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

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: De-duplicate using FocusController; update TestExpectations 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
Index: Source/core/html/HTMLFormControlElement.cpp
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index a4e37a36cc362f9912230017706c1f74ee3793f4..6e01ff07ddb1831c499c1ee56e74a867f00f5d13 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -33,6 +33,7 @@
#include "core/html/HTMLLegendElement.h"
#include "core/html/ValidityState.h"
#include "core/frame/UseCounter.h"
+#include "core/page/FocusController.h"
#include "core/page/Page.h"
#include "core/page/ValidationMessageClient.h"
#include "core/rendering/RenderBox.h"
@@ -56,7 +57,6 @@ HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Doc
, m_willValidate(true)
, m_isValid(true)
, m_wasChangedSinceLastFormControlChangeEvent(false)
- , m_wasFocusedByMouse(false)
{
setHasCustomStyleCallbacks();
associateByParser(form);
@@ -331,31 +331,12 @@ bool HTMLFormControlElement::shouldShowFocusRingOnMouseFocus() const
return false;
}
-void HTMLFormControlElement::dispatchFocusEvent(Element* oldFocusedElement, FocusType type)
-{
- if (type != FocusTypePage)
- m_wasFocusedByMouse = type == FocusTypeMouse;
- HTMLElement::dispatchFocusEvent(oldFocusedElement, type);
-}
-
bool HTMLFormControlElement::shouldHaveFocusAppearance() const
{
ASSERT(focused());
- return shouldShowFocusRingOnMouseFocus() || !m_wasFocusedByMouse;
+ return shouldShowFocusRingOnMouseFocus() || !document().page()->focusController().wasFocusedByMouse();
}
-void HTMLFormControlElement::willCallDefaultEventHandler(const Event& event)
-{
- if (!event.isKeyboardEvent() || event.type() != EventTypeNames::keydown)
- return;
- if (!m_wasFocusedByMouse)
- return;
- m_wasFocusedByMouse = false;
- if (renderer())
- renderer()->paintInvalidationForWholeRenderer();
-}
-
-
short HTMLFormControlElement::tabIndex() const
{
// Skip the supportsFocus check in HTMLElement.

Powered by Google App Engine
This is Rietveld 408576698