summaryrefslogtreecommitdiffstats
path: root/parser/htmlparser/nsElementTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'parser/htmlparser/nsElementTable.cpp')
-rw-r--r--parser/htmlparser/nsElementTable.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/parser/htmlparser/nsElementTable.cpp b/parser/htmlparser/nsElementTable.cpp
index 86fbdad86..52507a976 100644
--- a/parser/htmlparser/nsElementTable.cpp
+++ b/parser/htmlparser/nsElementTable.cpp
@@ -174,14 +174,23 @@ const nsHTMLElement gHTMLElements[] = {
/*********************************************************************************************/
-bool nsHTMLElement::IsContainer(eHTMLTags aChild)
+bool nsHTMLElement::IsMemberOf(int32_t aSet) const
{
- return !gHTMLElements[aChild].mLeaf;
+ return TestBits(aSet, mParentBits);
}
-bool nsHTMLElement::IsMemberOf(int32_t aSet) const
+bool nsHTMLElement::IsContainer(eHTMLTags aId)
+{
+ return !gHTMLElements[aId].mLeaf;
+}
+
+bool nsHTMLElement::IsBlock(eHTMLTags aId)
{
- return TestBits(aSet,mParentBits);
+ return gHTMLElements[aId].IsMemberOf(kBlock) ||
+ gHTMLElements[aId].IsMemberOf(kBlockEntity) ||
+ gHTMLElements[aId].IsMemberOf(kHeading) ||
+ gHTMLElements[aId].IsMemberOf(kPreformatted)||
+ gHTMLElements[aId].IsMemberOf(kList);
}
#ifdef DEBUG