Files
firefox/testing/web-platform/tests/shared-storage/shared-storage-writable-img-content-attribute.tentative.https.sub.html
Camillia Smith Barnes 1c340d0e5d Bug 1846908 [wpt PR 41312] - Shared Storage: Add image attribute for response header writes, a=testonly
Automatic update from web-platform-tests
Shared Storage: Add image attribute for response header writes

We add an IDL mixin interface `HTMLSharedStorageWritableElementUtils`
with boolean attribute `sharedStorageWritable`, and include it in
`HTMLImageElement`. A later CL (https://crrev.com/c/4717613) will
include it in `HTMLIFrameElement` as well.

The value of the new IDL attribute is plumbed to
`blink::ResourceRequest::shared_storage_writable_`.
From that point, the existing infrastructure for writing to
shared storage from `fetch(<url>, {sharedStorageWritable: true})`
will be used to propagate the value to `network::ResourceRequest` and
so forth.

This is part of a project to add support to writing to shared storage
from response headers. See
https://github.com/WICG/shared-storage/pull/70 for more information
and https://crrev.com/c/4691573 for a prototype for adding image and
iframe attributes.

Browser tests are added in https://crrev.com/c/4717731.

Bug: 1434529,1218540
Change-Id: Ide0b91211e3c24988e998f2a1b3f0f32066768a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718689
Reviewed-by: Yao Xiao <[email protected]>
Commit-Queue: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1183714}

--

wpt-commits: dc286a5b297af8d612fc4e7219cd5404a3eb59d0
wpt-pr: 41312
2023-08-25 09:12:57 +00:00

23 lines
1.1 KiB
HTML

<!doctype html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/utils.js></script>
<script src=/fenced-frame/resources/utils.js></script>
<script src=/shared-storage/resources/util.js></script>
<img src="/shared-storage/resources/shared-storage-writable-pixel.png?key=hello&value=world" sharedstoragewritable></img>
<img src="/shared-storage/resources/shared-storage-writable-pixel.png?key=wont&value=set"></img>
<img src="/shared-storage/resources/shared-storage-writable-pixel.png?key=goodnight&value=moon" sharedstoragewritable></img>
<script>
const sameOrigin = new URL("", location.href).origin;
promise_test(async t => {
await verifyKeyValueForOrigin('hello', 'world', sameOrigin);
await verifyKeyNotFoundForOrigin('wont', sameOrigin);
await verifyKeyValueForOrigin('goodnight', 'moon', sameOrigin);
await deleteKeyForOrigin('hello', sameOrigin);
await deleteKeyForOrigin('goodnight', sameOrigin);
}, 'test <img sharedstoragewritable src=[url]> for same origin img');
</script>
</body>