Bug 1739541 - Set TriggerByScript::Yes for Element.scrollIntoView. r=botond

We'd want to differentiate Element.scrollIntoView call as `triggeredByScript`.

Differential Revision: https://phabricator.services.mozilla.com/D130419
This commit is contained in:
Hiroyuki Ikezoe
2021-11-09 09:19:25 +00:00
parent a2c0776657
commit c0c25373b6
6 changed files with 23 additions and 8 deletions

View File

@@ -3485,7 +3485,10 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable,
aFrameAsScrollable->ScrollTo(scrollPt, scrollMode, &allowedRange,
aScrollFlags & ScrollFlags::ScrollSnap
? nsIScrollbarMediator::ENABLE_SNAP
: nsIScrollbarMediator::DISABLE_SNAP);
: nsIScrollbarMediator::DISABLE_SNAP,
aScrollFlags & ScrollFlags::TriggeredByScript
? ScrollTriggeredByScript::Yes
: ScrollTriggeredByScript::No);
if (!weakFrame.IsAlive()) {
return;
}