Changeset 227596 in webkit
- Timestamp:
- Jan 24, 2018 11:59:07 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r227595 r227596 1 2018-01-24 Frederic Wang <fwang@igalia.com> 2 3 ScrollingStateNode::reconcileLayerPositionForViewportRect is only called on direct children of the root 4 https://bugs.webkit.org/show_bug.cgi?id=179946 5 6 Reviewed by Simon Fraser. 7 8 Add a test that verifies the correct update of the graphic layer of a "position: fixed" and 9 "position: sticky" nodes inside a non-flat scrolling tree. The test checks recursive call 10 on overflow, "position: sticky" and "position: fixed" nodes. 11 12 * fast/scrolling/ios/reconcile-layer-position-recursive-expected.txt: Added. 13 * fast/scrolling/ios/reconcile-layer-position-recursive.html: Added. 14 1 15 2018-01-24 Manuel Rego Casasnovas <rego@igalia.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r227594 r227596 1 2018-01-24 Frederic Wang <fwang@igalia.com> 2 3 ScrollingStateNode::reconcileLayerPositionForViewportRect is only called on direct children of the root 4 https://bugs.webkit.org/show_bug.cgi?id=179946 5 6 Reviewed by Simon Fraser. 7 8 ScrollingStateNode::reconcileLayerPositionForViewportRect is currently only called on the 9 direct children of root of the scrolling tree. Hence nodes like "position: fixed" will not 10 update their layers after scrolling when they are deeper in the tree. This is already 11 possible on iOS with overflow nodes and will happen with subframes when async scrolling is 12 implemented. This commit fixes that issue by recursively calling the function 13 ScrollingStateNode::reconcileLayerPositionForViewportRect on the scrolling tree. 14 15 Test: fast/scrolling/ios/reconcile-layer-position-recursive.html 16 17 * page/scrolling/AsyncScrollingCoordinator.cpp: 18 (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Just call 19 reconcileLayerPositionForViewportRect on the root node. 20 * page/scrolling/ScrollingStateNode.cpp: 21 (WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect): By default, this 22 function now recursively calls reconcileLayerPositionForViewportRect on the children. 23 * page/scrolling/ScrollingStateNode.h: 24 * page/scrolling/ScrollingStateFixedNode.cpp: 25 (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect): Call the function 26 on children. 27 * page/scrolling/ScrollingStateStickyNode.cpp: 28 (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect): Ditto. 29 1 30 2018-01-24 Zan Dobersek <zdobersek@igalia.com> 2 31 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r227396 r227596 492 492 return; 493 493 494 auto children = m_scrollingStateTree->rootStateNode()->children();495 if (!children)496 return;497 498 494 LOG_WITH_STREAM(Scrolling, stream << getpid() << " AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions for viewport rect " << viewportRect); 499 495 500 // FIXME: We'll have to traverse deeper into the tree at some point. 501 for (auto& child : *children) 502 child->reconcileLayerPositionForViewportRect(viewportRect, action); 496 m_scrollingStateTree->rootStateNode()->reconcileLayerPositionForViewportRect(viewportRect, action); 503 497 } 504 498 -
trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp
r223728 r227596 72 72 void ScrollingStateFixedNode::reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction action) 73 73 { 74 ScrollingStateNode::reconcileLayerPositionForViewportRect(viewportRect, action); 75 74 76 FloatPoint position = m_constraints.layerPositionForViewportRect(viewportRect); 75 77 if (layer().representsGraphicsLayer()) { -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
r225227 r227596 101 101 } 102 102 103 void ScrollingStateNode::reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction action) 104 { 105 if (!m_children) 106 return; 107 108 for (auto& child : *m_children) 109 child->reconcileLayerPositionForViewportRect(viewportRect, action); 110 } 111 103 112 void ScrollingStateNode::setLayer(const LayerRepresentation& layerRepresentation) 104 113 { -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r223337 r227596 219 219 void setChangedProperties(ChangedProperties changedProperties) { m_changedProperties = changedProperties; } 220 220 221 virtual void reconcileLayerPositionForViewportRect(const LayoutRect& /*viewportRect*/, ScrollingLayerPositionAction) { }221 virtual void reconcileLayerPositionForViewportRect(const LayoutRect& /*viewportRect*/, ScrollingLayerPositionAction); 222 222 223 223 const LayerRepresentation& layer() const { return m_layer; } -
trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp
r223728 r227596 72 72 void ScrollingStateStickyNode::reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction action) 73 73 { 74 ScrollingStateNode::reconcileLayerPositionForViewportRect(viewportRect, action); 75 74 76 FloatPoint position = m_constraints.layerPositionForConstrainingRect(viewportRect); 75 77 if (layer().representsGraphicsLayer()) {
Note: See TracChangeset
for help on using the changeset viewer.