Changeset 201901 in webkit


Ignore:
Timestamp:
Jun 9, 2016 7:06:30 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
https://bugs.webkit.org/show_bug.cgi?id=119839
<rdar://problem/9671514>

Patch by Antoine Quint <Antoine Quint> on 2016-06-09
Reviewed by Simon Fraser.

Source/WebCore:

Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.

Test: fast/scrolling/ios/touch-scroll-pointer-events-none.html

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::GraphicsLayer):

  • platform/graphics/GraphicsLayer.h:

(WebCore::GraphicsLayer::userInteractionEnabled):
(WebCore::GraphicsLayer::setUserInteractionEnabled):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::setUserInteractionEnabled):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateUserInteractionEnabled):

  • platform/graphics/ca/GraphicsLayerCA.h:
  • platform/graphics/ca/PlatformCALayer.h:
  • platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
  • platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:

(PlatformCALayerCocoa::userInteractionEnabled):
(PlatformCALayerCocoa::setUserInteractionEnabled):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateAfterDescendants):

Source/WebKit2:

Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.

  • Shared/mac/RemoteLayerTreePropertyApplier.mm:

(WebKit::RemoteLayerTreePropertyApplier::applyProperties):

  • Shared/mac/RemoteLayerTreeTransaction.h:
  • Shared/mac/RemoteLayerTreeTransaction.mm:

(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::userInteractionEnabled):
(WebKit::PlatformCALayerRemote::setUserInteractionEnabled):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.h:

LayoutTests:

  • fast/scrolling/ios/touch-scroll-pointer-events-none-expected.txt: Added.
  • fast/scrolling/ios/touch-scroll-pointer-events-none.html: Added.
