[html5] r2474 - [c] (0) Change the rules for the handling of dimension attributes so that the re [...]

whatwg at whatwg.org whatwg at whatwg.org
Sat Nov 29 13:48:26 PST 2008


Author: ianh
Date: 2008-11-29 13:48:26 -0800 (Sat, 29 Nov 2008)
New Revision: 2474

Modified:
   index
   source
Log:
[c] (0) Change the rules for the handling of dimension attributes so that the requirement that they keep their ratio takes into account the integer nature of the attributes.

Modified: index
===================================================================
--- index	2008-11-29 21:32:04 UTC (rev 2473)
+++ index	2008-11-29 21:48:26 UTC (rev 2474)
@@ -21261,13 +21261,28 @@
   resolution that differs from the CSS pixel resolution. (On screens,
   CSS pixels have a resolution of 96ppi, but in general the CSS pixel
   resolution depends on the reading distance.) If both attributes are
-  specified, then the ratio of the specified width to the specified
-  height must be the same as the ratio of the intrinsic width to the
-  intrinsic height in the resource, or alternatively, in the case of
-  the <code><a href=#video>video</a></code> element, the same as the <a href=#concept-video-adjusted-ratio title=concept-video-adjusted-ratio>adjusted ratio</a>. The two
-  attributes must be omitted if the resource in question does not have
-  both an intrinsic width and an intrinsic height.</p>
+  specified, then one of the following statements must be true:</p>
 
+  <ul><li><span><var title="">specified width</var> - 0.5 ≤
+             <var title="">specified height</var> * <var title="">target ratio</var> ≤
+             <var title="">specified width</var> + 0.5</span></li>
+
+   <li><span><var title="">specified height</var> - 0.5 ≤
+             <var title="">specified width</var> / <var title="">target ratio</var> ≤
+             <var title="">specified height</var> + 0.5</span></li>
+
+  </ul><p>The <var title="">target ratio</var> is, in the
+  <code><a href=#video>video</a></code> element, the same as the <a href=#concept-video-adjusted-ratio title=concept-video-adjusted-ratio>adjusted ratio</a>, and in
+  the other cases, the ratio of the intrinsic width to the intrinsic
+  height in the resource. The <var title="">specified width</var> and
+  <var title="">specified height</var> are the values of the <code title=attr-dim-width><a href=#attr-dim-width>width</a></code> and <code title=attr-dim-height><a href=#attr-dim-height>height</a></code> attributes respectively.</p>
+
+  <p>The two attributes must be omitted if the resource in question
+  does not have both an intrinsic width and an intrinsic height.</p>
+
+  <p class=note>Basically, the dimension attributes can't be used to
+  stretch the image.</p>
+
   <p>To parse the attributes, user agents must use the <a href=#rules-for-parsing-dimension-values>rules for
   parsing dimension values</a>. This will return either an integer
   length, a percentage value, or nothing. The user agent requirements

Modified: source
===================================================================
--- source	2008-11-29 21:32:04 UTC (rev 2473)
+++ source	2008-11-29 21:48:26 UTC (rev 2474)
@@ -23468,14 +23468,35 @@
   resolution that differs from the CSS pixel resolution. (On screens,
   CSS pixels have a resolution of 96ppi, but in general the CSS pixel
   resolution depends on the reading distance.) If both attributes are
-  specified, then the ratio of the specified width to the specified
-  height must be the same as the ratio of the intrinsic width to the
-  intrinsic height in the resource, or alternatively, in the case of
-  the <code>video</code> element, the same as the <span
-  title="concept-video-adjusted-ratio">adjusted ratio</span>. The two
-  attributes must be omitted if the resource in question does not have
-  both an intrinsic width and an intrinsic height.</p>
+  specified, then one of the following statements must be true:</p>
 
+  <ul>
+
+   <li><span><var title="">specified width</var> - 0.5 ≤
+             <var title="">specified height</var> * <var title="">target ratio</var> ≤
+             <var title="">specified width</var> + 0.5</span></li>
+
+   <li><span><var title="">specified height</var> - 0.5 ≤
+             <var title="">specified width</var> / <var title="">target ratio</var> ≤
+             <var title="">specified height</var> + 0.5</span></li>
+
+  </ul>
+
+  <p>The <var title="">target ratio</var> is, in the
+  <code>video</code> element, the same as the <span
+  title="concept-video-adjusted-ratio">adjusted ratio</span>, and in
+  the other cases, the ratio of the intrinsic width to the intrinsic
+  height in the resource. The <var title="">specified width</var> and
+  <var title="">specified height</var> are the values of the <code
+  title="attr-dim-width">width</code> and <code
+  title="attr-dim-height">height</code> attributes respectively.</p>
+
+  <p>The two attributes must be omitted if the resource in question
+  does not have both an intrinsic width and an intrinsic height.</p>
+
+  <p class="note">Basically, the dimension attributes can't be used to
+  stretch the image.</p>
+
   <p>To parse the attributes, user agents must use the <span>rules for
   parsing dimension values</span>. This will return either an integer
   length, a percentage value, or nothing. The user agent requirements




More information about the Commit-Watchers mailing list