Fix build for clang-700.0.59.5 by replacing deprecated calls to convertScreenToBase...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Oct 2015 02:21:02 +0000 (02:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Oct 2015 02:21:02 +0000 (02:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150379

Patch by Gordon Sheridan <gordon_sheridan@apple.com> on 2015-10-20
Reviewed by Simon Fraser.

* WebView/WebHTMLView.mm:
(-[WebHTMLView characterIndexForPoint:]):
Convert point to rect, and call convertRectFromScreen:.

(-[WebHTMLView firstRectForCharacterRange:]):
Replace convertBaseToScreen: with convertRectToScreen:.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191370 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm

index 647a16e..b01bf97 100644 (file)
@@ -1,3 +1,17 @@
+2015-10-20  Gordon Sheridan  <gordon_sheridan@apple.com>
+
+        Fix build for clang-700.0.59.5 by replacing deprecated calls to convertScreenToBase: with convertRectFromScreen:.
+        https://bugs.webkit.org/show_bug.cgi?id=150379
+
+        Reviewed by Simon Fraser.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView characterIndexForPoint:]):
+        Convert point to rect, and call convertRectFromScreen:.
+
+        (-[WebHTMLView firstRectForCharacterRange:]):
+        Replace convertBaseToScreen: with convertRectToScreen:.
+
 2015-10-20  Tim Horton  <timothy_horton@apple.com>
 
         Try to fix the build by disabling MAC_GESTURE_EVENTS on 10.9 and 10.10
index 1f1c482..60e8723 100644 (file)
@@ -6108,8 +6108,10 @@ static BOOL writingDirectionKeyBindingsEnabled()
     NSWindow *window = [self window];
     WebFrame *frame = [self _frame];
 
-    if (window)
-        thePoint = [window convertScreenToBase:thePoint];
+    if (window) {
+        NSRect screenRect = { thePoint, NSZeroSize };
+        thePoint = [window convertRectFromScreen:screenRect].origin;
+    }     
     thePoint = [self convertPoint:thePoint fromView:nil];
 
     DOMRange *range = [frame _characterRangeAtPoint:thePoint];
@@ -6149,7 +6151,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
 
     NSWindow *window = [self window];
     if (window)
-        resultRect.origin = [window convertBaseToScreen:resultRect.origin];
+        resultRect = [window convertRectToScreen:resultRect];
     
     LOG(TextInput, "firstRectForCharacterRange:(%u, %u) -> (%f, %f, %f, %f)", theRange.location, theRange.length, resultRect.origin.x, resultRect.origin.y, resultRect.size.width, resultRect.size.height);
     return resultRect;