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

Unified Diff: Source/core/html/shadow/DateTimeFieldElement.cpp

Issue 191293011: Value set in onblur should not keep element in focus (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: SetFocus handler implementation for DateTimeFieldElement Created 6 years, 9 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/shadow/DateTimeFieldElement.cpp
diff --git a/Source/core/html/shadow/DateTimeFieldElement.cpp b/Source/core/html/shadow/DateTimeFieldElement.cpp
index 1746b0178c46ea0eb7668894af429ca64fa550d3..32354d7b8e1e5dd59429ff40d8b4c8a92a12d253 100644
--- a/Source/core/html/shadow/DateTimeFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeFieldElement.cpp
@@ -54,12 +54,6 @@ DateTimeFieldElement::DateTimeFieldElement(Document& document, FieldOwner& field
void DateTimeFieldElement::defaultEventHandler(Event* event)
{
- if (event->type() == EventTypeNames::blur)
- didBlur();
-
- if (event->type() == EventTypeNames::focus)
- didFocus();
-
if (event->isKeyboardEvent()) {
KeyboardEvent* keyboardEvent = toKeyboardEvent(event);
if (!isDisabled() && !isFieldOwnerDisabled() && !isFieldOwnerReadOnly()) {
@@ -129,16 +123,11 @@ void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv
}
}
-void DateTimeFieldElement::didBlur()
-{
- if (m_fieldOwner)
- m_fieldOwner->didBlurFromField();
-}
-
-void DateTimeFieldElement::didFocus()
+void DateTimeFieldElement::setFocus(bool value)
{
if (m_fieldOwner)
- m_fieldOwner->didFocusOnField();
+ value ? m_fieldOwner->didFocusOnField():m_fieldOwner->didBlurFromField();
tkent 2014/03/31 04:17:08 nit: Needs spaces around ':'.
Habib Virji 2014/03/31 09:05:51 Done.
+ ContainerNode::setFocus(value);
}
void DateTimeFieldElement::focusOnNextField()

Powered by Google App Engine
This is Rietveld 408576698