Commit 85abeb6d authored by Stephane Zermatten's avatar Stephane Zermatten Committed by Commit Bot

[Autofill Assistant] ScrollIntoViewIfNeeded before click.

Before this change, WebController would attempt to scroll an element to
be clicked using the same logic as used to focus on an element. This
produced strange behavior on some websites, when zoomed, with the
element to click appearing and disappearing from the viewport.

This is a likely cause of reported issues with clicking when zoomed in.

With this change, WebController calls ScrollIntoViewIfNeeded instead of
trying to scroll nicely. It results in stabler behavior when zoomed: It
removes the flickering of element to click that was observed.

Bug: b/123958732
Change-Id: Id890737ffe48ee6ed21061222a65c2488041b73c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1587027Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654847}
parent 4538080a
......@@ -971,7 +971,7 @@ void WebController::ClickOrTapElement(
runtime::CallFunctionOnParams::Builder()
.SetObjectId(element_object_id)
.SetArguments(std::move(argument))
.SetFunctionDeclaration(std::string(kScrollIntoViewScript))
.SetFunctionDeclaration(std::string(kScrollIntoViewIfNeededScript))
.SetReturnByValue(true)
.Build(),
base::BindOnce(&WebController::OnScrollIntoView,
......
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