Sfoglia il codice sorgente

LibWeb: Copy the css-attr-typed-fallback ref test as a layout test

As a layout test, this verifies that the fallback attr() substitution
results in the expected layout node. For example, the fallback content
for a `string` attribute type should create a text node.
Timothy Flynn 1 anno fa
parent
commit
4ced84a548

+ 38 - 0
Tests/LibWeb/Layout/expected/css-attr-typed-fallback.txt

@@ -0,0 +1,38 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+  BlockContainer <html> at (0,0) content-size 800x126 [BFC] children: not-inline
+    BlockContainer <body> at (8,8) content-size 784x110 children: not-inline
+      BlockContainer <div.string> at (9,9) content-size 100x20 children: inline
+        InlineNode <(anonymous)>
+          frag 0 from TextNode start: 0, length: 4, rect: [9,9 41.53125x17] baseline: 13.296875
+              "WHF!"
+          TextNode <#text>
+      BlockContainer <(anonymous)> at (8,30) content-size 784x0 children: inline
+        TextNode <#text>
+      BlockContainer <div.length> at (9,31) content-size 200x20 children: not-inline
+      BlockContainer <(anonymous)> at (8,52) content-size 784x0 children: inline
+        TextNode <#text>
+      BlockContainer <div.px> at (9,53) content-size 200x20 children: not-inline
+      BlockContainer <(anonymous)> at (8,74) content-size 784x0 children: inline
+        TextNode <#text>
+      BlockContainer <div.color> at (9,75) content-size 100x20 children: not-inline
+      BlockContainer <(anonymous)> at (8,96) content-size 784x0 children: inline
+        TextNode <#text>
+      BlockContainer <div.color> at (9,97) content-size 100x20 children: not-inline
+      BlockContainer <(anonymous)> at (8,118) content-size 784x0 children: inline
+        TextNode <#text>
+
+ViewportPaintable (Viewport<#document>) [0,0 800x600]
+  PaintableWithLines (BlockContainer<HTML>) [0,0 800x126]
+    PaintableWithLines (BlockContainer<BODY>) [8,8 784x110]
+      PaintableWithLines (BlockContainer<DIV>.string) [8,8 102x22]
+        InlinePaintable (InlineNode(anonymous))
+          TextPaintable (TextNode<#text>)
+      PaintableWithLines (BlockContainer(anonymous)) [8,30 784x0]
+      PaintableWithLines (BlockContainer<DIV>.length) [8,30 202x22]
+      PaintableWithLines (BlockContainer(anonymous)) [8,52 784x0]
+      PaintableWithLines (BlockContainer<DIV>.px) [8,52 202x22]
+      PaintableWithLines (BlockContainer(anonymous)) [8,74 784x0]
+      PaintableWithLines (BlockContainer<DIV>.color) [8,74 102x22]
+      PaintableWithLines (BlockContainer(anonymous)) [8,96 784x0]
+      PaintableWithLines (BlockContainer<DIV>.color) [8,96 102x22]
+      PaintableWithLines (BlockContainer(anonymous)) [8,118 784x0]

+ 26 - 0
Tests/LibWeb/Layout/input/css-attr-typed-fallback.html

@@ -0,0 +1,26 @@
+<!doctype html>
+<link rel="match" href="reference/css-attr-typed-ref.html" />
+<style>
+    div {
+        width: 100px;
+        height: 20px;
+        border: 1px solid black;
+    }
+    .string::before {
+        content: attr(foo string, "WHF!");
+    }
+    .length {
+        width: attr(foo length, 200px);
+    }
+    .px {
+        width: attr(foo px, 200px);
+    }
+    .color {
+        background-color: attr(foo color, lime);
+    }
+</style>
+<div class="string"></div>
+<div class="length" foo="90pizzas"></div>
+<div class="px" foo="twohundred"></div>
+<div class="color" foo="grunge"></div>
+<div class="color" foo="rgb(0,0,0)"></div>