| Index: Source/WebCore/css/SelectorChecker.cpp
|
| ===================================================================
|
| --- Source/WebCore/css/SelectorChecker.cpp (revision 119628)
|
| +++ Source/WebCore/css/SelectorChecker.cpp (working copy)
|
| @@ -729,10 +729,15 @@
|
| if (selector->m_match == CSSSelector::PseudoClass) {
|
| // Handle :not up front.
|
| if (selector->pseudoType() == CSSSelector::PseudoNot) {
|
| - ASSERT(selector->selectorList());
|
| + CSSSelectorList* selectorList = selector->selectorList();
|
| +
|
| + // FIXME: We probably should fix the parser and make it never produce :not rules with missing selector list.
|
| + if (!selectorList)
|
| + return false;
|
| +
|
| SelectorCheckingContext subContext(context);
|
| subContext.isSubSelector = true;
|
| - for (subContext.selector = selector->selectorList()->first(); subContext.selector; subContext.selector = subContext.selector->tagHistory()) {
|
| + for (subContext.selector = selectorList->first(); subContext.selector; subContext.selector = subContext.selector->tagHistory()) {
|
| // :not cannot nest. I don't really know why this is a
|
| // restriction in CSS3, but it is, so let's honor it.
|
| // the parser enforces that this never occurs
|
| @@ -1321,13 +1326,19 @@
|
| for (; selector; selector = selector->tagHistory()) {
|
| switch (selector->pseudoType()) {
|
| case CSSSelector::PseudoNot:
|
| - // :not(:visited) is equivalent to :link. Parser enforces that :not can't nest.
|
| - for (CSSSelector* subSelector = selector->selectorList()->first(); subSelector; subSelector = subSelector->tagHistory()) {
|
| - CSSSelector::PseudoType subType = subSelector->pseudoType();
|
| - if (subType == CSSSelector::PseudoVisited)
|
| - linkMatchType &= ~SelectorChecker::MatchVisited;
|
| - else if (subType == CSSSelector::PseudoLink)
|
| - linkMatchType &= ~SelectorChecker::MatchLink;
|
| + {
|
| + // :not(:visited) is equivalent to :link. Parser enforces that :not can't nest.
|
| + CSSSelectorList* selectorList = selector->selectorList();
|
| + if (!selectorList)
|
| + break;
|
| +
|
| + for (CSSSelector* subSelector = selectorList->first(); subSelector; subSelector = subSelector->tagHistory()) {
|
| + CSSSelector::PseudoType subType = subSelector->pseudoType();
|
| + if (subType == CSSSelector::PseudoVisited)
|
| + linkMatchType &= ~SelectorChecker::MatchVisited;
|
| + else if (subType == CSSSelector::PseudoLink)
|
| + linkMatchType &= ~SelectorChecker::MatchLink;
|
| + }
|
| }
|
| break;
|
| case CSSSelector::PseudoLink:
|
|
|