Title: [183725] trunk/Source/WebCore
Revision
183725
Author
[email protected]
Date
2015-05-02 17:53:18 -0700 (Sat, 02 May 2015)

Log Message

Style recalc always causes detach from shared StyleRareNonInheritedData.
<https://webkit.org/b/144530>

Reviewed by Darin Adler.

StyleResolver::adjustStyleForMaskImages() was always calling RenderStyle::ensureMaskLayers()
when we were in style recalc. This caused the RenderStyle to COW off from the previously
shared StyleRareNonInheritedData even if nothing actually changes.

This patch adds an early return to adjustStyleForMaskImages() when the previous style had
no mask images. Further refinements could be made, but this covers the most common case where
we don't have any mask images at all.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183724 => 183725)


--- trunk/Source/WebCore/ChangeLog	2015-05-03 00:15:27 UTC (rev 183724)
+++ trunk/Source/WebCore/ChangeLog	2015-05-03 00:53:18 UTC (rev 183725)
@@ -1,3 +1,21 @@
+2015-05-02  Andreas Kling  <[email protected]>
+
+        Style recalc always causes detach from shared StyleRareNonInheritedData.
+        <https://webkit.org/b/144530>
+
+        Reviewed by Darin Adler.
+
+        StyleResolver::adjustStyleForMaskImages() was always calling RenderStyle::ensureMaskLayers()
+        when we were in style recalc. This caused the RenderStyle to COW off from the previously
+        shared StyleRareNonInheritedData even if nothing actually changes.
+
+        This patch adds an early return to adjustStyleForMaskImages() when the previous style had
+        no mask images. Further refinements could be made, but this covers the most common case where
+        we don't have any mask images at all.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustStyleForMaskImages):
+
 2015-05-02  Alexey Proskuryakov  <[email protected]>
 
         fast/frames/flattening/iframe-flattening-resize-event-count.html times out on Yosemite WK2

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (183724 => 183725)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2015-05-03 00:15:27 UTC (rev 183724)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2015-05-03 00:53:18 UTC (rev 183725)
@@ -1180,7 +1180,10 @@
 
             oldMaskLayer = oldMaskLayer->next();
         }
-        
+
+        if (oldStyleMaskImages.isEmpty())
+            return;
+
         // Try to match the new mask objects through the list from the old style.
         // This should work perfectly and optimal when the list of masks remained
         // the same and also work correctly (but slower) when they were reordered.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to