Skip to content

Commit

Permalink
[e] (0) Try to better define how popup blockers work.
Browse files Browse the repository at this point in the history
Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@7593 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 18, 2012
1 parent 993cf93 commit 1212289
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 44 deletions.
38 changes: 23 additions & 15 deletions complete.html
Expand Up @@ -20430,13 +20430,12 @@ <h4 id=the-a-element><span class=secno>4.6.1 </span>The <dfn><code>a</code></dfn

<p>The <a href=#activation-behavior>activation behavior</a> of <code><a href=#the-a-element>a</a></code> elements that create <a href=#hyperlink title=hyperlink>hyperlinks</a> is to run the following steps:</p>

<ol><li><p>If the algorithm is not <a href=#allowed-to-show-a-pop-up>allowed to show a pop-up</a> and either the
<code><a href=#the-a-element>a</a></code> element has a <code title=attr-hyperlink-download><a href=#attr-hyperlink-download>download</a></code> attribute or
the element's <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code> attribute is present and applying
<a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a browsing context name</a>, using the
value of the <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code> attribute as the browsing context
name, would result in there not being a chosen browsing context, then throw an
<code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception and abort these steps.</li>
<ol><li><p>If either the <code><a href=#the-a-element>a</a></code> element has a <code title=attr-hyperlink-download><a href=#attr-hyperlink-download>download</a></code> attribute and the algorithm is not <a href=#allowed-to-show-a-pop-up>allowed
to show a pop-up</a>, or the element's <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code>
attribute is present and applying <a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a
browsing context name</a>, using the value of the <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code> attribute as the browsing context name, would result
in there not being a chosen browsing context, then throw an <code><a href=#invalidaccesserror>InvalidAccessError</a></code>
exception and abort these steps.</li>

<li><p>If the target of the <code title=event-click><a href=#event-click>click</a></code> event is an <code><a href=#the-img-element>img</a></code>
element with an <code title=attr-img-ismap><a href=#attr-img-ismap>ismap</a></code> attribute specified, then server-side
Expand Down Expand Up @@ -65992,7 +65991,7 @@ <h4 id=browsing-context-names><span class=secno>6.1.6 </span>Browsing context na

</ul><hr><p><dfn id=the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>The rules for choosing a browsing context given a browsing context name</dfn> are as
follows. The rules assume that they are being applied in the context of a <a href=#browsing-context>browsing
context</a>.</p>
context</a>, as part of the execution of a <a href=#concept-task title=concept-task>task</a>.</p>

<ol><li>

Expand Down Expand Up @@ -66036,7 +66035,18 @@ <h4 id=browsing-context-names><span class=secno>6.1.6 </span>Browsing context na
agent's configuration and abilities &mdash; it is determined by the rules given for the first
applicable option from the following list:</p>

<dl class=switch><dt id=sandboxWindowOpen>If the current browsing context's <a href=#active-document>active document</a>'s
<dl class=switch><dt id=popup-blocker>If the algorithm is not <a href=#allowed-to-show-a-pop-up>allowed to show a pop-up</a> and the
user agent has been configured to not show popups (i.e. the user agent has a "popup blocker"
enabled)</dt>

<dd>

<p>There is no chosen browsing context. The user agent may inform the user that a popup has
been blocked.</p>

</dd>

<dt id=sandboxWindowOpen>If the current browsing context's <a href=#active-document>active document</a>'s
<a href=#active-sandboxing-flag-set>active sandboxing flag set</a> has the <a href=#sandboxed-auxiliary-navigation-browsing-context-flag>sandboxed auxiliary navigation browsing
context flag</a> set.</dt>

Expand Down Expand Up @@ -66446,12 +66456,10 @@ <h4 id=apis-for-creating-and-navigating-browsing-contexts-by-name><span class=se
agent could override the selection of the target browsing context to
instead target a new tab.</p>

