Diff
Modified: branches/safari-605-branch/LayoutTests/ChangeLog (228061 => 228062)
--- branches/safari-605-branch/LayoutTests/ChangeLog 2018-02-05 02:18:58 UTC (rev 228061)
+++ branches/safari-605-branch/LayoutTests/ChangeLog 2018-02-05 02:19:01 UTC (rev 228062)
@@ -1,5 +1,22 @@
2018-02-04 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r227974. rdar://problem/37145538
+
+ 2018-02-01 Dean Jackson <d...@apple.com>
+
+ REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
+ https://bugs.webkit.org/show_bug.cgi?id=182394
+ <rdar://problem/34840816>
+
+ Reviewed by Simon Fraser.
+
+ Add a test for a scaled down page.
+
+ * fast/dom/elementFromPoint-scaled-scrolled-expected.txt:
+ * fast/dom/elementFromPoint-scaled-scrolled.html:
+
+2018-02-04 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227948. rdar://problem/37145473
2018-01-31 Per Arne Vollan <pvol...@apple.com>
Modified: branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt (228061 => 228062)
--- branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt 2018-02-05 02:18:58 UTC (rev 228061)
+++ branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt 2018-02-05 02:19:01 UTC (rev 228062)
@@ -14,6 +14,7 @@
PASS document.elementFromPoint(415, 315) is b2
PASS document.elementFromPoint(-85, 15) is null
PASS document.elementFromPoint(215, 315) is b2
+PASS document.elementFromPoint(525, 425) is b2
PASS successfullyParsed is true
TEST COMPLETE
Modified: branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html (228061 => 228062)
--- branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html 2018-02-05 02:18:58 UTC (rev 228061)
+++ branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html 2018-02-05 02:19:01 UTC (rev 228062)
@@ -52,6 +52,14 @@
shouldBeNull("document.elementFromPoint(-85, 15)");
shouldBe("document.elementFromPoint(215, 315)", "b2");
+ window.scrollTo(0, 0);
+ if (window.internals)
+ window.internals.setPageScaleFactor(0.5, 0, 0);
+ // b2 is now technically outside the 800x600 scaled viewport rect,
+ // but should still be found.
+
+ shouldBe("document.elementFromPoint(525, 425)", "b2");
+
finishJSTest();
}
</script>
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (228061 => 228062)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-05 02:18:58 UTC (rev 228061)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-05 02:19:01 UTC (rev 228062)
@@ -1,5 +1,36 @@
2018-02-04 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r227974. rdar://problem/37145538
+
+ 2018-02-01 Dean Jackson <d...@apple.com>
+
+ REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
+ https://bugs.webkit.org/show_bug.cgi?id=182394
+ <rdar://problem/34840816>
+
+ Reviewed by Simon Fraser.
+
+ If a scale < 1 is applied to the page, then the visual viewport will be bigger
+ than the layout viewport. Our hit testing code would then ignore any hits
+ that were outside the layout viewport.
+
+ The fix is to only apply a hit testing clip if the page is scaling up, not down.
+
+ Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is
+ no longer used, and it would have probably been more confusing to have it accept
+ a flag to ignore the scale if it is less than 1.
+ * page/FrameView.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin,
+ and pass it to a helper that added the origin back. The only thing the helper was
+ doing for us was applying a scale factor, which we only want to do if it was
+ scaling up.
+
+2018-02-04 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227967. rdar://problem/37145562
2018-02-01 Chris Dumez <cdu...@apple.com>
Modified: branches/safari-605-branch/Source/WebCore/page/FrameView.cpp (228061 => 228062)
--- branches/safari-605-branch/Source/WebCore/page/FrameView.cpp 2018-02-05 02:18:58 UTC (rev 228061)
+++ branches/safari-605-branch/Source/WebCore/page/FrameView.cpp 2018-02-05 02:19:01 UTC (rev 228062)
@@ -4524,14 +4524,6 @@
return point;
}
-FloatRect FrameView::layoutViewportToAbsoluteRect(FloatRect rect) const
-{
- ASSERT(frame().settings().visualViewportEnabled());
- rect.moveBy(layoutViewportRect().location());
- rect.scale(frame().frameScaleFactor());
- return rect;
-}
-
FloatPoint FrameView::layoutViewportToAbsolutePoint(FloatPoint p) const
{
ASSERT(frame().settings().visualViewportEnabled());
Modified: branches/safari-605-branch/Source/WebCore/page/FrameView.h (228061 => 228062)
--- branches/safari-605-branch/Source/WebCore/page/FrameView.h 2018-02-05 02:18:58 UTC (rev 228061)
+++ branches/safari-605-branch/Source/WebCore/page/FrameView.h 2018-02-05 02:19:01 UTC (rev 228062)
@@ -473,7 +473,6 @@
WEBCORE_EXPORT FloatRect clientToDocumentRect(FloatRect) const;
WEBCORE_EXPORT FloatPoint clientToDocumentPoint(FloatPoint) const;
- FloatRect layoutViewportToAbsoluteRect(FloatRect) const;
FloatPoint layoutViewportToAbsolutePoint(FloatPoint) const;
// Unlike client coordinates, layout viewport coordinates are affected by page zoom.
Modified: branches/safari-605-branch/Source/WebCore/rendering/RenderLayer.cpp (228061 => 228062)
--- branches/safari-605-branch/Source/WebCore/rendering/RenderLayer.cpp 2018-02-05 02:18:58 UTC (rev 228061)
+++ branches/safari-605-branch/Source/WebCore/rendering/RenderLayer.cpp 2018-02-05 02:19:01 UTC (rev 228062)
@@ -4933,8 +4933,10 @@
if (!request.ignoreClipping()) {
if (renderer().settings().visualViewportEnabled()) {
auto& frameView = renderer().view().frameView();
- LayoutRect layoutViewportBounds({ }, frameView.layoutViewportRect().size());
- LayoutRect absoluteLayoutViewportRect = LayoutRect(frameView.layoutViewportToAbsoluteRect(layoutViewportBounds));
+ LayoutRect absoluteLayoutViewportRect = frameView.layoutViewportRect();
+ auto scaleFactor = frameView.frame().frameScaleFactor();
+ if (scaleFactor > 1)
+ absoluteLayoutViewportRect.scale(scaleFactor);
hitTestArea.intersect(absoluteLayoutViewportRect);
} else
hitTestArea.intersect(renderer().view().frameView().visibleContentRect(LegacyIOSDocumentVisibleRect));