Skip to content
Permalink
Browse files
Upgrade to SelectorFailsAllSiblings when Child selector is failed.
https://bugs.webkit.org/show_bug.cgi?id=130961

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2014-04-04
Reviewed by Benjamin Poulain.

When Child selector fails, we should resume matching from the closest
Descendant selector.
So upgrading SelectorFailsLocally to SelectorFailsAllSibling at least
to prevent unnecessary direct/indirect adjacent selectors matching.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):


Canonical link: https://commits.webkit.org/149293@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Constellation authored and BenjaminPoulain committed Apr 4, 2014
1 parent c36e17a commit 346158873128eb138ad9d1f0b5a07b8caa8ab750
Showing 2 changed files with 26 additions and 6 deletions.
@@ -1,3 +1,18 @@
2014-04-04 Yusuke Suzuki <utatane.tea@gmail.com>

Upgrade to SelectorFailsAllSiblings when Child selector is failed.
https://bugs.webkit.org/show_bug.cgi?id=130961

Reviewed by Benjamin Poulain.

When Child selector fails, we should resume matching from the closest
Descendant selector.
So upgrading SelectorFailsLocally to SelectorFailsAllSibling at least
to prevent unnecessary direct/indirect adjacent selectors matching.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):

2014-04-04 Roger Fong <roger_fong@apple.com>

Keep track of filtered active attribute/uniform indices per shader program.
@@ -211,12 +211,17 @@ SelectorChecker::Match SelectorChecker::matchRecursively(const SelectorCheckingC
return SelectorFailsCompletely;

case CSSSelector::Child:
nextContext.element = context.element->parentElement();
if (!nextContext.element)
return SelectorFailsCompletely;
nextContext.isSubSelector = false;
nextContext.elementStyle = 0;
return matchRecursively(nextContext, ignoreDynamicPseudo);
{
nextContext.element = context.element->parentElement();
if (!nextContext.element)
return SelectorFailsCompletely;
nextContext.isSubSelector = false;
nextContext.elementStyle = nullptr;
Match match = matchRecursively(nextContext, ignoreDynamicPseudo);
if (match == SelectorMatches || match == SelectorFailsCompletely)
return match;
return SelectorFailsAllSiblings;
}

case CSSSelector::DirectAdjacent:
if (m_mode == ResolvingStyle) {

0 comments on commit 3461588

Please sign in to comment.