Changeset 246278 in webkit


Ignore:
Timestamp:
Jun 10, 2019 1:43:17 PM (5 years ago)
Author:
Antti Koivisto
Message:

Event region should be set on scrolledContentsLayer if it exists
https://bugs.webkit.org/show_bug.cgi?id=198717
<rdar://problem/51572169>

Reviewed by Simon Fraser.

Source/WebCore:

Test: pointerevents/ios/touch-action-region-overflow.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateConfiguration):

Move to updateBackingAndHierarchy.

(WebCore::RenderLayerBacking::updateEventRegion):

  • Set event region on scrolledContentsLayer if it exists
  • Translate away the scroll offset
  • Get the offset from renderer from the GraphicsLayer so scrolling and non-scrolling case can be handled uniformly.
  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):

Invoke updateEventRegion after geometry update so offsets are already available on GraphicsLayer.

LayoutTests:

  • pointerevents/ios/touch-action-region-backing-sharing-expected.txt:
  • pointerevents/ios/touch-action-region-overflow-expected.txt: Added.
  • pointerevents/ios/touch-action-region-overflow.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246277 r246278  
     12019-06-10  Antti Koivisto  <antti@apple.com>
     2
     3        Event region should be set on scrolledContentsLayer if it exists
     4        https://bugs.webkit.org/show_bug.cgi?id=198717
     5        <rdar://problem/51572169>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * pointerevents/ios/touch-action-region-backing-sharing-expected.txt:
     10        * pointerevents/ios/touch-action-region-overflow-expected.txt: Added.
     11        * pointerevents/ios/touch-action-region-overflow.html: Added.
     12
    1132019-06-10  Daniel Bates  <dabates@apple.com>
    214
  • trunk/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing-expected.txt

    r245175 r246278  
    22  (anchor 0.00 0.00)
    33  (bounds 800.00 600.00)
    4   (deep color 1)
    54  (children 1
    65    (GraphicsLayer
     
    109        (rect (0,0) width=800 height=600)
    1110      )
    12       (deep color 1)
    1311      (children 2
    1412        (GraphicsLayer
    1513          (position 8.00 13.00)
    1614          (bounds 200.00 200.00)
    17           (event region
    18             (rect (0,0) width=500 height=500)
    19           )
    20           (deep color 1)
    2115          (children 1
    2216            (GraphicsLayer
     
    2721                  (bounds 500.00 500.00)
    2822                  (drawsContent 1)
    29                   (deep color 1)
     23                  (event region
     24                    (rect (0,0) width=500 height=500)
     25                  )
    3026                )
    3127              )
     
    4945            )
    5046          )
    51           (deep color 1)
    5247        )
    5348      )
  • trunk/Source/WebCore/ChangeLog

    r246277 r246278  
     12019-06-10  Antti Koivisto  <antti@apple.com>
     2
     3        Event region should be set on scrolledContentsLayer if it exists
     4        https://bugs.webkit.org/show_bug.cgi?id=198717
     5        <rdar://problem/51572169>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Test: pointerevents/ios/touch-action-region-overflow.html
     10
     11        * rendering/RenderLayerBacking.cpp:
     12        (WebCore::RenderLayerBacking::updateConfiguration):
     13
     14        Move to updateBackingAndHierarchy.
     15
     16        (WebCore::RenderLayerBacking::updateEventRegion):
     17
     18        - Set event region on scrolledContentsLayer if it exists
     19        - Translate away the scroll offset
     20        - Get the offset from renderer from the GraphicsLayer so scrolling and non-scrolling case can be handled uniformly.
     21
     22        * rendering/RenderLayerBacking.h:
     23        * rendering/RenderLayerCompositor.cpp:
     24        (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
     25
     26        Invoke updateEventRegion after geometry update so offsets are already available on GraphicsLayer.
     27
    1282019-06-10  Daniel Bates  <dabates@apple.com>
    229
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r246019 r246278  
    842842        updateRootLayerConfiguration();
    843843
    844     updateEventRegion();
    845 
    846844    // Requires layout.
    847845    if (contentsInfo.isDirectlyCompositedImage())
     
    15271525        layer->paintLayerWithEffects(nullContext, paintingInfo, paintFlags);
    15281526
    1529     auto contentOffset = roundedIntSize(contentOffsetInCompositingLayer());
    1530     eventRegion.translate(contentOffset);
    1531     m_graphicsLayer->setEventRegion(WTFMove(eventRegion));
    1532 
     1527    GraphicsLayer& layerForEventRegion = m_scrolledContentsLayer ? *m_scrolledContentsLayer : *m_graphicsLayer;
     1528
     1529    auto layerOffset = toIntSize(layerForEventRegion.scrollOffset()) - roundedIntSize(layerForEventRegion.offsetFromRenderer());
     1530    eventRegion.translate(layerOffset);
     1531
     1532    layerForEventRegion.setEventRegion(WTFMove(eventRegion));
    15331533#endif
    15341534}
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r245977 r246278  
    217217    // Returns true if changed.
    218218    bool updateCompositedBounds();
     219
     220    void updateEventRegion();
    219221   
    220222    void updateAfterWidgetResize();
     
    359361
    360362    void updateDrawsContent(PaintedContentsInfo&);
    361     void updateEventRegion();
    362363
    363364    // Returns true if this compositing layer has no visible content.
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r246231 r246278  
    12111211            scrollingNodeChanges.add(ScrollingNodeChangeFlags::LayerGeometry);
    12121212
     1213        // This needs to happen after any geometry update.
     1214        // FIXME: Use separate bit for event region invalidation.
     1215        if (layerNeedsUpdate || layer.needsCompositingConfigurationUpdate())
     1216            layerBacking->updateEventRegion();
     1217
    12131218        if (auto* reflection = layer.reflectionLayer()) {
    12141219            if (auto* reflectionBacking = reflection->backing()) {
Note: See TracChangeset for help on using the changeset viewer.