Title: [164847] trunk/Source/WebKit2
- Revision
- 164847
- Author
- [email protected]
- Date
- 2014-02-27 18:05:28 -0800 (Thu, 27 Feb 2014)
Log Message
[Mac] Stop using some deprecated functions in WKView.mm
https://bugs.webkit.org/show_bug.cgi?id=129455
Reviewed by Anders Carlsson.
* UIProcess/API/mac/WKView.mm:
(-[WKView firstRectForCharacterRange:actualRange:]): Use convertRectToScreen,
which is a replacement for convertBaseToScreen. Don't check for window being null,
because isn't that crazy talk?
(-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]): Use event's location
in window instead of current mouse location. Using location that is not synced to
event stream rarely makes sense, and it doesn't look like this is one of those cases.
(-[WKView performDictionaryLookupAtCurrentMouseLocation]): Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (164846 => 164847)
--- trunk/Source/WebKit2/ChangeLog 2014-02-28 01:18:55 UTC (rev 164846)
+++ trunk/Source/WebKit2/ChangeLog 2014-02-28 02:05:28 UTC (rev 164847)
@@ -1,3 +1,19 @@
+2014-02-27 Alexey Proskuryakov <[email protected]>
+
+ [Mac] Stop using some deprecated functions in WKView.mm
+ https://bugs.webkit.org/show_bug.cgi?id=129455
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView firstRectForCharacterRange:actualRange:]): Use convertRectToScreen,
+ which is a replacement for convertBaseToScreen. Don't check for window being null,
+ because isn't that crazy talk?
+ (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]): Use event's location
+ in window instead of current mouse location. Using location that is not synced to
+ event stream rarely makes sense, and it doesn't look like this is one of those cases.
+ (-[WKView performDictionaryLookupAtCurrentMouseLocation]): Ditto.
+
2014-02-27 Jaehun Lim <[email protected]>
Unreviewed. Fix build after r164832
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (164846 => 164847)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-02-28 01:18:55 UTC (rev 164846)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-02-28 02:05:28 UTC (rev 164847)
@@ -1671,13 +1671,7 @@
NSRect resultRect = _data->_page->firstRectForCharacterRange(theRange.location, theRange.length);
resultRect = [self convertRect:resultRect toView:nil];
-
- NSWindow *window = [self window];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- if (window)
- resultRect.origin = [window convertBaseToScreen:resultRect.origin];
-#pragma clang diagnostic pop
+ resultRect = [self.window convertRectToScreen:resultRect];
if (actualRange) {
// FIXME: Update actualRange to match the range of first rect.
@@ -2151,12 +2145,9 @@
- (void)_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent
{
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[flagsChangedEvent window] convertScreenToBase:[NSEvent mouseLocation]]
+ NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:flagsChangedEvent.locationInWindow
modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber]
context:[flagsChangedEvent context] eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
NativeWebMouseEvent webEvent(fakeEvent, self);
_data->_page->handleMouseEvent(webEvent);
}
@@ -3093,14 +3084,7 @@
- (void)performDictionaryLookupAtCurrentMouseLocation
{
- NSPoint thePoint = [NSEvent mouseLocation];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- thePoint = [[self window] convertScreenToBase:thePoint];
-#pragma clang diagnostic pop
- thePoint = [self convertPoint:thePoint fromView:nil];
-
- _data->_page->performDictionaryLookupAtLocation(FloatPoint(thePoint.x, thePoint.y));
+ _data->_page->performDictionaryLookupAtLocation([self convertPoint:[[NSApp currentEvent] locationInWindow] fromView:nil]);
}
+ (void)hideWordDefinitionWindow
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes