Changeset 183725 in webkit


Ignore:
Timestamp:
May 2, 2015 5:53:18 PM (9 years ago)
Author:
akling@apple.com
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183720 r183725  
     12015-05-02  Andreas Kling  <akling@apple.com>
     2
     3        Style recalc always causes detach from shared StyleRareNonInheritedData.
     4        <https://webkit.org/b/144530>
     5
     6        Reviewed by Darin Adler.
     7
     8        StyleResolver::adjustStyleForMaskImages() was always calling RenderStyle::ensureMaskLayers()
     9        when we were in style recalc. This caused the RenderStyle to COW off from the previously
     10        shared StyleRareNonInheritedData even if nothing actually changes.
     11
     12        This patch adds an early return to adjustStyleForMaskImages() when the previous style had
     13        no mask images. Further refinements could be made, but this covers the most common case where
     14        we don't have any mask images at all.
     15
     16        * css/StyleResolver.cpp:
     17        (WebCore::StyleResolver::adjustStyleForMaskImages):
     18
    1192015-05-02  Alexey Proskuryakov  <ap@apple.com>
    220
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r183591 r183725  
    11811181            oldMaskLayer = oldMaskLayer->next();
    11821182        }
    1183        
     1183
     1184        if (oldStyleMaskImages.isEmpty())
     1185            return;
     1186
    11841187        // Try to match the new mask objects through the list from the old style.
    11851188        // This should work perfectly and optimal when the list of masks remained
Note: See TracChangeset for help on using the changeset viewer.