haikuwebkit/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-hea...

12 lines
337 B
Plaintext
Raw Permalink Normal View History

REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad https://bugs.webkit.org/show_bug.cgi?id=166472 rdar://problem/29675551 Reviewed by Tim Horton. Source/WebCore: r209299 broke autoscroll in zoomed pages because it changed RenderLayer::scrollRectToVisible() to shrink viewRect by page scale. This is incorrect for all callers of scrollRectToVisible, since the "absoluteRect" passed in is actually in zoomed document coordinates for all the callers I tested. This code is also fixed to account for headers and footers. getRectToExpose() takes rectangles in "scroll view contents" coordinates (i.e. including header, and zoomed document), so doesn't need the separate visibleRectRelativeToDocument parameter. Tests: fast/events/autoscroll-main-document.html fast/events/autoscroll-when-zoomed.html fast/events/drag-select-when-zoomed-with-header.html fast/events/drag-select-when-zoomed.html fast/scrolling/scroll-to-anchor-zoomed-header.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): (WebCore::RenderLayer::getRectToExpose): * rendering/RenderLayer.h: Tools: These changes are necessary to allow the mouse to leave the WTR window while drag-scrolling, to test autoscroll. Previously, we were never calling -mouseDragged (which DRT does); we'd always go through mouseMoved, which hits an early return in WebViewImpl::mouseMoved() when the point is outside the view. * WebKitTestRunner/mac/EventSenderProxy.mm: (WTR::EventSenderProxy::mouseMoveTo): LayoutTests: Add some test coverage for autoscroll of the main document. I could only get this working in WebKitTestRunner, not DumpRenderTree. * TestExpectations: * fast/events/autoscroll-main-document-expected.txt: Added. * fast/events/autoscroll-main-document.html: Added. * fast/events/autoscroll-when-zoomed-expected.txt: Added. * fast/events/autoscroll-when-zoomed.html: Added. * fast/events/drag-select-when-zoomed-expected.txt: Added. * fast/events/drag-select-when-zoomed-with-header-expected.txt: Added. * fast/events/drag-select-when-zoomed-with-header.html: Added. * fast/events/drag-select-when-zoomed.html: Added. * fast/scrolling/scroll-to-anchor-zoomed-header-expected.txt: Added. * fast/scrolling/scroll-to-anchor-zoomed-header.html: Added. * fast/transforms/selection-bounds-in-transformed-view.html: Revert the target scroll position to what it was before r209299, and improve the failure output. * platform/ios-simulator/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/183751@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-25 23:57:40 +00:00
Tests scrolling to an anchor in a zoomed page with a header scrolls to the correct location.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS document.scrollingElement.scrollTop is 1019
PASS document.scrollingElement.scrollLeft is 0
PASS successfullyParsed is true
TEST COMPLETE
Anchor is here