Skip to content
Permalink
Browse files

[e] (0) Try to better define how popup blockers work.

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 12122896632c52211420de2207c3ff683d21930d
Showing with 70 additions and 44 deletions.
  1. +23 −15 complete.html
  2. +23 −15 index
  3. +24 −14 source

<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

</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>

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>

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
38 index

<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

</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>

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>

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
38 source

<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

<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>


<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>
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

0 comments on commit 1212289

Please sign in to comment.
You can’t perform that action at this time.