gecko-dev/testing/web-platform/tests/client-hints/image-with-dpr-header.html
Rune Lillesveen aec891f144 Bug 1499368 [wpt PR 13542] - Don't propagate root/body background to viewport for display:none., a=testonly
Automatic update from web-platform-testsDon't propagate root/body background to viewport for display:none.

According to the specification, we should not paint backgrounds for
html or body on the viewport if they are display:none [1].

[1] https://drafts.csswg.org/css-backgrounds/#special-backgrounds

Bug: 895757
Change-Id: Ia975022e3bfa849298667f72908a64c0d5331872
Reviewed-on: https://chromium-review.googlesource.com/c/1283134
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599990}

--

wpt-commits: 6aa79dbab74eee1e2112908cd150514942bdac36
wpt-pr: 13542


--HG--
rename : testing/web-platform/tests/tools/lint/tests/dummy/ref/about_blank-ref.html => testing/web-platform/tests/tools/lint/tests/dummy/about_blank.html
2018-11-07 14:40:16 +00:00

36 lines
2.5 KiB
HTML

<!DOCTYPE html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<img id="int_dpr" src="resources/dpr.py?name=square.png&mimeType=image/png&dpr=4.0">
<img id="fractional_dpr" src="resources/dpr.py?name=square.png&mimeType=image/png&dpr=2.5">
<img id="smaller_than_one" src="resources/dpr.py?name=square.png&mimeType=image/png&dpr=0.5">
<img id="srcset" srcset="resources/square.png 4x">
<img id="invalid" src="resources/dpr.py?name=square.png&mimeType=image/png&dpr=xx">
<img id="header_and_srcset_invalid" srcset="resources/dpr.py?name=square.png&mimeType=image/png&dpr=xx 4x">
<img id="header_and_srcset_valid" srcset="resources/dpr.py?name=square.png&mimeType=image/png&dpr=4.0 2x">
<img id="explicit_width" src="resources/dpr.py?name=square.png&mimeType=image/png&dpr=4.0" width="100" height="100">
<img id="double_dpr" src="resources/dpr.py?name=square.png&mimeType=image/png&dpr=4.0&double=4.0">
<img id="double_dpr_different_values" src="resources/dpr.py?name=square.png&mimeType=image/png&dpr=4.0&double=2.5">
<script>
let run_test = () => {
test(() => {
assert_equals(document.getElementById("int_dpr").naturalWidth, 25, "Integer Content-DPR header value")
assert_equals(document.getElementById("fractional_dpr").naturalWidth, 40, "Fractional Content-DPR header value")
assert_equals(document.getElementById("smaller_than_one").naturalWidth, 200, "Smaller than one Content-DPR header value")
assert_equals(document.getElementById("srcset").naturalWidth, 25, "srcset")
assert_equals(document.getElementById("invalid").naturalWidth, 100, "Invalid Content-DPR header value")
assert_equals(document.getElementById("header_and_srcset_invalid").naturalWidth, 25, "Invalid Content-DPR header value with valid srcset")
assert_equals(document.getElementById("header_and_srcset_valid").naturalWidth, 25, "Value Content-DPR header value and srcset")
assert_equals(document.getElementById("explicit_width").naturalWidth, 25, "Explicit width attribute")
assert_equals(document.getElementById("double_dpr").naturalWidth, 25, "Double Content-DPR header")
assert_equals(document.getElementById("double_dpr_different_values").naturalWidth, 40, "Double Content-DPR header different values")
}, "Test the image dimensions of different DPR sizes");
}
window.addEventListener("load", run_test);
</script>
</body>
</html>