Changeset 181504 in webkit
- Timestamp:
- Mar 14, 2015, 10:11:19 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/scrolling/AxisScrollSnapOffsets.cpp (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/UIProcess/API/Cocoa/WKWebView.mm (modified) (1 diff)
-
WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181502 r181504 1 2015-03-14 Brent Fulgham <bfulgham@apple.com> 2 3 [iOS] scroll snap points are animating to the wrong positions... 4 https://bugs.webkit.org/show_bug.cgi?id=142705 5 <rdar://problem/20136946> 6 7 Reviewed by Simon Fraser. 8 9 Avoid adding an extra '0' snap point to our set. We always start with one zero; this 10 extra append just forces us to do more steps in our search for nearest snap point. 11 12 * page/scrolling/AxisScrollSnapOffsets.cpp: 13 (WebCore::updateFromStyle): Remove extra '0' appended to offsets. 14 1 15 2015-03-14 Dean Jackson <dino@apple.com> 2 16 -
trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp
r181194 r181504 84 84 LayoutUnit maxScrollOffset = scrollSize - viewSize; 85 85 LayoutUnit lastSnapPosition = curSnapPositionShift; 86 snapOffsets.append(0);87 86 do { 88 87 for (auto& snapPosition : snapOffsetSubsequence) { … … 99 98 curSnapPositionShift = lastSnapPosition + repeatOffset; 100 99 } while (hasRepeat && curSnapPositionShift < maxScrollOffset); 100 101 if (snapOffsets.isEmpty()) 102 snapOffsets.append(0); 103 101 104 // Always put a snap point on the maximum scroll offset. 102 105 // Not a part of the spec, but necessary to prevent unreachable content when snapping. -
trunk/Source/WebKit2/ChangeLog
r181502 r181504 1 2015-03-14 Brent Fulgham <bfulgham@apple.com> 2 3 [iOS] scroll snap points are animating to the wrong positions. 4 https://bugs.webkit.org/show_bug.cgi?id=142705 5 <rdar://problem/20136946> 6 7 Reviewed by Simon Fraser. 8 9 Scroll snapping was landing in the wrong place on iOS because of two problems: 10 (1) It was searching for the closest snap offset point using unscaled 'screen' pixels, 11 which caused it to always choose one of the earliest snap point options. 12 (2) It was then selecting a scaled snap point coordinate and passing it back to UIKit 13 to animate the snap. This caused it to select a target point beyond the 'screen' pixel 14 we want to hit. 15 16 The solution to both problems are to scale the scroll destination UIKit suggests so that 17 we search among the scaled points with a valid value. Then, we need to scale the returned 18 value back to screen units before handing it back to UIKit to process. 19 20 * UIProcess/API/Cocoa/WKWebView.mm: 21 (-[WKWebView scrollViewWillBeginDragging:]): Drive-by fix. Get rid of extra ';' at 22 the end of the line. 23 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: 24 (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): 25 1 26 2015-03-14 Dean Jackson <dino@apple.com> 2 27 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r181443 r181504 1340 1340 WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy(); 1341 1341 ASSERT(scrollView == _scrollView.get()); 1342 scrollView.decelerationRate = (coordinator && coordinator->shouldSetScrollViewDecelerationRateFast()) ? UIScrollViewDecelerationRateFast : [_scrollView preferredScrollDecelerationFactor]; ;1342 scrollView.decelerationRate = (coordinator && coordinator->shouldSetScrollViewDecelerationRateFast()) ? UIScrollViewDecelerationRateFast : [_scrollView preferredScrollDecelerationFactor]; 1343 1343 #endif 1344 1344 } -
trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm
r174340 r181504 150 150 ScrollingTreeFrameScrollingNode* rootFrame = static_cast<ScrollingTreeFrameScrollingNode*>(root); 151 151 const Vector<float>& snapOffsets = axis == ScrollEventAxis::Horizontal ? rootFrame->horizontalSnapOffsets() : rootFrame->verticalSnapOffsets(); 152 return closestSnapOffset<float, float>(snapOffsets, scrollDestination, velocity); 152 153 float scaledScrollDestination = scrollDestination / m_webPageProxy.displayedContentScale(); 154 float rawClosestSnapOffset = closestSnapOffset<float, float>(snapOffsets, scaledScrollDestination, velocity); 155 return rawClosestSnapOffset * m_webPageProxy.displayedContentScale(); 153 156 } 154 157 #endif
Note:
See TracChangeset
for help on using the changeset viewer.