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. |