Changeset 169430 in webkit
- Timestamp:
- May 28, 2014 12:34:52 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r169427 r169430 1 2014-05-28 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Improve behavior of position:fixed inside accelerated overflow-scroll 4 https://bugs.webkit.org/show_bug.cgi?id=133352 5 6 Reviewed by Tim Horton. 7 8 When adjusting layers inside accelerated overflow-scroll, pass a delta 9 down to descendant nodes. Fix behavior of sticky nodes inside fixed nodes 10 inside overflow scroll (sticky should only be affected if the parent node 11 is a scrolling node). 12 13 * page/scrolling/mac/ScrollingTreeFixedNode.mm: 14 (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Just remove 15 some .get() 16 * page/scrolling/mac/ScrollingTreeStickyNode.mm: 17 (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Remove .get()s. 18 We never care about the cumulative delta here, because sticky nodes only respond to 19 changes in their direct scrolling ancestors. Only adjust the layer if the parent 20 is a scrolling node. 21 1 22 2014-05-27 Chris Fleizach <cfleizach@apple.com> 2 23 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm
r169411 r169430 70 70 layerPosition -= cumulativeDelta; 71 71 72 CGRect layerBounds = [m_layer .get()bounds];73 CGPoint anchorPoint = [m_layer .get()anchorPoint];72 CGRect layerBounds = [m_layer bounds]; 73 CGPoint anchorPoint = [m_layer anchorPoint]; 74 74 CGPoint newPosition = layerPosition - m_constraints.alignmentOffset() + anchorPoint * layerBounds.size; 75 [m_layer.get() setPosition:newPosition]; 75 76 [m_layer setPosition:newPosition]; 76 77 77 78 if (!m_children) -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm
r169411 r169430 68 68 void ScrollingTreeStickyNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) 69 69 { 70 FloatRect constrainingRect = fixedPositionRect; 71 if (parent()->isOverflowScrollingNode()) 70 bool adjustStickyLayer = false; 71 FloatRect constrainingRect; 72 73 if (parent()->isOverflowScrollingNode()) { 72 74 constrainingRect = FloatRect(toScrollingTreeOverflowScrollingNode(parent())->scrollPosition(), m_constraints.constrainingRectAtLastLayout().size()); 75 adjustStickyLayer = true; 76 } else if (parent()->isFrameScrollingNode()) { 77 constrainingRect = fixedPositionRect; 78 adjustStickyLayer = true; 79 } 73 80 74 Float Point layerPosition = m_constraints.layerPositionForConstrainingRect(constrainingRect);81 FloatSize deltaForDescendants = cumulativeDelta; 75 82 76 // FIXME: Subtracting the cumulativeDelta is not totally sufficient to get the new position right for nested 77 // sticky objects. We probably need a way to modify the containingBlockRect in the ViewportContraints 78 // to get this right in all cases. 79 layerPosition -= cumulativeDelta; 83 if (adjustStickyLayer) { 84 FloatPoint layerPosition = m_constraints.layerPositionForConstrainingRect(constrainingRect); 80 85 81 CGRect layerBounds = [m_layer.get() bounds]; 82 CGPoint anchorPoint = [m_layer.get() anchorPoint]; 83 CGPoint newPosition = layerPosition - m_constraints.alignmentOffset() + anchorPoint * layerBounds.size; 84 [m_layer.get() setPosition:newPosition]; 86 CGRect layerBounds = [m_layer bounds]; 87 CGPoint anchorPoint = [m_layer anchorPoint]; 88 CGPoint newPosition = layerPosition - m_constraints.alignmentOffset() + anchorPoint * layerBounds.size; 89 [m_layer setPosition:newPosition]; 90 91 deltaForDescendants = layerPosition - m_constraints.layerPositionAtLastLayout() + cumulativeDelta; 92 } 85 93 86 94 if (!m_children) 87 95 return; 88 96 89 FloatSize newDelta = layerPosition - m_constraints.layerPositionAtLastLayout() + cumulativeDelta;90 91 97 for (auto& child : *m_children) 92 child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, newDelta);98 child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, deltaForDescendants); 93 99 } 94 100 -
trunk/Source/WebKit2/ChangeLog
r169426 r169430 1 2014-05-28 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Improve behavior of position:fixed inside accelerated overflow-scroll 4 https://bugs.webkit.org/show_bug.cgi?id=133352 5 6 Reviewed by Tim Horton. 7 8 Pass the correct delta down to descendant nodes. 9 10 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: 11 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): 12 1 13 2014-05-28 Andy Estes <aestes@apple.com> 2 14 -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
r169411 r169430 186 186 187 187 FloatRect fixedPositionRect = scrollingTree().fixedPositionRect(); 188 189 size_t size = m_children->size(); 190 for ( size_t i = 0; i < size; ++i)191 m_children->at(i)->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());188 FloatSize scrollDelta = lastCommittedScrollPosition() - scrollPosition; 189 190 for (auto& child : *m_children) 191 child->updateLayersAfterAncestorChange(*this, fixedPositionRect, scrollDelta); 192 192 } 193 193
Note: See TracChangeset
for help on using the changeset viewer.