diff --git a/mozilla/accessible/src/base/nsAccessibilityService.cpp b/mozilla/accessible/src/base/nsAccessibilityService.cpp index 58a15c2e783..4a2ad339971 100644 --- a/mozilla/accessible/src/base/nsAccessibilityService.cpp +++ b/mozilla/accessible/src/base/nsAccessibilityService.cpp @@ -1819,7 +1819,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode, #ifdef DEBUG_aleventhal_ // Frame hint debugging ++frameHintFailed; - if (content->IsContentOfType(nsIContent::eTEXT)) { + if (content->IsNodeOfType(nsINode::eTEXT)) { ++frameHintFailedForText; } frameHintNonexistant += !*aFrameHint; @@ -1868,7 +1868,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode, /** * Attempt to create an accessible based on what we know */ - if (content->IsContentOfType(nsIContent::eTEXT)) { + if (content->IsNodeOfType(nsINode::eTEXT)) { // --- Create HTML for visible text frames --- if (frame->IsEmpty()) { *aIsHidden = PR_TRUE; @@ -1876,7 +1876,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode, } frame->GetAccessible(getter_AddRefs(newAcc)); } - else if (!content->IsContentOfType(nsIContent::eHTML)) { + else if (!content->IsNodeOfType(nsINode::eHTML)) { // --- Try creating accessible non-HTML (XUL, etc.) --- // XUL elements may implement nsIAccessibleProvider via XBL // This allows them to say what kind of accessible to create diff --git a/mozilla/accessible/src/base/nsAccessible.cpp b/mozilla/accessible/src/base/nsAccessible.cpp index 830d14623cf..3820cbee890 100644 --- a/mozilla/accessible/src/base/nsAccessible.cpp +++ b/mozilla/accessible/src/base/nsAccessible.cpp @@ -191,11 +191,11 @@ NS_IMETHODIMP nsAccessible::GetName(nsAString& aName) PRBool canAggregateName = mRoleMapEntry && mRoleMapEntry->nameRule == eNameOkFromChildren; - if (content->IsContentOfType(nsIContent::eHTML)) { + if (content->IsNodeOfType(nsINode::eHTML)) { return GetHTMLName(aName, canAggregateName); } - if (content->IsContentOfType(nsIContent::eXUL)) { + if (content->IsNodeOfType(nsINode::eXUL)) { return GetXULName(aName, canAggregateName); } @@ -213,14 +213,14 @@ NS_IMETHODIMP nsAccessible::GetDescription(nsAString& aDescription) if (!content) { return NS_ERROR_FAILURE; // Node shut down } - if (!content->IsContentOfType(nsIContent::eTEXT)) { + if (!content->IsNodeOfType(nsINode::eTEXT)) { nsAutoString description; if (content->HasAttr(kNameSpaceID_XHTML2_Unofficial, nsAccessibilityAtoms::role)) { GetTextFromRelationID(nsAccessibilityAtoms::describedby, description); } if (description.IsEmpty()) { - PRBool isXUL = content->IsContentOfType(nsIContent::eXUL); + PRBool isXUL = content->IsNodeOfType(nsINode::eXUL); if (isXUL) { // Try XUL description text nsIContent *descriptionContent = @@ -745,7 +745,7 @@ NS_IMETHODIMP nsAccessible::GetState(PRUint32 *aState) // if someone sets it on another attribute, // it seems reasonable to consider it unavailable PRBool isDisabled; - if (content->IsContentOfType(nsIContent::eHTML)) { + 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); @@ -759,7 +759,7 @@ NS_IMETHODIMP nsAccessible::GetState(PRUint32 *aState) if (isDisabled) { *aState |= STATE_UNAVAILABLE; } - else if (content->IsContentOfType(nsIContent::eELEMENT)) { + else if (content->IsNodeOfType(nsINode::eELEMENT)) { if (!content->HasAttr(kNameSpaceID_XHTML2_Unofficial, nsAccessibilityAtoms::role)) { // Default state for element accessible is focusable unless role is manually set @@ -1209,7 +1209,7 @@ nsresult nsAccessible::AppendNameFromAccessibleFor(nsIContent *aContent, nsresult nsAccessible::AppendFlatStringFromContentNode(nsIContent *aContent, nsAString *aFlatString) { - if (aContent->IsContentOfType(nsIContent::eTEXT)) { + if (aContent->IsNodeOfType(nsINode::eTEXT)) { nsCOMPtr textContent(do_QueryInterface(aContent)); NS_ASSERTION(textContent, "No text content for text content type"); // If it's a text node, append the text @@ -1249,8 +1249,8 @@ nsresult nsAccessible::AppendFlatStringFromContentNode(nsIContent *aContent, nsA } nsAutoString textEquivalent; - if (!aContent->IsContentOfType(nsIContent::eHTML)) { - if (aContent->IsContentOfType(nsIContent::eXUL)) { + if (!aContent->IsNodeOfType(nsINode::eHTML)) { + if (aContent->IsNodeOfType(nsINode::eXUL)) { nsCOMPtr shell = GetPresShell(); if (!shell) { return NS_ERROR_FAILURE; @@ -1347,8 +1347,8 @@ nsresult nsAccessible::AppendFlatStringFromSubtreeRecurse(nsIContent *aContent, nsIContent *nsAccessible::GetLabelContent(nsIContent *aForNode) { - return aForNode->IsContentOfType(nsIContent::eXUL) ? GetXULLabelContent(aForNode) : - GetHTMLLabelContent(aForNode); + return aForNode->IsNodeOfType(nsINode::eXUL) ? GetXULLabelContent(aForNode) : + GetHTMLLabelContent(aForNode); } nsIContent* nsAccessible::GetXULLabelContent(nsIContent *aForNode, nsIAtom *aLabelType) @@ -1950,7 +1950,7 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce case RELATION_LABEL_FOR: { if (content->Tag() == nsAccessibilityAtoms::label) { - nsIAtom *relatedIDAttr = content->IsContentOfType(nsIContent::eHTML) ? + nsIAtom *relatedIDAttr = content->IsNodeOfType(nsINode::eHTML) ? nsAccessibilityAtoms::_for : nsAccessibilityAtoms::control; content->GetAttr(kNameSpaceID_None, relatedIDAttr, relatedID); if (relatedID.IsEmpty()) { @@ -1997,7 +1997,7 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce nsIContent *description = GetXULLabelContent(content, nsAccessibilityAtoms::description); if (!relatedNode && content->Tag() == nsAccessibilityAtoms::description && - content->IsContentOfType(nsIContent::eXUL)) { + 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. @@ -2008,7 +2008,7 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce } case RELATION_DEFAULT_BUTTON: { - if (content->IsContentOfType(nsIContent::eHTML)) { + if (content->IsNodeOfType(nsINode::eHTML)) { nsCOMPtr form; while ((form = do_QueryInterface(content)) == nsnull && (content = content->GetParent()) != nsnull) /* nothing */ ; diff --git a/mozilla/accessible/src/base/nsAccessibleTreeWalker.cpp b/mozilla/accessible/src/base/nsAccessibleTreeWalker.cpp index bfbc9891146..3f485e9daa0 100755 --- a/mozilla/accessible/src/base/nsAccessibleTreeWalker.cpp +++ b/mozilla/accessible/src/base/nsAccessibleTreeWalker.cpp @@ -107,7 +107,7 @@ NS_IMETHODIMP nsAccessibleTreeWalker::GetFullTreeParentNode(nsIDOMNode *aChildNo void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode) { nsCOMPtr parentContent(do_QueryInterface(aParentNode)); - if (!parentContent || !parentContent->IsContentOfType(nsIContent::eHTML)) { + if (!parentContent || !parentContent->IsNodeOfType(nsINode::eHTML)) { mState.frame = nsnull; // Don't walk frames in non-HTML content, just walk the DOM. } @@ -122,7 +122,7 @@ void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode) // Walk anonymous content? Not currently used for HTML -- anonymous content there uses frame walking mState.siblingIndex = 0; // Indicates our index into the sibling list if (parentContent) { - if (mBindingManager && !parentContent->IsContentOfType(nsIContent::eHTML)) { + if (mBindingManager && !parentContent->IsNodeOfType(nsINode::eHTML)) { // Walk anonymous content mBindingManager->GetXBLChildNodesFor(parentContent, getter_AddRefs(mState.siblingList)); // returns null if no anon nodes } diff --git a/mozilla/accessible/src/base/nsRootAccessible.cpp b/mozilla/accessible/src/base/nsRootAccessible.cpp index 5457969ab49..703b526704c 100644 --- a/mozilla/accessible/src/base/nsRootAccessible.cpp +++ b/mozilla/accessible/src/base/nsRootAccessible.cpp @@ -870,7 +870,7 @@ void nsRootAccessible::GetTargetNode(nsIDOMEvent *aEvent, nsIDOMNode **aTargetNo nsevent->GetOriginalTarget(getter_AddRefs(domEventTarget)); nsCOMPtr content(do_QueryInterface(domEventTarget)); nsIContent *bindingParent; - if (content && content->IsContentOfType(nsIContent::eHTML) && + if (content && content->IsNodeOfType(nsINode::eHTML) && (bindingParent = content->GetBindingParent()) != nsnull) { // Use binding parent when the event occurs in // anonymous HTML content. diff --git a/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp index e41a4454425..b33914b62c3 100644 --- a/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp @@ -382,7 +382,7 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIAccessibilityService *aAccServic for (PRUint32 count = 0; count < numChildren; count ++) { nsIContent *childContent = aParentContent->GetChildAt(count); - if (!childContent->IsContentOfType(nsIContent::eHTML)) { + if (!childContent->IsNodeOfType(nsINode::eHTML)) { continue; } nsCOMPtr tag = childContent->Tag(); @@ -712,7 +712,7 @@ nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIDOMNode *aListNod void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibleOption) { if (!aPossibleOption || aPossibleOption->Tag() != nsAccessibilityAtoms::option || - !aPossibleOption->IsContentOfType(nsIContent::eHTML)) { + !aPossibleOption->IsNodeOfType(nsINode::eHTML)) { return; } diff --git a/mozilla/accessible/src/msaa/nsAccessNodeWrap.cpp b/mozilla/accessible/src/msaa/nsAccessNodeWrap.cpp index 388774c2bce..0ffcde4cdfb 100644 --- a/mozilla/accessible/src/msaa/nsAccessNodeWrap.cpp +++ b/mozilla/accessible/src/msaa/nsAccessNodeWrap.cpp @@ -257,7 +257,7 @@ NS_IMETHODIMP nsAccessNodeWrap::GetComputedStyleDeclaration(nsIDOMCSSStyleDeclar if (!content) return NS_ERROR_FAILURE; - if (content->IsContentOfType(nsIContent::eTEXT)) { + if (content->IsNodeOfType(nsINode::eTEXT)) { content = content->GetParent(); NS_ASSERTION(content, "No parent for text node"); } diff --git a/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp b/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp index 0702f3cae03..5709f2ff625 100644 --- a/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp @@ -446,7 +446,7 @@ STDMETHODIMP nsAccessibleWrap::get_accRole( accessNode->GetDOMNode(getter_AddRefs(domNode)); nsIContent *content = GetRoleContent(domNode); NS_ASSERTION(content, "No content for accessible"); - if (content && content->IsContentOfType(nsIContent::eELEMENT)) { + if (content && content->IsNodeOfType(nsINode::eELEMENT)) { nsAutoString roleString; if (role != ROLE_CLIENT) { content->GetAttr(kNameSpaceID_XHTML2_Unofficial, nsAccessibilityAtoms::role, roleString); diff --git a/mozilla/content/base/public/nsIContent.h b/mozilla/content/base/public/nsIContent.h index e4c8f3cb0e9..f70f646ee1d 100644 --- a/mozilla/content/base/public/nsIContent.h +++ b/mozilla/content/base/public/nsIContent.h @@ -61,8 +61,8 @@ class nsAttrName; // IID for the nsIContent interface #define NS_ICONTENT_IID \ -{ 0xf967b2d6, 0xa81c, 0x492c, \ - { 0x91, 0x4b, 0x53, 0x8c, 0x0c, 0x19, 0x37, 0x8c } } +{ 0x26e42639, 0x013b, 0x442a, \ + { 0xbe, 0xa0, 0x31, 0xad, 0x43, 0x33, 0x6f, 0x79 } } /** * A node of content in a document's content model. This interface @@ -506,39 +506,6 @@ public: */ virtual nsIContent *GetBindingParent() const = 0; - /** - * Bit-flags to pass (or'ed together) to IsContentOfType() - */ - enum { - /** text elements */ - eTEXT = 0x00000001, - /** dom elements */ - eELEMENT = 0x00000002, - /** html elements */ - eHTML = 0x00000004, - /** form controls */ - eHTML_FORM_CONTROL = 0x00000008, - /** XUL elements */ - eXUL = 0x00000010, - /** xml processing instructions */ - ePROCESSING_INSTRUCTION = 0x00000020, - /** svg elements */ - eSVG = 0x00000040, - /** comment nodes */ - eCOMMENT = 0x00000080 - }; - - /** - * API for doing a quick check if a content object is of a given - * 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, eTEXT, eELEMENT, - * eHTML, eHTML_FORM_CONTROL, eXUL) - * @return whether the content matches ALL flags passed in - */ - virtual PRBool IsContentOfType(PRUint32 aFlags) const = 0; - /** * Get the event listener manager, the guy you talk to to register for events * on this element. diff --git a/mozilla/content/base/public/nsIDocument.h b/mozilla/content/base/public/nsIDocument.h index af2cc7b1b3b..ae9bd5fecbc 100644 --- a/mozilla/content/base/public/nsIDocument.h +++ b/mozilla/content/base/public/nsIDocument.h @@ -91,8 +91,8 @@ class nsIDocumentObserver; // IID for the nsIDocument interface #define NS_IDOCUMENT_IID \ -{ 0x726ce58e, 0x13ab, 0x4c91, \ - { 0x80, 0x45, 0xa8, 0x7b, 0xfe, 0xd5, 0xfe, 0xcd } } +{ 0x982d6716, 0xdb0b, 0x4bbf, \ + { 0xb7, 0x23, 0x81, 0x24, 0x6c, 0x10, 0xdb, 0xbd } } // Flag for AddStyleSheet(). diff --git a/mozilla/content/base/public/nsINode.h b/mozilla/content/base/public/nsINode.h index 049e3aa277c..748fdfded41 100644 --- a/mozilla/content/base/public/nsINode.h +++ b/mozilla/content/base/public/nsINode.h @@ -59,8 +59,8 @@ class nsIPrincipal; // IID for the nsINode interface // f96eef82-43fc-4eee-9784-4259415e98a9 #define NS_INODE_IID \ -{ 0xf96eef82, 0x43fc, 0x4eee, \ - { 0x97, 0x84, 0x42, 0x59, 0x41, 0x5e, 0x98, 0xa9 } } +{ 0x1418310f, 0x2151, 0x47b7, \ + { 0x9f, 0x4f, 0x4a, 0xc4, 0x95, 0x82, 0xfa, 0xc8 } } // hack to make egcs / gcc 2.95.2 happy class nsINode_base : public nsIDOMGCParticipant { @@ -85,6 +85,44 @@ public: { } + /** + * Bit-flags to pass (or'ed together) to IsNodeOfType() + */ + enum { + /** nsIContent nodes */ + eCONTENT = 1 << 0, + /** nsIDocument nodes */ + eDOCUMENT = 1 << 1, + /** nsIAttribute nodes */ + eATTRIBUTE = 1 << 2, + /** elements */ + eELEMENT = 1 << 3, + /** text nodes */ + eTEXT = 1 << 4, + /** xml processing instructions */ + ePROCESSING_INSTRUCTION = 1 << 5, + /** comment nodes */ + eCOMMENT = 1 << 6, + /** html elements */ + eHTML = 1 << 7, + /** form control elements */ + eHTML_FORM_CONTROL = 1 << 8, + /** XUL elements */ + eXUL = 1 << 9, + /** svg elements */ + eSVG = 1 << 10 + }; + + /** + * API for doing a quick check if a content object is of a given + * 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) + * @return whether the content matches ALL flags passed in + */ + virtual PRBool IsNodeOfType(PRUint32 aFlags) const = 0; + /** * Get the number of children * @return the number of children diff --git a/mozilla/content/base/src/mozSanitizingSerializer.cpp b/mozilla/content/base/src/mozSanitizingSerializer.cpp index 16d99a1a3c3..6b8bd3fe8cf 100644 --- a/mozilla/content/base/src/mozSanitizingSerializer.cpp +++ b/mozilla/content/base/src/mozSanitizingSerializer.cpp @@ -215,7 +215,7 @@ mozSanitizingHTMLSerializer::IsContainer(PRInt32 aId) PRInt32 mozSanitizingHTMLSerializer::GetIdForContent(nsIContent* aContent) { - if (!aContent->IsContentOfType(nsIContent::eHTML)) { + if (!aContent->IsNodeOfType(nsINode::eHTML)) { return eHTMLTag_unknown; } diff --git a/mozilla/content/base/src/nsCommentNode.cpp b/mozilla/content/base/src/nsCommentNode.cpp index aab49100c1e..661b90946cb 100644 --- a/mozilla/content/base/src/nsCommentNode.cpp +++ b/mozilla/content/base/src/nsCommentNode.cpp @@ -68,7 +68,7 @@ public: // nsIContent virtual PRBool MayHaveFrame() const; - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; #ifdef DEBUG virtual void List(FILE* out, PRInt32 aIndent) const; @@ -133,9 +133,9 @@ nsCommentNode::MayHaveFrame() const } PRBool -nsCommentNode::IsContentOfType(PRUint32 aFlags) const +nsCommentNode::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~eCOMMENT); + return !(aFlags & ~(eCONTENT | eCOMMENT)); } NS_IMETHODIMP diff --git a/mozilla/content/base/src/nsContentList.cpp b/mozilla/content/base/src/nsContentList.cpp index e0ade4112f8..155356b0d2c 100644 --- a/mozilla/content/base/src/nsContentList.cpp +++ b/mozilla/content/base/src/nsContentList.cpp @@ -710,7 +710,7 @@ nsContentList::Match(nsIContent *aContent) } if (mMatchAtom) { - if (!aContent->IsContentOfType(nsIContent::eELEMENT)) { + if (!aContent->IsNodeOfType(nsINode::eELEMENT)) { return PR_FALSE; } diff --git a/mozilla/content/base/src/nsContentUtils.cpp b/mozilla/content/base/src/nsContentUtils.cpp index 36fc62f1d31..2f3c5812cd8 100644 --- a/mozilla/content/base/src/nsContentUtils.cpp +++ b/mozilla/content/base/src/nsContentUtils.cpp @@ -791,7 +791,7 @@ nsContentUtils::InProlog(nsIDOMNode *aNode) while (pos > 0) { --pos; nsIContent *sibl = doc->GetChildAt(pos); - if (sibl->IsContentOfType(nsIContent::eELEMENT)) { + if (sibl->IsNodeOfType(nsINode::eELEMENT)) { return PR_FALSE; } } @@ -1738,7 +1738,7 @@ nsContentUtils::BelongsInForm(nsIDOMHTMLFormElement *aForm, } if (content->Tag() == nsHTMLAtoms::form && - content->IsContentOfType(nsIContent::eHTML)) { + content->IsNodeOfType(nsINode::eHTML)) { // The child is contained within a form, but not the right form // so we ignore it. @@ -2507,7 +2507,7 @@ nsContentUtils::ReportToConsole(PropertiesFile aFile, static PRBool MatchFormControls(nsIContent* aContent, PRInt32 aNamespaceID, nsIAtom* aAtom, const nsAString& aData) { - return aContent->IsContentOfType(nsIContent::eHTML_FORM_CONTROL); + return aContent->IsNodeOfType(nsINode::eHTML_FORM_CONTROL); } /* static */ already_AddRefed diff --git a/mozilla/content/base/src/nsCopySupport.cpp b/mozilla/content/base/src/nsCopySupport.cpp index 0c0e9f92bfe..453fadd2081 100644 --- a/mozilla/content/base/src/nsCopySupport.cpp +++ b/mozilla/content/base/src/nsCopySupport.cpp @@ -320,7 +320,7 @@ nsresult nsCopySupport::IsPlainTextContext(nsISelection *aSel, nsIDocument *aDoc { // checking for selection inside a plaintext form widget - if (!selContent->IsContentOfType(nsIContent::eHTML)) { + if (!selContent->IsNodeOfType(nsINode::eHTML)) { continue; } diff --git a/mozilla/content/base/src/nsDOMAttribute.cpp b/mozilla/content/base/src/nsDOMAttribute.cpp index 4836cdbb5ff..0cf293fdc5a 100644 --- a/mozilla/content/base/src/nsDOMAttribute.cpp +++ b/mozilla/content/base/src/nsDOMAttribute.cpp @@ -770,6 +770,12 @@ nsDOMAttribute::LookupNamespaceURI(const nsAString& aNamespacePrefix, return NS_OK; } +PRBool +nsDOMAttribute::IsNodeOfType(PRUint32 aFlags) const +{ + return !(aFlags & ~eATTRIBUTE); +} + PRUint32 nsDOMAttribute::GetChildCount() const { diff --git a/mozilla/content/base/src/nsDOMAttribute.h b/mozilla/content/base/src/nsDOMAttribute.h index 794734333be..13b7411785f 100644 --- a/mozilla/content/base/src/nsDOMAttribute.h +++ b/mozilla/content/base/src/nsDOMAttribute.h @@ -109,6 +109,7 @@ public: nsresult SetOwnerDocument(nsIDocument* aDocument); // nsINode interface + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; virtual PRUint32 GetChildCount() const; virtual nsIContent *GetChildAt(PRUint32 aIndex) const; virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const; diff --git a/mozilla/content/base/src/nsDOMAttributeMap.cpp b/mozilla/content/base/src/nsDOMAttributeMap.cpp index f806802dc73..1cad77b5f5b 100644 --- a/mozilla/content/base/src/nsDOMAttributeMap.cpp +++ b/mozilla/content/base/src/nsDOMAttributeMap.cpp @@ -290,7 +290,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode, nsAutoString value; attribute->GetValue(value); if (!aWithNS && ni->NamespaceID() == kNameSpaceID_None && - mContent->IsContentOfType(nsIContent::eHTML)) { + mContent->IsNodeOfType(nsINode::eHTML)) { // Set via setAttribute(), which may do normalization on the // attribute name for HTML nsCOMPtr ourElement(do_QueryInterface(mContent)); diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index 82a0e4d4f9c..4e8d05e69bb 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -1691,6 +1691,12 @@ nsDocument::FindContentForSubDocument(nsIDocument *aDocument) const return data.mResult; } +PRBool +nsDocument::IsNodeOfType(PRUint32 aFlags) const +{ + return !(aFlags & ~eDOCUMENT); +} + nsIContent * nsDocument::GetChildAt(PRUint32 aIndex) const { @@ -1713,7 +1719,7 @@ nsresult nsDocument::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify) { - if (aKid->IsContentOfType(nsIContent::eELEMENT)) { + if (aKid->IsNodeOfType(nsINode::eELEMENT)) { if (mRootContent) { NS_ERROR("Inserting element child when we already have one"); return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR; @@ -1764,7 +1770,7 @@ nsDocument::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) nsresult rv = NS_OK; if (oldKid) { if (oldKid == mRootContent) { - NS_ASSERTION(oldKid->IsContentOfType(nsIContent::eELEMENT), + NS_ASSERTION(oldKid->IsNodeOfType(nsINode::eELEMENT), "Non-element root content?"); // Destroy the link map up front and null out mRootContent before we mess // with the child list. Hopefully no one in doRemoveChildAt will compare @@ -1803,7 +1809,7 @@ nsDocument::VerifyRootContentState() nsIContent* kid = GetChildAt(i); NS_ASSERTION(kid, "Must have kid here"); - if (kid->IsContentOfType(nsIContent::eELEMENT)) { + if (kid->IsNodeOfType(nsINode::eELEMENT)) { NS_ASSERTION(!elementChild, "Multiple element kids?"); elementChild = kid; } diff --git a/mozilla/content/base/src/nsDocument.h b/mozilla/content/base/src/nsDocument.h index 82d894dffb0..6eb20280817 100644 --- a/mozilla/content/base/src/nsDocument.h +++ b/mozilla/content/base/src/nsDocument.h @@ -528,6 +528,7 @@ public: virtual void OnPageHide(PRBool aPersisted); // nsINode + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; virtual nsIContent *GetChildAt(PRUint32 aIndex) const; virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const; virtual PRUint32 GetChildCount() const; diff --git a/mozilla/content/base/src/nsFrameLoader.cpp b/mozilla/content/base/src/nsFrameLoader.cpp index 6bab16b9777..f3e81b06639 100644 --- a/mozilla/content/base/src/nsFrameLoader.cpp +++ b/mozilla/content/base/src/nsFrameLoader.cpp @@ -348,7 +348,7 @@ nsFrameLoader::EnsureDocShell() nsAutoString value; PRBool isContent = PR_FALSE; - if (mOwnerContent->IsContentOfType(nsIContent::eXUL)) { + if (mOwnerContent->IsNodeOfType(nsINode::eXUL)) { mOwnerContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value); } diff --git a/mozilla/content/base/src/nsGenericDOMDataNode.cpp b/mozilla/content/base/src/nsGenericDOMDataNode.cpp index 6dec473c941..ee3a13ebbac 100644 --- a/mozilla/content/base/src/nsGenericDOMDataNode.cpp +++ b/mozilla/content/base/src/nsGenericDOMDataNode.cpp @@ -675,7 +675,7 @@ nsGenericDOMDataNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent, // NS_PRECONDITION(!aParent || aDocument == aParent->GetCurrentDoc(), // "aDocument must be current doc of aParent"); NS_PRECONDITION(!aParent || - (aParent->IsContentOfType(eXUL) && aDocument == nsnull) || + (aParent->IsNodeOfType(eXUL) && aDocument == nsnull) || aDocument == aParent->GetCurrentDoc(), "aDocument must be current doc of aParent"); NS_PRECONDITION(!GetCurrentDoc() && !IsInDoc(), @@ -959,11 +959,12 @@ nsGenericDOMDataNode::GetBindingParent() const } PRBool -nsGenericDOMDataNode::IsContentOfType(PRUint32 aFlags) const +nsGenericDOMDataNode::IsNodeOfType(PRUint32 aFlags) const { - return PR_FALSE; + return !(aFlags & ~eCONTENT); } + #ifdef DEBUG void nsGenericDOMDataNode::List(FILE* out, PRInt32 aIndent) const diff --git a/mozilla/content/base/src/nsGenericDOMDataNode.h b/mozilla/content/base/src/nsGenericDOMDataNode.h index 811c789d688..17824c6d735 100644 --- a/mozilla/content/base/src/nsGenericDOMDataNode.h +++ b/mozilla/content/base/src/nsGenericDOMDataNode.h @@ -241,7 +241,7 @@ public: virtual const nsVoidArray *GetRangeList() const; virtual nsIContent *GetBindingParent() const; - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; virtual nsresult GetListenerManager(PRBool aCreateIfNotFound, nsIEventListenerManager** aResult); diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index c0e4348eb36..c3ec156944d 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -290,7 +290,7 @@ nsNode3Tearoff::GetTextContent(nsIContent *aContent, aTextContent.Truncate(); while (!iter->IsDone()) { nsIContent *content = iter->GetCurrentNode(); - if (content->IsContentOfType(nsIContent::eTEXT)) { + if (content->IsNodeOfType(nsINode::eTEXT)) { nsCOMPtr textContent(do_QueryInterface(iter->GetCurrentNode())); if (textContent) textContent->AppendTextTo(aTextContent); @@ -1713,7 +1713,7 @@ nsGenericElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, // NS_PRECONDITION(!aParent || aDocument == aParent->GetCurrentDoc(), // "aDocument must be current doc of aParent"); NS_PRECONDITION(!aParent || - (aParent->IsContentOfType(eXUL) && aDocument == nsnull) || + (aParent->IsNodeOfType(eXUL) && aDocument == nsnull) || aDocument == aParent->GetCurrentDoc(), "aDocument must be current doc of aParent"); NS_PRECONDITION(!GetCurrentDoc(), "Already have a document. Unbind first!"); @@ -2235,9 +2235,9 @@ nsGenericElement::GetBindingParent() const } PRBool -nsGenericElement::IsContentOfType(PRUint32 aFlags) const +nsGenericElement::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~eELEMENT); + return !(aFlags & ~(eCONTENT | eELEMENT)); } //---------------------------------------------------------------------- @@ -2661,7 +2661,7 @@ PRBool IsAllowedAsChild(nsIContent* aNewChild, PRUint16 aNewNodeType, for (PRUint32 index = 0; index < count; ++index) { nsIContent* childContent = aNewChild->GetChildAt(index); NS_ASSERTION(childContent, "Something went wrong"); - if (childContent->IsContentOfType(nsIContent::eELEMENT)) { + if (childContent->IsNodeOfType(nsINode::eELEMENT)) { if (sawElement) { // Can't put two elements into a document return PR_FALSE; @@ -3014,7 +3014,7 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace, } else { // Not inserting a fragment but rather a single node. - PRBool newContentIsXUL = newContent->IsContentOfType(eXUL); + PRBool newContentIsXUL = newContent->IsNodeOfType(eXUL); // Remove the element from the old parent if one exists nsINode* oldParent = newContent->GetNodeParent(); @@ -3821,7 +3821,7 @@ nsGenericElement::GetContentsAsText(nsAString& aText) for (i = 0; i < children; ++i) { nsIContent *child = GetChildAt(i); - if (child->IsContentOfType(eTEXT)) { + if (child->IsNodeOfType(eTEXT)) { tc = do_QueryInterface(child); tc->AppendTextTo(aText); diff --git a/mozilla/content/base/src/nsGenericElement.h b/mozilla/content/base/src/nsGenericElement.h index cac33c99134..6aa5e1740b7 100644 --- a/mozilla/content/base/src/nsGenericElement.h +++ b/mozilla/content/base/src/nsGenericElement.h @@ -445,7 +445,7 @@ public: virtual const nsVoidArray *GetRangeList() const; virtual void SetFocus(nsPresContext* aContext); virtual nsIContent *GetBindingParent() const; - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; virtual nsresult GetListenerManager(PRBool aCreateIfNotFound, nsIEventListenerManager** aResult); virtual already_AddRefed GetBaseURI() const; diff --git a/mozilla/content/base/src/nsObjectLoadingContent.cpp b/mozilla/content/base/src/nsObjectLoadingContent.cpp index a2b0b718f6d..944bcc48afc 100644 --- a/mozilla/content/base/src/nsObjectLoadingContent.cpp +++ b/mozilla/content/base/src/nsObjectLoadingContent.cpp @@ -1410,7 +1410,7 @@ nsObjectLoadingContent::ShouldShowDefaultPlugin(nsIContent* aContent) /* static */ PRBool nsObjectLoadingContent::IsUnsupportedPlugin(nsIContent* aContent) { - if (!aContent->IsContentOfType(nsIContent::eHTML)) { + if (!aContent->IsNodeOfType(nsINode::eHTML)) { return PR_FALSE; } @@ -1425,7 +1425,7 @@ nsObjectLoadingContent::IsUnsupportedPlugin(nsIContent* aContent) nsIContent* child = aContent->GetChildAt(i); NS_ASSERTION(child, "GetChildCount lied!"); - if (child->IsContentOfType(nsIContent::eHTML) && + if (child->IsNodeOfType(nsINode::eHTML) && child->Tag() == nsHTMLAtoms::param && child->AttrValueIs(kNameSpaceID_None, nsHTMLAtoms::name, NS_LITERAL_STRING("pluginurl"), eIgnoreCase)) { diff --git a/mozilla/content/base/src/nsPlainTextSerializer.cpp b/mozilla/content/base/src/nsPlainTextSerializer.cpp index 29a5c5dd049..bef966e98ff 100644 --- a/mozilla/content/base/src/nsPlainTextSerializer.cpp +++ b/mozilla/content/base/src/nsPlainTextSerializer.cpp @@ -1809,7 +1809,7 @@ nsPlainTextSerializer::IsCurrentNodeConverted(const nsIParserNode* aNode) PRInt32 nsPlainTextSerializer::GetIdForContent(nsIContent* aContent) { - if (!aContent->IsContentOfType(nsIContent::eHTML)) { + if (!aContent->IsNodeOfType(nsINode::eHTML)) { return eHTMLTag_unknown; } diff --git a/mozilla/content/base/src/nsScriptLoader.cpp b/mozilla/content/base/src/nsScriptLoader.cpp index 4d50da0fdb6..c9fdc7a4499 100644 --- a/mozilla/content/base/src/nsScriptLoader.cpp +++ b/mozilla/content/base/src/nsScriptLoader.cpp @@ -274,7 +274,7 @@ nsScriptLoader::InNonScriptingContainer(nsIScriptElement* aScriptElement) // displayed and processed. This might change if we support either // prefs or per-document container settings for not allowing // frames or plugins. - if (content->IsContentOfType(nsIContent::eHTML) && + if (content->IsNodeOfType(nsINode::eHTML) && (localName == nsHTMLAtoms::iframe || localName == nsHTMLAtoms::noframes || localName == nsHTMLAtoms::noembed)) { diff --git a/mozilla/content/base/src/nsTextNode.cpp b/mozilla/content/base/src/nsTextNode.cpp index 63a6086ff84..f45a616762a 100644 --- a/mozilla/content/base/src/nsTextNode.cpp +++ b/mozilla/content/base/src/nsTextNode.cpp @@ -72,7 +72,7 @@ public: NS_FORWARD_NSIDOMTEXT(nsGenericDOMDataNode::) // nsIContent - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; #ifdef DEBUG virtual void List(FILE* out, PRInt32 aIndent) const; virtual void DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const; @@ -213,9 +213,9 @@ nsTextNode::GetNodeType(PRUint16* aNodeType) } PRBool -nsTextNode::IsContentOfType(PRUint32 aFlags) const +nsTextNode::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~eTEXT); + return !(aFlags & ~(eCONTENT | eTEXT)); } nsGenericDOMDataNode* diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index be6ab27bc1d..97c109d198e 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -981,7 +981,7 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext, nsCOMPtr content = dont_AddRef(NS_STATIC_CAST(nsIContent*, mAccessKeys->Get(&key))); // if it's a XUL element... - if (content->IsContentOfType(nsIContent::eXUL)) { + if (content->IsNodeOfType(nsINode::eXUL)) { // find out what type of content node this is if (content->Tag() == nsXULAtoms::label) { // If anything fails, this will be null ... @@ -1272,7 +1272,7 @@ nsEventStateManager::FireContextClick() nsIAtom *tag = mGestureDownContent->Tag(); PRBool allowedToDispatch = PR_TRUE; - if (mGestureDownContent->IsContentOfType(nsIContent::eXUL)) { + if (mGestureDownContent->IsNodeOfType(nsINode::eXUL)) { if (tag == nsXULAtoms::scrollbar || tag == nsXULAtoms::scrollbarbutton || tag == nsXULAtoms::button) @@ -1293,7 +1293,7 @@ nsEventStateManager::FireContextClick() } } } - else if (mGestureDownContent->IsContentOfType(nsIContent::eHTML)) { + else if (mGestureDownContent->IsNodeOfType(nsINode::eHTML)) { nsCOMPtr formCtrl(do_QueryInterface(mGestureDownContent)); if (formCtrl) { @@ -1609,8 +1609,8 @@ nsEventStateManager::DoScrollTextsize(nsIFrame *aTargetFrame, // Exclude form controls and XUL content. nsIContent *content = aTargetFrame->GetContent(); if (content && - !content->IsContentOfType(nsIContent::eHTML_FORM_CONTROL) && - !content->IsContentOfType(nsIContent::eXUL)) + !content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL) && + !content->IsNodeOfType(nsINode::eXUL)) { // positive adjustment to increase text size, non-positive to decrease ChangeTextSize((adjustment > 0) ? 1 : -1); @@ -3047,7 +3047,7 @@ nsEventStateManager::ChangeFocusWith(nsIContent* aFocusContent, // Select text fields when focused via keyboard (tab or accesskey) if (sTextfieldSelectModel == eTextfieldSelect_auto && mCurrentFocus && - mCurrentFocus->IsContentOfType(nsIContent::eHTML_FORM_CONTROL)) { + mCurrentFocus->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) { nsCOMPtr formControl(do_QueryInterface(mCurrentFocus)); PRInt32 controlType = formControl->GetType(); if (controlType == NS_FORM_INPUT_TEXT || @@ -3478,7 +3478,7 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent, mPresContext, aStartFrame); NS_ENSURE_SUCCESS(rv, rv); if (!aStartContent || aStartContent->Tag() != nsHTMLAtoms::area || - !aStartContent->IsContentOfType(nsIContent::eHTML)) { + !aStartContent->IsNodeOfType(nsINode::eHTML)) { // Need to do special check in case we're in an imagemap which has multiple // content per frame, so don't skip over the starting frame. rv = forward ? frameTraversal->Next() : frameTraversal->Prev(); @@ -4038,7 +4038,7 @@ IsFocusable(nsIPresShell* aPresShell, nsIContent* aContent) // the content is focusable (not disabled). // We don't use nsIFrame::IsFocusable() because it defaults // tabindex to -1 for -moz-user-focus:ignore (bug 305840). - if (aContent->IsContentOfType(nsIContent::eXUL)) { + if (aContent->IsNodeOfType(nsINode::eXUL)) { // XXX Eventually we should have a better check, but for // now checking for style visibility and focusability caused // too many regressions. @@ -4584,7 +4584,7 @@ nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent, nsIContent *childContent = nsnull; startContent = do_QueryInterface(startNode); - if (startContent->IsContentOfType(nsIContent::eELEMENT)) { + if (startContent->IsNodeOfType(nsINode::eELEMENT)) { NS_ASSERTION(*aStartOffset >= 0, "Start offset cannot be negative"); childContent = startContent->GetChildAt(*aStartOffset); if (childContent) { @@ -4593,7 +4593,7 @@ nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent, } endContent = do_QueryInterface(endNode); - if (endContent->IsContentOfType(nsIContent::eELEMENT)) { + if (endContent->IsNodeOfType(nsINode::eELEMENT)) { PRInt32 endOffset = 0; domRange->GetEndOffset(&endOffset); NS_ASSERTION(endOffset >= 0, "End offset cannot be negative"); @@ -4636,7 +4636,7 @@ nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent, domNode->GetNodeValue(nodeValue); PRBool isFormControl = - startContent->IsContentOfType(nsIContent::eHTML_FORM_CONTROL); + startContent->IsNodeOfType(nsINode::eHTML_FORM_CONTROL); if (nodeValue.Length() == *aStartOffset && !isFormControl && startContent != mDocument->GetRootContent()) { @@ -4792,7 +4792,7 @@ nsEventStateManager::MoveFocusToCaret(PRBool aCanFocusDoc, // Add better focusable test here later if necessary ... if (tag == nsHTMLAtoms::a && - testContent->IsContentOfType(nsIContent::eHTML)) { + testContent->IsNodeOfType(nsINode::eHTML)) { *aIsSelectionWithFocus = PR_TRUE; } else { @@ -4835,7 +4835,7 @@ nsEventStateManager::MoveFocusToCaret(PRBool aCanFocusDoc, // Add better focusable test here later if necessary ... if (testContent) { if (testContent->Tag() == nsHTMLAtoms::a && - testContent->IsContentOfType(nsIContent::eHTML)) { + testContent->IsNodeOfType(nsINode::eHTML)) { *aIsSelectionWithFocus = PR_TRUE; FocusElementButNotDocument(testContent); return NS_OK; @@ -4931,7 +4931,7 @@ nsEventStateManager::MoveCaretToFocus() nsCOMPtr firstChild; currentFocusNode->GetFirstChild(getter_AddRefs(firstChild)); if (!firstChild || - mCurrentFocus->IsContentOfType(nsIContent::eHTML_FORM_CONTROL)) { + mCurrentFocus->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) { // If current focus node is a leaf, set range to before the // node by using the parent as a container. // This prevents it from appearing as selected. @@ -5095,7 +5095,7 @@ nsEventStateManager::IsFrameSetDoc(nsIDocShell* aDocShell) nsINodeInfo *ni = childContent->NodeInfo(); - if (childContent->IsContentOfType(nsIContent::eHTML) && + if (childContent->IsNodeOfType(nsINode::eHTML) && ni->Equals(nsHTMLAtoms::frameset)) { isFrameSet = PR_TRUE; break; diff --git a/mozilla/content/events/src/nsXMLEventsManager.cpp b/mozilla/content/events/src/nsXMLEventsManager.cpp index 865c277eeb6..8445510d249 100644 --- a/mozilla/content/events/src/nsXMLEventsManager.cpp +++ b/mozilla/content/events/src/nsXMLEventsManager.cpp @@ -418,7 +418,7 @@ nsXMLEventsManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aChild, PRInt32 aIndexInContainer) { - if (!aChild || !aChild->IsContentOfType(nsIContent::eELEMENT)) + if (!aChild || !aChild->IsNodeOfType(nsINode::eELEMENT)) return; //Note, we can't use IDs here, the observer may not always have an ID. //And to remember: the same observer can be referenced by many diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 4efe597518f..90d189b920e 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -572,7 +572,7 @@ static PRBool IsBody(nsIContent *aContent) { return (aContent->NodeInfo()->Equals(nsHTMLAtoms::body) && - aContent->IsContentOfType(nsIContent::eHTML)); + aContent->IsNodeOfType(nsINode::eHTML)); } static PRBool @@ -583,7 +583,7 @@ IsOffsetParent(nsIContent *aContent) return ((ni->Equals(nsHTMLAtoms::td) || ni->Equals(nsHTMLAtoms::table) || ni->Equals(nsHTMLAtoms::th)) && - aContent->IsContentOfType(nsIContent::eHTML)); + aContent->IsNodeOfType(nsINode::eHTML)); } void @@ -1347,7 +1347,7 @@ nsGenericHTMLElement::FindForm(nsIForm* aCurrentForm) while (content) { // If the current ancestor is a form, return it as our form if (content->Tag() == nsHTMLAtoms::form && - content->IsContentOfType(nsIContent::eHTML)) { + content->IsNodeOfType(nsINode::eHTML)) { nsIDOMHTMLFormElement* form; CallQueryInterface(content, &form); @@ -1400,7 +1400,7 @@ static PRBool IsArea(nsIContent *aContent) { return (aContent->Tag() == nsHTMLAtoms::area && - aContent->IsContentOfType(nsIContent::eHTML)); + aContent->IsNodeOfType(nsINode::eHTML)); } nsresult @@ -1922,9 +1922,9 @@ nsGenericHTMLElement::DumpContent(FILE* out, PRInt32 aIndent, PRBool -nsGenericHTMLElement::IsContentOfType(PRUint32 aFlags) const +nsGenericHTMLElement::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~(eELEMENT | eHTML)); + return !(aFlags & ~(eCONTENT | eELEMENT | eHTML)); } //---------------------------------------------------------------------- @@ -2956,9 +2956,9 @@ NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement) PRBool -nsGenericHTMLFormElement::IsContentOfType(PRUint32 aFlags) const +nsGenericHTMLFormElement::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~(eELEMENT | eHTML | eHTML_FORM_CONTROL)); + return !(aFlags & ~(eCONTENT | eELEMENT | eHTML | eHTML_FORM_CONTROL)); } NS_IMETHODIMP @@ -3498,7 +3498,7 @@ nsGenericHTMLElement::RemoveFocus(nsPresContext *aPresContext) if (!aPresContext) return; - if (IsContentOfType(eHTML_FORM_CONTROL)) { + if (IsNodeOfType(eHTML_FORM_CONTROL)) { nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_FALSE); if (formControlFrame) { formControlFrame->SetFocus(PR_FALSE, PR_FALSE); diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.h b/mozilla/content/html/content/src/nsGenericHTMLElement.h index 2a1a5d2ce36..5a4b4933619 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.h +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.h @@ -85,7 +85,7 @@ public: /** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/ static nsGenericHTMLElement* FromContent(nsIContent *aContent) { - if (aContent->IsContentOfType(eHTML)) + if (aContent->IsNodeOfType(eHTML)) return NS_STATIC_CAST(nsGenericHTMLElement*, aContent); return nsnull; } @@ -191,7 +191,7 @@ public: virtual void List(FILE* out, PRInt32 aIndent) const; virtual void DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const; #endif - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; virtual void RemoveFocus(nsPresContext *aPresContext); virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull); @@ -794,7 +794,7 @@ public: NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; // nsIFormControl NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm); diff --git a/mozilla/content/html/content/src/nsHTMLLabelElement.cpp b/mozilla/content/html/content/src/nsHTMLLabelElement.cpp index b991df45a55..701adb805c8 100644 --- a/mozilla/content/html/content/src/nsHTMLLabelElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLLabelElement.cpp @@ -318,7 +318,7 @@ nsHTMLLabelElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, inline PRBool IsNonLabelFormControl(nsIContent *aContent) { - return aContent->IsContentOfType(nsIContent::eHTML_FORM_CONTROL) && + return aContent->IsNodeOfType(nsINode::eHTML_FORM_CONTROL) && aContent->Tag() != nsHTMLAtoms::label; } diff --git a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp index b1d82ea65e0..172f30e03b3 100644 --- a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp @@ -735,7 +735,7 @@ nsHTMLSelectElement::RemoveOptionsFromList(nsIContent* aOptions, static PRBool IsOptGroup(nsIContent *aContent) { return (aContent->NodeInfo()->Equals(nsHTMLAtoms::optgroup) && - aContent->IsContentOfType(nsIContent::eHTML)); + aContent->IsNodeOfType(nsINode::eHTML)); } // If the document is such that recursing over these options gets us diff --git a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp index 169ee0a4d15..38d3a95d49f 100644 --- a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp @@ -135,7 +135,7 @@ nsHTMLTableCellElement::GetTable() if (parent) { // GetParent() should be a row nsIContent* section = parent->GetParent(); if (section) { - if (section->IsContentOfType(eHTML) && + if (section->IsNodeOfType(eHTML) && section->NodeInfo()->Equals(nsHTMLAtoms::table)) { // XHTML, without a row group result = section; diff --git a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp index a93562c2cdc..35346cce778 100644 --- a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp @@ -263,7 +263,7 @@ IsCell(nsIContent *aContent, PRInt32 aNamespaceID, nsIAtom* tag = aContent->Tag(); return ((tag == nsHTMLAtoms::td || tag == nsHTMLAtoms::th) && - aContent->IsContentOfType(nsIContent::eHTML)); + aContent->IsNodeOfType(nsINode::eHTML)); } NS_IMETHODIMP diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index fe84bf40cf1..0f1a8d7ca62 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -3217,7 +3217,7 @@ nsHTMLDocument::RemoveFromIdTable(nsIContent *aContent) nsresult nsHTMLDocument::UnregisterNamedItems(nsIContent *aContent) { - if (aContent->IsContentOfType(nsIContent::eTEXT)) { + if (aContent->IsNodeOfType(nsINode::eTEXT)) { // Text nodes are not named items nor can they have children. return NS_OK; } @@ -3253,7 +3253,7 @@ nsHTMLDocument::UnregisterNamedItems(nsIContent *aContent) nsresult nsHTMLDocument::RegisterNamedItems(nsIContent *aContent) { - if (aContent->IsContentOfType(nsIContent::eTEXT)) { + if (aContent->IsNodeOfType(nsINode::eTEXT)) { // Text nodes are not named items nor can they have children. return NS_OK; } @@ -3292,7 +3292,7 @@ FindNamedItems(nsIAtom* aName, nsIContent *aContent, NS_ASSERTION(aEntry.mNameContentList != NAME_NOT_VALID, "Entry that should never have a list passed to FindNamedItems()!"); - if (aContent->IsContentOfType(nsIContent::eTEXT)) { + if (aContent->IsNodeOfType(nsINode::eTEXT)) { // Text nodes are not named items nor can they have children. return; } @@ -3462,7 +3462,7 @@ nsHTMLDocument::ResolveName(const nsAString& aName, nsIContent *e = entry->GetIdContent(); - if (e && e != ID_NOT_IN_DOCUMENT && e->IsContentOfType(nsIContent::eHTML)) { + if (e && e != ID_NOT_IN_DOCUMENT && e->IsNodeOfType(nsINode::eHTML)) { nsIAtom *tag = e->Tag(); if ((tag == nsHTMLAtoms::embed || @@ -3493,7 +3493,7 @@ nsHTMLDocument::GetBodyContent() NS_ENSURE_TRUE(child, NS_ERROR_UNEXPECTED); if (child->NodeInfo()->Equals(nsHTMLAtoms::body, mDefaultNamespaceID) && - child->IsContentOfType(nsIContent::eHTML)) { + child->IsNodeOfType(nsINode::eHTML)) { mBodyContent = do_QueryInterface(child); return PR_TRUE; diff --git a/mozilla/content/svg/content/src/nsSVGElement.cpp b/mozilla/content/svg/content/src/nsSVGElement.cpp index 3ecc4634875..4d2d0b69a6d 100644 --- a/mozilla/content/svg/content/src/nsSVGElement.cpp +++ b/mozilla/content/svg/content/src/nsSVGElement.cpp @@ -297,9 +297,9 @@ nsSVGElement::UnsetAttr(PRInt32 aNamespaceID, nsIAtom* aName, } PRBool -nsSVGElement::IsContentOfType(PRUint32 aFlags) const +nsSVGElement::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~(eELEMENT | eSVG)); + return !(aFlags & ~(eCONTENT | eELEMENT | eSVG)); } NS_IMETHODIMP diff --git a/mozilla/content/svg/content/src/nsSVGElement.h b/mozilla/content/svg/content/src/nsSVGElement.h index c89f6f5d017..2d9967c012f 100644 --- a/mozilla/content/svg/content/src/nsSVGElement.h +++ b/mozilla/content/svg/content/src/nsSVGElement.h @@ -83,7 +83,7 @@ public: virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify); - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); NS_IMETHOD SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify); diff --git a/mozilla/content/xbl/src/nsXBLContentSink.cpp b/mozilla/content/xbl/src/nsXBLContentSink.cpp index 937ab009617..357a80c346a 100644 --- a/mozilla/content/xbl/src/nsXBLContentSink.cpp +++ b/mozilla/content/xbl/src/nsXBLContentSink.cpp @@ -888,7 +888,7 @@ nsresult nsXBLContentSink::AddAttributes(const PRUnichar** aAtts, nsIContent* aContent) { - if (aContent->IsContentOfType(nsIContent::eXUL)) + if (aContent->IsNodeOfType(nsINode::eXUL)) return NS_OK; // Nothing to do, since the proto already has the attrs. return nsXMLContentSink::AddAttributes(aAtts, aContent); diff --git a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp index 49538caf04e..f30a4909f7a 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -323,7 +323,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver, if (focusedContent) { while (content) { if (content->Tag() == nsHTMLAtoms::a && - content->IsContentOfType(nsIContent::eHTML)) { + content->IsNodeOfType(nsINode::eHTML)) { isLink = PR_TRUE; break; } diff --git a/mozilla/content/xbl/src/nsXBLService.cpp b/mozilla/content/xbl/src/nsXBLService.cpp index a0ed54bbba1..22e51bec007 100644 --- a/mozilla/content/xbl/src/nsXBLService.cpp +++ b/mozilla/content/xbl/src/nsXBLService.cpp @@ -1061,7 +1061,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement, ni->Equals(nsXULAtoms::thumb, kNameSpaceID_XUL) || ((ni->Equals(nsHTMLAtoms::input) || ni->Equals(nsHTMLAtoms::select)) && - aBoundElement->IsContentOfType(nsIContent::eHTML)))) && + 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 diff --git a/mozilla/content/xml/content/src/nsXMLCDATASection.cpp b/mozilla/content/xml/content/src/nsXMLCDATASection.cpp index f64e09e785c..b9fc3e98313 100644 --- a/mozilla/content/xml/content/src/nsXMLCDATASection.cpp +++ b/mozilla/content/xml/content/src/nsXMLCDATASection.cpp @@ -65,7 +65,7 @@ public: // Empty interface // nsIContent - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; #ifdef DEBUG virtual void List(FILE* out, PRInt32 aIndent) const; virtual void DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const; @@ -121,9 +121,9 @@ NS_IMPL_RELEASE_INHERITED(nsXMLCDATASection, nsGenericDOMDataNode) PRBool -nsXMLCDATASection::IsContentOfType(PRUint32 aFlags) const +nsXMLCDATASection::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~eTEXT); + return !(aFlags & ~(eCONTENT | eTEXT)); } NS_IMETHODIMP diff --git a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp index 454847cb4cc..d38a7de8bab 100644 --- a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp +++ b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp @@ -131,9 +131,9 @@ nsXMLProcessingInstruction::GetAttrValue(nsIAtom *aName, nsAString& aValue) } PRBool -nsXMLProcessingInstruction::IsContentOfType(PRUint32 aFlags) const +nsXMLProcessingInstruction::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~ePROCESSING_INSTRUCTION); + return !(aFlags & ~(eCONTENT | ePROCESSING_INSTRUCTION)); } // virtual diff --git a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h index 61e64b907ac..5a4beebd66b 100644 --- a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h +++ b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h @@ -64,7 +64,7 @@ public: NS_DECL_NSIDOMPROCESSINGINSTRUCTION // nsIContent - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; virtual PRBool MayHaveFrame() const; #ifdef DEBUG diff --git a/mozilla/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp b/mozilla/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp index 6fbeb797f58..2b5595c4165 100644 --- a/mozilla/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp +++ b/mozilla/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp @@ -379,14 +379,14 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode) } if (aNode.isContent()) { - if (aNode.mContent->IsContentOfType(nsIContent::eELEMENT)) { + if (aNode.mContent->IsNodeOfType(nsINode::eELEMENT)) { nsIAtom* localName = aNode.mContent->Tag(); NS_ADDREF(localName); return localName; } - if (aNode.mContent->IsContentOfType(nsIContent::ePROCESSING_INSTRUCTION)) { + if (aNode.mContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) { nsCOMPtr node = do_QueryInterface(aNode.mContent); nsAutoString target; node->GetNodeName(target); @@ -414,20 +414,20 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName) } if (aNode.isContent()) { - if (aNode.mContent->IsContentOfType(nsIContent::eELEMENT)) { + if (aNode.mContent->IsNodeOfType(nsINode::eELEMENT)) { nsINodeInfo* nodeInfo = aNode.mContent->NodeInfo(); nodeInfo->GetLocalName(aLocalName); // Check for html if (nodeInfo->NamespaceEquals(kNameSpaceID_None) && - aNode.mContent->IsContentOfType(nsIContent::eHTML)) { + aNode.mContent->IsNodeOfType(nsINode::eHTML)) { ToUpperCase(aLocalName); } return; } - if (aNode.mContent->IsContentOfType(nsIContent::ePROCESSING_INSTRUCTION)) { + if (aNode.mContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) { // PIs don't have a nodeinfo but do have a name nsCOMPtr node = do_QueryInterface(aNode.mContent); node->GetNodeName(aLocalName); @@ -445,7 +445,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName) // Check for html if (aNode.mContent->NodeInfo()->NamespaceEquals(kNameSpaceID_None) && - aNode.mContent->IsContentOfType(nsIContent::eHTML)) { + aNode.mContent->IsNodeOfType(nsINode::eHTML)) { ToUpperCase(aLocalName); } } @@ -461,20 +461,20 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName) } if (aNode.isContent()) { - if (aNode.mContent->IsContentOfType(nsIContent::eELEMENT)) { + if (aNode.mContent->IsNodeOfType(nsINode::eELEMENT)) { nsINodeInfo* nodeInfo = aNode.mContent->NodeInfo(); nodeInfo->GetQualifiedName(aName); // Check for html if (nodeInfo->NamespaceEquals(kNameSpaceID_None) && - aNode.mContent->IsContentOfType(nsIContent::eHTML)) { + aNode.mContent->IsNodeOfType(nsINode::eHTML)) { ToUpperCase(aName); } return; } - if (aNode.mContent->IsContentOfType(nsIContent::ePROCESSING_INSTRUCTION)) { + if (aNode.mContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) { // PIs don't have a nodeinfo but do have a name nsCOMPtr node = do_QueryInterface(aNode.mContent); node->GetNodeName(aName); @@ -491,7 +491,7 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName) // Check for html if (aNode.mContent->NodeInfo()->NamespaceEquals(kNameSpaceID_None) && - aNode.mContent->IsContentOfType(nsIContent::eHTML)) { + aNode.mContent->IsNodeOfType(nsINode::eHTML)) { ToUpperCase(aName); } } @@ -542,10 +542,10 @@ static void appendTextContent(nsIContent* aElement, nsAString& aResult) nsIContent* content = aElement->GetChildAt(0); PRUint32 i = 0; while (content) { - if (content->IsContentOfType(nsIContent::eELEMENT)) { + if (content->IsNodeOfType(nsINode::eELEMENT)) { appendTextContent(content, aResult); } - else if (content->IsContentOfType(nsIContent::eTEXT)) { + else if (content->IsNodeOfType(nsINode::eTEXT)) { nsCOMPtr textContent = do_QueryInterface(content); textContent->AppendTextTo(aResult); } @@ -576,13 +576,13 @@ txXPathNodeUtils::appendNodeValue(const txXPathNode& aNode, nsAString& aResult) return; } - if (aNode.mContent->IsContentOfType(nsIContent::eELEMENT)) { + if (aNode.mContent->IsNodeOfType(nsINode::eELEMENT)) { appendTextContent(aNode.mContent, aResult); return; } - if (aNode.mContent->IsContentOfType(nsIContent::ePROCESSING_INSTRUCTION)) { + if (aNode.mContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) { nsCOMPtr node = do_QueryInterface(aNode.mContent); nsAutoString result; diff --git a/mozilla/content/xslt/src/xpath/txXPathTreeWalker.h b/mozilla/content/xslt/src/xpath/txXPathTreeWalker.h index fc66ad5f380..864c11ed8a7 100644 --- a/mozilla/content/xslt/src/xpath/txXPathTreeWalker.h +++ b/mozilla/content/xslt/src/xpath/txXPathTreeWalker.h @@ -265,7 +265,7 @@ txXPathNodeUtils::localNameEquals(const txXPathNode& aNode, return localName == aLocalName; #else if (aNode.isContent() && - aNode.mContent->IsContentOfType(nsIContent::eELEMENT)) { + aNode.mContent->IsNodeOfType(nsINode::eELEMENT)) { return aNode.mContent->NodeInfo()->Equals(aLocalName); } @@ -294,7 +294,7 @@ txXPathNodeUtils::isElement(const txXPathNode& aNode) return aNode.mInner->getNodeType() == Node::ELEMENT_NODE; #else return aNode.isContent() && - aNode.mContent->IsContentOfType(nsIContent::eELEMENT); + aNode.mContent->IsNodeOfType(nsINode::eELEMENT); #endif } @@ -318,7 +318,7 @@ txXPathNodeUtils::isProcessingInstruction(const txXPathNode& aNode) return aNode.mInner->getNodeType() == Node::PROCESSING_INSTRUCTION_NODE; #else return aNode.isContent() && - aNode.mContent->IsContentOfType(nsIContent::ePROCESSING_INSTRUCTION); + aNode.mContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION); #endif } @@ -330,7 +330,7 @@ txXPathNodeUtils::isComment(const txXPathNode& aNode) return aNode.mInner->getNodeType() == Node::COMMENT_NODE; #else return aNode.isContent() && - aNode.mContent->IsContentOfType(nsIContent::eCOMMENT); + aNode.mContent->IsNodeOfType(nsINode::eCOMMENT); #endif } @@ -342,7 +342,7 @@ txXPathNodeUtils::isText(const txXPathNode& aNode) return aNode.mInner->getNodeType() == Node::TEXT_NODE; #else return aNode.isContent() && - aNode.mContent->IsContentOfType(nsIContent::eTEXT); + aNode.mContent->IsNodeOfType(nsINode::eTEXT); #endif } diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index ce228c0bdf9..43c827dd08e 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -763,7 +763,7 @@ nsXULElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, // NS_PRECONDITION(!aParent || aDocument == aParent->GetCurrentDoc(), // "aDocument must be current doc of aParent"); NS_PRECONDITION(!aParent || - (aParent->IsContentOfType(eXUL) && aDocument == nsnull) || + (aParent->IsNodeOfType(eXUL) && aDocument == nsnull) || aDocument == aParent->GetCurrentDoc(), "aDocument must be current doc of aParent"); // XXXbz we'd like to assert that GetCurrentDoc() is null, but the cloning @@ -1693,7 +1693,7 @@ nsXULElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor) domDoc->GetElementById(command, getter_AddRefs(commandElt)); nsCOMPtr commandContent(do_QueryInterface(commandElt)); if (commandContent && - commandContent->IsContentOfType(nsIContent::eXUL) && + commandContent->IsNodeOfType(nsINode::eXUL) && commandContent->Tag() == nsXULAtoms::command) { // Reusing the event here, but DISPATCH_DONE/STARTED hack // is needed. @@ -2245,9 +2245,9 @@ nsXULElement::GetBindingParent() const } PRBool -nsXULElement::IsContentOfType(PRUint32 aFlags) const +nsXULElement::IsNodeOfType(PRUint32 aFlags) const { - return !(aFlags & ~(eELEMENT | eXUL)); + return !(aFlags & ~(eCONTENT | eELEMENT | eXUL)); } nsresult diff --git a/mozilla/content/xul/content/src/nsXULElement.h b/mozilla/content/xul/content/src/nsXULElement.h index 9c06f4022fa..b63ea0c391f 100644 --- a/mozilla/content/xul/content/src/nsXULElement.h +++ b/mozilla/content/xul/content/src/nsXULElement.h @@ -432,7 +432,7 @@ public: /** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/ static nsXULElement* FromContent(nsIContent *aContent) { - if (aContent->IsContentOfType(eXUL)) + if (aContent->IsNodeOfType(eXUL)) return NS_STATIC_CAST(nsXULElement*, aContent); return nsnull; } @@ -514,7 +514,7 @@ public: virtual void RemoveFocus(nsPresContext* aPresContext); virtual nsIContent *GetBindingParent() const; - virtual PRBool IsContentOfType(PRUint32 aFlags) const; + virtual PRBool IsNodeOfType(PRUint32 aFlags) const; virtual nsresult GetListenerManager(PRBool aCreateIfNotFound, nsIEventListenerManager** aResult); virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull); diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 1cdd7b5f2b2..309539060be 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -1712,7 +1712,7 @@ NS_IMETHODIMP nsXULDocument::AddSubtreeToDocument(nsIContent* aElement) { // From here on we only care about elements. - if (!aElement->IsContentOfType(nsIContent::eELEMENT)) { + if (!aElement->IsNodeOfType(nsINode::eELEMENT)) { return NS_OK; } @@ -1740,7 +1740,7 @@ NS_IMETHODIMP nsXULDocument::RemoveSubtreeFromDocument(nsIContent* aElement) { // From here on we only care about elements. - if (!aElement->IsContentOfType(nsIContent::eELEMENT)) { + if (!aElement->IsNodeOfType(nsINode::eELEMENT)) { return NS_OK; } @@ -3868,7 +3868,7 @@ nsXULDocument::FindBroadcaster(nsIContent* aElement, nsString& aAttribute, nsIDOMElement** aBroadcaster) { - NS_ASSERTION(aElement->IsContentOfType(nsIContent::eELEMENT), + NS_ASSERTION(aElement->IsNodeOfType(nsINode::eELEMENT), "Only pass elements into FindBroadcaster!"); nsresult rv; diff --git a/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp b/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp index 047c2a15f3a..0701e5fc012 100644 --- a/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp +++ b/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp @@ -766,7 +766,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, // first element we've generated? } } - else if (tmplKid->IsContentOfType(nsIContent::eTEXT)) { + else if (tmplKid->IsNodeOfType(nsINode::eTEXT)) { nsCOMPtr tmplTextNode = do_QueryInterface(tmplKid); if (!tmplTextNode) { NS_ERROR("textnode not implementing nsIDOMNode??"); @@ -1491,7 +1491,7 @@ nsXULContentBuilder::IsOpen(nsIContent* aElement) // Treat the 'root' element as always open, -unless- it's a // menu/menupopup. We don't need to "fake" these as being open. - if ((aElement == mRoot) && aElement->IsContentOfType(nsIContent::eXUL) && + if ((aElement == mRoot) && aElement->IsNodeOfType(nsINode::eXUL) && (tag != nsXULAtoms::menu) && (tag != nsXULAtoms::menubutton) && (tag != nsXULAtoms::toolbarbutton) && @@ -1530,7 +1530,7 @@ nsXULContentBuilder::RemoveGeneratedContent(nsIContent* aElement) // it should be moved outside the inner loop. Bug 297290. if (element->NodeInfo()->Equals(nsXULAtoms::_template, kNameSpaceID_XUL) || - !element->IsContentOfType(nsIContent::eELEMENT)) + !element->IsNodeOfType(nsINode::eELEMENT)) continue; // If the element is in the template map, then we @@ -1565,7 +1565,7 @@ nsXULContentBuilder::IsLazyWidgetItem(nsIContent* aElement) { // Determine if this is a , , or element - if (!aElement->IsContentOfType(nsIContent::eXUL)) { + if (!aElement->IsNodeOfType(nsINode::eXUL)) { return PR_FALSE; } diff --git a/mozilla/content/xul/templates/src/nsXULSortService.cpp b/mozilla/content/xul/templates/src/nsXULSortService.cpp index 643092fb769..e6434ded586 100644 --- a/mozilla/content/xul/templates/src/nsXULSortService.cpp +++ b/mozilla/content/xul/templates/src/nsXULSortService.cpp @@ -275,7 +275,7 @@ XULSortServiceImpl::FindSortableContainer(nsIContent *aRoot, nsIAtom *tag = aRoot->Tag(); - if (aRoot->IsContentOfType(nsIContent::eXUL)) { + if (aRoot->IsNodeOfType(nsINode::eXUL)) { if (tag == nsXULAtoms::_template) // ignore content within templates return NS_OK; @@ -294,7 +294,7 @@ XULSortServiceImpl::FindSortableContainer(nsIContent *aRoot, for (PRUint32 childIndex = 0; childIndex < numChildren; childIndex++) { nsIContent *child = aRoot->GetChildAt(childIndex); - if (child->IsContentOfType(nsIContent::eXUL)) { + if (child->IsNodeOfType(nsINode::eXUL)) { rv = FindSortableContainer(child, aContainer); if (*aContainer) return rv; @@ -349,7 +349,7 @@ XULSortServiceImpl::SetSortColumnHints(nsIContent *content, for (PRUint32 childIndex = 0; childIndex < numChildren; ++childIndex) { nsIContent *child = content->GetChildAt(childIndex); - if (child->IsContentOfType(nsIContent::eXUL)) { + if (child->IsNodeOfType(nsINode::eXUL)) { nsIAtom *tag = child->Tag(); if (tag == nsXULAtoms::treecols || @@ -1089,7 +1089,7 @@ XULSortServiceImpl::SortContainer(nsIContent *container, sortPtr sortInfo, --childIndex; nsIContent *child = container->GetChildAt(childIndex); - if (child->IsContentOfType(nsIContent::eXUL)) { + if (child->IsNodeOfType(nsINode::eXUL)) { nsIAtom *tag = child->Tag(); if (tag == nsXULAtoms::listitem || @@ -1153,7 +1153,7 @@ XULSortServiceImpl::SortContainer(nsIContent *container, sortPtr sortInfo, --childIndex; nsIContent *child = container->GetChildAt(childIndex); - if (child->IsContentOfType(nsIContent::eXUL)) { + if (child->IsNodeOfType(nsINode::eXUL)) { nsIAtom *tag = child->Tag(); if (tag == nsXULAtoms::listitem || diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 8f3cd4a4a97..c2e9519ffad 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -191,7 +191,7 @@ ForEachPing(nsIContent *content, ForEachPingCallback callback, void *closure) // Make sure we are dealing with either an or element in the HTML // or XHTML namespace. - if (!content->IsContentOfType(nsIContent::eHTML)) + if (!content->IsNodeOfType(nsINode::eHTML)) return; nsIAtom *nameAtom = content->Tag(); if (!nameAtom->EqualsUTF8(NS_LITERAL_CSTRING("a")) && diff --git a/mozilla/dom/src/base/nsDOMClassInfo.cpp b/mozilla/dom/src/base/nsDOMClassInfo.cpp index df9db926fcb..66239f17aa0 100644 --- a/mozilla/dom/src/base/nsDOMClassInfo.cpp +++ b/mozilla/dom/src/base/nsDOMClassInfo.cpp @@ -6445,7 +6445,7 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, nsISupports *native_parent; if (content) { - if (content->IsContentOfType(nsIContent::eXUL)) { + if (content->IsNodeOfType(nsINode::eXUL)) { // For XUL elements, use the parent, if any. native_parent = content->GetParent(); @@ -6457,7 +6457,7 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, native_parent = doc; // But for HTML form controls, use the form as scope parent. - if (content->IsContentOfType(nsIContent::eELEMENT | + if (content->IsNodeOfType(nsINode::eELEMENT | nsIContent::eHTML | nsIContent::eHTML_FORM_CONTROL)) { nsCOMPtr form_control(do_QueryInterface(content)); diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp index 3510161f33a..f660f2a5281 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp @@ -1141,7 +1141,7 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty, skipNode = PR_TRUE; } } - else if (content->IsContentOfType(nsIContent::eELEMENT)) + else if (content->IsNodeOfType(nsINode::eELEMENT)) { // handle non-text leaf nodes here skipNode = PR_TRUE; } diff --git a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp index 4a782047157..2e1f897a918 100644 --- a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp +++ b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp @@ -1696,7 +1696,7 @@ ChromeContextMenuListener::ContextMenu(nsIDOMEvent* aMouseEvent) do { // XXX test for selected text content = do_QueryInterface(node); - if (content && content->IsContentOfType(nsIContent::eHTML)) { + if (content && content->IsNodeOfType(nsINode::eHTML)) { const char *tagStr; content->Tag()->GetUTF8String(&tagStr); diff --git a/mozilla/embedding/components/find/src/nsFind.cpp b/mozilla/embedding/components/find/src/nsFind.cpp index 75fd81f1a07..a140a7547be 100644 --- a/mozilla/embedding/components/find/src/nsFind.cpp +++ b/mozilla/embedding/components/find/src/nsFind.cpp @@ -319,7 +319,7 @@ nsFindContentIterator::MaybeSetupInnerIterator() mInnerIterator = nsnull; nsIContent* content = mOuterIterator->GetCurrentNode(); - if (!content || !content->IsContentOfType(nsIContent::eHTML_FORM_CONTROL)) + if (!content || !content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) return; nsCOMPtr formControl(do_QueryInterface(content)); @@ -783,7 +783,7 @@ nsFind::NextNode(nsIDOMRange* aSearchRange, PRBool nsFind::IsBlockNode(nsIContent* aContent) { - if (!aContent->IsContentOfType(nsIContent::eHTML)) { + if (!aContent->IsNodeOfType(nsINode::eHTML)) { return PR_FALSE; } @@ -812,7 +812,7 @@ PRBool nsFind::IsTextNode(nsIDOMNode* aNode) // also implements that interface. nsCOMPtr content (do_QueryInterface(aNode)); - return content && content->IsContentOfType(nsIContent::eTEXT); + return content && content->IsNodeOfType(nsINode::eTEXT); } PRBool nsFind::IsVisibleNode(nsIDOMNode *aDOMNode) @@ -847,8 +847,8 @@ PRBool nsFind::SkipNode(nsIContent* aContent) // We may not need to skip comment nodes, // now that IsTextNode distinguishes them from real text nodes. - return (aContent->IsContentOfType(nsIContent::eCOMMENT) || - (aContent->IsContentOfType(nsIContent::eHTML) && + return (aContent->IsNodeOfType(nsINode::eCOMMENT) || + (aContent->IsNodeOfType(nsINode::eHTML) && (atom == sScriptAtom || atom == sNoframesAtom || atom == sSelectAtom))); @@ -864,8 +864,8 @@ PRBool nsFind::SkipNode(nsIContent* aContent) { atom = content->Tag(); - if (aContent->IsContentOfType(nsIContent::eCOMMENT) || - (content->IsContentOfType(nsIContent::eHTML) && + if (aContent->IsNodeOfType(nsINode::eCOMMENT) || + (content->IsNodeOfType(nsINode::eHTML) && (atom == sScriptAtom || atom == sNoframesAtom || atom == sSelectAtom))) diff --git a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp index cedb130d091..cd34476da82 100755 --- a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp +++ b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp @@ -118,10 +118,10 @@ nsSpatialNavigation::KeyPress(nsIDOMEvent* aEvent) nsCOMPtr targetContent = do_QueryInterface(domEventTarget); - if (targetContent->IsContentOfType(nsIContent::eXUL)) + if (targetContent->IsNodeOfType(nsINode::eXUL)) return NS_OK; - if (targetContent->IsContentOfType(nsIContent::eHTML_FORM_CONTROL)) + if (targetContent->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) { nsCOMPtr formControl(do_QueryInterface(targetContent)); formControlType = formControl->GetType(); @@ -137,7 +137,7 @@ nsSpatialNavigation::KeyPress(nsIDOMEvent* aEvent) } } } - else if (!mService->mIgnoreTextFields && targetContent->IsContentOfType(nsIContent::eHTML)) + else if (!mService->mIgnoreTextFields && targetContent->IsNodeOfType(nsINode::eHTML)) { // Test for isindex, a deprecated kind of text field. We're using a string // compare because is not considered a form control, so it does diff --git a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp index cc604d50fab..ae7b5980696 100755 --- a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp +++ b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp @@ -319,7 +319,7 @@ isContentOfType(nsIContent* content, const char* type) if (!content) return PR_FALSE; - if (content->IsContentOfType(nsIContent::eELEMENT)) + if (content->IsNodeOfType(nsINode::eELEMENT)) { nsIAtom* atom = content->NodeInfo()->NameAtom(); if (atom) @@ -331,7 +331,7 @@ isContentOfType(nsIContent* content, const char* type) PRBool isArea(nsIContent* content) { - if (!content || !content->IsContentOfType(nsIContent::eHTML)) + if (!content || !content->IsNodeOfType(nsINode::eHTML)) return PR_FALSE; return isContentOfType(content, "area"); @@ -342,7 +342,7 @@ isMap(nsIFrame* frame) { nsIContent* content = frame->GetContent(); - if (!content || !content->IsContentOfType(nsIContent::eHTML)) + if (!content || !content->IsNodeOfType(nsINode::eHTML)) return PR_FALSE; return isContentOfType(content, "map"); @@ -356,7 +356,7 @@ isTargetable(PRBool focusDocuments, nsIFrame* frame) if (!currentContent) return PR_FALSE; - if (!currentContent->IsContentOfType(nsIContent::eHTML)) + if (!currentContent->IsNodeOfType(nsINode::eHTML)) return PR_FALSE; if (isContentOfType(currentContent, "map")) diff --git a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp index 0027ed48428..6cb986009fa 100644 --- a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp +++ b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp @@ -1592,7 +1592,7 @@ nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange, } origContent = startContent; - if (startContent->IsContentOfType(nsIContent::eELEMENT)) { + if (startContent->IsNodeOfType(nsINode::eELEMENT)) { nsIContent *childContent = startContent->GetChildAt(startOffset); if (childContent) { startContent = childContent; @@ -1627,7 +1627,7 @@ nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange, // Keep testing while textContent is equal to something, // eventually we'll run out of ancestors - if (startContent->IsContentOfType(nsIContent::eHTML)) { + if (startContent->IsNodeOfType(nsINode::eHTML)) { nsCOMPtr link(do_QueryInterface(startContent)); if (link) { // Check to see if inside HTML link @@ -2404,7 +2404,7 @@ nsTypeAheadFind::IsTargetContentOkay(nsIContent *aContent) return PR_FALSE; } - if (aContent->IsContentOfType(nsIContent::eHTML_FORM_CONTROL)) { + if (aContent->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) { nsCOMPtr formControl(do_QueryInterface(aContent)); PRInt32 controlType = formControl->GetType(); if (controlType == NS_FORM_SELECT || @@ -2418,7 +2418,7 @@ nsTypeAheadFind::IsTargetContentOkay(nsIContent *aContent) return PR_FALSE; } } - else if (aContent->IsContentOfType(nsIContent::eHTML)) { + else if (aContent->IsNodeOfType(nsINode::eHTML)) { // Test for isindex, a deprecated kind of text field. We're using a string // compare because is not considered a form control, so it does // not support nsIFormControl or eHTML_FORM_CONTROL, and it's not worth diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 084172fe0b3..4ab041b3241 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -2236,7 +2236,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIFrame* aParentFram kNameSpaceID_None, nsHTMLAtoms::alt, aStyleContext, getter_AddRefs(content), aFrame); - } else if (aContent->IsContentOfType(nsIContent::eHTML) && + } else if (aContent->IsNodeOfType(nsINode::eHTML) && aContent->NodeInfo()->Equals(nsHTMLAtoms::input)) { if (aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::value)) { rv = CreateAttributeContent(aContent, aParentFrame, @@ -2336,7 +2336,7 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsFrameConstructorState& aSta { *aResult = nsnull; // initialize OUT parameter - if (!aContent->IsContentOfType(nsIContent::eELEMENT)) + if (!aContent->IsNodeOfType(nsINode::eELEMENT)) return PR_FALSE; nsStyleSet *styleSet = mPresShell->StyleSet(); @@ -2509,7 +2509,7 @@ static PRBool IsOnlyWhitespace(nsIContent* aContent) { PRBool onlyWhiteSpace = PR_FALSE; - if (aContent->IsContentOfType(nsIContent::eTEXT)) { + if (aContent->IsNodeOfType(nsINode::eTEXT)) { nsCOMPtr textContent = do_QueryInterface(aContent); onlyWhiteSpace = textContent->IsOnlyWhitespace(); @@ -3423,7 +3423,7 @@ IsSpecialContent(nsIContent* aContent, // Gross hack. Return true if this is a content node that we'd create a // frame for based on something other than display -- in other words if this // is a node that could never have a nsTableCellFrame, for example. - if (aContent->IsContentOfType(nsIContent::eHTML) || + if (aContent->IsNodeOfType(nsINode::eHTML) || aNameSpaceID == kNameSpaceID_XHTML) { // XXXbz this is duplicating some logic from ConstructHTMLFrame.... // Would be nice to avoid that. :( @@ -3580,7 +3580,7 @@ nsCSSFrameConstructor::AdjustParentFrame(nsFrameConstructorState& aState, IsSpecialContent(aChildContent, aTag, aNameSpaceID, aChildStyle)) && // XXXbz evil hack for HTML forms.... see similar in // nsCSSFrameConstructor::TableProcessChild. It should just go away. - (!aChildContent->IsContentOfType(nsIContent::eHTML) || + (!aChildContent->IsNodeOfType(nsINode::eHTML) || !aChildContent->NodeInfo()->Equals(nsHTMLAtoms::form, kNameSpaceID_None))) { nsTableCreator tableCreator(aState.mPresShell); @@ -4097,11 +4097,11 @@ MustGeneratePseudoParent(nsIContent* aContent, nsStyleContext* aStyleContext) return PR_FALSE; } - if (aContent->IsContentOfType(nsIContent::eTEXT)) { + if (aContent->IsNodeOfType(nsINode::eTEXT)) { return !IsOnlyWhitespace(aContent); } - return !aContent->IsContentOfType(nsIContent::eCOMMENT); + return !aContent->IsNodeOfType(nsINode::eCOMMENT); } // this is called when a non table related element is a child of a table, row group, @@ -4207,8 +4207,8 @@ nsCSSFrameConstructor::TableProcessChildren(nsFrameConstructorState& aState, ++iter) { nsCOMPtr childContent = *iter; if (childContent && - (childContent->IsContentOfType(nsIContent::eELEMENT) || - childContent->IsContentOfType(nsIContent::eTEXT)) && + (childContent->IsNodeOfType(nsINode::eELEMENT) || + childContent->IsNodeOfType(nsINode::eTEXT)) && NeedFrameFor(aParentFrame, childContent)) { rv = TableProcessChild(aState, childContent, @@ -4343,9 +4343,9 @@ nsCSSFrameConstructor::TableProcessChild(nsFrameConstructorState& aState, nsINodeInfo *childNodeInfo = aChildContent->NodeInfo(); // Sometimes aChildContent is a #text node. In those cases we want to // construct a foreign frame for it in any case. - if (aChildContent->IsContentOfType(nsIContent::eHTML) && + if (aChildContent->IsNodeOfType(nsINode::eHTML) && childNodeInfo->Equals(nsHTMLAtoms::form, kNameSpaceID_None) && - aParentContent->IsContentOfType(nsIContent::eHTML)) { + aParentContent->IsNodeOfType(nsINode::eHTML)) { nsINodeInfo *parentNodeInfo = aParentContent->NodeInfo(); if (parentNodeInfo->Equals(nsHTMLAtoms::table) || @@ -4469,7 +4469,7 @@ nsCSSFrameConstructor::PropagateScrollToViewport() // of the viewport // XXX what about XHTML? nsCOMPtr htmlDoc(do_QueryInterface(mDocument)); - if (!htmlDoc || !docElement->IsContentOfType(nsIContent::eHTML)) { + if (!htmlDoc || !docElement->IsNodeOfType(nsINode::eHTML)) { return nsnull; } @@ -4619,7 +4619,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState, } else { // otherwise build a box or a block #ifdef MOZ_XUL - if (aDocElement->IsContentOfType(nsIContent::eXUL)) { + if (aDocElement->IsNodeOfType(nsINode::eXUL)) { contentFrame = NS_NewDocElementBoxFrame(mPresShell, styleContext); } else @@ -4778,7 +4778,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement, if (!isPaginated) { #ifdef MOZ_XUL - if (aDocElement->IsContentOfType(nsIContent::eXUL)) + if (aDocElement->IsNodeOfType(nsINode::eXUL)) { // pass a temporary stylecontext, the correct one will be set later rootFrame = NS_NewRootBoxFrame(mPresShell, viewportPseudoStyle); @@ -4816,11 +4816,11 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement, // 3) nsIScrollable::Scrollbar_Always = scrollbars always // Only need to create a scroll frame/view for cases 2 and 3. - PRBool isHTML = aDocElement->IsContentOfType(nsIContent::eHTML); + PRBool isHTML = aDocElement->IsNodeOfType(nsINode::eHTML); PRBool isXUL = PR_FALSE; if (!isHTML) { - isXUL = aDocElement->IsContentOfType(nsIContent::eXUL); + isXUL = aDocElement->IsNodeOfType(nsINode::eXUL); } // Never create scrollbars for XUL documents @@ -5594,7 +5594,7 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState, { // Ignore the tag if it's not HTML content and if it doesn't extend (via XBL) // a valid HTML namespace. - if (!aContent->IsContentOfType(nsIContent::eHTML) && + if (!aContent->IsNodeOfType(nsINode::eHTML) && aNameSpaceID != kNameSpaceID_XHTML) { return NS_OK; } @@ -6821,7 +6821,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta // and that might need to be propagated. PRBool propagatedScrollToViewport = PR_FALSE; if (aContent->NodeInfo()->Equals(nsHTMLAtoms::body) && - aContent->IsContentOfType(nsIContent::eHTML)) { + aContent->IsNodeOfType(nsINode::eHTML)) { propagatedScrollToViewport = PropagateScrollToViewport() == aContent; } @@ -7165,11 +7165,11 @@ nsCSSFrameConstructor::ResolveStyleContext(nsIFrame* aParentFrame, nsStyleSet *styleSet = mPresShell->StyleSet(); - if (aContent->IsContentOfType(nsIContent::eELEMENT)) { + if (aContent->IsNodeOfType(nsINode::eELEMENT)) { return styleSet->ResolveStyleFor(aContent, parentStyleContext); } else { - NS_ASSERTION(aContent->IsContentOfType(nsIContent::eTEXT), + NS_ASSERTION(aContent->IsNodeOfType(nsINode::eTEXT), "shouldn't waste time creating style contexts for " "comments and processing instructions"); @@ -7506,7 +7506,7 @@ nsCSSFrameConstructor::TestSVGConditions(nsIContent* aContent, nsAutoString value; // Only elements can have tests on them - if (! aContent->IsContentOfType(nsIContent::eELEMENT)) { + if (! aContent->IsNodeOfType(nsINode::eELEMENT)) { aHasRequiredExtensions = PR_FALSE; aHasRequiredFeatures = PR_FALSE; aHasSystemLanguage = PR_FALSE; @@ -7586,7 +7586,7 @@ nsCSSFrameConstructor::SVGSwitchProcessChildren(nsFrameConstructorState& aState, nsIContent* child = aContent->GetChildAt(i); // Skip over children that aren't elements - if (!child->IsContentOfType(nsIContent::eELEMENT)) { + if (!child->IsNodeOfType(nsINode::eELEMENT)) { continue; } @@ -7966,8 +7966,8 @@ nsCSSFrameConstructor::ConstructFrame(nsFrameConstructorState& aState, } // never create frames for comments or PIs - if (aContent->IsContentOfType(nsIContent::eCOMMENT) || - aContent->IsContentOfType(nsIContent::ePROCESSING_INSTRUCTION)) + if (aContent->IsNodeOfType(nsINode::eCOMMENT) || + aContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) return rv; nsRefPtr styleContext; @@ -8075,7 +8075,7 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState, return rv; } - if (aContent->IsContentOfType(nsIContent::eTEXT)) + if (aContent->IsNodeOfType(nsINode::eTEXT)) return ConstructTextFrame(aState, aContent, adjParentFrame, styleContext, *frameItems, pseudoParent); @@ -8966,7 +8966,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer, // find out if the child is a block or inline, an inline means we don't have to reframe nsIContent *child = aContainer->GetChildAt(aNewIndexInContainer); PRBool needReframe = !child; - if (child && child->IsContentOfType(nsIContent::eELEMENT)) { + if (child && child->IsNodeOfType(nsINode::eELEMENT)) { nsRefPtr styleContext; styleContext = ResolveStyleContext(parentFrame, child); // XXX since the block child goes in the last inline of the sacred triad, frames would @@ -9158,7 +9158,7 @@ nsCSSFrameConstructor::NeedSpecialFrameReframe(nsIContent* aParent1, // find out if aChild is a block or inline PRBool childIsBlock = PR_FALSE; - if (aChild->IsContentOfType(nsIContent::eELEMENT)) { + if (aChild->IsNodeOfType(nsINode::eELEMENT)) { nsRefPtr styleContext; styleContext = ResolveStyleContext(aParentFrame, aChild); const nsStyleDisplay* display = styleContext->GetStyleDisplay(); @@ -9267,8 +9267,8 @@ PRBool NotifyListBoxBody(nsPresContext* aPresContext, if (!aContainer) return PR_FALSE; - if (aContainer->IsContentOfType(nsIContent::eXUL) && - aChild->IsContentOfType(nsIContent::eXUL) && + if (aContainer->IsNodeOfType(nsINode::eXUL) && + aChild->IsNodeOfType(nsINode::eXUL) && aContainer->Tag() == nsXULAtoms::listbox && aChild->Tag() == nsXULAtoms::listitem) { nsCOMPtr xulElement = do_QueryInterface(aContainer); @@ -10303,7 +10303,7 @@ InvalidateCanvasIfNeeded(nsIFrame* aFrame) // Check whether it's an HTML body if (node->Tag() != nsHTMLAtoms::body || - !node->IsContentOfType(nsIContent::eHTML)) { + !node->IsNodeOfType(nsINode::eHTML)) { return; } } @@ -10614,7 +10614,7 @@ nsCSSFrameConstructor::RestyleLaterSiblings(nsIContent *aContent) index_end = parent->GetChildCount(); index != index_end; ++index) { nsIContent *child = parent->GetChildAt(index); - if (!child->IsContentOfType(nsIContent::eELEMENT)) + if (!child->IsNodeOfType(nsINode::eELEMENT)) continue; nsIFrame* primaryFrame = mPresShell->GetPrimaryFrameFor(child); @@ -11493,7 +11493,7 @@ nsCSSFrameConstructor::FindPrimaryFrameFor(nsFrameManager* aFrameManager, if (aHint && !*aFrame) { // if we had a hint, and we didn't get a frame, see if we should try the slow way - if (aContent->IsContentOfType(nsIContent::eTEXT)) + if (aContent->IsNodeOfType(nsINode::eTEXT)) { #ifdef NOISY_FINDFRAME FFWC_slowSearchForText++; @@ -11582,7 +11582,7 @@ nsCSSFrameConstructor::GetInsertionPoint(nsIFrame* aParentFrame, // have to look at insertionElement here... if (aMultiple && !*aMultiple) { nsIContent* content = insertionElement ? insertionElement : container; - if (content->IsContentOfType(nsIContent::eHTML) && + if (content->IsNodeOfType(nsINode::eHTML) && content->Tag() == nsHTMLAtoms::fieldset) { *aMultiple = PR_TRUE; } @@ -12324,7 +12324,7 @@ nsCSSFrameConstructor::CreateLetterFrame(nsFrameConstructorState& aState, nsIFrame* aParentFrame, nsFrameItems& aResult) { - NS_PRECONDITION(aTextContent->IsContentOfType(nsIContent::eTEXT), + NS_PRECONDITION(aTextContent->IsNodeOfType(nsINode::eTEXT), "aTextContent isn't text"); // Get style context for the first-letter-frame diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 307751a5a07..6c2fd9c8ac7 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -2696,7 +2696,7 @@ FindElementBackground(nsIFrame* aForFrame, return PR_TRUE; // A pseudo-element frame. nsIContent* content = aForFrame->GetContent(); - if (!content || !content->IsContentOfType(nsIContent::eHTML)) + if (!content || !content->IsNodeOfType(nsINode::eHTML)) return PR_TRUE; // not frame for an HTML element if (!parentFrame) diff --git a/mozilla/layout/base/nsFrameManager.cpp b/mozilla/layout/base/nsFrameManager.cpp index a3fbe403db5..ef08e59daf9 100644 --- a/mozilla/layout/base/nsFrameManager.cpp +++ b/mozilla/layout/base/nsFrameManager.cpp @@ -384,9 +384,9 @@ nsFrameManager::GetPrimaryFrameFor(nsIContent* aContent) do { prevSibling = parent->GetChildAt(--index); } while (index && - (prevSibling->IsContentOfType(nsIContent::eTEXT) || - prevSibling->IsContentOfType(nsIContent::eCOMMENT) || - prevSibling->IsContentOfType(nsIContent::ePROCESSING_INSTRUCTION))); + (prevSibling->IsNodeOfType(nsINode::eTEXT) || + prevSibling->IsNodeOfType(nsINode::eCOMMENT) || + prevSibling->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION))); if (prevSibling) { entry = NS_STATIC_CAST(PrimaryFrameMapEntry*, PL_DHashTableOperate(&mPrimaryFrameMap, prevSibling, @@ -1221,7 +1221,7 @@ nsFrameManager::ReResolveStyleContext(nsPresContext *aPresContext, // Make sure not to do this for pseudo-frames -- those can't have :before // or :after content. Neither can non-elements or leaf frames. if (!pseudoTag && localContent && - localContent->IsContentOfType(nsIContent::eELEMENT) && + localContent->IsNodeOfType(nsINode::eELEMENT) && !aFrame->IsLeaf()) { // Check for a new :before pseudo and an existing :before // frame, but only if the frame is the first continuation. @@ -1247,7 +1247,7 @@ nsFrameManager::ReResolveStyleContext(nsPresContext *aPresContext, // Make sure not to do this for pseudo-frames -- those can't have :before // or :after content. Neither can non-elements or leaf frames. if (!pseudoTag && localContent && - localContent->IsContentOfType(nsIContent::eELEMENT) && + localContent->IsNodeOfType(nsINode::eELEMENT) && !aFrame->IsLeaf()) { // Check for new :after content, but only if the frame is the // last continuation. diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 7bdc6eccd00..a00d863b8ac 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -3938,7 +3938,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, PRBool aScroll) content = do_QueryInterface(node); if (content) { if (content->Tag() == nsHTMLAtoms::a && - content->IsContentOfType(nsIContent::eHTML)) { + content->IsNodeOfType(nsINode::eHTML)) { break; } content = nsnull; @@ -6005,7 +6005,7 @@ PresShell::HandlePositionedEvent(nsIView* aView, // We use weak pointers because during this tight loop, the node // will *not* go away. And this happens on every mousemove. while (targetElement && - !targetElement->IsContentOfType(nsIContent::eELEMENT)) { + !targetElement->IsNodeOfType(nsINode::eELEMENT)) { targetElement = targetElement->GetParent(); } diff --git a/mozilla/layout/forms/nsFormControlHelper.cpp b/mozilla/layout/forms/nsFormControlHelper.cpp index 7879fab82ef..5bb91c7e363 100644 --- a/mozilla/layout/forms/nsFormControlHelper.cpp +++ b/mozilla/layout/forms/nsFormControlHelper.cpp @@ -126,7 +126,7 @@ nsFormControlHelper::GetWrapPropertyEnum(nsIContent * aContent, nsHTMLTextWrap& aWrapProp = eHTMLTextWrap_Soft; // the default nsAutoString wrap; - if (aContent->IsContentOfType(nsIContent::eHTML)) { + if (aContent->IsNodeOfType(nsINode::eHTML)) { static nsIContent::AttrValuesArray strings[] = {&nsHTMLAtoms::HARD, &nsHTMLAtoms::OFF, nsnull}; diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 52d6a53f959..84f9826ec52 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -451,7 +451,7 @@ void nsListControlFrame::PaintFocus(nsIRenderingContext& aRC, nsPoint aPt) // it's an element. Text frames need not apply. childframe = containerFrame->GetFirstChild(nsnull); if (childframe && - !childframe->GetContent()->IsContentOfType(nsIContent::eELEMENT)) { + !childframe->GetContent()->IsNodeOfType(nsINode::eELEMENT)) { childframe = nsnull; } result = NS_OK; @@ -579,14 +579,14 @@ static inline PRBool IsOptGroup(nsIContent *aContent) { return (aContent->NodeInfo()->Equals(nsHTMLAtoms::optgroup) && - aContent->IsContentOfType(nsIContent::eHTML)); + aContent->IsNodeOfType(nsINode::eHTML)); } static inline PRBool IsOption(nsIContent *aContent) { return (aContent->NodeInfo()->Equals(nsHTMLAtoms::option) && - aContent->IsContentOfType(nsIContent::eHTML)); + aContent->IsNodeOfType(nsINode::eHTML)); } static PRUint32 diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index ec4531344a7..e3e9c0f2d98 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -6815,7 +6815,7 @@ PRBool nsBlockFrame::FrameStartsCounterScope(nsIFrame* aFrame) { nsIContent* content = aFrame->GetContent(); - if (!content || !content->IsContentOfType(nsIContent::eHTML)) + if (!content || !content->IsNodeOfType(nsINode::eHTML)) return PR_FALSE; nsIAtom *localName = content->NodeInfo()->NameAtom(); diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index dc3ec8e3844..f56c23cc1fc 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -375,7 +375,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext, nsIContent *rootElem = doc->GetRootContent(); if (!doc->GetParentDocument() && (nsCOMPtr(doc->GetContainer())) && - rootElem && rootElem->IsContentOfType(nsIContent::eXUL)) { + rootElem && rootElem->IsNodeOfType(nsINode::eXUL)) { // we're XUL at the root of the document hierarchy. Try to make our // window translucent. // don't proceed unless this is the root view diff --git a/mozilla/layout/generic/nsFirstLetterFrame.cpp b/mozilla/layout/generic/nsFirstLetterFrame.cpp index 2b70acf37fe..818bdeef4f5 100644 --- a/mozilla/layout/generic/nsFirstLetterFrame.cpp +++ b/mozilla/layout/generic/nsFirstLetterFrame.cpp @@ -328,7 +328,7 @@ nsFirstLetterFrame::DrainOverflowFrames(nsPresContext* aPresContext) nsRefPtr sc; nsIContent* kidContent = kid->GetContent(); if (kidContent) { - NS_ASSERTION(kidContent->IsContentOfType(nsIContent::eTEXT), + NS_ASSERTION(kidContent->IsNodeOfType(nsINode::eTEXT), "should contain only text nodes"); sc = aPresContext->StyleSet()->ResolveStyleForNonElement(mStyleContext); if (sc) { diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index e71394bcda3..8f7ff9e824a 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -3363,7 +3363,7 @@ nsresult nsFrame::MakeFrameName(const nsAString& aType, nsAString& aResult) const { aResult = aType; - if (mContent && !mContent->IsContentOfType(nsIContent::eTEXT)) { + if (mContent && !mContent->IsNodeOfType(nsINode::eTEXT)) { nsAutoString buf; mContent->Tag()->ToString(buf); aResult.Append(NS_LITERAL_STRING("(") + buf + NS_LITERAL_STRING(")")); @@ -4942,12 +4942,12 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex, PRBool aWithMouse) } PRBool isFocusable = PR_FALSE; - if (mContent && mContent->IsContentOfType(nsIContent::eELEMENT) && + if (mContent && mContent->IsNodeOfType(nsINode::eELEMENT) && AreAncestorViewsVisible()) { const nsStyleVisibility* vis = GetStyleVisibility(); if (vis->mVisible != NS_STYLE_VISIBILITY_COLLAPSE && vis->mVisible != NS_STYLE_VISIBILITY_HIDDEN) { - if (mContent->IsContentOfType(nsIContent::eHTML)) { + if (mContent->IsNodeOfType(nsINode::eHTML)) { nsCOMPtr container(GetPresContext()->GetContainer()); nsCOMPtr editorDocShell(do_QueryInterface(container)); if (editorDocShell) { @@ -4967,7 +4967,7 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex, PRBool aWithMouse) isFocusable = mContent->IsFocusable(&tabIndex); if (!isFocusable && !aWithMouse && GetType() == nsLayoutAtoms::scrollFrame && - mContent->IsContentOfType(nsIContent::eHTML) && + mContent->IsNodeOfType(nsINode::eHTML) && !mContent->IsNativeAnonymous() && mContent->GetParent() && !mContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex)) { // Elements with scrollable view are focusable with script & tabbable diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 6d6efbb24a1..e73db23f405 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -319,7 +319,7 @@ nsSubDocumentFrame::GetDesiredSize(nsPresContext* aPresContext, { // processing does not use this routine, only