REGRESSION (r132941): attribute modification 10% performance regression
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 19:41:08 +0000 (19:41 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 19:41:08 +0000 (19:41 +0000)
commitfdc49a278b10f028c1acf76845ea2eebf4f7453b
tree65709cc310f507e73187bd4dd9988863bb0beb24
parent6b29b41ce46d75792855d26fa234a71e6b7701cc
REGRESSION (r132941): attribute modification 10% performance regression
https://bugs.webkit.org/show_bug.cgi?id=100873

Reviewed by Ojan Vafai.

Don't do the class change finding by mutating SpaceSplitString. It is slow. Instead use a bit vector
to mark the unchanged classes

* css/StyleResolver.cpp:
(WebCore):
* css/StyleResolver.h:
(WebCore::StyleResolver::hasSelectorForAttribute):
(WebCore):
(WebCore::StyleResolver::hasSelectorForClass):
(WebCore::StyleResolver::hasSelectorForId):

    Inlined these and moved value validity testing to clients.

* dom/Element.cpp:
(WebCore::checkNeedsStyleInvalidationForIdChange):
(WebCore):
(WebCore::Element::attributeChanged):

    Clean up id testing too.

(WebCore::checkNeedsStyleInvalidationForClassChange):

    Use bit vector for marking seen values. Avoids allocations and reffing.

(WebCore::Element::classAttributeChanged):

    Don't test if style is already invalid.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/dom/Element.cpp