<p>If the method is not <a href=#allowed-to-show-a-pop-up>allowed to show a pop-up</a> and
applying <a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a
browsing context name</a> using the <var title="">target</var>
argument, would result in there not being a chosen browsing context,
then throw an <code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception and abort
these steps.</p>
<p>If applying <a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a browsing context
name</a> using the <var title="">target</var> argument would result in there not being a chosen
browsing context, then throw an <code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception and abort these
steps.</p>

<p>Otherwise, if <var title="">url</var> is not
"<code><a href=#about:blank>about:blank</a></code>", the user agent must
Expand Down
38 changes: 23 additions & 15 deletions index
Expand Up @@ -20430,13 +20430,12 @@ included with Exhibit B.

<p>The <a href=#activation-behavior>activation behavior</a> of <code><a href=#the-a-element>a</a></code> elements that create <a href=#hyperlink title=hyperlink>hyperlinks</a> is to run the following steps:</p>

<ol><li><p>If the algorithm is not <a href=#allowed-to-show-a-pop-up>allowed to show a pop-up</a> and either the
<code><a href=#the-a-element>a</a></code> element has a <code title=attr-hyperlink-download><a href=#attr-hyperlink-download>download</a></code> attribute or
the element's <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code> attribute is present and applying
<a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a browsing context name</a>, using the
value of the <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code> attribute as the browsing context
name, would result in there not being a chosen browsing context, then throw an
<code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception and abort these steps.</li>
<ol><li><p>If either the <code><a href=#the-a-element>a</a></code> element has a <code title=attr-hyperlink-download><a href=#attr-hyperlink-download>download</a></code> attribute and the algorithm is not <a href=#allowed-to-show-a-pop-up>allowed
to show a pop-up</a>, or the element's <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code>
attribute is present and applying <a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a
browsing context name</a>, using the value of the <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code> attribute as the browsing context name, would result
in there not being a chosen browsing context, then throw an <code><a href=#invalidaccesserror>InvalidAccessError</a></code>
exception and abort these steps.</li>

<li><p>If the target of the <code title=event-click><a href=#event-click>click</a></code> event is an <code><a href=#the-img-element>img</a></code>
element with an <code title=attr-img-ismap><a href=#attr-img-ismap>ismap</a></code> attribute specified, then server-side
Expand Down Expand Up @@ -65992,7 +65991,7 @@ END:VCARD</pre>

</ul><hr><p><dfn id=the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>The rules for choosing a browsing context given a browsing context name</dfn> are as
follows. The rules assume that they are being applied in the context of a <a href=#browsing-context>browsing
context</a>.</p>
context</a>, as part of the execution of a <a href=#concept-task title=concept-task>task</a>.</p>

<ol><li>

Expand Down Expand Up @@ -66036,7 +66035,18 @@ END:VCARD</pre>
agent's configuration and abilities &mdash; it is determined by the rules given for the first
applicable option from the following list:</p>

<dl class=switch><dt id=sandboxWindowOpen>If the current browsing context's <a href=#active-document>active document</a>'s
<dl class=switch><dt id=popup-blocker>If the algorithm is not <a href=#allowed-to-show-a-pop-up>allowed to show a pop-up</a> and the
user agent has been configured to not show popups (i.e. the user agent has a "popup blocker"
enabled)</dt>

<dd>

<p>There is no chosen browsing context. The user agent may inform the user that a popup has
been blocked.</p>

</dd>

<dt id=sandboxWindowOpen>If the current browsing context's <a href=#active-document>active document</a>'s
<a href=#active-sandboxing-flag-set>active sandboxing flag set</a> has the <a href=#sandboxed-auxiliary-navigation-browsing-context-flag>sandboxed auxiliary navigation browsing
context flag</a> set.</dt>

Expand Down Expand Up @@ -66446,12 +66456,10 @@ END:VCARD</pre>
agent could override the selection of the target browsing context to
instead target a new tab.</p>

