- Revision
- 248354
- Author
- [email protected]
- Date
- 2019-08-06 23:52:50 -0700 (Tue, 06 Aug 2019)
Log Message
Cherry-pick r248015. rdar://problem/54017889
Can't scroll on yummly.co.uk recipe (scale(0) div covers the content and hit-tests)
https://bugs.webkit.org/show_bug.cgi?id=200263
rdar://problem/53679408
Reviewed by Antti Koivisto.
Source/WebKit:
The content on this page had a scale(0) div overlaying an overflow:scroll element,
and our UI-side hit-testing code would find this scale(0) element, because apparently
-[UIView convertPoint:fromView:] will happily work with non-invertible matrices, and
-[UIView pointInside:withEvent:] just compares the point with the view bounds.
Since the view frame takes the transform into account, we can look for an empty frame
to detect these non-invertible transforms.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::collectDescendantViewsAtPoint):
LayoutTests:
* fast/scrolling/ios/non-invertible-transformed-over-scroller-expected.txt: Added.
* fast/scrolling/ios/non-invertible-transformed-over-scroller.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Added Paths
Diff
Modified: branches/safari-608.1-branch/LayoutTests/ChangeLog (248353 => 248354)
--- branches/safari-608.1-branch/LayoutTests/ChangeLog 2019-08-07 06:52:47 UTC (rev 248353)
+++ branches/safari-608.1-branch/LayoutTests/ChangeLog 2019-08-07 06:52:50 UTC (rev 248354)
@@ -1,5 +1,46 @@
2019-08-06 Kocsen Chung <[email protected]>
+ Cherry-pick r248015. rdar://problem/54017889
+
+ Can't scroll on yummly.co.uk recipe (scale(0) div covers the content and hit-tests)
+ https://bugs.webkit.org/show_bug.cgi?id=200263
+ rdar://problem/53679408
+
+ Reviewed by Antti Koivisto.
+
+ Source/WebKit:
+
+ The content on this page had a scale(0) div overlaying an overflow:scroll element,
+ and our UI-side hit-testing code would find this scale(0) element, because apparently
+ -[UIView convertPoint:fromView:] will happily work with non-invertible matrices, and
+ -[UIView pointInside:withEvent:] just compares the point with the view bounds.
+
+ Since the view frame takes the transform into account, we can look for an empty frame
+ to detect these non-invertible transforms.
+
+ * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+ (WebKit::collectDescendantViewsAtPoint):
+
+ LayoutTests:
+
+ * fast/scrolling/ios/non-invertible-transformed-over-scroller-expected.txt: Added.
+ * fast/scrolling/ios/non-invertible-transformed-over-scroller.html: Added.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-07-29 Simon Fraser <[email protected]>
+
+ Can't scroll on yummly.co.uk recipe (scale(0) div covers the content and hit-tests)
+ https://bugs.webkit.org/show_bug.cgi?id=200263
+ rdar://problem/53679408
+
+ Reviewed by Antti Koivisto.
+
+ * fast/scrolling/ios/non-invertible-transformed-over-scroller-expected.txt: Added.
+ * fast/scrolling/ios/non-invertible-transformed-over-scroller.html: Added.
+
+2019-08-06 Kocsen Chung <[email protected]>
+
Cherry-pick r247868. rdar://problem/54017876
[iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
Added: branches/safari-608.1-branch/LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller-expected.txt (0 => 248354)
--- branches/safari-608.1-branch/LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller-expected.txt (rev 0)
+++ branches/safari-608.1-branch/LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller-expected.txt 2019-08-07 06:52:50 UTC (rev 248354)
@@ -0,0 +1,12 @@
+Tests hit-testing of layers over scrollers with odd transforms
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS scrollTopWithScale0Overlay is 100
+PASS scrollTopWithScaledOverlayHitOverlay is 0
+PASS scrollTopWithScaledOverlayHitScroller is 100
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: branches/safari-608.1-branch/LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller.html (0 => 248354)
--- branches/safari-608.1-branch/LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller.html (rev 0)
+++ branches/safari-608.1-branch/LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller.html 2019-08-07 06:52:50 UTC (rev 248354)
@@ -0,0 +1,99 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+ <meta name="viewport" content="width=device-width">
+ <style>
+ div {
+ box-sizing: border-box;
+ }
+ .container {
+ position: relative;
+ width: 200px;
+ height: 200px;
+ margin: 10px;
+ border: 1px solid black;
+ }
+
+ .scroller {
+ overflow: scroll;
+ }
+
+ .content {
+ width: 100%;
+ height: 300%;
+ background-image: repeating-linear-gradient(white, silver 200px);
+ }
+
+ .overlay {
+ transform-origin: top left;
+ background-color: rgba(0, 0, 0, 0.25);
+ }
+
+ .container > div {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ }
+ </style>
+ <script src=""
+ <script src=""
+ <script>
+ var scrollTopWithScale0Overlay;
+ var scrollTopWithScaledOverlayHitOverlay;
+ var scrollTopWithScaledOverlayHitScroller;
+
+ window.addEventListener('load', async () => {
+
+ let scrollers = document.querySelectorAll('.scroller');
+ let bounds = scrollers[0].getBoundingClientRect();
+
+ await UIHelper.immediateScrollElementAtContentPointToOffset(bounds.left + 10, bounds.top + 10, 0, 100);
+ scrollTopWithScale0Overlay = scrollers[0].scrollTop;
+
+ // In case the previous scroll failed.
+ document.scrollingElement.scrollTop = 0;
+ scrollers[1].scrollTop = 0;
+
+ bounds = scrollers[1].getBoundingClientRect();
+ // Hit the overlay
+ await UIHelper.immediateScrollElementAtContentPointToOffset(bounds.left + 10, bounds.top + 10, 0, 100);
+ scrollTopWithScaledOverlayHitOverlay = scrollers[1].scrollTop;
+
+ // In case the previous scroll failed.
+ document.scrollingElement.scrollTop = 0;
+ scrollers[1].scrollTop = 0;
+
+ // Hit the scroller
+ await UIHelper.immediateScrollElementAtContentPointToOffset(bounds.left + bounds.width / 2 + 10, bounds.top + 10, 0, 100);
+ scrollTopWithScaledOverlayHitScroller = scrollers[1].scrollTop;
+
+ description('Tests hit-testing of layers over scrollers with odd transforms');
+ shouldBe('scrollTopWithScale0Overlay', '100');
+ shouldBe('scrollTopWithScaledOverlayHitOverlay', '0');
+ shouldBe('scrollTopWithScaledOverlayHitScroller', '100');
+
+ finishJSTest();
+
+ }, false);
+
+ var successfullyParsed = true;
+ var jsTestIsAsync = true;
+ </script>
+ <script src=""
+</head>
+<body>
+ <div class="container">
+ <div class="scroller">
+ <div class="content"></div>
+ </div>
+ <div class="overlay" style="transform: scale(0)"></div>
+ </div>
+
+ <div class="container">
+ <div class="scroller">
+ <div class="content"></div>
+ </div>
+ <div class="overlay" style="transform: scale(0.5)"></div>
+ </div>
+</body>
+</html>
Modified: branches/safari-608.1-branch/Source/WebKit/ChangeLog (248353 => 248354)
--- branches/safari-608.1-branch/Source/WebKit/ChangeLog 2019-08-07 06:52:47 UTC (rev 248353)
+++ branches/safari-608.1-branch/Source/WebKit/ChangeLog 2019-08-07 06:52:50 UTC (rev 248354)
@@ -1,39 +1,69 @@
2019-08-06 Kocsen Chung <[email protected]>
- Cherry-pick r247920. rdar://problem/54017883
+ Cherry-pick r248015. rdar://problem/54017889
- Contextual menu does not present when holding an embedded photo but works with link and attachments
- https://bugs.webkit.org/show_bug.cgi?id=200239
- <rdar://problem/53318733>
+ Can't scroll on yummly.co.uk recipe (scale(0) div covers the content and hit-tests)
+ https://bugs.webkit.org/show_bug.cgi?id=200263
+ rdar://problem/53679408
- Reviewed by Tim Horton.
+ Reviewed by Antti Koivisto.
- If the user long-pressed on an image, and the client implemented the new API but did
- not provide a configuration, we were not falling back to the default behaviour of
- giving a menu allowing the user to copy/share/save the image.
+ Source/WebKit:
- * UIProcess/ios/WKContentViewInteraction.mm:
- (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates,
- and the element is an image, return the default configuration.
+ The content on this page had a scale(0) div overlaying an overflow:scroll element,
+ and our UI-side hit-testing code would find this scale(0) element, because apparently
+ -[UIView convertPoint:fromView:] will happily work with non-invertible matrices, and
+ -[UIView pointInside:withEvent:] just compares the point with the view bounds.
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+ Since the view frame takes the transform into account, we can look for an empty frame
+ to detect these non-invertible transforms.
+
+ * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+ (WebKit::collectDescendantViewsAtPoint):
+
+ LayoutTests:
+
+ * fast/scrolling/ios/non-invertible-transformed-over-scroller-expected.txt: Added.
+ * fast/scrolling/ios/non-invertible-transformed-over-scroller.html: Added.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- 2019-07-29 Dean Jackson <[email protected]>
+ 2019-08-06 Kocsen Chung <[email protected]>
- Contextual menu does not present when holding an embedded photo but works with link and attachments
- https://bugs.webkit.org/show_bug.cgi?id=200239
- <rdar://problem/53318733>
+ Cherry-pick r247920. rdar://problem/54017883
- Reviewed by Tim Horton.
+ Contextual menu does not present when holding an embedded photo but works with link and attachments
+ https://bugs.webkit.org/show_bug.cgi?id=200239
+ <rdar://problem/53318733>
- If the user long-pressed on an image, and the client implemented the new API but did
- not provide a configuration, we were not falling back to the default behaviour of
- giving a menu allowing the user to copy/share/save the image.
+ Reviewed by Tim Horton.
- * UIProcess/ios/WKContentViewInteraction.mm:
- (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates,
- and the element is an image, return the default configuration.
+ If the user long-pressed on an image, and the client implemented the new API but did
+ not provide a configuration, we were not falling back to the default behaviour of
+ giving a menu allowing the user to copy/share/save the image.
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates,
+ and the element is an image, return the default configuration.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-07-29 Dean Jackson <[email protected]>
+
+ Contextual menu does not present when holding an embedded photo but works with link and attachments
+ https://bugs.webkit.org/show_bug.cgi?id=200239
+ <rdar://problem/53318733>
+
+ Reviewed by Tim Horton.
+
+ If the user long-pressed on an image, and the client implemented the new API but did
+ not provide a configuration, we were not falling back to the default behaviour of
+ giving a menu allowing the user to copy/share/save the image.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates,
+ and the element is an image, return the default configuration.
+
2019-08-06 Kocsen Chung <[email protected]>
Cherry-pick r247868. rdar://problem/54017876
@@ -318,6 +348,25 @@
incoming synchronous IPC for other processes (in particular the UIProcess) while it is blocked
on those synchronous IPCs. It is safe to re-enter the WebContent process on these sync IPCs
since they are triggered by JS and we return to JS right after. This should avoid UIProcess
+2019-07-29 Simon Fraser <[email protected]>
+
+ Can't scroll on yummly.co.uk recipe (scale(0) div covers the content and hit-tests)
+ https://bugs.webkit.org/show_bug.cgi?id=200263
+ rdar://problem/53679408
+
+ Reviewed by Antti Koivisto.
+
+ The content on this page had a scale(0) div overlaying an overflow:scroll element,
+ and our UI-side hit-testing code would find this scale(0) element, because apparently
+ -[UIView convertPoint:fromView:] will happily work with non-invertible matrices, and
+ -[UIView pointInside:withEvent:] just compares the point with the view bounds.
+
+ Since the view frame takes the transform into account, we can look for an empty frame
+ to detect these non-invertible transforms.
+
+ * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+ (WebKit::collectDescendantViewsAtPoint):
+
hangs when the UIProcess is sending a sync IPC to the WebContent process, which is itself
stuck on the sync IPC to show a JS alert.
Modified: branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (248353 => 248354)
--- branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm 2019-08-07 06:52:47 UTC (rev 248353)
+++ branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm 2019-08-07 06:52:50 UTC (rev 248354)
@@ -52,8 +52,13 @@
// It is currently only needed for scroll views.
if (!view.isUserInteractionEnabled)
return false;
+
+ if (CGRectIsEmpty([view frame]))
+ return false;
+
if (![view pointInside:subviewPoint withEvent:event])
return false;
+
if (![view isKindOfClass:[WKCompositingView class]])
return true;
auto* node = RemoteLayerTreeNode::forCALayer(view.layer);