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

Unified Diff: Source/core/html/HTMLFormControlElement.cpp

Issue 455223002: Make anchors mouse-focusable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move m_wasFocusedByMouse into subclasses. Created 6 years, 4 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/html/HTMLFormControlElement.h ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormControlElement.cpp
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index 127ee3a02c2c9298244c170b632a23567f755e6e..55e29423cc13e899d936655c37fc4a8ed00ddb0d 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -333,31 +333,21 @@ bool HTMLFormControlElement::shouldShowFocusRingOnMouseFocus() const
return false;
}
-void HTMLFormControlElement::dispatchFocusEvent(Element* oldFocusedElement, FocusType type)
+bool HTMLFormControlElement::shouldHaveFocusAppearance() const
{
- if (type != FocusTypePage)
- m_wasFocusedByMouse = type == FocusTypeMouse;
- HTMLElement::dispatchFocusEvent(oldFocusedElement, type);
+ return !m_wasFocusedByMouse || shouldShowFocusRingOnMouseFocus();
}
-bool HTMLFormControlElement::shouldHaveFocusAppearance() const
+bool HTMLFormControlElement::wasFocusedByMouse() const
{
- ASSERT(focused());
- return shouldShowFocusRingOnMouseFocus() || !m_wasFocusedByMouse;
+ return m_wasFocusedByMouse;
}
-void HTMLFormControlElement::willCallDefaultEventHandler(const Event& event)
+void HTMLFormControlElement::setWasFocusedByMouse(bool wasFocusedByMouse)
{
- if (!event.isKeyboardEvent() || event.type() != EventTypeNames::keydown)
- return;
- if (!m_wasFocusedByMouse)
- return;
- m_wasFocusedByMouse = false;
- if (renderer())
- renderer()->setShouldDoFullPaintInvalidation(true);
+ m_wasFocusedByMouse = wasFocusedByMouse;
}
-
short HTMLFormControlElement::tabIndex() const
{
// Skip the supportsFocus check in HTMLElement.
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698