-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Stop inserting inline nodes into a generated wrapper box
493dd5d caused the `::before` pseudo-element node to be inserted before the element's content, which caused issues with how we determine where to insert inline nodes into the layout tree. At the time, I noticed the issue with contents of flex containers, and prevented them from merging into a `::before` box. However, a similar situation happens when we're not in a flex container, but the pseudo-element has `display: block`. This commit fixes that situation by using the same logic in both places, so a similar mistake can't be made again. This fixes the tab text being invisible on GitHub project pages. :^)
- Loading branch information
1 parent
068f677
commit 1132c85
Showing
3 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...s/LibWeb/Layout/expected/block-and-inline/inline-node-not-inserted-into-generated-box.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline | ||
BlockContainer <html> at (0,0) content-size 800x50.9375 [BFC] children: not-inline | ||
BlockContainer <body> at (8,8) content-size 784x34.9375 children: not-inline | ||
BlockContainer <(anonymous)> at (8,8) content-size 784x17.46875 children: inline | ||
line 0 width: 27.15625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 | ||
frag 0 from TextNode start: 0, length: 3, rect: [8,8 27.15625x17.46875] | ||
"foo" | ||
TextNode <#text> | ||
BlockContainer <(anonymous)> at (8,25.46875) content-size 784x17.46875 children: inline | ||
line 0 width: 27.640625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 | ||
frag 0 from TextNode start: 0, length: 3, rect: [8,25.46875 27.640625x17.46875] | ||
"bar" | ||
TextNode <#text> | ||
|
||
ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x50.9375] | ||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x34.9375] | ||
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x17.46875] | ||
TextPaintable (TextNode<#text>) | ||
PaintableWithLines (BlockContainer(anonymous)) [8,25.46875 784x17.46875] | ||
TextPaintable (TextNode<#text>) |
6 changes: 6 additions & 0 deletions
6
Tests/LibWeb/Layout/input/block-and-inline/inline-node-not-inserted-into-generated-box.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html><style> | ||
body::before { | ||
content: "foo"; | ||
display: block; | ||
} | ||
</style><body>bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters