Bug 1400777 (part 5) - Clean up nsElementTable.{cpp,h}. r=mrbkap.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 20 Sep 2017 08:32:51 +1000
changeset 668879 84bde7821021d9661c841e7d40bfb7e3a18393ee
parent 668878 50d9715e7b0ada2111baa0d51fa888135f78d1d7
child 668880 d16d4dacc88434dee7dfb9df9fdb90da5f599bf2
push id81146
push userbmo:topwu.tw@gmail.com
push dateFri, 22 Sep 2017 05:24:51 +0000
reviewersmrbkap
bugs1400777
milestone58.0a1
Bug 1400777 (part 5) - Clean up nsElementTable.{cpp,h}. r=mrbkap. This patch makes some style fixes and other minor improvements.
parser/htmlparser/nsElementTable.cpp
parser/htmlparser/nsElementTable.h
--- a/parser/htmlparser/nsElementTable.cpp
+++ b/parser/htmlparser/nsElementTable.cpp
@@ -1,16 +1,14 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 sw=2 et tw=78: */
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "nsIAtom.h"
 #include "nsElementTable.h"
 
 static const int kNone= 0x0;
 
 static const int kHTMLContent   = 0x0001; //  HEAD, (FRAMESET | BODY)
 static const int kHeadContent   = 0x0002; //  Elements that *must* be in the head.
 static const int kHeadMisc      = 0x0004; //  Elements that *can* be in the head.
 
@@ -217,34 +215,36 @@ static const HTMLElement gHTMLElements[]
   ELEM(doctypeDecl, kFlowEntity,                 false)
   ELEM(markupDecl,  kFlowEntity,                 false)
   ELEM(instruction, kFlowEntity,                 false)
   ELEM(userdefined, (kFlowEntity|kHeadMisc),     false)
 };
 
 #undef ELEM
 
-/*********************************************************************************************/
-
-bool nsHTMLElement::IsContainer(nsHTMLTag aId)
+bool
+nsHTMLElement::IsContainer(nsHTMLTag aId)
 {
   return !gHTMLElements[aId].mLeaf;
 }
 
-bool nsHTMLElement::IsBlock(nsHTMLTag 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()
+void
+CheckElementTable()
 {
   for (nsHTMLTag t = eHTMLTag_unknown;
        t <= eHTMLTag_userdefined;
        t = nsHTMLTag(t + 1)) {
-    NS_ASSERTION(gHTMLElements[t].mTagID == t, "gHTMLElements entries does match tag list.");
+    MOZ_ASSERT(gHTMLElements[t].mTagID == t,
+               "gHTMLElements entries does match tag list.");
   }
 }
 #endif
--- a/parser/htmlparser/nsElementTable.h
+++ b/parser/htmlparser/nsElementTable.h
@@ -1,31 +1,22 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
-
-/**
- * MODULE NOTES:
- * @update  gess 4/1/98
- * 
- */
-
-
-
-#ifndef _NSELEMENTABLE
-#define _NSELEMENTABLE
+#ifndef nsElementTable_h
+#define nsElementTable_h
 
 #include "nsHTMLTags.h"
-#include "nsIDTD.h"
 
 #ifdef DEBUG
-extern void CheckElementTable();
+void CheckElementTable();
 #endif
 
 struct nsHTMLElement
 {
-  static  bool    IsContainer(nsHTMLTag aTag);
-  static  bool    IsBlock(nsHTMLTag aTag);
+  static bool IsContainer(nsHTMLTag aTag);
+  static bool IsBlock(nsHTMLTag aTag);
 };
 
-#endif
+#endif // nsElementTable_h