Automatic update from web-platform-tests Revert "Update enablement approach for sec-ch-width tests" This reverts commit 0cc26e2b517e84e599540c2f13260726c7c6c159. Reason for revert: Spec was updated to use http-equiv after all: https://github.com/WICG/client-hints-infrastructure/issues/159 Original change's description: > Update enablement approach for sec-ch-width tests > > There are some higher-level interop/spec issues with how to enable > sec-ch-width. This patch switches the tests to use name="Delegate-CH", > which is per-spec [1], as well as sending the Accept-CH header. > > [1] https://wicg.github.io/client-hints-infrastructure/#delegate-ch-algo > > Bug: 335630145 > Change-Id: Id37303bce2fb73c85505262cc5543e23701bd091 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5548997 > Commit-Queue: Philip Rogers <pdr@chromium.org> > Reviewed-by: Traian Captan <tcaptan@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1303438} Bug: 335630145 Change-Id: I890fc0dc9faa1d6fa8140ba56199c18fb687f36e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5555162 Auto-Submit: Philip Rogers <pdr@chromium.org> Commit-Queue: Traian Captan <tcaptan@chromium.org> Reviewed-by: Traian Captan <tcaptan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1304037} -- wpt-commits: 9036de52d5ef50db887553fd4602955cb7ca269d wpt-pr: 46405
25 lines
876 B
HTML
25 lines
876 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Delegate-CH" content="Sec-CH-Width">
|
|
<title>Tests Sec-CH-Width</title>
|
|
<link rel="help" href="https://wicg.github.io/responsive-image-client-hints/#sec-ch-width">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<script>
|
|
setup({explicit_done: true});
|
|
|
|
function run() {
|
|
test(() => {
|
|
const testImage = document.getElementsByTagName('img')[0];
|
|
// Spec: sec-ch-width MUST be an integer greater than or equal to 0.
|
|
const width = Math.ceil(0.10 * innerWidth * devicePixelRatio);
|
|
assert_equals(testImage.naturalWidth, 2 * width);
|
|
assert_equals(testImage.naturalHeight, 3 * width);
|
|
}, 'Sec-CH-Width should be set');
|
|
done();
|
|
}
|
|
</script>
|
|
|
|
<img onload="run()" src="resources/2x3-svg-scaled-by-sec-ch-width.py" sizes="10vw">
|