Skip to content

Commit

Permalink
[c] (0) Change the rules for the handling of dimension attributes so …
Browse files Browse the repository at this point in the history
…that the requirement that they keep their ratio takes into account the integer nature of the attributes.

git-svn-id: http://svn.whatwg.org/webapps@2474 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 29, 2008
1 parent c5d10cf commit b563812
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 13 deletions.
27 changes: 21 additions & 6 deletions index
Expand Up @@ -21261,12 +21261,27 @@ function AddCloud(data, x, y) { ... }</pre>
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 &le;
<var title="">specified height</var> * <var title="">target ratio</var> &le;
<var title="">specified width</var> + 0.5</span></li>

<li><span><var title="">specified height</var> - 0.5 &le;
<var title="">specified width</var> / <var title="">target ratio</var> &le;
<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
Expand Down
35 changes: 28 additions & 7 deletions source
Expand Up @@ -23468,13 +23468,34 @@ function AddCloud(data, x, y) { ... }</pre>
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 &le;
<var title="">specified height</var> * <var title="">target ratio</var> &le;
<var title="">specified width</var> + 0.5</span></li>

<li><span><var title="">specified height</var> - 0.5 &le;
<var title="">specified width</var> / <var title="">target ratio</var> &le;
<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
Expand Down

0 comments on commit b563812

Please sign in to comment.