Backed out changeset 496886cb30a5 (bug 1867152) for bc failures on browser_user_input...
[gecko.git] / layout / generic / nsIScrollableFrame.h
blob19f00007dc3e60cda9530add6943b325558e359d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /*
8 * interface that provides scroll APIs implemented by scrollable frames
9 */
11 #ifndef nsIScrollFrame_h___
12 #define nsIScrollFrame_h___
14 #include "nsCoord.h"
15 #include "mozilla/dom/WindowBinding.h" // for mozilla::dom::ScrollBehavior
16 #include "mozilla/Maybe.h"
17 #include "mozilla/ScrollOrigin.h"
18 #include "mozilla/ScrollPositionUpdate.h"
19 #include "mozilla/ScrollStyles.h"
20 #include "mozilla/ScrollTypes.h"
21 #include "mozilla/gfx/Point.h"
22 #include "nsIScrollbarMediator.h"
23 #include "Units.h"
24 #include "FrameMetrics.h"
26 class gfxContext;
27 class nsIScrollPositionListener;
28 class nsIFrame;
29 class nsPresContext;
30 class nsIContent;
32 namespace mozilla {
33 class DisplayItemClip;
34 class nsDisplayListBuilder;
35 enum class StyleScrollSnapAlignKeyword : uint8_t;
37 namespace layers {
38 struct ScrollMetadata;
39 class Layer;
40 class WebRenderLayerManager;
41 } // namespace layers
42 namespace layout {
43 class ScrollAnchorContainer;
44 } // namespace layout
45 } // namespace mozilla
47 /**
48 * Interface for frames that are scrollable. This interface exposes
49 * APIs for examining scroll state, observing changes to scroll state,
50 * and triggering scrolling.
52 class nsIScrollableFrame : public nsIScrollbarMediator {
53 public:
54 using CSSIntPoint = mozilla::CSSIntPoint;
55 using ScrollSnapInfo = mozilla::ScrollSnapInfo;
56 using ScrollAnchorContainer = mozilla::layout::ScrollAnchorContainer;
57 using ScrollMode = mozilla::ScrollMode;
58 using ScrollOrigin = mozilla::ScrollOrigin;
59 using PhysicalScrollSnapAlign =
60 std::pair<mozilla::StyleScrollSnapAlignKeyword,
61 mozilla::StyleScrollSnapAlignKeyword>;
63 NS_DECL_QUERYFRAME_TARGET(nsIScrollableFrame)
65 /**
66 * Get the frame for the content that we are scrolling within
67 * this scrollable frame.
69 virtual nsIFrame* GetScrolledFrame() const = 0;
71 /**
72 * Get the overflow styles (StyleOverflow::Scroll, StyleOverflow::Hidden, or
73 * StyleOverflow::Auto) governing the horizontal and vertical scrollbars for
74 * this frame.
76 * This is special because they can be propagated from the <body> element,
77 * unlike other styles.
79 virtual mozilla::ScrollStyles GetScrollStyles() const = 0;
81 /**
82 * Returns whether this scroll frame is for a text control element with no
83 * scrollbars (for <input>, basically).
85 virtual bool IsForTextControlWithNoScrollbars() const = 0;
87 /**
88 * Returns whether we already have anonymous content nodes for all our needed
89 * scrollbar parts (or a superset thereof).
91 virtual bool HasAllNeededScrollbars() const = 0;
93 /**
94 * Get the overscroll-behavior styles.
96 virtual mozilla::layers::OverscrollBehaviorInfo GetOverscrollBehaviorInfo()
97 const = 0;
99 /**
100 * Return the scrollbars which are visible. It's OK to call this during reflow
101 * of the scrolled contents, in which case it will reflect the current
102 * assumptions about scrollbar visibility.
104 virtual mozilla::layers::ScrollDirections GetScrollbarVisibility() const = 0;
106 * Returns the directions in which scrolling is allowed (if the scroll range
107 * is at least one device pixel in that direction).
109 mozilla::layers::ScrollDirections GetAvailableScrollingDirections() const;
111 * Returns the directions in which scrolling is allowed when taking into
112 * account the visual viewport size and overflow hidden. (An (apz) zoomed in
113 * overflow hidden scrollframe is actually user scrollable.)
115 virtual mozilla::layers::ScrollDirections
116 GetAvailableScrollingDirectionsForUserInputEvents() const = 0;
118 * Return the actual sizes of all possible scrollbars. Returns 0 for scrollbar
119 * positions that don't have a scrollbar or where the scrollbar is not
120 * visible. Do not call this while this frame's descendants are being
121 * reflowed, it won't be accurate.
122 * INCLUDE_VISUAL_VIEWPORT_SCROLLBARS means we include the size of layout
123 * scrollbars that are only visible to scroll the visual viewport inside the
124 * layout viewport (ie the layout viewport cannot be scrolled) even though
125 * there is no layout space set aside for these scrollbars.
127 enum class ScrollbarSizesOptions { NONE, INCLUDE_VISUAL_VIEWPORT_SCROLLBARS };
128 virtual nsMargin GetActualScrollbarSizes(
129 ScrollbarSizesOptions aOptions = ScrollbarSizesOptions::NONE) const = 0;
131 * Return the sizes of all scrollbars assuming that any scrollbars that could
132 * be visible due to overflowing content, are. This can be called during
133 * reflow of the scrolled contents.
135 virtual nsMargin GetDesiredScrollbarSizes() const = 0;
137 * Get the layout size of this frame.
138 * Note that this is a value which is not expanded by the minimum scale size.
139 * For scroll frames other than the root content document's scroll frame, this
140 * value will be the same as GetScrollPortRect().Size().
142 * This value is used for Element.clientWidth and clientHeight.
144 virtual nsSize GetLayoutSize() const = 0;
146 * GetScrolledRect is designed to encapsulate deciding which
147 * directions of overflow should be reachable by scrolling and which
148 * should not. Callers should NOT depend on it having any particular
149 * behavior (although nsXULScrollFrame currently does).
151 * This should only be called when the scrolled frame has been
152 * reflowed with the scroll port size given in mScrollPort.
154 * Currently it allows scrolling down and to the right for
155 * nsHTMLScrollFrames with LTR directionality and for all
156 * nsXULScrollFrames, and allows scrolling down and to the left for
157 * nsHTMLScrollFrames with RTL directionality.
159 virtual nsRect GetScrolledRect() const = 0;
161 * Get the area of the scrollport relative to the origin of this frame's
162 * border-box.
163 * This is the area of this frame minus border and scrollbars.
165 virtual nsRect GetScrollPortRect() const = 0;
167 * Get the offset of the scrollport origin relative to the scrolled
168 * frame origin. Typically the position will be non-negative.
169 * This will always be a multiple of device pixels.
171 virtual nsPoint GetScrollPosition() const = 0;
173 * As GetScrollPosition(), but uses the top-right as origin for RTL frames.
175 virtual nsPoint GetLogicalScrollPosition() const = 0;
178 * Get the area that must contain the scroll position. Typically
179 * (but not always, e.g. for RTL content) x and y will be 0, and
180 * width or height will be nonzero if the content can be scrolled in
181 * that direction. Since scroll positions must be a multiple of
182 * device pixels, the range extrema will also be a multiple of
183 * device pixels.
185 virtual nsRect GetScrollRange() const = 0;
187 * Get the size of the view port to use when clamping the scroll
188 * position.
190 virtual nsSize GetVisualViewportSize() const = 0;
192 * Returns the offset of the visual viewport relative to
193 * the origin of the scrolled content. Note that only the RCD-RSF
194 * has a distinct visual viewport; for other scroll frames, the
195 * visual viewport always coincides with the layout viewport, and
196 * consequently the offset this function returns is equal to
197 * GetScrollPosition().
199 virtual nsPoint GetVisualViewportOffset() const = 0;
201 * Set the visual viewport offset associated with a root scroll frame. This is
202 * only valid when called on a root scroll frame and will assert otherwise.
203 * aRepaint indicates if we need to ask for a main thread paint if this
204 * changes scrollbar positions or not. For example, if the compositor has
205 * already put the scrollbars at this position then they don't need to move so
206 * we can skip the repaint. Returns true if the offset changed and the scroll
207 * frame is still alive after this call.
209 virtual bool SetVisualViewportOffset(const nsPoint& aOffset,
210 bool aRepaint) = 0;
212 * Get the area that must contain the visual viewport offset.
214 virtual nsRect GetVisualScrollRange() const = 0;
216 * Like GetVisualScrollRange but also takes into account overflow: hidden.
218 virtual nsRect GetScrollRangeForUserInputEvents() const = 0;
220 * Return how much we would try to scroll by in each direction if
221 * asked to scroll by one "line" vertically and horizontally.
223 virtual nsSize GetLineScrollAmount() const = 0;
225 * Return how much we would try to scroll by in each direction if
226 * asked to scroll by one "page" vertically and horizontally.
228 virtual nsSize GetPageScrollAmount() const = 0;
231 * Return scroll-padding value of this frame.
233 virtual nsMargin GetScrollPadding() const = 0;
235 * Some platforms (OSX) may generate additional scrolling events even
236 * after the user has stopped scrolling, simulating a momentum scrolling
237 * effect resulting from fling gestures.
238 * SYNTHESIZED_MOMENTUM_EVENT indicates that the scrolling is being requested
239 * by such a synthesized event and may be ignored if another scroll has
240 * been started since the last actual user input.
242 enum ScrollMomentum { NOT_MOMENTUM, SYNTHESIZED_MOMENTUM_EVENT };
244 * @note This method might destroy the frame, pres shell and other objects.
245 * Clamps aScrollPosition to GetScrollRange and sets the scroll position
246 * to that value.
247 * @param aRange If non-null, specifies area which contains aScrollPosition
248 * and can be used for choosing a performance-optimized scroll position.
249 * Any point within this area can be chosen.
250 * The choosen point will be as close as possible to aScrollPosition.
252 virtual void ScrollTo(
253 nsPoint aScrollPosition, ScrollMode aMode, const nsRect* aRange = nullptr,
254 mozilla::ScrollSnapFlags aSnapFlags = mozilla::ScrollSnapFlags::Disabled,
255 mozilla::ScrollTriggeredByScript aTriggeredByScript =
256 mozilla::ScrollTriggeredByScript::No) = 0;
258 * @note This method might destroy the frame, pres shell and other objects.
259 * Scrolls to a particular position in integer CSS pixels.
260 * Keeps the exact current horizontal or vertical position if the current
261 * position, rounded to CSS pixels, matches aScrollPosition. If
262 * aScrollPosition.x/y is different from the current CSS pixel position,
263 * makes sure we only move in the direction given by the difference.
265 * When aMode is SMOOTH, INSTANT, or NORMAL, GetScrollPositionCSSPixels (the
266 * scroll position after rounding to CSS pixels) will be exactly
267 * aScrollPosition at the end of the scroll animation.
269 * When aMode is SMOOTH_MSD, intermediate animation frames may be outside the
270 * range and / or moving in any direction; GetScrollPositionCSSPixels will be
271 * exactly aScrollPosition at the end of the scroll animation unless the
272 * SMOOTH_MSD animation is interrupted.
274 virtual void ScrollToCSSPixels(const CSSIntPoint& aScrollPosition,
275 ScrollMode aMode = ScrollMode::Instant) = 0;
277 * @note This method might destroy the frame, pres shell and other objects.
278 * Scrolls to a particular position in float CSS pixels.
279 * This does not guarantee that GetScrollPositionCSSPixels equals
280 * aScrollPosition afterward. It tries to scroll as close to
281 * aScrollPosition as possible while scrolling by an integer
282 * number of layer pixels (so the operation is fast and looks clean).
284 virtual void ScrollToCSSPixelsForApz(
285 const mozilla::CSSPoint& aScrollPosition,
286 mozilla::ScrollSnapTargetIds&& aLastSnapTargetIds) = 0;
289 * Returns the scroll position in integer CSS pixels, rounded to the nearest
290 * pixel.
292 virtual CSSIntPoint GetScrollPositionCSSPixels() = 0;
294 * @note This method might destroy the frame, pres shell and other objects.
295 * Modifies the current scroll position by aDelta units given by aUnit,
296 * clamping it to GetScrollRange. If WHOLE is specified as the unit,
297 * content is scrolled all the way in the direction(s) given by aDelta.
298 * @param aOverflow if non-null, returns the amount that scrolling
299 * was clamped by in each direction (how far we moved the scroll position
300 * to bring it back into the legal range). This is never negative. The
301 * values are in device pixels.
303 virtual void ScrollBy(nsIntPoint aDelta, mozilla::ScrollUnit aUnit,
304 ScrollMode aMode, nsIntPoint* aOverflow = nullptr,
305 ScrollOrigin aOrigin = ScrollOrigin::NotSpecified,
306 ScrollMomentum aMomentum = NOT_MOMENTUM,
307 mozilla::ScrollSnapFlags aSnapFlags =
308 mozilla::ScrollSnapFlags::Disabled) = 0;
310 virtual void ScrollByCSSPixels(const CSSIntPoint& aDelta,
311 ScrollMode aMode = ScrollMode::Instant) = 0;
314 * Perform scroll snapping, possibly resulting in a smooth scroll to
315 * maintain the scroll snap position constraints. Velocity sampled from
316 * main thread scrolling is used to determine best matching snap point
317 * when called after a fling gesture on a trackpad or mouse wheel.
319 virtual void ScrollSnap() = 0;
322 * @note This method might destroy the frame, pres shell and other objects.
323 * This tells the scroll frame to try scrolling to the scroll
324 * position that was restored from the history. This must be called
325 * at least once after state has been restored. It is called by the
326 * scrolled frame itself during reflow, but sometimes state can be
327 * restored after reflows are done...
328 * XXX should we take an aMode parameter here? Currently it's instant.
330 virtual void ScrollToRestoredPosition() = 0;
333 * Add a scroll position listener. This listener must be removed
334 * before it is destroyed.
336 virtual void AddScrollPositionListener(
337 nsIScrollPositionListener* aListener) = 0;
339 * Remove a scroll position listener.
341 virtual void RemoveScrollPositionListener(
342 nsIScrollPositionListener* aListener) = 0;
345 * Internal method used by scrollbars to notify their scrolling
346 * container of changes.
348 virtual void CurPosAttributeChanged(nsIContent* aChild) = 0;
351 * Allows the docshell to request that the scroll frame post an event
352 * after being restored from history.
354 NS_IMETHOD PostScrolledAreaEventForCurrentArea() = 0;
357 * Returns true if this scrollframe is being "actively scrolled".
358 * This basically means that we should allocate resources in the
359 * expectation that scrolling is going to happen.
361 virtual bool IsScrollingActive() const = 0;
364 * Returns true if this scroll frame might be scrolled
365 * asynchronously by the compositor.
367 virtual bool IsMaybeAsynchronouslyScrolled() const = 0;
370 * Was the current presentation state for this frame restored from history?
372 virtual bool DidHistoryRestore() const = 0;
374 * Clear the flag so that DidHistoryRestore() returns false until the next
375 * RestoreState call.
376 * @see nsIStatefulFrame::RestoreState
378 virtual void ClearDidHistoryRestore() = 0;
380 * Mark the frame as having been scrolled at least once, so that it remains
381 * active and we can also start storing its scroll position when saving state.
383 virtual void MarkEverScrolled() = 0;
385 * Determine if the passed in rect is nearly visible according to the frame
386 * visibility heuristics for how close it is to the visible scrollport.
388 virtual bool IsRectNearlyVisible(const nsRect& aRect) const = 0;
390 * Expand the given rect taking into account which directions we can scroll
391 * and how far we want to expand for frame visibility purposes.
393 virtual nsRect ExpandRectToNearlyVisible(const nsRect& aRect) const = 0;
395 * Returns the origin that triggered the last instant scroll. Will equal
396 * ScrollOrigin::Apz when the compositor's replica frame metrics includes the
397 * latest instant scroll.
399 virtual ScrollOrigin LastScrollOrigin() const = 0;
402 * Gets the async scroll animation state of this scroll frame.
404 * There are five possible kinds that can overlap.
405 * MainThread means async scroll animated by the main thread.
406 * APZ scroll animations that are requested from the main thread go through
407 * three states: 1) pending, when the main thread has recorded that it wants
408 * apz to do a scroll animation, 2) requested, when the main thread has sent
409 * the request to the compositor (but it hasn't necessarily arrived yet), and
410 * 3) in progress, after apz has responded to the main thread that it got the
411 * request.
412 * TriggeredByScript means that the async scroll animation was triggered by
413 * script, e.g. Element.scrollTo().
415 enum class AnimationState {
416 MainThread, // mAsyncScroll || mAsyncSmoothMSDScroll
417 APZPending, // mScrollUpdates.LastElement() is Smooth or SmoothMsd
418 APZRequested, // mApzAnimationRequested
419 APZInProgress, // mCurrentAPZScrollAnimationType !=
420 // APZScrollAniationType::No
421 TriggeredByScript // The animation was triggered with
422 // ScrollTriggeredByScript::Yes
424 virtual mozilla::EnumSet<AnimationState> ScrollAnimationState() const = 0;
427 * Returns the current generation counter for the scrollframe. This counter
428 * increments every time the scroll position is set.
430 virtual mozilla::MainThreadScrollGeneration CurrentScrollGeneration()
431 const = 0;
433 * The APZ scroll generation associated with the last APZ scroll offset for
434 * which we processed a repaint request.
436 virtual mozilla::APZScrollGeneration ScrollGenerationOnApz() const = 0;
438 * LastScrollDestination returns the destination of the most recently
439 * requested smooth scroll animation.
441 virtual nsPoint LastScrollDestination() = 0;
443 * Returns the list of scroll position updates since the last call to
444 * NotifyApzTransaction().
446 virtual nsTArray<mozilla::ScrollPositionUpdate> GetScrollUpdates() const = 0;
448 * Returns true if the scroll frame has any scroll position updates since
449 * the last call to NotifyApzTransaction().
451 virtual bool HasScrollUpdates() const = 0;
453 enum class InScrollingGesture : bool { No, Yes };
455 * Clears the "origin of last scroll" property stored in this frame, if
456 * the generation counter passed in matches the current scroll generation
457 * counter, and clears the "origin of last smooth scroll" property if the
458 * generation counter matches. It also resets whether there's an ongoing apz
459 * animation.
461 virtual void ResetScrollInfoIfNeeded(
462 const mozilla::MainThreadScrollGeneration& aGeneration,
463 const mozilla::APZScrollGeneration& aGenerationOnApz,
464 mozilla::APZScrollAnimationType aAPZScrollAnimationType,
465 InScrollingGesture aInScrollingGesture) = 0;
467 * Determine whether it is desirable to be able to asynchronously scroll this
468 * scroll frame.
470 virtual bool WantAsyncScroll() const = 0;
472 * Returns the ScrollMetadata contributed by this frame, if there is one.
474 virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
475 mozilla::layers::WebRenderLayerManager* aLayerManager,
476 const nsIFrame* aItemFrame,
477 const nsPoint& aOffsetToReferenceFrame) const = 0;
480 * Mark the scrollbar frames for reflow.
482 virtual void MarkScrollbarsDirtyForReflow() const = 0;
485 * Invalidate the scrollbar after the marks have been changed.
487 virtual void InvalidateScrollbars() const = 0;
489 virtual void UpdateScrollbarPosition() = 0;
491 virtual void SetTransformingByAPZ(bool aTransforming) = 0;
492 virtual bool IsTransformingByAPZ() const = 0;
495 * Notify this scroll frame that it can be scrolled by APZ. In particular,
496 * this is called *after* the APZ code has created an APZC for this scroll
497 * frame and verified that it is not a scrollinfo layer. Therefore, setting an
498 * async transform on it is actually user visible.
500 virtual void SetScrollableByAPZ(bool aScrollable) = 0;
503 * Notify this scroll frame that it can be zoomed by APZ.
505 virtual void SetZoomableByAPZ(bool aZoomable) = 0;
508 * Mark this scroll frame as having out-of-flow content inside a CSS filter.
509 * Such content will move incorrectly during async-scrolling; to mitigate
510 * this, paint skipping is disabled for such scroll frames.
512 virtual void SetHasOutOfFlowContentInsideFilter() = 0;
515 * Determine if we should build a scrollable layer for this scroll frame and
516 * return the result. It will also record this result on the scroll frame.
517 * Pass the visible rect in aVisibleRect. On return it will be set to the
518 * displayport if there is one.
519 * Pass the dirty rect in aDirtyRect. On return it will be set to the
520 * dirty rect inside the displayport (ie the dirty rect that should be used).
521 * This function will set the display port base rect if aSetBase is true.
522 * aSetBase is only allowed to be false if there has been a call with it
523 * set to true before on the same paint.
525 virtual bool DecideScrollableLayer(mozilla::nsDisplayListBuilder* aBuilder,
526 nsRect* aVisibleRect, nsRect* aDirtyRect,
527 bool aSetBase) = 0;
530 * Notify the scrollframe that the current scroll offset and origin have been
531 * sent over in a layers transaction.
533 * This sets a flag on the scrollframe that indicates subsequent changes
534 * to the scroll position by "weaker" origins are permitted to overwrite the
535 * the scroll origin. Scroll origins that
536 * nsLayoutUtils::CanScrollOriginClobberApz returns false for are considered
537 * "weaker" than scroll origins for which that function returns true.
539 * This function must be called for a scrollframe after all calls to
540 * ComputeScrollMetadata in a layers transaction have been completed.
543 virtual void NotifyApzTransaction() = 0;
546 * Notification that this scroll frame is getting its frame visibility
547 * updated. aIgnoreDisplayPort indicates that the display port was ignored
548 * (because there was no suitable base rect)
550 virtual void NotifyApproximateFrameVisibilityUpdate(
551 bool aIgnoreDisplayPort) = 0;
554 * Returns true if this scroll frame had a display port at the last frame
555 * visibility update and fills in aDisplayPort with that displayport. Returns
556 * false otherwise, and doesn't touch aDisplayPort.
558 virtual bool GetDisplayPortAtLastApproximateFrameVisibilityUpdate(
559 nsRect* aDisplayPort) = 0;
562 * This is called when a descendant scrollframe's has its displayport expired.
563 * This function will check to see if this scrollframe may safely expire its
564 * own displayport and schedule a timer to do that if it is safe.
566 virtual void TriggerDisplayPortExpiration() = 0;
569 * Returns information required to determine where to snap to after a scroll.
571 virtual ScrollSnapInfo GetScrollSnapInfo() = 0;
573 virtual void TryResnap() = 0;
575 * Post a pending re-snap request if the given |aFrame| is one of the snap
576 * points on the last scroll operation.
578 virtual void PostPendingResnapIfNeeded(const nsIFrame* aFrame) = 0;
579 virtual void PostPendingResnap() = 0;
582 * Returns a pair of the scroll-snap-align property value both on X and Y axes
583 * for the given |aFrame| considering the scroll-snap-type of this scroll
584 * container. For example, if the scroll-snap-type is `none`, the pair of
585 * scroll-snap-align is also `none none`.
587 virtual PhysicalScrollSnapAlign GetScrollSnapAlignFor(
588 const nsIFrame* aFrame) const = 0;
591 * Given the drag event aEvent, determine whether the mouse is near the edge
592 * of the scrollable area, and scroll the view in the direction of that edge
593 * if so. If scrolling occurred, true is returned. When false is returned, the
594 * caller should look for an ancestor to scroll.
596 virtual bool DragScroll(mozilla::WidgetEvent* aEvent) = 0;
598 virtual void AsyncScrollbarDragInitiated(
599 uint64_t aDragBlockId, mozilla::layers::ScrollDirection aDirection) = 0;
600 virtual void AsyncScrollbarDragRejected() = 0;
603 * Returns whether this scroll frame is the root scroll frame of the document
604 * that it is in. Note that some documents don't have root scroll frames at
605 * all (ie XUL documents) even though they may contain other scroll frames.
607 virtual bool IsRootScrollFrameOfDocument() const = 0;
610 * Returns the paint sequence number if this scroll frame was the first
611 * scrollable frame for the paint.
613 virtual mozilla::Maybe<uint32_t> IsFirstScrollableFrameSequenceNumber()
614 const = 0;
617 * Set the paint sequence number for the paint in which this was the first
618 * scrollable frame that was encountered.
620 virtual void SetIsFirstScrollableFrameSequenceNumber(
621 mozilla::Maybe<uint32_t> aValue) = 0;
624 * Returns the scroll anchor associated with this scrollable frame. This is
625 * never null.
627 virtual const ScrollAnchorContainer* Anchor() const = 0;
628 virtual ScrollAnchorContainer* Anchor() = 0;
630 virtual bool SmoothScrollVisual(
631 const nsPoint& aVisualViewportOffset,
632 mozilla::layers::FrameMetrics::ScrollOffsetUpdateType aUpdateType) = 0;
635 * Returns true if this scroll frame should perform smooth scroll with the
636 * given |aBehavior|.
638 virtual bool IsSmoothScroll(mozilla::dom::ScrollBehavior aBehavior =
639 mozilla::dom::ScrollBehavior::Auto) const = 0;
642 #endif