Changeset 100083 in webkit


Ignore:
Timestamp:
Nov 12, 2011, 2:13:00 PM (14 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/10294191> REGRESSION (WebKit2): Lookup bubble sized and positioned incorrectly (vertically off)
https://bugs.webkit.org/show_bug.cgi?id=72217

Reviewed by Dave Hyatt.

  • UIProcess/API/mac/PageClientImpl.mm:

(WebKit::PageClientImpl::didPerformDictionaryLookup): Rather than adding the NSFont’s ascender
to the top of the text rect to establish the baseline here...

  • WebProcess/WebPage/mac/WebPageMac.mm:

(WebKit::WebPage::performDictionaryLookupForRange): ...do it here, using the WebCore::Font’s
ascender, which is what’s actually used when drawing the text.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r100056 r100083  
     12011-11-12  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10294191> REGRESSION (WebKit2): Lookup bubble sized and positioned incorrectly (vertically off)
     4        https://bugs.webkit.org/show_bug.cgi?id=72217
     5
     6        Reviewed by Dave Hyatt.
     7
     8        * UIProcess/API/mac/PageClientImpl.mm:
     9        (WebKit::PageClientImpl::didPerformDictionaryLookup): Rather than adding the NSFont’s ascender
     10        to the top of the text rect to establish the baseline here...
     11        * WebProcess/WebPage/mac/WebPageMac.mm:
     12        (WebKit::WebPage::performDictionaryLookupForRange): ...do it here, using the WebCore::Font’s
     13        ascender, which is what’s actually used when drawing the text.
     14
    1152011-11-11  Nayan Kumar K  <nayankk@motorola.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm

    r99911 r100083  
    407407
    408408    NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
    409     textBaselineOrigin.y += [font ascender];
    410    
     409
    411410#if !defined(BUILDING_ON_SNOW_LEOPARD)
    412411    // Convert to screen coordinates.
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r98187 r100083  
    540540    DictionaryPopupInfo dictionaryPopupInfo;
    541541    dictionaryPopupInfo.type = type;
    542     dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y());
     542    dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y() + style->fontMetrics().ascent());
    543543    dictionaryPopupInfo.fontInfo.fontAttributeDictionary = fontDescriptorAttributes;
    544544#if !defined(BUILDING_ON_SNOW_LEOPARD)
Note: See TracChangeset for help on using the changeset viewer.