diff options
author | Andreas Kling <kling@serenityos.org> | 2023-03-10 22:06:20 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-11 10:46:26 +0100 |
commit | f97754942c57117c07b3d369fa23d12c38828583 (patch) | |
tree | 1badb09172adf9b37c46e32066167e1115173d30 /Tests | |
parent | 1cf5737e9e18001ec810204c382cad226f9fc9ee (diff) | |
download | serenity-f97754942c57117c07b3d369fa23d12c38828583.zip |
LibWeb: Collapse margin-left with space used by left-side floats
We had an issue where boxes with margin-left were shifted right by
left-side floats twice instead of just once.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/LibWeb/Layout/expected/ifc-float-left-and-sibling-with-margin-left.txt | 9 | ||||
-rw-r--r-- | Tests/LibWeb/Layout/input/ifc-float-left-and-sibling-with-margin-left.html | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/ifc-float-left-and-sibling-with-margin-left.txt b/Tests/LibWeb/Layout/expected/ifc-float-left-and-sibling-with-margin-left.txt new file mode 100644 index 0000000000..efc8ed23b4 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/ifc-float-left-and-sibling-with-margin-left.txt @@ -0,0 +1,9 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer <html> at (1,1) content-size 798x61 children: not-inline + BlockContainer <body> at (10,10) content-size 780x19.46875 children: not-inline + BlockContainer <div.thumbnail> at (11,11) content-size 50x50 floating children: not-inline + BlockContainer <div.title> at (91,11) content-size 698x17.46875 children: inline + line 0 width: 125.125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 14, rect: [91,11 125.125x17.46875] + "Chrono Trigger" + TextNode <#text> diff --git a/Tests/LibWeb/Layout/input/ifc-float-left-and-sibling-with-margin-left.html b/Tests/LibWeb/Layout/input/ifc-float-left-and-sibling-with-margin-left.html new file mode 100644 index 0000000000..d44e5f5ce4 --- /dev/null +++ b/Tests/LibWeb/Layout/input/ifc-float-left-and-sibling-with-margin-left.html @@ -0,0 +1,16 @@ +<!DOCTYPE html><html><head><style> + * { + border: 1px solid black; + font-family: 'SerenitySans'; + } + .thumbnail { + float: left; + width: 50px; + height: 50px; + background-color: pink; + } + .title { + margin-left: 80px; + background-color: orange; + } +</style></head><body><div class="thumbnail"></div><div class="title">Chrono Trigger
\ No newline at end of file |