Skip to content

Commit

Permalink
Specify parsing of 'noopener' feature in window.open
Browse files Browse the repository at this point in the history
Specify parsing of 'noopener' feature in window.open so that noopener is only set to true
if the value is either:
- The empty string.
- The string "yes".
- The value is not 0 or an error when parsed as an integer.

Fixes #2600.
  • Loading branch information
Chris Dumez authored and zcorpan committed Oct 11, 2018
1 parent 5fabb58 commit 3bf4cec
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -78318,13 +78318,17 @@ interface <dfn data-export="" data-dfn-type="interface">Window</dfn> : <span>Eve
<li><p>Let <var>tokenizedFeatures</var> be the result of <span
data-x="concept-window-open-features-tokenize">tokenizing</span> <var>features</var>.</p></li>

<li><p>Let <var>noopener</var> be true if <var>tokenizedFeatures</var> <span data-x="map
exists">contains</span> an entry with the key "<code data-x="">noopener</code>"</p></li>
<li><p>Let <var>noopener</var> be false.</p></li>

<li><p>If <var>tokenizedFeatures</var> <span data-x="map exists">contains</span> an entry with the
key "<code data-x="">noopener</code>", then set <var>noopener</var> to the result of <span
data-x="concept-window-open-features-parse-boolean">parsing <var>tokenizedFeatures["noopener"]</var>
as a boolean feature</span>.</p></li>

<li>
<p>Let <var>target browsing context</var> and <var>new</var> be the result of applying <span>the
rules for choosing a browsing context</span> given <var>target</var>, <var>source browsing
context</var>, and <var>noopener</var>.
context</var>, and <var>noopener</var>.</p>

<p class="example">If there is a user agent that supports control-clicking a link to open it in
a new tab, and the user control-clicks on an element whose <code
Expand Down Expand Up @@ -78477,6 +78481,23 @@ interface <dfn data-export="" data-dfn-type="interface">Window</dfn> : <span>Eve
<dd>Return <var>name</var>.
</dl>

<p>To <dfn data-x="concept-window-open-features-parse-boolean">parse a boolean feature</dfn> given a
string <var>value</var>:</p>

<ol>
<li><p>If <var>value</var> is the empty string, then return true.</p></li>

<li><p>If <var>value</var> is a case-sensitive match for <code data-x="">yes</code>, then return
true.</p></li>

<li><p>Let <var>parsed</var> be the result of <span data-x="rules for parsing integers">parsing
<var>value</var> as an integer</span>.</p></li>

<li><p>If <var>parsed</var> is an error, then set it to 0."</p></li>

<li><p>If <var>parsed</var> is 0, then return false, otherwise return true.</p></li>
</ol>

<hr>

<p>The <dfn><code data-x="dom-name">name</code></dfn> attribute of the <code>Window</code> object
Expand Down

0 comments on commit 3bf4cec

Please sign in to comment.