Commit e1f4ac81 authored by Pâris Meuleman's avatar Pâris Meuleman Committed by Commit Bot

Set popup name to null when COOP triggers a popup with noopener

If a main frame is COOP and a cross origin iframe tries to open a
popup, that popup will have the noopener attribute. When that's the
case, the popup should not have any name, and any parameter set during
its creation should be ignored.

Bug: 1060691
Change-Id: Ibb73a4b0fcf6b9d40041ed6534a8fafd8a90b499
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2098702
Commit-Queue: Pâris Meuleman <pmeuleman@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749636}
parent 215014dd
...@@ -4502,6 +4502,10 @@ void RenderFrameHostImpl::CreateNewWindow( ...@@ -4502,6 +4502,10 @@ void RenderFrameHostImpl::CreateNewWindow(
if (top_level_opener->cross_origin_opener_policy() == if (top_level_opener->cross_origin_opener_policy() ==
network::mojom::CrossOriginOpenerPolicy::kSameOrigin) { network::mojom::CrossOriginOpenerPolicy::kSameOrigin) {
params->opener_suppressed = true; params->opener_suppressed = true;
// The frame name should not be forwarded to a noopener popup.
// TODO(https://crbug.com/1060691) This should be applied to all
// popups opened with noopener.
params->frame_name.clear();
} }
} }
} }
......
This is a testharness.js-based test.
PASS same-origin with SAME_ORIGIN iframe opening popup a SAME_ORIGIN with COOP:
FAIL same-origin with SAME_SITE iframe opening popup a SAME_ORIGIN with COOP: assert_equals: name expected "" but got "SAME_SITE_iframe_opening_SAME_ORIGIN_popup_with_coop_"
FAIL same-origin with CROSS_ORIGIN iframe opening popup a SAME_ORIGIN with COOP: assert_equals: name expected "" but got "CROSS_ORIGIN_iframe_opening_SAME_ORIGIN_popup_with_coop_"
PASS same-origin with SAME_ORIGIN iframe opening popup a SAME_SITE with COOP:
FAIL same-origin with SAME_SITE iframe opening popup a SAME_SITE with COOP: assert_equals: name expected "" but got "SAME_SITE_iframe_opening_SAME_SITE_popup_with_coop_"
FAIL same-origin with CROSS_ORIGIN iframe opening popup a SAME_SITE with COOP: assert_equals: name expected "" but got "CROSS_ORIGIN_iframe_opening_SAME_SITE_popup_with_coop_"
PASS same-origin with SAME_ORIGIN iframe opening popup a CROSS_ORIGIN with COOP:
FAIL same-origin with SAME_SITE iframe opening popup a CROSS_ORIGIN with COOP: assert_equals: name expected "" but got "SAME_SITE_iframe_opening_CROSS_ORIGIN_popup_with_coop_"
FAIL same-origin with CROSS_ORIGIN iframe opening popup a CROSS_ORIGIN with COOP: assert_equals: name expected "" but got "CROSS_ORIGIN_iframe_opening_CROSS_ORIGIN_popup_with_coop_"
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment