Generalize the compilation of :not() to support arbitrary selector lists
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 00:43:29 +0000 (00:43 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 00:43:29 +0000 (00:43 +0000)
commitdf8e5a69b08c132cdce518b545d9987460f2fcce
tree436c393d218ef41481d2d44257e521582855c8ae
parent029ecd981fef3aeafe14942a1543661a0d8faeec
Generalize the compilation of :not() to support arbitrary selector lists
https://bugs.webkit.org/show_bug.cgi?id=137843

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-10-20
Reviewed by Andreas Kling.

This builds :not() on top of the code created for :nth-child(An+B of selectorList)
to support any selector list.

The tests for the JIT were added previously:
-not-boundaries.html
-not-backtracking.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
Any :not() of a selector is handled through a simple selector list. Cases like
:not(foo, bar) simply generate not([fragmentFoo, bragmentBar]).

Old cases like :not(foo):not(bar) simply add those cases to the selector list,
generating not([fragmentFoo, bragmentBar]).

(WebCore::SelectorCompiler::minimumRegisterRequirements):
Register pressure is now tracked through computeBacktrackingMemoryRequirements.

(WebCore::SelectorCompiler::hasAnyCombinators):
(WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
(WebCore::SelectorCompiler::computeBacktrackingInformation):
Abstract the code creating Selector Lists from :nth-child(of). Use that for :not()
and  :nth-child(of).

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesNotPseudoClass):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/cssjit/SelectorCompiler.cpp