Skip to content

Commit

Permalink
[giow] (3) Make <img> reload if inserting it into a new doc causes th…
Browse files Browse the repository at this point in the history
…e URL to change (note that exactly what this does depends on whether the browser's 'list of available images' is maintained per-Doc, or whether there's only one list per origin)

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24312
Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@8509 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 24, 2014
1 parent 1b1a59e commit aba3cf6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 6 additions & 3 deletions complete.html
Expand Up @@ -3730,6 +3730,7 @@ <h4 id=dependencies><span class=secno>2.2.2 </span>Dependencies</h4>

<li>The <dfn id=concept-node-insert title=concept-node-insert>insert</dfn>, <dfn id=concept-node-append title=concept-node-append>append</dfn>, <dfn id=concept-node-remove title=concept-node-remove>remove</dfn>, <dfn id=concept-node-replace title=concept-node-replace>replace</dfn>, and <dfn id=concept-node-adopt title=concept-node-adopt>adopt</dfn> algorithms for nodes</li>
<li>The <dfn id=nodes-are-inserted>nodes are inserted</dfn> and <dfn id=nodes-are-removed>nodes are removed</dfn> concepts</li>
<li>An element's <dfn id=concept-node-adopt-ext title=concept-node-adopt-ext>adopting steps</dfn></li>
<li>The <dfn id=attribute-list>attribute list</dfn> concept.</li>
<li>The <dfn id=concept-cd-data title=concept-cd-data>data</dfn> of a text node.</li>

Expand Down Expand Up @@ -20928,13 +20929,15 @@ <h4 id=the-img-element><span class=secno>4.7.1 </span>The <dfn><code>img</code><
data</a> of an <code><a href=#the-img-element>img</a></code> element whenever that element is created with a <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute, a <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>
attribute, or both. A user agent that obtains images immediately must also synchronously
<a href=#update-the-image-data>update the image data</a> of an <code><a href=#the-img-element>img</a></code> element whenever that element has its
<code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed.</p> <!-- Note
how this does NOT happen when the base URL changes. -->
<code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed, and whenever
that element's <a href=#concept-node-adopt-ext title=concept-node-adopt-ext>adopting steps</a> are run.</p> <!-- Note
how this does NOT happen when the base URL changes (except for when adopted into a new doc) -->

<p>A user agent that obtains images on demand must <a href=#update-the-image-data>update the image data</a> of an
<code><a href=#the-img-element>img</a></code> element whenever it needs the image data (i.e. on demand), but only if the
<code><a href=#the-img-element>img</a></code> element has a <code title=attr-img-src><a href=#attr-img-src>src</a></code> or <code title=attr-img-src><a href=#attr-img-src>srcset</a></code> attribute, and only if the <code><a href=#the-img-element>img</a></code> element is in the
<a href=#img-none title=img-none>unavailable</a> state. When an <code><a href=#the-img-element>img</a></code> element's <code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed, if the user
<a href=#img-none title=img-none>unavailable</a> state. When an <code><a href=#the-img-element>img</a></code> element's <code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed, and whenever
that element's <a href=#concept-node-adopt-ext title=concept-node-adopt-ext>adopting steps</a> are run, if the user
agent only obtains images on demand, the <code><a href=#the-img-element>img</a></code> element must return to the <a href=#img-none title=img-none>unavailable</a> state.</p> <!-- Note how this does NOT happen when the base
URL changes. -->

Expand Down
9 changes: 6 additions & 3 deletions index
Expand Up @@ -3730,6 +3730,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<li>The <dfn id=concept-node-insert title=concept-node-insert>insert</dfn>, <dfn id=concept-node-append title=concept-node-append>append</dfn>, <dfn id=concept-node-remove title=concept-node-remove>remove</dfn>, <dfn id=concept-node-replace title=concept-node-replace>replace</dfn>, and <dfn id=concept-node-adopt title=concept-node-adopt>adopt</dfn> algorithms for nodes</li>
<li>The <dfn id=nodes-are-inserted>nodes are inserted</dfn> and <dfn id=nodes-are-removed>nodes are removed</dfn> concepts</li>
<li>An element's <dfn id=concept-node-adopt-ext title=concept-node-adopt-ext>adopting steps</dfn></li>
<li>The <dfn id=attribute-list>attribute list</dfn> concept.</li>
<li>The <dfn id=concept-cd-data title=concept-cd-data>data</dfn> of a text node.</li>

