[html5] r1629 - /

whatwg at whatwg.org whatwg at whatwg.org
Thu May 15 01:09:31 PDT 2008


Author: ianh
Date: 2008-05-15 01:09:31 -0700 (Thu, 15 May 2008)
New Revision: 1629

Modified:
   index
   source
Log:
[gow] (2) <source pixelratio=''> support (based on feedback from YouTube)

Modified: index
===================================================================
--- index	2008-05-15 07:30:02 UTC (rev 1628)
+++ index	2008-05-15 08:09:31 UTC (rev 1629)
@@ -14949,11 +14949,17 @@
   <p>Video content should be rendered inside the element's playback area such
    that the video content is shown centered in the playback area at the
    largest possible size that fits completely within it, with the video
-   content's aspect ratio being preserved. Thus, if the aspect ratio of the
-   playback area does not match the aspect ratio of the video, the video will
-   be shown letterboxed. Areas of the element's playback area that do not
+   content's <a href="#adjusted">adjusted aspect ratio</a> being preserved.
+   Thus, if the aspect ratio of the playback area does not match the <a
+   href="#adjusted">adjusted aspect ratio</a> of the video, the video will be
+   shown letterboxed. Areas of the element's playback area that do not
    contain the video represent nothing.
 
+  <p>The <dfn id=adjusted>adjusted aspect ratio</dfn> of a video is the ratio
+   of its <a href="#adjusted0">adjusted width</a> to its intrinsic height.
+   The <dfn id=adjusted0>adjusted width</dfn> of a video is its intrinsic
+   width multiplied by its <a href="#pixel0">pixel ratio</a>.
+
   <p>In addition to the above, the user agent may provide messages to the
    user (such as "buffering", "no video loaded", "error", or more detailed
    information) by overlaying text or icons on the video or other areas of
@@ -15155,6 +15161,9 @@
 
    <dd><code title=attr-source-media><a href="#media5">media</a></code>
 
+   <dd><code title=attr-source-pixelratio><a
+    href="#pixelratio">pixelratio</a></code>
+
    <dt>DOM interface:
 
    <dd>
@@ -15163,6 +15172,7 @@
            attribute DOMString <a href="#src6" title=dom-source-src>src</a>;
            attribute DOMString <a href="#type9" title=dom-source-type>type</a>;
            attribute DOMString <a href="#media6" title=dom-source-media>media</a>;
+           attribute float <a href="#pixelratio0" title=dom-source-pixelRatio>pixelRatio</a>;
 };</pre>
   </dl>
 
@@ -15313,6 +15323,18 @@
    unless this is the last <code><a href="#source">source</a></code> element
    child of the parent element.
 
+  <p>The <dfn id=pixelratio
+   title=attr-source-pixelratio><code>pixelratio</code></dfn> attribute
+   allows the author to specify the pixel ratio of anamorphic <a
+   href="#media10" title="media resource">media resources</a> that do not
+   self-describe their pixel ratio. The attribute value, if specified, must
+   be a <a href="#valid1">valid floating point number</a> giving the ratio of
+   the correct rendered width of each pixel to the actual width of each pixel
+   in the image (i.e., the multiple by which the video's intrinsic width must
+   be multiplied to obtain the rendered width that gives the correct aspect
+   ratio). The default value, if the attribute is omitted or cannot be
+   parsed, is 1.0.
+
   <p>If a <code><a href="#source">source</a></code> element is inserted into
    a <a href="#media7">media element</a> that is already in a document and
    whose <code title=dom-media-networkState><a
@@ -15330,6 +15352,11 @@
    href="#reflect">reflect</a> the respective content attributes of the same
    name.
 
+  <p>The DOM attribute <dfn id=pixelratio0
+   title=dom-source-pixelRatio><code>pixelRatio</code></dfn> must <a
+   href="#reflect">reflect</a> the <code title=attr-source-pixelratio><a
+   href="#pixelratio">pixelratio</a></code> content attribute.
+
   <h4 id=media><span class=secno>3.12.10 </span>Media elements</h4>
 
   <p><dfn id=media7 title="media element">Media elements</dfn> implement the
