Title: [194097] branches/safari-601.1.46-branch

Diff

Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (194096 => 194097)


--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-15 07:03:25 UTC (rev 194096)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-15 07:03:30 UTC (rev 194097)
@@ -1,3 +1,19 @@
+2015-12-14  Matthew Hanson  <[email protected]>
+
+        Merge r193997. rdar://problem/23814333
+
+    2015-12-11  Beth Dakin  <[email protected]>
+
+            _touchEventRegions should return regions in the view's coordinates
+            https://bugs.webkit.org/show_bug.cgi?id=152189
+            -and corresponding-
+            rdar://problem/23188605
+
+            Reviewed by Dan Bernstein.
+
+            * fast/events/touch/ios/touch-event-rtl-expected.txt: Added.
+            * fast/events/touch/ios/touch-event-rtl.html: Added.
+
 2015-12-11  Matthew Hanson  <[email protected]>
 
         Merge r193859. rdar://problem/23814345

Added: branches/safari-601.1.46-branch/LayoutTests/fast/events/touch/ios/touch-event-rtl-expected.txt (0 => 194097)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/touch/ios/touch-event-rtl-expected.txt	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/touch/ios/touch-event-rtl-expected.txt	2015-12-15 07:03:30 UTC (rev 194097)
@@ -0,0 +1,3 @@
+Tap me
+Received event touchstart at 58, 50
+Done

Added: branches/safari-601.1.46-branch/LayoutTests/fast/events/touch/ios/touch-event-rtl.html (0 => 194097)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/touch/ios/touch-event-rtl.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/touch/ios/touch-event-rtl.html	2015-12-15 07:03:30 UTC (rev 194097)
@@ -0,0 +1,60 @@
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" dir="rtl">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
+<style>
+body {
+    width: 900px;
+}
+.button {
+    padding: 40px;
+    background: #ccc;
+}
+.button.tapped {
+    background: green;
+}
+</style>
+
+<script>
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+function getUIScript()
+{
+    return `
+    (function() {
+        uiController.singleTapAtPoint(-50, 50, function() {
+            uiController.uiScriptComplete("Done");
+                });
+    })();`
+}
+
+function setUp()
+{
+    var output = '';
+    var target = document.getElementById('target');
+    target.addEventListener('touchstart', function(event) {
+        output += 'Received event ' + event.type + ' at ' + event.touches[0].clientX + ', ' + event.touches[0].clientY + '<br>';
+        target.classList.toggle('tapped');
+    });
+
+    if (testRunner.runUIScript) {
+        testRunner.runUIScript(getUIScript(), function(result) {
+            output += result;
+            document.getElementById('console').innerHTML = output;
+            testRunner.notifyDone();
+        });
+    }
+}
+
+window.addEventListener('load', setUp, false);
+</script>
+</head>
+<body>
+    <div class="button" id="target">Tap me</div>
+    <pre id="console">To test manually, tap the box. If it turns green, then the test passes.</pre>
+</body>
+</html>

Modified: branches/safari-601.1.46-branch/Source/WebKit/mac/ChangeLog (194096 => 194097)


--- branches/safari-601.1.46-branch/Source/WebKit/mac/ChangeLog	2015-12-15 07:03:25 UTC (rev 194096)
+++ branches/safari-601.1.46-branch/Source/WebKit/mac/ChangeLog	2015-12-15 07:03:30 UTC (rev 194097)
@@ -1,3 +1,26 @@
+2015-12-14  Matthew Hanson  <[email protected]>
+
+        Merge r193997. rdar://problem/23814333
+
+    2015-12-11  Beth Dakin  <[email protected]>
+
+            _touchEventRegions should return regions in the view's coordinates
+            https://bugs.webkit.org/show_bug.cgi?id=152189
+            -and corresponding-
+            rdar://problem/23188605
+
+            Reviewed by Dan Bernstein.
+
+            The comment here was actually out of date. It claimed that touch rectangles
+            are in the coordinate system of the document, but we had actually changed
+            them to be in the view’s coordinate system in order to fix issues with
+            handling touch events in UIWebView. But now we are going back to having the
+            touch rectangles be in the document’s coordinate system, so we should fix the
+            rtl bugs here by converting to view coordinates before handing the rects off
+            to iOS WK1 clients.
+            * WebView/WebView.mm:
+            (-[WebView _touchEventRegions]):
+
 2015-10-17  Myles C. Maxfield  <[email protected]>
 
         Build fix after r191260

Modified: branches/safari-601.1.46-branch/Source/WebKit/mac/WebView/WebView.mm (194096 => 194097)


--- branches/safari-601.1.46-branch/Source/WebKit/mac/WebView/WebView.mm	2015-12-15 07:03:25 UTC (rev 194096)
+++ branches/safari-601.1.46-branch/Source/WebKit/mac/WebView/WebView.mm	2015-12-15 07:03:30 UTC (rev 194097)
@@ -3719,26 +3719,27 @@
 
     NSMutableArray *eventRegionArray = [[[NSMutableArray alloc] initWithCapacity:rects.size()] autorelease];
 
+    NSView <WebDocumentView> *documentView = [[[self mainFrame] frameView] documentView];
     Vector<IntRect>::const_iterator end = rects.end();
     for (Vector<IntRect>::const_iterator it = rects.begin(); it != end; ++it) {
         const IntRect& rect = *it;
         if (rect.isEmpty())
             continue;
 
-        // Note that these rectangles are in the coordinate system of the document (inside the WebHTMLView), which is not
-        // the same as the coordinate system of the WebView. If you want to do comparisons with locations in the WebView,
-        // you must convert between the two using WAKView's convertRect:toView: selector. This will take care of scaling
-        // and translations (which are relevant for right-to-left column layout).
+        // The touch rectangles are in the coordinate system of the document (inside the WebHTMLView), which is not
+        // the same as the coordinate system of the WebView. UIWebView currently expects view coordinates, so we'll
+        // convert them here now.
+        IntRect viewRect = IntRect([documentView convertRect:rect toView:self]);
 
         // The event region wants this points in this order:
         //  p2------p3
         //  |       |
         //  p1------p4
         //
-        WebEventRegion *eventRegion = [[WebEventRegion alloc] initWithPoints:FloatPoint(rect.x(), rect.maxY())
-                                                                            :FloatPoint(rect.x(), rect.y())
-                                                                            :FloatPoint(rect.maxX(), rect.y())
-                                                                            :FloatPoint(rect.maxX(), rect.maxY())];
+        WebEventRegion *eventRegion = [[WebEventRegion alloc] initWithPoints:FloatPoint(viewRect.x(), viewRect.maxY())
+                                                                            :FloatPoint(viewRect.x(), viewRect.y())
+                                                                            :FloatPoint(viewRect.maxX(), viewRect.y())
+                                                                            :FloatPoint(viewRect.maxX(), viewRect.maxY())];
         if (eventRegion) {
             [eventRegionArray addObject:eventRegion];
             [eventRegion release];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to