Commit d7843414 authored by tzik's avatar tzik Committed by Commit bot

Specify TaskType of posted Task explicitly in forms

These tasks should be posted as TaskType::UserInteraction as specified
on the spec.
https://html.spec.whatwg.org/multipage/forms.html#common-input-element-events

BUG=624696

Review-Url: https://codereview.chromium.org/2580243002
Cr-Commit-Position: refs/heads/master@{#439386}
parent c7d47a47
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "core/dom/ExecutionContextTask.h" #include "core/dom/ExecutionContextTask.h"
#include "core/dom/IdTargetObserver.h" #include "core/dom/IdTargetObserver.h"
#include "core/dom/StyleChangeReason.h" #include "core/dom/StyleChangeReason.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/InsertionPoint.h" #include "core/dom/shadow/InsertionPoint.h"
#include "core/dom/shadow/ShadowRoot.h" #include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/FrameSelection.h" #include "core/editing/FrameSelection.h"
...@@ -1263,7 +1264,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt) { ...@@ -1263,7 +1264,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt) {
if (m_inputTypeView->shouldSubmitImplicitly(evt)) { if (m_inputTypeView->shouldSubmitImplicitly(evt)) {
// FIXME: Remove type check. // FIXME: Remove type check.
if (type() == InputTypeNames::search) if (type() == InputTypeNames::search)
document().postTask(BLINK_FROM_HERE, document().postTask(TaskType::UserInteraction, BLINK_FROM_HERE,
createSameThreadTask(&HTMLInputElement::onSearch, createSameThreadTask(&HTMLInputElement::onSearch,
wrapPersistent(this))); wrapPersistent(this)));
// Form submission finishes editing, just as loss of focus does. // Form submission finishes editing, just as loss of focus does.
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "core/dom/NodeComputedStyle.h" #include "core/dom/NodeComputedStyle.h"
#include "core/dom/NodeListsNodeData.h" #include "core/dom/NodeListsNodeData.h"
#include "core/dom/NodeTraversal.h" #include "core/dom/NodeTraversal.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/events/GestureEvent.h" #include "core/events/GestureEvent.h"
#include "core/events/KeyboardEvent.h" #include "core/events/KeyboardEvent.h"
#include "core/events/MouseEvent.h" #include "core/events/MouseEvent.h"
...@@ -897,7 +898,7 @@ void HTMLSelectElement::scrollToOption(HTMLOptionElement* option) { ...@@ -897,7 +898,7 @@ void HTMLSelectElement::scrollToOption(HTMLOptionElement* option) {
m_optionToScrollTo = option; m_optionToScrollTo = option;
if (!hasPendingTask) if (!hasPendingTask)
document().postTask( document().postTask(
BLINK_FROM_HERE, TaskType::UserInteraction, BLINK_FROM_HERE,
createSameThreadTask(&HTMLSelectElement::scrollToOptionTask, createSameThreadTask(&HTMLSelectElement::scrollToOptionTask,
wrapPersistent(this))); wrapPersistent(this)));
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "core/HTMLNames.h" #include "core/HTMLNames.h"
#include "core/InputTypeNames.h" #include "core/InputTypeNames.h"
#include "core/dom/ExecutionContextTask.h" #include "core/dom/ExecutionContextTask.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/ShadowRoot.h" #include "core/dom/shadow/ShadowRoot.h"
#include "core/events/KeyboardEvent.h" #include "core/events/KeyboardEvent.h"
#include "core/html/HTMLInputElement.h" #include "core/html/HTMLInputElement.h"
...@@ -104,8 +105,9 @@ void SearchInputType::startSearchEventTimer() { ...@@ -104,8 +105,9 @@ void SearchInputType::startSearchEventTimer() {
if (!length) { if (!length) {
m_searchEventTimer.stop(); m_searchEventTimer.stop();
element().document().postTask( element().document().postTask(
BLINK_FROM_HERE, createSameThreadTask(&HTMLInputElement::onSearch, TaskType::UserInteraction, BLINK_FROM_HERE,
wrapPersistent(&element()))); createSameThreadTask(&HTMLInputElement::onSearch,
wrapPersistent(&element())));
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment