diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp
index 3ef86e4853d..d7e7bf73004 100644
--- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp
@@ -1607,15 +1607,6 @@ nsGenericHTMLElement::GetHrefURIForAnchors(nsIURI** aURI)
return NS_OK;
}
-PRInt32
-nsGenericHTMLElement::GetNameSpaceID() const
-{
- // XXX
- // XXX This is incorrect!!!!!!!!!!!!!!!!
- // XXX
- return kNameSpaceID_XHTML;
-}
-
nsresult
nsGenericHTMLElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aAttribute,
nsIAtom* aPrefix, const nsAString& aValue,
diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.h b/mozilla/content/html/content/src/nsGenericHTMLElement.h
index 1111ababf49..ab6ed44c10a 100644
--- a/mozilla/content/html/content/src/nsGenericHTMLElement.h
+++ b/mozilla/content/html/content/src/nsGenericHTMLElement.h
@@ -174,7 +174,6 @@ public:
// Implementation for nsIContent
virtual void SetDocument(nsIDocument* aDocument, PRBool aDeep,
PRBool aCompileEventHandlers);
- virtual PRInt32 GetNameSpaceID() const;
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, PRBool aNotify)
{
diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp
index fd038bf2bd6..b8eb2bcb99e 100644
--- a/mozilla/layout/style/nsCSSStyleSheet.cpp
+++ b/mozilla/layout/style/nsCSSStyleSheet.cpp
@@ -2846,9 +2846,6 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext,
// we hold no ref to the content...
mContent = aContent;
- // get the namespace
- mNameSpaceID = aContent->GetNameSpaceID();
-
// get the tag and parent
mContentTag = aContent->Tag();
mParentContent = aContent->GetParent();
@@ -2866,8 +2863,17 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext,
mHasAttributes = aContent->GetAttrCount() > 0;
// check for HTMLContent and Link status
- if (aContent->IsContentOfType(nsIContent::eHTML))
+ if (aContent->IsContentOfType(nsIContent::eHTML)) {
mIsHTMLContent = PR_TRUE;
+ // Note that we want to treat non-XML HTML content as XHTML for namespace
+ // purposes, since html.css has that namespace declared.
+ mNameSpaceID = kNameSpaceID_XHTML;
+ } else {
+ // get the namespace
+ mNameSpaceID = aContent->GetNameSpaceID();
+ }
+
+
// if HTML content and it has some attributes, check for an HTML link
// NOTE: optimization: cannot be a link if no attributes (since it needs an href)