Bug 1400777 (part 1) - Remove eHTMLTags. r=mrbkap.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 19 Sep 2017 11:07:49 +1000
changeset 668875 5835c5943a4881567e2d1e9ce1a8a6b0f97cf200
parent 668874 f4e02a5eb8f07ce46c75d141a68b69c46efe0c14
child 668876 2b23e3f158dd747de9c40c068d4e9a5da583cf98
push id81146
push userbmo:topwu.tw@gmail.com
push dateFri, 22 Sep 2017 05:24:51 +0000
reviewersmrbkap
bugs1400777
milestone58.0a1
Bug 1400777 (part 1) - Remove eHTMLTags. r=mrbkap. It's just a too-cute-by-half typedef for nsHTMLTag.
editor/libeditor/HTMLEditUtils.cpp
parser/htmlparser/nsElementTable.cpp
parser/htmlparser/nsElementTable.h
parser/htmlparser/nsHTMLTags.h
--- a/editor/libeditor/HTMLEditUtils.cpp
+++ b/editor/libeditor/HTMLEditUtils.cpp
@@ -567,17 +567,17 @@ HTMLEditUtils::SupportsAlignAttr(nsINode
   (GROUP_FONTSTYLE | GROUP_PHRASE | GROUP_SPECIAL | GROUP_FORMCONTROL | \
    GROUP_LEAF)
 
 #define GROUP_FLOW_ELEMENT (GROUP_INLINE_ELEMENT | GROUP_BLOCK)
 
 struct ElementInfo final
 {
 #ifdef DEBUG
-  eHTMLTags mTag;
+  nsHTMLTag mTag;
 #endif
   uint32_t mGroup;
   uint32_t mCanContainGroups;
   bool mIsContainer;
   bool mCanContainSelf;
 };
 
 #ifdef DEBUG
@@ -782,17 +782,17 @@ HTMLEditUtils::CanContain(int32_t aParen
       NS_ASSERTION(kElements[i - 1].mTag == i,
                    "You need to update kElements (missing tags).");
     }
   }
 #endif
 
   // Special-case button.
   if (aParent == eHTMLTag_button) {
-    static const eHTMLTags kButtonExcludeKids[] = {
+    static const nsHTMLTag kButtonExcludeKids[] = {
       eHTMLTag_a,
       eHTMLTag_fieldset,
       eHTMLTag_form,
       eHTMLTag_iframe,
       eHTMLTag_input,
       eHTMLTag_select,
       eHTMLTag_textarea
     };
--- a/parser/htmlparser/nsElementTable.cpp
+++ b/parser/htmlparser/nsElementTable.cpp
@@ -174,30 +174,32 @@ const nsHTMLElement gHTMLElements[] = {
 
 /*********************************************************************************************/
 
 bool nsHTMLElement::IsMemberOf(int32_t aSet) const
 {
   return TestBits(aSet, mParentBits);
 }
 
-bool nsHTMLElement::IsContainer(eHTMLTags aId)
+bool nsHTMLElement::IsContainer(nsHTMLTag aId)
 {
   return !gHTMLElements[aId].mLeaf;
 }
 
-bool nsHTMLElement::IsBlock(eHTMLTags aId)
+bool nsHTMLElement::IsBlock(nsHTMLTag aId)
 {
   return gHTMLElements[aId].IsMemberOf(kBlock)       ||
          gHTMLElements[aId].IsMemberOf(kBlockEntity) ||
          gHTMLElements[aId].IsMemberOf(kHeading)     ||
          gHTMLElements[aId].IsMemberOf(kPreformatted)||
          gHTMLElements[aId].IsMemberOf(kList);
 }
 
 #ifdef DEBUG
 void CheckElementTable()
 {
-  for (eHTMLTags t = eHTMLTag_unknown; t <= eHTMLTag_userdefined; t = eHTMLTags(t + 1)) {
+  for (nsHTMLTag t = eHTMLTag_unknown;
+       t <= eHTMLTag_userdefined;
+       t = nsHTMLTag(t + 1)) {
     NS_ASSERTION(gHTMLElements[t].mTagID == t, "gHTMLElements entries does match tag list.");
   }
 }
 #endif
--- a/parser/htmlparser/nsElementTable.h
+++ b/parser/htmlparser/nsElementTable.h
@@ -76,20 +76,20 @@ inline bool TestBits(int aBitset,int aTe
   }
   return false;
 }
 
 struct nsHTMLElement {
   bool            IsMemberOf(int32_t aType) const;
 
 #ifdef DEBUG
-  eHTMLTags       mTagID;
+  nsHTMLTag       mTagID;
 #endif
   int             mParentBits;        //defines groups that can contain this element
   bool            mLeaf;
 
-  static  bool    IsContainer(eHTMLTags aTag);
-  static  bool    IsBlock(eHTMLTags aTag);
+  static  bool    IsContainer(nsHTMLTag aTag);
+  static  bool    IsBlock(nsHTMLTag aTag);
 };
 
 extern const nsHTMLElement gHTMLElements[];
 
 #endif
--- a/parser/htmlparser/nsHTMLTags.h
+++ b/parser/htmlparser/nsHTMLTags.h
@@ -79,11 +79,9 @@ private:
   static nsIAtom* sTagAtomTable[eHTMLTag_userdefined - 1];
   static const char16_t* const sTagUnicodeTable[];
 
   static int32_t gTableRefCount;
   static PLHashTable* gTagTable;
   static PLHashTable* gTagAtomTable;
 };
 
-#define eHTMLTags nsHTMLTag
-
 #endif /* nsHTMLTags_h___ */