Changeset 181510 in webkit
- Timestamp:
- Mar 15, 2015, 12:13:36 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (modified) (1 diff)
-
page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (modified) (1 diff)
-
platform/cocoa/ScrollController.h (modified) (1 diff)
-
platform/cocoa/ScrollController.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181508 r181510 1 2015-03-15 Brent Fulgham <bfulgham@apple.com> 2 3 scroll snap points do not properly account for zoomed pages 4 https://bugs.webkit.org/show_bug.cgi?id=142706 5 <rdar://problem/20165771> 6 7 Reviewed by Anders Carlsson. 8 9 When a WebView is zoomed (such that it has a non-unity pageScaleFactor), we need to account for this 10 scaling value when selecting our correct scroll snap point target, as well as when specifying the 11 pixel location for our animation to target. 12 13 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: 14 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: 15 (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor): Added new delegate method. 16 * platform/cocoa/ScrollController.h: 17 (WebCore::ScrollControllerClient::pageScaleFactor): Added new default delegate. 18 * platform/cocoa/ScrollController.mm: 19 (WebCore::ScrollController::beginScrollSnapAnimation): Calculate the correct scroll target 20 based on the page scale factor. 21 1 22 2015-03-15 Csaba Osztrogonác <ossy@webkit.org> 2 23 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h
r181087 r181510 83 83 LayoutUnit scrollOffsetOnAxis(ScrollEventAxis) const override; 84 84 void immediateScrollOnAxis(ScrollEventAxis, float delta) override; 85 float pageScaleFactor() const override; 85 86 #endif 86 87 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
r181087 r181510 559 559 immediateScrollBy(change - currentPosition); 560 560 } 561 562 float ScrollingTreeFrameScrollingNodeMac::pageScaleFactor() const 563 { 564 return frameScaleFactor(); 565 } 561 566 #endif 562 567 -
trunk/Source/WebCore/platform/cocoa/ScrollController.h
r181087 r181510 87 87 { 88 88 // Override to perform client-specific scroll snap point end logic 89 89 } 90 91 virtual float pageScaleFactor() const 92 { 93 return 1.0f; 90 94 } 91 95 #endif -
trunk/Source/WebCore/platform/cocoa/ScrollController.mm
r181300 r181510 685 685 return; 686 686 687 projectedScrollDestination = std::min(std::max(projectedScrollDestination, snapState.m_snapOffsets.first()), snapState.m_snapOffsets.last()); 687 float scaleFactor = m_client->pageScaleFactor(); 688 689 projectedScrollDestination = std::min(std::max(LayoutUnit(projectedScrollDestination / scaleFactor), snapState.m_snapOffsets.first()), snapState.m_snapOffsets.last()); 688 690 snapState.m_initialOffset = offset; 689 snapState.m_targetOffset = closestSnapOffset<LayoutUnit, float>(snapState.m_snapOffsets, projectedScrollDestination, initialWheelDelta);691 snapState.m_targetOffset = scaleFactor * closestSnapOffset<LayoutUnit, float>(snapState.m_snapOffsets, projectedScrollDestination, initialWheelDelta); 690 692 if (snapState.m_initialOffset == snapState.m_targetOffset) 691 693 return;
Note:
See TracChangeset
for help on using the changeset viewer.