Changeset 227974 in webkit
- Timestamp:
- Feb 1, 2018 10:59:38 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r227973 r227974 1 2018-02-01 Dean Jackson <dino@apple.com> 2 3 REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body 4 https://bugs.webkit.org/show_bug.cgi?id=182394 5 <rdar://problem/34840816> 6 7 Reviewed by Simon Fraser. 8 9 Add a test for a scaled down page. 10 11 * fast/dom/elementFromPoint-scaled-scrolled-expected.txt: 12 * fast/dom/elementFromPoint-scaled-scrolled.html: 13 1 14 2018-02-01 Commit Queue <commit-queue@webkit.org> 2 15 -
trunk/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt
r219342 r227974 15 15 PASS document.elementFromPoint(-85, 15) is null 16 16 PASS document.elementFromPoint(215, 315) is b2 17 PASS document.elementFromPoint(525, 425) is b2 17 18 PASS successfullyParsed is true 18 19 -
trunk/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html
r219342 r227974 53 53 shouldBe("document.elementFromPoint(215, 315)", "b2"); 54 54 55 window.scrollTo(0, 0); 56 if (window.internals) 57 window.internals.setPageScaleFactor(0.5, 0, 0); 58 // b2 is now technically outside the 800x600 scaled viewport rect, 59 // but should still be found. 60 61 shouldBe("document.elementFromPoint(525, 425)", "b2"); 62 55 63 finishJSTest(); 56 64 } -
trunk/Source/WebCore/ChangeLog
r227969 r227974 1 2018-02-01 Dean Jackson <dino@apple.com> 2 3 REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body 4 https://bugs.webkit.org/show_bug.cgi?id=182394 5 <rdar://problem/34840816> 6 7 Reviewed by Simon Fraser. 8 9 If a scale < 1 is applied to the page, then the visual viewport will be bigger 10 than the layout viewport. Our hit testing code would then ignore any hits 11 that were outside the layout viewport. 12 13 The fix is to only apply a hit testing clip if the page is scaling up, not down. 14 15 Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test. 16 17 * page/FrameView.cpp: 18 (WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is 19 no longer used, and it would have probably been more confusing to have it accept 20 a flag to ignore the scale if it is less than 1. 21 * page/FrameView.h: 22 * rendering/RenderLayer.cpp: 23 (WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin, 24 and pass it to a helper that added the origin back. The only thing the helper was 25 doing for us was applying a scale factor, which we only want to do if it was 26 scaling up. 27 1 28 2018-02-01 Yusuke Suzuki <utatane.tea@gmail.com> 2 29 -
trunk/Source/WebCore/page/FrameView.cpp
r227954 r227974 4609 4609 } 4610 4610 4611 FloatRect FrameView::layoutViewportToAbsoluteRect(FloatRect rect) const4612 {4613 ASSERT(frame().settings().visualViewportEnabled());4614 rect.moveBy(layoutViewportRect().location());4615 rect.scale(frame().frameScaleFactor());4616 return rect;4617 }4618 4619 4611 FloatPoint FrameView::layoutViewportToAbsolutePoint(FloatPoint p) const 4620 4612 { -
trunk/Source/WebCore/page/FrameView.h
r227664 r227974 476 476 WEBCORE_EXPORT FloatPoint clientToDocumentPoint(FloatPoint) const; 477 477 478 FloatRect layoutViewportToAbsoluteRect(FloatRect) const;479 478 FloatPoint layoutViewportToAbsolutePoint(FloatPoint) const; 480 479 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r226666 r227974 4934 4934 if (renderer().settings().visualViewportEnabled()) { 4935 4935 auto& frameView = renderer().view().frameView(); 4936 LayoutRect layoutViewportBounds({ }, frameView.layoutViewportRect().size()); 4937 LayoutRect absoluteLayoutViewportRect = LayoutRect(frameView.layoutViewportToAbsoluteRect(layoutViewportBounds)); 4936 LayoutRect absoluteLayoutViewportRect = frameView.layoutViewportRect(); 4937 auto scaleFactor = frameView.frame().frameScaleFactor(); 4938 if (scaleFactor > 1) 4939 absoluteLayoutViewportRect.scale(scaleFactor); 4938 4940 hitTestArea.intersect(absoluteLayoutViewportRect); 4939 4941 } else
Note: See TracChangeset
for help on using the changeset viewer.