Expand Down Expand Up @@ -20928,13 +20929,15 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
data</a> of an <code><a href=#the-img-element>img</a></code> element whenever that element is created with a <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute, a <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>
attribute, or both. A user agent that obtains images immediately must also synchronously
<a href=#update-the-image-data>update the image data</a> of an <code><a href=#the-img-element>img</a></code> element whenever that element has its
<code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed.</p> <!-- Note
how this does NOT happen when the base URL changes. -->
<code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed, and whenever
that element's <a href=#concept-node-adopt-ext title=concept-node-adopt-ext>adopting steps</a> are run.</p> <!-- Note
how this does NOT happen when the base URL changes (except for when adopted into a new doc) -->

<p>A user agent that obtains images on demand must <a href=#update-the-image-data>update the image data</a> of an
<code><a href=#the-img-element>img</a></code> element whenever it needs the image data (i.e. on demand), but only if the
<code><a href=#the-img-element>img</a></code> element has a <code title=attr-img-src><a href=#attr-img-src>src</a></code> or <code title=attr-img-src><a href=#attr-img-src>srcset</a></code> attribute, and only if the <code><a href=#the-img-element>img</a></code> element is in the
<a href=#img-none title=img-none>unavailable</a> state. When an <code><a href=#the-img-element>img</a></code> element's <code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed, if the user
<a href=#img-none title=img-none>unavailable</a> state. When an <code><a href=#the-img-element>img</a></code> element's <code title=attr-img-src><a href=#attr-img-src>src</a></code>, <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>, or <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> attribute set, changed, or removed, and whenever
that element's <a href=#concept-node-adopt-ext title=concept-node-adopt-ext>adopting steps</a> are run, if the user
agent only obtains images on demand, the <code><a href=#the-img-element>img</a></code> element must return to the <a href=#img-none title=img-none>unavailable</a> state.</p> <!-- Note how this does NOT happen when the base
URL changes. -->

Expand Down
9 changes: 6 additions & 3 deletions source
Expand Up @@ -2448,6 +2448,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<li>The <dfn data-x="concept-node-insert">insert</dfn>, <dfn data-x="concept-node-append">append</dfn>, <dfn data-x="concept-node-remove">remove</dfn>, <dfn data-x="concept-node-replace">replace</dfn>, and <dfn data-x="concept-node-adopt">adopt</dfn> algorithms for nodes</li>
<li>The <dfn>nodes are inserted</dfn> and <dfn>nodes are removed</dfn> concepts</li>
<li>An element's <dfn data-x="concept-node-adopt-ext">adopting steps</dfn></li>
<li>The <dfn>attribute list</dfn> concept.</li>
<li>The <dfn data-x="concept-cd-data">data</dfn> of a text node.</li>

Expand Down Expand Up @@ -21873,16 +21874,18 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
attribute, or both. A user agent that obtains images immediately must also synchronously
<span>update the image data</span> of an <code>img</code> element whenever that element has its
<code data-x="attr-img-src">src</code>, <code data-x="attr-img-srcset">srcset</code>, or <code
data-x="attr-img-crossorigin">crossorigin</code> attribute set, changed, or removed.</p> <!-- Note
how this does NOT happen when the base URL changes. -->
data-x="attr-img-crossorigin">crossorigin</code> attribute set, changed, or removed, and whenever
that element's <span data-x="concept-node-adopt-ext">adopting steps</span> are run.</p> <!-- Note
how this does NOT happen when the base URL changes (except for when adopted into a new doc) -->

<p>A user agent that obtains images on demand must <span>update the image data</span> of an
<code>img</code> element whenever it needs the image data (i.e. on demand), but only if the
<code>img</code> element has a <code data-x="attr-img-src">src</code> or <code
data-x="attr-img-src">srcset</code> attribute, and only if the <code>img</code> element is in the
<span data-x="img-none">unavailable</span> state. When an <code>img</code> element's <code
data-x="attr-img-src">src</code>, <code data-x="attr-img-srcset">srcset</code>, or <code
data-x="attr-img-crossorigin">crossorigin</code> attribute set, changed, or removed, if the user
data-x="attr-img-crossorigin">crossorigin</code> attribute set, changed, or removed, and whenever
that element's <span data-x="concept-node-adopt-ext">adopting steps</span> are run, if the user
agent only obtains images on demand, the <code>img</code> element must return to the <span
data-x="img-none">unavailable</span> state.</p> <!-- Note how this does NOT happen when the base
URL changes. -->
Expand Down

0 comments on commit aba3cf6

Please sign in to comment.