Changeset 208722 in webkit
- Timestamp:
- Nov 14, 2016 6:19:27 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r208716 r208722 1 2016-11-14 Simon Fraser <simon.fraser@apple.com> 2 3 Scrolling when zoomed doesn't always use the correct layout viewport 4 https://bugs.webkit.org/show_bug.cgi?id=164756 5 6 Reviewed by Dean Jackson. 7 8 The scrolling thread was always using the layout viewport rect pushed onto it and 9 never computing a new one, so when scrolling around after zooming position:fixed 10 elements would not get the expected visual viewport behavior. 11 12 Fix by having ScrollingTreeFrameScrollingNode updating its notion of the layout viewport 13 on scrolls. 14 15 Not testable because we can't dump the scrolling tree on Mac (yet). 16 17 * page/scrolling/ScrollingTreeFrameScrollingNode.h: 18 (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport): 19 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: 20 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): 21 1 22 2016-11-14 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h
r208666 r208722 71 71 72 72 FloatRect layoutViewport() const { return m_layoutViewport; }; 73 void setLayoutViewport(const FloatRect& r) { m_layoutViewport = r; }; 74 73 75 FloatPoint minLayoutViewportOrigin() const { return m_minLayoutViewportOrigin; } 74 76 FloatPoint maxLayoutViewportOrigin() const { return m_maxLayoutViewportOrigin; } 75 77 76 78 ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; } 77 79 78 80 private: 79 81 void dumpProperties(TextStream&, ScrollingStateTreeAsTextBehavior) const override; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
r208503 r208722 389 389 updateMainFramePinState(scrollPosition); 390 390 391 FloatRect layoutViewport;392 391 Optional<FloatPoint> layoutViewportOrigin; 393 392 if (scrollingTree().visualViewportEnabled()) { … … 395 394 float counterScale = 1 / frameScaleFactor(); 396 395 visibleContentOrigin.scale(counterScale, counterScale); 397 layoutViewport = layoutViewportForScrollPosition(visibleContentOrigin, frameScaleFactor()); 398 layoutViewportOrigin = layoutViewport.location(); 396 FloatRect newLayoutViewport = layoutViewportForScrollPosition(visibleContentOrigin, frameScaleFactor()); 397 setLayoutViewport(newLayoutViewport); 398 layoutViewportOrigin = newLayoutViewport.location(); 399 399 } 400 400 … … 405 405 } 406 406 407 setScrollLayerPosition(scrollPosition, layoutViewport );407 setScrollLayerPosition(scrollPosition, layoutViewport()); 408 408 scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, layoutViewportOrigin); 409 409 }
Note: See TracChangeset
for help on using the changeset viewer.