diff --git a/layout/reftests/forms/input/number/number-pseudo-elements-ref.html b/layout/reftests/forms/input/number/number-pseudo-elements-ref.html new file mode 100644 index 00000000000..263aeff1f81 --- /dev/null +++ b/layout/reftests/forms/input/number/number-pseudo-elements-ref.html @@ -0,0 +1,6 @@ + + +
+ + + diff --git a/layout/reftests/forms/input/number/number-pseudo-elements.html b/layout/reftests/forms/input/number/number-pseudo-elements.html new file mode 100644 index 00000000000..33cf40fcf24 --- /dev/null +++ b/layout/reftests/forms/input/number/number-pseudo-elements.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/layout/reftests/forms/input/number/reftest.list b/layout/reftests/forms/input/number/reftest.list index de618b34912..cfc448602d0 100644 --- a/layout/reftests/forms/input/number/reftest.list +++ b/layout/reftests/forms/input/number/reftest.list @@ -20,3 +20,6 @@ fuzzy-if(/^Windows\x20NT\x205\.1/.test(http.oscpu),64,4) fuzzy-if(cocoaWidget,63 # focus fails-if(B2G) needs-focus == focus-handling.html focus-handling-ref.html # bug 940760 +# pseudo-elements not usable from content: +== number-pseudo-elements.html number-pseudo-elements-ref.html + diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 92227cd7ab5..931cb3632cf 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -3661,6 +3661,18 @@ CSSParserImpl::ParsePseudoSelector(int32_t& aDataMask, nsCSSPseudoClasses::Type pseudoClassType = nsCSSPseudoClasses::GetPseudoType(pseudo); + if (!mUnsafeRulesEnabled && + (pseudoElementType == nsCSSPseudoElements::ePseudo_mozNumberWrapper || + pseudoElementType == nsCSSPseudoElements::ePseudo_mozNumberText || + pseudoElementType == nsCSSPseudoElements::ePseudo_mozNumberSpinBox || + pseudoElementType == nsCSSPseudoElements::ePseudo_mozNumberSpinUp || + pseudoElementType == nsCSSPseudoElements::ePseudo_mozNumberSpinDown)) { + // Hide these pseudo-elements from content until we standardize them. + REPORT_UNEXPECTED_TOKEN(PEPseudoSelUnknown); + UngetToken(); + return eSelectorParsingStatus_Error; + } + // We currently allow :-moz-placeholder and ::-moz-placeholder. We have to // be a bit stricter regarding the pseudo-element parsing rules. if (pseudoElementType == nsCSSPseudoElements::ePseudo_mozPlaceholder &&