Changeset 212559 in webkit
- Timestamp:
- Feb 17, 2017, 11:11:59 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 10 edited
- 3 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt (modified) (1 diff)
-
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt (copied) (copied from trunk/LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt ) (3 diffs)
-
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html (copied) (copied from trunk/LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects.html ) (3 diffs)
-
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects.html (modified) (2 diffs)
-
LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt ) (3 diffs)
-
LayoutTests/platform/mac-wk1/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (2 diffs)
-
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r212558 r212559 1 2017-02-17 Simon Fraser <simon.fraser@apple.com> 2 3 Fixed elements bounce when rubber-banding at the bottom of the page 4 https://bugs.webkit.org/show_bug.cgi?id=168493 5 rdar://problem/30567713 6 7 Reviewed by Tim Horton. 8 9 * fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: 10 * fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt: Copied from LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt. 11 * fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html: Copied from LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects.html. 12 * fast/visual-viewport/rubberbanding-viewport-rects.html: 13 * platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt: 14 * platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt: Copied from LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt. 15 * platform/mac-wk1/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt: Added. 16 1 17 2017-02-17 Simon Fraser <simon.fraser@apple.com> 2 18 -
trunk/LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt
r211379 r212559 12 12 JSON.stringify(visualViewport) is {"top":525,"right":1260,"bottom":1110,"left":475,"width":785,"height":585} 13 13 14 Scrolled to 1800, 1 70015 JSON.stringify(layoutViewport) is {"top":169 0,"right":2008,"bottom":2275,"left":1223,"width":785,"height":585}16 JSON.stringify(visualViewport) is {"top":1 700,"right":2585,"bottom":2275,"left":1800,"width":785,"height":575}14 Scrolled to 1800, 1850 15 JSON.stringify(layoutViewport) is {"top":1695,"right":2008,"bottom":2280,"left":1223,"width":785,"height":585} 16 JSON.stringify(visualViewport) is {"top":1850,"right":2585,"bottom":2435,"left":1800,"width":785,"height":585} 17 17 PASS successfullyParsed is true 18 18 -
trunk/LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt
r212558 r212559 1 This test scrolls the page and checks that the layout and visual viewports respond as expected.1 This test scrolls the page with extended backgrounds enabled and checks that the layout and visual viewports respond as expected. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". … … 5 5 6 6 Scrolled to -123, -234 7 JSON.stringify(layoutViewport) is {"top": 0,"right":785,"bottom":585,"left":0,"width":785,"height":585}7 JSON.stringify(layoutViewport) is {"top":-234,"right":662,"bottom":351,"left":-123,"width":785,"height":585} 8 8 JSON.stringify(visualViewport) is {"top":-234,"right":662,"bottom":351,"left":-123,"width":785,"height":585} 9 9 … … 12 12 JSON.stringify(visualViewport) is {"top":525,"right":1260,"bottom":1110,"left":475,"width":785,"height":585} 13 13 14 Scrolled to 1800, 1 70015 JSON.stringify(layoutViewport) is {"top":1 690,"right":2008,"bottom":2275,"left":1223,"width":785,"height":585}16 JSON.stringify(visualViewport) is {"top":1 700,"right":2585,"bottom":2275,"left":1800,"width":785,"height":575}14 Scrolled to 1800, 1850 15 JSON.stringify(layoutViewport) is {"top":1850,"right":2585,"bottom":2435,"left":1800,"width":785,"height":585} 16 JSON.stringify(visualViewport) is {"top":1850,"right":2585,"bottom":2435,"left":1800,"width":785,"height":585} 17 17 PASS successfullyParsed is true 18 18 -
trunk/LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html
r212558 r212559 11 11 </style> 12 12 <script> 13 description("This test scrolls the page and checks that the layout and visual viewports respond as expected.");13 description("This test scrolls the page with extended backgrounds enabled and checks that the layout and visual viewports respond as expected."); 14 14 15 15 if (window.internals) { 16 16 internals.settings.setVisualViewportEnabled(true); 17 17 internals.settings.setAllowUnclampedScrollPosition(true); 18 internals.settings.setBackgroundShouldExtendBeyondPage(true); 18 19 } 19 20 … … 29 30 debug('Scrolled to ' + window.scrollX + ', ' + window.scrollY); 30 31 31 // Don't use shouldBeEqualToString() to avoid showing failures when correct output differs between platforms. 32 // Don't use shouldBeEqualToString() to avoid showing failures when correct output differs between platforms. 32 33 evalAndLogResult("JSON.stringify(layoutViewport)"); 33 34 evalAndLogResult("JSON.stringify(visualViewport)"); … … 43 44 44 45 debug(''); 45 window.scrollTo(1800, 1 700);46 window.scrollTo(1800, 1850); 46 47 visualViewport = internals.visualViewportRect(); 47 48 layoutViewport = internals.layoutViewportRect(); -
trunk/LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects.html
r211379 r212559 29 29 debug('Scrolled to ' + window.scrollX + ', ' + window.scrollY); 30 30 31 // Don't use shouldBeEqualToString() to avoid showing failures when correct output differs between platforms. 31 // Don't use shouldBeEqualToString() to avoid showing failures when correct output differs between platforms. 32 32 evalAndLogResult("JSON.stringify(layoutViewport)"); 33 33 evalAndLogResult("JSON.stringify(visualViewport)"); … … 43 43 44 44 debug(''); 45 window.scrollTo(1800, 1 700);45 window.scrollTo(1800, 1850); 46 46 visualViewport = internals.visualViewportRect(); 47 47 layoutViewport = internals.layoutViewportRect(); -
trunk/LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt
r211379 r212559 12 12 JSON.stringify(visualViewport) is {"top":525,"right":1275,"bottom":1125,"left":475,"width":800,"height":600} 13 13 14 Scrolled to 1800, 1 70015 JSON.stringify(layoutViewport) is {"top":16 16,"right":2008,"bottom":2216,"left":1208,"width":800,"height":600}16 JSON.stringify(visualViewport) is {"top":1 700,"right":2600,"bottom":2216,"left":1800,"width":800,"height":516}14 Scrolled to 1800, 1850 15 JSON.stringify(layoutViewport) is {"top":1658,"right":2008,"bottom":2258,"left":1208,"width":800,"height":600} 16 JSON.stringify(visualViewport) is {"top":1850,"right":2600,"bottom":2450,"left":1800,"width":800,"height":600} 17 17 PASS successfullyParsed is true 18 18 -
trunk/LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt
r212558 r212559 1 This test scrolls the page and checks that the layout and visual viewports respond as expected.1 This test scrolls the page with extended backgrounds enabled and checks that the layout and visual viewports respond as expected. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". … … 5 5 6 6 Scrolled to -123, -234 7 JSON.stringify(layoutViewport) is {"top": 0,"right":800,"bottom":600,"left":0,"width":800,"height":600}7 JSON.stringify(layoutViewport) is {"top":-234,"right":677,"bottom":366,"left":-123,"width":800,"height":600} 8 8 JSON.stringify(visualViewport) is {"top":-234,"right":677,"bottom":366,"left":-123,"width":800,"height":600} 9 9 … … 12 12 JSON.stringify(visualViewport) is {"top":525,"right":1275,"bottom":1125,"left":475,"width":800,"height":600} 13 13 14 Scrolled to 1800, 1 70015 JSON.stringify(layoutViewport) is {"top":1 616,"right":2008,"bottom":2216,"left":1208,"width":800,"height":600}16 JSON.stringify(visualViewport) is {"top":1 700,"right":2600,"bottom":2216,"left":1800,"width":800,"height":516}14 Scrolled to 1800, 1850 15 JSON.stringify(layoutViewport) is {"top":1850,"right":2600,"bottom":2450,"left":1800,"width":800,"height":600} 16 JSON.stringify(visualViewport) is {"top":1850,"right":2600,"bottom":2450,"left":1800,"width":800,"height":600} 17 17 PASS successfullyParsed is true 18 18 -
trunk/Source/WebCore/ChangeLog
r212558 r212559 1 2017-02-17 Simon Fraser <simon.fraser@apple.com> 2 3 Fixed elements bounce when rubber-banding at the bottom of the page 4 https://bugs.webkit.org/show_bug.cgi?id=168493 5 rdar://problem/30567713 6 7 Reviewed by Tim Horton. 8 9 FrameView::visibleDocumentRect() was computing a bad visible rect when bottom-rubber-banding, 10 by adding rubberBandBottom which is negative, rather than subtracting. 11 12 Log some more scrolling stuff. 13 14 Ironically, the existing test didn't test stick-to-viewport fixed position because 15 backgroundShouldExtendBeyondPage() is off by default in WTR, so clone it to a test 16 that sets this, to test both behaviors. 17 18 This also revealed that dynamic changes to backgroundShouldExtendBeyondPage() need 19 to be propagated to the scrolling tree, which is fixed in AsyncScrollingCoordinator::frameViewLayoutUpdated(). 20 21 Test: fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html 22 23 * page/FrameView.cpp: 24 (WebCore::FrameView::updateLayoutViewport): 25 (WebCore::FrameView::visibleDocumentRect): 26 * page/scrolling/AsyncScrollingCoordinator.cpp: 27 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): 28 * page/scrolling/ScrollingStateFrameScrollingNode.cpp: 29 (WebCore::ScrollingStateFrameScrollingNode::dumpProperties): 30 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: 31 (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition): 32 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 33 (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit): 34 (WebCore::ScrollingCoordinatorMac::commitTreeState): 35 1 36 2017-02-17 Simon Fraser <simon.fraser@apple.com> 2 37 -
trunk/Source/WebCore/page/FrameView.cpp
r212484 r212559 1907 1907 LayoutRect layoutViewport = layoutViewportRect(); 1908 1908 1909 LOG_WITH_STREAM(Scrolling, stream << "\nFrameView " << this << " updateLayoutViewport() totalContentSize " << totalContentsSize() << " unscaledDocumentRect " << (renderView() ? renderView()->unscaledDocumentRect() : IntRect()) << " header height " << headerHeight() << " footer height " << footerHeight() );1909 LOG_WITH_STREAM(Scrolling, stream << "\nFrameView " << this << " updateLayoutViewport() totalContentSize " << totalContentsSize() << " unscaledDocumentRect " << (renderView() ? renderView()->unscaledDocumentRect() : IntRect()) << " header height " << headerHeight() << " footer height " << footerHeight() << " fixed behavior " << scrollBehaviorForFixedElements()); 1910 1910 LOG_WITH_STREAM(Scrolling, stream << "layoutViewport: " << layoutViewport); 1911 1911 LOG_WITH_STREAM(Scrolling, stream << "visualViewport: " << visualViewportRect()); … … 1960 1960 1961 1961 float rubberBandBottom = std::min<float>((totalContentsSize.height() - visibleContentRect.y()) - visibleContentRect.height(), 0); 1962 float visibleScaledDocumentBottom = std::min<float>(visibleContentRect.maxY() - headerHeight, contentsHeight) +rubberBandBottom;1962 float visibleScaledDocumentBottom = std::min<float>(visibleContentRect.maxY() - headerHeight, contentsHeight) - rubberBandBottom; 1963 1963 1964 1964 FloatRect visibleDocumentRect = visibleContentRect; -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r211379 r212559 158 158 node->setReachableContentsSize(frameView.totalContentsSize()); 159 159 node->setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame()); 160 node->setScrollBehaviorForFixedElements(frameView.scrollBehaviorForFixedElements()); 160 161 161 162 #if ENABLE(CSS_SCROLL_SNAP) -
trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
r208503 r212559 282 282 ts << "(max layout viewport origin " << m_maxLayoutViewportOrigin << ")\n"; 283 283 } 284 285 if (m_behaviorForFixed == StickToViewportBounds) { 286 writeIndent(ts, indent + 1); 287 ts << "(fixed behavior: stick to viewport)\n"; 288 } 284 289 285 290 if (!m_eventTrackingRegions.asynchronousDispatchRegion.isEmpty()) { -
trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp
r211379 r212559 107 107 LayoutRect layoutViewport(m_layoutViewport); 108 108 109 LOG_WITH_STREAM(Scrolling, stream << "\nScrolling thread: " << "(visibleContentOrigin " << visibleContentOrigin << ") ");109 LOG_WITH_STREAM(Scrolling, stream << "\nScrolling thread: " << "(visibleContentOrigin " << visibleContentOrigin << ") fixed behavior " << m_behaviorForFixed); 110 110 LOG_WITH_STREAM(Scrolling, stream << " layoutViewport: " << layoutViewport); 111 111 LOG_WITH_STREAM(Scrolling, stream << " visualViewport: " << visualViewport); -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r211033 r212559 31 31 32 32 #include "FrameView.h" 33 #include "Logging.h" 33 34 #include "MainFrame.h" 34 35 #include "Page.h" … … 104 105 return; 105 106 107 LOG(Scrolling, "ScrollingCoordinatorMac::scheduleTreeStateCommit"); 106 108 m_scrollingStateTreeCommitterTimer.startOneShot(0); 107 109 } … … 110 112 { 111 113 willCommitTree(); 114 115 LOG(Scrolling, "ScrollingCoordinatorMac::commitTreeState, has changes %d", scrollingStateTree()->hasChangedProperties()); 116 112 117 if (!scrollingStateTree()->hasChangedProperties()) 113 118 return; 119 120 LOG(Scrolling, "%s", scrollingStateTreeAsText().utf8().data()); 114 121 115 122 RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree());
Note:
See TracChangeset
for help on using the changeset viewer.