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

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: Code review updates 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..a302c5d116879d95f5c1436828fcd72b5930fe20 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();
+ ContainerNode::setFocus(value);
}
void DateTimeFieldElement::focusOnNextField()
« no previous file with comments | « Source/core/html/shadow/DateTimeFieldElement.h ('k') | Source/core/html/shadow/DateTimeNumericFieldElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698