Skip to content

Truly independent web browser

LibWeb: Add test for line boxes next to a float outside the BFC root

Andreas Kling9d875b4310a8
diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/line-boxes-avoid-left-float-lying-outside-bfc-root.txt b/Tests/LibWeb/Layout/expected/block-and-inline/line-boxes-avoid-left-float-lying-outside-bfc-root.txt
new file mode 100644
index 00000000000..5acb32ade55
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/block-and-inline/line-boxes-avoid-left-float-lying-outside-bfc-root.txt
@@ -0,0 +1,23 @@
+Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline
+ BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
+ BlockContainer <body> at [0,0] [0+0+0 800 0+0+0] [0+0+0 20 0+0+0] children: not-inline
+ BlockContainer <div> at [0,0] [0+0+0 300 0+0+500] [0+0+0 20 0+0+0] children: not-inline
+ BlockContainer <(anonymous)> at [0,0] [0+0+0 300 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ BlockContainer <div> at [-300,0] [-300+0+0 900 0+0+-300] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ BlockContainer <div> at [-300,0] floating [0+0+0 295 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
+ TextNode <#text> (not painted)
+ BlockContainer <(anonymous)> at [0,0] [0+0+0 300 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ BlockContainer <div> at [-20,0] [-20+0+0 320 0+0+0] [0+0+0 20 0+0+0] children: inline
+ frag 0 from TextNode start: 0, length: 4, rect: [-20,0 40.1875x20] baseline: 16
+ "text"
+ TextNode <#text> (not painted)
+ BlockContainer <(anonymous)> at [0,20] [0+0+0 300 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ BlockContainer <(anonymous)> at [0,20] [0+0+0 800 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+
+SC for Viewport<#document> [0,0 800x600] (z-index: auto)
+ SC for BlockContainer<HTML> [0,0 800x50] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/line-boxes-avoid-left-float-lying-outside-bfc-root.html b/Tests/LibWeb/Layout/input/block-and-inline/line-boxes-avoid-left-float-lying-outside-bfc-root.html
new file mode 100644
index 00000000000..dfc00d6fd8f
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/line-boxes-avoid-left-float-lying-outside-bfc-root.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<style>
+ body {
+ margin: 0;
+ font: 20px SerifPro;
+ }
+</style>
+<div style="width: 300px">
+ <div style="width: 900px; margin-left: -300px">
+ <div style="float: left; width: 295px; height: 50px"></div>
+ </div>
+ <div style="margin-left: -20px">text</div>
+</div>