Changeset 168440 in webkit


Ignore:
Timestamp:
May 7, 2014, 2:49:10 PM (11 years ago)
Author:
Simon Fraser
Message:

[iOS] Acclerated overflow-scrolling broken in WK1
https://bugs.webkit.org/show_bug.cgi?id=132665
<rdar://problem/16842909>

Reviewed by Tim Horton.

r168301 added a CALayer delegate to disable implicit animations,
but for some layers we wrap them in UIViews (which are themselves
layer delegates), so bad things happened.

Fix by falling back to setting the null actions dictionary for
layers with custom scrolling behavior.

  • platform/graphics/GraphicsLayer.h:
  • platform/graphics/ca/mac/PlatformCALayerMac.h:
  • platform/graphics/ca/mac/PlatformCALayerMac.mm:

(PlatformCALayerMac::updateCustomBehavior):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateScrollingLayers):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r168439 r168440  
     12014-05-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS] Acclerated overflow-scrolling broken in WK1
     4        https://bugs.webkit.org/show_bug.cgi?id=132665
     5        <rdar://problem/16842909>
     6
     7        Reviewed by Tim Horton.
     8
     9        r168301 added a CALayer delegate to disable implicit animations,
     10        but for some layers we wrap them in UIViews (which are themselves
     11        layer delegates), so bad things happened.
     12       
     13        Fix by falling back to setting the null actions dictionary for
     14        layers with custom scrolling behavior.
     15
     16        * platform/graphics/GraphicsLayer.h:
     17        * platform/graphics/ca/mac/PlatformCALayerMac.h:
     18        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
     19        (PlatformCALayerMac::updateCustomBehavior):
     20        * rendering/RenderLayerBacking.cpp:
     21        (WebCore::RenderLayerBacking::updateScrollingLayers):
     22
    1232014-05-07  Jeremy Jones  <jeremyj@apple.com>
    224
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r168423 r168440  
    447447    CustomAppearance customAppearance() const { return m_customAppearance; }
    448448
    449     enum CustomBehavior { NoCustomBehavior, CustomScrollingBehavior };
     449    enum CustomBehavior { NoCustomBehavior, CustomScrollingBehavior, CustomScrolledContentsBehavior };
    450450    virtual void setCustomBehavior(CustomBehavior customBehavior) { m_customBehavior = customBehavior; }
    451451    CustomBehavior customBehavior() const { return m_customBehavior; }
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h

    r167553 r168440  
    142142
    143143    virtual GraphicsLayer::CustomBehavior customBehavior() const override { return m_customBehavior; }
    144     virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior) override { m_customBehavior = customBehavior; }
     144    virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior) override;
    145145
    146146    virtual TiledBacking* tiledBacking() override;
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm

    r168301 r168440  
    765765}
    766766
     767void PlatformCALayerMac::updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior)
     768{
     769    m_customBehavior = customBehavior;
     770
     771    // Custom layers can get wrapped in UIViews (which clobbers the layer delegate),
     772    // so fall back to the slower way of disabling implicit animations.
     773    if (m_customBehavior != GraphicsLayer::NoCustomBehavior) {
     774        if ([[m_layer delegate] isKindOfClass:[WebActionDisablingCALayerDelegate class]])
     775            [m_layer setDelegate:nil];
     776        [m_layer web_disableAllActions];
     777    }
     778}
     779
    767780TiledBacking* PlatformCALayerMac::tiledBacking()
    768781{
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r168423 r168440  
    14281428        m_scrollingContentsLayer = createGraphicsLayer("Scrolled Contents");
    14291429        m_scrollingContentsLayer->setDrawsContent(true);
     1430#if PLATFORM(IOS)
     1431        m_scrollingContentsLayer->setCustomBehavior(GraphicsLayer::CustomScrolledContentsBehavior);
     1432#endif
    14301433        GraphicsLayerPaintingPhase paintPhase = GraphicsLayerPaintOverflowContents | GraphicsLayerPaintCompositedScroll;
    14311434        if (!m_foregroundLayer)
Note: See TracChangeset for help on using the changeset viewer.