Skip to content

Commit

Permalink
[giow] (2) Make <object> and <embed> not have live plugins when out-o…
Browse files Browse the repository at this point in the history
…f-document.

git-svn-id: http://svn.whatwg.org/webapps@3828 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 14, 2009
1 parent 6ac2b67 commit dbcf6b0
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 116 deletions.
134 changes: 82 additions & 52 deletions index
Expand Up @@ -20081,33 +20081,63 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
overriding the sandbox to the user if an option to do so is
provided.</p>

<p>When the element is created with a <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute, and whenever the <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute is subsequently set, and
whenever the <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute is
set or removed while the element has a <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute, if the element is not
in a sandboxed browsing context, not a descendant of a <a href=#media-element>media
element</a>, and not a descendant of an <code><a href=#the-object-element>object</a></code>
element that is not showing its <a href=#fallback-content>fallback content</a>, the
user agent must <a href=#resolve-a-url title="resolve a url">resolve</a> the value
of the attribute, relative to the element, and if that is
successful, should <a href=#fetch>fetch</a> the resulting <a href=#absolute-url>absolute
URL</a>. The <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task
source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must find and instantiate an
appropriate <a href=#plugin>plugin</a> based on the <a href=#concept-embed-type title=concept-embed-type>content's type</a>, and hand that
<a href=#plugin>plugin</a> the content of the resource, replacing any
previously instantiated plugin for the element. <!-- Note that this
doesn't happen when the base URL changes. --></p>

<p>Fetching the resource must <a href=#delay-the-load-event>delay the load event</a> of
the element's document.</p>
<!-- if we add load/error events, then replace the previous
paragraph with the text one: -->
<!-- similar text in various places -->
<!--<p>Fetching the resource must <span>delay the load event</span>
of the element's document until the final <span
title="concept-task">task</span> that is <span title="queue a
task">queued</span> by the <span>networking task source</span> once
the resource has been <span title="fetch">fetched</span> has been
run.</p>-->
<p>An <code><a href=#the-embed-element>embed</a></code> element is said to be <dfn id=concept-embed-active title=concept-embed-active>potentially active</dfn> when the
following conditions are all met simultaneously:</p>

<ul class=brief><li>The element is <a href=#in-a-document title="in a document">in a <code>Document</code></a>.</li>
<li>The element has either a <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute set or a <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute set (or both).</li>
<li>The element is not in a sandboxed browsing context.</li>
<li>The element is not a descendant of a <a href=#media-element>media element</a>.</li>
<li>The element is not a descendant of an <code><a href=#the-object-element>object</a></code> element that is not showing its <a href=#fallback-content>fallback content</a>.</li>
</ul><p>Whenever an <code><a href=#the-embed-element>embed</a></code> element that was not <a href=#concept-embed-active title=concept-embed-active>potentially active</a> becomes <a href=#concept-embed-active title=concept-embed-active>potentially active</a>, and whenever
a <a href=#concept-embed-active title=concept-embed-active>potentially active</a>
<code><a href=#the-embed-element>embed</a></code> element's <code title=attr-embed-type><a href=#attr-embed-type>src</a></code> attribute is set, changed, or
removed, and whenever a <a href=#concept-embed-active title=concept-embed-active>potentially active</a>
<code><a href=#the-embed-element>embed</a></code> element's <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute is set, changed, or
removed, the appropriate set of steps from the following is then
applied:</p>

<dl class=switch><dt>If the element has a <code title=attr-embed-src><a href=#attr-embed-src>src</a></code>
attribute set</dt>

<dd>

<p>The user agent must <a href=#resolve-a-url title="resolve a url">resolve</a>
the value of the element's <code title=attr-embed-src><a href=#attr-embed-src>src</a></code>
attribute, relative to the element. If that is successful, the
user agent should <a href=#fetch>fetch</a> the resulting <a href=#absolute-url>absolute
URL</a>. The <a href=#concept-task title=concept-task>task</a> that is
<a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking
task source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must find and instantiate an
appropriate <a href=#plugin>plugin</a> based on the <a href=#concept-embed-type title=concept-embed-type>content's type</a>, and hand that
<a href=#plugin>plugin</a> the content of the resource, replacing any
previously instantiated plugin for the element.</p> <!-- Note that
this doesn't happen when the base URL changes. -->

<p>Fetching the resource must <a href=#delay-the-load-event>delay the load event</a> of
the element's document.</p>
<!-- if we add load/error events, then replace the previous
paragraph with the text one: -->
<!-- similar text in various places -->
<!--<p>Fetching the resource must <span>delay the load
event</span> of the element's document until the final <span
title="concept-task">task</span> that is <span title="queue a
task">queued</span> by the <span>networking task source</span>
once the resource has been <span title="fetch">fetched</span> has
been run.</p>-->

</dd>

<dt>If the element has no <code title=attr-embed-src><a href=#attr-embed-src>src</a></code>
attribute set</dt>

<dd><p>The user agent should find and instantiate an appropriate
<a href=#plugin>plugin</a> based on the value of the <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute.</p>

</dl><p>Whenever an <code><a href=#the-embed-element>embed</a></code> element that was <a href=#concept-embed-active title=concept-embed-active>potentially active</a> stops being
<a href=#concept-embed-active title=concept-embed-active>potentially active</a>, any
<a href=#plugin>plugin</a> that had been instantiated for that element must
be unloaded.</p>

