diff --git a/content/base/src/nsDOMTokenList.h b/content/base/src/nsDOMTokenList.h index 1e09a1706df..2d0f5e556c4 100644 --- a/content/base/src/nsDOMTokenList.h +++ b/content/base/src/nsDOMTokenList.h @@ -63,7 +63,7 @@ protected: if (!mElement) { return nsnull; } - return mElement->GetParsedAttr(mAttrAtom); + return mElement->GetAttrInfo(kNameSpaceID_None, mAttrAtom).mValue; } nsresult CheckToken(const nsAString& aStr); diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index 3103dd014a0..70164c1dad0 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -746,6 +746,16 @@ public: nsIDOMDOMTokenList* GetClassList(nsresult *aResult); PRBool MozMatchesSelector(const nsAString& aSelector); + /** + * Get the attr info for the given namespace ID and attribute name. The + * namespace ID must not be kNameSpaceID_Unknown and the name must not be + * null. Note that this can only return info on attributes that actually + * live on this element (and is only virtual to handle XUL prototypes). That + * is, this should only be called from methods that only care about attrs + * that effectively live in mAttrsAndChildren. + */ + virtual nsAttrInfo GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const; + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsGenericElement) protected: @@ -863,16 +873,6 @@ protected: nsISupports** aTarget, PRBool* aDefer); - /** - * Get the attr info for the given namespace ID and attribute name. The - * namespace ID must not be kNameSpaceID_Unknown and the name must not be - * null. Note that this can only return info on attributes that actually - * live on this element (and is only virtual to handle XUL prototypes). That - * is, this should only be called from methods that only care about attrs - * that effectively live in mAttrsAndChildren. - */ - virtual nsAttrInfo GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const; - /** * Copy attributes and state to another element * @param aDest the object to copy to diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index a41119e50e6..1f6bae8f7fe 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -393,6 +393,7 @@ _TEST_FILES2 = \ file_bug548193.sjs \ test_html_colors_quirks.html \ test_html_colors_standards.html \ + test_bug571390.xul \ $(NULL) # This test fails on the Mac for some reason diff --git a/content/base/test/test_bug571390.xul b/content/base/test/test_bug571390.xul new file mode 100644 index 00000000000..e761bc2de15 --- /dev/null +++ b/content/base/test/test_bug571390.xul @@ -0,0 +1,43 @@ + + + + + + + diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h index 9eafcfd793f..cd1a56222f2 100644 --- a/content/xul/content/src/nsXULElement.h +++ b/content/xul/content/src/nsXULElement.h @@ -577,6 +577,13 @@ public: mBindingParent = aBindingParent; } + /** + * Get the attr info for the given namespace ID and attribute name. + * The namespace ID must not be kNameSpaceID_Unknown and the name + * must not be null. + */ + virtual nsAttrInfo GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const; + protected: // XXX This can be removed when nsNodeUtils::CloneAndAdopt doesn't need // access to mPrototype anymore. @@ -627,13 +634,6 @@ protected: */ nsresult MakeHeavyweight(); - /** - * Get the attr info for the given namespace ID and attribute name. - * The namespace ID must not be kNameSpaceID_Unknown and the name - * must not be null. - */ - virtual nsAttrInfo GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const; - const nsAttrValue* FindLocalOrProtoAttr(PRInt32 aNameSpaceID, nsIAtom *aName) const { return nsXULElement::GetAttrInfo(aNameSpaceID, aName).mValue;