W3C home > Mailing lists > Public > public-html-diffs@w3.org > March 2010

hixie: example correctness (whatwg r4871)

From: poot <cvsmail@w3.org>
Date: Fri, 26 Mar 2010 10:31:41 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20100326013141.EEDDF2BC46@toro.w3.mag.keio.ac.jp>
hixie: example correctness (whatwg r4871)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3898&r2=1.3899&f=h
http://html5.org/tools/web-apps-tracker?from=4870&to=4871

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3898
retrieving revision 1.3899
diff -u -d -r1.3898 -r1.3899
--- Overview.html	25 Mar 2010 21:32:52 -0000	1.3898
+++ Overview.html	26 Mar 2010 01:31:23 -0000	1.3899
@@ -19177,20 +19177,24 @@
    <code title="event-error">error</code> event on the last
    <code><a href="#the-source-element">source</a></code> element and trigger fallback behaviour:</p>
 
-   <pre>&lt;video controls autoplay&gt;
- &lt;source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'&gt;
- &lt;source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'
-         onerror="fallback(parentNode)"&gt;
- ...
-&lt;/video&gt;
-&lt;script&gt;
+   <pre>&lt;script&gt;
  function fallback(video) {
    // replace &lt;video&gt; with its contents
-   while (video.hasChildNodes())
-     video.parentNode.insertBefore(video.firstChild, video);
+   while (video.hasChildNodes()) {
+     if (video.firstChild instanceof HTMLSourceElement)
+       video.removeChild(video.firstChild);
+     else
+       video.parentNode.insertBefore(video.firstChild, video);
+   }
    video.parentNode.removeChild(video);
  }
-&lt;/script&gt;</pre>
+&lt;/script&gt;
+&lt;video controls autoplay&gt;
+ &lt;source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'&gt;
+ &lt;source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'
+         onerror="fallback(parentNode)"&gt;
+ ...
+&lt;/video&gt;</pre>
 
   </div><h4 id="media-elements"><span class="secno">4.8.9 </span>Media elements</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><p><dfn id="media-element" title="media element">Media elements</dfn> implement the
   following interface:<pre class="idl">interface <dfn id="htmlmediaelement">HTMLMediaElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
Received on Friday, 26 March 2010 01:32:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 06:14:18 GMT