Skip to content

[Spec] Allow setting automatic beacon data from cross-origin subframes. - #203

Merged
blu25 merged 10 commits into
masterfrom
liam-cross-origin-beacon-changes
Jan 22, 2025
Merged

[Spec] Allow setting automatic beacon data from cross-origin subframes.#203
blu25 merged 10 commits into
masterfrom
liam-cross-origin-beacon-changes

Conversation

@blu25

@blu25 blu25 commented Jan 8, 2025

Copy link
Copy Markdown
Collaborator

This PR modifies the automatic beacon algorithms to support data being set from frames that are cross-origin to the fenced frame config's mapped URL. More specifically, this makes the following modifications:

  • setReportEventDataForAutomaticBeacons() is modified to allow data to be set from cross-origin subframes, but only if the data's crossOriginExposed parameter is set to true.
  • A new snapshot automatic beacon mapping type is introduced that contains 2 mappings. The first mapping is the same as the existing automatic beacon data map. The second mapping only contains automatic beacon data whose crossOriginExposed parameter is set to true. This is needed since, as part of this change, cross-origin subframes that trigger automatic beacons will now use the first cross-origin exposed data it finds up the frame tree, versus the first data it finds regardless of whether it is cross-origin exposed or not (which it wouldn't be able to use).
  • The attempt to send an automatic beacon algorithm now checks either the "all data mapping" or the "cross-origin only mapping" based on whether the automatic beacon initiator is cross-origin to the fenced frame config's mapped URL. This will ensure that if an ancestor has usable data, it won't accidentally grab data from a closer ancestor that can't be used. This also has a side effect of letting us remove the |should send beacon with data| variable, as the same behavior is now obtained by simply checking the cross-origin only data mapping.
  • The get the automatic beacon data mapping to use is renamed and modified to read data into both the regular mapping and the cross-origin only mapping.

Preview | Diff

Comment thread spec.bs Outdated
/fenced-frame/automatic-beacon-use-ancestor-data.https.html
</wpt>

TODO: Add the following tests:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is blocking merge right?

@blu25 blu25 Jan 9, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. This isn't ready for review yet. I just uploaded this so I could see a visual diff.

I'm also running into issues with the tests not being found. I tried running bikeshed update --skip-manifest and got this error:

FATAL ERROR: Bikeshed currently only knows how to handle WPT v8 manifest data, but got v9. Please report this to the maintainer!

I think I have the latest release installed (4.2.8) so adding any new WPTs to the spec might be blocked until that gets patched.

@blu25
blu25 requested a review from VergeA January 16, 2025 22:29
Comment thread spec.bs Outdated
Comment thread spec.bs Outdated

@VergeA VergeA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, thanks! Assuming it compiles after the Bikeshed fix you're waiting on goes in.

@domfarolino domfarolino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to defer to @VergeA's review here since the annals of the cross-origin automatic beacon work is slightly beyond me at this point, but from looking at the PR nothing major sticks out.

Comment thread spec.bs Outdated
Comment thread spec.bs Outdated
@blu25
blu25 marked this pull request as ready for review January 22, 2025 15:30
@blu25
blu25 merged commit f345c10 into master Jan 22, 2025
@blu25
blu25 deleted the liam-cross-origin-beacon-changes branch January 22, 2025 15:34
github-actions Bot added a commit that referenced this pull request Jan 22, 2025
…s. (#203)

SHA: f345c10
Reason: push, by blu25

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants