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 @@
#include "core/dom/ExecutionContextTask.h"
#include "core/dom/IdTargetObserver.h"
#include "core/dom/StyleChangeReason.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/InsertionPoint.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/FrameSelection.h"
......@@ -1263,7 +1264,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt) {
if (m_inputTypeView->shouldSubmitImplicitly(evt)) {
// FIXME: Remove type check.
if (type() == InputTypeNames::search)
document().postTask(BLINK_FROM_HERE,
document().postTask(TaskType::UserInteraction, BLINK_FROM_HERE,
createSameThreadTask(&HTMLInputElement::onSearch,
wrapPersistent(this)));
// Form submission finishes editing, just as loss of focus does.
......
......@@ -46,6 +46,7 @@
#include "core/dom/NodeComputedStyle.h"
#include "core/dom/NodeListsNodeData.h"
#include "core/dom/NodeTraversal.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/events/GestureEvent.h"
#include "core/events/KeyboardEvent.h"
#include "core/events/MouseEvent.h"
......@@ -897,7 +898,7 @@ void HTMLSelectElement::scrollToOption(HTMLOptionElement* option) {
m_optionToScrollTo = option;
if (!hasPendingTask)
document().postTask(
BLINK_FROM_HERE,
TaskType::UserInteraction, BLINK_FROM_HERE,
createSameThreadTask(&HTMLSelectElement::scrollToOptionTask,
wrapPersistent(this)));
}
......
......@@ -34,6 +34,7 @@
#include "core/HTMLNames.h"
#include "core/InputTypeNames.h"
#include "core/dom/ExecutionContextTask.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/KeyboardEvent.h"
#include "core/html/HTMLInputElement.h"
......@@ -104,8 +105,9 @@ void SearchInputType::startSearchEventTimer() {
if (!length) {
m_searchEventTimer.stop();
element().document().postTask(
BLINK_FROM_HERE, createSameThreadTask(&HTMLInputElement::onSearch,
wrapPersistent(&element())));
TaskType::UserInteraction, BLINK_FROM_HERE,
createSameThreadTask(&HTMLInputElement::onSearch,
wrapPersistent(&element())));
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