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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 1070
1071 String LayoutThemeMac::extraDefaultStyleSheet() 1071 String LayoutThemeMac::extraDefaultStyleSheet()
1072 { 1072 {
1073 return LayoutTheme::extraDefaultStyleSheet() + 1073 return LayoutTheme::extraDefaultStyleSheet() +
1074 loadResourceAsASCIIString("themeInputMultipleFields.css") + 1074 loadResourceAsASCIIString("themeInputMultipleFields.css") +
1075 loadResourceAsASCIIString("themeMac.css"); 1075 loadResourceAsASCIIString("themeMac.css");
1076 } 1076 }
1077 1077
1078 bool LayoutThemeMac::themeDrawsFocusRing(const ComputedStyle& style) const 1078 bool LayoutThemeMac::themeDrawsFocusRing(const ComputedStyle& style) const
1079 { 1079 {
1080 return (style.hasAppearance() && style.appearance() != TextFieldPart && styl e.appearance() != SearchFieldPart && style.appearance() != TextAreaPart && style .appearance() != MenulistButtonPart && style.appearance() != ListboxPart && !sho uldUseFallbackTheme(style)); 1080 if (shouldUseFallbackTheme(style))
1081 return false;
1082 switch (style.appearance()) {
1083 case CheckboxPart:
1084 case RadioPart:
1085 case PushButtonPart:
1086 case SquareButtonPart:
1087 case ButtonPart:
1088 case MenulistPart:
1089 case SliderThumbHorizontalPart:
1090 case SliderThumbVerticalPart:
1091 return true;
1092
1093 // Actually, they don't support native focus rings, but this function
1094 // returns true for them in order to prevent Blink from drawing focus rings.
1095 // SliderThumb*Part have focus rings, and we don't need to draw two focus
1096 // rings for single slider.
1097 case SliderHorizontalPart:
1098 case SliderVerticalPart:
1099 return true;
1100
1101 default:
1102 return false;
1103 }
1081 } 1104 }
1082 1105
1083 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const 1106 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const
1084 { 1107 {
1085 ControlPart part = style.appearance(); 1108 ControlPart part = style.appearance();
1086 if (part == CheckboxPart || part == RadioPart) 1109 if (part == CheckboxPart || part == RadioPart)
1087 return style.effectiveZoom() != 1; 1110 return style.effectiveZoom() != 1;
1088 return false; 1111 return false;
1089 } 1112 }
1090 1113
1091 } // namespace blink 1114 } // namespace blink
OLDNEW
« 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