Commit 5a94587f authored by yurina@chromium.org's avatar yurina@chromium.org

Reject pseudo class inside :not()

The current behavior, pseudo classes inside :not() work when they used in the <content select=””> context,  however, it does not satisfy the matching criteria.
This patch reject them.


BUG=389003

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181726 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 80e0d5da
......@@ -162,6 +162,18 @@ div, div:first-of-type
PASS internals.isValidContentSelect(content) is false
div:first-of-type, div:last-of-type
PASS internals.isValidContentSelect(content) is false
div:not(:not(div))
PASS internals.isValidContentSelect(content) is false
div:not(:hover)
PASS internals.isValidContentSelect(content) is false
div:not(div div)
PASS internals.isValidContentSelect(content) is false
div:not(div div:not)
PASS internals.isValidContentSelect(content) is false
div:not(div div:hover)
PASS internals.isValidContentSelect(content) is false
div div:not(:hover)
PASS internals.isValidContentSelect(content) is false
null
PASS internals.isValidContentSelect(content) is true
......
......@@ -51,7 +51,7 @@ var dataOfInvalidCases = [
'div:nth-last-of-type(1)', 'div:first-child', 'div:last-child', 'div:first-of-type',
'div:last-of-type', 'div:only-of-type',
'div:first-of-type:last-of-type', 'div.elem:visited', '*:visited',
'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:last-of-type',
'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:last-of-type', 'div:not(:not(div))', 'div:not(:hover)', 'div:not(div div)', 'div:not(div div:not)', 'div:not(div div:hover)', 'div div:not(:hover)',
];
var dataOfValidCasesIfPseudoClassIsAllowed = [
......
......@@ -81,7 +81,11 @@ void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
static inline bool includesDisallowedPseudoClass(const CSSSelector& selector)
{
return selector.match() == CSSSelector::PseudoClass && selector.pseudoType() != CSSSelector::PseudoNot;
if (selector.pseudoType() == CSSSelector::PseudoNot) {
const CSSSelector* subSelector = selector.selectorList()->first();
return subSelector->match() == CSSSelector::PseudoClass;
}
return selector.match() == CSSSelector::PseudoClass;
}
bool HTMLContentElement::validateSelect() const
......
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