@@ -15524,6 +15551,9 @@
 
   <ol>
    <li>
+    <p>Let the <var title="">chosen resource's pixel ratio</var> be 1.0.
+
+   <li>
     <p>If the <a href="#media7">media element</a> has a <code
      title=attr-media-src><a href="#src7">src</a></code>, then the address
      given in that attribute is the address of the <a href="#media10">media
@@ -15535,6 +15565,18 @@
      href="#media7">media element</a>, or null if there is no such child.
 
    <li>
+    <p><i>Loop</i>: this is the start of the loop that looks at the <code><a
+     href="#source">source</a></code> elements.
+
+   <li>
+    <p>If <var title="">candidate</var> is not null and it has a <code
+     title=attr-source-pixelratio><a href="#pixelratio">pixelratio</a></code>
+     attribute, then let the <var title="">chosen resource's pixel
+     ratio</var> be result of applying the <a href="#rules1">rules for
+     parsing floating point number values</a> to the value of that attribute,
+     or 1.0 if those rules return an error.
+
+   <li>
     <p>If either:</p>
 
     <ul>
@@ -15572,14 +15614,17 @@
      children.
 
    <li>
-    <p>If <var title="">candidate</var> is not null, return to step 3.
+    <p>If <var title="">candidate</var> is not null, return to the step
+     labeled <i>loop</i>.
 
    <li>
     <p>There is no <a href="#media10">media resource</a>. Abort these steps.
 
    <li>
     <p>Let the address of the <dfn id=chosen>chosen media resource</dfn> be
-     the one that was found before jumping to this step.
+     the one that was found before jumping to this step, and let its <dfn
+     id=pixel0>pixel ratio</dfn> be the value of the <var title="">chosen
+     resource's pixel ratio</var>.
   </ol>
 
   <p>The <dfn id=currentsrc
