Avoid unnecessary copy-on-write in FillLayer style application.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Nov 2013 16:20:16 +0000 (16:20 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Nov 2013 16:20:16 +0000 (16:20 +0000)
commit3aa2873674e56bc6a44909aaaddd656b5b95309f
treef61873fa13e1ea191aec2d9e8b95298481f0c63b
parent54dc3d36d11abe3b4fcb7bae1426e3142c7d121c
Avoid unnecessary copy-on-write in FillLayer style application.
<https://webkit.org/b/124878>

We ended up with a lot of cloned StyleBackgroundData objects on
HTML5-8266. This happened because we always forced a copy-on-write
when applying background-image:inherit / background-image:initial.

This patch adds early returns to both functions. In the "inherit"
case, we bail early if the target style already has the same fill
layer data as its parent style.

In the "initial" case, we optimize for the single-FillLayer case
and add an early return if the relevant value is either unset or
equal to the templatized initial value.

2.46 MB progression on HTML5-8266 locally.

Reviewed by Antti Koivisto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/DeprecatedStyleBuilder.cpp