Bug 857022 - Remove MOZ_MEDIA from parser. r=smaug
authorRalph Giles <giles@mozilla.com>
Thu, 04 Apr 2013 14:08:00 -0700
changeset 128029 c130590bbe8c6bca6dd57cbccb9c7315226add34
parent 128028 d26b014749ba1f331f7ffdb4be2f6c94f5c0d37a
child 128030 d8846d94297a9cb129b476235667d4bad5a459c5
push id26106
push userrgiles@mozilla.com
push dateMon, 08 Apr 2013 20:00:01 +0000
treeherdermozilla-inbound@d8846d94297a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs857022
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 857022 - Remove MOZ_MEDIA from parser. r=smaug Enable this code unconditionally.
editor/libeditor/html/nsHTMLEditUtils.cpp
parser/htmlparser/public/nsHTMLTagList.h
parser/htmlparser/src/nsElementTable.cpp
parser/htmlparser/src/nsHTMLTags.cpp
--- a/editor/libeditor/html/nsHTMLEditUtils.cpp
+++ b/editor/libeditor/html/nsHTMLEditUtils.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "./../../mozilla-config.h"     // for MOZ_MEDIA
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc
 #include "mozilla/Util.h"               // for ArrayLength
 #include "mozilla/dom/Element.h"        // for Element, nsINode
 #include "nsAString.h"                  // for nsAString_internal::IsEmpty
 #include "nsCOMPtr.h"                   // for nsCOMPtr, operator==, etc
 #include "nsCaseTreatment.h"
 #include "nsDebug.h"                    // for NS_PRECONDITION, etc
 #include "nsEditProperty.h"             // for nsEditProperty, etc
