[Spec] Allow setting automatic beacon data from cross-origin subframes. #203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'scrossOriginExposed
parameter is set totrue
.snapshot automatic beacon mapping
type is introduced that contains 2 mappings. The first mapping is the same as the existingautomatic beacon data map
. The second mapping only contains automatic beacon data whosecrossOriginExposed
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).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.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