summaryrefslogtreecommitdiff
path: root/Tests/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-03-25 17:20:52 +0100
committerAndreas Kling <kling@serenityos.org>2023-03-25 19:41:31 +0100
commit4bf10674fad03dee16447aca113efc66c2039de1 (patch)
tree8c8d99b6535ca98990c0d11da936e49d2a17cf77 /Tests/LibWeb
parent3f6f3966b91c364c3bd39f6c7271a20b9ef92de1 (diff)
downloadserenity-4bf10674fad03dee16447aca113efc66c2039de1.zip
LibWeb: Don't allow resolved height of abspos elements to become negative
We have to clamp the resulting height to 0 when solving for it.
Diffstat (limited to 'Tests/LibWeb')
-rw-r--r--Tests/LibWeb/Layout/expected/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.txt5
-rw-r--r--Tests/LibWeb/Layout/input/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.html11
2 files changed, 16 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.txt b/Tests/LibWeb/Layout/expected/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.txt
new file mode 100644
index 0000000000..c00e615415
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.txt
@@ -0,0 +1,5 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x0 children: not-inline
+ BlockContainer <body.outer> at (8,8) content-size 0x0 positioned children: not-inline
+ BlockContainer <div.inner> at (9,9) content-size 0x0 positioned children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.html b/Tests/LibWeb/Layout/input/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.html
new file mode 100644
index 0000000000..8f08ee3495
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/automatic-height-of-non-replaced-abspos-element-must-not-be-negative.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html><html><head><style>
+ .outer {
+ position: absolute;
+ }
+ .inner {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ border: 1px solid black;
+ }
+</style></head><body class="outer"><div class="inner">