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

Unified Diff: Source/core/rendering/RenderTheme.cpp

Issue 16194013: Mouse press should focus on any types of form controls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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
Index: Source/core/rendering/RenderTheme.cpp
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
index ea5d3389a21eb85b43fb581e9b02d9874ec34a74..5d47101b70d46e446872c539e2163f7e89d214c7 100644
--- a/Source/core/rendering/RenderTheme.cpp
+++ b/Source/core/rendering/RenderTheme.cpp
@@ -692,6 +692,22 @@ void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)
#endif
}
+bool RenderTheme::shouldDrawCommonFocusRing(RenderObject* renderer) const
ojan 2013/05/31 22:48:16 I'm not really sure what "Common" means here.
tkent 2013/06/02 23:52:14 We have three types of focus rings. - Dedicated t
+{
+ if (supportsFocusRing(renderer->style()))
+ return false;
+ if (!renderer->style()->hasAppearance())
+ return true;
+ Node* node = renderer->node();
+ if (!node)
+ return true;
+ // We can't use RenderTheme::isFocused because outline:auto might be
+ // specified to non-:focus rulesets.
+ if (node->focused() && !node->shouldHaveFocusAppearance())
+ return false;
+ return true;
+}
+
bool RenderTheme::supportsFocusRing(const RenderStyle* style) const
{
return (style->hasAppearance() && style->appearance() != TextFieldPart && style->appearance() != TextAreaPart && style->appearance() != MenulistButtonPart && style->appearance() != ListboxPart);
@@ -798,7 +814,7 @@ bool RenderTheme::isFocused(const RenderObject* o) const
node = node->focusDelegate();
Document* document = node->document();
Frame* frame = document->frame();
- return node == document->focusedNode() && frame && frame->selection()->isFocusedAndActive();
+ return node == document->focusedNode() && node->shouldHaveFocusAppearance() && frame && frame->selection()->isFocusedAndActive();
}
bool RenderTheme::isPressed(const RenderObject* o) const
« Source/core/html/HTMLFormControlElement.cpp ('K') | « Source/core/rendering/RenderTheme.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698