Automatic update from web-platform-tests Enforce integrity() URL modifier for CSS resources Add SRI enforcement for the CSS integrity() URL modifier so that resources with a non-matching hash are blocked from rendering. Bug: 435625756 Change-Id: I852fd6ae3b5d93a9c6c5a38cf1979e99731d92cf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7748032 Reviewed-by: Fredrik Söderquist <fs@opera.com> Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: jj <jj@chromium.org> Cr-Commit-Position: refs/heads/main@{#1618868} -- wpt-commits: bf4d00e68bc328afb453ce53706a014e4b1ca5b1 wpt-pr: 59381
21 lines
851 B
HTML
21 lines
851 B
HTML
<!DOCTYPE html>
|
|
<title>Request URL Modifiers: integrity() for @font-face</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-values-5/#typedef-request-url-modifier-integrity-modifier">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<style>
|
|
@font-face {
|
|
font-family: "TestFont";
|
|
src: url("http://{{hosts[][]}}:{{ports[http][1]}}/fonts/Ahem.ttf" cross-origin(anonymous) integrity("sha256-txnssxxbIfxXPAP2Qhx0rGPCcaWj/4QeNPlwX7lLhEg=")) format("truetype");
|
|
}
|
|
.test { font-family: "TestFont" }
|
|
</style>
|
|
<div class="test">X</div>
|
|
<script>
|
|
promise_test(async t => {
|
|
await document.fonts.ready;
|
|
const loaded = document.fonts.check("16px TestFont");
|
|
assert_true(loaded, "Font with matching integrity should load");
|
|
}, "integrity() with correct hash allows font loading");
|
|
</script>
|