Closed Bug 1739541 Opened 3 years ago Closed 3 years ago

Differentiate scroll operations (which will be asynchronously running by APZ) triggered by script

Categories

(Core :: Panning and Zooming, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(8 files)

The changes for bug 1692708 have been bigger than I thought initially because I also have some minor cleanups, so I'd like to handle these changes in this individual bug. These change should not impact any user interactions.

The target scroll operations are;

Element.scroll()s, Element.scrollTo()s, Element.scrollBy()s, Element.scrollTop, Elemenet.scrollLeft and Element.scrollIntoView. Also Window.scroll()s, Window.scrollTo()s and Window.scrollBy()s.

Either Window.scrollByLines or Window.scrollByPages are not in the scope. They are moz extensions, just basically used in our xul tree implementation.

Summary: Differentiate scroll operations triggered by script → Differentiate scroll operations (which will be asynchronously running by APZ) triggered by script

All call sites of ScrollByCSSPixels specify ScrollOrigin::Relative.

There are 4 call sites of the function, Element::Scroll, Element::SetScrollTop,
Element::SetScrollLeft and nsGlobalWindowInner::ScrollTo. None of call sites
specifies ScrollOrigin.

Depends on D130415

Both ScrollToCSSPixels and ScrollByCSSPixels are called only from JS via
Element.scrollTo, Element.scrollTop, Element.scrollLeft, Window.scroll,
Window.scrollTo and Window.scrollBy.

Note that we don't target either Window.scrollByLines or Window.scrollByPages
(both end up calling ScrollFrameHelper::ScrollBy) because both are triggered by
user interactions for our XUL tree implementation, for example
Window.scrollByLines gets called in response to a DOMMouseScroll event in
tree.js [1].

[1] https://searchfox.org/mozilla-central/rev/a12c2c2e59c92d8f969d8f3f290ab16919449c9d/toolkit/content/widgets/tree.js#788

Depends on D130417

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

Depends on D130418

Pushed by hikezoe.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/21ff7d9ba6df
Drop ScrollOrigin argument from ScrollByCSSPixels. r=botond
https://hg.mozilla.org/integration/autoland/rev/5420b6c278b5
Drop ScrollOrigin argument from ScrollToCSSPixels. r=botond
https://hg.mozilla.org/integration/autoland/rev/19252a004ff3
Drop `e` prefix from ScrollMode comments. r=botond
https://hg.mozilla.org/integration/autoland/rev/dcfcbfd27ea5
Introduce TriggeredByScript in ScrollPositionUpdate and set `Yes` for ScrollToCSSPixels and ScrollByCSSPixels. r=botond
https://hg.mozilla.org/integration/autoland/rev/981eef98a585
Set `TriggerByScript::Yes` for Element.scrollIntoView. r=botond
https://hg.mozilla.org/integration/autoland/rev/4c0fdefcf0a0
Introduce WasTriggeedByScript() function in AsyncPanZoomAnimation class. r=botond
https://hg.mozilla.org/integration/autoland/rev/1288f0879002
Use `using` instead of `typedef` in nsGfxScrollFrame.h. r=botond
https://hg.mozilla.org/integration/autoland/rev/bfd44deda9c7
Introduce APZScrollAnimationType and use it in RepaintRequest and ScrollFrameHelopr instead of a boolean representing whether there's an animation or not. r=botond
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: