From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../the-img-element/srcset/common.js | 25 +++ .../srcset/parse-a-srcset-attribute.html | 245 +++++++++++++++++++++ .../srcset/select-an-image-source.html | 20 ++ 3 files changed, 290 insertions(+) create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset') diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js new file mode 100644 index 000000000..d4d2c7534 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js @@ -0,0 +1,25 @@ +setup({explicit_done:true}); + +function check(img) { + var name = format_value(img.getAttribute('srcset')); + if (img.hasAttribute('sizes')) { + name += ' sizes=' + format_value(img.getAttribute('sizes')); + } + if (img.hasAttribute('data-desc')) { + name += ' (' + img.getAttribute('data-desc') + ')'; + } + test(function() { + var expect = img.dataset.expect; + if ('resolve' in img.dataset) { + var a = document.createElement('a'); + a.href = expect; + expect = a.href; + } + assert_equals(img.currentSrc, expect); + }, name); +} + +onload = function() { + [].forEach.call(document.images, check); + done(); +}; diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html new file mode 100644 index 000000000..ce1e4cebe --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html @@ -0,0 +1,245 @@ + +img parse a srcset attribute + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html new file mode 100644 index 000000000..292395d3a --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html @@ -0,0 +1,20 @@ + +img select an image source + + + +
+ + + + + + + + + + + + + + -- cgit v1.2.3