Przeglądaj źródła

Tests/LibWeb: Add two tests for lh and rlh units

Simon Wanner 2 lat temu
rodzic
commit
482fa2d4e2

+ 6 - 0
Tests/LibWeb/Layout/expected/lh-1.txt

@@ -0,0 +1,6 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+  BlockContainer <html> at (0,0) content-size 800x116 children: not-inline
+    BlockContainer <body> at (8,8) content-size 784x100 children: not-inline
+      BlockContainer <div#a> at (8,8) content-size 100x100 children: not-inline
+        BlockContainer <div#b> at (8,8) content-size 100x100 children: inline
+          TextNode <#text>

+ 6 - 0
Tests/LibWeb/Layout/expected/lh-2.txt

@@ -0,0 +1,6 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+  BlockContainer <html> at (0,0) content-size 800x116 children: not-inline
+    BlockContainer <body> at (8,8) content-size 784x100 children: not-inline
+      BlockContainer <div#a> at (8,8) content-size 100x100 children: not-inline
+        BlockContainer <div#b> at (8,8) content-size 100x100 children: inline
+          TextNode <#text>

+ 23 - 0
Tests/LibWeb/Layout/input/lh-1.html

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<head><style>
+* {
+    font-family: SerenitySans;
+}
+:root {
+    font-size: 20px;
+    line-height: 2;
+}
+#a {
+    background-color: red;
+    width: 100px;
+    height: 100px;
+}
+#b {
+    background-color: green;
+    font-size: 50px;
+    line-height: 100%;
+    width: 2lh;
+    height: 2.5rlh;
+}
+</style>
+<body><div id="a"><div id="b">

+ 22 - 0
Tests/LibWeb/Layout/input/lh-2.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<head><style>
+* {
+    font-family: SerenitySans;
+}
+:root {
+    font-size: 20px;
+    line-height: 2;
+}
+#a {
+    background-color: red;
+    width: 100px;
+    height: 100px;
+}
+#b {
+    background-color: green;
+    line-height: 50px;
+    width: 2lh;
+    height: 2.5rlh;
+}
+</style>
+<body><div id="a"><div id="b">