Changeset 185681 in webkit
- Timestamp:
- Jun 17, 2015, 5:32:33 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (modified) (1 diff)
-
WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (modified) (2 diffs)
-
WebCore/platform/ScrollAnimator.cpp (modified) (2 diffs)
-
WebCore/platform/ScrollAnimator.h (modified) (1 diff)
-
WebCore/platform/cocoa/ScrollController.h (modified) (2 diffs)
-
WebCore/platform/cocoa/ScrollController.mm (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185679 r185681 1 2015-06-17 Brent Fulgham <bfulgham@apple.com> 2 3 Overflow regions with scroll snap points are not reliably rubber banding 4 https://bugs.webkit.org/show_bug.cgi?id=142522 5 <rdar://problem/20100726> 6 7 Reviewed by Darin Adler. 8 9 When computing the target scroll destination, update the nearest snap point index 10 and other bookkeeping, but keep the original gesture target if it would have taken 11 us beyond either limit of the scroll container. 12 13 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: 14 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: 15 (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtents): Add new method 16 to support client API. 17 * platform/ScrollAnimator.cpp: 18 (WebCore::ScrollAnimator::scrollExtents): Add new method to support client API. 19 * platform/ScrollAnimator.h: 20 * platform/cocoa/ScrollController.h: 21 (WebCore::ScrollControllerClient::scrollExtents): Added new pure virtual method to API. 22 * platform/cocoa/ScrollController.mm: 23 (WebCore::ScrollController::beginScrollSnapAnimation): Hold onto original user gesture 24 target, and use that instead of our nearest snap point if the gesture takes us past 25 either extreme of the scroll container. 26 1 27 2015-06-17 Tim Horton <timothy_horton@apple.com> 2 28 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h
r184596 r185681 89 89 void startScrollSnapTimer(ScrollEventAxis) override; 90 90 void stopScrollSnapTimer(ScrollEventAxis) override; 91 LayoutSize scrollExtent() const override; 91 92 #endif 92 93 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
r184596 r185681 30 30 31 31 #import "FrameView.h" 32 #import "LayoutSize.h" 32 33 #import "Logging.h" 33 34 #import "NSScrollerImpDetails.h" … … 588 589 scrollingTree().setMainFrameIsScrollSnapping(false); 589 590 } 591 592 LayoutSize ScrollingTreeFrameScrollingNodeMac::scrollExtent() const 593 { 594 return LayoutSize(totalContentsSize()); 595 } 590 596 #endif 591 597 -
trunk/Source/WebCore/platform/ScrollAnimator.cpp
r184728 r185681 34 34 35 35 #include "FloatPoint.h" 36 #include "LayoutSize.h" 36 37 #include "PlatformWheelEvent.h" 37 38 #include "ScrollableArea.h" … … 214 215 scrollToOffsetWithoutAnimation(FloatPoint(currentPosition.x(), currentPosition.y() + delta)); 215 216 } 217 218 LayoutSize ScrollAnimator::scrollExtent() const 219 { 220 return m_scrollableArea.contentsSize(); 221 } 216 222 #endif 217 223 -
trunk/Source/WebCore/platform/ScrollAnimator.h
r185431 r185681 136 136 bool activeScrollSnapIndexDidChange() const; 137 137 unsigned activeScrollSnapIndexForAxis(ScrollEventAxis) const; 138 LayoutSize scrollExtent() const override; 138 139 #endif 139 140 -
trunk/Source/WebCore/platform/cocoa/ScrollController.h
r184728 r185681 42 42 namespace WebCore { 43 43 44 class LayoutSize; 44 45 class PlatformWheelEvent; 45 46 class ScrollableArea; … … 103 104 return 0; 104 105 } 106 107 virtual LayoutSize scrollExtent() const = 0; 105 108 #endif 106 109 }; -
trunk/Source/WebCore/platform/cocoa/ScrollController.mm
r184728 r185681 27 27 #include "ScrollController.h" 28 28 29 #include "LayoutSize.h" 29 30 #include "PlatformWheelEvent.h" 30 31 #include "WebCoreSystemInterface.h" … … 753 754 LayoutUnit offset = m_client.scrollOffsetOnAxis(axis); 754 755 float initialWheelDelta = newState == ScrollSnapState::Gliding ? snapState.averageInitialWheelDelta() : 0; 755 LayoutUnit projectedScrollDestination = newState == ScrollSnapState::Gliding ? snapState.m_beginTrackingWheelDeltaOffset + LayoutUnit(projectedInertialScrollDistance(initialWheelDelta)) : offset;756 LayoutUnit scaledProjectedScrollDestination = newState == ScrollSnapState::Gliding ? snapState.m_beginTrackingWheelDeltaOffset + LayoutUnit(projectedInertialScrollDistance(initialWheelDelta)) : offset; 756 757 if (snapState.m_snapOffsets.isEmpty()) 757 758 return; 758 759 759 760 float scaleFactor = m_client.pageScaleFactor(); 760 761 projectedScrollDestination = std::min(std::max(LayoutUnit(projectedScrollDestination / scaleFactor), snapState.m_snapOffsets.first()), snapState.m_snapOffsets.last()); 761 LayoutUnit originalProjectedScrollDestination = scaledProjectedScrollDestination / scaleFactor; 762 763 LayoutUnit clampedScrollDestination = std::min(std::max(originalProjectedScrollDestination, snapState.m_snapOffsets.first()), snapState.m_snapOffsets.last()); 762 764 snapState.m_initialOffset = offset; 763 765 m_activeScrollSnapIndexDidChange = false; 764 snapState.m_targetOffset = scaleFactor * closestSnapOffset<LayoutUnit, float>(snapState.m_snapOffsets, projectedScrollDestination, initialWheelDelta, snapState.m_activeSnapIndex);766 snapState.m_targetOffset = scaleFactor * closestSnapOffset<LayoutUnit, float>(snapState.m_snapOffsets, clampedScrollDestination, initialWheelDelta, snapState.m_activeSnapIndex); 765 767 if (snapState.m_initialOffset == snapState.m_targetOffset) 766 768 return; 769 770 LayoutUnit scrollExtent = (axis == ScrollEventAxis::Horizontal) ? m_client.scrollExtent().width() : m_client.scrollExtent().height(); 771 LayoutUnit projectedScrollDestination = clampedScrollDestination; 772 if (originalProjectedScrollDestination < 0 || originalProjectedScrollDestination > scrollExtent) 773 projectedScrollDestination = originalProjectedScrollDestination; 767 774 768 775 m_activeScrollSnapIndexDidChange = true; -
trunk/Source/WebKit2/ChangeLog
r185680 r185681 1 2015-06-17 Brent Fulgham <bfulgham@apple.com> 2 3 Overflow regions with scroll snap points are not reliably rubber banding 4 https://bugs.webkit.org/show_bug.cgi?id=142522 5 <rdar://problem/20100726> 6 7 Reviewed by Darin Adler. 8 9 Make sure we don't block rubberbanding behavior when a scroll gesture should take us past 10 the end of the scroll container. 11 12 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: 13 (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Don't adjust 14 target point if we were going to scroll past the edges of the scroll container. 15 1 16 2015-06-17 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
r184139 r185681 81 81 - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset 82 82 { 83 CGFloat horizontalTarget = targetContentOffset->x; 84 CGFloat verticalTarget = targetContentOffset->y; 85 83 86 unsigned ignore; 84 if (!_scrollingTreeNode->horizontalSnapOffsets().isEmpty() )85 targetContentOffset->x = closestSnapOffset<float, CGFloat>(_scrollingTreeNode->horizontalSnapOffsets(), targetContentOffset->x, velocity.x, ignore);86 if (!_scrollingTreeNode->verticalSnapOffsets().isEmpty() )87 targetContentOffset->y = closestSnapOffset<float, CGFloat>(_scrollingTreeNode->verticalSnapOffsets(), targetContentOffset->y, velocity.y, ignore);87 if (!_scrollingTreeNode->horizontalSnapOffsets().isEmpty() && horizontalTarget >= 0 && horizontalTarget <= scrollView.contentSize.width) 88 targetContentOffset->x = closestSnapOffset<float, CGFloat>(_scrollingTreeNode->horizontalSnapOffsets(), horizontalTarget, velocity.x, ignore); 89 if (!_scrollingTreeNode->verticalSnapOffsets().isEmpty() && verticalTarget >= 0 && verticalTarget <= scrollView.contentSize.height) 90 targetContentOffset->y = closestSnapOffset<float, CGFloat>(_scrollingTreeNode->verticalSnapOffsets(), verticalTarget, velocity.y, ignore); 88 91 } 89 92 #endif
Note:
See TracChangeset
for help on using the changeset viewer.