Factor common code in Style::*ChangeInvalidation into helper functions
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2017 14:45:29 +0000 (14:45 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2017 14:45:29 +0000 (14:45 +0000)
commit7e7d19d58ef6dea4e54412e1de9472b2b526ee04
tree13adfcc87e3c88f39548198a1b388216eeceabe2
parentfeb53887fe10db42156269162e64efa3109c8502
Factor common code in Style::*ChangeInvalidation into helper functions
https://bugs.webkit.org/show_bug.cgi?id=174312

Reviewed by Andreas Kling.

There is a lot of copy code here.

* Style/StyleInvalidationFunctions.h: Added.
(WebCore::Style::traverseRuleFeaturesInShadowTree):
(WebCore::Style::traverseRuleFeaturesForSlotted):
(WebCore::Style::traverseRuleFeatures):

    Add functions for traversing rule features that may affect style of an element.
    Use lambdas to implement client-specific behavior.

* WebCore.xcodeproj/project.pbxproj:
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByAttributeChange):
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostRules): Deleted.
(WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostRules): Deleted.
(WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
* style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostRules): Deleted.
(WebCore::Style::mayBeAffectedBySlottedRules): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/style/AttributeChangeInvalidation.cpp
Source/WebCore/style/ClassChangeInvalidation.cpp
Source/WebCore/style/IdChangeInvalidation.cpp
Source/WebCore/style/StyleInvalidationFunctions.h [new file with mode: 0644]