| Index: Source/core/html/HTMLInputElement.cpp
|
| diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
|
| index 7952c58f83be743b8803e9610ed433ab59f45558..57ace97980b52e2793d98996333dfad5d796c927 100644
|
| --- a/Source/core/html/HTMLInputElement.cpp
|
| +++ b/Source/core/html/HTMLInputElement.cpp
|
| @@ -68,6 +68,7 @@
|
| #include "core/html/shadow/ShadowElementNames.h"
|
| #include "core/page/Chrome.h"
|
| #include "core/page/ChromeClient.h"
|
| +#include "core/page/Page.h"
|
| #include "core/rendering/RenderTextControlSingleLine.h"
|
| #include "core/rendering/RenderTheme.h"
|
| #include "platform/DateTimeChooser.h"
|
| @@ -918,6 +919,12 @@ void HTMLInputElement::copyNonAttributePropertiesFromElement(const Element& sour
|
|
|
| String HTMLInputElement::value() const
|
| {
|
| + if (m_inputType->canSetValueAfterUserGesture() && !m_valueGatedOnUserGesture.isEmpty()) {
|
| + if (document().page()->userGestureSeenSinceLastNavigation())
|
| + return m_valueGatedOnUserGesture;
|
| + return String();
|
| + }
|
| +
|
| String value;
|
| if (m_inputType->getTypeSpecificValue(value))
|
| return value;
|
| @@ -949,6 +956,14 @@ void HTMLInputElement::setValueForUser(const String& value)
|
| setValue(value, DispatchChangeEvent);
|
| }
|
|
|
| +void HTMLInputElement::setValueAfterUserGesture(const String& value)
|
| +{
|
| + if (m_inputType->canSetValueAfterUserGesture())
|
| + m_valueGatedOnUserGesture = value;
|
| + else
|
| + setValueForUser(value);
|
| +}
|
| +
|
| const String& HTMLInputElement::suggestedValue() const
|
| {
|
| return m_suggestedValue;
|
| @@ -1022,6 +1037,7 @@ void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even
|
|
|
| void HTMLInputElement::setValueInternal(const String& sanitizedValue, TextFieldEventBehavior eventBehavior)
|
| {
|
| + m_valueGatedOnUserGesture = String();
|
| m_valueIfDirty = sanitizedValue;
|
| setNeedsValidityCheck();
|
| if (document().focusedElement() == this)
|
|
|