Changeset 216104 in webkit


Ignore:
Timestamp:
May 2, 2017, 4:06:13 PM (8 years ago)
Author:
Simon Fraser
Message:

Dynamically added position:fixed element is in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=170280
rdar://problem/31374008

Reviewed by Tim Horton.

Source/WebKit2:

Layers for position:fixed elements have their positions reconciled after scrolls
via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.

This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
but there was no signal to the UI process to restore the layer's pre-scrolled position.

Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
geometry updates in the web process always send new positions to the UI process.

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::setPosition):

LayoutTests:

  • scrollingcoordinator/ios/nested-fixed-layer-positions-expected.html: Added.
  • scrollingcoordinator/ios/nested-fixed-layer-positions.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r216100 r216104  
     12017-05-02  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Dynamically added position:fixed element is in the wrong place
     4        https://bugs.webkit.org/show_bug.cgi?id=170280
     5        rdar://problem/31374008
     6
     7        Reviewed by Tim Horton.
     8
     9        * scrollingcoordinator/ios/nested-fixed-layer-positions-expected.html: Added.
     10        * scrollingcoordinator/ios/nested-fixed-layer-positions.html: Added.
     11
    1122017-05-02  Ryan Haddad  <ryanhaddad@apple.com>
    213
  • trunk/Source/WebKit2/ChangeLog

    r216101 r216104  
     12017-05-02  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Dynamically added position:fixed element is in the wrong place
     4        https://bugs.webkit.org/show_bug.cgi?id=170280
     5        rdar://problem/31374008
     6
     7        Reviewed by Tim Horton.
     8
     9        Layers for position:fixed elements have their positions reconciled after scrolls
     10        via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
     11        which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.
     12
     13        This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
     14        position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
     15        but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
     16        but there was no signal to the UI process to restore the layer's pre-scrolled position.
     17
     18        Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
     19        geometry updates in the web process always send new positions to the UI process.
     20
     21        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     22        (WebKit::PlatformCALayerRemote::setPosition):
     23
    1242017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
    225
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r215780 r216104  
    453453void PlatformCALayerRemote::setPosition(const FloatPoint3D& value)
    454454{
    455     if (value == m_properties.position)
    456         return;
    457 
     455    // We can't early return here if the position has not changed, since GraphicsLayerCA::syncPosition() may have changed
     456    // the GraphicsLayer position (which doesn't force a geometry update) but we want a subsequent GraphicsLayerCA::setPosition()
     457    // to push a new position to the UI process, even though our m_properties.position hasn't changed.
    458458    m_properties.position = value;
    459459    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::PositionChanged);
Note: See TracChangeset for help on using the changeset viewer.