mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
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.
This commit is contained in:
parent
4a3497e9cd
commit
4ced84a548
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/trflynn89
Commit: 4ced84a548
Pull-request: https://github.com/SerenityOS/serenity/pull/23985
Issue: https://github.com/SerenityOS/serenity/issues/23939
2 changed files with 64 additions and 0 deletions
38
Tests/LibWeb/Layout/expected/css-attr-typed-fallback.txt
Normal file
38
Tests/LibWeb/Layout/expected/css-attr-typed-fallback.txt
Normal file
|
@ -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
Tests/LibWeb/Layout/input/css-attr-typed-fallback.html
Normal file
26
Tests/LibWeb/Layout/input/css-attr-typed-fallback.html
Normal file
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue