CSS auto focus-ring outlines don't render on iOS
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 22:26:37 +0000 (22:26 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 22:26:37 +0000 (22:26 +0000)
commitfe7ba5f97fd9f88335e1758e717f561b6ded2016
treebcc3e92b29bedd81473bd587fb480c14467eb3eb
parent05b71b7fbdf0ed34568614df5cfe2bf3e1335861
CSS auto focus-ring outlines don't render on iOS
https://bugs.webkit.org/show_bug.cgi?id=193583
<rdar://problem/6508697>

Reviewed by Simon Fraser.

Source/WebCore:

Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
enabled.

For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.

* SourcesCocoa.txt: Add file ColorIOS.mm.
* WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):
(WebCore::GraphicsContext::drawFocusRing):
Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
This is always enabled on Mac.

* platform/ios/ColorIOS.h: Added.
* platform/ios/ColorIOS.mm: Added.
(WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
This is always enabled on Mac.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
(WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
return false - the iOS theme code does not support painting focus rings. By returning false we
will use the platform-independent, non-theme code path to draw focus rings.

Source/WebCore/PAL:

Forward declare some IPI.

* pal/spi/ios/UIKitSPI.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm
Source/WebCore/platform/ios/ColorIOS.h [new file with mode: 0644]
Source/WebCore/platform/ios/ColorIOS.mm [new file with mode: 0644]
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderThemeIOS.h
Source/WebCore/rendering/RenderThemeIOS.mm