Commit acce4131 authored by rune's avatar rune Committed by Commit bot

Marked parsing as failed for invalid compound.

If we return nullptr trying to consume a compound, and all tokens have
been consumed, we don't recognize that as a parse failure if a valid
selector precedes the compound. Set m_failedParsing to true to notice
we have an invalid selector.

R=timloh@chromium.org
BUG=581257

Review URL: https://codereview.chromium.org/1634273003

Cr-Commit-Position: refs/heads/master@{#371760}
parent ab8cca20
......@@ -291,8 +291,10 @@ PassOwnPtr<CSSParserSelector> CSSSelectorParser::consumeCompoundSelector(CSSPars
// TODO(rune@opera.com): crbug.com/578131
// The UASheetMode check is a work-around to allow this selector in mediaControls(New).css:
// video::-webkit-media-text-track-region-container.scrolling
if (m_context.mode() != UASheetMode && !isSimpleSelectorValidAfterPseudoElement(*simpleSelector.get(), compoundPseudoElement))
if (m_context.mode() != UASheetMode && !isSimpleSelectorValidAfterPseudoElement(*simpleSelector.get(), compoundPseudoElement)) {
m_failedParsing = true;
return nullptr;
}
if (simpleSelector->match() == CSSSelector::PseudoElement)
compoundPseudoElement = simpleSelector->pseudoType();
......
......@@ -190,7 +190,8 @@ TEST(CSSSelectorParserTest, InvalidSimpleAfterPseudoElementInCompound)
"::shadow:not(::after)",
"::content:not(#id)",
"::-webkit-scrollbar:vertical:not(:first-child)",
"video::-webkit-media-text-track-region-container.scrolling"
"video::-webkit-media-text-track-region-container.scrolling",
"div ::before.a"
};
for (auto testCase : testCases) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment