From 0e6a9cc60aeb754e00e466ce20052d2fa9ccb7f9 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 6 Jan 2021 16:31:36 +0000 Subject: Issue #1705 - Part 3: Rename ScrollbarStyles to ScrollStyles. ScrollbarStyles contains values of overflow, (over)scroll-behavior, etc. The only one which is marginally related to scroll _bars_ is overflow, which can be used to hide scrollbar (by making an element not scrollable) or enforce the scrollbar to display. It makes more sense to be called ScrollStyles as it's mainly concerning behavior of scrolling, not scrollbars. Also, with the addition of scrollbar width properties, the current name can be confusing. --- dom/animation/KeyframeEffectReadOnly.cpp | 2 +- dom/base/Element.cpp | 20 ++++++++++---------- dom/base/nsDocument.cpp | 2 +- dom/base/nsGlobalWindow.cpp | 6 +++--- dom/events/EventStateManager.cpp | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'dom') diff --git a/dom/animation/KeyframeEffectReadOnly.cpp b/dom/animation/KeyframeEffectReadOnly.cpp index 179ed6cb4..2efc747f0 100644 --- a/dom/animation/KeyframeEffectReadOnly.cpp +++ b/dom/animation/KeyframeEffectReadOnly.cpp @@ -1089,7 +1089,7 @@ KeyframeEffectReadOnly::CanThrottleTransformChanges(nsIFrame& aFrame) const return true; } - ScrollbarStyles ss = scrollable->GetScrollbarStyles(); + ScrollStyles ss = scrollable->GetScrollStyles(); if (ss.mVertical == NS_STYLE_OVERFLOW_HIDDEN && ss.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN && scrollable->GetLogicalScrollPosition() == nsPoint(0, 0)) { diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 940045ca7..9ba065238 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -745,7 +745,7 @@ Element::Scroll(const CSSIntPoint& aScroll, const ScrollOptions& aOptions) if (aOptions.mBehavior == ScrollBehavior::Smooth) { scrollMode = nsIScrollableFrame::SMOOTH_MSD; } else if (aOptions.mBehavior == ScrollBehavior::Auto) { - ScrollbarStyles styles = sf->GetScrollbarStyles(); + ScrollStyles styles = sf->GetScrollStyles(); if (styles.mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) { scrollMode = nsIScrollableFrame::SMOOTH_MSD; } @@ -834,7 +834,7 @@ Element::SetScrollTop(int32_t aScrollTop) nsIScrollableFrame* sf = GetScrollFrame(); if (sf) { nsIScrollableFrame::ScrollMode scrollMode = nsIScrollableFrame::INSTANT; - if (sf->GetScrollbarStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) { + if (sf->GetScrollStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) { scrollMode = nsIScrollableFrame::SMOOTH_MSD; } sf->ScrollToCSSPixels(CSSIntPoint(sf->GetScrollPositionCSSPixels().x, @@ -856,7 +856,7 @@ Element::SetScrollLeft(int32_t aScrollLeft) nsIScrollableFrame* sf = GetScrollFrame(); if (sf) { nsIScrollableFrame::ScrollMode scrollMode = nsIScrollableFrame::INSTANT; - if (sf->GetScrollbarStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) { + if (sf->GetScrollStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) { scrollMode = nsIScrollableFrame::SMOOTH_MSD; } @@ -1069,7 +1069,7 @@ ShadowRoot* Element::GetShadowRootByMode() const { /** - * 1. Let shadow be context object’s shadow root. + * 1. Let shadow be context object???s shadow root. * 2. If shadow is null or its mode is "closed", then return null. */ ShadowRoot* shadowRoot = GetShadowRoot(); @@ -1088,7 +1088,7 @@ already_AddRefed Element::AttachShadow(const ShadowRootInit& aInit, ErrorResult& aError) { /** - * 1. If context object’s namespace is not the HTML namespace, + * 1. If context object???s namespace is not the HTML namespace, * then throw a "NotSupportedError" DOMException. */ if (!IsHTMLElement()) { @@ -1097,7 +1097,7 @@ Element::AttachShadow(const ShadowRootInit& aInit, ErrorResult& aError) } /** - * 2. If context object’s local name is not + * 2. If context object???s local name is not * a valid custom element name, "article", "aside", "blockquote", * "body", "div", "footer", "h1", "h2", "h3", "h4", "h5", "h6", * "header", "main" "nav", "p", "section", or "span", @@ -1181,8 +1181,8 @@ Element::AttachShadowInternal(bool aClosed, ErrorResult& aError) /** * 4. Let shadow be a new shadow root whose node document is - * context object’s node document, host is context object, - * and mode is init’s mode. + * context object???s node document, host is context object, + * and mode is init???s mode. */ RefPtr shadowRoot = new ShadowRoot(this, aClosed, nodeInfo.forget(), protoBinding); @@ -1190,7 +1190,7 @@ Element::AttachShadowInternal(bool aClosed, ErrorResult& aError) shadowRoot->SetIsComposedDocParticipant(IsInComposedDoc()); /** - * 5. Set context object’s shadow root to shadow. + * 5. Set context object???s shadow root to shadow. */ SetShadowRoot(shadowRoot); @@ -1890,7 +1890,7 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent) nsPresContext* presContext = presShell->GetPresContext(); if (presContext) { MOZ_ASSERT(this != - presContext->GetViewportScrollbarStylesOverrideNode(), + presContext->GetViewportScrollStylesOverrideNode(), "Leaving behind a raw pointer to this node (as having " "propagated scrollbar styles) - that's dangerous..."); } diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 0396848a9..0fed2db01 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -10568,7 +10568,7 @@ UpdateViewportScrollbarOverrideForFullscreen(nsIDocument* aDoc) { if (nsIPresShell* presShell = aDoc->GetShell()) { if (nsPresContext* presContext = presShell->GetPresContext()) { - presContext->UpdateViewportScrollbarStylesOverride(); + presContext->UpdateViewportScrollStylesOverride(); } } } diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 4e80568f6..38a58f947 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8264,7 +8264,7 @@ nsGlobalWindow::ScrollTo(const CSSIntPoint& aScroll, scroll.y = maxpx; } - bool smoothScroll = sf->GetScrollbarStyles().IsSmoothScroll(aOptions.mBehavior); + bool smoothScroll = sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior); sf->ScrollToCSSPixels(scroll, smoothScroll ? nsIScrollableFrame::SMOOTH_MSD @@ -8320,7 +8320,7 @@ nsGlobalWindow::ScrollByLines(int32_t numLines, // It seems like it would make more sense for ScrollByLines to use // SMOOTH mode, but tests seem to depend on the synchronous behaviour. // Perhaps Web content does too. - bool smoothScroll = sf->GetScrollbarStyles().IsSmoothScroll(aOptions.mBehavior); + bool smoothScroll = sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior); sf->ScrollBy(nsIntPoint(0, numLines), nsIScrollableFrame::LINES, smoothScroll @@ -8341,7 +8341,7 @@ nsGlobalWindow::ScrollByPages(int32_t numPages, // It seems like it would make more sense for ScrollByPages to use // SMOOTH mode, but tests seem to depend on the synchronous behaviour. // Perhaps Web content does too. - bool smoothScroll = sf->GetScrollbarStyles().IsSmoothScroll(aOptions.mBehavior); + bool smoothScroll = sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior); sf->ScrollBy(nsIntPoint(0, numPages), nsIScrollableFrame::PAGES, smoothScroll diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 2ca698024..c8f1acdb5 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -2516,7 +2516,7 @@ EventStateManager::ComputeScrollTarget(nsIFrame* aTargetFrame, return frameToScroll; } - ScrollbarStyles ss = scrollableFrame->GetScrollbarStyles(); + ScrollStyles ss = scrollableFrame->GetScrollStyles(); bool hiddenForV = (NS_STYLE_OVERFLOW_HIDDEN == ss.mVertical); bool hiddenForH = (NS_STYLE_OVERFLOW_HIDDEN == ss.mHorizontal); if ((hiddenForV && hiddenForH) || @@ -2609,7 +2609,7 @@ EventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame, ComputeScrollAmountForDefaultAction(aEvent, scrollAmountInDevPixels); // Don't scroll around the axis whose overflow style is hidden. - ScrollbarStyles overflowStyle = aScrollableFrame->GetScrollbarStyles(); + ScrollStyles overflowStyle = aScrollableFrame->GetScrollStyles(); if (overflowStyle.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN) { actualDevPixelScrollAmount.x = 0; } -- cgit v1.2.3