diff options
author | John Reck <jreck@google.com> | 2012-02-16 09:20:29 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-02-21 13:30:30 -0800 |
commit | f404d29266675808fffe9d71b065bc03b555b58d (patch) | |
tree | 68c50db2bc977de17ba481bc4fd552f0df684905 /Source/WebCore | |
parent | a54eb7fa1e850d7096f97065f35ed00bcb5384d3 (diff) | |
download | external_webkit-f404d29266675808fffe9d71b065bc03b555b58d.zip external_webkit-f404d29266675808fffe9d71b065bc03b555b58d.tar.gz external_webkit-f404d29266675808fffe9d71b065bc03b555b58d.tar.bz2 |
Improve keyboard navigation cursor rings
Change-Id: I2b11c0b0011104c5a3515ed138a9077dfe8b4ce1
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/platform/android/RenderThemeAndroid.cpp | 24 | ||||
-rw-r--r-- | Source/WebCore/platform/android/RenderThemeAndroid.h | 2 |
2 files changed, 6 insertions, 20 deletions
diff --git a/Source/WebCore/platform/android/RenderThemeAndroid.cpp b/Source/WebCore/platform/android/RenderThemeAndroid.cpp index b570d0e..793fce7 100644 --- a/Source/WebCore/platform/android/RenderThemeAndroid.cpp +++ b/Source/WebCore/platform/android/RenderThemeAndroid.cpp @@ -623,30 +623,16 @@ bool RenderThemeAndroid::paintMenuListButton(RenderObject* obj, const PaintInfo& Color RenderThemeAndroid::platformFocusRingColor() const { - static Color focusRingColor(0x66, 0x33, 0xB5, 0xE5); + static Color focusRingColor(0x33, 0xB5, 0xE5, 0x66); return focusRingColor; } bool RenderThemeAndroid::supportsFocusRing(const RenderStyle* style) const { - // TODO: Draw this on the UI side - // For now, just return false to let WebKit draw the focus ring. We only - // draw this ring when navigating via the keyboard, this does not affect - // the touch ring - return false; - return style->opacity() > 0 - && style->hasAppearance() - && style->appearance() != TextFieldPart - && style->appearance() != SearchFieldPart - && style->appearance() != TextAreaPart - && style->appearance() != CheckboxPart - && style->appearance() != RadioPart - && style->appearance() != PushButtonPart - && style->appearance() != SquareButtonPart - && style->appearance() != ButtonPart - && style->appearance() != ButtonBevelPart - && style->appearance() != MenulistPart - && style->appearance() != MenulistButtonPart; + // Draw the focus ring ourselves unless it is a text area (webkit does borders better) + if (!style || !style->hasAppearance()) + return true; + return style->appearance() != TextFieldPart && style->appearance() != TextAreaPart; } } // namespace WebCore diff --git a/Source/WebCore/platform/android/RenderThemeAndroid.h b/Source/WebCore/platform/android/RenderThemeAndroid.h index 802d3c3..42818e3 100644 --- a/Source/WebCore/platform/android/RenderThemeAndroid.h +++ b/Source/WebCore/platform/android/RenderThemeAndroid.h @@ -48,7 +48,7 @@ public: ~RenderThemeAndroid(); virtual bool stateChanged(RenderObject*, ControlState) const; - + virtual bool supportsFocusRing(const RenderStyle*) const; // A method asking if the theme's controls actually care about redrawing when hovered. virtual bool supportsHover(const RenderStyle* style) const { return style->affectedByHoverRules(); } |