mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:47:44 +00:00
LibWeb: Don't drop single <br/> lines
Previously, when having inline contexts consisting of just a `<br/>` tag, we would not create a line box. Ensure that there is always a line box when a line is explicitly being broken and also ensure it won't be trimmed due to being empty. This will a fix a number of sites that use `<br>` tags for layouts between block elements (even though the spec says they shouldn't).
This commit is contained in:
parent
2fe4be40af
commit
9927dab993
4 changed files with 29 additions and 2 deletions
8
Tests/LibWeb/Layout/expected/single-br-inline-layout.txt
Normal file
8
Tests/LibWeb/Layout/expected/single-br-inline-layout.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x37.46875 children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x21.46875 children: not-inline
|
||||
BlockContainer <div#begin> at (8,8) content-size 784x2 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,10) content-size 784x17.46875 children: inline
|
||||
line 0 width: 0, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
BreakNode <br>
|
||||
BlockContainer <div#end> at (8,27.46875) content-size 784x2 children: not-inline
|
15
Tests/LibWeb/Layout/input/single-br-inline-layout.html
Normal file
15
Tests/LibWeb/Layout/input/single-br-inline-layout.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<style>
|
||||
body {
|
||||
font-family: 'SerenitySans';
|
||||
}
|
||||
|
||||
#begin {
|
||||
height: 2px;
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
#end {
|
||||
height: 2px;
|
||||
background-color: red;
|
||||
}
|
||||
</style><div id="begin"></div><br><div id="end"></div>
|
Loading…
Add table
Add a link
Reference in a new issue