Changeset 166753 in webkit


Ignore:
Timestamp:
Apr 3, 2014 4:28:42 PM (10 years ago)
Author:
Simon Fraser
Message:

ASSERT(m_children.isEmpty()) in PlatformCALayerRemote::removeAllSublayers() on time.com
https://bugs.webkit.org/show_bug.cgi?id=131187

Reviewed by Maciej Stachowiak.

After a call to PlatformCALayerRemote::adoptSublayers() when a layer
toggles between tiled and non-tiled, we'd assert in PlatformCALayerRemote::removeAllSublayers()
that not all sublayers had been removed (there was one with a null superlayer).

Fix by ensuring that we don't copy over custom subviews when adoptSublayers()
is called; they'll get added as we update children anyway.

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::adoptSublayers):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r166750 r166753  
     12014-04-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        ASSERT(m_children.isEmpty()) in PlatformCALayerRemote::removeAllSublayers() on time.com
     4        https://bugs.webkit.org/show_bug.cgi?id=131187
     5
     6        Reviewed by Maciej Stachowiak.
     7       
     8        After a call to PlatformCALayerRemote::adoptSublayers() when a layer
     9        toggles between tiled and non-tiled, we'd assert in PlatformCALayerRemote::removeAllSublayers()
     10        that not all sublayers had been removed (there was one with a null superlayer).
     11       
     12        Fix by ensuring that we don't copy over custom subviews when adoptSublayers()
     13        is called; they'll get added as we update children anyway.
     14
     15        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     16        (WebKit::PlatformCALayerRemote::adoptSublayers):
     17
    1182014-04-03  Benjamin Poulain  <bpoulain@apple.com>
    219
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r166545 r166753  
    265265void PlatformCALayerRemote::adoptSublayers(PlatformCALayer* source)
    266266{
    267     setSublayers(toPlatformCALayerRemote(source)->m_children);
     267    PlatformCALayerList layersToMove = toPlatformCALayerRemote(source)->m_children;
     268
     269    if (const PlatformCALayerList* customLayers = source->customSublayers()) {
     270        for (const auto& layer : *customLayers) {
     271            size_t layerIndex = layersToMove.find(layer);
     272            if (layerIndex != notFound)
     273                layersToMove.remove(layerIndex);
     274        }
     275    }
     276
     277    setSublayers(layersToMove);
    268278}
    269279
Note: See TracChangeset for help on using the changeset viewer.