Changeset 150530 in webkit


Ignore:
Timestamp:
May 22, 2013, 12:06:13 PM (13 years ago)
Author:
Simon Fraser
Message:

Fix issues with focus rings on search fields
https://bugs.webkit.org/show_bug.cgi?id=116591

Source/WebCore:

Reviewed by Darin Adler.

On a future OS, the rect returned by _focusRingVisibleRect should
be in the coordinate system of the that NSView, not the base
coordinate system, so fix the code that sets and reads the global
focusRingClipRect variable accordingly.

  • platform/graphics/mac/WebLayer.mm:

(drawLayerContents):

  • platform/mac/ThemeMac.mm:

(-[WebCoreFlippedView _focusRingVisibleRect]):

Source/WebKit/mac:

Reviewed by Darin Adler.

In WebKit1, focus rings didn't render correctly on some OSes until
some other control drew a focus ring, which changes internal AppKit state
on the focused view. Fix by overriding an internal AppKit method to always
disable AppKit's "automatic" focus ring drawing.

  • WebView/WebHTMLView.mm:

(-[WebHTMLView _automaticFocusRingDisabled]):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150529 r150530  
     12013-05-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix issues with focus rings on search fields
     4        https://bugs.webkit.org/show_bug.cgi?id=116591
     5
     6        Reviewed by Darin Adler.
     7       
     8        On a future OS, the rect returned by _focusRingVisibleRect should
     9        be in the coordinate system of the that NSView, not the base
     10        coordinate system, so fix the code that sets and reads the global
     11        focusRingClipRect variable accordingly.
     12
     13        * platform/graphics/mac/WebLayer.mm:
     14        (drawLayerContents):
     15        * platform/mac/ThemeMac.mm:
     16        (-[WebCoreFlippedView _focusRingVisibleRect]):
     17
    1182013-05-22  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm

    r149980 r150530  
    8080    FloatRect clipBounds = CGContextGetClipBoundingBox(context);
    8181
     82    FloatRect focusRingClipRect = clipBounds;
     83#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1090
    8284    // Set the focus ring clip rect which needs to be in base coordinates.
    8385    AffineTransform transform = CGContextGetCTM(context);
    84     ThemeMac::setFocusRingClipRect(transform.mapRect(clipBounds));
     86    focusRingClipRect = transform.mapRect(clipBounds);
     87#endif
     88    ThemeMac::setFocusRingClipRect(focusRingClipRect);
    8589
    8690#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
  • trunk/Source/WebCore/platform/mac/ThemeMac.mm

    r147860 r150530  
    6767
    6868    NSRect rect = focusRingClipRect;
     69#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1090
    6970    rect.origin.y = [self bounds].size.height - NSMaxY(rect);
     71#endif
    7072
    7173    return rect;
  • trunk/Source/WebKit/mac/ChangeLog

    r150367 r150530  
     12013-05-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix issues with focus rings on search fields
     4        https://bugs.webkit.org/show_bug.cgi?id=116591
     5
     6        Reviewed by Darin Adler.
     7       
     8        In WebKit1, focus rings didn't render correctly on some OSes until
     9        some other control drew a focus ring, which changes internal AppKit state
     10        on the focused view. Fix by overriding an internal AppKit method to always
     11        disable AppKit's "automatic" focus ring drawing.
     12
     13        * WebView/WebHTMLView.mm:
     14        (-[WebHTMLView _automaticFocusRingDisabled]):
     15
    1162013-05-20  David Kilzer  <ddkilzer@apple.com>
    217
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r150214 r150530  
    49484948}
    49494949
     4950#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     4951- (BOOL)_automaticFocusRingDisabled
     4952{
     4953    // The default state for _automaticFocusRingDisabled is NO, which prevents focus rings
     4954    // from being painted for search fields. Calling NSSetFocusRingStyle has the side effect
     4955    // of changing this to YES, so just return YES all the time. <rdar://problem/13780122>,
     4956    return YES;
     4957}
     4958#endif
    49504959
    49514960- (void)_updateControlTints
Note: See TracChangeset for help on using the changeset viewer.