Title: [241828] trunk/Source/WebCore
Revision
241828
Author
dba...@webkit.org
Date
2019-02-20 12:25:28 -0800 (Wed, 20 Feb 2019)

Log Message

[iOS] Tweak UI for focus rings
https://bugs.webkit.org/show_bug.cgi?id=194864
<rdar://problem/47831886>

Reviewed by Brent Fulgham.

Source/WebCore:

Make use of UIKit constants to make focus rings pretty.

* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):

Source/WebCore/PAL:

Expose more SPI.

* pal/ios/UIKitSoftLink.h:
* pal/ios/UIKitSoftLink.mm:
* pal/spi/ios/UIKitSPI.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (241827 => 241828)


--- trunk/Source/WebCore/ChangeLog	2019-02-20 19:56:14 UTC (rev 241827)
+++ trunk/Source/WebCore/ChangeLog	2019-02-20 20:25:28 UTC (rev 241828)
@@ -1,3 +1,16 @@
+2019-02-20  Daniel Bates  <daba...@apple.com>
+
+        [iOS] Tweak UI for focus rings
+        https://bugs.webkit.org/show_bug.cgi?id=194864
+        <rdar://problem/47831886>
+
+        Reviewed by Brent Fulgham.
+
+        Make use of UIKit constants to make focus rings pretty.
+
+        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
+        (WebCore::drawFocusRingAtTime):
+
 2019-02-20  Timothy Hatcher  <timo...@apple.com>
 
         RenderThemeIOS should use RenderTheme's color cache instead of its own.

Modified: trunk/Source/WebCore/PAL/ChangeLog (241827 => 241828)


--- trunk/Source/WebCore/PAL/ChangeLog	2019-02-20 19:56:14 UTC (rev 241827)
+++ trunk/Source/WebCore/PAL/ChangeLog	2019-02-20 20:25:28 UTC (rev 241828)
@@ -1,3 +1,17 @@
+2019-02-20  Daniel Bates  <daba...@apple.com>
+
+        [iOS] Tweak UI for focus rings
+        https://bugs.webkit.org/show_bug.cgi?id=194864
+        <rdar://problem/47831886>
+
+        Reviewed by Brent Fulgham.
+
+        Expose more SPI.
+
+        * pal/ios/UIKitSoftLink.h:
+        * pal/ios/UIKitSoftLink.mm:
+        * pal/spi/ios/UIKitSPI.h:
+
 2019-02-20  Timothy Hatcher  <timo...@apple.com>
 
         RenderThemeIOS should use RenderTheme's color cache instead of its own.

Modified: trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h (241827 => 241828)


--- trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h	2019-02-20 19:56:14 UTC (rev 241827)
+++ trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h	2019-02-20 20:25:28 UTC (rev 241828)
@@ -49,6 +49,7 @@
 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIColor)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIDevice)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIDocumentInteractionController)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, UIFocusRingStyle)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIFont)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIGraphicsImageRenderer)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, UIImage)

Modified: trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm (241827 => 241828)


--- trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm	2019-02-20 19:56:14 UTC (rev 241827)
+++ trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm	2019-02-20 20:25:28 UTC (rev 241828)
@@ -52,6 +52,7 @@
 SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIFont)
 SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIGraphicsImageRenderer)
 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, UIKit, UIImage, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIFocusRingStyle)
 SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UILabel)
 SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIPasteboard)
 SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIScreen)

Modified: trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h (241827 => 241828)


--- trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h	2019-02-20 19:56:14 UTC (rev 241827)
+++ trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h	2019-02-20 20:25:28 UTC (rev 241828)
@@ -37,6 +37,7 @@
 #import <UIKit/UIApplicationSceneConstants.h>
 #import <UIKit/UIApplication_Private.h>
 #import <UIKit/UIColor_Private.h>
+#import <UIKit/UIFocusRingStyle.h>
 #import <UIKit/UIFont_Private.h>
 #import <UIKit/UIInterface_Private.h>
 #import <UIKit/UIScreen_Private.h>
@@ -149,6 +150,12 @@
 @interface UIColor (IPI)
 + (UIColor *)keyboardFocusIndicatorColor;
 @end
+
+@interface UIFocusRingStyle (Staging_47831886)
++ (CGFloat)cornerRadius;
++ (CGFloat)maxAlpha;
++ (CGFloat)alphaThreshold;
+@end
 #endif
 
 #endif // PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm (241827 => 241828)


--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm	2019-02-20 19:56:14 UTC (rev 241827)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm	2019-02-20 20:25:28 UTC (rev 241828)
@@ -42,6 +42,7 @@
 #if PLATFORM(IOS_FAMILY)
 #import "Color.h"
 #import "WKGraphics.h"
+#import <pal/ios/UIKitSoftLink.h>
 #import <pal/spi/ios/UIKitSPI.h>
 #endif
 
@@ -74,9 +75,9 @@
     focusRingStyle.version = 0;
     focusRingStyle.tint = kCGFocusRingTintBlue;
     focusRingStyle.ordering = kCGFocusRingOrderingNone;
-    focusRingStyle.alpha = kCGFocusRingAlphaDefault;
-    focusRingStyle.radius = kCGFocusRingRadiusDefault;
-    focusRingStyle.threshold = kCGFocusRingThresholdDefault;
+    focusRingStyle.alpha = [PAL::getUIFocusRingStyleClass() maxAlpha];
+    focusRingStyle.radius = [PAL::getUIFocusRingStyleClass() cornerRadius];
+    focusRingStyle.threshold = [PAL::getUIFocusRingStyleClass() alphaThreshold];
     focusRingStyle.bounds = CGRectZero;
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to