Location:
trunk
Files:
2 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201899 r201901  
     12016-06-09  Antoine Quint  <graouts@apple.com>
     2
     3        [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
     4        https://bugs.webkit.org/show_bug.cgi?id=119839
     5        <rdar://problem/9671514>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/scrolling/ios/touch-scroll-pointer-events-none-expected.txt: Added.
     10        * fast/scrolling/ios/touch-scroll-pointer-events-none.html: Added.
     11
    1122016-06-09  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r201899 r201901  
     12016-06-09  Antoine Quint  <graouts@apple.com>
     2
     3        [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
     4        https://bugs.webkit.org/show_bug.cgi?id=119839
     5        <rdar://problem/9671514>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
     10        user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.
     11
     12        Test: fast/scrolling/ios/touch-scroll-pointer-events-none.html
     13
     14        * platform/graphics/GraphicsLayer.cpp:
     15        (WebCore::GraphicsLayer::GraphicsLayer):
     16        * platform/graphics/GraphicsLayer.h:
     17        (WebCore::GraphicsLayer::userInteractionEnabled):
     18        (WebCore::GraphicsLayer::setUserInteractionEnabled):
     19        * platform/graphics/ca/GraphicsLayerCA.cpp:
     20        (WebCore::GraphicsLayerCA::setUserInteractionEnabled):
     21        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
     22        (WebCore::GraphicsLayerCA::updateUserInteractionEnabled):
     23        * platform/graphics/ca/GraphicsLayerCA.h:
     24        * platform/graphics/ca/PlatformCALayer.h:
     25        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
     26        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
     27        (PlatformCALayerCocoa::userInteractionEnabled):
     28        (PlatformCALayerCocoa::setUserInteractionEnabled):
     29        * rendering/RenderLayerBacking.cpp:
     30        (WebCore::RenderLayerBacking::updateAfterDescendants):
     31
    1322016-06-09  Chris Dumez  <cdumez@apple.com>
    233
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r199046 r201901  
    129129    , m_isMaskLayer(false)
    130130    , m_isTrackingDisplayListReplay(false)
     131    , m_userInteractionEnabled(true)
    131132    , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip)
    132133    , m_contentsOrientation(CompositingCoordinatesTopDown)
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r201785 r201901  
    347347    virtual void setContentsVisible(bool b) { m_contentsVisible = b; }
    348348
     349    bool userInteractionEnabled() const { return m_userInteractionEnabled; }
     350    virtual void setUserInteractionEnabled(bool b) { m_userInteractionEnabled = b; }
     351   
    349352    bool acceleratesDrawing() const { return m_acceleratesDrawing; }
    350353    virtual void setAcceleratesDrawing(bool b) { m_acceleratesDrawing = b; }
     
    627630    bool m_isMaskLayer : 1;
    628631    bool m_isTrackingDisplayListReplay : 1;
     632    bool m_userInteractionEnabled : 1;
    629633   
    630634    GraphicsLayerPaintingPhase m_paintingPhase;
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r201785 r201901  
    677677}
    678678
     679void GraphicsLayerCA::setUserInteractionEnabled(bool userInteractionEnabled)
     680{
     681    if (userInteractionEnabled == m_userInteractionEnabled)
     682        return;
     683   
     684    GraphicsLayer::setUserInteractionEnabled(userInteractionEnabled);
     685    noteLayerPropertyChanged(UserInteractionEnabledChanged);
     686}
     687
    679688void GraphicsLayerCA::setAcceleratesDrawing(bool acceleratesDrawing)
    680689{
     
    15801589        updateContentsVisibility();
    15811590
     1591    if (m_uncommittedChanges & UserInteractionEnabledChanged)
     1592        updateUserInteractionEnabled();
     1593
    15821594    // Note that contentsScale can affect whether the layer can be opaque.
    15831595    if (m_uncommittedChanges & ContentsOpaqueChanged)
     
    18831895
    18841896    m_layer->setContentsHidden(!m_contentsVisible);
     1897}
     1898
     1899void GraphicsLayerCA::updateUserInteractionEnabled()
     1900{
     1901    m_layer->setUserInteractionEnabled(m_userInteractionEnabled);
    18851902}
    18861903
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r201785 r201901  
    9292    WEBCORE_EXPORT void setAcceleratesDrawing(bool) override;
    9393    WEBCORE_EXPORT void setUsesDisplayListDrawing(bool) override;
     94    WEBCORE_EXPORT void setUserInteractionEnabled(bool) override;
    9495
    9596    WEBCORE_EXPORT void setBackgroundColor(const Color&) override;
     
    400401    void updateCoverage();
    401402    void updateBackgroundColor();
     403    void updateUserInteractionEnabled();
    402404
    403405    void updateContentsImage();
     
    496498        ShapeChanged =                  1LLU << 35,
    497499        WindRuleChanged =               1LLU << 36,
     500        UserInteractionEnabledChanged = 1LLU << 37,
    498501    };
    499502    typedef uint64_t LayerChangeFlags;
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h

    r200612 r201901  
    162162    virtual bool contentsHidden() const = 0;
    163163    virtual void setContentsHidden(bool) = 0;
     164    virtual bool userInteractionEnabled() const = 0;
     165    virtual void setUserInteractionEnabled(bool) = 0;
    164166
    165167    virtual bool geometryFlipped() const = 0;
  • trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h

    r200602 r201901  
    9393    bool contentsHidden() const override;
    9494    void setContentsHidden(bool) override;
     95
     96    bool userInteractionEnabled() const override;
     97    void setUserInteractionEnabled(bool) override;
    9598
    9699    void setBackingStoreAttached(bool) override;
  • trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm

    r201648 r201901  
    629629}
    630630
     631bool PlatformCALayerCocoa::userInteractionEnabled() const
     632{
     633    return true;
     634}
     635
     636void PlatformCALayerCocoa::setUserInteractionEnabled(bool)
     637{
     638}
     639
    631640void PlatformCALayerCocoa::setBackingStoreAttached(bool)
    632641{
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r201785 r201901  
    10721072
    10731073    m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || isPaintDestinationForDescendantLayers());
    1074     if (m_scrollingLayer)
     1074    if (m_scrollingLayer) {
    10751075        m_scrollingLayer->setContentsVisible(renderer().style().visibility() == VISIBLE);
     1076        m_scrollingLayer->setUserInteractionEnabled(renderer().style().pointerEvents() != PE_NONE);
     1077    }
    10761078}
    10771079
  • trunk/Source/WebKit2/ChangeLog

    r201897 r201901  
     12016-06-09  Antoine Quint  <graouts@apple.com>
     2
     3        [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
     4        https://bugs.webkit.org/show_bug.cgi?id=119839
     5        <rdar://problem/9671514>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
     10        user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.
     11
     12        * Shared/mac/RemoteLayerTreePropertyApplier.mm:
     13        (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
     14        * Shared/mac/RemoteLayerTreeTransaction.h:
     15        * Shared/mac/RemoteLayerTreeTransaction.mm:
     16        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
     17        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
     18        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
     19        (WebKit::dumpChangedLayers):
     20        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     21        (WebKit::PlatformCALayerRemote::userInteractionEnabled):
     22        (WebKit::PlatformCALayerRemote::setUserInteractionEnabled):
     23        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
     24
    1252016-06-09  Anders Carlsson  <andersca@apple.com>
    226
  • trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm

    r201038 r201901  
    332332        }
    333333    }
    334    
    335     if (properties.changedProperties & RemoteLayerTreeTransaction::ContentsHiddenChanged)
    336         view.userInteractionEnabled = !properties.contentsHidden;
     334
     335    if (properties.changedProperties & (RemoteLayerTreeTransaction::ContentsHiddenChanged | RemoteLayerTreeTransaction::UserInteractionEnabledChanged))
     336        view.userInteractionEnabled = !properties.contentsHidden && properties.userInteractionEnabled;
    337337
    338338    END_BLOCK_OBJC_EXCEPTIONS;
  • trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h

    r200602 r201901  
    9090        EdgeAntialiasingMaskChanged     = 1LLU << 35,
    9191        CustomAppearanceChanged         = 1LLU << 36,
     92        UserInteractionEnabledChanged   = 1LLU << 37,
    9293    };
    9394    typedef uint64_t LayerChange;
     
    167168        bool opaque;
    168169        bool contentsHidden;
     170        bool userInteractionEnabled;
    169171    };
    170172
  • trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm

    r200602 r201901  
    105105    , opaque(false)
    106106    , contentsHidden(false)
     107    , userInteractionEnabled(true)
    107108{
    108109}
     
    143144    , opaque(other.opaque)
    144145    , contentsHidden(other.contentsHidden)
     146    , userInteractionEnabled(other.userInteractionEnabled)
    145147{
    146148    // FIXME: LayerProperties should reference backing store by ID, so that two layers can have the same backing store (for clones).
     
    274276    if (changedProperties & CustomAppearanceChanged)
    275277        encoder.encodeEnum(customAppearance);
     278
     279    if (changedProperties & UserInteractionEnabledChanged)
     280        encoder << userInteractionEnabled;
    276281}
    277282
     
    489494    if (result.changedProperties & CustomAppearanceChanged) {
    490495        if (!decoder.decodeEnum(result.customAppearance))
     496            return false;
     497    }
     498
     499    if (result.changedProperties & UserInteractionEnabledChanged) {
     500        if (!decoder.decode(result.userInteractionEnabled))
    491501            return false;
    492502    }
     
    815825        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomAppearanceChanged)
    816826            ts.dumpProperty("customAppearance", layerProperties.customAppearance);
     827
     828        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::UserInteractionEnabledChanged)
     829            ts.dumpProperty("userInteractionEnabled", layerProperties.userInteractionEnabled);
    817830    }
    818831}
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r201374 r201901  
    528528}
    529529
     530bool PlatformCALayerRemote::userInteractionEnabled() const
     531{
     532    return m_properties.userInteractionEnabled;
     533}
     534
     535void PlatformCALayerRemote::setUserInteractionEnabled(bool value)
     536{
     537    if (m_properties.userInteractionEnabled == value)
     538        return;
     539   
     540    m_properties.userInteractionEnabled = value;
     541    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::UserInteractionEnabledChanged);
     542}
     543
    530544void PlatformCALayerRemote::setBackingStoreAttached(bool value)
    531545{
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h

    r200602 r201901  
    9898    void setContentsHidden(bool) override;
    9999
     100    bool userInteractionEnabled() const override;
     101    void setUserInteractionEnabled(bool) override;
     102
    100103    void setBackingStoreAttached(bool) override;
    101104    bool backingStoreAttached() const override;
Note: See TracChangeset for help on using the changeset viewer.