Don't invalidate style unnecessarily when setting inline style cssText
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2016 16:46:12 +0000 (16:46 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2016 16:46:12 +0000 (16:46 +0000)
commitcd43d88f7b3a361e6e34de27af6a2bffc552e81c
tree0643bce0c3a718e84c8489df2afe85f03c197134
parent4c133bacd67330c626cb913a4309d01da5877185
Don't invalidate style unnecessarily when setting inline style cssText
https://bugs.webkit.org/show_bug.cgi?id=155541
rdar://problem/23318893

Reviewed by Simon Fraser.

Source/WebCore:

We currently invalidate style when cssText is set whether the style declaration changed or not.

Based on a patch by Simon.

Test: fast/css/style-invalidation-inline-csstext.html

* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::cssText):
(WebCore::PropertySetCSSStyleDeclaration::setCssText):

    Invalidate only if the parsed style changed.

* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::parseDeclaration):

    Compare the original and new style after parsing, return result.

* css/StyleProperties.h:

LayoutTests:

* fast/css/style-invalidation-inline-csstext-expected.txt: Added.
* fast/css/style-invalidation-inline-csstext.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/style-invalidation-inline-csstext-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/style-invalidation-inline-csstext.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
Source/WebCore/css/StyleProperties.cpp
Source/WebCore/css/StyleProperties.h