diff --git a/content/base/test/file_bug416317.xhtml b/content/base/test/file_bug416317.xhtml index 6f735c2e05fc..a2a037a6adf7 100644 --- a/content/base/test/file_bug416317.xhtml +++ b/content/base/test/file_bug416317.xhtml @@ -494,7 +494,6 @@ return root[select](q, resolver); } catch(e){ if ( e.message.indexOf("ERR") > -1 || - (e.name == "NamespaceError" && e.code == DOMException.NAMESPACE_ERR) || (e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR) ) throw e; } @@ -549,7 +548,7 @@ results = query(q, resolver); } catch(e) { pass = (e.message === "bad ERROR" || - (e.name == "NamespaceError" && e.code == DOMException.NAMESPACE_ERR)); + (e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR)); } assert( pass, type + ": " + name + " Bad Resolver #" + (i+1) + " (" + nq + ")" + diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index a406343678da..c0c82813cb9d 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -592,7 +592,7 @@ protected: /* Find and return the namespace ID associated with aPrefix. If aPrefix has not been declared in an @namespace rule, returns - kNameSpaceID_Unknown and sets mFoundUnresolvablePrefix to true. */ + kNameSpaceID_Unknown. */ PRInt32 GetNamespaceIdForPrefix(const nsString& aPrefix); /* Find the correct default namespace, and set it on aSelector. */ @@ -652,10 +652,6 @@ protected: // some quirks during shorthand parsing bool mParsingCompoundProperty : 1; - // GetNamespaceIdForPrefix will set mFoundUnresolvablePrefix to true - // when it encounters a prefix that is not mapped to a namespace. - bool mFoundUnresolvablePrefix : 1; - #ifdef DEBUG bool mScannerInited : 1; #endif @@ -740,8 +736,7 @@ CSSParserImpl::CSSParserImpl() mNavQuirkMode(false), mUnsafeRulesEnabled(false), mHTMLMediaMode(false), - mParsingCompoundProperty(false), - mFoundUnresolvablePrefix(false) + mParsingCompoundProperty(false) #ifdef DEBUG , mScannerInited(false) #endif @@ -1193,12 +1188,7 @@ CSSParserImpl::ParseSelectorString(const nsSubstring& aSelectorString, AssertInitialState(); - // This is the only place that cares about mFoundUnresolvablePrefix, - // so this is the only place that bothers clearing it. - mFoundUnresolvablePrefix = false; - bool success = ParseSelectorList(*aSelectorList, PRUnichar(0)); - bool prefixErr = mFoundUnresolvablePrefix; // We deliberately do not call OUTPUT_ERROR here, because all our // callers map a failure return to a JS exception, and if that JS @@ -1217,8 +1207,6 @@ CSSParserImpl::ParseSelectorString(const nsSubstring& aSelectorString, } NS_ASSERTION(!*aSelectorList, "Shouldn't have list!"); - if (prefixErr) - return NS_ERROR_DOM_NAMESPACE_ERR; return NS_ERROR_DOM_SYNTAX_ERR; } @@ -9250,7 +9238,6 @@ CSSParserImpl::GetNamespaceIdForPrefix(const nsString& aPrefix) aPrefix.get() }; REPORT_UNEXPECTED_P(PEUnknownNamespacePrefix, params); - mFoundUnresolvablePrefix = true; } return nameSpaceID;