summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorAndi Gallo <andigallo@proton.me>2023-05-28 04:40:27 +0000
committerAndreas Kling <kling@serenityos.org>2023-05-28 12:11:10 +0200
commit29d29134baa95e772b07aad2eac0b91970205af8 (patch)
treeac2713d456e102b9a4e6b2d22fc625ce3d026404 /Tests
parent87ac906ee679043421f27617cc3822ebc9524622 (diff)
downloadserenity-29d29134baa95e772b07aad2eac0b91970205af8.zip
LibWeb: Skip children based on media when updating the source set
If child has a media attribute and its value does not match the environment, continue to the next child.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWeb/Layout/expected/picture-source-media-query.txt13
-rw-r--r--Tests/LibWeb/Layout/input/120.pngbin0 -> 572 bytes
-rw-r--r--Tests/LibWeb/Layout/input/400.pngbin0 -> 592 bytes
-rw-r--r--Tests/LibWeb/Layout/input/picture-source-media-query.html11
4 files changed, 24 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/picture-source-media-query.txt b/Tests/LibWeb/Layout/expected/picture-source-media-query.txt
new file mode 100644
index 0000000000..7049945dd6
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/picture-source-media-query.txt
@@ -0,0 +1,13 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x416 [BFC] children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x400 children: inline
+ line 0 width: 400, height: 400, bottom: 400, baseline: 400
+ frag 0 from ImageBox start: 0, length: 0, rect: [8,8 400x400]
+ TextNode <#text>
+ InlineNode <picture>
+ TextNode <#text>
+ InlineNode <source>
+ TextNode <#text>
+ ImageBox <img> at (8,8) content-size 400x400 children: not-inline
+ TextNode <#text>
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/120.png b/Tests/LibWeb/Layout/input/120.png
new file mode 100644
index 0000000000..c021943f7f
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/120.png
Binary files differ
diff --git a/Tests/LibWeb/Layout/input/400.png b/Tests/LibWeb/Layout/input/400.png
new file mode 100644
index 0000000000..adbdc22561
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/400.png
Binary files differ
diff --git a/Tests/LibWeb/Layout/input/picture-source-media-query.html b/Tests/LibWeb/Layout/input/picture-source-media-query.html
new file mode 100644
index 0000000000..fbc7660337
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/picture-source-media-query.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+
+<body>
+ <picture>
+ <source media="(max-width: 600px)" srcset="120.png">
+ <img src="400.png">
+ </picture>
+</body>
+
+</html> \ No newline at end of file