From 6b200c36eddce40147961173ac5a371a03650185 Mon Sep 17 00:00:00 2001
From: Andrew Williams
To get an element's noopener, given an a
, area
, or
- form
element element and a string target:
form
element element, a string url, and a string
+ target, perform the following steps. They return a boolean.
If element's link types include the
ASCII case-insensitive match for "
_blank
", then return
true.
Let maybeURL be the result of encoding-parsing a URL given + url.
If maybeURL is not failure and maybeURL's
+ scheme is "blob
", run these
+ steps:
Let blobOrigin be maybeURL's + blob URL entry's + environment settings object's origin.
Let topLevelOrigin be element's node navigable's + active document's relevant settings object's + top-level origin.
If blobOriginis not same site with topLevelOrigin, + then return true.
Return false.
The window open steps, given a string url, a string target, - and a string features, are as follows:
+To get noopener for window open, given a string url, a + Document sourceDocument, an ordered map + tokenizedFeatures, and a boolean noreferrer, perform the following steps. + They return a boolean.
If the event loop's termination nesting level is nonzero, - return null.
If noreferrer is true, return true.
Let sourceDocument be the entry global object's associated Document
.
Let maybeURL be the result of encoding-parsing a URL given + url.
If target is the empty string, then set target to "_blank
".
If maybeURL is not failure and maybeURL's
+ scheme is "blob
", run these
+ steps:
Let tokenizedFeatures be the result of tokenizing features.
Let blobOrigin be maybeURL's + blob URL entry's + environment settings object's origin. + +
Let topLevelOrigin be sourceDocument's node navigable's + active document's relevant settings object's + top-level origin.
Let noopener and noreferrer be false.
If blobOriginis not same site with topLevelOrigin, + then return true.
Let noopener be false.
If tokenizedFeatures["noopener
"] associated Document
.
If target is the empty string, then set target to "_blank
".
Let tokenizedFeatures be the result of tokenizing features.
Let noreferrer be false.
If tokenizedFeatures["noreferrer
"] exists, then:
Let noopener be the result of + getting noopener for window open with + url, sourceDocument, tokenizedFeatures, and + noreferrer.
Let referrerPolicy be the empty string.
If noreferrer is true, then set noopener to true and set
- referrerPolicy to "no-referrer
".
If noreferrer is true, then set referrerPolicy to
+ "no-referrer
".
Let targetNavigable and windowType be the result of applying the
From 4786e670fbc63a7de284b6acb69aa270469566af Mon Sep 17 00:00:00 2001
From: Andrew Williams
To get an element's noopener, given an a
, area
, or
- form
element element, a string url, and a string
- target, perform the following steps. They return a boolean.
form
element element, a URL record url, and a
+ string target, perform the following steps. They return a boolean.
If element's link types include the
ASCII case-insensitive match for "
_blank
", then return
true.
Let maybeURL be the result of encoding-parsing a URL given - url.
If maybeURL is not failure and maybeURL's
- scheme is "blob
", run these
- steps:
If url's scheme is
+ "blob
", run these steps:
Let blobOrigin be maybeURL's +
Let blobOrigin be url's blob URL entry's environment settings object's origin.
Let urlRecord be the result of encoding-parsing a URL given
+ subject's href
attribute value, relative to
+ subject's node document.
If urlRecord is failure, then return.
Let noopener be the result of getting - an element's noopener with subject and + an element's noopener with subject, urlRecord, and targetAttributeValue.
Let targetNavigable be the first return value of applying the rules for
@@ -25596,11 +25598,8 @@ document.body.appendChild(wbr);
If targetNavigable is null, then return. Let urlString be the result of encoding-parsing-and-serializing a
- URL given subject's If urlString is failure, then return. Let urlString be the result of applying the
+ URL serializer to urlRecord. If hyperlinkSuffix is non-null, then append it to
urlString.href
attribute
- value, relative to subject's node document.
Let noopener be the result of getting - an element's noopener with form and target.
Let targetNavigable be the first return value of applying the rules for
choosing a navigable given target, form's node
From bb5c5c88c8c79b20fc1c3627cb0130c1df69af78 Mon Sep 17 00:00:00 2001
From: Andrew Williams _blank
", then return
true.
If url's scheme is
- "blob
", run these steps:
If url's scheme is "blob
":
Let blobOrigin be url's - blob URL entry's +
Let blobOrigin be url's blob URL entry's environment settings object's origin.
Let topLevelOrigin be element's node navigable's - active document's relevant settings object's - top-level origin.
Let topLevelOrigin be element's + relevant settings object's top-level origin.
If blobOriginis not same site with topLevelOrigin, +
If blobOrigin is not same site with topLevelOrigin, then return true.
If targetNavigable is null, then return.
Let urlString be the result of applying the - URL serializer to urlRecord.
Let urlString be the result of applying the URL serializer to urlRecord.
If hyperlinkSuffix is non-null, then append it to urlString.
Let topLevelOrigin be sourceDocument's node navigable's - active document's relevant settings object's - top-level origin.
Let topLevelOrigin be sourceDocument's + relevant settings object's top-level origin.
If blobOriginis not same site with topLevelOrigin, then return true.
To get noopener for window open, given a string url, a +
To get noopener for window open, given a URL record url, a Document sourceDocument, an ordered map tokenizedFeatures, and a boolean noreferrer, perform the following steps. They return a boolean.
@@ -89828,16 +89828,12 @@ dictionary WindowPostMessageOptions : StructuredSeriIf noreferrer is true, return true.
Let maybeURL be the result of encoding-parsing a URL given - url.
If maybeURL is not failure and maybeURL's
- scheme is "blob
", run these
- steps:
If url is not failure and url's scheme is "blob
":
Let blobOrigin be maybeURL's - blob URL entry's +
Let blobOrigin be url's blob URL entry's environment settings object's origin.
Let topLevelOrigin be sourceDocument's @@ -89901,16 +89897,23 @@ dictionary WindowPostMessageOptions : StructuredSeri
Let noopener be the result of - getting noopener for window open with - url, sourceDocument, tokenizedFeatures, and - noreferrer.
Let referrerPolicy be the empty string.
If noreferrer is true, then set referrerPolicy to
"no-referrer
".
Let urlRecord be the URL record
+ about:blank
.
If url is not the empty string, then set urlRecord to the result + of encoding-parsing a URL given url, relative to the entry + settings object.
Let noopener be the result of + getting noopener for window open with + urlRecord, sourceDocument, tokenizedFeatures, and + noreferrer.
Let targetNavigable and windowType be the result of applying the
rules for choosing a navigable given target, sourceDocument's
@@ -89926,6 +89929,9 @@ dictionary WindowPostMessageOptions : StructuredSeri
If targetNavigable is null, then return null. If urlRecord is failure, then throw a " If windowType is either "SyntaxError
"
+ DOMException
.new and unrestricted
" or "new with no opener
", then:
Let urlRecord be the URL record
- about:blank
.
If url is not the empty string, then set urlRecord to the result - of encoding-parsing a URL given url, relative to the entry - settings object.
If urlRecord is failure, then throw a "SyntaxError
"
- DOMException
.
If urlRecord matches If url is not the empty string, then: Let urlRecord be the result of encoding-parsing a URL
- url, relative to the entry settings object. If urlRecord is failure, then throw a
- " Navigate targetNavigable to
- urlRecord using sourceDocument, with referrerPolicy set to referrerPolicy and
- exceptionsEnabled set to true. If url is not the empty string, then
+ navigate targetNavigable to
+ urlRecord using sourceDocument, with referrerPolicy set to referrerPolicy and
+ exceptionsEnabled set to true.about:blank
, then perform the
URL and history update steps given targetNavigable's WindowPostMessageOptions : StructuredSeri
-
+ SyntaxError
" DOMException
.
If noopener is false, then set targetNavigable's
Date: Wed, 6 Nov 2024 02:01:21 +0000
Subject: [PATCH 5/7] Make URL record optional for 'get noopener for window
open'
---
source | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/source b/source
index a24c5cc5d92..e004c5eee51 100644
--- a/source
+++ b/source
@@ -89820,21 +89820,21 @@ dictionary WindowPostMessageOptions : StructuredSeri
To get noopener for window open, given a URL record url, a
- Document sourceDocument, an ordered map
- tokenizedFeatures, and a boolean noreferrer, perform the following steps.
- They return a boolean. To get noopener for window open, given a Document
+ sourceDocument, an ordered map tokenizedFeatures, a boolean
+ noreferrer, and an optional URL record url, perform the
+ following steps. They return a boolean. If noreferrer is true, return true. If url is not failure and url's If url was given and url's scheme is " Let blobOrigin be url's blob URL entry's
- environment settings object's origin.
+ environment settings object's origin. Let topLevelOrigin be sourceDocument's
relevant settings object's top-level origin. Let noopener be the result of
- getting noopener for window open with
- urlRecord, sourceDocument, tokenizedFeatures, and
- noreferrer. Let noopener be the result of getting noopener for window open with
+ sourceDocument, tokenizedFeatures, and noreferrer if
+ urlRecord is failure; Otherwise, the result of getting noopener for window open with
+ sourceDocument, tokenizedFeatures, noreferrer, and
+ urlRecord. Let targetNavigable and windowType be the result of applying the
@@ -89966,13 +89969,11 @@ dictionary WindowPostMessageOptions : StructuredSeri
Otherwise: If url is not the empty string, then
- navigate targetNavigable to
- urlRecord using sourceDocument, with referrerPolicy set to referrerPolicy and
- exceptionsEnabled set to true. If url is not the empty string, then
+ navigate targetNavigable to
+ urlRecord using sourceDocument, with referrerPolicy set to referrerPolicy and
+ exceptionsEnabled set to true. If noopener is false, then set targetNavigable's active browsing context's opener browsing context to
From 5a1700a9ddc264aa36d52bf06b1cf578ea8cec98 Mon Sep 17 00:00:00 2001
From: Andrew Williams If noreferrer is true, return true. If url was given and url's scheme is " If url was given and url's scheme is " Let blobOrigin be url's
Date: Wed, 6 Nov 2024 16:09:24 +0000
Subject: [PATCH 7/7] Address review feedback
---
source | 46 +++++++++++++++++++++-------------------------
1 file changed, 21 insertions(+), 25 deletions(-)
diff --git a/source b/source
index b46514bab5d..017073effac 100644
--- a/source
+++ b/source
@@ -25558,11 +25558,12 @@ document.body.appendChild(wbr);
Let blobOrigin be url's blob URL entry's
- environment settings object's origin. Let topLevelOrigin be element's
- relevant settings object's top-level origin. Let topLevelOrigin be element's relevant settings
+ object's top-level origin. If blobOrigin is not same site with topLevelOrigin,
then return true. To get noopener for window open, given a Document
- sourceDocument, an ordered map tokenizedFeatures, a boolean
- noreferrer, and an optional URL record url, perform the
- following steps. They return a boolean. If noreferrer is true, return true. If url was given and url's If url is not failure and url's scheme is " Let blobOrigin be url's blob URL entry's
- environment settings object's origin. Let topLevelOrigin be sourceDocument's
- relevant settings object's top-level origin. Let topLevelOrigin be sourceDocument's relevant settings
+ object's top-level origin. If blobOriginis not same site with topLevelOrigin,
then return true. If the event loop's termination nesting level is nonzero,
- return null. Let sourceDocument be the entry global object's associated Let referrerPolicy be the empty string. If noreferrer is true, then set referrerPolicy to
- " Let urlRecord be the URL record
Let noopener be the result of getting noopener for window open with
- sourceDocument, tokenizedFeatures, and noreferrer if
- urlRecord is failure; Otherwise, the result of getting noopener for window open with
- sourceDocument, tokenizedFeatures, noreferrer, and
- urlRecord. Let referrerPolicy be the empty string. If noreferrer is true, then set noopener to true and set
+ referrerPolicy to " Let targetNavigable and windowType be the result of applying the
blob
":
-
blob
":blob
":
's environment's origin.
-
blob
":
- Document
.no-referrer
".about:blank
.no-referrer
".