@@ -19561,7 +19606,7 @@
   of the target element, not the rendered image (e.g. height/width
   attributes don't affect it -->
 
-  <h6 id=pixel><span class=secno>3.12.11.1.11. </span><dfn id=pixel0>Pixel
+  <h6 id=pixel><span class=secno>3.12.11.1.11. </span><dfn id=pixel1>Pixel
    manipulation</dfn></h6>
   <!--
   <span>ImageData</span> <span title="dom-context-2d-createImageData">createImageData</span>(in float sw, in float sh);

Modified: source
===================================================================
--- source	2008-05-15 07:30:02 UTC (rev 1628)
+++ source	2008-05-15 08:09:31 UTC (rev 1629)
@@ -12941,12 +12941,17 @@
   <p>Video content should be rendered inside the element's playback
   area such that the video content is shown centered in the playback
   area at the largest possible size that fits completely within it,
-  with the video content's aspect ratio being preserved. Thus, if the
-  aspect ratio of the playback area does not match the aspect ratio of
-  the video, the video will be shown letterboxed. Areas of the
-  element's playback area that do not contain the video represent
-  nothing.</p>
+  with the video content's <span>adjusted aspect ratio</span> being
+  preserved. Thus, if the aspect ratio of the playback area does not
+  match the <span>adjusted aspect ratio</span> of the video, the video
+  will be shown letterboxed. Areas of the element's playback area that
+  do not contain the video represent nothing.</p>
 
+  <p>The <dfn>adjusted aspect ratio</dfn> of a video is the ratio of
+  its <span>adjusted width</span> to its intrinsic height. The
+  <dfn>adjusted width</dfn> of a video is its intrinsic width
+  multiplied by its <span>pixel ratio</span>.</p>
+
   <p>In addition to the above, the user agent may provide messages to
   the user (such as "buffering", "no video loaded", "error", or more
   detailed information) by overlaying text or icons on the video or
@@ -13129,12 +13134,14 @@
    <dd><code title="attr-source-src">src</code></dd>
    <dd><code title="attr-source-type">type</code></dd>
    <dd><code title="attr-source-media">media</code></dd>
+   <dd><code title="attr-source-pixelratio">pixelratio</code></dd>
    <dt>DOM interface:</dt>
    <dd>
 <pre class="idl">interface <dfn>HTMLSourceElement</dfn> : <span>HTMLElement</span> {
            attribute DOMString <span title="dom-source-src">src</span>;
            attribute DOMString <span title="dom-source-type">type</span>;
            attribute DOMString <span title="dom-source-media">media</span>;
+           attribute float <span title="dom-source-pixelRatio">pixelRatio</span>;
 };</pre>
    </dd>
   </dl>
@@ -13263,6 +13270,18 @@
   must be specified, unless this is the last <code>source</code>
   element child of the parent element.</p>
 
+  <p>The <dfn
+  title="attr-source-pixelratio"><code>pixelratio</code></dfn>
+  attribute allows the author to specify the pixel ratio of anamorphic
+  <span title="media resource">media resources</span> that do not
+  self-describe their pixel ratio. The attribute value, if specified,
+  must be a <span>valid floating point number</span> giving the ratio
+  of the correct rendered width of each pixel to the actual width of
+  each pixel in the image (i.e., the multiple by which the video's
+  intrinsic width must be multiplied to obtain the rendered width that
+  gives the correct aspect ratio). The default value, if the attribute
+  is omitted or cannot be parsed, is 1.0.</p>
+
   <p>If a <code>source</code> element is inserted into a <span>media
   element</span> that is already in a document and whose <code
   title="dom-media-networkState">networkState</code> is in the <code
@@ -13279,8 +13298,14 @@
   <span>reflect</span> the respective content attributes of the same
   name.</p>
 
+  <p>The DOM attribute <dfn
+  title="dom-source-pixelRatio"><code>pixelRatio</code></dfn> must
+  <span>reflect</span> the <code
+  title="attr-source-pixelratio">pixelratio</code> content
+  attribute.</p>
 
 
+
   <h4>Media elements</h4>
 
   <p><dfn title="media element">Media elements</dfn> implement the
@@ -13470,6 +13495,9 @@
 
   <ol>
 
+   <li><p>Let the <var title="">chosen resource's pixel ratio</var> be
+   1.0.</p></li>
+
    <li><p>If the <span>media element</span> has a <code
    title="attr-media-src">src</code>, then the address given in that
    attribute is the address of the <span>media resource</span>; jump
@@ -13479,6 +13507,16 @@
    <code>source</code> element child in the <span>media
    element</span>, or null if there is no such child.</p></li>
 
+   <li><p><i>Loop</i>: this is the start of the loop that looks at the
+   <code>source</code> elements.</p></li>
+
+   <li><p>If <var title="">candidate</var> is not null and it has a
+   <code title="attr-source-pixelratio">pixelratio</code> attribute,
+   then let the <var title="">chosen resource's pixel ratio</var> be
+   result of applying the <span>rules for parsing floating point
+   number values</span> to the value of that attribute, or 1.0 if
+   those rules return an error.</p></li>
+
    <li>
 
     <p>If either:</p>
@@ -13521,14 +13559,16 @@
    element</span>, or null if there are no more such
    children.</p></li>
 
-   <li><p>If <var title="">candidate</var> is not null, return to step
-   3.</p></li>
+   <li><p>If <var title="">candidate</var> is not null, return to the
+   step labeled <i>loop</i>.</p></li>
 
    <li><p>There is no <span>media resource</span>. Abort these
    steps.</p></li>
 
    <li><p>Let the address of the <dfn>chosen media resource</dfn> be
-   the one that was found before jumping to this step.</p></li>
+   the one that was found before jumping to this step, and let its
+   <dfn>pixel ratio</dfn> be the value of the <var title="">chosen
+   resource's pixel ratio</var>.</p></li>
 
   </ol>
 




More information about the Commit-Watchers mailing list