Changeset 164847 in webkit


Ignore:
Timestamp:
Feb 27, 2014 6:05:28 PM (10 years ago)
Author:
ap@apple.com
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.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r164844 r164847  
     12014-02-27  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] Stop using some deprecated functions in WKView.mm
     4        https://bugs.webkit.org/show_bug.cgi?id=129455
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/API/mac/WKView.mm:
     9        (-[WKView firstRectForCharacterRange:actualRange:]): Use convertRectToScreen,
     10        which is a replacement for convertBaseToScreen. Don't check for window being null,
     11        because isn't that crazy talk?
     12        (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]): Use event's location
     13        in window instead of current mouse location. Using location that is not synced to
     14        event stream rarely makes sense, and it doesn't look like this is one of those cases.
     15        (-[WKView performDictionaryLookupAtCurrentMouseLocation]): Ditto.
     16
    1172014-02-27  Jaehun Lim  <ljaehun.lim@samsung.com>
    218
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r164818 r164847  
    16721672    NSRect resultRect = _data->_page->firstRectForCharacterRange(theRange.location, theRange.length);
    16731673    resultRect = [self convertRect:resultRect toView:nil];
    1674    
    1675     NSWindow *window = [self window];
    1676 #pragma clang diagnostic push
    1677 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
    1678     if (window)
    1679         resultRect.origin = [window convertBaseToScreen:resultRect.origin];
    1680 #pragma clang diagnostic pop
     1674    resultRect = [self.window convertRectToScreen:resultRect];
    16811675
    16821676    if (actualRange) {
     
    21522146- (void)_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent
    21532147{
    2154 #pragma clang diagnostic push
    2155 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
    2156     NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[flagsChangedEvent window] convertScreenToBase:[NSEvent mouseLocation]]
     2148    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:flagsChangedEvent.locationInWindow
    21572149        modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber]
    21582150        context:[flagsChangedEvent context] eventNumber:0 clickCount:0 pressure:0];
    2159 #pragma clang diagnostic pop
    21602151    NativeWebMouseEvent webEvent(fakeEvent, self);
    21612152    _data->_page->handleMouseEvent(webEvent);
     
    30943085- (void)performDictionaryLookupAtCurrentMouseLocation
    30953086{
    3096     NSPoint thePoint = [NSEvent mouseLocation];
    3097 #pragma clang diagnostic push
    3098 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
    3099     thePoint = [[self window] convertScreenToBase:thePoint];
    3100 #pragma clang diagnostic pop
    3101     thePoint = [self convertPoint:thePoint fromView:nil];
    3102 
    3103     _data->_page->performDictionaryLookupAtLocation(FloatPoint(thePoint.x, thePoint.y));
     3087    _data->_page->performDictionaryLookupAtLocation([self convertPoint:[[NSApp currentEvent] locationInWindow] fromView:nil]);
    31043088}
    31053089
Note: See TracChangeset for help on using the changeset viewer.