Bug 457806 - "<source> child of <audio> causes HTML parser to enter infinite loop" [r+sr=mrbkap]
authorMatthew Gregan <kinetik@flim.org>
Tue, 30 Sep 2008 23:58:02 -0500
changeset 20021 96bf4c4184ed3deb60174a1d1448b1522b11ef52
parent 20020 a613924403d65648564e8bb6587d9c30000f2292
child 20022 93210b4517d8fa72575e9d12cd8b180f38970b01
push id2578
push userreed@reedloden.com
push dateWed, 01 Oct 2008 04:58:33 +0000
treeherdermozilla-central@96bf4c4184ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs457806
milestone1.9.1b1pre
Bug 457806 - "<source> child of <audio> causes HTML parser to enter infinite loop" [r+sr=mrbkap]
content/media/video/test/test_constants.html
parser/htmlparser/src/nsElementTable.cpp
--- a/content/media/video/test/test_constants.html
+++ b/content/media/video/test/test_constants.html
@@ -6,17 +6,17 @@
 -->
 <head>
   <title>Media test: constants</title>
   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
-<video><source></video><audio></audio>
+<video><source></video><audio><source></audio>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 is(HTMLElement.EMPTY, undefined);
 is(HTMLElement.LOADING, undefined);
 is(HTMLElement.LOADED_METADATA, undefined);
 is(HTMLElement.LOADED_FIRST_FRAME, undefined);
 is(HTMLElement.LOADED, undefined);
 is(HTMLElement.DATA_UNAVAILABLE, undefined);
@@ -90,16 +90,25 @@ is(document.getElementsByTagName("source
 is(document.getElementsByTagName("source")[0].LOADING, undefined);
 is(document.getElementsByTagName("source")[0].LOADED_METADATA, undefined);
 is(document.getElementsByTagName("source")[0].LOADED_FIRST_FRAME, undefined);
 is(document.getElementsByTagName("source")[0].LOADED, undefined);
 is(document.getElementsByTagName("source")[0].DATA_UNAVAILABLE, undefined);
 is(document.getElementsByTagName("source")[0].CAN_SHOW_CURRENT_FRAME, undefined);
 is(document.getElementsByTagName("source")[0].CAN_PLAY, undefined);
 is(document.getElementsByTagName("source")[0].CAN_PLAY_THROUGH, undefined);
+is(document.getElementsByTagName("source")[1].EMPTY, undefined);
+is(document.getElementsByTagName("source")[1].LOADING, undefined);
+is(document.getElementsByTagName("source")[1].LOADED_METADATA, undefined);
+is(document.getElementsByTagName("source")[1].LOADED_FIRST_FRAME, undefined);
+is(document.getElementsByTagName("source")[1].LOADED, undefined);
+is(document.getElementsByTagName("source")[1].DATA_UNAVAILABLE, undefined);
+is(document.getElementsByTagName("source")[1].CAN_SHOW_CURRENT_FRAME, undefined);
+is(document.getElementsByTagName("source")[1].CAN_PLAY, undefined);
+is(document.getElementsByTagName("source")[1].CAN_PLAY_THROUGH, undefined);
 is(HTMLElement.prototype.EMPTY, undefined);
 is(HTMLElement.prototype.LOADING, undefined);
 is(HTMLElement.prototype.LOADED_METADATA, undefined);
 is(HTMLElement.prototype.LOADED_FIRST_FRAME, undefined);
 is(HTMLElement.prototype.LOADED, undefined);
 is(HTMLElement.prototype.DATA_UNAVAILABLE, undefined);
 is(HTMLElement.prototype.CAN_SHOW_CURRENT_FRAME, undefined);
 is(HTMLElement.prototype.CAN_PLAY, undefined);
--- a/parser/htmlparser/src/nsElementTable.cpp
+++ b/parser/htmlparser/src/nsElementTable.cpp
@@ -1050,17 +1050,17 @@ const nsHTMLElement gHTMLElements[] = {
     /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,
     /*special props, prop-range*/       0, kDefaultPropRange,
     /*special parents,kids,skip*/       0,0,eHTMLTag_unknown,
     /*contain-func*/                    0
   },
 #if defined(MOZ_MEDIA)
   {
     /*tag*/                             eHTMLTag_source,
-    /*req-parent excl-parent*/          eHTMLTag_video,eHTMLTag_unknown,
+    /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gSourceParents,&gSourceParents,
     /*autoclose starttags and endtags*/ &gPAutoClose, 0, 0,0,
     /*parent,incl,exclgroups*/          kNone, kNone, kNone,
     /*special props, prop-range*/       kNonContainer,kNoPropRange,
     /*special parents,kids,skip*/       &gSourceParents,0,eHTMLTag_unknown,
     /*contain-func*/                    0
   },
 #endif