<p>If the method is not <a href=#allowed-to-show-a-pop-up>allowed to show a pop-up</a> and
applying <a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a
browsing context name</a> using the <var title="">target</var>
argument, would result in there not being a chosen browsing context,
then throw an <code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception and abort
these steps.</p>
<p>If applying <a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>the rules for choosing a browsing context given a browsing context
name</a> using the <var title="">target</var> argument would result in there not being a chosen
browsing context, then throw an <code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception and abort these
steps.</p>

<p>Otherwise, if <var title="">url</var> is not
"<code><a href=#about:blank>about:blank</a></code>", the user agent must
Expand Down
38 changes: 24 additions & 14 deletions source
Expand Up @@ -21629,13 +21629,14 @@ included with Exhibit B.

<ol>

<li><p>If the algorithm is not <span>allowed to show a pop-up</span> and either the
<code>a</code> element has a <code title="attr-hyperlink-download">download</code> attribute or
the element's <code title="attr-hyperlink-target">target</code> attribute is present and applying
<span>the rules for choosing a browsing context given a browsing context name</span>, using the
value of the <code title="attr-hyperlink-target">target</code> attribute as the browsing context
name, would result in there not being a chosen browsing context, then throw an
<code>InvalidAccessError</code> exception and abort these steps.</p></li>
<li><p>If either the <code>a</code> element has a <code
title="attr-hyperlink-download">download</code> attribute and the algorithm is not <span>allowed
to show a pop-up</span>, or the element's <code title="attr-hyperlink-target">target</code>
attribute is present and applying <span>the rules for choosing a browsing context given a
browsing context name</span>, using the value of the <code
title="attr-hyperlink-target">target</code> attribute as the browsing context name, would result
in there not being a chosen browsing context, then throw an <code>InvalidAccessError</code>
exception and abort these steps.</p></li>

<li><p>If the target of the <code title="event-click">click</code> event is an <code>img</code>
element with an <code title="attr-img-ismap">ismap</code> attribute specified, then server-side
Expand Down Expand Up @@ -77252,7 +77253,7 @@ END:VCARD</pre>

<p><dfn>The rules for choosing a browsing context given a browsing context name</dfn> are as
follows. The rules assume that they are being applied in the context of a <span>browsing
context</span>.</p>
context</span>, as part of the execution of a <span title="concept-task">task</span>.</p>

<ol>

Expand Down Expand Up @@ -77301,6 +77302,17 @@ END:VCARD</pre>

<dl class="switch">

<dt id="popup-blocker">If the algorithm is not <span>allowed to show a pop-up</span> and the
user agent has been configured to not show popups (i.e. the user agent has a "popup blocker"
enabled)</dt>

<dd>

<p>There is no chosen browsing context. The user agent may inform the user that a popup has
been blocked.</p>

</dd>

<dt id="sandboxWindowOpen">If the current browsing context's <span>active document</span>'s
<span>active sandboxing flag set</span> has the <span>sandboxed auxiliary navigation browsing
context flag</span> set.</dt>
Expand Down Expand Up @@ -77742,12 +77754,10 @@ END:VCARD</pre>
agent could override the selection of the target browsing context to
instead target a new tab.</p>

<p>If the method is not <span>allowed to show a pop-up</span> and
applying <span>the rules for choosing a browsing context given a
browsing context name</span> using the <var title="">target</var>
argument, would result in there not being a chosen browsing context,
then throw an <code>InvalidAccessError</code> exception and abort
these steps.</p>
<p>If applying <span>the rules for choosing a browsing context given a browsing context
name</span> using the <var title="">target</var> argument would result in there not being a chosen
browsing context, then throw an <code>InvalidAccessError</code> exception and abort these
steps.</p>

<p>Otherwise, if <var title="">url</var> is not
"<code>about:blank</code>", the user agent must
Expand Down

0 comments on commit 1212289

Please sign in to comment.