REGRESSION (r104445): Style is not recomputed on serenaandlily.com
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 16:37:10 +0000 (16:37 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 16:37:10 +0000 (16:37 +0000)
commit7fb0ed2add3fd002933e1492194957f8e6ea058d
tree31a4c182f23b9fb6b815761047726cb2adfa7668
parent58012bc65fba4a066f0d305e3cae856486b33132
REGRESSION (r104445): Style is not recomputed on serenaandlily.com
https://bugs.webkit.org/show_bug.cgi?id=83663

Source/WebCore:

Reviewed by Andreas Kling.

CSS class and id selectors are case insensitive in non-strict modes. The code
that invalidated the scope elements used getElementByID() which is case
sensitive in all modes. As a result we would fail to invalidate elements
that would match a style rule but used different case in id.

The new code invalidates by crawling the DOM tree. This often (when there are classes)
actually faster than the existing code as we can now handle everything in a single pass.
Each class scope required a crawl with the old code.

The code uses the same functions as the selector matching code to get the same behavior.

The maximum class limit is lifted as number of classes does not affect complexity anymore.

Test: fast/css/id-or-class-before-stylesheet-strict.html

* css/SelectorChecker.h:
(WebCore::SelectorChecker::elementMatchesSelectorScopes):
(WebCore):
* dom/Document.cpp:
(WebCore::Document::testAddedStylesheetRequiresStyleRecalc):
(WebCore):

LayoutTests:

Reviewed by Andreas Kling.

Update the existing test with case insensitive comparisons and add a strict mode test.

* fast/css/id-or-class-before-stylesheet-expected.txt:
* fast/css/id-or-class-before-stylesheet-strict-expected.txt: Added.
* fast/css/id-or-class-before-stylesheet-strict.html: Added.
* fast/css/id-or-class-before-stylesheet.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/id-or-class-before-stylesheet-expected.txt
LayoutTests/fast/css/id-or-class-before-stylesheet-strict-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/id-or-class-before-stylesheet-strict.html [new file with mode: 0644]
LayoutTests/fast/css/id-or-class-before-stylesheet.html
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.h
Source/WebCore/dom/Document.cpp