Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm

Issue 1829513003: OSX: Media appearance values don't support native focus ring. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/mac/media/controls-focus-ring-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
index ce4beb4570e30cfd780dd71dcb5a90f4c72ea143..e822d1ac5d546ae6a329881144dc3bcf41f9fe01 100644
--- a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
+++ b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
@@ -1077,7 +1077,30 @@ String LayoutThemeMac::extraDefaultStyleSheet()
bool LayoutThemeMac::themeDrawsFocusRing(const ComputedStyle& style) const
{
- return (style.hasAppearance() && style.appearance() != TextFieldPart && style.appearance() != SearchFieldPart && style.appearance() != TextAreaPart && style.appearance() != MenulistButtonPart && style.appearance() != ListboxPart && !shouldUseFallbackTheme(style));
+ if (shouldUseFallbackTheme(style))
+ return false;
+ switch (style.appearance()) {
+ case CheckboxPart:
+ case RadioPart:
+ case PushButtonPart:
+ case SquareButtonPart:
+ case ButtonPart:
+ case MenulistPart:
+ case SliderThumbHorizontalPart:
+ case SliderThumbVerticalPart:
+ return true;
+
+ // Actually, they don't support native focus rings, but this function
+ // returns true for them in order to prevent Blink from drawing focus rings.
+ // SliderThumb*Part have focus rings, and we don't need to draw two focus
+ // rings for single slider.
+ case SliderHorizontalPart:
+ case SliderVerticalPart:
+ return true;
+
+ default:
+ return false;
+ }
}
bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/mac/media/controls-focus-ring-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698