Changeset 246197 in webkit
- Timestamp:
- Jun 7, 2019, 7:17:49 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/scrollingcoordinator/ios/fixed-overflow-no-stacking-context-1-expected.html (added)
-
LayoutTests/scrollingcoordinator/ios/fixed-overflow-no-stacking-context-1.html (added)
-
LayoutTests/scrollingcoordinator/ios/fixed-overflow-no-stacking-context-2-expected.html (added)
-
LayoutTests/scrollingcoordinator/ios/fixed-overflow-no-stacking-context-2.html (added)
-
LayoutTests/scrollingcoordinator/ios/fixed-overflow-stacking-context-stationary-expected.html (added)
-
LayoutTests/scrollingcoordinator/ios/fixed-overflow-stacking-context-stationary.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (modified) (1 diff)
-
Source/WebCore/page/scrolling/cocoa/ScrollingTreeFixedNode.mm (modified) (2 diffs)
-
Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.h (modified) (1 diff)
-
Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.mm (modified) (2 diffs)
-
Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246195 r246197 1 2019-06-07 Antti Koivisto <antti@apple.com> 2 3 position:fixed inside overflow positioning nodes is jumpy 4 https://bugs.webkit.org/show_bug.cgi?id=198647 5 <rdar://problem/51514437> 6 7 Reviewed by Frédéric Wang. 8 9 * scrollingcoordinator/ios/fixed-overflow-no-stacking-context-1-expected.html: Added. 10 * scrollingcoordinator/ios/fixed-overflow-no-stacking-context-1.html: Added. 11 * scrollingcoordinator/ios/fixed-overflow-no-stacking-context-2-expected.html: Added. 12 * scrollingcoordinator/ios/fixed-overflow-no-stacking-context-2.html: Added. 13 * scrollingcoordinator/ios/fixed-overflow-stacking-context-stationary-expected.html: Added. 14 * scrollingcoordinator/ios/fixed-overflow-stacking-context-stationary.html: Added. 15 1 16 2019-06-07 Enrique Ocaña González <eocanha@igalia.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r246195 r246197 1 2019-06-07 Antti Koivisto <antti@apple.com> 2 3 position:fixed inside overflow positioning nodes is jumpy 4 https://bugs.webkit.org/show_bug.cgi?id=198647 5 <rdar://problem/51514437> 6 7 Reviewed by Frédéric Wang. 8 9 Tests: scrollingcoordinator/ios/fixed-overflow-no-stacking-context-1.html 10 scrollingcoordinator/ios/fixed-overflow-no-stacking-context-2.html 11 scrollingcoordinator/ios/fixed-overflow-stacking-context-stationary.html 12 13 * page/scrolling/ScrollingTreeScrollingNode.h: 14 * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: 15 (WebCore::ScrollingTreeFixedNode::applyLayerPositions): 16 17 Take deltas from positioning nodes into account. 18 19 * page/scrolling/cocoa/ScrollingTreePositionedNode.h: 20 * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: 21 (WebCore::ScrollingTreePositionedNode::scrollDeltaSinceLastCommit const): 22 23 Rename since 'scrollOffset' has other meaning. 24 25 (WebCore::ScrollingTreePositionedNode::applyLayerPositions): 26 (WebCore::ScrollingTreePositionedNode::scrollOffsetSinceLastCommit const): Deleted. 27 * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: 28 (WebCore::ScrollingTreeStickyNode::applyLayerPositions): 29 1 30 2019-06-07 Enrique Ocaña González <eocanha@igalia.com> 2 31 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r245818 r246197 56 56 FloatPoint currentScrollPosition() const { return m_currentScrollPosition; } 57 57 FloatPoint lastCommittedScrollPosition() const { return m_lastCommittedScrollPosition; } 58 FloatSize scrollDeltaSinceLastCommit() const { return m_currentScrollPosition - m_lastCommittedScrollPosition; } 58 59 59 60 // These are imperative; they adjust the scrolling layers. -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeFixedNode.mm
r245818 r246197 34 34 #import "ScrollingTreeFrameScrollingNode.h" 35 35 #import "ScrollingTreeOverflowScrollingNode.h" 36 #import "ScrollingTreePositionedNode.h" 36 37 #import "WebCoreCALayerExtras.h" 37 38 #import <wtf/text/TextStream.h> … … 70 71 auto computeLayerPosition = [&] { 71 72 FloatSize overflowScrollDelta; 72 // FIXME: This code is wrong in complex cases where the fixed element is inside a positioned node as 73 // the scroll container order does not match the scrolling tree ancestor order. 74 for (auto* node = parent(); node; node = node->parent()) { 75 if (is<ScrollingTreeFrameScrollingNode>(*node)) { 73 for (auto* ancestor = parent(); ancestor; ancestor = ancestor->parent()) { 74 if (is<ScrollingTreePositionedNode>(*ancestor)) { 75 auto& positioningAncestor = downcast<ScrollingTreePositionedNode>(*ancestor); 76 if (positioningAncestor.layer() != m_layer) 77 overflowScrollDelta -= positioningAncestor.scrollDeltaSinceLastCommit(); 78 } 79 80 if (is<ScrollingTreeFrameScrollingNode>(*ancestor)) { 76 81 // Fixed nodes are positioned relative to the containing frame scrolling node. 77 82 // We bail out after finding one. 78 auto layoutViewport = downcast<ScrollingTreeFrameScrollingNode>(* node).layoutViewport();83 auto layoutViewport = downcast<ScrollingTreeFrameScrollingNode>(*ancestor).layoutViewport(); 79 84 return m_constraints.layerPositionForViewportRect(layoutViewport) - overflowScrollDelta; 80 85 } 81 86 82 if (is<ScrollingTreeOverflowScrollingNode>(* node)) {87 if (is<ScrollingTreeOverflowScrollingNode>(*ancestor)) { 83 88 // To keep the layer still during async scrolling we adjust by how much the position has changed since layout. 84 auto& overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(*node); 85 auto localDelta = overflowNode.lastCommittedScrollPosition() - overflowNode.currentScrollPosition(); 86 overflowScrollDelta += localDelta; 89 auto& overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(*ancestor); 90 overflowScrollDelta -= overflowNode.scrollDeltaSinceLastCommit(); 87 91 } 88 92 } -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.h
r246083 r246197 47 47 const Vector<ScrollingNodeID>& relatedOverflowScrollingNodes() const { return m_relatedOverflowScrollingNodes; } 48 48 49 FloatSize scroll OffsetSinceLastCommit() const;49 FloatSize scrollDeltaSinceLastCommit() const; 50 50 51 51 private: -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.mm
r246083 r246197 77 77 } 78 78 79 FloatSize ScrollingTreePositionedNode::scroll OffsetSinceLastCommit() const79 FloatSize ScrollingTreePositionedNode::scrollDeltaSinceLastCommit() const 80 80 { 81 FloatSize offset;81 FloatSize delta; 82 82 for (auto nodeID : m_relatedOverflowScrollingNodes) { 83 83 if (auto* node = scrollingTree().nodeForID(nodeID)) { 84 84 if (is<ScrollingTreeOverflowScrollingNode>(node)) { 85 85 auto& overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(*node); 86 offset += overflowNode.currentScrollPosition() - overflowNode.lastCommittedScrollPosition();86 delta += overflowNode.scrollDeltaSinceLastCommit(); 87 87 } 88 88 } … … 90 90 if (m_constraints.scrollPositioningBehavior() == ScrollPositioningBehavior::Stationary) { 91 91 // Stationary nodes move in the opposite direction. 92 return - offset;92 return -delta; 93 93 } 94 94 95 return offset;95 return delta; 96 96 } 97 97 98 98 void ScrollingTreePositionedNode::applyLayerPositions() 99 99 { 100 auto offset = scrollOffsetSinceLastCommit();101 auto layerPosition = m_constraints.layerPositionAtLastLayout() - offset;100 auto delta = scrollDeltaSinceLastCommit(); 101 auto layerPosition = m_constraints.layerPositionAtLastLayout() - delta; 102 102 103 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreePositionedNode " << scrollingNodeID() << " applyLayerPositions: overflow delta " << offset<< " moving layer to " << layerPosition);103 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreePositionedNode " << scrollingNodeID() << " applyLayerPositions: overflow delta " << delta << " moving layer to " << layerPosition); 104 104 105 105 [m_layer _web_setLayerTopLeftPosition:layerPosition - m_constraints.alignmentOffset()]; -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm
r246083 r246197 98 98 if (positioningAncestor.layer() == m_layer) { 99 99 // We'll also do the adjustment the positioning node would do. 100 position -= positioningAncestor.scroll OffsetSinceLastCommit();100 position -= positioningAncestor.scrollDeltaSinceLastCommit(); 101 101 } 102 102
Note:
See TracChangeset
for help on using the changeset viewer.