WebKit Bugzilla
Attachment 359540 Details for
Bug 193591
: Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193591-20190118143001.patch (text/plain), 7.42 KB, created by
Daniel Bates
on 2019-01-18 14:30:01 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-01-18 14:30:01 PST
Size:
7.42 KB
patch
obsolete
>Subversion Revision: 240171 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d7f847638bfb767ae534378a0b1652f36ba6df6e..2e73170077b785953e3c53f54072f0cde3b5edf3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,37 @@ >+2019-01-18 Daniel Bates <dabates@apple.com> >+ >+ Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing >+ https://bugs.webkit.org/show_bug.cgi?id=193591 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using >+ the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when >+ outline-style: auto. >+ >+ No functionality changed. So, no new tests. >+ >+ * page/Settings.yaml: >+ * page/SettingsBase.cpp: >+ (WebCore::SettingsBase::defaultUsePlatformFocusRingColorForOutlineStyleAuto): Use the platform >+ focus ring color on Cocoa-based platforms. All other platforms will use the CSS outline-color. >+ (WebCore::SettingsBase::defaultUseShrinkWrappedFocusRingForOutlineStyleAuto): Enable the fancy >+ shrink wrapped focus ring appearance on Cocoa-based platforms. Disable it - use a plain rectangle - >+ on all other platforms. >+ * page/SettingsBase.h: >+ >+ * platform/graphics/GraphicsContext.h: >+ * platform/graphics/cocoa/GraphicsContextCocoa.mm: >+ (WebCore::drawFocusRing): >+ (WebCore::drawFocusRingToContextAtTime): >+ Change some macro guards. >+ >+ * rendering/RenderElement.cpp: >+ (WebCore::RenderElement::paintFocusRing): Query the settings to determine whether to perform >+ fancy shrink-wrapping and whether to use the platform focus ring color over the CSS outline-color. >+ Only compile calls to the animated drawFocusRing() variants when building on Mac as this is the >+ only platform that supports them at the time of writing. >+ > 2019-01-18 Daniel Bates <dabates@apple.com> > > CSS auto focus-ring outlines don't render on iOS >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index 9b9a6e87c6acdf5b188e9dbc3c1ff3967db02a60..831264e87689e46490611d9da2362fd4a0c57cbb 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -788,3 +788,9 @@ videoQualityIncludesDisplayCompositingEnabled: > > editableImagesEnabled: > initial: false >+ >+usePlatformFocusRingColorForOutlineStyleAuto: >+ initial: defaultUsePlatformFocusRingColorForOutlineStyleAuto() >+ >+useShrinkWrappedFocusRingForOutlineStyleAuto: >+ initial: defaultUseShrinkWrappedFocusRingForOutlineStyleAuto() >diff --git a/Source/WebCore/page/SettingsBase.cpp b/Source/WebCore/page/SettingsBase.cpp >index cd4c4e8118f151520a2c02b2b41343fcedd2e782..4efe246cadbef788850585a52887b7c800c41c70 100644 >--- a/Source/WebCore/page/SettingsBase.cpp >+++ b/Source/WebCore/page/SettingsBase.cpp >@@ -103,6 +103,24 @@ bool SettingsBase::defaultDownloadableBinaryFontsEnabled() > #endif > } > >+bool SettingsBase::defaultUsePlatformFocusRingColorForOutlineStyleAuto() >+{ >+#if PLATFORM(COCOA) >+ return true; >+#else >+ return false; >+#endif >+} >+ >+bool SettingsBase::defaultUseShrinkWrappedFocusRingForOutlineStyleAuto() >+{ >+#if PLATFORM(COCOA) >+ return true; >+#else >+ return false; >+#endif >+} >+ > #if !PLATFORM(COCOA) > const String& SettingsBase::defaultMediaContentTypesRequiringHardwareSupport() > { >diff --git a/Source/WebCore/page/SettingsBase.h b/Source/WebCore/page/SettingsBase.h >index d6471c24d9ebc70da937afab59bcbad01e119dfd..dbd69301c8afa830de99acb0152c7b6bf56d11e3 100644 >--- a/Source/WebCore/page/SettingsBase.h >+++ b/Source/WebCore/page/SettingsBase.h >@@ -116,6 +116,9 @@ public: > WEBCORE_EXPORT static float defaultMinimumZoomFontSize(); > WEBCORE_EXPORT static bool defaultDownloadableBinaryFontsEnabled(); > >+ WEBCORE_EXPORT static bool defaultUsePlatformFocusRingColorForOutlineStyleAuto(); >+ WEBCORE_EXPORT static bool defaultUseShrinkWrappedFocusRingForOutlineStyleAuto(); >+ > static const unsigned defaultMaximumHTMLParserDOMTreeDepth = 512; > static const unsigned defaultMaximumRenderTreeDepth = 512; > >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index 816caea7b1b007fb03296d3cecb5d76888de9df7..1c366d51cbd74d0bcedec5790df2ed71aacc7a96 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -446,9 +446,7 @@ public: > > void drawFocusRing(const Vector<FloatRect>&, float width, float offset, const Color&); > void drawFocusRing(const Path&, float width, float offset, const Color&); >- >- // FIXME: The following functions should only be compiled for Mac. See <https://bugs.webkit.org/show_bug.cgi?id=193591>. >-#if PLATFORM(COCOA) >+#if PLATFORM(MAC) > void drawFocusRing(const Path&, double timeOffset, bool& needsRedraw, const Color&); > void drawFocusRing(const Vector<FloatRect>&, double timeOffset, bool& needsRedraw, const Color&); > #endif >diff --git a/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm b/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm >index 702d6c53a4a8b382de5307be407d68fa57bbe845..eab564b0e24255a021c94120b861e7c691781507 100644 >--- a/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm >@@ -95,7 +95,7 @@ static bool drawFocusRingAtTime(CGContextRef context, NSTimeInterval timeOffset, > return needsRepaint; > } > >-static void drawFocusRing(CGContextRef context, const Color& color) >+inline static void drawFocusRing(CGContextRef context, const Color& color) > { > drawFocusRingAtTime(context, std::numeric_limits<double>::max(), color); > } >@@ -107,14 +107,6 @@ static void drawFocusRingToContext(CGContextRef context, CGPathRef focusRingPath > drawFocusRing(context, color); > } > >-static bool drawFocusRingToContextAtTime(CGContextRef context, CGPathRef focusRingPath, double timeOffset, const Color& color) >-{ >- UNUSED_PARAM(timeOffset); >- CGContextBeginPath(context); >- CGContextAddPath(context, focusRingPath); >- return drawFocusRingAtTime(context, std::numeric_limits<double>::max(), color); >-} >- > #endif // ENABLE(FULL_KEYBOARD_ACCESS) > > void GraphicsContext::drawFocusRing(const Path& path, float width, float offset, const Color& color) >@@ -137,8 +129,15 @@ void GraphicsContext::drawFocusRing(const Path& path, float width, float offset, > #endif > } > >-// FIXME: The following functions should only be compiled for Mac. See <https://bugs.webkit.org/show_bug.cgi?id=193591>. >-#if ENABLE(FULL_KEYBOARD_ACCESS) >+#if PLATFORM(MAC) >+ >+static bool drawFocusRingToContextAtTime(CGContextRef context, CGPathRef focusRingPath, double timeOffset, const Color& color) >+{ >+ UNUSED_PARAM(timeOffset); >+ CGContextBeginPath(context); >+ CGContextAddPath(context, focusRingPath); >+ return drawFocusRingAtTime(context, std::numeric_limits<double>::max(), color); >+} > > void GraphicsContext::drawFocusRing(const Path& path, double timeOffset, bool& needsRedraw, const Color& color) > { >@@ -166,7 +165,7 @@ void GraphicsContext::drawFocusRing(const Vector<FloatRect>& rects, double timeO > needsRedraw = drawFocusRingToContextAtTime(platformContext(), focusRingPath.get(), timeOffset, color); > } > >-#endif >+#endif // PLATFORM(MAC) > > void GraphicsContext::drawFocusRing(const Vector<FloatRect>& rects, float width, float offset, const Color& color) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193591
:
359536
|
359540
|
361633