Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for changes to fenced frames urns/attributes #48

Closed
gtanzer opened this issue Jul 28, 2022 · 2 comments
Closed

Proposal for changes to fenced frames urns/attributes #48

gtanzer opened this issue Jul 28, 2022 · 2 comments

Comments

@gtanzer
Copy link
Collaborator

gtanzer commented Jul 28, 2022

Previously, we talked about urn:uuids mapping to URLs. But this is a bit imprecise, because there was actually other metadata associated with those URLs, like reporting metadata for FLEDGE reportEvent(), budget metadata for sharedStorage, etc.

This proposal makes this explicit, saying that urn:uuids map to a set of attributes, one of which is the src attribute. And we can add additional attributes like width and height that allow consumer APIs to have more control over and flexibility with information flow for their particular use case. See this document for the full proposal.

Here is an existing issue about how the proposal affects FLEDGE: WICG/turtledove#312

We welcome feedback. 🙂

aarongable pushed a commit to chromium/chromium that referenced this issue Aug 15, 2022
This CL creates a struct to represent fenced frame inner properties, and
carries them in the browser from the urn mapping into the FrameTreeNode.
There will be a second refactor CL to eliminate the now-redundant
equivalents of these properties outside of the struct.

See WICG/fenced-frame#48

The second refactor is here: https://chromium-review.googlesource.com/c/chromium/src/+/3806500

Bug: 1347953
Change-Id: Ie26ba7f2c67f25c2304bd46259bd8646791d34fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3781046
Reviewed-by: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Garrett Tanzer <gtanzer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1035235}
@gtanzer
Copy link
Collaborator Author

gtanzer commented Sep 13, 2022

As a follow-up to the above proposal:

Previously, we conceptualized opaque identifiers as a means to map only a src. Therefore, it made sense to set them with the src attribute, and have them be strings (urn:uuids).

Given that these opaque identifiers have become and are continuing to become more expansive (describing more about the resulting fenced frame’s characteristics than just the resource URL), we don’t think it makes as much sense anymore to set them using the src attribute. Therefore, we are considering setting these opaque identifiers— which represent a “configuration”, “intent”, “set of properties”, or some other name subject to bikeshedding—using a new member of HTMLFencedFrameElement which is a WebIDL object. Because this new property need not be a string, we are also considering making the opaque identifier the WebIDL object’s reference (where some of the fields are opaque, as privacy requires for each use case).

For some examples of how this might look in practice:

// FLEDGE.
let frame = document.querySelector('fencedframe');
let config = await navigator.runAdAuction({ width: 100, height: 200, … });
frame.width = config.contentWidth;
frame.height = config.contentHeight;
frame.config = config;

// sharedStorage
let frame = document.querySelector('fencedframe');
let intent = await sharedStorage.selectURL({ width: 100, height: 200 },
[
  {url: '/url1', ...},
  {url: '/url2', ...}
]);
frame.width = config.contentWidth;
frame.height = config.contentHeight;
frame.config = config;

// Direct use (mostly for testing).
let frame = document.querySelector('fencedframe');
frame.config = new FencedFrameConfig({ url: 'https://www.example.com/' });

There would be a bit of complexity in migrating to this new approach for ongoing origin trials; it is likely that both urn:uuids and the new opaque identifier object would have to be supported simultaneously for some period of time.

@shivanigithub
Copy link
Collaborator

Closing since FencedFrameConfig is now part of the explainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants