summaryrefslogtreecommitdiff
path: root/Tests/LibWeb/Layout
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-03-12 16:09:30 +0100
committerAndreas Kling <kling@serenityos.org>2023-03-12 18:10:32 +0100
commit7bb7d878070df22914ff0a8f659c559f4a054fc9 (patch)
tree58f9cd98d70a223ff4c04de38f59031ddb65e313 /Tests/LibWeb/Layout
parent7b55d79d3ad80064cb0415950e8cb6ee5c8d7087 (diff)
downloadserenity-7bb7d878070df22914ff0a8f659c559f4a054fc9.zip
LibWeb: Resolve percentage line-height values before CSS inheritance
Percentage line-height values are relative to 1em (i.e the font-size of the element). We have to resolve their computed values before proceeding with inheritance.
Diffstat (limited to 'Tests/LibWeb/Layout')
-rw-r--r--Tests/LibWeb/Layout/expected/css-line-height-percentage-inheritance.txt8
-rw-r--r--Tests/LibWeb/Layout/input/css-line-height-percentage-inheritance.html13
2 files changed, 21 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/css-line-height-percentage-inheritance.txt b/Tests/LibWeb/Layout/expected/css-line-height-percentage-inheritance.txt
new file mode 100644
index 0000000000..be7033268c
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/css-line-height-percentage-inheritance.txt
@@ -0,0 +1,8 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (1,1) content-size 798x52 children: not-inline
+ BlockContainer <body> at (10,10) content-size 780x34 children: not-inline
+ BlockContainer <div> at (11,11) content-size 778x32 children: inline
+ line 0 width: 552.109375, height: 32, bottom: 32, baseline: 27.992187
+ frag 0 from TextNode start: 0, length: 25, rect: [11,11 552.109375x32]
+ "The Linux Kernel Archives"
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/css-line-height-percentage-inheritance.html b/Tests/LibWeb/Layout/input/css-line-height-percentage-inheritance.html
new file mode 100644
index 0000000000..831ca6adaf
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/css-line-height-percentage-inheritance.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html><html><head><style>
+ * {
+ border: 1px solid black !important;
+ font-family: "SerenitySans";
+ }
+ html {
+ line-height: 200%;
+ font-size: 16px;
+ }
+ div {
+ font-size: 40px;
+ }
+</style></head><body><div>The Linux Kernel Archives \ No newline at end of file