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

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: rebase Created 7 years, 6 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 | « Source/core/rendering/RenderTheme.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTheme.cpp
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
index 143cf041f7173774b08cb0a37eecfdfd02f33503..a8999b918dcbdda23f16d36ce0915d6be6daca5e 100644
--- a/Source/core/rendering/RenderTheme.cpp
+++ b/Source/core/rendering/RenderTheme.cpp
@@ -700,6 +700,22 @@ void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)
#endif
}
+bool RenderTheme::shouldDrawDefaultFocusRing(RenderObject* renderer) const
+{
+ 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);
@@ -796,7 +812,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
« no previous file with comments | « Source/core/rendering/RenderTheme.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698