зеркало из https://github.com/mozilla/pjs.git
Backed out changeset 4aa19414e651 (bug 488249) to fix test orange.
--HG-- extra : rebase_source : ae1c0155ec32b0887eff27ded77c6ba2b37dda64
This commit is contained in:
Родитель
d15fec2073
Коммит
79edda8c98
|
@ -1483,7 +1483,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
|||
return InitAccessible(newAcc, aAccessible, nsnull);
|
||||
}
|
||||
|
||||
PRBool isHTML = content->IsHTML();
|
||||
PRBool isHTML = content->IsNodeOfType(nsINode::eHTML);
|
||||
if (isHTML && content->Tag() == nsAccessibilityAtoms::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
|
||||
|
|
|
@ -298,9 +298,9 @@ nsAccessible::GetName(nsAString& aName)
|
|||
|
||||
nsIAtom *tooltipAttr = nsnull;
|
||||
|
||||
if (content->IsHTML())
|
||||
if (content->IsNodeOfType(nsINode::eHTML))
|
||||
tooltipAttr = nsAccessibilityAtoms::title;
|
||||
else if (content->IsXUL())
|
||||
else if (content->IsNodeOfType(nsINode::eXUL))
|
||||
tooltipAttr = nsAccessibilityAtoms::tooltiptext;
|
||||
else
|
||||
return NS_OK;
|
||||
|
@ -342,7 +342,7 @@ NS_IMETHODIMP nsAccessible::GetDescription(nsAString& aDescription)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (description.IsEmpty()) {
|
||||
PRBool isXUL = content->IsXUL();
|
||||
PRBool isXUL = content->IsNodeOfType(nsINode::eXUL);
|
||||
if (isXUL) {
|
||||
// Try XUL <description control="[id]">description text</description>
|
||||
nsIContent *descriptionContent =
|
||||
|
@ -1009,7 +1009,7 @@ nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
// if someone sets it on another attribute,
|
||||
// it seems reasonable to consider it unavailable
|
||||
PRBool isDisabled;
|
||||
if (content->IsHTML()) {
|
||||
if (content->IsNodeOfType(nsINode::eHTML)) {
|
||||
// In HTML, just the presence of the disabled attribute means it is disabled,
|
||||
// therefore disabled="false" indicates disabled!
|
||||
isDisabled = content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::disabled);
|
||||
|
@ -2410,7 +2410,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
case nsIAccessibleRelation::RELATION_LABEL_FOR:
|
||||
{
|
||||
if (content->Tag() == nsAccessibilityAtoms::label) {
|
||||
nsIAtom *IDAttr = content->IsHTML() ?
|
||||
nsIAtom *IDAttr = content->IsNodeOfType(nsINode::eHTML) ?
|
||||
nsAccessibilityAtoms::_for : nsAccessibilityAtoms::control;
|
||||
rv = nsRelUtils::
|
||||
AddTargetFromIDRefAttr(aRelationType, aRelation, content, IDAttr);
|
||||
|
@ -2467,7 +2467,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
return NS_OK; // XXX bug 381599, avoid performance problems
|
||||
|
||||
if (content->Tag() == nsAccessibilityAtoms::description &&
|
||||
content->IsXUL()) {
|
||||
content->IsNodeOfType(nsINode::eXUL)) {
|
||||
// This affectively adds an optional control attribute to xul:description,
|
||||
// which only affects accessibility, by allowing the description to be
|
||||
// tied to a control.
|
||||
|
@ -2551,7 +2551,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
|
||||
case nsIAccessibleRelation::RELATION_DEFAULT_BUTTON:
|
||||
{
|
||||
if (content->IsHTML()) {
|
||||
if (content->IsNodeOfType(nsINode::eHTML)) {
|
||||
// HTML form controls implements nsIFormControl interface.
|
||||
nsCOMPtr<nsIFormControl> control(do_QueryInterface(content));
|
||||
if (control) {
|
||||
|
@ -3098,10 +3098,10 @@ nsAccessible::GetNameInternal(nsAString& aName)
|
|||
if (!content)
|
||||
return NS_OK;
|
||||
|
||||
if (content->IsHTML())
|
||||
if (content->IsNodeOfType(nsINode::eHTML))
|
||||
return GetHTMLName(aName);
|
||||
|
||||
if (content->IsXUL())
|
||||
if (content->IsNodeOfType(nsINode::eXUL))
|
||||
return GetXULName(aName);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -75,7 +75,7 @@ nsAccessibleTreeWalker::~nsAccessibleTreeWalker()
|
|||
void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode)
|
||||
{
|
||||
nsCOMPtr<nsIContent> parentContent(do_QueryInterface(aParentNode));
|
||||
if (!parentContent || !parentContent->IsHTML()) {
|
||||
if (!parentContent || !parentContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
mState.frame = nsnull; // Don't walk frames in non-HTML content, just walk the DOM.
|
||||
}
|
||||
|
||||
|
|
|
@ -760,7 +760,7 @@ nsCoreUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
|
|||
nsIContent*
|
||||
nsCoreUtils::GetLabelContent(nsIContent *aForNode)
|
||||
{
|
||||
if (aForNode->IsXUL())
|
||||
if (aForNode->IsNodeOfType(nsINode::eXUL))
|
||||
return FindNeighbourPointingToNode(aForNode, nsAccessibilityAtoms::control,
|
||||
nsAccessibilityAtoms::label);
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aContent->IsHTML() &&
|
||||
if (aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
aContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
|
||||
aString->AppendLiteral("\r\n");
|
||||
return NS_OK;
|
||||
|
@ -393,7 +393,7 @@ nsTextEquivUtils::AppendFromDOMNode(nsIContent *aContent, nsAString *aString)
|
|||
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
|
||||
return NS_OK;
|
||||
|
||||
if (aContent->IsXUL()) {
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsAutoString textEquivalent;
|
||||
nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl =
|
||||
do_QueryInterface(aContent);
|
||||
|
|
|
@ -408,7 +408,7 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIAccessibilityService *aAccServic
|
|||
|
||||
for (PRUint32 count = 0; count < numChildren; count ++) {
|
||||
nsIContent *childContent = aParentContent->GetChildAt(count);
|
||||
if (!childContent->IsHTML()) {
|
||||
if (!childContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
continue;
|
||||
}
|
||||
nsCOMPtr<nsIAtom> tag = childContent->Tag();
|
||||
|
@ -835,7 +835,7 @@ nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIDOMNode *aListNod
|
|||
void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibleOption)
|
||||
{
|
||||
if (!aPossibleOption || aPossibleOption->Tag() != nsAccessibilityAtoms::option ||
|
||||
!aPossibleOption->IsHTML()) {
|
||||
!aPossibleOption->IsNodeOfType(nsINode::eHTML)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -633,7 +633,7 @@ nsresult nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode* aNode, PRI
|
|||
nsCOMPtr<nsIAccessible> descendantAccessible;
|
||||
if (findNode) {
|
||||
nsCOMPtr<nsIContent> findContent = do_QueryInterface(findNode);
|
||||
if (findContent->IsHTML() &&
|
||||
if (findContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
findContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
|
||||
nsIContent *parent = findContent->GetParent();
|
||||
if (parent &&
|
||||
|
|
|
@ -247,26 +247,6 @@ public:
|
|||
return mNodeInfo;
|
||||
}
|
||||
|
||||
inline PRBool IsInNamespace(PRInt32 aNamespace) const {
|
||||
return mNodeInfo->NamespaceID() == aNamespace;
|
||||
}
|
||||
|
||||
inline PRBool IsHTML() const {
|
||||
return IsInNamespace(kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
inline PRBool IsSVG() const {
|
||||
return IsInNamespace(kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
inline PRBool IsXUL() const {
|
||||
return IsInNamespace(kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline PRBool IsMathML() const {
|
||||
return IsInNamespace(kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an atom holding the name of the attribute of type ID on
|
||||
* this content node (if applicable). Returns null for non-element
|
||||
|
|
|
@ -293,21 +293,28 @@ public:
|
|||
ePROCESSING_INSTRUCTION = 1 << 5,
|
||||
/** comment nodes */
|
||||
eCOMMENT = 1 << 6,
|
||||
/** html elements */
|
||||
eHTML = 1 << 7,
|
||||
/** form control elements */
|
||||
eHTML_FORM_CONTROL = 1 << 7,
|
||||
eHTML_FORM_CONTROL = 1 << 8,
|
||||
/** XUL elements */
|
||||
eXUL = 1 << 9,
|
||||
/** svg elements */
|
||||
eSVG = 1 << 10,
|
||||
/** document fragments */
|
||||
eDOCUMENT_FRAGMENT = 1 << 8,
|
||||
eDOCUMENT_FRAGMENT = 1 << 11,
|
||||
/** data nodes (comments, PIs, text). Nodes of this type always
|
||||
returns a non-null value for nsIContent::GetText() */
|
||||
eDATA_NODE = 1 << 9,
|
||||
eDATA_NODE = 1 << 12,
|
||||
/** nsMathMLElement */
|
||||
eMATHML = 1 << 13,
|
||||
/** nsHTMLMediaElement */
|
||||
eMEDIA = 1 << 10
|
||||
eMEDIA = 1 << 14
|
||||
};
|
||||
|
||||
/**
|
||||
* API for doing a quick check if a content is of a given
|
||||
* type, such as Text, Document, Comment ... Use this when you can instead of
|
||||
* type, such as HTML, XUL, Text, ... Use this when you can instead of
|
||||
* checking the tag.
|
||||
*
|
||||
* @param aFlags what types you want to test for (see above)
|
||||
|
|
|
@ -214,7 +214,7 @@ mozSanitizingHTMLSerializer::IsContainer(PRInt32 aId)
|
|||
PRInt32
|
||||
mozSanitizingHTMLSerializer::GetIdForContent(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent->IsHTML()) {
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
return eHTMLTag_unknown;
|
||||
}
|
||||
|
||||
|
|
|
@ -2092,7 +2092,7 @@ nsContentUtils::BelongsInForm(nsIDOMHTMLFormElement *aForm,
|
|||
}
|
||||
|
||||
if (content->Tag() == nsGkAtoms::form &&
|
||||
content->IsHTML()) {
|
||||
content->IsNodeOfType(nsINode::eHTML)) {
|
||||
// The child is contained within a form, but not the right form
|
||||
// so we ignore it.
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ nsresult nsCopySupport::IsPlainTextContext(nsISelection *aSel, nsIDocument *aDoc
|
|||
{
|
||||
// checking for selection inside a plaintext form widget
|
||||
|
||||
if (!selContent->IsHTML()) {
|
||||
if (!selContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
|
|||
iAttribute->SetMap(this);
|
||||
|
||||
if (!aWithNS && ni->NamespaceID() == kNameSpaceID_None &&
|
||||
mContent->IsHTML()) {
|
||||
mContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
// Set via setAttribute(), which may do normalization on the
|
||||
// attribute name for HTML
|
||||
nsCOMPtr<nsIDOMElement> ourElement(do_QueryInterface(mContent));
|
||||
|
|
|
@ -4825,7 +4825,7 @@ nsDocument::GetHtmlContent()
|
|||
{
|
||||
nsIContent* rootContent = GetRootContent();
|
||||
if (rootContent && rootContent->Tag() == nsGkAtoms::html &&
|
||||
rootContent->IsHTML())
|
||||
rootContent->IsNodeOfType(nsINode::eHTML))
|
||||
return rootContent;
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -4841,14 +4841,14 @@ nsDocument::GetHtmlChildContent(nsIAtom* aTag)
|
|||
// forwards to find the first such element.
|
||||
for (PRUint32 i = 0; i < html->GetChildCount(); ++i) {
|
||||
nsIContent* result = html->GetChildAt(i);
|
||||
if (result->Tag() == aTag && result->IsHTML())
|
||||
if (result->Tag() == aTag && result->IsNodeOfType(nsINode::eHTML))
|
||||
return result;
|
||||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
nsDocument::GetTitleContent(PRUint32 aNamespace)
|
||||
nsDocument::GetTitleContent(PRUint32 aNodeType)
|
||||
{
|
||||
// mMayHaveTitleElement will have been set to true if any HTML or SVG
|
||||
// <title> element has been bound to this document. So if it's false,
|
||||
|
@ -4870,15 +4870,15 @@ nsDocument::GetTitleContent(PRUint32 aNamespace)
|
|||
nsIContent* elem = list->Item(i, PR_FALSE);
|
||||
if (!elem)
|
||||
return nsnull;
|
||||
if (elem->IsInNamespace(aNamespace))
|
||||
if (elem->IsNodeOfType(aNodeType))
|
||||
return elem;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsDocument::GetTitleFromElement(PRUint32 aNamespace, nsAString& aTitle)
|
||||
nsDocument::GetTitleFromElement(PRUint32 aNodeType, nsAString& aTitle)
|
||||
{
|
||||
nsIContent* title = GetTitleContent(aNamespace);
|
||||
nsIContent* title = GetTitleContent(aNodeType);
|
||||
if (!title)
|
||||
return;
|
||||
nsContentUtils::GetNodeTextContent(title, PR_FALSE, aTitle);
|
||||
|
@ -4904,12 +4904,12 @@ nsDocument::GetTitle(nsAString& aTitle)
|
|||
#ifdef MOZ_SVG
|
||||
case kNameSpaceID_SVG:
|
||||
if (rootContent->Tag() == nsGkAtoms::svg) {
|
||||
GetTitleFromElement(kNameSpaceID_SVG, tmp);
|
||||
GetTitleFromElement(nsINode::eSVG, tmp);
|
||||
break;
|
||||
} // else fall through
|
||||
#endif
|
||||
default:
|
||||
GetTitleFromElement(kNameSpaceID_XHTML, tmp);
|
||||
GetTitleFromElement(nsINode::eHTML, tmp);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4941,7 +4941,7 @@ nsDocument::SetTitle(const nsAString& aTitle)
|
|||
// element" under us
|
||||
mozAutoDocUpdate updateBatch(this, UPDATE_CONTENT_MODEL, PR_TRUE);
|
||||
|
||||
nsIContent* title = GetTitleContent(kNameSpaceID_XHTML);
|
||||
nsIContent* title = GetTitleContent(nsINode::eHTML);
|
||||
if (!title) {
|
||||
nsIContent *head = GetHeadContent();
|
||||
if (!head)
|
||||
|
@ -5020,7 +5020,7 @@ nsDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult)
|
|||
nsIDocument* doc = content->GetOwnerDoc();
|
||||
NS_ENSURE_TRUE(doc == this, NS_ERROR_DOM_WRONG_DOCUMENT_ERR);
|
||||
|
||||
if (!mHasWarnedAboutBoxObjects && !content->IsXUL()) {
|
||||
if (!mHasWarnedAboutBoxObjects && !content->IsNodeOfType(eXUL)) {
|
||||
mHasWarnedAboutBoxObjects = PR_TRUE;
|
||||
nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
|
||||
"UseOfGetBoxObjectForWarning",
|
||||
|
|
|
@ -400,7 +400,7 @@ AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem, nsIContent* aOwningContent,
|
|||
nsAutoString value;
|
||||
PRBool isContent = PR_FALSE;
|
||||
|
||||
if (aOwningContent->IsXUL()) {
|
||||
if (aOwningContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
aOwningContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
|
||||
}
|
||||
|
||||
|
|
|
@ -338,8 +338,7 @@ nsINode::GetTextEditorRootContent(nsIEditor** aEditor)
|
|||
if (aEditor)
|
||||
*aEditor = nsnull;
|
||||
for (nsINode* node = this; node; node = node->GetNodeParent()) {
|
||||
if (!node->IsNodeOfType(eELEMENT) ||
|
||||
!static_cast<nsIContent*>(node)->IsHTML())
|
||||
if (!node->IsNodeOfType(eHTML))
|
||||
continue;
|
||||
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
|
@ -1145,7 +1144,7 @@ nsNSElementTearoff::GetScrollInfo(nsIScrollableView **aScrollableView,
|
|||
*aScrollableView = nsnull;
|
||||
|
||||
// it isn't clear what to return for SVG nodes, so just return nothing
|
||||
if (mContent->IsSVG()) {
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG)) {
|
||||
if (aFrame)
|
||||
*aFrame = nsnull;
|
||||
return;
|
||||
|
@ -1297,7 +1296,7 @@ nsNSElementTearoff::GetScrollHeight(PRInt32* aScrollHeight)
|
|||
NS_ENSURE_ARG_POINTER(aScrollHeight);
|
||||
*aScrollHeight = 0;
|
||||
|
||||
if (mContent->IsSVG())
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG))
|
||||
return NS_OK;
|
||||
|
||||
nsIScrollableView *scrollView;
|
||||
|
@ -1328,7 +1327,7 @@ nsNSElementTearoff::GetScrollWidth(PRInt32* aScrollWidth)
|
|||
NS_ENSURE_ARG_POINTER(aScrollWidth);
|
||||
*aScrollWidth = 0;
|
||||
|
||||
if (mContent->IsSVG())
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG))
|
||||
return NS_OK;
|
||||
|
||||
nsIScrollableView *scrollView;
|
||||
|
@ -1359,7 +1358,7 @@ nsNSElementTearoff::GetClientAreaRect()
|
|||
nsIFrame *frame;
|
||||
|
||||
// it isn't clear what to return for SVG nodes, so just return 0
|
||||
if (mContent->IsSVG())
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG))
|
||||
return nsRect(0, 0, 0, 0);
|
||||
|
||||
GetScrollInfo(&scrollView, &frame);
|
||||
|
@ -3950,7 +3949,7 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
|
|||
}
|
||||
}
|
||||
|
||||
if (!newContent->IsXUL()) {
|
||||
if (!newContent->IsNodeOfType(eXUL)) {
|
||||
nsContentUtils::ReparentContentWrapper(newContent, aParent,
|
||||
container->GetOwnerDoc(),
|
||||
container->GetOwnerDoc());
|
||||
|
@ -4009,7 +4008,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
|
||||
|
||||
if (tmp->HasProperties() && tmp->IsXUL()) {
|
||||
if (tmp->HasProperties() && tmp->IsNodeOfType(nsINode::eXUL)) {
|
||||
tmp->DeleteProperty(nsGkAtoms::contextmenulistener);
|
||||
tmp->DeleteProperty(nsGkAtoms::popuplistener);
|
||||
}
|
||||
|
@ -4039,7 +4038,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
|||
slots->mAttributeMap->DropReference();
|
||||
slots->mAttributeMap = nsnull;
|
||||
}
|
||||
if (tmp->IsXUL())
|
||||
if (tmp->IsNodeOfType(nsINode::eXUL))
|
||||
NS_IF_RELEASE(slots->mControllers);
|
||||
slots->mChildrenList = nsnull;
|
||||
}
|
||||
|
@ -4077,7 +4076,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA
|
||||
|
||||
if (tmp->HasProperties() && tmp->IsXUL()) {
|
||||
if (tmp->HasProperties() && tmp->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsISupports* property =
|
||||
static_cast<nsISupports*>
|
||||
(tmp->GetProperty(nsGkAtoms::contextmenulistener));
|
||||
|
@ -4119,7 +4118,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
|
|||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mAttributeMap");
|
||||
cb.NoteXPCOMChild(slots->mAttributeMap.get());
|
||||
|
||||
if (tmp->IsXUL())
|
||||
if (tmp->IsNodeOfType(nsINode::eXUL))
|
||||
cb.NoteXPCOMChild(slots->mControllers);
|
||||
cb.NoteXPCOMChild(
|
||||
static_cast<nsIDOMNodeList*>(slots->mChildrenList.get()));
|
||||
|
|
|
@ -690,7 +690,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, PRBool aClone, PRBool 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->IsNodeOfType(nsINode::eELEMENT) && static_cast<nsIContent*>(aNode)->IsXUL()) {
|
||||
if (aClone && !aParent && aNode->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsXULElement *xulElem = static_cast<nsXULElement*>(elem);
|
||||
if (!xulElem->mPrototype || xulElem->IsInDoc()) {
|
||||
clone->SetFlags(NODE_FORCE_XBL_BINDINGS);
|
||||
|
|
|
@ -1788,7 +1788,7 @@ nsObjectLoadingContent::ShouldShowDefaultPlugin(nsIContent* aContent,
|
|||
nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
|
||||
const nsCString& aContentType)
|
||||
{
|
||||
if (!aContent->IsHTML()) {
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
return ePluginOtherState;
|
||||
}
|
||||
|
||||
|
@ -1805,7 +1805,7 @@ nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
|
|||
nsIContent* child = aContent->GetChildAt(i);
|
||||
NS_ASSERTION(child, "GetChildCount lied!");
|
||||
|
||||
if (child->IsHTML() &&
|
||||
if (child->IsNodeOfType(nsINode::eHTML) &&
|
||||
child->Tag() == nsGkAtoms::param) {
|
||||
if (child->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
|
||||
NS_LITERAL_STRING("pluginurl"), eIgnoreCase)) {
|
||||
|
|
|
@ -1853,7 +1853,7 @@ nsPlainTextSerializer::IsCurrentNodeConverted(const nsIParserNode* aNode)
|
|||
PRInt32
|
||||
nsPlainTextSerializer::GetIdForContent(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent->IsHTML()) {
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
return eHTMLTag_unknown;
|
||||
}
|
||||
|
||||
|
|
|
@ -145,23 +145,23 @@ nsScriptElement::ContentInserted(nsIDocument *aDocument,
|
|||
}
|
||||
|
||||
static PRBool
|
||||
InNonScriptingContainer(nsIContent* aNode)
|
||||
InNonScriptingContainer(nsINode* aNode)
|
||||
{
|
||||
aNode = aNode->GetParent();
|
||||
aNode = aNode->GetNodeParent();
|
||||
while (aNode) {
|
||||
// XXX noframes and noembed are currently unconditionally not
|
||||
// displayed and processed. This might change if we support either
|
||||
// prefs or per-document container settings for not allowing
|
||||
// frames or plugins.
|
||||
if (aNode->IsHTML()) {
|
||||
nsIAtom *localName = aNode->Tag();
|
||||
if (aNode->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsIAtom *localName = static_cast<nsIContent*>(aNode)->Tag();
|
||||
if (localName == nsGkAtoms::iframe ||
|
||||
localName == nsGkAtoms::noframes ||
|
||||
localName == nsGkAtoms::noembed) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
aNode = aNode->GetParent();
|
||||
aNode = aNode->GetNodeParent();
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
|
|
|
@ -503,7 +503,7 @@ nsXHTMLContentSerializer::AfterElementStart(nsIContent * aContent,
|
|||
PRUint32 i, childCount = aContent->GetChildCount();
|
||||
for (i = 0; i < childCount; ++i) {
|
||||
nsIContent* child = aContent->GetChildAt(i);
|
||||
if (child->IsHTML() &&
|
||||
if (child->IsNodeOfType(nsINode::eHTML) &&
|
||||
child->Tag() == nsGkAtoms::meta &&
|
||||
child->HasAttr(kNameSpaceID_None, nsGkAtoms::content)) {
|
||||
nsAutoString header;
|
||||
|
|
|
@ -772,7 +772,7 @@ nsXMLContentSerializer::IsJavaScript(nsIContent * aContent, nsIAtom* aAttrNameAt
|
|||
PRInt32 aAttrNamespaceID, const nsAString& aValueString)
|
||||
{
|
||||
PRInt32 namespaceID = aContent->GetNameSpaceID();
|
||||
PRBool isHtml = aContent->IsHTML();
|
||||
PRBool isHtml = aContent->IsNodeOfType(nsINode::eHTML);
|
||||
|
||||
if (aAttrNamespaceID == kNameSpaceID_None &&
|
||||
(isHtml ||
|
||||
|
|
|
@ -141,7 +141,7 @@ nsContentEventHandler::Init(nsQueryContentEvent* aEvent)
|
|||
// we don't want to include the bogus BRs at the end.
|
||||
static PRBool IsContentBR(nsIContent* aContent)
|
||||
{
|
||||
return aContent->IsHTML() &&
|
||||
return aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
aContent->Tag() == nsGkAtoms::br &&
|
||||
!aContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::type,
|
||||
|
@ -857,12 +857,12 @@ static void AdjustRangeForSelection(nsIContent* aRoot,
|
|||
node = node->GetParent();
|
||||
offset = node->IndexOf(*aNode) + (offset ? 1 : 0);
|
||||
}
|
||||
|
||||
nsIContent* brContent = node->GetChildAt(offset - 1);
|
||||
while (brContent && brContent->IsHTML()) {
|
||||
nsINode* brNode = node->GetChildAt(offset - 1);
|
||||
while (brNode && brNode->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsIContent* brContent = static_cast<nsIContent*>(brNode);
|
||||
if (brContent->Tag() != nsGkAtoms::br || IsContentBR(brContent))
|
||||
break;
|
||||
brContent = node->GetChildAt(--offset - 1);
|
||||
brNode = node->GetChildAt(--offset - 1);
|
||||
}
|
||||
*aNode = node;
|
||||
*aOffset = PR_MAX(offset, 0);
|
||||
|
|
|
@ -1243,7 +1243,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
|||
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDoc =
|
||||
do_QueryInterface(aContent->GetOwnerDoc());
|
||||
if (!xulDoc && !aContent->IsXUL())
|
||||
if (!xulDoc && !aContent->IsNodeOfType(nsINode::eXUL))
|
||||
return PR_TRUE;
|
||||
|
||||
// For XUL we do visibility checks.
|
||||
|
@ -1264,7 +1264,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
|||
if (control)
|
||||
return PR_TRUE;
|
||||
|
||||
if (aContent->IsHTML()) {
|
||||
if (aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsIAtom* tag = aContent->Tag();
|
||||
|
||||
// HTML area, label and legend elements are never focusable, so
|
||||
|
@ -1274,7 +1274,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
|||
tag == nsGkAtoms::legend)
|
||||
return PR_TRUE;
|
||||
|
||||
} else if (aContent->IsXUL()) {
|
||||
} else if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
// XUL label elements are never focusable, so we need to check for them
|
||||
// explicitly before giving up.
|
||||
if (aContent->Tag() == nsGkAtoms::label)
|
||||
|
@ -1557,7 +1557,7 @@ nsEventStateManager::FireContextClick()
|
|||
nsIAtom *tag = mGestureDownContent->Tag();
|
||||
PRBool allowedToDispatch = PR_TRUE;
|
||||
|
||||
if (mGestureDownContent->IsXUL()) {
|
||||
if (mGestureDownContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tag == nsGkAtoms::scrollbar ||
|
||||
tag == nsGkAtoms::scrollbarbutton ||
|
||||
tag == nsGkAtoms::button)
|
||||
|
@ -1578,7 +1578,7 @@ nsEventStateManager::FireContextClick()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (mGestureDownContent->IsHTML()) {
|
||||
else if (mGestureDownContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsCOMPtr<nsIFormControl> formCtrl(do_QueryInterface(mGestureDownContent));
|
||||
|
||||
if (formCtrl) {
|
||||
|
@ -2207,7 +2207,7 @@ nsEventStateManager::DoScrollZoom(nsIFrame *aTargetFrame,
|
|||
nsIContent *content = aTargetFrame->GetContent();
|
||||
if (content &&
|
||||
!content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL) &&
|
||||
!content->IsXUL())
|
||||
!content->IsNodeOfType(nsINode::eXUL))
|
||||
{
|
||||
// positive adjustment to decrease zoom, negative to increase
|
||||
PRInt32 change = (adjustment > 0) ? -1 : 1;
|
||||
|
|
|
@ -436,8 +436,8 @@ nsGenericHTMLElement::SetClassName(const nsAString& aClassName)
|
|||
static PRBool
|
||||
IsBody(nsIContent *aContent)
|
||||
{
|
||||
return aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
|
||||
aContent->IsHTML();
|
||||
return (aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
static PRBool IS_TABLE_CELL(nsIAtom* frameType) {
|
||||
|
@ -752,13 +752,14 @@ nsGenericHTMLElement::GetSpellcheck(PRBool* aSpellcheck)
|
|||
*aSpellcheck = PR_FALSE; // Default answer is to not spellcheck
|
||||
|
||||
// Has the state has been explicitly set?
|
||||
nsIContent* node;
|
||||
for (node = this; node; node = node->GetParent()) {
|
||||
if (node->IsHTML()) {
|
||||
nsINode* node;
|
||||
for (node = this; node; node = node->GetNodeParent()) {
|
||||
if (node->IsNodeOfType(nsINode::eHTML)) {
|
||||
static nsIContent::AttrValuesArray strings[] =
|
||||
{&nsGkAtoms::_true, &nsGkAtoms::_false, nsnull};
|
||||
switch (node->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck,
|
||||
strings, eCaseMatters)) {
|
||||
switch (static_cast<nsIContent*>(node)->
|
||||
FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck,
|
||||
strings, eCaseMatters)) {
|
||||
case 0: // spellcheck = "true"
|
||||
*aSpellcheck = PR_TRUE;
|
||||
// Fall through
|
||||
|
@ -905,7 +906,7 @@ nsGenericHTMLElement::FindForm(nsIForm* aCurrentForm)
|
|||
while (content != bindingParent && content) {
|
||||
// If the current ancestor is a form, return it as our form
|
||||
if (content->Tag() == nsGkAtoms::form &&
|
||||
content->IsHTML()) {
|
||||
content->IsNodeOfType(nsINode::eHTML)) {
|
||||
#ifdef DEBUG
|
||||
if (!nsContentUtils::IsInSameAnonymousTree(this, content)) {
|
||||
// It's possible that we started unbinding at |content| or
|
||||
|
@ -958,7 +959,7 @@ static PRBool
|
|||
IsArea(nsIContent *aContent)
|
||||
{
|
||||
return (aContent->Tag() == nsGkAtoms::area &&
|
||||
aContent->IsHTML());
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
@ -1210,7 +1211,7 @@ nsGenericHTMLElement::GetBaseTarget(nsAString& aBaseTarget) const
|
|||
PRBool
|
||||
nsGenericHTMLElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -2292,7 +2293,7 @@ NS_IMPL_QUERY_INTERFACE_INHERITED1(nsGenericHTMLFormElement,
|
|||
PRBool
|
||||
nsGenericHTMLFormElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML_FORM_CONTROL));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML | eHTML_FORM_CONTROL));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
/** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/
|
||||
static nsGenericHTMLElement* FromContent(nsIContent *aContent)
|
||||
{
|
||||
if (aContent->IsHTML())
|
||||
if (aContent->IsNodeOfType(eHTML))
|
||||
return static_cast<nsGenericHTMLElement*>(aContent);
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -436,7 +436,7 @@ static PRBool HasSourceChildren(nsIContent *aElement)
|
|||
NS_ASSERTION(child, "GetChildCount lied!");
|
||||
if (child &&
|
||||
child->Tag() == nsGkAtoms::source &&
|
||||
child->IsHTML())
|
||||
child->IsNodeOfType(nsINode::eHTML))
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -1626,7 +1626,7 @@ void nsHTMLMediaElement::Thaw()
|
|||
PRBool
|
||||
nsHTMLMediaElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eMEDIA));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML | eMEDIA));
|
||||
}
|
||||
|
||||
void nsHTMLMediaElement::NotifyAddedSource()
|
||||
|
@ -1679,7 +1679,7 @@ already_AddRefed<nsIURI> nsHTMLMediaElement::GetNextSource()
|
|||
// If child is a <source> element, it may be the next candidate.
|
||||
if (child &&
|
||||
child->Tag() == nsGkAtoms::source &&
|
||||
child->IsHTML())
|
||||
child->IsNodeOfType(nsINode::eHTML))
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsAutoString src,type;
|
||||
|
|
|
@ -158,7 +158,8 @@ nsIContent*
|
|||
nsHTMLOptGroupElement::GetSelect()
|
||||
{
|
||||
nsIContent* parent = this;
|
||||
while ((parent = parent->GetParent()) && parent->IsHTML()) {
|
||||
while ((parent = parent->GetParent()) &&
|
||||
parent->IsNodeOfType(eHTML)) {
|
||||
if (parent->Tag() == nsGkAtoms::select) {
|
||||
return parent;
|
||||
}
|
||||
|
|
|
@ -442,7 +442,7 @@ nsHTMLOptionElement::GetSelect()
|
|||
{
|
||||
nsIContent* parent = this;
|
||||
while ((parent = parent->GetParent()) &&
|
||||
parent->IsHTML()) {
|
||||
parent->IsNodeOfType(eHTML)) {
|
||||
if (parent->Tag() == nsGkAtoms::select) {
|
||||
return parent;
|
||||
}
|
||||
|
|
|
@ -331,7 +331,7 @@ nsHTMLSelectElement::RemoveOptionsFromList(nsIContent* aOptions,
|
|||
static PRBool IsOptGroup(nsIContent *aContent)
|
||||
{
|
||||
return (aContent->NodeInfo()->Equals(nsGkAtoms::optgroup) &&
|
||||
aContent->IsHTML());
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
// If the document is such that recursing over these options gets us
|
||||
|
|
|
@ -140,7 +140,7 @@ nsHTMLTableCellElement::GetTable()
|
|||
if (parent) { // GetParent() should be a row
|
||||
nsIContent* section = parent->GetParent();
|
||||
if (section) {
|
||||
if (section->IsHTML() &&
|
||||
if (section->IsNodeOfType(eHTML) &&
|
||||
section->NodeInfo()->Equals(nsGkAtoms::table)) {
|
||||
// XHTML, without a row group
|
||||
result = section;
|
||||
|
|
|
@ -237,7 +237,7 @@ IsCell(nsIContent *aContent, PRInt32 aNamespaceID,
|
|||
nsIAtom* tag = aContent->Tag();
|
||||
|
||||
return ((tag == nsGkAtoms::td || tag == nsGkAtoms::th) &&
|
||||
aContent->IsHTML());
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -1592,7 +1592,7 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
|
|||
// body.
|
||||
if (!newBody || !(newBody->Tag() == nsGkAtoms::body ||
|
||||
newBody->Tag() == nsGkAtoms::frameset) ||
|
||||
!root || !root->IsHTML() ||
|
||||
!root || !root->IsNodeOfType(nsINode::eHTML) ||
|
||||
root->Tag() != nsGkAtoms::html) {
|
||||
return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
|
||||
}
|
||||
|
@ -2824,7 +2824,7 @@ nsHTMLDocument::ResolveName(const nsAString& aName,
|
|||
|
||||
nsIContent *e = entry->GetIdContent();
|
||||
|
||||
if (e && e->IsHTML()) {
|
||||
if (e && e->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsIAtom *tag = e->Tag();
|
||||
|
||||
if ((tag == nsGkAtoms::embed ||
|
||||
|
|
|
@ -410,7 +410,7 @@ nsMathMLElement::IntrinsicState() const
|
|||
PRBool
|
||||
nsMathMLElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eMATHML));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -699,7 +699,7 @@ nsSVGElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
|||
PRBool
|
||||
nsSVGElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eSVG));
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
|
|
|
@ -289,7 +289,7 @@ float
|
|||
nsSVGLength2::GetUnitScaleFactor(nsIFrame *aFrame, PRUint8 aUnitType) const
|
||||
{
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (content->IsSVG())
|
||||
if (content->IsNodeOfType(nsINode::eSVG))
|
||||
return GetUnitScaleFactor(static_cast<nsSVGElement*>(content), aUnitType);
|
||||
|
||||
switch (aUnitType) {
|
||||
|
|
|
@ -899,7 +899,7 @@ nsresult
|
|||
nsXBLContentSink::AddAttributes(const PRUnichar** aAtts,
|
||||
nsIContent* aContent)
|
||||
{
|
||||
if (aContent->IsXUL())
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL))
|
||||
return NS_OK; // Nothing to do, since the proto already has the attrs.
|
||||
|
||||
return nsXMLContentSink::AddAttributes(aAtts, aContent);
|
||||
|
|
|
@ -481,7 +481,8 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsPIDOMEventTarget* aTarget, nsIDOMEve
|
|||
// 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->IsNodeOfType(nsINode::eHTML)) {
|
||||
isLink = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1172,7 +1172,8 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
|
|||
ni->Equals(nsGkAtoms::thumb, kNameSpaceID_XUL) ||
|
||||
((ni->Equals(nsGkAtoms::input) ||
|
||||
ni->Equals(nsGkAtoms::select)) &&
|
||||
aBoundElement->IsHTML()))) && !aForceSyncLoad) {
|
||||
aBoundElement->IsNodeOfType(nsINode::eHTML)))) &&
|
||||
!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
|
||||
|
|
|
@ -437,6 +437,13 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
|
|||
if (aNode.mNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
nsINodeInfo* nodeInfo = aNode.Content()->NodeInfo();
|
||||
nodeInfo->GetLocalName(aLocalName);
|
||||
|
||||
// Check for html
|
||||
if (nodeInfo->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.mNode->IsNodeOfType(nsINode::eHTML)) {
|
||||
ToUpperCase(aLocalName);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -458,7 +465,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
|
|||
|
||||
// Check for html
|
||||
if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.Content()->IsHTML()) {
|
||||
aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
|
||||
ToUpperCase(aLocalName);
|
||||
}
|
||||
}
|
||||
|
@ -479,9 +486,11 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
|
|||
nodeInfo->GetQualifiedName(aName);
|
||||
|
||||
// Check for html
|
||||
if (aNode.Content()->IsHTML()) {
|
||||
if (nodeInfo->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
|
||||
ToUpperCase(aName);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -501,7 +510,8 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
|
|||
aNode.Content()->GetAttrNameAt(aNode.mIndex)->GetQualifiedName(aName);
|
||||
|
||||
// Check for html
|
||||
if (aNode.Content()->IsHTML()) {
|
||||
if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
|
||||
ToUpperCase(aName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
return PR_FALSE;
|
||||
}
|
||||
nsIContent* content = aNode.Content();
|
||||
return content->IsHTML() && content->IsInHTMLDocument();
|
||||
return content->IsNodeOfType(nsINode::eHTML) && content->IsInHTMLDocument();
|
||||
}
|
||||
#else
|
||||
private:
|
||||
|
|
|
@ -308,14 +308,14 @@ txMozillaXMLOutput::endElement()
|
|||
|
||||
// Handle html-elements
|
||||
if (!mNoFixup) {
|
||||
if (element->IsHTML()) {
|
||||
if (element->IsNodeOfType(nsINode::eHTML)) {
|
||||
rv = endHTMLElement(element);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Handle script elements
|
||||
if (element->Tag() == nsGkAtoms::script &&
|
||||
(element->IsHTML() ||
|
||||
(element->IsNodeOfType(nsINode::eHTML) ||
|
||||
element->GetNameSpaceID() == kNameSpaceID_SVG)) {
|
||||
|
||||
rv = element->DoneAddingChildren(PR_TRUE);
|
||||
|
|
|
@ -2152,7 +2152,7 @@ nsXULElement::GetBindingParent() const
|
|||
PRBool
|
||||
nsXULElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eXUL));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -476,7 +476,7 @@ public:
|
|||
/** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/
|
||||
static nsXULElement* FromContent(nsIContent *aContent)
|
||||
{
|
||||
if (aContent->IsXUL())
|
||||
if (aContent->IsNodeOfType(eXUL))
|
||||
return static_cast<nsXULElement*>(aContent);
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -1302,7 +1302,7 @@ PRBool
|
|||
nsXULContentBuilder::IsOpen(nsIContent* aElement)
|
||||
{
|
||||
// Determine if this is a <treeitem> or <menu> element
|
||||
if (!aElement->IsXUL())
|
||||
if (!aElement->IsNodeOfType(nsINode::eXUL))
|
||||
return PR_TRUE;
|
||||
|
||||
// XXXhyatt Use the XBL service to obtain a base tag.
|
||||
|
|
|
@ -112,7 +112,7 @@ XULSortServiceImpl::SetSortColumnHints(nsIContent *content,
|
|||
for (PRUint32 childIndex = 0; childIndex < numChildren; ++childIndex) {
|
||||
nsIContent *child = content->GetChildAt(childIndex);
|
||||
|
||||
if (child->IsXUL()) {
|
||||
if (child->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsIAtom *tag = child->Tag();
|
||||
|
||||
if (tag == nsGkAtoms::treecols) {
|
||||
|
|
|
@ -1249,7 +1249,7 @@ nsXULTemplateBuilder::LoadDataSources(nsIDocument* aDocument,
|
|||
if (xuldoc)
|
||||
xuldoc->SetTemplateBuilderFor(mRoot, this);
|
||||
|
||||
if (!mRoot->IsXUL()) {
|
||||
if (!mRoot->IsNodeOfType(nsINode::eXUL)) {
|
||||
// Hmm. This must be an HTML element. Try to set it as a
|
||||
// JS property "by hand".
|
||||
InitHTMLTemplateRoot();
|
||||
|
|
|
@ -356,7 +356,7 @@ ForEachPing(nsIContent *content, ForEachPingCallback callback, void *closure)
|
|||
|
||||
// Make sure we are dealing with either an <A> or <AREA> element in the HTML
|
||||
// or XHTML namespace.
|
||||
if (!content->IsHTML())
|
||||
if (!content->IsNodeOfType(nsINode::eHTML))
|
||||
return;
|
||||
nsIAtom *nameAtom = content->Tag();
|
||||
if (!nameAtom->EqualsUTF8(NS_LITERAL_CSTRING("a")) &&
|
||||
|
|
|
@ -7000,8 +7000,7 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
|
|||
nsISupports *native_parent;
|
||||
|
||||
PRBool slimWrappers = PR_TRUE;
|
||||
PRBool nodeIsElement = node->IsNodeOfType(nsINode::eELEMENT);
|
||||
if (nodeIsElement && static_cast<nsIContent*>(node)->IsXUL()) {
|
||||
if (node->IsNodeOfType(nsINode::eELEMENT | nsINode::eXUL)) {
|
||||
// For XUL elements, use the parent, if any.
|
||||
native_parent = node->GetParent();
|
||||
|
||||
|
@ -7017,8 +7016,9 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
|
|||
native_parent = doc;
|
||||
|
||||
// But for HTML form controls, use the form as scope parent.
|
||||
if (nodeIsElement &&
|
||||
node->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
|
||||
if (node->IsNodeOfType(nsINode::eELEMENT |
|
||||
nsIContent::eHTML |
|
||||
nsIContent::eHTML_FORM_CONTROL)) {
|
||||
nsCOMPtr<nsIFormControl> form_control(do_QueryInterface(node));
|
||||
|
||||
if (form_control) {
|
||||
|
|
|
@ -265,7 +265,7 @@ nsIContent*
|
|||
nsFocusManager::GetRedirectedFocus(nsIContent* aContent)
|
||||
{
|
||||
#ifdef MOZ_XUL
|
||||
if (aContent->IsXUL()) {
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsCOMPtr<nsIDOMNode> inputField;
|
||||
|
||||
nsCOMPtr<nsIDOMXULTextBoxElement> textbox = do_QueryInterface(aContent);
|
||||
|
@ -1254,7 +1254,7 @@ nsFocusManager::CheckIfFocusable(nsIContent* aContent, PRUint32 aFlags)
|
|||
if (!frame)
|
||||
return nsnull;
|
||||
|
||||
if (aContent->Tag() == nsGkAtoms::area && aContent->IsHTML()) {
|
||||
if (aContent->Tag() == nsGkAtoms::area && aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
// HTML areas do not have their own frame, and the img frame we get from
|
||||
// GetPrimaryFrameFor() is not relevant as to whether it is focusable or
|
||||
// not, so we have to do all the relevant checks manually for them.
|
||||
|
@ -2074,7 +2074,7 @@ nsFocusManager::DetermineElementToMoveFocus(nsPIDOMWindow* aWindow,
|
|||
if (startContent) {
|
||||
nsIFrame* frame = presShell->GetPrimaryFrameFor(startContent);
|
||||
if (startContent->Tag() == nsGkAtoms::area &&
|
||||
startContent->IsHTML())
|
||||
startContent->IsNodeOfType(nsINode::eHTML))
|
||||
startContent->IsFocusable(&tabIndex);
|
||||
else if (frame)
|
||||
frame->IsFocusable(&tabIndex, 0);
|
||||
|
@ -2354,7 +2354,7 @@ nsFocusManager::GetNextTabbableContent(nsIPresShell* aPresShell,
|
|||
frameTraversal->Last();
|
||||
}
|
||||
else if (!aStartContent || aStartContent->Tag() != nsGkAtoms::area ||
|
||||
!aStartContent->IsHTML()) {
|
||||
!aStartContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
// 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)
|
||||
|
@ -2638,7 +2638,7 @@ nsFocusManager::GetRootForFocus(nsPIDOMWindow* aWindow,
|
|||
for (PRUint32 i = 0; i < childCount; ++i) {
|
||||
nsIContent *childContent = rootContent->GetChildAt(i);
|
||||
nsINodeInfo *ni = childContent->NodeInfo();
|
||||
if (childContent->IsHTML() &&
|
||||
if (childContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
ni->Equals(nsGkAtoms::frameset))
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -789,7 +789,7 @@ nsFind::NextNode(nsIDOMRange* aSearchRange,
|
|||
|
||||
PRBool nsFind::IsBlockNode(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent->IsHTML()) {
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
@ -854,7 +854,7 @@ PRBool nsFind::SkipNode(nsIContent* aContent)
|
|||
// We may not need to skip comment nodes,
|
||||
// now that IsTextNode distinguishes them from real text nodes.
|
||||
return (aContent->IsNodeOfType(nsINode::eCOMMENT) ||
|
||||
(aContent->IsHTML() &&
|
||||
(aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
(atom == sScriptAtom ||
|
||||
atom == sNoframesAtom ||
|
||||
atom == sSelectAtom)));
|
||||
|
@ -871,7 +871,7 @@ PRBool nsFind::SkipNode(nsIContent* aContent)
|
|||
atom = content->Tag();
|
||||
|
||||
if (aContent->IsNodeOfType(nsINode::eCOMMENT) ||
|
||||
(content->IsHTML() &&
|
||||
(content->IsNodeOfType(nsINode::eHTML) &&
|
||||
(atom == sScriptAtom ||
|
||||
atom == sNoframesAtom ||
|
||||
atom == sSelectAtom)))
|
||||
|
|
|
@ -1798,7 +1798,7 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
|
|||
return content.forget();
|
||||
}
|
||||
|
||||
if (aParentContent->IsHTML() &&
|
||||
if (aParentContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
aParentContent->NodeInfo()->Equals(nsGkAtoms::input)) {
|
||||
if (aParentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
|
@ -2407,7 +2407,7 @@ nsCSSFrameConstructor::PropagateScrollToViewport()
|
|||
// of the viewport
|
||||
// XXX what about XHTML?
|
||||
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc(do_QueryInterface(mDocument));
|
||||
if (!htmlDoc || !docElement->IsHTML()) {
|
||||
if (!htmlDoc || !docElement->IsNodeOfType(nsINode::eHTML)) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
@ -2540,7 +2540,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIContent* aDocEle
|
|||
|
||||
// Check whether we need to build a XUL box or SVG root frame
|
||||
#ifdef MOZ_XUL
|
||||
if (aDocElement->IsXUL()) {
|
||||
if (aDocElement->IsNodeOfType(nsINode::eXUL)) {
|
||||
contentFrame = NS_NewDocElementBoxFrame(mPresShell, styleContext);
|
||||
if (NS_UNLIKELY(!contentFrame)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -2799,7 +2799,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
|
|||
|
||||
if (!isPaginated) {
|
||||
#ifdef MOZ_XUL
|
||||
if (aDocElement->IsXUL())
|
||||
if (aDocElement->IsNodeOfType(nsINode::eXUL))
|
||||
{
|
||||
// pass a temporary stylecontext, the correct one will be set later
|
||||
rootFrame = NS_NewRootBoxFrame(mPresShell, viewportPseudoStyle);
|
||||
|
@ -2838,11 +2838,11 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
|
|||
// 3) nsIScrollable::Scrollbar_Always = scrollbars always
|
||||
// Only need to create a scroll frame/view for cases 2 and 3.
|
||||
|
||||
PRBool isHTML = aDocElement->IsHTML();
|
||||
PRBool isHTML = aDocElement->IsNodeOfType(nsINode::eHTML);
|
||||
PRBool isXUL = PR_FALSE;
|
||||
|
||||
if (!isHTML) {
|
||||
isXUL = aDocElement->IsXUL();
|
||||
isXUL = aDocElement->IsNodeOfType(nsINode::eXUL);
|
||||
}
|
||||
|
||||
// Never create scrollbars for XUL documents
|
||||
|
@ -3656,7 +3656,7 @@ nsCSSFrameConstructor::FindHTMLData(nsIContent* aContent,
|
|||
// Ignore the tag if it's not HTML content and if it doesn't extend (via XBL)
|
||||
// a valid HTML namespace. This check must match the one in
|
||||
// ShouldHaveFirstLineStyle.
|
||||
if (!aContent->IsHTML() &&
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
aNameSpaceID != kNameSpaceID_XHTML) {
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -4496,7 +4496,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
|
|||
// make this function static.
|
||||
PRBool propagatedScrollToViewport = PR_FALSE;
|
||||
if (aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
|
||||
aContent->IsHTML()) {
|
||||
aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
propagatedScrollToViewport =
|
||||
PropagateScrollToViewport() == aContent;
|
||||
}
|
||||
|
@ -6064,7 +6064,7 @@ static PRBool
|
|||
IsSpecialFramesetChild(nsIContent* aContent)
|
||||
{
|
||||
// IMPORTANT: This must match the conditions in nsHTMLFramesetFrame::Init.
|
||||
return aContent->IsHTML() &&
|
||||
return aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
(aContent->Tag() == nsGkAtoms::frameset ||
|
||||
aContent->Tag() == nsGkAtoms::frame);
|
||||
}
|
||||
|
@ -6081,8 +6081,8 @@ MaybeGetListBoxBodyFrame(nsIContent* aContainer, nsIContent* aChild)
|
|||
if (!aContainer)
|
||||
return nsnull;
|
||||
|
||||
if (aContainer->IsXUL() &&
|
||||
aChild->IsXUL() &&
|
||||
if (aContainer->IsNodeOfType(nsINode::eXUL) &&
|
||||
aChild->IsNodeOfType(nsINode::eXUL) &&
|
||||
aContainer->Tag() == nsGkAtoms::listbox &&
|
||||
aChild->Tag() == nsGkAtoms::listitem) {
|
||||
nsCOMPtr<nsIDOMXULElement> xulElement = do_QueryInterface(aContainer);
|
||||
|
@ -7556,7 +7556,7 @@ InvalidateCanvasIfNeeded(nsIPresShell* presShell, nsIContent* node)
|
|||
|
||||
// Check whether it's an HTML body
|
||||
if (node->Tag() != nsGkAtoms::body ||
|
||||
!node->IsHTML()) {
|
||||
!node->IsNodeOfType(nsINode::eHTML)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -8833,7 +8833,7 @@ nsCSSFrameConstructor::GetInsertionPoint(nsIFrame* aParentFrame,
|
|||
// have to look at insertionElement here...
|
||||
if (aMultiple && !*aMultiple) {
|
||||
nsIContent* content = insertionElement ? insertionElement : container;
|
||||
if (content->IsHTML() &&
|
||||
if (content->IsNodeOfType(nsINode::eHTML) &&
|
||||
content->Tag() == nsGkAtoms::fieldset) {
|
||||
*aMultiple = PR_TRUE;
|
||||
}
|
||||
|
@ -9194,7 +9194,7 @@ nsCSSFrameConstructor::ShouldHaveFirstLineStyle(nsIContent* aContent,
|
|||
// This check must match the one in FindHTMLData.
|
||||
hasFirstLine = tag != nsGkAtoms::fieldset ||
|
||||
(namespaceID != kNameSpaceID_XHTML &&
|
||||
!aContent->IsHTML());
|
||||
!aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
return hasFirstLine;
|
||||
|
|
|
@ -1424,7 +1424,7 @@ public:
|
|||
nsIContent* root = aContent->GetCurrentDoc()->GetRootContent();
|
||||
while (aContent && aContent->IsInNativeAnonymousSubtree()) {
|
||||
nsIContent* parent = aContent->GetParent();
|
||||
if (parent == root && aContent->IsXUL()) {
|
||||
if (parent == root && aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsIAtom* tag = aContent->Tag();
|
||||
return tag == nsGkAtoms::scrollbar || tag == nsGkAtoms::scrollcorner;
|
||||
}
|
||||
|
@ -3744,7 +3744,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, PRBool aScroll)
|
|||
content = do_QueryInterface(node);
|
||||
if (content) {
|
||||
if (content->Tag() == nsGkAtoms::a &&
|
||||
content->IsHTML()) {
|
||||
content->IsNodeOfType(nsINode::eHTML)) {
|
||||
break;
|
||||
}
|
||||
content = nsnull;
|
||||
|
|
|
@ -433,14 +433,14 @@ static inline PRBool
|
|||
IsOptGroup(nsIContent *aContent)
|
||||
{
|
||||
return (aContent->NodeInfo()->Equals(nsGkAtoms::optgroup) &&
|
||||
aContent->IsHTML());
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
static inline PRBool
|
||||
IsOption(nsIContent *aContent)
|
||||
{
|
||||
return (aContent->NodeInfo()->Equals(nsGkAtoms::option) &&
|
||||
aContent->IsHTML());
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
static PRUint32
|
||||
|
|
|
@ -165,7 +165,7 @@ GetWrapPropertyEnum(nsIContent* aContent, nsHTMLTextWrap& aWrapProp)
|
|||
aWrapProp = eHTMLTextWrap_Soft; // the default
|
||||
|
||||
nsAutoString wrap;
|
||||
if (aContent->IsHTML()) {
|
||||
if (aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
static nsIContent::AttrValuesArray strings[] =
|
||||
{&nsGkAtoms::HARD, &nsGkAtoms::OFF, nsnull};
|
||||
|
||||
|
|
|
@ -6552,7 +6552,7 @@ PRBool
|
|||
nsBlockFrame::FrameStartsCounterScope(nsIFrame* aFrame)
|
||||
{
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (!content || !content->IsHTML())
|
||||
if (!content || !content->IsNodeOfType(nsINode::eHTML))
|
||||
return PR_FALSE;
|
||||
|
||||
nsIAtom *localName = content->NodeInfo()->NameAtom();
|
||||
|
|
|
@ -516,7 +516,7 @@ nsContainerFrame::SyncWindowProperties(nsPresContext* aPresContext,
|
|||
return;
|
||||
|
||||
nsIContent* rootContent = aPresContext->Document()->GetRootContent();
|
||||
if (!rootContent || !rootContent->IsXUL()) {
|
||||
if (!rootContent || !rootContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
// Scrollframes use native widgets which don't work well with
|
||||
// translucent windows, at least in Windows XP. So if the document
|
||||
// has a root scrollrame it's useless to try to make it transparent,
|
||||
|
|
|
@ -6047,7 +6047,7 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex, PRBool aWithMouse)
|
|||
isFocusable = mContent->IsFocusable(&tabIndex);
|
||||
if (!isFocusable && !aWithMouse &&
|
||||
GetType() == nsGkAtoms::scrollFrame &&
|
||||
mContent->IsHTML() &&
|
||||
mContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
!mContent->IsRootOfNativeAnonymousSubtree() &&
|
||||
mContent->GetParent() &&
|
||||
!mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::tabindex)) {
|
||||
|
|
|
@ -394,7 +394,7 @@ nsSubDocumentFrame::GetIntrinsicWidth()
|
|||
return 0; // HTML <frame> has no useful intrinsic width
|
||||
}
|
||||
|
||||
if (mContent->IsXUL()) {
|
||||
if (mContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
return 0; // XUL <iframe> and <browser> have no useful intrinsic width
|
||||
}
|
||||
|
||||
|
@ -412,7 +412,7 @@ nsSubDocumentFrame::GetIntrinsicHeight()
|
|||
// <frame> processing does not use this routine, only <iframe>
|
||||
NS_ASSERTION(IsInline(), "Shouldn't have been called");
|
||||
|
||||
if (mContent->IsXUL()) {
|
||||
if (mContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -685,7 +685,7 @@ nsSubDocumentFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|||
if (!mFrameLoader)
|
||||
return NS_OK;
|
||||
|
||||
if (!mContent->IsXUL()) {
|
||||
if (!mContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
|
|||
|
||||
// IMPORTANT: This must match the conditions in
|
||||
// nsCSSFrameConstructor::ContentAppended/Inserted/Removed
|
||||
if (!child->IsHTML())
|
||||
if (!child->IsNodeOfType(nsINode::eHTML))
|
||||
continue;
|
||||
|
||||
nsIAtom *tag = child->Tag();
|
||||
|
@ -736,7 +736,7 @@ nsHTMLFramesetFrame* nsHTMLFramesetFrame::GetFramesetParent(nsIFrame* aChild)
|
|||
if (content) {
|
||||
nsCOMPtr<nsIContent> contentParent = content->GetParent();
|
||||
|
||||
if (contentParent && contentParent->IsHTML() &&
|
||||
if (contentParent && contentParent->IsNodeOfType(nsINode::eHTML) &&
|
||||
contentParent->Tag() == nsGkAtoms::frameset) {
|
||||
nsIFrame* fptr = aChild->GetParent();
|
||||
parent = (nsHTMLFramesetFrame*) fptr;
|
||||
|
@ -1393,7 +1393,7 @@ nsHTMLFramesetFrame::RecalculateBorderResize()
|
|||
for (childIndex = 0; childIndex < numChildren; childIndex++) {
|
||||
nsIContent *child = mContent->GetChildAt(childIndex);
|
||||
|
||||
if (child->IsHTML()) {
|
||||
if (child->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsINodeInfo *ni = child->NodeInfo();
|
||||
|
||||
if (ni->Equals(nsGkAtoms::frameset)) {
|
||||
|
|
|
@ -806,7 +806,7 @@ nsImageMap::SearchForAreas(nsIContent* aParent, PRBool& aFoundArea,
|
|||
for (i = 0; i < n; i++) {
|
||||
nsIContent *child = aParent->GetChildAt(i);
|
||||
|
||||
if (child->IsHTML()) {
|
||||
if (child->IsNodeOfType(nsINode::eHTML)) {
|
||||
// If we haven't determined that the map element contains an
|
||||
// <a> element yet, then look for <area>.
|
||||
if (!aFoundAnchor && child->Tag() == nsGkAtoms::area) {
|
||||
|
@ -957,7 +957,7 @@ nsImageMap::AttributeChanged(nsIDocument* aDocument,
|
|||
// are the only cases we care about.
|
||||
if ((aContent->NodeInfo()->Equals(nsGkAtoms::area) ||
|
||||
aContent->NodeInfo()->Equals(nsGkAtoms::a)) &&
|
||||
aContent->IsHTML() &&
|
||||
aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
aNameSpaceID == kNameSpaceID_None &&
|
||||
(aAttribute == nsGkAtoms::shape ||
|
||||
aAttribute == nsGkAtoms::coords)) {
|
||||
|
|
|
@ -859,7 +859,7 @@ NS_IMETHODIMP nsInlineFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
*aAccessible = nsnull;
|
||||
nsIAtom *tagAtom = mContent->Tag();
|
||||
if ((tagAtom == nsGkAtoms::img || tagAtom == nsGkAtoms::input ||
|
||||
tagAtom == nsGkAtoms::label) && mContent->IsHTML()) {
|
||||
tagAtom == nsGkAtoms::label) && mContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
// Only get accessibility service if we're going to use it
|
||||
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
|
||||
if (!accService)
|
||||
|
|
|
@ -3254,7 +3254,7 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
|
|||
// source order, while in XML and XHTML it's the same as the source order
|
||||
// (see the AddAttributes functions in the HTML and XML content sinks).
|
||||
PRInt16 start, end, increment;
|
||||
if (mContent->IsHTML() &&
|
||||
if (mContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
mContent->IsInHTMLDocument()) {
|
||||
// HTML. Walk attributes in reverse order.
|
||||
start = numRealAttrs - 1;
|
||||
|
|
|
@ -2367,7 +2367,7 @@ static PRBool IsCell(nsIContent *aContent)
|
|||
{
|
||||
return ((aContent->Tag() == nsGkAtoms::td ||
|
||||
aContent->Tag() == nsGkAtoms::th) &&
|
||||
aContent->IsHTML());
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
}
|
||||
|
||||
nsITableCellLayout*
|
||||
|
@ -3075,7 +3075,7 @@ nsFrameSelection::GetParentTable(nsIContent *aCell) const
|
|||
for (nsIContent* parent = aCell->GetParent(); parent;
|
||||
parent = parent->GetParent()) {
|
||||
if (parent->Tag() == nsGkAtoms::table &&
|
||||
parent->IsHTML()) {
|
||||
parent->IsNodeOfType(nsINode::eHTML)) {
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
|
@ -3213,14 +3213,13 @@ nsTypedSelection::GetTableSelectionType(nsIRange* aRange,
|
|||
if ((endOffset - startOffset) != 1)
|
||||
return NS_OK;
|
||||
|
||||
nsIContent* startContent = static_cast<nsIContent*>(startNode);
|
||||
if (!(startNode->IsNodeOfType(nsINode::eELEMENT) && startContent->IsHTML())) {
|
||||
if (!startNode->IsNodeOfType(nsINode::eHTML)) {
|
||||
// Implies a check for being an element; if we ever make this work
|
||||
// for non-HTML, need to keep checking for elements.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAtom *tag = startContent->Tag();
|
||||
nsIAtom *tag = static_cast<nsIContent*>(startNode)->Tag();
|
||||
|
||||
if (tag == nsGkAtoms::tr)
|
||||
{
|
||||
|
|
|
@ -1344,7 +1344,7 @@ nsMathMLContainerFrame::SetIncrementScriptLevel(PRInt32 aChildIndex, PRBool aInc
|
|||
if (!child)
|
||||
return;
|
||||
nsIContent* content = child->GetContent();
|
||||
if (!content->IsMathML())
|
||||
if (!content->IsNodeOfType(nsINode::eMATHML))
|
||||
return;
|
||||
nsMathMLElement* element = static_cast<nsMathMLElement*>(content);
|
||||
|
||||
|
|
|
@ -2676,7 +2676,7 @@ PRBool nsPrintEngine::HasFramesetChild(nsIContent* aContent)
|
|||
for (PRUint32 i = 0; i < numChildren; ++i) {
|
||||
nsIContent *child = aContent->GetChildAt(i);
|
||||
if (child->Tag() == nsGkAtoms::frameset &&
|
||||
child->IsHTML()) {
|
||||
child->IsNodeOfType(nsINode::eHTML)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ nsPrintPreviewListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||
if (nsEvent)
|
||||
nsEvent->GetOriginalTarget(getter_AddRefs(target));
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(target));
|
||||
if (content && !content->IsXUL()) {
|
||||
if (content && !content->IsNodeOfType(nsINode::eXUL)) {
|
||||
eEventAction action = ::GetActionForEvent(aEvent);
|
||||
switch (action) {
|
||||
case eEventAction_Tab:
|
||||
|
|
|
@ -956,7 +956,7 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext,
|
|||
// NOTE: optimization: cannot be an XLink if no attributes (since it needs an
|
||||
if(!mIsLink &&
|
||||
mHasAttributes &&
|
||||
!(mIsHTMLContent || aContent->IsXUL()) &&
|
||||
!(mIsHTMLContent || aContent->IsNodeOfType(nsINode::eXUL)) &&
|
||||
nsStyleUtil::IsLink(aContent, linkHandler, &mLinkState)) {
|
||||
mIsLink = PR_TRUE;
|
||||
}
|
||||
|
@ -1012,7 +1012,7 @@ const nsString* RuleProcessorData::GetLang()
|
|||
// XHTML1 section C.7).
|
||||
PRBool hasAttr = content->GetAttr(kNameSpaceID_XML, nsGkAtoms::lang,
|
||||
*mLanguage);
|
||||
if (!hasAttr && content->IsHTML()) {
|
||||
if (!hasAttr && content->IsNodeOfType(nsINode::eHTML)) {
|
||||
hasAttr = content->GetAttr(kNameSpaceID_None, nsGkAtoms::lang,
|
||||
*mLanguage);
|
||||
}
|
||||
|
@ -1434,7 +1434,7 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
|||
if (element) {
|
||||
do {
|
||||
child = element->GetChildAt(++index);
|
||||
if (child && child->IsHTML() &&
|
||||
if (child && child->IsNodeOfType(nsINode::eHTML) &&
|
||||
child->Tag() == nsGkAtoms::param &&
|
||||
child->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
|
||||
NS_LITERAL_STRING("pluginurl"), eIgnoreCase)) {
|
||||
|
|
|
@ -462,7 +462,7 @@ nsHTMLStyleSheet::RulesMatching(ElementRuleProcessorData* aData)
|
|||
}
|
||||
else if (tag == nsGkAtoms::col) {
|
||||
nsIContent* parent = aData->mParentContent;
|
||||
if (parent && parent->IsHTML() &&
|
||||
if (parent && parent->IsNodeOfType(nsIContent::eHTML) &&
|
||||
parent->Tag() == nsGkAtoms::colgroup) {
|
||||
ruleWalker->Forward(mTableColRule);
|
||||
} else {
|
||||
|
@ -533,7 +533,7 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
|
|||
if (aData->mAttribute == nsGkAtoms::href &&
|
||||
(mLinkRule || mVisitedRule || mActiveRule) &&
|
||||
content &&
|
||||
content->IsHTML() &&
|
||||
content->IsNodeOfType(nsINode::eHTML) &&
|
||||
aData->mContentTag == nsGkAtoms::a) {
|
||||
*aResult = eReStyle_Self;
|
||||
return NS_OK;
|
||||
|
|
|
@ -432,7 +432,7 @@ PRBool nsStyleUtil::IsHTMLLink(nsIContent *aContent,
|
|||
nsILinkHandler *aLinkHandler,
|
||||
nsLinkState *aState)
|
||||
{
|
||||
NS_ASSERTION(aContent->IsHTML(),
|
||||
NS_ASSERTION(aContent->IsNodeOfType(nsINode::eHTML),
|
||||
"Only use this function with HTML elements");
|
||||
NS_ASSERTION(aState, "null arg in IsHTMLLink");
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ nsSVGDisplayContainerFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspac
|
|||
// nsSVGGlyphFrame's mContent is a nsTextNode!
|
||||
if (kid->GetType() != nsGkAtoms::svgGlyphFrame) {
|
||||
nsIContent *content = kid->GetContent();
|
||||
if (content->IsSVG()) {
|
||||
if (content->IsNodeOfType(nsINode::eSVG)) {
|
||||
transform = static_cast<nsSVGElement*>(content)->
|
||||
PrependLocalTransformTo(aToBBoxUserspace);
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ nsSVGSwitchFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace)
|
|||
if (svgKid) {
|
||||
nsIContent *content = kid->GetContent();
|
||||
gfxMatrix transform = aToBBoxUserspace;
|
||||
if (content->IsSVG()) {
|
||||
if (content->IsNodeOfType(nsINode::eSVG)) {
|
||||
transform = static_cast<nsSVGElement*>(content)->
|
||||
PrependLocalTransformTo(aToBBoxUserspace);
|
||||
}
|
||||
|
|
|
@ -670,7 +670,7 @@ nsIBox::AddCSSPrefSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)
|
|||
// ignore 'height' and 'width' attributes if the actual element is not XUL
|
||||
// For example, we might be magic XUL frames whose primary content is an HTML
|
||||
// <select>
|
||||
if (content && content->IsXUL()) {
|
||||
if (content && content->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsAutoString value;
|
||||
PRInt32 error;
|
||||
|
||||
|
|
|
@ -1220,7 +1220,7 @@ nsListBoxBodyFrame::GetNextItemBox(nsIBox* aBox, PRInt32 aOffset,
|
|||
// There is a content node that wants a frame.
|
||||
nsIContent *nextContent = parentContent->GetChildAt(i + aOffset + 1);
|
||||
|
||||
if (!nextContent->IsXUL() ||
|
||||
if (!nextContent->IsNodeOfType(nsINode::eXUL) ||
|
||||
nextContent->Tag() != nsGkAtoms::listitem)
|
||||
return GetNextItemBox(aBox, ++aOffset, aCreated);
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ nsTreeBodyFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
|
|||
desiredRows = 0;
|
||||
}
|
||||
else if (baseElement->Tag() == nsGkAtoms::select &&
|
||||
baseElement->IsHTML()) {
|
||||
baseElement->IsNodeOfType(nsINode::eHTML)) {
|
||||
min.width = CalcMaxRowWidth();
|
||||
nsAutoString size;
|
||||
baseElement->GetAttr(kNameSpaceID_None, nsGkAtoms::size, size);
|
||||
|
@ -1824,7 +1824,7 @@ nsTreeBodyFrame::MarkDirtyIfSelect()
|
|||
nsIContent* baseElement = GetBaseElement();
|
||||
|
||||
if (baseElement && baseElement->Tag() == nsGkAtoms::select &&
|
||||
baseElement->IsHTML()) {
|
||||
baseElement->IsNodeOfType(nsINode::eHTML)) {
|
||||
// If we are an intrinsically sized select widget, we may need to
|
||||
// resize, if the widest item was removed or a new item was added.
|
||||
// XXX optimize this more
|
||||
|
@ -4303,7 +4303,7 @@ nsTreeBodyFrame::GetBaseElement()
|
|||
|
||||
if (ni->Equals(nsGkAtoms::tree, kNameSpaceID_XUL) ||
|
||||
(ni->Equals(nsGkAtoms::select) &&
|
||||
content->IsHTML()))
|
||||
content->IsNodeOfType(nsINode::eHTML)))
|
||||
return content;
|
||||
}
|
||||
|
||||
|
|
|
@ -517,18 +517,18 @@ nsTreeContentView::GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsAString& _re
|
|||
|
||||
nsIAtom *rowTag = row->mContent->Tag();
|
||||
if (rowTag == nsGkAtoms::option &&
|
||||
row->mContent->IsHTML()) {
|
||||
row->mContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
// Use the text node child as the label
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> elem = do_QueryInterface(row->mContent);
|
||||
elem->GetText(_retval);
|
||||
}
|
||||
else if (rowTag == nsGkAtoms::optgroup &&
|
||||
row->mContent->IsHTML()) {
|
||||
row->mContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsCOMPtr<nsIDOMHTMLOptGroupElement> elem = do_QueryInterface(row->mContent);
|
||||
elem->GetLabel(_retval);
|
||||
}
|
||||
else if (rowTag == nsGkAtoms::treeitem &&
|
||||
row->mContent->IsXUL()) {
|
||||
row->mContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
nsIContent* realRow =
|
||||
nsTreeUtils::GetImmediateChild(row->mContent, nsGkAtoms::treerow);
|
||||
if (realRow) {
|
||||
|
@ -588,7 +588,7 @@ nsTreeContentView::ToggleOpenState(PRInt32 aIndex)
|
|||
Row* row = mRows[aIndex];
|
||||
|
||||
if (row->mContent->Tag() == nsGkAtoms::optgroup &&
|
||||
row->mContent->IsHTML()) {
|
||||
row->mContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
// we don't use an attribute for optgroup's open state
|
||||
if (row->IsOpen())
|
||||
CloseContainer(aIndex);
|
||||
|
@ -794,7 +794,7 @@ nsTreeContentView::ContentStatesChanged(nsIDocument* aDocument,
|
|||
PRInt32 aStateMask)
|
||||
{
|
||||
if (!aContent1 || !mSelection ||
|
||||
!aContent1->IsHTML() ||
|
||||
!aContent1->IsNodeOfType(nsINode::eHTML) ||
|
||||
!(aStateMask & NS_EVENT_STATE_CHECKED))
|
||||
return;
|
||||
|
||||
|
@ -823,7 +823,7 @@ nsTreeContentView::AttributeChanged(nsIDocument *aDocument,
|
|||
mBoxObject->Invalidate();
|
||||
}
|
||||
|
||||
if (aContent->IsXUL()) {
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tag != nsGkAtoms::treecol &&
|
||||
tag != nsGkAtoms::treeitem &&
|
||||
tag != nsGkAtoms::treeseparator &&
|
||||
|
@ -842,8 +842,8 @@ nsTreeContentView::AttributeChanged(nsIDocument *aDocument,
|
|||
if (!element)
|
||||
return; // this is not for us
|
||||
nsIAtom *parentTag = element->Tag();
|
||||
if ((element->IsXUL() && parentTag == nsGkAtoms::tree) ||
|
||||
(element->IsHTML() && parentTag == nsGkAtoms::select))
|
||||
if ((element->IsNodeOfType(nsINode::eXUL) && parentTag == nsGkAtoms::tree) ||
|
||||
(element->IsNodeOfType(nsINode::eHTML) && parentTag == nsGkAtoms::select))
|
||||
return; // this is not for us
|
||||
}
|
||||
|
||||
|
@ -984,12 +984,12 @@ nsTreeContentView::ContentInserted(nsIDocument *aDocument,
|
|||
// First check the tag to see if it's one that we care about.
|
||||
nsIAtom *childTag = aChild->Tag();
|
||||
|
||||
if (aChild->IsHTML()) {
|
||||
if (aChild->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (childTag != nsGkAtoms::option &&
|
||||
childTag != nsGkAtoms::optgroup)
|
||||
return;
|
||||
}
|
||||
else if (aChild->IsXUL()) {
|
||||
else if (aChild->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (childTag != nsGkAtoms::treeitem &&
|
||||
childTag != nsGkAtoms::treeseparator &&
|
||||
childTag != nsGkAtoms::treechildren &&
|
||||
|
@ -1008,8 +1008,8 @@ nsTreeContentView::ContentInserted(nsIDocument *aDocument,
|
|||
if (!element)
|
||||
return; // this is not for us
|
||||
nsIAtom *parentTag = element->Tag();
|
||||
if ((element->IsXUL() && parentTag == nsGkAtoms::tree) ||
|
||||
(element->IsHTML() && parentTag == nsGkAtoms::select))
|
||||
if ((element->IsNodeOfType(nsINode::eXUL) && parentTag == nsGkAtoms::tree) ||
|
||||
(element->IsNodeOfType(nsINode::eHTML) && parentTag == nsGkAtoms::select))
|
||||
return; // this is not for us
|
||||
}
|
||||
|
||||
|
@ -1067,12 +1067,12 @@ nsTreeContentView::ContentRemoved(nsIDocument *aDocument,
|
|||
// First check the tag to see if it's one that we care about.
|
||||
nsIAtom *tag = aChild->Tag();
|
||||
|
||||
if (aChild->IsHTML()) {
|
||||
if (aChild->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (tag != nsGkAtoms::option &&
|
||||
tag != nsGkAtoms::optgroup)
|
||||
return;
|
||||
}
|
||||
else if (aChild->IsXUL()) {
|
||||
else if (aChild->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tag != nsGkAtoms::treeitem &&
|
||||
tag != nsGkAtoms::treeseparator &&
|
||||
tag != nsGkAtoms::treechildren &&
|
||||
|
@ -1091,8 +1091,8 @@ nsTreeContentView::ContentRemoved(nsIDocument *aDocument,
|
|||
if (!element)
|
||||
return; // this is not for us
|
||||
nsIAtom *parentTag = element->Tag();
|
||||
if ((element->IsXUL() && parentTag == nsGkAtoms::tree) ||
|
||||
(element->IsHTML() && parentTag == nsGkAtoms::select))
|
||||
if ((element->IsNodeOfType(nsINode::eXUL) && parentTag == nsGkAtoms::tree) ||
|
||||
(element->IsNodeOfType(nsINode::eHTML) && parentTag == nsGkAtoms::select))
|
||||
return; // this is not for us
|
||||
}
|
||||
|
||||
|
@ -1154,13 +1154,13 @@ nsTreeContentView::Serialize(nsIContent* aContent, PRInt32 aParentIndex,
|
|||
nsIAtom *tag = content->Tag();
|
||||
PRInt32 count = aRows.Length();
|
||||
|
||||
if (content->IsXUL()) {
|
||||
if (content->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tag == nsGkAtoms::treeitem)
|
||||
SerializeItem(content, aParentIndex, aIndex, aRows);
|
||||
else if (tag == nsGkAtoms::treeseparator)
|
||||
SerializeSeparator(content, aParentIndex, aIndex, aRows);
|
||||
}
|
||||
else if (content->IsHTML()) {
|
||||
else if (content->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (tag == nsGkAtoms::option)
|
||||
SerializeOption(content, aParentIndex, aIndex, aRows);
|
||||
else if (tag == nsGkAtoms::optgroup)
|
||||
|
@ -1271,7 +1271,7 @@ nsTreeContentView::GetIndexInSubtree(nsIContent* aContainer,
|
|||
|
||||
nsIAtom *tag = content->Tag();
|
||||
|
||||
if (content->IsXUL()) {
|
||||
if (content->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tag == nsGkAtoms::treeitem) {
|
||||
if (! content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
|
||||
nsGkAtoms::_true, eCaseMatters)) {
|
||||
|
@ -1293,7 +1293,7 @@ nsTreeContentView::GetIndexInSubtree(nsIContent* aContainer,
|
|||
(*aIndex)++;
|
||||
}
|
||||
}
|
||||
else if (content->IsHTML()) {
|
||||
else if (content->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (tag == nsGkAtoms::optgroup) {
|
||||
(*aIndex)++;
|
||||
GetIndexInSubtree(content, aContent, aIndex);
|
||||
|
@ -1365,8 +1365,8 @@ nsTreeContentView::InsertRowFor(nsIContent* aParent, nsIContent* aChild)
|
|||
nsCOMPtr<nsIContent> grandParent = aParent->GetParent();
|
||||
nsIAtom* grandParentTag = grandParent->Tag();
|
||||
|
||||
if ((grandParent->IsXUL() && grandParentTag == nsGkAtoms::tree) ||
|
||||
(grandParent->IsHTML() && grandParentTag == nsGkAtoms::select)
|
||||
if ((grandParent->IsNodeOfType(nsINode::eXUL) && grandParentTag == nsGkAtoms::tree) ||
|
||||
(grandParent->IsNodeOfType(nsINode::eHTML) && grandParentTag == nsGkAtoms::select)
|
||||
) {
|
||||
// Allow insertion to the outermost container.
|
||||
insertRow = PR_TRUE;
|
||||
|
@ -1399,13 +1399,13 @@ nsTreeContentView::InsertRow(PRInt32 aParentIndex, PRInt32 aIndex, nsIContent* a
|
|||
{
|
||||
nsAutoTArray<Row*, 8> rows;
|
||||
nsIAtom *tag = aContent->Tag();
|
||||
if (aContent->IsXUL()) {
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tag == nsGkAtoms::treeitem)
|
||||
SerializeItem(aContent, aParentIndex, &aIndex, rows);
|
||||
else if (tag == nsGkAtoms::treeseparator)
|
||||
SerializeSeparator(aContent, aParentIndex, &aIndex, rows);
|
||||
}
|
||||
else if (aContent->IsHTML()) {
|
||||
else if (aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (tag == nsGkAtoms::option)
|
||||
SerializeOption(aContent, aParentIndex, &aIndex, rows);
|
||||
else if (tag == nsGkAtoms::optgroup)
|
||||
|
|
|
@ -831,7 +831,7 @@ nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange,
|
|||
// Keep testing while startContent is equal to something,
|
||||
// eventually we'll run out of ancestors
|
||||
|
||||
if (startContent->IsHTML()) {
|
||||
if (startContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsCOMPtr<nsILink> link(do_QueryInterface(startContent));
|
||||
if (link) {
|
||||
// Check to see if inside HTML link
|
||||
|
|
|
@ -120,12 +120,12 @@ nsNativeThemeGTK::RefreshWidgetWindow(nsIFrame* aFrame)
|
|||
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
|
||||
}
|
||||
|
||||
static PRBool IsFrameContentNodeInNamespace(nsIFrame *aFrame, PRUint32 aNamespace)
|
||||
static PRBool IsFrameContentNodeOfType(nsIFrame *aFrame, PRUint32 aFlags)
|
||||
{
|
||||
nsIContent *content = aFrame ? aFrame->GetContent() : nsnull;
|
||||
if (!content)
|
||||
return false;
|
||||
return content->IsInNamespace(aNamespace);
|
||||
return content->IsNodeOfType(aFlags);
|
||||
}
|
||||
|
||||
static PRBool IsWidgetTypeDisabled(PRUint8* aDisabledVector, PRUint8 aWidgetType) {
|
||||
|
@ -199,7 +199,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame,
|
|||
aWidgetType == NS_THEME_RADIO_LABEL)) {
|
||||
|
||||
nsIAtom* atom = nsnull;
|
||||
if (IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XUL)) {
|
||||
if (IsFrameContentNodeOfType(aFrame, nsINode::eXUL)) {
|
||||
if (aWidgetType == NS_THEME_CHECKBOX_LABEL ||
|
||||
aWidgetType == NS_THEME_RADIO_LABEL) {
|
||||
// Adjust stateFrame so GetContentState finds the correct state.
|
||||
|
@ -247,7 +247,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame,
|
|||
aState->canDefault = FALSE; // XXX fix me
|
||||
aState->depressed = FALSE;
|
||||
|
||||
if (IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XUL)) {
|
||||
if (IsFrameContentNodeOfType(aFrame, nsINode::eXUL)) {
|
||||
// For these widget types, some element (either a child or parent)
|
||||
// actually has element focus, so we check the focused attribute
|
||||
// to see whether to draw in the focused state.
|
||||
|
@ -496,7 +496,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame,
|
|||
case NS_THEME_DROPDOWN:
|
||||
aGtkWidgetType = MOZ_GTK_DROPDOWN;
|
||||
if (aWidgetFlags)
|
||||
*aWidgetFlags = IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XHTML);
|
||||
*aWidgetFlags = IsFrameContentNodeOfType(aFrame, nsINode::eHTML);
|
||||
break;
|
||||
case NS_THEME_DROPDOWN_TEXT:
|
||||
return PR_FALSE; // nothing to do, but prevents the bg from being drawn
|
||||
|
@ -871,7 +871,7 @@ nsNativeThemeGTK::GetWidgetBorder(nsIDeviceContext* aContext, nsIFrame* aFrame,
|
|||
nsnull))
|
||||
moz_gtk_get_widget_border(gtkWidgetType, &aResult->left, &aResult->top,
|
||||
&aResult->right, &aResult->bottom, direction,
|
||||
IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XHTML));
|
||||
IsFrameContentNodeOfType(aFrame, nsINode::eHTML));
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1304,7 +1304,7 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
|||
case NS_THEME_DROPDOWN_BUTTON:
|
||||
// "Native" dropdown buttons cause padding and margin problems, but only
|
||||
// in HTML so allow them in XUL.
|
||||
return (!aFrame || IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XUL)) &&
|
||||
return (!aFrame || IsFrameContentNodeOfType(aFrame, nsINode::eXUL)) &&
|
||||
!IsWidgetStyled(aPresContext, aFrame, aWidgetType);
|
||||
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ GetViewportOrgEx(HDC hdc, LPPOINT lpPoint)
|
|||
static inline bool IsHTMLContent(nsIFrame *frame)
|
||||
{
|
||||
nsIContent* content = frame->GetContent();
|
||||
return content && content->IsHTML();
|
||||
return content && content->IsNodeOfType(nsINode::eHTML);
|
||||
}
|
||||
|
||||
nsNativeThemeWin::nsNativeThemeWin() {
|
||||
|
@ -390,7 +390,7 @@ PRBool
|
|||
nsNativeThemeWin::IsMenuActive(nsIFrame *aFrame, PRUint8 aWidgetType)
|
||||
{
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (content->IsXUL() &&
|
||||
if (content->IsNodeOfType(nsINode::eXUL) &&
|
||||
content->NodeInfo()->Equals(nsWidgetAtoms::richlistitem))
|
||||
return CheckBooleanAttr(aFrame, nsWidgetAtoms::selected);
|
||||
|
||||
|
@ -497,7 +497,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
|
|||
/* XUL textboxes don't get focused themselves, because they have child
|
||||
* html:input.. but we can check the XUL focused attributes on them
|
||||
*/
|
||||
if (content && content->IsXUL() && IsFocused(aFrame))
|
||||
if (content && content->IsNodeOfType(nsINode::eXUL) && IsFocused(aFrame))
|
||||
aState = TFS_EDITBORDER_FOCUSED;
|
||||
else if (eventState & NS_EVENT_STATE_ACTIVE || eventState & NS_EVENT_STATE_FOCUS)
|
||||
aState = TFS_EDITBORDER_FOCUSED;
|
||||
|
@ -778,7 +778,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
|
|||
}
|
||||
case NS_THEME_DROPDOWN: {
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
PRBool isHTML = content && content->IsHTML();
|
||||
PRBool isHTML = content && content->IsNodeOfType(nsINode::eHTML);
|
||||
|
||||
/* On vista, in HTML, we use CBP_DROPBORDER instead of DROPFRAME for HTML content;
|
||||
* this gives us the thin outline in HTML content, instead of the gradient-filled
|
||||
|
@ -1187,7 +1187,7 @@ RENDER_AGAIN:
|
|||
// Draw focus rectangles for XP HTML checkboxes and radio buttons
|
||||
// XXX it'd be nice to draw these outside of the frame
|
||||
if ((aWidgetType == NS_THEME_CHECKBOX || aWidgetType == NS_THEME_RADIO) &&
|
||||
aFrame->GetContent()->IsHTML() ||
|
||||
aFrame->GetContent()->IsNodeOfType(nsINode::eHTML) ||
|
||||
aWidgetType == NS_THEME_SCALE_HORIZONTAL ||
|
||||
aWidgetType == NS_THEME_SCALE_VERTICAL) {
|
||||
PRInt32 contentState;
|
||||
|
@ -1350,7 +1350,7 @@ nsNativeThemeWin::GetWidgetBorder(nsIDeviceContext* aContext,
|
|||
|
||||
if (aFrame && (aWidgetType == NS_THEME_TEXTFIELD || aWidgetType == NS_THEME_TEXTFIELD_MULTILINE)) {
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (content && content->IsHTML()) {
|
||||
if (content && content->IsNodeOfType(nsINode::eHTML)) {
|
||||
// We need to pad textfields by 1 pixel, since the caret will draw
|
||||
// flush against the edge by default if we don't.
|
||||
aResult->top++;
|
||||
|
@ -1632,7 +1632,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame*
|
|||
// GetPreferredWidgetSize from GetMinimumWidgetSize, so callers can
|
||||
// use the one they want.
|
||||
if (aWidgetType == NS_THEME_BUTTON &&
|
||||
aFrame->GetContent()->IsHTML())
|
||||
aFrame->GetContent()->IsNodeOfType(nsINode::eHTML))
|
||||
sizeReq = 0; /* TS_MIN */
|
||||
|
||||
SIZE sz;
|
||||
|
@ -2083,7 +2083,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8
|
|||
// The down state is flat if the button is focusable
|
||||
if (uiData->mUserFocus == NS_STYLE_USER_FOCUS_NORMAL) {
|
||||
#ifndef WINCE
|
||||
if (!aFrame->GetContent()->IsHTML())
|
||||
if (!aFrame->GetContent()->IsNodeOfType(nsINode::eHTML))
|
||||
aState |= DFCS_FLAT;
|
||||
#endif
|
||||
aFocused = PR_TRUE;
|
||||
|
@ -2125,7 +2125,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8
|
|||
}
|
||||
|
||||
contentState = GetContentState(aFrame, aWidgetType);
|
||||
if (!content->IsXUL() &&
|
||||
if (!content->IsNodeOfType(nsINode::eXUL) &&
|
||||
(contentState & NS_EVENT_STATE_FOCUS)) {
|
||||
aFocused = PR_TRUE;
|
||||
}
|
||||
|
@ -2604,7 +2604,7 @@ RENDER_AGAIN:
|
|||
|
||||
// Fill in background
|
||||
if (IsDisabled(aFrame) ||
|
||||
(aFrame->GetContent()->IsXUL() &&
|
||||
(aFrame->GetContent()->IsNodeOfType(nsINode::eXUL) &&
|
||||
IsReadOnly(aFrame)))
|
||||
::FillRect(hdc, &widgetRect, (HBRUSH) (COLOR_BTNFACE+1));
|
||||
else
|
||||
|
|
|
@ -77,7 +77,7 @@ nsNativeTheme::GetContentState(nsIFrame* aFrame, PRUint8 aWidgetType)
|
|||
PRBool isXULCheckboxRadio =
|
||||
(aWidgetType == NS_THEME_CHECKBOX ||
|
||||
aWidgetType == NS_THEME_RADIO) &&
|
||||
aFrame->GetContent()->IsXUL();
|
||||
aFrame->GetContent()->IsNodeOfType(nsINode::eXUL);
|
||||
if (isXULCheckboxRadio)
|
||||
aFrame = aFrame->GetParent();
|
||||
|
||||
|
@ -109,7 +109,7 @@ nsNativeTheme::CheckBooleanAttr(nsIFrame* aFrame, nsIAtom* aAtom)
|
|||
if (!content)
|
||||
return PR_FALSE;
|
||||
|
||||
if (content->IsHTML())
|
||||
if (content->IsNodeOfType(nsINode::eHTML))
|
||||
return content->HasAttr(kNameSpaceID_None, aAtom);
|
||||
|
||||
// For XML/XUL elements, an attribute must be equal to the literal
|
||||
|
@ -142,7 +142,7 @@ nsNativeTheme::GetCheckedOrSelected(nsIFrame* aFrame, PRBool aCheckSelected)
|
|||
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
|
||||
if (content->IsXUL()) {
|
||||
if (content->IsNodeOfType(nsINode::eXUL)) {
|
||||
// For a XUL checkbox or radio button, the state of the parent determines
|
||||
// the checked state
|
||||
aFrame = aFrame->GetParent();
|
||||
|
@ -179,7 +179,7 @@ nsNativeTheme::GetIndeterminate(nsIFrame* aFrame)
|
|||
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
|
||||
if (content->IsXUL()) {
|
||||
if (content->IsNodeOfType(nsINode::eXUL)) {
|
||||
// For a XUL checkbox or radio button, the state of the parent determines
|
||||
// the state
|
||||
return CheckBooleanAttr(aFrame->GetParent(), nsWidgetAtoms::indeterminate);
|
||||
|
@ -207,7 +207,7 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
|
|||
aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
|
||||
aWidgetType == NS_THEME_LISTBOX ||
|
||||
aWidgetType == NS_THEME_DROPDOWN) &&
|
||||
aFrame->GetContent()->IsHTML() &&
|
||||
aFrame->GetContent()->IsNodeOfType(nsINode::eHTML) &&
|
||||
aPresContext->HasAuthorSpecifiedRules(aFrame,
|
||||
NS_AUTHOR_SPECIFIED_BORDER |
|
||||
NS_AUTHOR_SPECIFIED_BACKGROUND);
|
||||
|
|
Загрузка…
Ссылка в новой задаче