mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1134280 - Get rid of Tag() - patch 1 - Is{HTML,XUL,MathML,SVG}Element and IsAnyOf{HTML,XUL,MathML,SVG}Elements, r=smaug
This commit is contained in:
parent
704be780d1
commit
454d9140a2
@ -155,7 +155,7 @@ HTMLLabelIterator::Next()
|
||||
Accessible* walkUp = mAcc->Parent();
|
||||
while (walkUp && !walkUp->IsDoc()) {
|
||||
nsIContent* walkUpElm = walkUp->GetContent();
|
||||
if (walkUpElm->IsHTML()) {
|
||||
if (walkUpElm->IsHTMLElement()) {
|
||||
if (walkUpElm->Tag() == nsGkAtoms::label &&
|
||||
!walkUpElm->HasAttr(kNameSpaceID_None, nsGkAtoms::_for)) {
|
||||
mLabelFilter = eSkipAncestorLabel; // prevent infinite loop
|
||||
|
@ -872,7 +872,7 @@ TextAttrsMgr::TextPosTextAttr::
|
||||
}
|
||||
|
||||
const nsIContent* content = aFrame->GetContent();
|
||||
if (content && content->IsHTML()) {
|
||||
if (content && content->IsHTMLElement()) {
|
||||
const nsIAtom* tagName = content->Tag();
|
||||
if (tagName == nsGkAtoms::sup)
|
||||
return eTextPosSuper;
|
||||
|
@ -893,7 +893,8 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
|
||||
#ifdef DEBUG
|
||||
nsImageFrame* imageFrame = do_QueryFrame(frame);
|
||||
NS_ASSERTION(imageFrame && content->IsHTML() && content->Tag() == nsGkAtoms::area,
|
||||
NS_ASSERTION(imageFrame && content->IsHTMLElement() &&
|
||||
content->Tag() == nsGkAtoms::area,
|
||||
"Unknown case of not main content for the frame!");
|
||||
#endif
|
||||
return nullptr;
|
||||
@ -901,7 +902,8 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
|
||||
#ifdef DEBUG
|
||||
nsImageFrame* imageFrame = do_QueryFrame(frame);
|
||||
NS_ASSERTION(!imageFrame || !content->IsHTML() || content->Tag() != nsGkAtoms::area,
|
||||
NS_ASSERTION(!imageFrame || !content->IsHTMLElement() ||
|
||||
content->Tag() != nsGkAtoms::area,
|
||||
"Image map manages the area accessible creation!");
|
||||
#endif
|
||||
|
||||
@ -931,7 +933,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
return newAcc;
|
||||
}
|
||||
|
||||
bool isHTML = content->IsHTML();
|
||||
bool isHTML = content->IsHTMLElement();
|
||||
if (isHTML && content->Tag() == nsGkAtoms::map) {
|
||||
// Create hyper text accessible for HTML map if it is used to group links
|
||||
// (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML
|
||||
@ -1021,7 +1023,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
}
|
||||
|
||||
// Accessible XBL types and deck stuff are used in XUL only currently.
|
||||
if (!newAcc && content->IsXUL()) {
|
||||
if (!newAcc && content->IsXULElement()) {
|
||||
// No accessible for not selected deck panel and its children.
|
||||
if (!aContext->IsXULTabpanels()) {
|
||||
nsDeckFrame* deckFrame = do_QueryFrame(frame->GetParent());
|
||||
@ -1050,7 +1052,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
}
|
||||
|
||||
if (!newAcc) {
|
||||
if (content->IsSVG()) {
|
||||
if (content->IsSVGElement()) {
|
||||
nsSVGPathGeometryFrame* pathGeometryFrame = do_QueryFrame(frame);
|
||||
if (pathGeometryFrame) {
|
||||
// A graphic elements: rect, circle, ellipse, line, path, polygon,
|
||||
@ -1060,7 +1062,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
} else if (content->Tag() == nsGkAtoms::svg) {
|
||||
newAcc = new EnumRoleAccessible(content, document, roles::DIAGRAM);
|
||||
}
|
||||
} else if (content->IsMathML()){
|
||||
} else if (content->IsMathMLElement()) {
|
||||
if (content->Tag() == nsGkAtoms::math)
|
||||
newAcc = new EnumRoleAccessible(content, document, roles::EQUATION);
|
||||
else
|
||||
@ -1264,7 +1266,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
||||
|
||||
for (nsIContent* child = listItem->GetFirstChild(); child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsXUL(nsGkAtoms::listcell) && child != aContent) {
|
||||
if (child->IsXULElement(nsGkAtoms::listcell) && child != aContent) {
|
||||
accessible = new XULListCellAccessibleWrap(aContent, aDoc);
|
||||
break;
|
||||
}
|
||||
@ -1296,7 +1298,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
||||
// implementations on each platform for a consistent scripting environment, but
|
||||
// then strip out redundant accessibles in the AccessibleWrap class for each platform.
|
||||
nsIContent *parent = aContent->GetParent();
|
||||
if (parent && parent->IsXUL() && parent->Tag() == nsGkAtoms::menu)
|
||||
if (parent && parent->IsXULElement() && parent->Tag() == nsGkAtoms::menu)
|
||||
return nullptr;
|
||||
#endif
|
||||
|
||||
|
@ -153,7 +153,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aContent->IsHTML() &&
|
||||
if (aContent->IsHTMLElement() &&
|
||||
aContent->NodeInfo()->Equals(nsGkAtoms::br)) {
|
||||
aString->AppendLiteral("\r\n");
|
||||
return NS_OK;
|
||||
@ -301,7 +301,7 @@ nsTextEquivUtils::AppendFromDOMNode(nsIContent *aContent, nsAString *aString)
|
||||
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
|
||||
return NS_OK;
|
||||
|
||||
if (aContent->IsXUL()) {
|
||||
if (aContent->IsXULElement()) {
|
||||
nsAutoString textEquivalent;
|
||||
nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl =
|
||||
do_QueryInterface(aContent);
|
||||
|
@ -48,7 +48,7 @@ inline bool
|
||||
Accessible::IsSearchbox() const
|
||||
{
|
||||
return (mRoleMapEntry && mRoleMapEntry->Is(nsGkAtoms::searchbox)) ||
|
||||
(mContent->IsHTML(nsGkAtoms::input) &&
|
||||
(mContent->IsHTMLElement(nsGkAtoms::input) &&
|
||||
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
|
||||
nsGkAtoms::textInputType, eCaseMatters));
|
||||
}
|
||||
|
@ -141,22 +141,22 @@ Accessible::Name(nsString& aName)
|
||||
return nameFlag;
|
||||
|
||||
// In the end get the name from tooltip.
|
||||
if (mContent->IsHTML()) {
|
||||
if (mContent->IsHTMLElement()) {
|
||||
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aName)) {
|
||||
aName.CompressWhitespace();
|
||||
return eNameFromTooltip;
|
||||
}
|
||||
} else if (mContent->IsXUL()) {
|
||||
} else if (mContent->IsXULElement()) {
|
||||
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aName)) {
|
||||
aName.CompressWhitespace();
|
||||
return eNameFromTooltip;
|
||||
}
|
||||
} else if (mContent->IsSVG()) {
|
||||
} else if (mContent->IsSVGElement()) {
|
||||
// If user agents need to choose among multiple ‘desc’ or ‘title’ elements
|
||||
// for processing, the user agent shall choose the first one.
|
||||
for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
|
||||
childElm = childElm->GetNextSibling()) {
|
||||
if (childElm->IsSVG(nsGkAtoms::desc)) {
|
||||
if (childElm->IsSVGElement(nsGkAtoms::desc)) {
|
||||
nsTextEquivUtils::AppendTextEquivFromContent(this, childElm, &aName);
|
||||
return eNameFromTooltip;
|
||||
}
|
||||
@ -186,7 +186,7 @@ Accessible::Description(nsString& aDescription)
|
||||
aDescription);
|
||||
|
||||
if (aDescription.IsEmpty()) {
|
||||
bool isXUL = mContent->IsXUL();
|
||||
bool isXUL = mContent->IsXULElement();
|
||||
if (isXUL) {
|
||||
// Try XUL <description control="[id]">description text</description>
|
||||
XULDescriptionIterator iter(Document(), mContent);
|
||||
@ -199,14 +199,14 @@ Accessible::Description(nsString& aDescription)
|
||||
|
||||
if (aDescription.IsEmpty()) {
|
||||
// Keep the Name() method logic.
|
||||
if (mContent->IsHTML()) {
|
||||
if (mContent->IsHTMLElement()) {
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aDescription);
|
||||
} else if (mContent->IsXUL()) {
|
||||
} else if (mContent->IsXULElement()) {
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aDescription);
|
||||
} else if (mContent->IsSVG()) {
|
||||
} else if (mContent->IsSVGElement()) {
|
||||
for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
|
||||
childElm = childElm->GetNextSibling()) {
|
||||
if (childElm->IsSVG(nsGkAtoms::desc)) {
|
||||
if (childElm->IsSVGElement(nsGkAtoms::desc)) {
|
||||
nsTextEquivUtils::AppendTextEquivFromContent(this, childElm,
|
||||
&aDescription);
|
||||
break;
|
||||
@ -237,14 +237,14 @@ Accessible::AccessKey() const
|
||||
Accessible* label = nullptr;
|
||||
|
||||
// Copy access key from label node.
|
||||
if (mContent->IsHTML()) {
|
||||
if (mContent->IsHTMLElement()) {
|
||||
// Unless it is labeled via an ancestor <label>, in which case that would
|
||||
// be redundant.
|
||||
HTMLLabelIterator iter(Document(), this,
|
||||
HTMLLabelIterator::eSkipAncestorLabel);
|
||||
label = iter.Next();
|
||||
|
||||
} else if (mContent->IsXUL()) {
|
||||
} else if (mContent->IsXULElement()) {
|
||||
XULLabelIterator iter(Document(), mContent);
|
||||
label = iter.Next();
|
||||
}
|
||||
@ -354,7 +354,7 @@ Accessible::VisibilityState()
|
||||
nsIFrame* parentFrame = curFrame->GetParent();
|
||||
nsDeckFrame* deckFrame = do_QueryFrame(parentFrame);
|
||||
if (deckFrame && deckFrame->GetSelectedBox() != curFrame) {
|
||||
if (deckFrame->GetContent()->IsXUL() &&
|
||||
if (deckFrame->GetContent()->IsXULElement() &&
|
||||
deckFrame->GetContent()->Tag() == nsGkAtoms::tabpanels)
|
||||
return states::OFFSCREEN;
|
||||
|
||||
@ -435,7 +435,7 @@ Accessible::NativeState()
|
||||
|
||||
// XXX we should look at layout for non XUL box frames, but need to decide
|
||||
// how that interacts with ARIA.
|
||||
if (HasOwnContent() && mContent->IsXUL() && frame->IsBoxFrame()) {
|
||||
if (HasOwnContent() && mContent->IsXULElement() && frame->IsBoxFrame()) {
|
||||
const nsStyleXUL* xulStyle = frame->StyleXUL();
|
||||
if (xulStyle && frame->IsBoxFrame()) {
|
||||
// In XUL all boxes are either vertical or horizontal
|
||||
@ -448,7 +448,7 @@ Accessible::NativeState()
|
||||
}
|
||||
|
||||
// Check if a XUL element has the popup attribute (an attached popup menu).
|
||||
if (HasOwnContent() && mContent->IsXUL() &&
|
||||
if (HasOwnContent() && mContent->IsXULElement() &&
|
||||
mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
|
||||
state |= states::HASPOPUP;
|
||||
|
||||
@ -485,7 +485,7 @@ Accessible::NativeLinkState() const
|
||||
bool
|
||||
Accessible::NativelyUnavailable() const
|
||||
{
|
||||
if (mContent->IsHTML())
|
||||
if (mContent->IsHTMLElement())
|
||||
return mContent->AsElement()->State().HasState(NS_EVENT_STATE_DISABLED);
|
||||
|
||||
return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
|
||||
@ -1519,9 +1519,9 @@ Accessible::RelationByType(RelationType aType)
|
||||
case RelationType::LABELLED_BY: {
|
||||
Relation rel(new IDRefsIterator(mDoc, mContent,
|
||||
nsGkAtoms::aria_labelledby));
|
||||
if (mContent->IsHTML()) {
|
||||
if (mContent->IsHTMLElement()) {
|
||||
rel.AppendIter(new HTMLLabelIterator(Document(), this));
|
||||
} else if (mContent->IsXUL()) {
|
||||
} else if (mContent->IsXULElement()) {
|
||||
rel.AppendIter(new XULLabelIterator(Document(), mContent));
|
||||
}
|
||||
|
||||
@ -1531,7 +1531,7 @@ Accessible::RelationByType(RelationType aType)
|
||||
case RelationType::LABEL_FOR: {
|
||||
Relation rel(new RelatedAccIterator(Document(), mContent,
|
||||
nsGkAtoms::aria_labelledby));
|
||||
if (mContent->Tag() == nsGkAtoms::label && mContent->IsXUL())
|
||||
if (mContent->Tag() == nsGkAtoms::label && mContent->IsXULElement())
|
||||
rel.AppendIter(new IDRefsIterator(mDoc, mContent, nsGkAtoms::control));
|
||||
|
||||
return rel;
|
||||
@ -1540,7 +1540,7 @@ Accessible::RelationByType(RelationType aType)
|
||||
case RelationType::DESCRIBED_BY: {
|
||||
Relation rel(new IDRefsIterator(mDoc, mContent,
|
||||
nsGkAtoms::aria_describedby));
|
||||
if (mContent->IsXUL())
|
||||
if (mContent->IsXULElement())
|
||||
rel.AppendIter(new XULDescriptionIterator(Document(), mContent));
|
||||
|
||||
return rel;
|
||||
@ -1554,7 +1554,7 @@ Accessible::RelationByType(RelationType aType)
|
||||
// which only affects accessibility, by allowing the description to be
|
||||
// tied to a control.
|
||||
if (mContent->Tag() == nsGkAtoms::description &&
|
||||
mContent->IsXUL())
|
||||
mContent->IsXULElement())
|
||||
rel.AppendIter(new IDRefsIterator(mDoc, mContent,
|
||||
nsGkAtoms::control));
|
||||
|
||||
@ -1639,7 +1639,7 @@ Accessible::RelationByType(RelationType aType)
|
||||
return Relation();
|
||||
|
||||
case RelationType::DEFAULT_BUTTON: {
|
||||
if (mContent->IsHTML()) {
|
||||
if (mContent->IsHTMLElement()) {
|
||||
// HTML form controls implements nsIFormControl interface.
|
||||
nsCOMPtr<nsIFormControl> control(do_QueryInterface(mContent));
|
||||
if (control) {
|
||||
@ -1874,7 +1874,7 @@ Accessible::ARIAName(nsString& aName)
|
||||
ENameValueFlag
|
||||
Accessible::NativeName(nsString& aName)
|
||||
{
|
||||
if (mContent->IsHTML()) {
|
||||
if (mContent->IsHTMLElement()) {
|
||||
Accessible* label = nullptr;
|
||||
HTMLLabelIterator iter(Document(), this);
|
||||
while ((label = iter.Next())) {
|
||||
@ -1890,7 +1890,7 @@ Accessible::NativeName(nsString& aName)
|
||||
return aName.IsEmpty() ? eNameOK : eNameFromSubtree;
|
||||
}
|
||||
|
||||
if (mContent->IsXUL()) {
|
||||
if (mContent->IsXULElement()) {
|
||||
XULElmName(mDoc, mContent, aName);
|
||||
if (!aName.IsEmpty())
|
||||
return eNameOK;
|
||||
@ -1899,12 +1899,12 @@ Accessible::NativeName(nsString& aName)
|
||||
return aName.IsEmpty() ? eNameOK : eNameFromSubtree;
|
||||
}
|
||||
|
||||
if (mContent->IsSVG()) {
|
||||
if (mContent->IsSVGElement()) {
|
||||
// If user agents need to choose among multiple ‘desc’ or ‘title’ elements
|
||||
// for processing, the user agent shall choose the first one.
|
||||
for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
|
||||
childElm = childElm->GetNextSibling()) {
|
||||
if (childElm->IsSVG(nsGkAtoms::title)) {
|
||||
if (childElm->IsSVGElement(nsGkAtoms::title)) {
|
||||
nsTextEquivUtils::AppendTextEquivFromContent(this, childElm, &aName);
|
||||
return eNameOK;
|
||||
}
|
||||
@ -2526,7 +2526,7 @@ Accessible::GetActionRule() const
|
||||
return eNoAction;
|
||||
|
||||
// Return "click" action on elements that have an attached popup menu.
|
||||
if (mContent->IsXUL())
|
||||
if (mContent->IsXULElement())
|
||||
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
|
||||
return eClickAction;
|
||||
|
||||
|
@ -565,7 +565,7 @@ public:
|
||||
|
||||
inline bool IsAbbreviation() const
|
||||
{
|
||||
return mContent->IsHTML() &&
|
||||
return mContent->IsHTMLElement() &&
|
||||
(mContent->Tag() == nsGkAtoms::abbr || mContent->Tag() == nsGkAtoms::acronym);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ DocAccessible::
|
||||
mPresShell->SetDocAccessible(this);
|
||||
|
||||
// If this is a XUL Document, it should not implement nsHyperText
|
||||
if (mDocumentNode && mDocumentNode->IsXUL())
|
||||
if (mDocumentNode && mDocumentNode->IsXULDocument())
|
||||
mGenericTypes &= ~eHyperText;
|
||||
}
|
||||
|
||||
@ -875,7 +875,8 @@ DocAccessible::AttributeChangedImpl(Accessible* aAccessible,
|
||||
}
|
||||
|
||||
// ARIA or XUL selection
|
||||
if ((aAccessible->GetContent()->IsXUL() && aAttribute == nsGkAtoms::selected) ||
|
||||
if ((aAccessible->GetContent()->IsXULElement() &&
|
||||
aAttribute == nsGkAtoms::selected) ||
|
||||
aAttribute == nsGkAtoms::aria_selected) {
|
||||
Accessible* widget =
|
||||
nsAccUtils::GetSelectableContainer(aAccessible, aAccessible->State());
|
||||
@ -1337,7 +1338,7 @@ DocAccessible::ProcessInvalidationList()
|
||||
Accessible*
|
||||
DocAccessible::GetAccessibleEvenIfNotInMap(nsINode* aNode) const
|
||||
{
|
||||
if (!aNode->IsContent() || !aNode->AsContent()->IsHTML(nsGkAtoms::area))
|
||||
if (!aNode->IsContent() || !aNode->AsContent()->IsHTMLElement(nsGkAtoms::area))
|
||||
return GetAccessible(aNode);
|
||||
|
||||
// XXX Bug 135040, incorrect when multiple images use the same map.
|
||||
@ -1499,13 +1500,13 @@ DocAccessible::AddDependentIDsFor(dom::Element* aRelProviderElm,
|
||||
continue;
|
||||
|
||||
if (relAttr == nsGkAtoms::_for) {
|
||||
if (!aRelProviderElm->IsHTML() ||
|
||||
if (!aRelProviderElm->IsHTMLElement() ||
|
||||
(aRelProviderElm->Tag() != nsGkAtoms::label &&
|
||||
aRelProviderElm->Tag() != nsGkAtoms::output))
|
||||
continue;
|
||||
|
||||
} else if (relAttr == nsGkAtoms::control) {
|
||||
if (!aRelProviderElm->IsXUL() ||
|
||||
if (!aRelProviderElm->IsXULElement() ||
|
||||
(aRelProviderElm->Tag() != nsGkAtoms::label &&
|
||||
aRelProviderElm->Tag() != nsGkAtoms::description))
|
||||
continue;
|
||||
|
@ -294,7 +294,7 @@ HyperTextAccessible::DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
|
||||
Accessible* descendant = nullptr;
|
||||
if (findNode) {
|
||||
nsCOMPtr<nsIContent> findContent(do_QueryInterface(findNode));
|
||||
if (findContent && findContent->IsHTML() &&
|
||||
if (findContent && findContent->IsHTMLElement() &&
|
||||
findContent->NodeInfo()->Equals(nsGkAtoms::br) &&
|
||||
findContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::mozeditorbogusnode,
|
||||
@ -1692,7 +1692,7 @@ HyperTextAccessible::NativeName(nsString& aName)
|
||||
{
|
||||
// Check @alt attribute for invalid img elements.
|
||||
bool hasImgAlt = false;
|
||||
if (mContent->IsHTML(nsGkAtoms::img)) {
|
||||
if (mContent->IsHTMLElement(nsGkAtoms::img)) {
|
||||
hasImgAlt = mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName);
|
||||
if (!aName.IsEmpty())
|
||||
return eNameOK;
|
||||
|
@ -199,7 +199,8 @@ ImageAccessible::GetLongDescURI() const
|
||||
if (document) {
|
||||
IDRefsIterator iter(document, mContent, nsGkAtoms::aria_describedby);
|
||||
while (nsIContent* target = iter.NextElem()) {
|
||||
if ((target->IsHTML(nsGkAtoms::a) || target->IsHTML(nsGkAtoms::area)) &&
|
||||
if ((target->IsHTMLElement(nsGkAtoms::a) ||
|
||||
target->IsHTMLElement(nsGkAtoms::area)) &&
|
||||
target->HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
|
||||
nsGenericHTMLElement* element =
|
||||
nsGenericHTMLElement::FromContent(target);
|
||||
|
@ -126,7 +126,7 @@ HTMLSelectListAccessible::CacheChildren()
|
||||
// a flat tree under the Select List.
|
||||
for (nsIContent* childContent = mContent->GetFirstChild(); childContent;
|
||||
childContent = childContent->GetNextSibling()) {
|
||||
if (!childContent->IsHTML()) {
|
||||
if (!childContent->IsHTMLElement()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -951,7 +951,7 @@ HTMLTableAccessible::IsProbablyLayoutTable()
|
||||
|
||||
for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
|
||||
childElm = childElm->GetNextSibling()) {
|
||||
if (!childElm->IsHTML())
|
||||
if (!childElm->IsHTMLElement())
|
||||
continue;
|
||||
|
||||
if (childElm->Tag() == nsGkAtoms::col ||
|
||||
@ -965,10 +965,10 @@ HTMLTableAccessible::IsProbablyLayoutTable()
|
||||
if (childElm->Tag() == nsGkAtoms::tbody) {
|
||||
for (nsIContent* rowElm = childElm->GetFirstChild(); rowElm;
|
||||
rowElm = rowElm->GetNextSibling()) {
|
||||
if (rowElm->IsHTML() && rowElm->Tag() == nsGkAtoms::tr) {
|
||||
if (rowElm->IsHTMLElement() && rowElm->Tag() == nsGkAtoms::tr) {
|
||||
for (nsIContent* cellElm = rowElm->GetFirstChild(); cellElm;
|
||||
cellElm = cellElm->GetNextSibling()) {
|
||||
if (cellElm->IsHTML()) {
|
||||
if (cellElm->IsHTMLElement()) {
|
||||
|
||||
if (cellElm->NodeInfo()->Equals(nsGkAtoms::th)) {
|
||||
RETURN_LAYOUT_ANSWER(false,
|
||||
|
@ -352,7 +352,7 @@ IsElementAnchor(nsIContent* aContent)
|
||||
{
|
||||
// Make sure we are dealing with either an <A> or <AREA> element in the HTML
|
||||
// or XHTML namespace.
|
||||
if (!aContent->IsHTML()) {
|
||||
if (!aContent->IsHTMLElement()) {
|
||||
return false;
|
||||
}
|
||||
nsIAtom* nameAtom = aContent->Tag();
|
||||
@ -2620,7 +2620,7 @@ nsDocShell::GetFullscreenAllowed(bool* aFullscreenAllowed)
|
||||
}
|
||||
nsCOMPtr<Element> frameElement = win->GetFrameElementInternal();
|
||||
if (frameElement &&
|
||||
frameElement->IsHTML(nsGkAtoms::iframe) &&
|
||||
frameElement->IsHTMLElement(nsGkAtoms::iframe) &&
|
||||
!frameElement->HasAttr(kNameSpaceID_None, nsGkAtoms::allowfullscreen) &&
|
||||
!frameElement->HasAttr(kNameSpaceID_None, nsGkAtoms::mozallowfullscreen)) {
|
||||
return NS_OK;
|
||||
@ -13426,7 +13426,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
|
||||
|
||||
uint32_t flags = INTERNAL_LOAD_FLAGS_NONE;
|
||||
if (IsElementAnchor(aContent)) {
|
||||
MOZ_ASSERT(aContent->IsHTML());
|
||||
MOZ_ASSERT(aContent->IsHTMLElement());
|
||||
nsAutoString referrer;
|
||||
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::rel, referrer);
|
||||
nsWhitespaceTokenizerTemplate<nsContentUtils::IsHTMLWhitespace> tok(referrer);
|
||||
|
@ -167,7 +167,7 @@ Attr::GetNameAtom(nsIContent* aContent)
|
||||
if (!mNsAware &&
|
||||
mNodeInfo->NamespaceID() == kNameSpaceID_None &&
|
||||
aContent->IsInHTMLDocument() &&
|
||||
aContent->IsHTML()) {
|
||||
aContent->IsHTMLElement()) {
|
||||
nsString name;
|
||||
mNodeInfo->GetName(name);
|
||||
nsAutoString lowercaseName;
|
||||
|
@ -58,7 +58,7 @@ GetMatchedNodesForPoint(nsIContent* aContent)
|
||||
}
|
||||
|
||||
// Web components case
|
||||
MOZ_ASSERT(aContent->IsHTML(nsGkAtoms::content));
|
||||
MOZ_ASSERT(aContent->IsHTMLElement(nsGkAtoms::content));
|
||||
return MatchedNodes(static_cast<HTMLContentElement*>(aContent));
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ static bool
|
||||
DoesNotParticipateInAutoDirection(const Element* aElement)
|
||||
{
|
||||
mozilla::dom::NodeInfo* nodeInfo = aElement->NodeInfo();
|
||||
return (!aElement->IsHTML() ||
|
||||
return (!aElement->IsHTMLElement() ||
|
||||
nodeInfo->Equals(nsGkAtoms::script) ||
|
||||
nodeInfo->Equals(nsGkAtoms::style) ||
|
||||
nodeInfo->Equals(nsGkAtoms::textarea) ||
|
||||
@ -249,7 +249,7 @@ IsBdiWithoutDirAuto(const Element* aElement)
|
||||
// We are testing for bdi elements without explicit dir="auto", so we can't
|
||||
// use the HasDirAuto() flag, since that will return true for bdi element with
|
||||
// no dir attribute or an invalid dir attribute
|
||||
return (aElement->IsHTML(nsGkAtoms::bdi) &&
|
||||
return (aElement->IsHTMLElement(nsGkAtoms::bdi) &&
|
||||
(!aElement->HasValidDir() || aElement->HasFixedDir()));
|
||||
}
|
||||
|
||||
@ -922,7 +922,7 @@ void
|
||||
OnSetDirAttr(Element* aElement, const nsAttrValue* aNewValue,
|
||||
bool hadValidDir, bool hadDirAuto, bool aNotify)
|
||||
{
|
||||
if (aElement->IsHTML(nsGkAtoms::input)) {
|
||||
if (aElement->IsHTMLElement(nsGkAtoms::input)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -977,7 +977,7 @@ SetDirOnBind(mozilla::dom::Element* aElement, nsIContent* aParent)
|
||||
// Set the AncestorHasDirAuto flag, unless this element shouldn't affect
|
||||
// ancestors that have dir=auto
|
||||
if (!DoesNotParticipateInAutoDirection(aElement) &&
|
||||
!aElement->IsHTML(nsGkAtoms::bdi) &&
|
||||
!aElement->IsHTMLElement(nsGkAtoms::bdi) &&
|
||||
aParent && aParent->NodeOrAncestorHasDirAuto()) {
|
||||
aElement->SetAncestorHasDirAuto();
|
||||
|
||||
|
@ -158,7 +158,7 @@ nsIContent::DoGetClasses() const
|
||||
MOZ_ASSERT(HasFlag(NODE_MAY_HAVE_CLASS), "Unexpected call");
|
||||
MOZ_ASSERT(IsElement(), "Only elements can have classes");
|
||||
|
||||
if (IsSVG()) {
|
||||
if (IsSVGElement()) {
|
||||
const nsAttrValue* animClass =
|
||||
static_cast<const nsSVGElement*>(this)->GetAnimatedClassName();
|
||||
if (animClass) {
|
||||
@ -381,10 +381,10 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
|
||||
// otherwise, don't do anything else here unless we're dealing with
|
||||
// XUL or an HTML element that may have a plugin-related overlay
|
||||
// (i.e. object, embed, or applet).
|
||||
bool isXULorPluginElement = (IsXUL() ||
|
||||
IsHTML(nsGkAtoms::object) ||
|
||||
IsHTML(nsGkAtoms::embed) ||
|
||||
IsHTML(nsGkAtoms::applet));
|
||||
bool isXULorPluginElement = (IsXULElement() ||
|
||||
IsHTMLElement(nsGkAtoms::object) ||
|
||||
IsHTMLElement(nsGkAtoms::embed) ||
|
||||
IsHTMLElement(nsGkAtoms::applet));
|
||||
nsIPresShell *shell = aDocument->GetShell();
|
||||
if (!shell || GetPrimaryFrame() || !isXULorPluginElement) {
|
||||
*aResult = nullptr;
|
||||
@ -551,7 +551,7 @@ nsIScrollableFrame*
|
||||
Element::GetScrollFrame(nsIFrame **aStyledFrame, bool aFlushLayout)
|
||||
{
|
||||
// it isn't clear what to return for SVG nodes, so just return nothing
|
||||
if (IsSVG()) {
|
||||
if (IsSVGElement()) {
|
||||
if (aStyledFrame) {
|
||||
*aStyledFrame = nullptr;
|
||||
}
|
||||
@ -822,7 +822,7 @@ static nsSize GetScrollRectSizeForOverflowVisibleFrame(nsIFrame* aFrame)
|
||||
int32_t
|
||||
Element::ScrollHeight()
|
||||
{
|
||||
if (IsSVG())
|
||||
if (IsSVGElement())
|
||||
return 0;
|
||||
|
||||
nsIScrollableFrame* sf = GetScrollFrame();
|
||||
@ -839,7 +839,7 @@ Element::ScrollHeight()
|
||||
int32_t
|
||||
Element::ScrollWidth()
|
||||
{
|
||||
if (IsSVG())
|
||||
if (IsSVGElement())
|
||||
return 0;
|
||||
|
||||
nsIScrollableFrame* sf = GetScrollFrame();
|
||||
@ -923,7 +923,7 @@ Element::AddToIdTable(nsIAtom* aId)
|
||||
containingShadow->AddToIdTable(this, aId);
|
||||
} else {
|
||||
nsIDocument* doc = GetUncomposedDoc();
|
||||
if (doc && (!IsInAnonymousSubtree() || doc->IsXUL())) {
|
||||
if (doc && (!IsInAnonymousSubtree() || doc->IsXULDocument())) {
|
||||
doc->AddToIdTable(this, aId);
|
||||
}
|
||||
}
|
||||
@ -946,7 +946,7 @@ Element::RemoveFromIdTable()
|
||||
}
|
||||
} else {
|
||||
nsIDocument* doc = GetUncomposedDoc();
|
||||
if (doc && (!IsInAnonymousSubtree() || doc->IsXUL())) {
|
||||
if (doc && (!IsInAnonymousSubtree() || doc->IsXULDocument())) {
|
||||
doc->RemoveFromIdTable(this, id);
|
||||
}
|
||||
}
|
||||
@ -1113,12 +1113,12 @@ Element::GetAttribute(const nsAString& aName, DOMString& aReturn)
|
||||
{
|
||||
const nsAttrValue* val =
|
||||
mAttrsAndChildren.GetAttr(aName,
|
||||
IsHTML() && IsInHTMLDocument() ?
|
||||
IsHTMLElement() && IsInHTMLDocument() ?
|
||||
eIgnoreCase : eCaseMatters);
|
||||
if (val) {
|
||||
val->ToString(aReturn);
|
||||
} else {
|
||||
if (IsXUL()) {
|
||||
if (IsXULElement()) {
|
||||
// XXX should be SetDOMStringToNull(aReturn);
|
||||
// See bug 232598
|
||||
// aReturn is already empty
|
||||
@ -1142,7 +1142,7 @@ Element::SetAttribute(const nsAString& aName,
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAtom> nameAtom;
|
||||
if (IsHTML() && IsInHTMLDocument()) {
|
||||
if (IsHTMLElement() && IsInHTMLDocument()) {
|
||||
nsAutoString lower;
|
||||
nsContentUtils::ASCIIToLower(aName, lower);
|
||||
nameAtom = do_GetAtom(lower);
|
||||
@ -1524,7 +1524,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
// This has to be here, rather than in nsGenericHTMLElement::BindToTree,
|
||||
// because it has to happen after updating the parent pointer, but before
|
||||
// recursively binding the kids.
|
||||
if (IsHTML()) {
|
||||
if (IsHTMLElement()) {
|
||||
SetDirOnBind(this, aParent);
|
||||
}
|
||||
|
||||
@ -1564,7 +1564,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
AddToIdTable(DoGetID());
|
||||
}
|
||||
|
||||
if (MayHaveStyle() && !IsXUL()) {
|
||||
if (MayHaveStyle() && !IsXULElement()) {
|
||||
// XXXbz if we already have a style attr parsed, this won't do
|
||||
// anything... need to fix that.
|
||||
// If MayHaveStyle() is true, we must be an nsStyledElement
|
||||
@ -1736,7 +1736,7 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
// This has to be here, rather than in nsGenericHTMLElement::UnbindFromTree,
|
||||
// because it has to happen after unsetting the parent pointer, but before
|
||||
// recursively unbinding the kids.
|
||||
if (IsHTML()) {
|
||||
if (IsHTMLElement()) {
|
||||
ResetDir(this);
|
||||
}
|
||||
|
||||
@ -2241,7 +2241,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
|
||||
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
if (aName == nsGkAtoms::dir) {
|
||||
hadValidDir = HasValidDir() || IsHTML(nsGkAtoms::bdi);
|
||||
hadValidDir = HasValidDir() || IsHTMLElement(nsGkAtoms::bdi);
|
||||
hadDirAuto = HasDirAuto(); // already takes bdi into account
|
||||
}
|
||||
|
||||
@ -2478,7 +2478,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
bool hadDirAuto = false;
|
||||
|
||||
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::dir) {
|
||||
hadValidDir = HasValidDir() || IsHTML(nsGkAtoms::bdi);
|
||||
hadValidDir = HasValidDir() || IsHTMLElement(nsGkAtoms::bdi);
|
||||
hadDirAuto = HasDirAuto(); // already takes bdi into account
|
||||
}
|
||||
|
||||
@ -3218,7 +3218,7 @@ Element::SetOuterHTML(const nsAString& aOuterHTML, ErrorResult& aError)
|
||||
return;
|
||||
}
|
||||
|
||||
if (OwnerDoc()->IsHTML()) {
|
||||
if (OwnerDoc()->IsHTMLDocument()) {
|
||||
nsIAtom* localName;
|
||||
int32_t namespaceID;
|
||||
if (parent->IsElement()) {
|
||||
@ -3315,7 +3315,7 @@ Element::InsertAdjacentHTML(const nsAString& aPosition, const nsAString& aText,
|
||||
mozAutoSubtreeModified subtree(doc, nullptr);
|
||||
|
||||
// Parse directly into destination if possible
|
||||
if (doc->IsHTML() && !OwnerDoc()->MayHaveDOMMutationObservers() &&
|
||||
if (doc->IsHTMLDocument() && !OwnerDoc()->MayHaveDOMMutationObservers() &&
|
||||
(position == eBeforeEnd ||
|
||||
(position == eAfterEnd && !GetNextSibling()) ||
|
||||
(position == eAfterBegin && !GetFirstChild()))) {
|
||||
|
@ -351,7 +351,7 @@ public:
|
||||
// false
|
||||
inline bool HasDirAuto() const {
|
||||
return (!HasFixedDir() &&
|
||||
(HasValidDir() || IsHTML(nsGkAtoms::bdi)));
|
||||
(HasValidDir() || IsHTMLElement(nsGkAtoms::bdi)));
|
||||
}
|
||||
|
||||
Directionality GetComputedDirectionality() const;
|
||||
|
@ -306,7 +306,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
|
||||
const nsIContent *elem = this;
|
||||
do {
|
||||
// First check for SVG specialness (why is this SVG specific?)
|
||||
if (elem->IsSVG()) {
|
||||
if (elem->IsSVGElement()) {
|
||||
nsIContent* bindingParent = elem->GetBindingParent();
|
||||
if (bindingParent) {
|
||||
nsXBLBinding* binding = bindingParent->GetXBLBinding();
|
||||
@ -1347,7 +1347,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
|
||||
// which is dispatched in UnbindFromTree.
|
||||
|
||||
if (tmp->HasProperties()) {
|
||||
if (tmp->IsHTML() || tmp->IsSVG()) {
|
||||
if (tmp->IsHTMLElement() || tmp->IsSVGElement()) {
|
||||
nsIAtom*** props = Element::HTMLSVGPropertiesToTraverseAndUnlink();
|
||||
for (uint32_t i = 0; props[i]; ++i) {
|
||||
tmp->DeleteProperty(*props[i]);
|
||||
@ -1389,7 +1389,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
|
||||
{
|
||||
nsDOMSlots *slots = tmp->GetExistingDOMSlots();
|
||||
if (slots) {
|
||||
slots->Unlink(tmp->IsXUL());
|
||||
slots->Unlink(tmp->IsXULElement());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1899,7 +1899,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
|
||||
tmp->OwnerDoc()->BindingManager()->Traverse(tmp, cb);
|
||||
|
||||
if (tmp->HasProperties()) {
|
||||
if (tmp->IsHTML() || tmp->IsSVG()) {
|
||||
if (tmp->IsHTMLElement() || tmp->IsSVGElement()) {
|
||||
nsIAtom*** props = Element::HTMLSVGPropertiesToTraverseAndUnlink();
|
||||
for (uint32_t i = 0; props[i]; ++i) {
|
||||
nsISupports* property =
|
||||
@ -1934,7 +1934,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
|
||||
{
|
||||
nsDOMSlots *slots = tmp->GetExistingDOMSlots();
|
||||
if (slots) {
|
||||
slots->Traverse(cb, tmp->IsXUL());
|
||||
slots->Traverse(cb, tmp->IsXULElement());
|
||||
}
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
@ -2433,7 +2433,8 @@ StartElement(Element* aContent, StringBuilder& aBuilder)
|
||||
int32_t tagNS = aContent->GetNameSpaceID();
|
||||
|
||||
aBuilder.Append("<");
|
||||
if (aContent->IsHTML() || aContent->IsSVG() || aContent->IsMathML()) {
|
||||
if (aContent->IsHTMLElement() || aContent->IsSVGElement() ||
|
||||
aContent->IsMathMLElement()) {
|
||||
aBuilder.Append(localName);
|
||||
} else {
|
||||
aBuilder.Append(aContent->NodeName());
|
||||
@ -2498,7 +2499,7 @@ StartElement(Element* aContent, StringBuilder& aBuilder)
|
||||
// pre/textarea/listing is a textnode and starts with a \n.
|
||||
// But because browsers haven't traditionally had that behavior,
|
||||
// we're not changing our behavior either - yet.
|
||||
if (aContent->IsHTML()) {
|
||||
if (aContent->IsHTMLElement()) {
|
||||
if (localName == nsGkAtoms::pre || localName == nsGkAtoms::textarea ||
|
||||
localName == nsGkAtoms::listing) {
|
||||
nsIContent* fc = aContent->GetFirstChild();
|
||||
@ -2517,7 +2518,7 @@ StartElement(Element* aContent, StringBuilder& aBuilder)
|
||||
static inline bool
|
||||
ShouldEscape(nsIContent* aParent)
|
||||
{
|
||||
if (!aParent || !aParent->IsHTML()) {
|
||||
if (!aParent || !aParent->IsHTMLElement()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2586,7 +2587,7 @@ IsVoidTag(nsIAtom* aTag)
|
||||
static inline bool
|
||||
IsVoidTag(Element* aElement)
|
||||
{
|
||||
if (!aElement->IsHTML()) {
|
||||
if (!aElement->IsHTMLElement()) {
|
||||
return false;
|
||||
}
|
||||
return IsVoidTag(aElement->Tag());
|
||||
@ -2666,7 +2667,8 @@ Serialize(FragmentOrElement* aRoot, bool aDescendentsOnly, nsAString& aOut)
|
||||
if (!isVoid && current->NodeType() == nsIDOMNode::ELEMENT_NODE) {
|
||||
builder.Append("</");
|
||||
nsIContent* elem = static_cast<nsIContent*>(current);
|
||||
if (elem->IsHTML() || elem->IsSVG() || elem->IsMathML()) {
|
||||
if (elem->IsHTMLElement() || elem->IsSVGElement() ||
|
||||
elem->IsMathMLElement()) {
|
||||
builder.Append(elem->Tag());
|
||||
} else {
|
||||
builder.Append(current->NodeName());
|
||||
@ -2848,7 +2850,7 @@ FragmentOrElement::SetInnerHTMLInternal(const nsAString& aInnerHTML, ErrorResult
|
||||
contextNameSpaceID = shadowRoot->GetHost()->GetNameSpaceID();
|
||||
}
|
||||
|
||||
if (doc->IsHTML()) {
|
||||
if (doc->IsHTMLDocument()) {
|
||||
int32_t oldChildCount = target->GetChildCount();
|
||||
aError = nsContentUtils::ParseFragmentHTML(aInnerHTML,
|
||||
target,
|
||||
|
@ -40,8 +40,10 @@ Link::~Link()
|
||||
bool
|
||||
Link::ElementHasHref() const
|
||||
{
|
||||
return ((!mElement->IsSVG() && mElement->HasAttr(kNameSpaceID_None, nsGkAtoms::href))
|
||||
|| (!mElement->IsHTML() && mElement->HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)));
|
||||
return ((!mElement->IsSVGElement() &&
|
||||
mElement->HasAttr(kNameSpaceID_None, nsGkAtoms::href))
|
||||
|| (!mElement->IsHTMLElement() &&
|
||||
mElement->HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -83,7 +83,7 @@ NodeInfo::NodeInfo(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
|
||||
// Correct the case for HTML
|
||||
if (aNodeType == nsIDOMNode::ELEMENT_NODE &&
|
||||
aNamespaceID == kNameSpaceID_XHTML && GetDocument() &&
|
||||
GetDocument()->IsHTML()) {
|
||||
GetDocument()->IsHTMLDocument()) {
|
||||
nsContentUtils::ASCIIToUpper(mQualifiedName, mNodeName);
|
||||
} else {
|
||||
mNodeName = mQualifiedName;
|
||||
|
@ -565,7 +565,7 @@ ShadowRoot::ChangePoolHost(nsIContent* aNewHost)
|
||||
bool
|
||||
ShadowRoot::IsShadowInsertionPoint(nsIContent* aContent)
|
||||
{
|
||||
if (aContent && aContent->IsHTML(nsGkAtoms::shadow)) {
|
||||
if (aContent && aContent->IsHTMLElement(nsGkAtoms::shadow)) {
|
||||
HTMLShadowElement* shadowElem = static_cast<HTMLShadowElement*>(aContent);
|
||||
return shadowElem->IsInsertionPoint();
|
||||
}
|
||||
@ -597,7 +597,7 @@ ShadowRoot::IsPooledNode(nsIContent* aContent, nsIContent* aContainer,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (aContainer && aContainer->IsHTML(nsGkAtoms::content)) {
|
||||
if (aContainer && aContainer->IsHTMLElement(nsGkAtoms::content)) {
|
||||
// Fallback content will end up in pool if its parent is a child of the host.
|
||||
HTMLContentElement* content = static_cast<HTMLContentElement*>(aContainer);
|
||||
return content->IsInsertionPoint() && content->MatchedNodes().IsEmpty() &&
|
||||
|
@ -482,7 +482,7 @@ TraceActiveWindowGlobal(const uint64_t& aId, nsGlobalWindow*& aWindow, void* aCl
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
nsIDocument* doc = aWindow->GetExtantDoc();
|
||||
if (doc && doc->IsXUL()) {
|
||||
if (doc && doc->IsXULDocument()) {
|
||||
XULDocument* xulDoc = static_cast<XULDocument*>(doc);
|
||||
xulDoc->TraceProtos(closure->mTrc, closure->mGCNumber);
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ nsContentList::nsContentList(nsINode* aRootNode,
|
||||
// not parser-created and don't need to be flushing stuff under us
|
||||
// to get our kids right.
|
||||
nsIDocument* doc = mRootNode->GetUncomposedDoc();
|
||||
mFlushesNeeded = doc && !doc->IsHTML();
|
||||
mFlushesNeeded = doc && !doc->IsHTMLDocument();
|
||||
}
|
||||
|
||||
nsContentList::nsContentList(nsINode* aRootNode,
|
||||
@ -452,7 +452,7 @@ nsContentList::nsContentList(nsINode* aRootNode,
|
||||
// not parser-created and don't need to be flushing stuff under us
|
||||
// to get our kids right.
|
||||
nsIDocument* doc = mRootNode->GetUncomposedDoc();
|
||||
mFlushesNeeded = doc && !doc->IsHTML();
|
||||
mFlushesNeeded = doc && !doc->IsHTMLDocument();
|
||||
}
|
||||
|
||||
nsContentList::~nsContentList()
|
||||
@ -853,7 +853,7 @@ nsContentList::Match(Element *aElement)
|
||||
return toReturn;
|
||||
|
||||
bool matchHTML = aElement->GetNameSpaceID() == kNameSpaceID_XHTML &&
|
||||
aElement->OwnerDoc()->IsHTML();
|
||||
aElement->OwnerDoc()->IsHTMLDocument();
|
||||
|
||||
if (unknown) {
|
||||
return matchHTML ? ni->QualifiedNameEquals(mHTMLMatchAtom) :
|
||||
|
@ -4101,7 +4101,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
||||
// If we don't have a document here, we can't get the right security context
|
||||
// for compiling event handlers... so just bail out.
|
||||
nsCOMPtr<nsIDocument> document = aContextNode->OwnerDoc();
|
||||
bool isHTML = document->IsHTML();
|
||||
bool isHTML = document->IsHTMLDocument();
|
||||
#ifdef DEBUG
|
||||
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(document);
|
||||
NS_ASSERTION(!isHTML || htmlDoc, "Should have HTMLDocument here!");
|
||||
@ -4120,7 +4120,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
||||
}
|
||||
}
|
||||
|
||||
if (contextAsContent && !contextAsContent->IsHTML(nsGkAtoms::html)) {
|
||||
if (contextAsContent && !contextAsContent->IsHTMLElement(nsGkAtoms::html)) {
|
||||
aRv = ParseFragmentHTML(aFragment, frag,
|
||||
contextAsContent->Tag(),
|
||||
contextAsContent->GetNameSpaceID(),
|
||||
@ -4749,8 +4749,9 @@ nsContentUtils::TriggerLink(nsIContent *aContent, nsPresContext *aPresContext,
|
||||
// as downloadable. If this check fails we will just do the normal thing
|
||||
// (i.e. navigate to the resource).
|
||||
nsAutoString fileName;
|
||||
if ((!aContent->IsHTML(nsGkAtoms::a) && !aContent->IsHTML(nsGkAtoms::area) &&
|
||||
!aContent->IsSVG(nsGkAtoms::a)) ||
|
||||
if ((!aContent->IsHTMLElement(nsGkAtoms::a) &&
|
||||
!aContent->IsHTMLElement(nsGkAtoms::area) &&
|
||||
!aContent->IsSVGElement(nsGkAtoms::a)) ||
|
||||
!aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::download, fileName) ||
|
||||
NS_FAILED(aContent->NodePrincipal()->CheckMayLoad(aLinkURI, false, true))) {
|
||||
fileName.SetIsVoid(true); // No actionable download attribute was found.
|
||||
@ -6895,7 +6896,7 @@ nsContentUtils::IsContentInsertionPoint(const nsIContent* aContent)
|
||||
}
|
||||
|
||||
// Check if the content is a web components content insertion point.
|
||||
if (aContent->IsHTML(nsGkAtoms::content)) {
|
||||
if (aContent->IsHTMLElement(nsGkAtoms::content)) {
|
||||
return static_cast<const HTMLContentElement*>(aContent)->IsInsertionPoint();
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ static nsresult AppendDOMNode(nsITransferable *aTransferable,
|
||||
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(document, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
|
||||
NS_ENSURE_TRUE(document->IsHTML(), NS_OK);
|
||||
NS_ENSURE_TRUE(document->IsHTMLDocument(), NS_OK);
|
||||
|
||||
// init encoder with document and node
|
||||
rv = docEncoder->NativeInit(document, NS_LITERAL_STRING(kHTMLMime),
|
||||
|
@ -1656,7 +1656,7 @@ nsDOMWindowUtils::GetTranslationNodes(nsIDOMNode* aRoot,
|
||||
// skip the root tag from being a translation node.
|
||||
nsIContent* content = root;
|
||||
while ((limit > 0) && (content = content->GetNextNode(root))) {
|
||||
if (!content->IsHTML()) {
|
||||
if (!content->IsHTMLElement()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -642,7 +642,7 @@ nsIdentifierMapEntry::RemoveIdElement(Element* aElement)
|
||||
// This could fire in OOM situations
|
||||
// Only assert this in HTML documents for now as XUL does all sorts of weird
|
||||
// crap.
|
||||
NS_ASSERTION(!aElement->OwnerDoc()->IsHTML() ||
|
||||
NS_ASSERTION(!aElement->OwnerDoc()->IsHTMLDocument() ||
|
||||
mIdContentList.IndexOf(aElement) >= 0,
|
||||
"Removing id entry that doesn't exist");
|
||||
|
||||
@ -5500,7 +5500,7 @@ nsIDocument::CreateElement(const nsAString& aTagName, ErrorResult& rv)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool needsLowercase = IsHTML() && !IsLowercaseASCII(aTagName);
|
||||
bool needsLowercase = IsHTMLDocument() && !IsLowercaseASCII(aTagName);
|
||||
nsAutoString lcTagName;
|
||||
if (needsLowercase) {
|
||||
nsContentUtils::ASCIIToLower(aTagName, lcTagName);
|
||||
@ -5703,7 +5703,7 @@ already_AddRefed<CDATASection>
|
||||
nsIDocument::CreateCDATASection(const nsAString& aData,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
if (IsHTML()) {
|
||||
if (IsHTMLDocument()) {
|
||||
rv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
@ -6161,7 +6161,7 @@ nsDocument::RegisterElement(JSContext* aCx, const nsAString& aType,
|
||||
// Only convert NAME to lowercase in HTML documents. Note that NAME is
|
||||
// options.extends.
|
||||
nsAutoString lcName;
|
||||
if (IsHTML()) {
|
||||
if (IsHTMLDocument()) {
|
||||
nsContentUtils::ASCIIToLower(aOptions.mExtends, lcName);
|
||||
} else {
|
||||
lcName.Assign(aOptions.mExtends);
|
||||
@ -7024,7 +7024,7 @@ Element*
|
||||
nsIDocument::GetHtmlElement() const
|
||||
{
|
||||
Element* rootElement = GetRootElement();
|
||||
if (rootElement && rootElement->IsHTML(nsGkAtoms::html))
|
||||
if (rootElement && rootElement->IsHTMLElement(nsGkAtoms::html))
|
||||
return rootElement;
|
||||
return nullptr;
|
||||
}
|
||||
@ -7041,7 +7041,7 @@ nsIDocument::GetHtmlChildElement(nsIAtom* aTag)
|
||||
for (nsIContent* child = html->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsHTML(aTag))
|
||||
if (child->IsHTMLElement(aTag))
|
||||
return child->AsElement();
|
||||
}
|
||||
return nullptr;
|
||||
@ -7228,7 +7228,7 @@ nsDocument::GetBoxObjectFor(Element* aElement, ErrorResult& aRv)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!mHasWarnedAboutBoxObjects && !aElement->IsXUL()) {
|
||||
if (!mHasWarnedAboutBoxObjects && !aElement->IsXULElement()) {
|
||||
mHasWarnedAboutBoxObjects = true;
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("BoxObjects"), this,
|
||||
@ -8179,7 +8179,7 @@ nsDocument::FlushPendingNotifications(mozFlushType aType)
|
||||
// make sure that layout is started as needed. But we can skip that
|
||||
// part if we have no presshell or if it's already done an initial
|
||||
// reflow.
|
||||
if ((!IsHTML() ||
|
||||
if ((!IsHTMLDocument() ||
|
||||
(aType > Flush_ContentAndNotify && mPresShell &&
|
||||
!mPresShell->DidInitialize())) &&
|
||||
(mParser || mWeakSink)) {
|
||||
@ -8352,7 +8352,7 @@ nsRadioGroupStruct*
|
||||
nsDocument::GetRadioGroupInternal(const nsAString& aName) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (IsHTML()) {
|
||||
if (IsHTMLDocument()) {
|
||||
nsAutoString lcName;
|
||||
ToLowerCase(aName, lcName);
|
||||
MOZ_ASSERT(aName == lcName);
|
||||
@ -8371,7 +8371,7 @@ nsRadioGroupStruct*
|
||||
nsDocument::GetRadioGroup(const nsAString& aName) const
|
||||
{
|
||||
nsAutoString tmKey(aName);
|
||||
if (IsHTML()) {
|
||||
if (IsHTMLDocument()) {
|
||||
ToLowerCase(tmKey); //should case-insensitive.
|
||||
}
|
||||
|
||||
@ -8382,7 +8382,7 @@ nsRadioGroupStruct*
|
||||
nsDocument::GetOrCreateRadioGroup(const nsAString& aName)
|
||||
{
|
||||
nsAutoString tmKey(aName);
|
||||
if (IsHTML()) {
|
||||
if (IsHTMLDocument()) {
|
||||
ToLowerCase(tmKey); //should case-insensitive.
|
||||
}
|
||||
|
||||
@ -8452,7 +8452,7 @@ nsDocument::GetNextRadioButton(const nsAString& aName,
|
||||
else if (++index >= numRadios) {
|
||||
index = 0;
|
||||
}
|
||||
NS_ASSERTION(static_cast<nsGenericHTMLFormElement*>(radioGroup->mRadioButtons[index])->IsHTML(nsGkAtoms::input),
|
||||
NS_ASSERTION(static_cast<nsGenericHTMLFormElement*>(radioGroup->mRadioButtons[index])->IsHTMLElement(nsGkAtoms::input),
|
||||
"mRadioButtons holding a non-radio button");
|
||||
radio = static_cast<HTMLInputElement*>(radioGroup->mRadioButtons[index]);
|
||||
} while (radio->Disabled() && radio != currentRadio);
|
||||
|
@ -530,7 +530,7 @@ nsDocumentEncoder::SerializeToStringIterative(nsINode* aNode,
|
||||
current->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
|
||||
DocumentFragment* frag = static_cast<DocumentFragment*>(current);
|
||||
nsIContent* host = frag->GetHost();
|
||||
if (host && host->IsHTML(nsGkAtoms::_template)) {
|
||||
if (host && host->IsHTMLElement(nsGkAtoms::_template)) {
|
||||
current = host;
|
||||
}
|
||||
}
|
||||
@ -1093,7 +1093,7 @@ nsDocumentEncoder::EncodeToStringWithMaxLength(uint32_t aMaxLength,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(node);
|
||||
if (content && content->IsHTML(nsGkAtoms::tr)) {
|
||||
if (content && content->IsHTMLElement(nsGkAtoms::tr)) {
|
||||
nsINode* n = content;
|
||||
if (!prevNode) {
|
||||
// Went from a non-<tr> to a <tr>
|
||||
@ -1411,7 +1411,7 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
|
||||
|
||||
// also consider ourselves in a text widget if we can't find an html document
|
||||
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(mDocument);
|
||||
if (!(htmlDoc && mDocument->IsHTML())) {
|
||||
if (!(htmlDoc && mDocument->IsHTMLDocument())) {
|
||||
mIsTextWidget = true;
|
||||
mSelection = aSelection;
|
||||
// mMimeType is set to text/plain when encoding starts.
|
||||
@ -1856,7 +1856,7 @@ nsHTMLCopyEncoder::IsMozBR(nsIDOMNode* aNode)
|
||||
MOZ_ASSERT(aNode);
|
||||
nsCOMPtr<Element> element = do_QueryInterface(aNode);
|
||||
return element &&
|
||||
element->IsHTML(nsGkAtoms::br) &&
|
||||
element->IsHTMLElement(nsGkAtoms::br) &&
|
||||
element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
|
||||
NS_LITERAL_STRING("_moz"), eIgnoreCase);
|
||||
}
|
||||
@ -2015,11 +2015,12 @@ nsHTMLCopyEncoder::GetImmediateContextCount(const nsTArray<nsINode*>& aAncestorA
|
||||
break;
|
||||
}
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(node));
|
||||
if (!content || !content->IsHTML() || (content->Tag() != nsGkAtoms::tr &&
|
||||
content->Tag() != nsGkAtoms::thead &&
|
||||
content->Tag() != nsGkAtoms::tbody &&
|
||||
content->Tag() != nsGkAtoms::tfoot &&
|
||||
content->Tag() != nsGkAtoms::table)) {
|
||||
if (!content || !content->IsHTMLElement() ||
|
||||
(content->Tag() != nsGkAtoms::tr &&
|
||||
content->Tag() != nsGkAtoms::thead &&
|
||||
content->Tag() != nsGkAtoms::tbody &&
|
||||
content->Tag() != nsGkAtoms::tfoot &&
|
||||
content->Tag() != nsGkAtoms::table)) {
|
||||
break;
|
||||
}
|
||||
++j;
|
||||
|
@ -316,7 +316,7 @@ nsIContent*
|
||||
nsFocusManager::GetRedirectedFocus(nsIContent* aContent)
|
||||
{
|
||||
#ifdef MOZ_XUL
|
||||
if (aContent->IsXUL()) {
|
||||
if (aContent->IsXULElement()) {
|
||||
nsCOMPtr<nsIDOMNode> inputField;
|
||||
|
||||
nsCOMPtr<nsIDOMXULTextBoxElement> textbox = do_QueryInterface(aContent);
|
||||
@ -1552,7 +1552,7 @@ nsFocusManager::CheckIfFocusable(nsIContent* aContent, uint32_t aFlags)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (aContent->Tag() == nsGkAtoms::area && aContent->IsHTML()) {
|
||||
if (aContent->Tag() == nsGkAtoms::area && aContent->IsHTMLElement()) {
|
||||
// HTML areas do not have their own frame, and the img frame we get from
|
||||
// GetPrimaryFrame() is not relevant as to whether it is focusable or
|
||||
// not, so we have to do all the relevant checks manually for them.
|
||||
@ -2504,7 +2504,7 @@ nsFocusManager::DetermineElementToMoveFocus(nsPIDOMWindow* aWindow,
|
||||
if (startContent) {
|
||||
nsIFrame* frame = startContent->GetPrimaryFrame();
|
||||
if (startContent->Tag() == nsGkAtoms::area &&
|
||||
startContent->IsHTML())
|
||||
startContent->IsHTMLElement())
|
||||
startContent->IsFocusable(&tabIndex);
|
||||
else if (frame)
|
||||
frame->IsFocusable(&tabIndex, 0);
|
||||
@ -2813,7 +2813,7 @@ nsFocusManager::GetNextTabbableContent(nsIPresShell* aPresShell,
|
||||
}
|
||||
else if (getNextFrame &&
|
||||
(!iterStartContent || iterStartContent->Tag() != nsGkAtoms::area ||
|
||||
!iterStartContent->IsHTML())) {
|
||||
!iterStartContent->IsHTMLElement())) {
|
||||
// Need to do special check in case we're in an imagemap which has multiple
|
||||
// content nodes per frame, so don't skip over the starting frame.
|
||||
if (aForward)
|
||||
|
@ -208,7 +208,7 @@ nsFrameLoader::LoadFrame()
|
||||
|
||||
nsAutoString src;
|
||||
|
||||
bool isSrcdoc = mOwnerContent->IsHTML(nsGkAtoms::iframe) &&
|
||||
bool isSrcdoc = mOwnerContent->IsHTMLElement(nsGkAtoms::iframe) &&
|
||||
mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::srcdoc);
|
||||
if (isSrcdoc) {
|
||||
src.AssignLiteral("about:srcdoc");
|
||||
@ -222,7 +222,7 @@ nsFrameLoader::LoadFrame()
|
||||
// If the frame is a XUL element and has the attribute 'nodefaultsrc=true'
|
||||
// then we will not use 'about:blank' as fallback but return early without
|
||||
// starting a load if no 'src' attribute is given (or it's empty).
|
||||
if (mOwnerContent->IsXUL() &&
|
||||
if (mOwnerContent->IsXULElement() &&
|
||||
mOwnerContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::nodefaultsrc,
|
||||
nsGkAtoms::_true, eCaseMatters)) {
|
||||
return NS_OK;
|
||||
@ -402,7 +402,7 @@ nsFrameLoader::ReallyStartLoadingInternal()
|
||||
nsCOMPtr<nsIURI> referrer;
|
||||
|
||||
nsAutoString srcdoc;
|
||||
bool isSrcdoc = mOwnerContent->IsHTML(nsGkAtoms::iframe) &&
|
||||
bool isSrcdoc = mOwnerContent->IsHTMLElement(nsGkAtoms::iframe) &&
|
||||
mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::srcdoc,
|
||||
srcdoc);
|
||||
|
||||
@ -1728,7 +1728,7 @@ nsFrameLoader::MaybeCreateDocShell()
|
||||
}
|
||||
|
||||
if (mIsTopLevelContent &&
|
||||
mOwnerContent->IsXUL(nsGkAtoms::browser) &&
|
||||
mOwnerContent->IsXULElement(nsGkAtoms::browser) &&
|
||||
!mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disablehistory)) {
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsISHistory> sessionHistory =
|
||||
@ -2113,7 +2113,7 @@ nsFrameLoader::TryRemoteBrowser()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mOwnerContent->IsXUL()) {
|
||||
if (!mOwnerContent->IsXULElement()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2413,7 +2413,7 @@ nsFrameLoader::EnsureMessageManager()
|
||||
if (!mIsTopLevelContent &&
|
||||
!OwnerIsBrowserOrAppFrame() &&
|
||||
!mRemoteFrame &&
|
||||
!(mOwnerContent->IsXUL() &&
|
||||
!(mOwnerContent->IsXULElement() &&
|
||||
mOwnerContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::forcemessagemanager,
|
||||
nsGkAtoms::_true, eCaseMatters))) {
|
||||
@ -2434,7 +2434,7 @@ nsFrameLoader::EnsureMessageManager()
|
||||
|
||||
if (chromeWindow) {
|
||||
nsAutoString messagemanagergroup;
|
||||
if (mOwnerContent->IsXUL() &&
|
||||
if (mOwnerContent->IsXULElement() &&
|
||||
mOwnerContent->GetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::messagemanagergroup,
|
||||
messagemanagergroup)) {
|
||||
|
@ -305,7 +305,8 @@ private:
|
||||
nsIDocShell* aParentNode);
|
||||
|
||||
nsIAtom* TypeAttrName() const {
|
||||
return mOwnerContent->IsXUL() ? nsGkAtoms::type : nsGkAtoms::mozframetype;
|
||||
return mOwnerContent->IsXULElement()
|
||||
? nsGkAtoms::type : nsGkAtoms::mozframetype;
|
||||
}
|
||||
|
||||
// Update the permission manager's app-id refcount based on mOwnerContent's
|
||||
|
@ -9946,7 +9946,7 @@ nsGlobalWindow::SetChromeEventHandler(EventTarget* aChromeEventHandler)
|
||||
|
||||
static bool IsLink(nsIContent* aContent)
|
||||
{
|
||||
return aContent && (aContent->IsHTML(nsGkAtoms::a) ||
|
||||
return aContent && (aContent->IsHTMLElement(nsGkAtoms::a) ||
|
||||
aContent->AttrValueIs(kNameSpaceID_XLink, nsGkAtoms::type,
|
||||
nsGkAtoms::simple, eCaseMatters));
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ enum nsLinkState {
|
||||
|
||||
// IID for the nsIContent interface
|
||||
#define NS_ICONTENT_IID \
|
||||
{ 0x697a2fe1, 0x5549, 0x48e7, \
|
||||
{ 0x9a, 0x1a, 0xc2, 0x9d, 0xab, 0x14, 0xe2, 0x39 } }
|
||||
{ 0x70f7e9ea, 0xa9bf, 0x48cc, \
|
||||
{ 0xad, 0x9d, 0x8a, 0xca, 0xee, 0xd2, 0x9b, 0x68 } }
|
||||
|
||||
/**
|
||||
* A node of content in a document's content model. This interface
|
||||
@ -250,60 +250,69 @@ public:
|
||||
return mNodeInfo->NamespaceID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the NodeInfo for this element
|
||||
* @return the nodes node info
|
||||
*/
|
||||
inline mozilla::dom::NodeInfo* NodeInfo() const
|
||||
{
|
||||
return mNodeInfo;
|
||||
}
|
||||
|
||||
inline bool IsInNamespace(int32_t aNamespace) const
|
||||
{
|
||||
return mNodeInfo->NamespaceID() == aNamespace;
|
||||
}
|
||||
|
||||
inline bool IsHTML() const
|
||||
inline bool IsHTMLElement() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
inline bool IsHTML(nsIAtom* aTag) const
|
||||
inline bool IsHTMLElement(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
inline bool IsSVG() const
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfHTMLElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsHTMLElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
|
||||
inline bool IsSVGElement() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
inline bool IsSVG(nsIAtom* aTag) const
|
||||
inline bool IsSVGElement(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
inline bool IsXUL() const
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfSVGElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsSVGElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
|
||||
inline bool IsXULElement() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline bool IsXUL(nsIAtom* aTag) const
|
||||
inline bool IsXULElement(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline bool IsMathML() const
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfXULElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsXULElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
|
||||
inline bool IsMathMLElement() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
inline bool IsMathML(nsIAtom* aTag) const
|
||||
inline bool IsMathMLElement(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfMathMLElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsMathMLElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
inline bool IsActiveChildrenElement() const
|
||||
{
|
||||
return mNodeInfo->Equals(nsGkAtoms::children, kNameSpaceID_XBL) &&
|
||||
@ -910,7 +919,7 @@ public:
|
||||
// XHTML1 section C.7).
|
||||
bool hasAttr = content->GetAttr(kNameSpaceID_XML, nsGkAtoms::lang,
|
||||
aResult);
|
||||
if (!hasAttr && (content->IsHTML() || content->IsSVG())) {
|
||||
if (!hasAttr && (content->IsHTMLElement() || content->IsSVGElement())) {
|
||||
hasAttr = content->GetAttr(kNameSpaceID_None, nsGkAtoms::lang,
|
||||
aResult);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
inline bool
|
||||
nsIContent::IsInHTMLDocument() const
|
||||
{
|
||||
return OwnerDoc()->IsHTML();
|
||||
return OwnerDoc()->IsHTMLDocument();
|
||||
}
|
||||
|
||||
#endif // nsIContentInlines_h
|
||||
|
@ -146,10 +146,9 @@ struct FullScreenOptions {
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
// 137c6144-513e-4edf-840e-5e3156638ed6
|
||||
#define NS_IDOCUMENT_IID \
|
||||
{ 0x137c6144, 0x513e, 0x4edf, \
|
||||
{ 0x84, 0x0e, 0x5e, 0x31, 0x56, 0x63, 0x8e, 0xd6 } }
|
||||
{ 0x0b78eabe, 0x8b94, 0x4ea1, \
|
||||
{ 0x93, 0x31, 0x5d, 0x48, 0xe8, 0x3a, 0xda, 0x95 } }
|
||||
|
||||
// Enum for requesting a particular type of document when creating a doc
|
||||
enum DocumentFlavor {
|
||||
@ -1302,7 +1301,7 @@ public:
|
||||
* media documents). Returns false for XHTML and any other documents parsed
|
||||
* by the XML parser.
|
||||
*/
|
||||
bool IsHTML() const
|
||||
bool IsHTMLDocument() const
|
||||
{
|
||||
return mType == eHTML;
|
||||
}
|
||||
@ -1310,15 +1309,15 @@ public:
|
||||
{
|
||||
return mType == eHTML || mType == eXHTML;
|
||||
}
|
||||
bool IsXML() const
|
||||
bool IsXMLDocument() const
|
||||
{
|
||||
return !IsHTML();
|
||||
return !IsHTMLDocument();
|
||||
}
|
||||
bool IsSVG() const
|
||||
bool IsSVGDocument() const
|
||||
{
|
||||
return mType == eSVG;
|
||||
}
|
||||
bool IsXUL() const
|
||||
bool IsXULDocument() const
|
||||
{
|
||||
return mType == eXUL;
|
||||
}
|
||||
@ -1328,7 +1327,7 @@ public:
|
||||
}
|
||||
bool LoadsFullXULStyleSheetUpFront()
|
||||
{
|
||||
return IsXUL() || AllowXULXBL();
|
||||
return IsXULDocument() || AllowXULXBL();
|
||||
}
|
||||
|
||||
virtual bool IsScriptEnabled() = 0;
|
||||
|
@ -220,7 +220,7 @@ nsINode::GetTextEditorRootContent(nsIEditor** aEditor)
|
||||
*aEditor = nullptr;
|
||||
for (nsINode* node = this; node; node = node->GetParentNode()) {
|
||||
if (!node->IsElement() ||
|
||||
!node->AsElement()->IsHTML())
|
||||
!node->IsHTMLElement())
|
||||
continue;
|
||||
|
||||
nsCOMPtr<nsIEditor> editor =
|
||||
@ -427,7 +427,7 @@ nsINode::IsAnonymousContentInSVGUseSubtree() const
|
||||
MOZ_ASSERT(IsInAnonymousSubtree());
|
||||
nsIContent* parent = AsContent()->GetBindingParent();
|
||||
// Watch out for parentless native-anonymous subtrees.
|
||||
return parent && parent->IsSVG(nsGkAtoms::use);
|
||||
return parent && parent->IsSVGElement(nsGkAtoms::use);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -248,8 +248,8 @@ private:
|
||||
|
||||
// IID for the nsINode interface
|
||||
#define NS_INODE_IID \
|
||||
{ 0x66972940, 0x1d1b, 0x4d15, \
|
||||
{ 0x93, 0x11, 0x96, 0x72, 0x84, 0x2e, 0xc7, 0x27 } }
|
||||
{ 0x9c090b44, 0x754b, 0x413c, \
|
||||
{ 0x9d, 0xd5, 0xe4, 0x3d, 0xc4, 0x54, 0x96, 0xe3 } }
|
||||
|
||||
/**
|
||||
* An internal interface that abstracts some DOMNode-related parts that both
|
||||
@ -574,6 +574,99 @@ public:
|
||||
return mNodeInfo->NameAtom();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the NodeInfo for this element
|
||||
* @return the nodes node info
|
||||
*/
|
||||
inline mozilla::dom::NodeInfo* NodeInfo() const
|
||||
{
|
||||
return mNodeInfo;
|
||||
}
|
||||
|
||||
inline bool IsInNamespace(int32_t aNamespace) const
|
||||
{
|
||||
return mNodeInfo->NamespaceID() == aNamespace;
|
||||
}
|
||||
|
||||
protected:
|
||||
// These 2 methods are useful for the recursive templates IsHTMLElement,
|
||||
// IsSVGElement, etc.
|
||||
inline bool IsNodeInternal() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsNodeInternal(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return mNodeInfo->Equals(aFirst) || IsNodeInternal(aArgs...);
|
||||
}
|
||||
|
||||
public:
|
||||
inline bool IsHTMLElement() const
|
||||
{
|
||||
return IsElement() && IsInNamespace(kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
inline bool IsHTMLElement(nsIAtom* aTag) const
|
||||
{
|
||||
return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfHTMLElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsHTMLElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
|
||||
inline bool IsSVGElement() const
|
||||
{
|
||||
return IsElement() && IsInNamespace(kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
inline bool IsSVGElement(nsIAtom* aTag) const
|
||||
{
|
||||
return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfSVGElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsSVGElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
|
||||
inline bool IsXULElement() const
|
||||
{
|
||||
return IsElement() && IsInNamespace(kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline bool IsXULElement(nsIAtom* aTag) const
|
||||
{
|
||||
return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfXULElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsXULElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
|
||||
inline bool IsMathMLElement() const
|
||||
{
|
||||
return IsElement() && IsInNamespace(kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
inline bool IsMathMLElement(nsIAtom* aTag) const
|
||||
{
|
||||
return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
template<typename First, typename... Args>
|
||||
inline bool IsAnyOfMathMLElements(First aFirst, Args... aArgs) const
|
||||
{
|
||||
return IsMathMLElement() && IsNodeInternal(aFirst, aArgs...);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a content node at a particular index. This method handles calling
|
||||
* BindToTree on the child appropriately.
|
||||
|
@ -224,7 +224,7 @@ nsNodeUtils::LastRelease(nsINode* aNode)
|
||||
static_cast<nsGenericHTMLFormElement*>(aNode)->ClearForm(true);
|
||||
}
|
||||
|
||||
if (aNode->IsElement() && aNode->AsElement()->IsHTML(nsGkAtoms::img) &&
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::img) &&
|
||||
aNode->HasFlag(ADDED_TO_FORM)) {
|
||||
HTMLImageElement* imageElem = static_cast<HTMLImageElement*>(aNode);
|
||||
imageElem->ClearForm(true);
|
||||
@ -527,8 +527,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
// cloning, so kids of the new node aren't confused about whether they're
|
||||
// in a document.
|
||||
#ifdef MOZ_XUL
|
||||
if (aClone && !aParent && aNode->IsElement() &&
|
||||
aNode->AsElement()->IsXUL()) {
|
||||
if (aClone && !aParent && aNode->IsXULElement()) {
|
||||
if (!aNode->OwnerDoc()->IsLoadedAsInteractiveData()) {
|
||||
clone->SetFlags(NODE_FORCE_XBL_BINDINGS);
|
||||
}
|
||||
@ -565,7 +564,7 @@ nsNodeUtils::UnlinkUserData(nsINode *aNode)
|
||||
bool
|
||||
nsNodeUtils::IsTemplateElement(const nsINode *aNode)
|
||||
{
|
||||
return aNode->IsElement() && aNode->AsElement()->IsHTML(nsGkAtoms::_template);
|
||||
return aNode->IsHTMLElement(nsGkAtoms::_template);
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
|
@ -965,7 +965,7 @@ nsObjectLoadingContent::BuildParametersArray()
|
||||
|
||||
int32_t start = 0, end = content->GetAttrCount(), step = 1;
|
||||
// HTML attributes are stored in reverse order.
|
||||
if (content->IsHTML() && content->IsInHTMLDocument()) {
|
||||
if (content->IsHTMLElement() && content->IsInHTMLDocument()) {
|
||||
start = end - 1;
|
||||
end = -1;
|
||||
step = -1;
|
||||
@ -2895,7 +2895,7 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
NS_ASSERTION(thisContent, "must be a content");
|
||||
|
||||
if (!thisContent->IsHTML() || mContentType.IsEmpty()) {
|
||||
if (!thisContent->IsHTMLElement() || mContentType.IsEmpty()) {
|
||||
// Don't let custom fallback handlers run outside HTML, tags without a
|
||||
// determined type should always just be alternate content
|
||||
aType = eFallbackAlternate;
|
||||
@ -2909,7 +2909,7 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
|
||||
// Show alternate content instead, if it exists
|
||||
for (nsIContent* child = thisContent->GetFirstChild();
|
||||
child; child = child->GetNextSibling()) {
|
||||
if (!child->IsHTML(nsGkAtoms::param) &&
|
||||
if (!child->IsHTMLElement(nsGkAtoms::param) &&
|
||||
nsStyleUtil::IsSignificantChild(child, true, false)) {
|
||||
aType = eFallbackAlternate;
|
||||
break;
|
||||
|
@ -1773,7 +1773,7 @@ nsPlainTextSerializer::IsCurrentNodeConverted()
|
||||
nsIAtom*
|
||||
nsPlainTextSerializer::GetIdForContent(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent->IsHTML()) {
|
||||
if (!aContent->IsHTMLElement()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ NS_IMPL_ISUPPORTS(nsScriptLoader, nsIStreamLoaderObserver)
|
||||
static bool
|
||||
IsScriptEventHandler(nsIContent* aScriptElement)
|
||||
{
|
||||
if (!aScriptElement->IsHTML()) {
|
||||
if (!aScriptElement->IsHTMLElement()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -575,7 +575,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
// no 'type=' element
|
||||
// "language" is a deprecated attribute of HTML, so we check it only for
|
||||
// HTML script elements.
|
||||
if (scriptContent->IsHTML()) {
|
||||
if (scriptContent->IsHTMLElement()) {
|
||||
nsAutoString language;
|
||||
scriptContent->GetAttr(kNameSpaceID_None, nsGkAtoms::language, language);
|
||||
if (!language.IsEmpty()) {
|
||||
|
@ -227,8 +227,8 @@ IsScopedStyleElement(nsIContent* aContent)
|
||||
// This is quicker than, say, QIing aContent to nsStyleLinkElement
|
||||
// and then calling its virtual GetStyleSheetInfo method to find out
|
||||
// if it is scoped.
|
||||
return (aContent->IsHTML(nsGkAtoms::style) ||
|
||||
aContent->IsSVG(nsGkAtoms::style)) &&
|
||||
return (aContent->IsHTMLElement(nsGkAtoms::style) ||
|
||||
aContent->IsSVGElement(nsGkAtoms::style)) &&
|
||||
aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scoped);
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ nsStyleLinkElement::DoUpdateStyleSheet(nsIDocument* aOldDocument,
|
||||
// Check for a ShadowRoot because link elements are inert in a
|
||||
// ShadowRoot.
|
||||
ShadowRoot* containingShadow = thisContent->GetContainingShadow();
|
||||
if (thisContent->IsHTML(nsGkAtoms::link) &&
|
||||
if (thisContent->IsHTMLElement(nsGkAtoms::link) &&
|
||||
(aOldShadowRoot || containingShadow)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1214,10 +1214,10 @@ nsTreeSanitizer::SanitizeAttributes(mozilla::dom::Element* aElement,
|
||||
}
|
||||
if (aAllowed->GetEntry(attrLocal) &&
|
||||
!((attrLocal == nsGkAtoms::rel &&
|
||||
aElement->IsHTML(nsGkAtoms::link)) ||
|
||||
aElement->IsHTMLElement(nsGkAtoms::link)) ||
|
||||
(!mFullDocument &&
|
||||
attrLocal == nsGkAtoms::name &&
|
||||
aElement->IsHTML(nsGkAtoms::meta)))) {
|
||||
aElement->IsHTMLElement(nsGkAtoms::meta)))) {
|
||||
// name="" and rel="" are whitelisted, but treat them as blacklisted
|
||||
// for <meta name> (fragment case) and <link rel> (all cases) to avoid
|
||||
// document-wide metadata or styling overrides with non-conforming
|
||||
@ -1273,8 +1273,7 @@ nsTreeSanitizer::SanitizeAttributes(mozilla::dom::Element* aElement,
|
||||
|
||||
// If we've got HTML audio or video, add the controls attribute, because
|
||||
// otherwise the content is unplayable with scripts removed.
|
||||
if (aElement->IsHTML(nsGkAtoms::video) ||
|
||||
aElement->IsHTML(nsGkAtoms::audio)) {
|
||||
if (aElement->IsAnyOfHTMLElements(nsGkAtoms::video, nsGkAtoms::audio)) {
|
||||
aElement->SetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::controls,
|
||||
EmptyString(),
|
||||
@ -1358,7 +1357,7 @@ nsTreeSanitizer::Sanitize(nsIDocument* aDocument)
|
||||
#ifdef DEBUG
|
||||
NS_PRECONDITION(!aDocument->GetContainer(), "The document is in a shell.");
|
||||
nsRefPtr<mozilla::dom::Element> root = aDocument->GetRootElement();
|
||||
NS_PRECONDITION(root->IsHTML(nsGkAtoms::html), "Not HTML root.");
|
||||
NS_PRECONDITION(root->IsHTMLElement(nsGkAtoms::html), "Not HTML root.");
|
||||
#endif
|
||||
|
||||
mFullDocument = true;
|
||||
|
@ -466,7 +466,7 @@ nsXHTMLContentSerializer::AfterElementStart(nsIContent * aContent,
|
||||
for (nsIContent* child = aContent->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::meta) &&
|
||||
if (child->IsHTMLElement(nsGkAtoms::meta) &&
|
||||
child->HasAttr(kNameSpaceID_None, nsGkAtoms::content)) {
|
||||
nsAutoString header;
|
||||
child->GetAttr(kNameSpaceID_None, nsGkAtoms::httpEquiv, header);
|
||||
|
@ -766,9 +766,9 @@ bool
|
||||
nsXMLContentSerializer::IsJavaScript(nsIContent * aContent, nsIAtom* aAttrNameAtom,
|
||||
int32_t aAttrNamespaceID, const nsAString& aValueString)
|
||||
{
|
||||
bool isHtml = aContent->IsHTML();
|
||||
bool isXul = aContent->IsXUL();
|
||||
bool isSvg = aContent->IsSVG();
|
||||
bool isHtml = aContent->IsHTMLElement();
|
||||
bool isXul = aContent->IsXULElement();
|
||||
bool isSvg = aContent->IsSVGElement();
|
||||
|
||||
if (aAttrNamespaceID == kNameSpaceID_None &&
|
||||
(isHtml || isXul || isSvg) &&
|
||||
|
@ -195,7 +195,7 @@ ContentEventHandler::QueryContentRect(nsIContent* aContent,
|
||||
// we don't want to include the bogus BRs at the end.
|
||||
static bool IsContentBR(nsIContent* aContent)
|
||||
{
|
||||
return aContent->IsHTML() &&
|
||||
return aContent->IsHTMLElement() &&
|
||||
aContent->Tag() == nsGkAtoms::br &&
|
||||
!aContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::type,
|
||||
@ -1391,7 +1391,7 @@ static void AdjustRangeForSelection(nsIContent* aRoot,
|
||||
}
|
||||
|
||||
nsIContent* brContent = node->GetChildAt(nodeOffset - 1);
|
||||
while (brContent && brContent->IsHTML()) {
|
||||
while (brContent && brContent->IsHTMLElement()) {
|
||||
if (brContent->Tag() != nsGkAtoms::br || IsContentBR(brContent)) {
|
||||
break;
|
||||
}
|
||||
|
@ -872,7 +872,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
||||
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDoc =
|
||||
do_QueryInterface(aContent->OwnerDoc());
|
||||
if (!xulDoc && !aContent->IsXUL())
|
||||
if (!xulDoc && !aContent->IsXULElement())
|
||||
return true;
|
||||
|
||||
// For XUL we do visibility checks.
|
||||
@ -890,7 +890,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
||||
if (control)
|
||||
return true;
|
||||
|
||||
if (aContent->IsHTML()) {
|
||||
if (aContent->IsHTMLElement()) {
|
||||
nsIAtom* tag = aContent->Tag();
|
||||
|
||||
// HTML area, label and legend elements are never focusable, so
|
||||
@ -900,7 +900,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
||||
tag == nsGkAtoms::legend)
|
||||
return true;
|
||||
|
||||
} else if (aContent->IsXUL()) {
|
||||
} else if (aContent->IsXULElement()) {
|
||||
// XUL label elements are never focusable, so we need to check for them
|
||||
// explicitly before giving up.
|
||||
if (aContent->Tag() == nsGkAtoms::label)
|
||||
@ -1126,7 +1126,7 @@ EventStateManager::IsRemoteTarget(nsIContent* target) {
|
||||
// <browser/iframe remote=true> from XUL
|
||||
if ((target->Tag() == nsGkAtoms::browser ||
|
||||
target->Tag() == nsGkAtoms::iframe) &&
|
||||
target->IsXUL() &&
|
||||
target->IsXULElement() &&
|
||||
target->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote,
|
||||
nsGkAtoms::_true, eIgnoreCase)) {
|
||||
return true;
|
||||
@ -1387,7 +1387,7 @@ EventStateManager::FireContextClick()
|
||||
nsIAtom *tag = mGestureDownContent->Tag();
|
||||
bool allowedToDispatch = true;
|
||||
|
||||
if (mGestureDownContent->IsXUL()) {
|
||||
if (mGestureDownContent->IsXULElement()) {
|
||||
if (tag == nsGkAtoms::scrollbar ||
|
||||
tag == nsGkAtoms::scrollbarbutton ||
|
||||
tag == nsGkAtoms::button)
|
||||
@ -1408,7 +1408,7 @@ EventStateManager::FireContextClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mGestureDownContent->IsHTML()) {
|
||||
else if (mGestureDownContent->IsHTMLElement()) {
|
||||
nsCOMPtr<nsIFormControl> formCtrl(do_QueryInterface(mGestureDownContent));
|
||||
|
||||
if (formCtrl) {
|
||||
@ -2646,7 +2646,7 @@ static bool
|
||||
NodeAllowsClickThrough(nsINode* aNode)
|
||||
{
|
||||
while (aNode) {
|
||||
if (aNode->IsElement() && aNode->AsElement()->IsXUL()) {
|
||||
if (aNode->IsXULElement()) {
|
||||
mozilla::dom::Element* element = aNode->AsElement();
|
||||
static nsIContent::AttrValuesArray strings[] =
|
||||
{&nsGkAtoms::always, &nsGkAtoms::never, nullptr};
|
||||
@ -2888,7 +2888,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||
EnsureDocument(mPresContext);
|
||||
if (mDocument) {
|
||||
#ifdef XP_MACOSX
|
||||
if (!activeContent || !activeContent->IsXUL())
|
||||
if (!activeContent || !activeContent->IsXULElement())
|
||||
#endif
|
||||
fm->ClearFocus(mDocument->GetWindow());
|
||||
fm->SetFocusedWindow(mDocument->GetWindow());
|
||||
@ -4807,7 +4807,7 @@ EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
|
||||
* the current link. We want to make sure that the UI gets informed when they
|
||||
* are actually removed from the DOM.
|
||||
*/
|
||||
if (aContent->IsHTML() &&
|
||||
if (aContent->IsHTMLElement() &&
|
||||
(aContent->Tag() == nsGkAtoms::a || aContent->Tag() == nsGkAtoms::area) &&
|
||||
(aContent->AsElement()->State().HasAtLeastOneOfStates(NS_EVENT_STATE_FOCUS |
|
||||
NS_EVENT_STATE_HOVER))) {
|
||||
|
@ -917,7 +917,7 @@ GetContentBR(dom::Element* aElement)
|
||||
return nullptr;
|
||||
}
|
||||
nsIContent* content = static_cast<nsIContent*>(aElement);
|
||||
return content->IsHTML(nsGkAtoms::br) ? content : nullptr;
|
||||
return content->IsHTMLElement(nsGkAtoms::br) ? content : nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -842,7 +842,7 @@ IMEStateManager::SetIMEState(const IMEState& aState,
|
||||
willSubmit = true;
|
||||
// is this an html form and does it only have a single text input element?
|
||||
} else if (formElement && formElement->Tag() == nsGkAtoms::form &&
|
||||
formElement->IsHTML() &&
|
||||
formElement->IsHTMLElement() &&
|
||||
!static_cast<dom::HTMLFormElement*>(formElement)->
|
||||
ImplicitSubmissionIsDisabled()) {
|
||||
willSubmit = true;
|
||||
|
@ -65,8 +65,7 @@ HTMLContentElement::BindToTree(nsIDocument* aDocument,
|
||||
if (containingShadow && !oldContainingShadow) {
|
||||
nsINode* parentNode = nsINode::GetParentNode();
|
||||
while (parentNode && parentNode != containingShadow) {
|
||||
if (parentNode->IsElement() &&
|
||||
parentNode->AsElement()->IsHTML(nsGkAtoms::content)) {
|
||||
if (parentNode->IsHTMLElement(nsGkAtoms::content)) {
|
||||
// Content element in fallback content is not an insertion point.
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ HTMLFieldSetElement::InsertChildAt(nsIContent* aChild, uint32_t aIndex,
|
||||
{
|
||||
bool firstLegendHasChanged = false;
|
||||
|
||||
if (aChild->IsHTML(nsGkAtoms::legend)) {
|
||||
if (aChild->IsHTMLElement(nsGkAtoms::legend)) {
|
||||
if (!mFirstLegend) {
|
||||
mFirstLegend = aChild;
|
||||
// We do not want to notify the first time mFirstElement is set.
|
||||
@ -199,7 +199,7 @@ HTMLFieldSetElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
|
||||
firstLegendHasChanged = true;
|
||||
|
||||
for (; child; child = child->GetNextSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::legend)) {
|
||||
if (child->IsHTMLElement(nsGkAtoms::legend)) {
|
||||
mFirstLegend = child;
|
||||
break;
|
||||
}
|
||||
|
@ -702,7 +702,7 @@ HTMLFormElement::BuildSubmission(nsFormSubmission** aFormSubmission,
|
||||
if (formEvent) {
|
||||
nsIContent* originator = formEvent->originator;
|
||||
if (originator) {
|
||||
if (!originator->IsHTML()) {
|
||||
if (!originator->IsHTMLElement()) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
originatingElement = static_cast<nsGenericHTMLElement*>(originator);
|
||||
@ -1966,7 +1966,7 @@ HTMLFormElement::CheckValidFormSubmission()
|
||||
i < length; ++i) {
|
||||
// Input elements can trigger a form submission and we want to
|
||||
// update the style in that case.
|
||||
if (mControls->mElements[i]->IsHTML(nsGkAtoms::input) &&
|
||||
if (mControls->mElements[i]->IsHTMLElement(nsGkAtoms::input) &&
|
||||
nsContentUtils::IsFocusedContent(mControls->mElements[i])) {
|
||||
static_cast<HTMLInputElement*>(mControls->mElements[i])
|
||||
->UpdateValidityUIBits(true);
|
||||
|
@ -585,7 +585,7 @@ HTMLImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
UpdateFormOwner();
|
||||
}
|
||||
|
||||
bool addedToPicture = aParent && aParent->IsHTML(nsGkAtoms::picture) &&
|
||||
bool addedToPicture = aParent && aParent->IsHTMLElement(nsGkAtoms::picture) &&
|
||||
HTMLPictureElement::IsPictureEnabled();
|
||||
if (addedToPicture) {
|
||||
QueueImageLoadTask();
|
||||
@ -630,7 +630,7 @@ HTMLImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
}
|
||||
|
||||
if (aNullParent && GetParent() &&
|
||||
GetParent()->IsHTML(nsGkAtoms::picture) &&
|
||||
GetParent()->IsHTMLElement(nsGkAtoms::picture) &&
|
||||
HTMLPictureElement::IsPictureEnabled()) {
|
||||
// Being removed from picture re-triggers selection, even if we
|
||||
// weren't using a <source> peer
|
||||
@ -888,7 +888,7 @@ HTMLImageElement::HaveSrcsetOrInPicture()
|
||||
}
|
||||
|
||||
Element *parent = nsINode::GetParentElement();
|
||||
return (parent && parent->IsHTML(nsGkAtoms::picture));
|
||||
return (parent && parent->IsHTMLElement(nsGkAtoms::picture));
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1046,7 +1046,7 @@ HTMLImageElement::UpdateResponsiveSource()
|
||||
Element *parent = pictureEnabled ? nsINode::GetParentElement() : nullptr;
|
||||
|
||||
nsINode *candidateSource = nullptr;
|
||||
if (parent && parent->IsHTML(nsGkAtoms::picture)) {
|
||||
if (parent && parent->IsHTMLElement(nsGkAtoms::picture)) {
|
||||
// Walk source nodes previous to ourselves
|
||||
candidateSource = parent->GetFirstChild();
|
||||
} else {
|
||||
@ -1075,8 +1075,7 @@ HTMLImageElement::UpdateResponsiveSource()
|
||||
mResponsiveSelector = nullptr;
|
||||
}
|
||||
break;
|
||||
} else if (candidateSource->IsElement() &&
|
||||
candidateSource->AsElement()->IsHTML(nsGkAtoms::source) &&
|
||||
} else if (candidateSource->IsHTMLElement(nsGkAtoms::source) &&
|
||||
TryCreateResponsiveSelector(candidateSource->AsContent())) {
|
||||
// This led to a valid source, stop
|
||||
break;
|
||||
@ -1109,10 +1108,10 @@ HTMLImageElement::TryCreateResponsiveSelector(nsIContent *aSourceNode,
|
||||
|
||||
bool pictureEnabled = HTMLPictureElement::IsPictureEnabled();
|
||||
// Skip if this is not a <source> with matching media query
|
||||
bool isSourceTag = aSourceNode->IsHTML(nsGkAtoms::source);
|
||||
bool isSourceTag = aSourceNode->IsHTMLElement(nsGkAtoms::source);
|
||||
if (isSourceTag) {
|
||||
DebugOnly<Element *> parent(nsINode::GetParentElement());
|
||||
MOZ_ASSERT(parent && parent->IsHTML(nsGkAtoms::picture));
|
||||
MOZ_ASSERT(parent && parent->IsHTMLElement(nsGkAtoms::picture));
|
||||
MOZ_ASSERT(IsPreviousSibling(aSourceNode, this));
|
||||
MOZ_ASSERT(pictureEnabled);
|
||||
|
||||
@ -1127,7 +1126,7 @@ HTMLImageElement::TryCreateResponsiveSelector(nsIContent *aSourceNode,
|
||||
!SupportedPictureSourceType(type)) {
|
||||
return false;
|
||||
}
|
||||
} else if (aSourceNode->IsHTML(nsGkAtoms::img)) {
|
||||
} else if (aSourceNode->IsHTMLElement(nsGkAtoms::img)) {
|
||||
// Otherwise this is the <img> tag itself
|
||||
MOZ_ASSERT(aSourceNode == this);
|
||||
}
|
||||
|
@ -1885,7 +1885,7 @@ HTMLInputElement::GetList() const
|
||||
}
|
||||
|
||||
Element* element = doc->GetElementById(dataListId);
|
||||
if (!element || !element->IsHTML(nsGkAtoms::datalist)) {
|
||||
if (!element || !element->IsHTMLElement(nsGkAtoms::datalist)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ HTMLLegendElement::GetFieldSet() const
|
||||
{
|
||||
nsIContent* parent = GetParent();
|
||||
|
||||
if (parent && parent->IsHTML(nsGkAtoms::fieldset)) {
|
||||
if (parent && parent->IsHTMLElement(nsGkAtoms::fieldset)) {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ already_AddRefed<HTMLFormElement>
|
||||
HTMLLegendElement::GetForm()
|
||||
{
|
||||
Element* form = GetFormElement();
|
||||
MOZ_ASSERT_IF(form, form->IsHTML(nsGkAtoms::form));
|
||||
MOZ_ASSERT_IF(form, form->IsHTMLElement(nsGkAtoms::form));
|
||||
nsRefPtr<HTMLFormElement> ret = static_cast<HTMLFormElement*>(form);
|
||||
return ret.forget();
|
||||
}
|
||||
|
@ -814,7 +814,7 @@ static bool HasSourceChildren(nsIContent* aElement)
|
||||
for (nsIContent* child = aElement->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::source))
|
||||
if (child->IsHTMLElement(nsGkAtoms::source))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -3952,7 +3952,7 @@ nsIContent* HTMLMediaElement::GetNextSource()
|
||||
nsIContent* child = GetChildAt(startOffset);
|
||||
|
||||
// If child is a <source> element, it is the next candidate.
|
||||
if (child && child->IsHTML(nsGkAtoms::source)) {
|
||||
if (child && child->IsHTMLElement(nsGkAtoms::source)) {
|
||||
mSourceLoadCandidate = child;
|
||||
return child;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ nsIContent*
|
||||
HTMLOptGroupElement::GetSelect()
|
||||
{
|
||||
nsIContent* parent = this;
|
||||
while ((parent = parent->GetParent()) && parent->IsHTML()) {
|
||||
while ((parent = parent->GetParent()) && parent->IsHTMLElement()) {
|
||||
if (parent->Tag() == nsGkAtoms::select) {
|
||||
return parent;
|
||||
}
|
||||
@ -114,7 +114,7 @@ HTMLOptGroupElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
// disabled attribute. We should make sure their state is updated.
|
||||
for (nsIContent* child = nsINode::GetFirstChild(); child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::option)) {
|
||||
if (child->IsHTMLElement(nsGkAtoms::option)) {
|
||||
// No need to call |IsElement()| because it's an HTML element.
|
||||
child->AsElement()->UpdateState(true);
|
||||
}
|
||||
|
@ -273,7 +273,8 @@ HTMLOptionElement::GetText(nsAString& aText)
|
||||
child->NodeType() == nsIDOMNode::CDATA_SECTION_NODE) {
|
||||
child->AppendTextTo(text);
|
||||
}
|
||||
if (child->IsHTML(nsGkAtoms::script) || child->IsSVG(nsGkAtoms::script)) {
|
||||
if (child->IsHTMLElement(nsGkAtoms::script) ||
|
||||
child->IsSVGElement(nsGkAtoms::script)) {
|
||||
child = child->GetNextNonChildNode(this);
|
||||
} else {
|
||||
child = child->GetNextNode(this);
|
||||
@ -336,7 +337,7 @@ HTMLOptionElement::IntrinsicState() const
|
||||
state &= ~NS_EVENT_STATE_ENABLED;
|
||||
} else {
|
||||
nsIContent* parent = GetParent();
|
||||
if (parent && parent->IsHTML(nsGkAtoms::optgroup) &&
|
||||
if (parent && parent->IsHTMLElement(nsGkAtoms::optgroup) &&
|
||||
parent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
|
||||
state |= NS_EVENT_STATE_DISABLED;
|
||||
state &= ~NS_EVENT_STATE_ENABLED;
|
||||
@ -355,7 +356,7 @@ HTMLOptionElement::GetSelect()
|
||||
{
|
||||
nsIContent* parent = this;
|
||||
while ((parent = parent->GetParent()) &&
|
||||
parent->IsHTML()) {
|
||||
parent->IsHTMLElement()) {
|
||||
HTMLSelectElement* select = HTMLSelectElement::FromContent(parent);
|
||||
if (select) {
|
||||
return select;
|
||||
|
@ -277,11 +277,11 @@ HTMLPropertiesCollection::CrawlSubtree(Element* aElement)
|
||||
while (aContent) {
|
||||
// We must check aContent against mRoot because
|
||||
// an element must not be its own property
|
||||
if (aContent == mRoot || !aContent->IsHTML()) {
|
||||
if (aContent == mRoot || !aContent->IsHTMLElement()) {
|
||||
// Move on to the next node in the tree
|
||||
aContent = aContent->GetNextNode(aElement);
|
||||
} else {
|
||||
MOZ_ASSERT(aContent->IsElement(), "IsHTML() returned true!");
|
||||
MOZ_ASSERT(aContent->IsElement(), "IsHTMLElement() returned true!");
|
||||
Element* element = aContent->AsElement();
|
||||
if (element->HasAttr(kNameSpaceID_None, nsGkAtoms::itemprop) &&
|
||||
!mProperties.Contains(element)) {
|
||||
|
@ -350,7 +350,7 @@ HTMLSelectElement::InsertOptionsIntoListRecurse(nsIContent* aOptions,
|
||||
}
|
||||
|
||||
// Recurse down into optgroups
|
||||
if (aOptions->IsHTML(nsGkAtoms::optgroup)) {
|
||||
if (aOptions->IsHTMLElement(nsGkAtoms::optgroup)) {
|
||||
mOptGroupCount++;
|
||||
|
||||
for (nsIContent* child = aOptions->GetFirstChild();
|
||||
@ -391,7 +391,7 @@ HTMLSelectElement::RemoveOptionsFromListRecurse(nsIContent* aOptions,
|
||||
}
|
||||
|
||||
// Recurse down deeper for options
|
||||
if (mOptGroupCount && aOptions->IsHTML(nsGkAtoms::optgroup)) {
|
||||
if (mOptGroupCount && aOptions->IsHTMLElement(nsGkAtoms::optgroup)) {
|
||||
mOptGroupCount--;
|
||||
|
||||
for (nsIContent* child = aOptions->GetFirstChild();
|
||||
@ -1135,7 +1135,7 @@ HTMLSelectElement::IsOptionDisabled(HTMLOptionElement* aOption)
|
||||
node;
|
||||
node = node->GetParentElement()) {
|
||||
// If we reached the select element, we're done
|
||||
if (node->IsHTML(nsGkAtoms::select)) {
|
||||
if (node->IsHTMLElement(nsGkAtoms::select)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1792,7 +1792,7 @@ AddOptionsRecurse(nsIContent* aRoot, HTMLOptionsCollection* aArray)
|
||||
HTMLOptionElement* opt = HTMLOptionElement::FromContent(cur);
|
||||
if (opt) {
|
||||
aArray->AppendOption(opt);
|
||||
} else if (cur->IsHTML(nsGkAtoms::optgroup)) {
|
||||
} else if (cur->IsHTMLElement(nsGkAtoms::optgroup)) {
|
||||
AddOptionsRecurse(cur, aArray);
|
||||
}
|
||||
}
|
||||
@ -1873,7 +1873,7 @@ VerifyOptionsRecurse(nsIContent* aRoot, int32_t& aIndex,
|
||||
if (opt) {
|
||||
NS_ASSERTION(opt == aArray->ItemAsOption(aIndex++),
|
||||
"Options collection broken");
|
||||
} else if (cur->IsHTML(nsGkAtoms::optgroup)) {
|
||||
} else if (cur->IsHTMLElement(nsGkAtoms::optgroup)) {
|
||||
VerifyOptionsRecurse(cur, aIndex, aArray);
|
||||
}
|
||||
}
|
||||
|
@ -94,8 +94,7 @@ IsInFallbackContent(nsIContent* aContent)
|
||||
{
|
||||
nsINode* parentNode = aContent->GetParentNode();
|
||||
while (parentNode) {
|
||||
if (parentNode->IsElement() &&
|
||||
parentNode->AsElement()->IsHTML(nsGkAtoms::content)) {
|
||||
if (parentNode->IsHTMLElement(nsGkAtoms::content)) {
|
||||
return true;
|
||||
}
|
||||
parentNode = parentNode->GetParentNode();
|
||||
|
@ -157,7 +157,7 @@ SetBaseURIUsingFirstBaseWithHref(nsIDocument* aDocument, nsIContent* aMustMatch)
|
||||
|
||||
for (nsIContent* child = aDocument->GetFirstChild(); child;
|
||||
child = child->GetNextNode()) {
|
||||
if (child->IsHTML(nsGkAtoms::base) &&
|
||||
if (child->IsHTMLElement(nsGkAtoms::base) &&
|
||||
child->HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
|
||||
if (aMustMatch && child != aMustMatch) {
|
||||
return;
|
||||
@ -194,7 +194,7 @@ SetBaseTargetUsingFirstBaseWithTarget(nsIDocument* aDocument,
|
||||
|
||||
for (nsIContent* child = aDocument->GetFirstChild(); child;
|
||||
child = child->GetNextNode()) {
|
||||
if (child->IsHTML(nsGkAtoms::base) &&
|
||||
if (child->IsHTMLElement(nsGkAtoms::base) &&
|
||||
child->HasAttr(kNameSpaceID_None, nsGkAtoms::target)) {
|
||||
if (aMustMatch && child != aMustMatch) {
|
||||
return;
|
||||
|
@ -56,14 +56,14 @@ HTMLTableCellElement::GetTable() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (section->IsHTML(nsGkAtoms::table)) {
|
||||
if (section->IsHTMLElement(nsGkAtoms::table)) {
|
||||
// XHTML, without a row group.
|
||||
return static_cast<HTMLTableElement*>(section);
|
||||
}
|
||||
|
||||
// We have a row group.
|
||||
nsIContent* result = section->GetParent();
|
||||
if (result && result->IsHTML(nsGkAtoms::table)) {
|
||||
if (result && result->IsHTMLElement(nsGkAtoms::table)) {
|
||||
return static_cast<HTMLTableElement*>(result);
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ NS_INTERFACE_MAP_END
|
||||
/* TBodies */ \
|
||||
for (nsIContent* _node = mParent->nsINode::GetFirstChild(); \
|
||||
_node; _node = _node->GetNextSibling()) { \
|
||||
if (_node->IsHTML(nsGkAtoms::tbody)) { \
|
||||
if (_node->IsHTMLElement(nsGkAtoms::tbody)) { \
|
||||
rowGroup = static_cast<HTMLTableSectionElement*>(_node); \
|
||||
rows = rowGroup->Rows(); \
|
||||
do { /* gives scoping */ \
|
||||
@ -474,7 +474,7 @@ HTMLTableElement::CreateTBody()
|
||||
for (nsIContent* child = nsINode::GetLastChild();
|
||||
child;
|
||||
child = child->GetPreviousSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::tbody)) {
|
||||
if (child->IsHTMLElement(nsGkAtoms::tbody)) {
|
||||
referenceNode = child->GetNextSibling();
|
||||
break;
|
||||
}
|
||||
@ -552,7 +552,7 @@ HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
|
||||
for (nsIContent* child = nsINode::GetLastChild();
|
||||
child;
|
||||
child = child->GetPreviousSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::tbody)) {
|
||||
if (child->IsHTMLElement(nsGkAtoms::tbody)) {
|
||||
rowGroup = child;
|
||||
break;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
}
|
||||
void SetTHead(HTMLTableSectionElement* aTHead, ErrorResult& aError)
|
||||
{
|
||||
if (aTHead && !aTHead->IsHTML(nsGkAtoms::thead)) {
|
||||
if (aTHead && !aTHead->IsHTMLElement(nsGkAtoms::thead)) {
|
||||
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
|
||||
return;
|
||||
}
|
||||
@ -74,7 +74,7 @@ public:
|
||||
}
|
||||
void SetTFoot(HTMLTableSectionElement* aTFoot, ErrorResult& aError)
|
||||
{
|
||||
if (aTFoot && !aTFoot->IsHTML(nsGkAtoms::tfoot)) {
|
||||
if (aTFoot && !aTFoot->IsHTMLElement(nsGkAtoms::tfoot)) {
|
||||
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
|
||||
return;
|
||||
}
|
||||
@ -212,7 +212,7 @@ protected:
|
||||
{
|
||||
for (nsIContent* cur = nsINode::GetFirstChild(); cur;
|
||||
cur = cur->GetNextSibling()) {
|
||||
if (cur->IsHTML(aTag)) {
|
||||
if (cur->IsHTMLElement(aTag)) {
|
||||
return cur;
|
||||
}
|
||||
}
|
||||
|
@ -51,9 +51,10 @@ HTMLTableSectionElement*
|
||||
HTMLTableRowElement::GetSection() const
|
||||
{
|
||||
nsIContent* parent = GetParent();
|
||||
if (parent && parent->IsHTML() && (parent->Tag() == nsGkAtoms::thead ||
|
||||
parent->Tag() == nsGkAtoms::tbody ||
|
||||
parent->Tag() == nsGkAtoms::tfoot)) {
|
||||
if (parent && parent->IsHTMLElement() &&
|
||||
(parent->Tag() == nsGkAtoms::thead ||
|
||||
parent->Tag() == nsGkAtoms::tbody ||
|
||||
parent->Tag() == nsGkAtoms::tfoot)) {
|
||||
return static_cast<HTMLTableSectionElement*>(parent);
|
||||
}
|
||||
return nullptr;
|
||||
@ -124,7 +125,7 @@ IsCell(nsIContent *aContent, int32_t aNamespaceID,
|
||||
nsIAtom* tag = aContent->Tag();
|
||||
|
||||
return ((tag == nsGkAtoms::td || tag == nsGkAtoms::th) &&
|
||||
aContent->IsHTML());
|
||||
aContent->IsHTMLElement());
|
||||
}
|
||||
|
||||
nsIHTMLCollection*
|
||||
|
@ -633,7 +633,7 @@ ImageDocument::CreateSyntheticDocument()
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsRefPtr<NodeInfo> nodeInfo;
|
||||
nsRefPtr<mozilla::dom::NodeInfo> nodeInfo;
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::img, nullptr,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
|
@ -316,8 +316,9 @@ IsOffsetParent(nsIFrame* aFrame)
|
||||
// with display: table-cell with no actual table
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
|
||||
return content->IsHTML(nsGkAtoms::table) || content->IsHTML(nsGkAtoms::td)
|
||||
|| content->IsHTML(nsGkAtoms::th);
|
||||
return content->IsAnyOfHTMLElements(nsGkAtoms::table,
|
||||
nsGkAtoms::td,
|
||||
nsGkAtoms::th);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -345,7 +346,8 @@ nsGenericHTMLElement::GetOffsetRect(CSSIntRect& aRect)
|
||||
Element* docElement = GetComposedDoc()->GetRootElement();
|
||||
nsIContent* content = frame->GetContent();
|
||||
|
||||
if (content && (content->IsHTML(nsGkAtoms::body) || content == docElement)) {
|
||||
if (content && (content->IsHTMLElement(nsGkAtoms::body) ||
|
||||
content == docElement)) {
|
||||
parent = frame;
|
||||
}
|
||||
else {
|
||||
@ -377,7 +379,7 @@ nsGenericHTMLElement::GetOffsetRect(CSSIntRect& aRect)
|
||||
|
||||
// Break if the ancestor frame type makes it suitable as offset parent
|
||||
// and this element is *not* positioned or if we found the body element.
|
||||
if (isOffsetParent || content->IsHTML(nsGkAtoms::body)) {
|
||||
if (isOffsetParent || content->IsHTMLElement(nsGkAtoms::body)) {
|
||||
offsetParent = content;
|
||||
break;
|
||||
}
|
||||
@ -437,7 +439,7 @@ nsGenericHTMLElement::Spellcheck()
|
||||
// Has the state has been explicitly set?
|
||||
nsIContent* node;
|
||||
for (node = this; node; node = node->GetParent()) {
|
||||
if (node->IsHTML()) {
|
||||
if (node->IsHTMLElement()) {
|
||||
static nsIContent::AttrValuesArray strings[] =
|
||||
{&nsGkAtoms::_true, &nsGkAtoms::_false, nullptr};
|
||||
switch (node->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck,
|
||||
@ -589,7 +591,7 @@ HTMLFormElement*
|
||||
nsGenericHTMLElement::FindAncestorForm(HTMLFormElement* aCurrentForm)
|
||||
{
|
||||
NS_ASSERTION(!HasAttr(kNameSpaceID_None, nsGkAtoms::form) ||
|
||||
IsHTML(nsGkAtoms::img),
|
||||
IsHTMLElement(nsGkAtoms::img),
|
||||
"FindAncestorForm should not be called if @form is set!");
|
||||
|
||||
// Make sure we don't end up finding a form that's anonymous from
|
||||
@ -599,7 +601,7 @@ nsGenericHTMLElement::FindAncestorForm(HTMLFormElement* aCurrentForm)
|
||||
nsIContent* content = this;
|
||||
while (content != bindingParent && content) {
|
||||
// If the current ancestor is a form, return it as our form
|
||||
if (content->IsHTML(nsGkAtoms::form)) {
|
||||
if (content->IsHTMLElement(nsGkAtoms::form)) {
|
||||
#ifdef DEBUG
|
||||
if (!nsContentUtils::IsInSameAnonymousTree(this, content)) {
|
||||
// It's possible that we started unbinding at |content| or
|
||||
@ -655,7 +657,8 @@ nsGenericHTMLElement::CheckHandleEventForAnchorsPreconditions(
|
||||
nsCOMPtr<nsIContent> target = aVisitor.mPresContext->EventStateManager()->
|
||||
GetEventTargetContent(aVisitor.mEvent);
|
||||
|
||||
return !target || !target->IsHTML(nsGkAtoms::area) || IsHTML(nsGkAtoms::area);
|
||||
return !target || !target->IsHTMLElement(nsGkAtoms::area) ||
|
||||
IsHTMLElement(nsGkAtoms::area);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -2403,7 +2406,7 @@ nsGenericHTMLFormElement::FormIdUpdated(Element* aOldElement,
|
||||
nsGenericHTMLFormElement* element =
|
||||
static_cast<nsGenericHTMLFormElement*>(aData);
|
||||
|
||||
NS_ASSERTION(element->IsHTML(), "aData should be an HTML element");
|
||||
NS_ASSERTION(element->IsHTMLElement(), "aData should be an HTML element");
|
||||
|
||||
element->UpdateFormOwner(false, aNewElement);
|
||||
|
||||
@ -2459,7 +2462,7 @@ nsGenericHTMLFormElement::UpdateFormOwner(bool aBindToTree,
|
||||
"element should be equals to the current element "
|
||||
"associated with the id in @form!");
|
||||
|
||||
if (element && element->IsHTML(nsGkAtoms::form)) {
|
||||
if (element && element->IsHTMLElement(nsGkAtoms::form)) {
|
||||
mForm = static_cast<HTMLFormElement*>(element);
|
||||
}
|
||||
}
|
||||
@ -2763,7 +2766,7 @@ nsGenericHTMLElement::IsCurrentBodyElement()
|
||||
{
|
||||
// TODO Bug 698498: Should this handle the case where GetBody returns a
|
||||
// frameset?
|
||||
if (!IsHTML(nsGkAtoms::body)) {
|
||||
if (!IsHTMLElement(nsGkAtoms::body)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -920,12 +920,12 @@ public:
|
||||
static inline bool
|
||||
ShouldExposeNameAsHTMLDocumentProperty(Element* aElement)
|
||||
{
|
||||
return aElement->IsHTML() && CanHaveName(aElement->Tag());
|
||||
return aElement->IsHTMLElement() && CanHaveName(aElement->Tag());
|
||||
}
|
||||
static inline bool
|
||||
ShouldExposeIdAsHTMLDocumentProperty(Element* aElement)
|
||||
{
|
||||
if (!aElement->IsHTML()) {
|
||||
if (!aElement->IsHTMLElement()) {
|
||||
return false;
|
||||
}
|
||||
nsIAtom* tag = aElement->Tag();
|
||||
|
@ -684,9 +684,9 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsHTML() || !docShell) { // no docshell for text/html XHR
|
||||
charsetSource = IsHTML() ? kCharsetFromFallback
|
||||
: kCharsetFromDocTypeDefault;
|
||||
if (!IsHTMLDocument() || !docShell) { // no docshell for text/html XHR
|
||||
charsetSource = IsHTMLDocument() ? kCharsetFromFallback
|
||||
: kCharsetFromDocTypeDefault;
|
||||
charset.AssignLiteral("UTF-8");
|
||||
TryChannelCharset(aChannel, charsetSource, charset, executor);
|
||||
parserCharsetSource = charsetSource;
|
||||
@ -778,7 +778,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
||||
mParser->SetDocumentCharset(parserCharset, parserCharsetSource);
|
||||
mParser->SetCommand(aCommand);
|
||||
|
||||
if (!IsHTML()) {
|
||||
if (!IsHTMLDocument()) {
|
||||
MOZ_ASSERT(!loadAsHtml5);
|
||||
nsCOMPtr<nsIXMLContentSink> xmlsink;
|
||||
NS_NewXMLContentSink(getter_AddRefs(xmlsink), this, uri,
|
||||
@ -863,7 +863,7 @@ nsHTMLDocument::EndLoad()
|
||||
void
|
||||
nsHTMLDocument::SetCompatibilityMode(nsCompatibility aMode)
|
||||
{
|
||||
NS_ASSERTION(IsHTML() || aMode == eCompatibility_FullStandards,
|
||||
NS_ASSERTION(IsHTMLDocument() || aMode == eCompatibility_FullStandards,
|
||||
"Bad compat mode for XHTML document!");
|
||||
|
||||
mCompatMode = aMode;
|
||||
@ -1017,7 +1017,8 @@ nsHTMLDocument::GetBody()
|
||||
for (nsIContent* child = html->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::body) || child->IsHTML(nsGkAtoms::frameset)) {
|
||||
if (child->IsHTMLElement(nsGkAtoms::body) ||
|
||||
child->IsHTMLElement(nsGkAtoms::frameset)) {
|
||||
return static_cast<nsGenericHTMLElement*>(child);
|
||||
}
|
||||
}
|
||||
@ -1039,7 +1040,7 @@ NS_IMETHODIMP
|
||||
nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
|
||||
{
|
||||
nsCOMPtr<nsIContent> newBody = do_QueryInterface(aBody);
|
||||
MOZ_ASSERT(!newBody || newBody->IsHTML(),
|
||||
MOZ_ASSERT(!newBody || newBody->IsHTMLElement(),
|
||||
"How could we be an nsIContent but not actually HTML here?");
|
||||
ErrorResult rv;
|
||||
SetBody(static_cast<nsGenericHTMLElement*>(newBody.get()), rv);
|
||||
@ -1056,7 +1057,7 @@ nsHTMLDocument::SetBody(nsGenericHTMLElement* newBody, ErrorResult& rv)
|
||||
// body.
|
||||
if (!newBody || !(newBody->Tag() == nsGkAtoms::body ||
|
||||
newBody->Tag() == nsGkAtoms::frameset) ||
|
||||
!root || !root->IsHTML() ||
|
||||
!root || !root->IsHTMLElement() ||
|
||||
root->Tag() != nsGkAtoms::html) {
|
||||
rv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
|
||||
return;
|
||||
@ -1410,7 +1411,7 @@ nsHTMLDocument::Open(JSContext* cx,
|
||||
{
|
||||
NS_ASSERTION(nsContentUtils::CanCallerAccess(static_cast<nsIDOMHTMLDocument*>(this)),
|
||||
"XOW should have caught this!");
|
||||
if (!IsHTML() || mDisableDocWrite || !IsMasterDocument()) {
|
||||
if (!IsHTMLDocument() || mDisableDocWrite || !IsMasterDocument()) {
|
||||
// No calling document.open() on XHTML
|
||||
rv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return nullptr;
|
||||
@ -1756,7 +1757,7 @@ nsHTMLDocument::Close()
|
||||
void
|
||||
nsHTMLDocument::Close(ErrorResult& rv)
|
||||
{
|
||||
if (!IsHTML()) {
|
||||
if (!IsHTMLDocument()) {
|
||||
// No calling document.close() on XHTML!
|
||||
|
||||
rv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
@ -1841,7 +1842,7 @@ nsHTMLDocument::WriteCommon(JSContext *cx,
|
||||
(mWriteLevel > NS_MAX_DOCUMENT_WRITE_DEPTH || mTooDeepWriteRecursion);
|
||||
NS_ENSURE_STATE(!mTooDeepWriteRecursion);
|
||||
|
||||
if (!IsHTML() || mDisableDocWrite || !IsMasterDocument()) {
|
||||
if (!IsHTMLDocument() || mDisableDocWrite || !IsMasterDocument()) {
|
||||
// No calling document.write*() on XHTML!
|
||||
|
||||
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
||||
@ -1987,7 +1988,7 @@ nsHTMLDocument::GetElementsByName(const nsAString& aElementName,
|
||||
static bool MatchItems(nsIContent* aContent, int32_t aNameSpaceID,
|
||||
nsIAtom* aAtom, void* aData)
|
||||
{
|
||||
if (!(aContent->IsElement() && aContent->AsElement()->IsHTML())) {
|
||||
if (!aContent->IsHTMLElement()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ nsITextControlElement::GetWrapPropertyEnum(nsIContent* aContent,
|
||||
aWrapProp = eHTMLTextWrap_Soft; // the default
|
||||
|
||||
nsAutoString wrap;
|
||||
if (aContent->IsHTML()) {
|
||||
if (aContent->IsHTMLElement()) {
|
||||
static nsIContent::AttrValuesArray strings[] =
|
||||
{&nsGkAtoms::HARD, &nsGkAtoms::OFF, nullptr};
|
||||
|
||||
|
@ -138,7 +138,8 @@ SVGAnimationElement::GetTargetElement()
|
||||
// We'll just call the other GetTargetElement method, and QI to the right type
|
||||
nsIContent* target = GetTargetElementContent();
|
||||
|
||||
return (target && target->IsSVG()) ? static_cast<nsSVGElement*>(target) : nullptr;
|
||||
return (target && target->IsSVGElement())
|
||||
? static_cast<nsSVGElement*>(target) : nullptr;
|
||||
}
|
||||
|
||||
float
|
||||
|
@ -41,7 +41,7 @@ SVGContentUtils::GetOuterSVGElement(nsSVGElement *aSVGElement)
|
||||
nsIContent *element = nullptr;
|
||||
nsIContent *ancestor = aSVGElement->GetFlattenedTreeParent();
|
||||
|
||||
while (ancestor && ancestor->IsSVG() &&
|
||||
while (ancestor && ancestor->IsSVGElement() &&
|
||||
ancestor->Tag() != nsGkAtoms::foreignObject) {
|
||||
element = ancestor;
|
||||
ancestor = element->GetFlattenedTreeParent();
|
||||
@ -365,7 +365,7 @@ SVGContentUtils::EstablishesViewport(nsIContent *aContent)
|
||||
// Although SVG 1.1 states that <image> is an element that establishes a
|
||||
// viewport, this is really only for the document it references, not
|
||||
// for any child content, which is what this function is used for.
|
||||
return aContent && aContent->IsSVG() &&
|
||||
return aContent && aContent->IsSVGElement() &&
|
||||
(aContent->Tag() == nsGkAtoms::svg ||
|
||||
aContent->Tag() == nsGkAtoms::foreignObject ||
|
||||
aContent->Tag() == nsGkAtoms::symbol);
|
||||
@ -376,7 +376,7 @@ SVGContentUtils::GetNearestViewportElement(nsIContent *aContent)
|
||||
{
|
||||
nsIContent *element = aContent->GetFlattenedTreeParent();
|
||||
|
||||
while (element && element->IsSVG()) {
|
||||
while (element && element->IsSVGElement()) {
|
||||
if (EstablishesViewport(element)) {
|
||||
if (element->Tag() == nsGkAtoms::foreignObject) {
|
||||
return nullptr;
|
||||
@ -396,7 +396,7 @@ GetCTMInternal(nsSVGElement *aElement, bool aScreenCTM, bool aHaveRecursed)
|
||||
nsSVGElement *element = aElement;
|
||||
nsIContent *ancestor = aElement->GetFlattenedTreeParent();
|
||||
|
||||
while (ancestor && ancestor->IsSVG() &&
|
||||
while (ancestor && ancestor->IsSVGElement() &&
|
||||
ancestor->Tag() != nsGkAtoms::foreignObject) {
|
||||
element = static_cast<nsSVGElement*>(ancestor);
|
||||
matrix *= element->PrependLocalTransformsTo(gfxMatrix()); // i.e. *A*ppend
|
||||
@ -431,7 +431,7 @@ GetCTMInternal(nsSVGElement *aElement, bool aScreenCTM, bool aHaveRecursed)
|
||||
if (!ancestor || !ancestor->IsElement()) {
|
||||
return gfx::ToMatrix(matrix);
|
||||
}
|
||||
if (ancestor->IsSVG()) {
|
||||
if (ancestor->IsSVGElement()) {
|
||||
return
|
||||
gfx::ToMatrix(matrix) * GetCTMInternal(static_cast<nsSVGElement*>(ancestor), true, true);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ SVGDocument::GetRootElement(ErrorResult& aRv)
|
||||
if (!root) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!root->IsSVG()) {
|
||||
if (!root->IsSVGElement()) {
|
||||
aRv.Throw(NS_NOINTERFACE);
|
||||
return nullptr;
|
||||
}
|
||||
@ -70,7 +70,7 @@ SVGDocument::InsertChildAt(nsIContent* aKid, uint32_t aIndex, bool aNotify)
|
||||
{
|
||||
nsresult rv = XMLDocument::InsertChildAt(aKid, aIndex, aNotify);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && aKid->IsElement() && !aKid->IsSVG()) {
|
||||
if (NS_SUCCEEDED(rv) && aKid->IsElement() && !aKid->IsSVGElement()) {
|
||||
// We can get here when well formed XML with a non-SVG root element is
|
||||
// served with the SVG MIME type, for example. In that case we need to load
|
||||
// the non-SVG UA sheets or else we can get bugs like bug 1016145.
|
||||
|
@ -353,7 +353,7 @@ SVGFEImageElement::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect*
|
||||
void
|
||||
SVGFEImageElement::Invalidate()
|
||||
{
|
||||
if (GetParent() && GetParent()->IsSVG(nsGkAtoms::filter)) {
|
||||
if (GetParent() && GetParent()->IsSVGElement(nsGkAtoms::filter)) {
|
||||
static_cast<SVGFilterElement*>(GetParent())->Invalidate();
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ SVGFEMergeElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources)
|
||||
for (nsIContent* child = nsINode::GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsSVG(nsGkAtoms::feMergeNode)) {
|
||||
if (child->IsSVGElement(nsGkAtoms::feMergeNode)) {
|
||||
SVGFEMergeNodeElement* node = static_cast<SVGFEMergeNodeElement*>(child);
|
||||
aSources.AppendElement(nsSVGStringInfo(node->GetIn1(), node));
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ SVGForeignObjectElement::BindToTree(nsIDocument* aDocument,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
if (doc && doc->IsSVG()) {
|
||||
if (doc && doc->IsSVGDocument()) {
|
||||
// We assume that we're going to have HTML content, so we ensure that the
|
||||
// UA style sheets that nsDocumentViewer::CreateStyleSet skipped when
|
||||
// it saw the document was an SVG document are loaded.
|
||||
|
@ -33,7 +33,7 @@ static dom::SVGViewElement*
|
||||
GetViewElement(nsIDocument* aDocument, const nsAString& aId)
|
||||
{
|
||||
dom::Element* element = aDocument->GetElementById(aId);
|
||||
return (element && element->IsSVG(nsGkAtoms::view)) ?
|
||||
return (element && element->IsSVGElement(nsGkAtoms::view)) ?
|
||||
static_cast<dom::SVGViewElement*>(element) : nullptr;
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ bool
|
||||
SVGFragmentIdentifier::ProcessFragmentIdentifier(nsIDocument* aDocument,
|
||||
const nsAString& aAnchorName)
|
||||
{
|
||||
MOZ_ASSERT(aDocument->GetRootElement()->IsSVG(nsGkAtoms::svg),
|
||||
MOZ_ASSERT(aDocument->GetRootElement()->IsSVGElement(nsGkAtoms::svg),
|
||||
"expecting an SVG root element");
|
||||
|
||||
dom::SVGSVGElement* rootElement =
|
||||
|
@ -187,7 +187,7 @@ SVGMPathElement::GetReferencedPath()
|
||||
}
|
||||
|
||||
nsIContent* genericTarget = mHrefTarget.get();
|
||||
if (genericTarget && genericTarget->IsSVG(nsGkAtoms::path)) {
|
||||
if (genericTarget && genericTarget->IsSVGElement(nsGkAtoms::path)) {
|
||||
return static_cast<SVGPathElement*>(genericTarget);
|
||||
}
|
||||
return nullptr;
|
||||
@ -246,7 +246,7 @@ SVGMPathElement::UnlinkHrefTarget(bool aNotifyParent)
|
||||
void
|
||||
SVGMPathElement::NotifyParentOfMpathChange(nsIContent* aParent)
|
||||
{
|
||||
if (aParent && aParent->IsSVG(nsGkAtoms::animateMotion)) {
|
||||
if (aParent && aParent->IsSVGElement(nsGkAtoms::animateMotion)) {
|
||||
|
||||
SVGAnimateMotionElement* animateMotionParent =
|
||||
static_cast<SVGAnimateMotionElement*>(aParent);
|
||||
|
@ -134,7 +134,7 @@ GetFirstMPathChild(nsIContent* aElem)
|
||||
for (nsIContent* child = aElem->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsSVG(nsGkAtoms::mpath)) {
|
||||
if (child->IsSVGElement(nsGkAtoms::mpath)) {
|
||||
return static_cast<SVGMPathElement*>(child);
|
||||
}
|
||||
}
|
||||
@ -152,7 +152,7 @@ SVGMotionSMILAnimationFunction::
|
||||
MOZ_ASSERT(mPathVertices.IsEmpty(),
|
||||
"regenerating when we already have vertices");
|
||||
|
||||
if (!aContextElem->IsSVG()) {
|
||||
if (!aContextElem->IsSVGElement()) {
|
||||
NS_ERROR("Uh oh, SVG animateMotion element targeting a non-SVG node");
|
||||
return;
|
||||
}
|
||||
|
@ -785,7 +785,7 @@ SVGSVGElement::WillBeOutermostSVG(nsIContent* aParent,
|
||||
{
|
||||
nsIContent* parent = aBindingParent ? aBindingParent : aParent;
|
||||
|
||||
while (parent && parent->IsSVG()) {
|
||||
while (parent && parent->IsSVGElement()) {
|
||||
nsIAtom* tag = parent->Tag();
|
||||
if (tag == nsGkAtoms::foreignObject) {
|
||||
// SVG in a foreignObject must have its own <svg> (nsSVGOuterSVGFrame).
|
||||
@ -826,7 +826,7 @@ SVGSVGElement::GetCurrentViewElement() const
|
||||
nsIDocument* doc = GetUncomposedDoc();
|
||||
if (doc) {
|
||||
Element *element = doc->GetElementById(*mCurrentViewID);
|
||||
if (element && element->IsSVG(nsGkAtoms::view)) {
|
||||
if (element && element->IsSVGElement(nsGkAtoms::view)) {
|
||||
return static_cast<SVGViewElement*>(element);
|
||||
}
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ private:
|
||||
*/
|
||||
bool IsInner() const {
|
||||
const nsIContent *parent = GetFlattenedTreeParent();
|
||||
return parent && parent->IsSVG() &&
|
||||
return parent && parent->IsSVGElement() &&
|
||||
parent->Tag() != nsGkAtoms::foreignObject;
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ SVGUseElement::CreateAnonymousContent()
|
||||
|
||||
LookupHref();
|
||||
nsIContent* targetContent = mSource.get();
|
||||
if (!targetContent || !targetContent->IsSVG())
|
||||
if (!targetContent || !targetContent->IsSVGElement())
|
||||
return nullptr;
|
||||
|
||||
// make sure target is valid type for <use>
|
||||
@ -248,7 +248,7 @@ SVGUseElement::CreateAnonymousContent()
|
||||
for (nsCOMPtr<nsIContent> content = GetParent();
|
||||
content;
|
||||
content = content->GetParent()) {
|
||||
if (content->IsSVG(nsGkAtoms::use) &&
|
||||
if (content->IsSVGElement(nsGkAtoms::use) &&
|
||||
static_cast<SVGUseElement*>(content.get())->mOriginal == mOriginal) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -268,7 +268,7 @@ SVGUseElement::CreateAnonymousContent()
|
||||
if (!newcontent)
|
||||
return nullptr;
|
||||
|
||||
if (newcontent->IsSVG(nsGkAtoms::symbol)) {
|
||||
if (newcontent->IsSVGElement(nsGkAtoms::symbol)) {
|
||||
nsIDocument *document = GetComposedDoc();
|
||||
if (!document)
|
||||
return nullptr;
|
||||
@ -312,8 +312,7 @@ SVGUseElement::CreateAnonymousContent()
|
||||
newcontent = svgNode;
|
||||
}
|
||||
|
||||
if (newcontent->IsSVG() && (newcontent->Tag() == nsGkAtoms::svg ||
|
||||
newcontent->Tag() == nsGkAtoms::symbol)) {
|
||||
if (newcontent->IsAnyOfSVGElements(nsGkAtoms::svg, nsGkAtoms::symbol)) {
|
||||
nsSVGElement *newElement = static_cast<nsSVGElement*>(newcontent.get());
|
||||
|
||||
if (mLengthAttributes[ATTR_WIDTH].IsExplicitlySet())
|
||||
@ -342,8 +341,7 @@ SVGUseElement::DestroyAnonymousContent()
|
||||
bool
|
||||
SVGUseElement::OurWidthAndHeightAreUsed() const
|
||||
{
|
||||
return mClone && mClone->IsSVG() && (mClone->Tag() == nsGkAtoms::svg ||
|
||||
mClone->Tag() == nsGkAtoms::symbol);
|
||||
return mClone && mClone->IsAnyOfSVGElements(nsGkAtoms::svg, nsGkAtoms::symbol);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -56,7 +56,7 @@ SVGZoomEvent::SVGZoomEvent(EventTarget* aOwner,
|
||||
// (e.g. if this event was created by calling createEvent on a
|
||||
// non-SVGDocument), then the "New" and "Previous"
|
||||
// properties will be left null which is probably what we want.
|
||||
if (rootElement->IsSVG(nsGkAtoms::svg)) {
|
||||
if (rootElement->IsSVGElement(nsGkAtoms::svg)) {
|
||||
SVGSVGElement *SVGSVGElem =
|
||||
static_cast<SVGSVGElement*>(rootElement);
|
||||
|
||||
|
@ -1516,7 +1516,7 @@ nsSVGElement::GetCtx() const
|
||||
{
|
||||
nsIContent* ancestor = GetFlattenedTreeParent();
|
||||
|
||||
while (ancestor && ancestor->IsSVG()) {
|
||||
while (ancestor && ancestor->IsSVGElement()) {
|
||||
nsIAtom* tag = ancestor->Tag();
|
||||
if (tag == nsGkAtoms::foreignObject) {
|
||||
return nullptr;
|
||||
|
@ -489,9 +489,9 @@ nsSVGFELightingElement::ComputeLightAttributes(nsSVGFilterInstance* aInstance)
|
||||
for (nsCOMPtr<nsIContent> child = nsINode::GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsSVG(nsGkAtoms::feDistantLight) ||
|
||||
child->IsSVG(nsGkAtoms::fePointLight) ||
|
||||
child->IsSVG(nsGkAtoms::feSpotLight)) {
|
||||
if (child->IsAnyOfSVGElements(nsGkAtoms::feDistantLight,
|
||||
nsGkAtoms::fePointLight,
|
||||
nsGkAtoms::feSpotLight)) {
|
||||
return static_cast<SVGFELightElement*>(child.get())->ComputeLightAttributes(aInstance);
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ float
|
||||
nsSVGLength2::GetUnitScaleFactor(nsIFrame *aFrame, uint8_t aUnitType) const
|
||||
{
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (content->IsSVG()) {
|
||||
if (content->IsSVGElement()) {
|
||||
return GetUnitScaleFactor(SVGElementMetrics(static_cast<nsSVGElement*>(content)), aUnitType);
|
||||
}
|
||||
return GetUnitScaleFactor(NonSVGFrameUserSpaceMetrics(aFrame), aUnitType);
|
||||
|
@ -884,7 +884,7 @@ nsresult
|
||||
nsXBLContentSink::AddAttributes(const char16_t** aAtts,
|
||||
nsIContent* aContent)
|
||||
{
|
||||
if (aContent->IsXUL())
|
||||
if (aContent->IsXULElement())
|
||||
return NS_OK; // Nothing to do, since the proto already has the attrs.
|
||||
|
||||
return nsXMLContentSink::AddAttributes(aAtts, aContent);
|
||||
|
@ -484,7 +484,7 @@ nsXBLPrototypeHandler::DispatchXBLCommand(EventTarget* aTarget, nsIDOMEvent* aEv
|
||||
// element is focused and has a parent.
|
||||
if (focusedContent && focusedContent->GetParent()) {
|
||||
while (content) {
|
||||
if (content->Tag() == nsGkAtoms::a && content->IsHTML()) {
|
||||
if (content->Tag() == nsGkAtoms::a && content->IsHTMLElement()) {
|
||||
isLink = true;
|
||||
break;
|
||||
}
|
||||
|
@ -666,7 +666,8 @@ MayBindToContent(nsXBLPrototypeBinding* aProtoBinding, nsIContent* aBoundElement
|
||||
|
||||
// We let XUL content and content in XUL documents through, since XUL is
|
||||
// restricted anyway and we want to minimize remote XUL breakage.
|
||||
if (aBoundElement->IsXUL() || aBoundElement->OwnerDoc()->IsXUL()) {
|
||||
if (aBoundElement->IsXULElement() ||
|
||||
aBoundElement->OwnerDoc()->IsXULElement()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -955,7 +956,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
|
||||
ni->Equals(nsGkAtoms::thumb, kNameSpaceID_XUL) ||
|
||||
((ni->Equals(nsGkAtoms::input) ||
|
||||
ni->Equals(nsGkAtoms::select)) &&
|
||||
aBoundElement->IsHTML()))) && !aForceSyncLoad) {
|
||||
aBoundElement->IsHTMLElement()))) && !aForceSyncLoad) {
|
||||
// The third line of defense is to investigate whether or not the
|
||||
// document is currently being loaded asynchronously. If so, there's no
|
||||
// document yet, but we need to glom on our request so that it will be
|
||||
|
@ -849,7 +849,7 @@ nsXMLContentSink::PushContent(nsIContent *aContent)
|
||||
|
||||
// When an XML parser would append a node to a template element, it
|
||||
// must instead append it to the template element's template contents.
|
||||
if (contentToPush->IsHTML(nsGkAtoms::_template)) {
|
||||
if (contentToPush->IsHTMLElement(nsGkAtoms::_template)) {
|
||||
HTMLTemplateElement* templateElement =
|
||||
static_cast<HTMLTemplateElement*>(contentToPush);
|
||||
contentToPush = templateElement->Content();
|
||||
@ -1116,7 +1116,7 @@ nsXMLContentSink::HandleEndElement(const char16_t *aName,
|
||||
}
|
||||
DidAddContent();
|
||||
|
||||
if (content->IsSVG(nsGkAtoms::svg)) {
|
||||
if (content->IsSVGElement(nsGkAtoms::svg)) {
|
||||
FlushTags();
|
||||
nsCOMPtr<nsIRunnable> event = new nsHtml5SVGLoadDispatcher(content);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(event))) {
|
||||
|
@ -228,7 +228,7 @@ nsXMLFragmentContentSink::CloseElement(nsIContent* aContent)
|
||||
{
|
||||
// don't do fancy stuff in nsXMLContentSink
|
||||
if (mPreventScriptExecution && aContent->Tag() == nsGkAtoms::script &&
|
||||
(aContent->IsHTML() || aContent->IsSVG())) {
|
||||
(aContent->IsHTMLElement() || aContent->IsSVGElement())) {
|
||||
nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(aContent);
|
||||
NS_ASSERTION(sele, "script did QI correctly!");
|
||||
sele->PreventExecution();
|
||||
|
@ -121,7 +121,8 @@ XPathEvaluator::CreateExpression(const nsAString& aExpression,
|
||||
XPathNSResolver* aResolver, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
|
||||
XPathEvaluatorParseContext pContext(aResolver, !(doc && doc->IsHTML()));
|
||||
XPathEvaluatorParseContext pContext(aResolver,
|
||||
!(doc && doc->IsHTMLDocument()));
|
||||
return CreateExpression(aExpression, &pContext, doc, aRv);
|
||||
}
|
||||
|
||||
@ -130,7 +131,8 @@ XPathEvaluator::CreateExpression(const nsAString& aExpression,
|
||||
nsINode* aResolver, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
|
||||
XPathEvaluatorParseContext pContext(aResolver, !(doc && doc->IsHTML()));
|
||||
XPathEvaluatorParseContext pContext(aResolver,
|
||||
!(doc && doc->IsHTMLDocument()));
|
||||
return CreateExpression(aExpression, &pContext, doc, aRv);
|
||||
}
|
||||
|
||||
|
@ -420,7 +420,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
|
||||
|
||||
// Check for html
|
||||
if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.Content()->IsHTML()) {
|
||||
aNode.Content()->IsHTMLElement()) {
|
||||
nsContentUtils::ASCIIToUpper(aLocalName);
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
nsIContent* content = aNode.Content();
|
||||
return content->IsHTML() && content->IsInHTMLDocument();
|
||||
return content->IsHTMLElement() && content->IsInHTMLDocument();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -281,7 +281,7 @@ txMozillaXMLOutput::endElement()
|
||||
|
||||
// Handle html-elements
|
||||
if (!mNoFixup) {
|
||||
if (element->IsHTML()) {
|
||||
if (element->IsHTMLElement()) {
|
||||
rv = endHTMLElement(element);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ txToFragmentHandlerFactory::createHandlerWith(txOutputFormat* aFormat,
|
||||
NS_ASSERTION(domdoc, "unable to get ownerdocument");
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
|
||||
|
||||
if (doc && doc->IsHTML()) {
|
||||
if (doc && doc->IsHTMLDocument()) {
|
||||
format.mMethod = eHTMLOutput;
|
||||
} else {
|
||||
format.mMethod = eXMLOutput;
|
||||
|
@ -141,7 +141,7 @@ nsXULPopupListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
return NS_OK;
|
||||
}
|
||||
if (targetContent->Tag() == nsGkAtoms::browser &&
|
||||
targetContent->IsXUL() &&
|
||||
targetContent->IsXULElement() &&
|
||||
EventStateManager::IsRemoteTarget(targetContent)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1263,7 +1263,7 @@ bool
|
||||
nsXULContentBuilder::IsOpen(nsIContent* aElement)
|
||||
{
|
||||
// Determine if this is a <treeitem> or <menu> element
|
||||
if (!aElement->IsXUL())
|
||||
if (!aElement->IsXULElement())
|
||||
return true;
|
||||
|
||||
// XXXhyatt Use the XBL service to obtain a base tag.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user