summaryrefslogtreecommitdiff
path: root/Tests/LibWeb/Layout
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-02 06:51:32 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-02 11:47:13 +0200
commit00e3e82bbd5a01878331caa55ae9fd90a4839cb0 (patch)
tree630c3eee6c31d413550dd32c52a950280ba788be /Tests/LibWeb/Layout
parentdeea7cbc117ba8debe1c54dee1ec3d334b240756 (diff)
downloadserenity-00e3e82bbd5a01878331caa55ae9fd90a4839cb0.zip
LibWeb: Account for box-sizing:border-box in layout-less definite sizes
When we determine that a size is definite because it can be resolved now without performing layout, we also need to account for the box-sizing property. This lets us remove a hack from flex layout where box-sizing:border-box was manually undone at one point in the layout algorithm.
Diffstat (limited to 'Tests/LibWeb/Layout')
-rw-r--r--Tests/LibWeb/Layout/expected/box-sizing-border-box-for-definite-sizes-without-layout.txt11
-rw-r--r--Tests/LibWeb/Layout/input/box-sizing-border-box-for-definite-sizes-without-layout.html14
2 files changed, 25 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/box-sizing-border-box-for-definite-sizes-without-layout.txt b/Tests/LibWeb/Layout/expected/box-sizing-border-box-for-definite-sizes-without-layout.txt
new file mode 100644
index 0000000000..f79242478a
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/box-sizing-border-box-for-definite-sizes-without-layout.txt
@@ -0,0 +1,11 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x66 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x50 children: inline
+ line 0 width: 89.726562, height: 50, bottom: 50, baseline: 16.914062
+ frag 0 from Box start: 0, length: 0, rect: [28,38 49.726562x0]
+ Box <div.button> at (28,38) content-size 49.726562x0 flex-container(row) children: not-inline
+ BlockContainer <(anonymous)> at (28,27.082031) content-size 49.726562x21.835937 flex-item children: inline
+ line 0 width: 49.726562, height: 21.835937, bottom: 21.835937, baseline: 16.914062
+ frag 0 from TextNode start: 0, length: 5, rect: [28,27.082031 49.726562x21.835937]
+ "Hello"
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/box-sizing-border-box-for-definite-sizes-without-layout.html b/Tests/LibWeb/Layout/input/box-sizing-border-box-for-definite-sizes-without-layout.html
new file mode 100644
index 0000000000..0911ac1b2a
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/box-sizing-border-box-for-definite-sizes-without-layout.html
@@ -0,0 +1,14 @@
+<!doctype html><html><head><style>
+ * {
+ font: 20px SerenitySans;
+ }
+ .button {
+ align-items: center;
+ background-color: orange;
+ display: inline-flex;
+ height: 30px;
+ padding: 20px;
+ font-size: 20px;
+ box-sizing: border-box;
+ }
+</style></head><body><div class="button">Hello \ No newline at end of file