diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2023-02-21 19:54:31 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2023-02-22 14:00:43 +0800 |
commit | 4493017fd84076504e5017be329cd4d72e8dc175 (patch) | |
tree | 138919d6e09e388f8315d5310c7ff6ba005839ec /layout | |
parent | f2ef28d09c65269029ee1ac5c65524a89423008a (diff) | |
download | uxp-4493017fd84076504e5017be329cd4d72e8dc175.tar.gz |
Issue #2078 - Follow-up: Move isForgiving check to ParsePseudoClassWithSelectorListArg
Diffstat (limited to 'layout')
-rw-r--r-- | layout/style/nsCSSParser.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 63a9bc0514..9bdb202ace 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -781,8 +781,7 @@ protected: CSSPseudoClassType aType); nsSelectorParsingStatus ParsePseudoClassWithSelectorListArg(nsCSSSelector& aSelector, - CSSPseudoClassType aType, - bool aIsForgiving); + CSSPseudoClassType aType); nsSelectorParsingStatus ParseNegatedSimpleSelector(int32_t& aDataMask, nsCSSSelector& aSelector); @@ -6166,11 +6165,8 @@ CSSParserImpl::ParsePseudoSelector(int32_t& aDataMask, else { MOZ_ASSERT(nsCSSPseudoClasses::HasSelectorListArg(pseudoClassType), "unexpected pseudo with function token"); - bool isForgiving = - nsCSSPseudoClasses::HasForgivingSelectorListArg(pseudoClassType); parsingStatus = ParsePseudoClassWithSelectorListArg(aSelector, - pseudoClassType, - isForgiving); + pseudoClassType); } if (eSelectorParsingStatus_Continue != parsingStatus) { if (eSelectorParsingStatus_Error == parsingStatus) { @@ -6539,11 +6535,13 @@ CSSParserImpl::ParsePseudoClassWithNthPairArg(nsCSSSelector& aSelector, // CSSParserImpl::nsSelectorParsingStatus CSSParserImpl::ParsePseudoClassWithSelectorListArg(nsCSSSelector& aSelector, - CSSPseudoClassType aType, - bool aIsForgiving) + CSSPseudoClassType aType) { + bool isForgiving = + nsCSSPseudoClasses::HasForgivingSelectorListArg(aType); + nsAutoPtr<nsCSSSelectorList> slist; - if (! ParseSelectorList(*getter_Transfers(slist), char16_t(')'), aIsForgiving)) { + if (! ParseSelectorList(*getter_Transfers(slist), char16_t(')'), isForgiving)) { return eSelectorParsingStatus_Error; // our caller calls SkipUntil(')') } @@ -6555,13 +6553,13 @@ CSSParserImpl::ParsePseudoClassWithSelectorListArg(nsCSSSelector& aSelector, for (nsCSSSelectorList *l = slist; l; l = l->mNext) { nsCSSSelector *s = l->mSelectors; if (s == nullptr) { - MOZ_ASSERT(aIsForgiving, + MOZ_ASSERT(isForgiving, "unexpected empty selector in unforgiving selector list"); break; } // Check that none of the selectors in the list have combinators or // pseudo-elements. - if ((!aIsForgiving && s->mNext) || s->IsPseudoElement()) { + if ((!isForgiving && s->mNext) || s->IsPseudoElement()) { return eSelectorParsingStatus_Error; // our caller calls SkipUntil(')') } } |