Closed Bug 1829165 Opened 3 years ago Closed 2 years ago

[wpt-sync] Sync PR 39626 - Fix COOP:RP inheritance by bundling the origin that sets it

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED INVALID

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 39626 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/39626
Details from upstream follow.

Jonathan Hao <phao@chromium.org> wrote:

Fix COOP:RP inheritance by bundling the origin that sets it

Before this CL, whenever a cross-origin iframe opens a popup, it behaves
like noopener is used. To make the Cross-Origin-Opener-Policy: restrict-properties(COOP:RP) more useful, we'd like to keep the opener
connection between the iframe and the popup window, and decide whether
to swap browser instance when it navigates to an end-document. See https://github.com/hemeryar/coi-with-popups/blob/main/docs/cross_origin_iframe_popup.MD for why we do this.

  1. To keep the opener connection, we return false in
    COOPSuppressOpener when COOP=RP
  2. We bundle the COOP value with the origin that sets it, and use this
    origin in COOP algorithms because that origin represents the current
    browsing context group.
  3. Since we allow the popup's initial empty document to stay in the
    process, we had to restrict its crossOriginIsolated capability.
    Otherwise, a cross-origin iframe can get around permission policy that
    restricts it from using crossOriginIsolated APIs. In order to do this,
    we put the COOP bundle into the policy container so it is passed down to
    the renderer. We can then decide whether we need to restrict
    crossOriginIsolated.

Bug: 1385827
Change-Id: Ia4f45f949b30b6238568b22978f47a23dc1992fa
Reviewed-on: https://chromium-review.googlesource.com/4404116
WPT-Export-Revision: af07decb6e0a39dcb83a42a45bd5e6bce8949ffb

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.