<p>The <dfn id=concept-embed-type title=concept-embed-type>type of the content</dfn>
being embedded is defined as follows:</p>
Expand Down Expand Up @@ -20142,7 +20172,12 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>

<!-- This algorithm is a monument to bad design. Go legacy! -->

</ol><p>Whether the resource is fetched successfully or not (e.g. whether
</ol><p>The <code><a href=#the-embed-element>embed</a></code> element has no <a href=#fallback-content>fallback
content</a>. If the user agent can't find a suitable plugin, then
the user agent must use a default plugin. (This default could be as
simple as saying "Unsupported Format".)</p>

<p>Whether the resource is fetched successfully or not (e.g. whether
the response code was a 2xx code <a href=#concept-http-equivalent-codes title=concept-http-equivalent-codes>or equivalent</a>) must be
ignored when determining the resource's type and when handing the
resource to the plugin.</p>
Expand All @@ -20151,14 +20186,6 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
with error responses (e.g. HTTP 500 Internal Server Error codes can
still contain plugin data).</p>

<p>When the element is created with a <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute and no <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute, and whenever the <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute is subsequently set,
so long as no <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute is
set, and whenever the <code title=attr-embed-src><a href=#attr-embed-src>src</a></code>
attribute is removed when the element has a <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute, if the element is not
in a sandboxed browsing context, user agents should find and
instantiate an appropriate <a href=#plugin>plugin</a> based on the value of
the <code title=attr-embed-type><a href=#attr-embed-type>type</a></code> attribute.</p>

</div>

<p>Any (namespace-less) attribute may be specified on the
Expand All @@ -20182,11 +20209,6 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
<code><a href=#htmlembedelement>HTMLEmbedElement</a></code> object representing the element should
expose that interface while the element is instantiated.</p>

<p>The <code><a href=#the-embed-element>embed</a></code> element has no <a href=#fallback-content>fallback
content</a>. If the user agent can't find a suitable plugin, then
the user agent must use a default plugin. (This default could be as
simple as saying "Unsupported Format".)</p>

</div>

<p>The <code><a href=#the-embed-element>embed</a></code> element supports <a href=#dimension-attributes>dimension
Expand Down Expand Up @@ -20288,21 +20310,28 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>

<div class=impl>

<p>When the element is created, and subsequently whenever the <code title=attr-object-classid>classid</code> attribute changes or is
removed, or, if the <code title=attr-object-classid>classid</code>
attribute is not present, whenever the <code title=attr-object-data><a href=#attr-object-data>data</a></code> attribute changes or is
removed, or, if neither <code title=attr-object-classid>classid</code> attribute nor the <code title=attr-object-data><a href=#attr-object-data>data</a></code> attribute are present, whenever
the <code title=attr-object-type><a href=#attr-object-type>type</a></code> attribute changes or
is removed, the user agent must run the following steps to determine
what the <code><a href=#the-object-element>object</a></code> element represents:</p> <!-- Changing
the base URL doesn't trigger this. -->
<p>When the element is created, and subsequently whenever the
element is <a href=#insert-an-element-into-a-document title="insert an element into a document">inserted
into a document</a>, <a href=#insert-an-element-into-a-document title="insert an element into a
document">removed from a document</a>; and whenever an ancestor
<code><a href=#the-object-element>object</a></code> element changes to or from showing its
<a href=#fallback-content>fallback content</a>; and whenever the element's <code title=attr-object-classid>classid</code> attribute is set,
changed, or removed; and, when its <code title=attr-object-classid>classid</code> attribute is not present,
whenever its <code title=attr-object-data><a href=#attr-object-data>data</a></code> attribute is
set, changed, or removed; and, when neither its <code title=attr-object-classid>classid</code> attribute nor its <code title=attr-object-data><a href=#attr-object-data>data</a></code> attribute are present, whenever
its <code title=attr-object-type><a href=#attr-object-type>type</a></code> attribute is set,
changed, or removed: the user agent must run the following steps to
(re)determine what the <code><a href=#the-object-element>object</a></code> element represents:</p>
<!-- Changing the base URL doesn't trigger this. -->

<ol><li>

<p>If the element has an ancestor <a href=#media-element>media element</a>, or
has an ancestor <code><a href=#the-object-element>object</a></code> element that is <em>not</em>
showing its <a href=#fallback-content>fallback content</a>, then jump to the last
step in the overall set of steps (fallback).</p>
showing its <a href=#fallback-content>fallback content</a>, or if the element is
not <a href=#in-a-document title="in a document">in a <code>Document</code></a>,
then jump to the last step in the overall set of steps
(fallback).</p>

</li>

Expand Down Expand Up @@ -20576,7 +20605,8 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
<li><p>(Fallback.) The <code><a href=#the-object-element>object</a></code> element
<a href=#represents>represents</a> the element's children, ignoring any
leading <code><a href=#the-param-element>param</a></code> element children. This is the element's
<a href=#fallback-content>fallback content</a>.</li>
<a href=#fallback-content>fallback content</a>. If the element has an instantiated
<a href=#plugin>plugin</a>, then unload it.</li>

</ol><p id=object-plugin>When the algorithm above instantiates a
<a href=#plugin>plugin</a>, the user agent should pass the names and values
Expand Down

0 comments on commit dbcf6b0

Please sign in to comment.