Allow RenderStyles marked unique in matched properties cache
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 May 2016 18:32:43 +0000 (18:32 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 May 2016 18:32:43 +0000 (18:32 +0000)
commit09b64350715c7a0c926ede20e8ec636c4ab9d73e
treeeedafe6bbca7bbe7e1fb568199ca58cea03efc51
parent7a11ce4f180a40095dd3227330186b1fcb7ea0f1
Allow RenderStyles marked unique in matched properties cache
https://bugs.webkit.org/show_bug.cgi?id=157844

Reviewed by Andreas Kling.

Depending on content this can improve matched properties cache hit rate quite a bit and so reduce
time spent building styles.

* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueContent):

    Set the attr bit on render style.

* css/StyleResolver.cpp:
(WebCore::isCacheableInMatchedPropertiesCache):

    Allow caching of styles marked "unique". It only means that they are not shareable by style
    sharing code because there were some complex selectors in the rules used for building them. It
    doesn't affect matched properties cache the cache how the properties were resolved.

    We still need to test against "content: attr()" as that makes the style depend on the element
    being matched. It now has a separate bit in RenderStyle.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setHasAttrContent):

    Bit for "content: attr()". It also sets unique() to keep style sharing code happy.

(WebCore::requireTransformOrigin):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::hasAttrContent):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h