@@ -618,19 +617,17 @@ static const nsElementInfo kElements[eHT
   ELEM(acronym, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
   ELEM(address, true, true, GROUP_BLOCK,
        GROUP_INLINE_ELEMENT | GROUP_P),
   ELEM(applet, true, true, GROUP_SPECIAL | GROUP_BLOCK,
        GROUP_FLOW_ELEMENT | GROUP_OBJECT_CONTENT),
   ELEM(area, false, false, GROUP_MAP_CONTENT, GROUP_NONE),
   ELEM(article, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(aside, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
-#if defined(MOZ_MEDIA)
   ELEM(audio, false, false, GROUP_NONE, GROUP_NONE),
-#endif
   ELEM(b, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
   ELEM(base, false, false, GROUP_HEAD_CONTENT, GROUP_NONE),
   ELEM(basefont, false, false, GROUP_SPECIAL, GROUP_NONE),
   ELEM(bdo, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
   ELEM(bgsound, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(big, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
   ELEM(blink, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(blockquote, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
@@ -730,19 +727,17 @@ static const nsElementInfo kElements[eHT
   ELEM(q, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
   ELEM(s, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
   ELEM(samp, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
   ELEM(script, true, false, GROUP_HEAD_CONTENT | GROUP_SPECIAL,
        GROUP_LEAF),
   ELEM(section, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(select, true, false, GROUP_FORMCONTROL, GROUP_SELECT_CONTENT),
   ELEM(small, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
-#if defined(MOZ_MEDIA)
   ELEM(source, false, false, GROUP_NONE, GROUP_NONE),
-#endif
   ELEM(span, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
   ELEM(strike, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
   ELEM(strong, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
   ELEM(style, true, false, GROUP_HEAD_CONTENT, GROUP_LEAF),
   ELEM(sub, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
   ELEM(sup, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
   ELEM(table, true, false, GROUP_BLOCK, GROUP_TABLE_CONTENT),
   ELEM(tbody, true, false, GROUP_TABLE_CONTENT, GROUP_TBODY_CONTENT),
@@ -756,19 +751,17 @@ static const nsElementInfo kElements[eHT
   ELEM(title, true, false, GROUP_HEAD_CONTENT, GROUP_LEAF),
   ELEM(tr, true, false, GROUP_TBODY_CONTENT, GROUP_TR_CONTENT),
   ELEM(tt, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
   ELEM(u, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
   // XXX Can contain self and ol because editor does sublists illegally.
   ELEM(ul, true, true, GROUP_BLOCK | GROUP_OL_UL,
        GROUP_LI | GROUP_OL_UL),
   ELEM(var, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
-#if defined(MOZ_MEDIA)
   ELEM(video, false, false, GROUP_NONE, GROUP_NONE),
-#endif
   ELEM(wbr, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(xmp, false, false, GROUP_NONE, GROUP_NONE),
 
   // These aren't elements.
   ELEM(text, false, false, GROUP_LEAF, GROUP_NONE),
   ELEM(whitespace, false, false, GROUP_LEAF, GROUP_NONE),
   ELEM(newline, false, false, GROUP_LEAF, GROUP_NONE),
   ELEM(comment, false, false, GROUP_LEAF, GROUP_NONE),
--- a/parser/htmlparser/public/nsHTMLTagList.h
+++ b/parser/htmlparser/public/nsHTMLTagList.h
@@ -38,19 +38,17 @@
 HTML_TAG(a, Anchor)
 HTML_HTMLELEMENT_TAG(abbr)
 HTML_HTMLELEMENT_TAG(acronym)
 HTML_HTMLELEMENT_TAG(address)
 HTML_TAG(applet, SharedObject)
 HTML_TAG(area, Area)
 HTML_HTMLELEMENT_TAG(article)
 HTML_HTMLELEMENT_TAG(aside)
-#if defined(MOZ_MEDIA)
 HTML_TAG(audio, Audio)
-#endif
 HTML_HTMLELEMENT_TAG(b)
 HTML_TAG(base, Shared)
 HTML_TAG(basefont, Span)
 HTML_HTMLELEMENT_TAG(bdo)
 HTML_TAG(bgsound, Unknown)
 HTML_HTMLELEMENT_TAG(big)
 HTML_HTMLELEMENT_TAG(blink)
 HTML_TAG(blockquote, Shared)
@@ -133,19 +131,17 @@ HTML_TAG(pre, Pre)
 HTML_TAG(progress, Progress)
 HTML_TAG(q, Shared)
 HTML_HTMLELEMENT_TAG(s)
 HTML_HTMLELEMENT_TAG(samp)
 HTML_TAG(script, Script)
 HTML_HTMLELEMENT_TAG(section)
 HTML_TAG(select, Select)
 HTML_HTMLELEMENT_TAG(small)
-#if defined(MOZ_MEDIA)
 HTML_TAG(source, Source)
-#endif
 HTML_TAG(span, Span)
 HTML_HTMLELEMENT_TAG(strike)
 HTML_HTMLELEMENT_TAG(strong)
 HTML_TAG(style, Style)
 HTML_HTMLELEMENT_TAG(sub)
 HTML_HTMLELEMENT_TAG(sup)
 HTML_TAG(table, Table)
 HTML_TAG(tbody, TableSection)
@@ -157,19 +153,17 @@ HTML_TAG(thead, TableSection)
 HTML_TAG(template, Template)
 HTML_TAG(time, Time)
 HTML_TAG(title, Title)
 HTML_TAG(tr, TableRow)
 HTML_HTMLELEMENT_TAG(tt)
 HTML_HTMLELEMENT_TAG(u)
 HTML_TAG(ul, SharedList)
 HTML_HTMLELEMENT_TAG(var)
-#if defined(MOZ_MEDIA)
 HTML_TAG(video, Video)
-#endif
 HTML_HTMLELEMENT_TAG(wbr)
 HTML_HTMLELEMENT_TAG(xmp)
 
 
 /* These are not for tags. But they will be included in the nsHTMLTag
    enum anyway */
 
 HTML_OTHER(text)
--- a/parser/htmlparser/src/nsElementTable.cpp
+++ b/parser/htmlparser/src/nsElementTable.cpp
@@ -38,19 +38,17 @@ DECL_TAG_LIST(gOptgroupParents,{eHTMLTag
 DECL_TAG_LIST(gBodyParents,{eHTMLTag_html COMMA eHTMLTag_noframes})
 DECL_TAG_LIST(gColParents,{eHTMLTag_table COMMA eHTMLTag_colgroup})
 DECL_TAG_LIST(gFramesetParents,{eHTMLTag_html COMMA eHTMLTag_frameset})
 DECL_TAG_LIST(gLegendParents,{eHTMLTag_fieldset})
 DECL_TAG_LIST(gAreaParent,{eHTMLTag_map})
 DECL_TAG_LIST(gParamParents,{eHTMLTag_applet COMMA eHTMLTag_object})
 DECL_TAG_LIST(gTRParents,{eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA eHTMLTag_thead COMMA eHTMLTag_table})
 DECL_TAG_LIST(gTREndParents,{eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA eHTMLTag_thead COMMA eHTMLTag_table COMMA eHTMLTag_applet})
-#ifdef MOZ_MEDIA
 DECL_TAG_LIST(gSourceParents,{eHTMLTag_video COMMA eHTMLTag_audio})
-#endif
 
 //*********************************************************************************************
 //  Next, define the set of taglists for tags with special kids...
 //*********************************************************************************************
 
 DECL_TAG_LIST(gContainsText,{eHTMLTag_text COMMA eHTMLTag_newline COMMA eHTMLTag_whitespace COMMA eHTMLTag_entity})
 DECL_TAG_LIST(gUnknownKids,{eHTMLTag_html COMMA eHTMLTag_frameset})
 
@@ -85,20 +83,18 @@ DECL_TAG_LIST(gMapKids,{eHTMLTag_area})
 DECL_TAG_LIST(gPreKids,{eHTMLTag_hr COMMA eHTMLTag_center})  //note that CENTER is here for backward compatibility; it's not 4.0 spec.
 
 DECL_TAG_LIST(gTableKids,{eHTMLTag_caption COMMA eHTMLTag_col COMMA eHTMLTag_colgroup COMMA eHTMLTag_form COMMA  eHTMLTag_thead COMMA eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA eHTMLTag_script})// Removed INPUT - Ref. Bug 20087, 25382
   
 DECL_TAG_LIST(gTableElemKids,{eHTMLTag_form COMMA eHTMLTag_noscript COMMA eHTMLTag_script COMMA eHTMLTag_td COMMA eHTMLTag_th COMMA eHTMLTag_tr})
 DECL_TAG_LIST(gTRKids,{eHTMLTag_td COMMA eHTMLTag_th COMMA eHTMLTag_form COMMA eHTMLTag_script})// Removed INPUT - Ref. Bug 20087, 25382 |  Removed MAP to fix 58942
 DECL_TAG_LIST(gTBodyKids,{eHTMLTag_tr COMMA eHTMLTag_form}) // Removed INPUT - Ref. Bug 20087, 25382
 DECL_TAG_LIST(gULKids,{eHTMLTag_li COMMA eHTMLTag_p})
-#ifdef MOZ_MEDIA
 DECL_TAG_LIST(gVideoKids,{eHTMLTag_source})
 DECL_TAG_LIST(gAudioKids,{eHTMLTag_source})
-#endif
 
 //*********************************************************************************************
 // The following tag lists are used to define common set of root notes for the HTML elements...
 //*********************************************************************************************
 
 DECL_TAG_LIST(gRootTags,{eHTMLTag_body COMMA eHTMLTag_td COMMA eHTMLTag_table COMMA eHTMLTag_applet COMMA eHTMLTag_select}) // Added SELECT to fix bug 98645
 DECL_TAG_LIST(gTableRootTags,{eHTMLTag_applet COMMA eHTMLTag_body COMMA eHTMLTag_dl COMMA eHTMLTag_ol COMMA eHTMLTag_td COMMA eHTMLTag_th})
 DECL_TAG_LIST(gHTMLRootTags,{eHTMLTag_unknown})
@@ -229,27 +225,25 @@ const nsHTMLElement gHTMLElements[] = {
     /*tag*/                             eHTMLTag_aside,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
     /*autoclose starttags and endtags*/ 0,0,0,0,
     /*parent,incl,exclgroups*/          kBlock, (kSelf|kFlowEntity), kNone,
     /*special props, prop-range*/       0,kDefaultPropRange,
     /*special parents,kids*/            0,0,
   },
-#if defined(MOZ_MEDIA)
   {
     /*tag*/                             eHTMLTag_audio,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
     /*autoclose starttags and endtags*/ 0, 0, 0,0,
     /*parent,incl,exclgroups*/          kSpecial, (kFlowEntity|kSelf), kNone,
     /*special props, prop-range*/       0,kDefaultPropRange,
     /*special parents,kids*/            0,&gAudioKids,
   },
-#endif
   {
     /*tag*/                             eHTMLTag_b,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
     /*autoclose starttags and endtags*/ 0,0,0,0,
     /*parent,incl,exclgroups*/          kFontStyle, (kInlineEntity|kSelf), kNone,
     /*special props, prop-range*/       0, kDefaultPropRange,
     /*special parents,kids*/            0,0,
@@ -1069,27 +1063,25 @@ const nsHTMLElement gHTMLElements[] = {
     /*tag*/                             eHTMLTag_small,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
     /*autoclose starttags and endtags*/ 0,0,0,0,
     /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,
     /*special props, prop-range*/       0, kDefaultPropRange,
     /*special parents,kids*/            0,0,
   },
-#if defined(MOZ_MEDIA)
   {
     /*tag*/                             eHTMLTag_source,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gSourceParents,&gSourceParents,
     /*autoclose starttags and endtags*/ &gPAutoClose, 0, 0,0,
     /*parent,incl,exclgroups*/          kSpecial, kNone, kNone,
     /*special props, prop-range*/       kNonContainer,kNoPropRange,
     /*special parents,kids*/            &gSourceParents,0,
   },
-#endif
   {
     
           // I made span a special% tag again, (instead of inline).
           // This fixes the case:  <font color="blue"><p><span>text</span>
 
     /*tag*/                             eHTMLTag_span,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
@@ -1277,27 +1269,25 @@ const nsHTMLElement gHTMLElements[] = {
     /*tag*/                             eHTMLTag_var,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
     /*autoclose starttags and endtags*/ 0,0,0,0,
     /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,
     /*special props, prop-range*/       0,kDefaultPropRange,
     /*special parents,kids*/            0,0,
   },
-#if defined(MOZ_MEDIA)
   {
     /*tag*/                             eHTMLTag_video,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
     /*autoclose starttags and endtags*/ 0, 0, 0,0,
     /*parent,incl,exclgroups*/          kSpecial, (kFlowEntity|kSelf), kNone,
     /*special props, prop-range*/       0,kDefaultPropRange,
     /*special parents,kids*/            0,&gVideoKids,
   },
-#endif
   {
     /*tag*/                             eHTMLTag_wbr,
     /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
     /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,
     /*autoclose starttags and endtags*/ 0,0,0,0,
     /*parent,incl,exclgroups*/          kExtensions, kNone, kNone,
     /*special props, prop-range*/       kNonContainer|kRequiresBody,kNoPropRange,
     /*special parents,kids*/            0,0,
--- a/parser/htmlparser/src/nsHTMLTags.cpp
+++ b/parser/htmlparser/src/nsHTMLTags.cpp
@@ -30,20 +30,18 @@ static const PRUnichar sHTMLTagUnicodeNa
 static const PRUnichar sHTMLTagUnicodeName_applet[] =
   {'a', 'p', 'p', 'l', 'e', 't', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_area[] =
   {'a', 'r', 'e', 'a', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_article[] =
   {'a', 'r', 't', 'i', 'c', 'l', 'e', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_aside[] =
   {'a', 's', 'i', 'd', 'e', '\0'};
-#if defined(MOZ_MEDIA)
 static const PRUnichar sHTMLTagUnicodeName_audio[] =
   {'a', 'u', 'd', 'i', 'o', '\0'};
-#endif
 static const PRUnichar sHTMLTagUnicodeName_b[] =
   {'b', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_base[] =
   {'b', 'a', 's', 'e', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_basefont[] =
   {'b', 'a', 's', 'e', 'f', 'o', 'n', 't', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_bdo[] =
   {'b', 'd', 'o', '\0'};
@@ -220,20 +218,18 @@ static const PRUnichar sHTMLTagUnicodeNa
 static const PRUnichar sHTMLTagUnicodeName_script[] =
   {'s', 'c', 'r', 'i', 'p', 't', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_section[] =
   {'s', 'e', 'c', 't', 'i', 'o', 'n', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_select[] =
   {'s', 'e', 'l', 'e', 'c', 't', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_small[] =
   {'s', 'm', 'a', 'l', 'l', '\0'};
-#if defined(MOZ_MEDIA)
 static const PRUnichar sHTMLTagUnicodeName_source[] =
   {'s', 'o', 'u', 'r', 'c', 'e', '\0'};
-#endif
 static const PRUnichar sHTMLTagUnicodeName_spacer[] =
   {'s', 'p', 'a', 'c', 'e', 'r', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_span[] =
   {'s', 'p', 'a', 'n', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_strike[] =
   {'s', 't', 'r', 'i', 'k', 'e', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_strong[] =
   {'s', 't', 'r', 'o', 'n', 'g', '\0'};
@@ -268,20 +264,18 @@ static const PRUnichar sHTMLTagUnicodeNa
 static const PRUnichar sHTMLTagUnicodeName_tt[] =
   {'t', 't', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_u[] =
   {'u', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_ul[] =
   {'u', 'l', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_var[] =
   {'v', 'a', 'r', '\0'};
-#if defined(MOZ_MEDIA)
 static const PRUnichar sHTMLTagUnicodeName_video[] =
   {'v', 'i', 'd', 'e', 'o', '\0'};
-#endif
 static const PRUnichar sHTMLTagUnicodeName_wbr[] =
   {'w', 'b', 'r', '\0'};
 static const PRUnichar sHTMLTagUnicodeName_xmp[] =
   {'x', 'm', 'p', '\0'};
 
 // static array of unicode tag names
 #define HTML_TAG(_tag, _classname) sHTMLTagUnicodeName_##_tag,
 #define HTML_HTMLELEMENT_TAG(_tag) sHTMLTagUnicodeName_##_tag,