HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
1956Cleanup around <img> requirements. Disallow scripts to run in <img> images.2008-07-30 02:24
@@ -12975,48 +12975,48 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
   </dl>
 
   <p>An <code>img</code> element represents an image.</p>
 
   <p>The image given by the <dfn
   title="attr-img-src"><code>src</code></dfn> attribute is the
   embedded content, and the value of the <dfn
   title="attr-img-alt"><code>alt</code></dfn> attribute is the
   <code>img</code> element's <span>fallback content</span>.</p>
 
-  <p><strong>Authoring requirements</strong>: The <code
-  title="attr-img-src">src</code> attribute must be present, and must
-  contain a <span>valid URL</span>. The requirements on the <code
-  title="attr-img-alt">alt</code> attribute's value are described <a
-  href="#alt">in the next section</a>.</p>
+  <p>The <code title="attr-img-src">src</code> attribute must be
+  present, and must contain a <span>valid URL</span>.</p>
 
   <p class="big-issue">Should we restrict the URL to pointing to an
   image? What's an image? Is PDF an image? (Safari supports PDFs in
   &lt;img> elements.) How about SVG? (Opera supports those). WMFs?
   XPMs? HTML?</p>
 
+  <p>The requirements on the <code title="attr-img-alt">alt</code>
+  attribute's value are described <a href="#alt">in the next
+  section</a>.</p>
+
   <p class="big-issue">There has been some suggestion that the <code
   title="">longdesc</code> attribute from HTML4, or some other
   mechanism that is more powerful than <code title="">alt=""</code>,
   should be included. This has not yet been considered.</p>
 
   <p>The <code>img</code> must not be used as a layout tool. In
   particular, <code>img</code> elements should not be used to display
   fully transparent images, as they rarely convey meaning and rarely
   add anything useful to the document.</p>
 
   <hr>
 
-  <p><strong>User agent requirements</strong>: When the <code
-  title="attr-img-alt">alt</code> attribute is present and its value
-  is the empty string, the image supplements the surrounding
-  content. In such cases, the image may be omitted without affecting
-  the meaning of the document.</p>
+  <p>When the <code title="attr-img-alt">alt</code> attribute is
+  present and its value is the empty string, the image supplements the
+  surrounding content. In such cases, the image may be omitted in the
+  rendering without affecting the meaning of the document.</p>
 
   <p>When the <code title="attr-img-alt">alt</code> attribute is
   present and its value is not the empty string, the image is a
   graphical equivalent of the string given in the <code
   title="attr-img-alt">alt</code> attribute. In such cases, the image
   may be replaced in the rendering by the string given in the
   attribute without significantly affecting the meaning of the
   document.</p>
 
   <p>When the <code title="attr-img-alt">alt</code> attribute is
@@ -13028,20 +13028,27 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
   represent advisory information. User agents must not present the
   contents of the <code title="attr-img-alt">alt</code> attribute in
   the same way as content of the <code title="attr-title">title</code>
   attribute.</p>
 
   <p>If the <code title="attr-img-src">src</code> attribute is
   omitted, the image represents whatever string is given by the
   element's <code title="attr-img-alt">alt</code> attribute, if any,
   or nothing, if that attribute is empty or absent.</p>
 
+  <p>When the <code title="attr-img-src">src</code> attribute is
+  present, the element represents the image given by that
+  attribute.</p>
+
+  <p>The contents of <code>img</code> elements, if any, are ignored
+  for the purposes of rendering.</p>
+
   <hr>
 
   <p>When an <code>img</code> is created with a <code
   title="attr-img-src">src</code> attribute, and whenever the <code
   title="attr-img-src">src</code> attribute is set subsequently, the
   user agent must fetch the resource specifed by the <code
   title="attr-img-src">src</code> attribute's value, unless the user
   agent cannot support images, or its support for images has been
   disabled, or the user agent only fetches elements on demand.</p>
   <!-- Note how this does NOT happen when the base URL changes. -->
@@ -13068,21 +13075,22 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
 
   <p>The remote server's response metadata (e.g. an HTTP 404 status
   code, or <span title="Content-Type">associated Content-Type
   headers</span>) must be ignored when determining whether the
   resource obtained is a valid image or not.</p>
 
   <p class="note">This allows servers to return images with error
   responses.</p>
 
   <p>User agents must not support non-image resources with the
-  <code>img</code> element.</p>
+  <code>img</code> element. User agents must not run executable code
+  (e.g. scripts) embedded in the image resource.</p>
 
   <hr>
 
   <p>The <code title="attr-hyperlink-usemap">usemap</code> attribute,
   if present, can indicate that the image has an associated
   <span>image map</span>.</p>
 
   <p>The <dfn title="attr-img-ismap"><code>ismap</code></dfn>
   attribute, when used on an element that is a descendant of an
   <code>a</code> element with an <code
@@ -13092,23 +13100,20 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
   <code>a</code> element.</p>
 
   <p>The <code title="attr-img-ismap">ismap</code> attribute is a
   <span>boolean attribute</span>. The attribute must not be specified
   on an element that does not have an ancestor <code>a</code> element
   with an <code title="attr-hyperlink-href">href</code> attribute.</p>
 
   <p>The <code>img</code> element supports <span>dimension
   attributes</span>.</p>
 
-  <!-- XXX contents of <img> should be ignored for rendering but not
-  for semantics, e.g. <script>, <input>, etc. -->
-
   <p>The DOM attributes <dfn
   title="dom-img-alt"><code>alt</code></dfn>, <dfn
   title="dom-img-src"><code>src</code></dfn>, <dfn
   title="dom-img-useMap"><code>useMap</code></dfn>, and <dfn
   title="dom-img-isMap"><code>isMap</code></dfn> each must
   <span>reflect</span> the respective content attributes of the same
   name.</p>
 
   <p>The DOM attributes <dfn
   title="dom-img-width"><code>width</code></dfn> and <dfn

|