mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 07:17:30 +09:00
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.
This commit is contained in:
parent
3765010635
commit
21f707390d
26 changed files with 111 additions and 111 deletions
|
|
@ -305,8 +305,8 @@ TextOverflow::TextOverflow(nsDisplayListBuilder* aBuilder,
|
|||
mCanHaveInlineAxisScrollbar = false;
|
||||
if (mScrollableFrame) {
|
||||
auto scrollbarStyle = mBlockWM.IsVertical() ?
|
||||
mScrollableFrame->GetScrollbarStyles().mVertical :
|
||||
mScrollableFrame->GetScrollbarStyles().mHorizontal;
|
||||
mScrollableFrame->GetScrollStyles().mVertical :
|
||||
mScrollableFrame->GetScrollStyles().mHorizontal;
|
||||
mCanHaveInlineAxisScrollbar = scrollbarStyle != NS_STYLE_OVERFLOW_HIDDEN;
|
||||
if (!mAdjustForPixelSnapping) {
|
||||
// Scrolling to the end position can leave some text still overflowing due
|
||||
|
|
|
|||
|
|
@ -9188,7 +9188,7 @@ nsIFrame::IsFocusable(int32_t *aTabIndex, bool aWithMouse)
|
|||
// will be enough to make them keyboard scrollable.
|
||||
nsIScrollableFrame *scrollFrame = do_QueryFrame(this);
|
||||
if (scrollFrame &&
|
||||
!scrollFrame->GetScrollbarStyles().IsHiddenInBothDirections() &&
|
||||
!scrollFrame->GetScrollStyles().IsHiddenInBothDirections() &&
|
||||
!scrollFrame->GetScrollRange().IsEqualEdges(nsRect(0, 0, 0, 0))) {
|
||||
// Scroll bars will be used for overflow
|
||||
isFocusable = true;
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ struct MOZ_STACK_CLASS ScrollReflowInput {
|
|||
// worry about the reflow depth here
|
||||
, mBoxState(aState.mFrame->PresContext(), aState.mRenderingContext, 0)
|
||||
{
|
||||
ScrollbarStyles styles = aFrame->GetScrollbarStyles();
|
||||
ScrollStyles styles = aFrame->GetScrollStyles();
|
||||
mHScrollbar = ShouldShowScrollbar(styles.mHorizontal);
|
||||
mVScrollbar = ShouldShowScrollbar(styles.mVertical);
|
||||
}
|
||||
|
|
@ -808,7 +808,7 @@ nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState,
|
|||
nscoord
|
||||
nsHTMLScrollFrame::GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext)
|
||||
{
|
||||
ScrollbarStyles ss = GetScrollbarStyles();
|
||||
ScrollStyles ss = GetScrollStyles();
|
||||
if (ss.mVertical != NS_STYLE_OVERFLOW_SCROLL || !mHelper.mVScrollbarBox)
|
||||
return 0;
|
||||
|
||||
|
|
@ -1161,7 +1161,7 @@ nsHTMLScrollFrame::AccessibleType()
|
|||
// Create an accessible regardless of focusable state because the state can be
|
||||
// changed during frame life cycle without any notifications to accessibility.
|
||||
if (mContent->IsRootOfNativeAnonymousSubtree() ||
|
||||
GetScrollbarStyles().IsHiddenInBothDirections()) {
|
||||
GetScrollStyles().IsHiddenInBothDirections()) {
|
||||
return a11y::eNoType;
|
||||
}
|
||||
|
||||
|
|
@ -1320,7 +1320,7 @@ ScrollFrameHelper::WantAsyncScroll() const
|
|||
return true;
|
||||
}
|
||||
|
||||
ScrollbarStyles styles = GetScrollbarStylesFromFrame();
|
||||
ScrollStyles styles = GetScrollStylesFromFrame();
|
||||
nscoord oneDevPixel = GetScrolledFrame()->PresContext()->AppUnitsPerDevPixel();
|
||||
nsRect scrollRange = GetScrollRange();
|
||||
bool isVScrollable = (scrollRange.height >= oneDevPixel) &&
|
||||
|
|
@ -1571,7 +1571,7 @@ nsXULScrollFrame::GetXULPrefSize(nsBoxLayoutState& aState)
|
|||
|
||||
nsSize pref = mHelper.mScrolledFrame->GetXULPrefSize(aState);
|
||||
|
||||
ScrollbarStyles styles = GetScrollbarStyles();
|
||||
ScrollStyles styles = GetScrollStyles();
|
||||
|
||||
// scrolled frames don't have their own margins
|
||||
|
||||
|
|
@ -1604,7 +1604,7 @@ nsXULScrollFrame::GetXULMinSize(nsBoxLayoutState& aState)
|
|||
|
||||
nsSize min = mHelper.mScrolledFrame->GetXULMinSizeForScrollArea(aState);
|
||||
|
||||
ScrollbarStyles styles = GetScrollbarStyles();
|
||||
ScrollStyles styles = GetScrollStyles();
|
||||
|
||||
if (mHelper.mVScrollbarBox &&
|
||||
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
|
||||
|
|
@ -2490,7 +2490,7 @@ bool ScrollFrameHelper::IsAlwaysActive() const
|
|||
|
||||
// If we're overflow:hidden, then start as inactive until
|
||||
// we get scrolled manually.
|
||||
ScrollbarStyles styles = GetScrollbarStylesFromFrame();
|
||||
ScrollStyles styles = GetScrollStylesFromFrame();
|
||||
return (styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN &&
|
||||
styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN);
|
||||
}
|
||||
|
|
@ -3821,21 +3821,21 @@ static void HandleScrollPref(nsIScrollable *aScrollable, int32_t aOrientation,
|
|||
}
|
||||
}
|
||||
|
||||
ScrollbarStyles
|
||||
ScrollFrameHelper::GetScrollbarStylesFromFrame() const
|
||||
ScrollStyles
|
||||
ScrollFrameHelper::GetScrollStylesFromFrame() const
|
||||
{
|
||||
nsPresContext* presContext = mOuter->PresContext();
|
||||
if (!presContext->IsDynamic() &&
|
||||
!(mIsRoot && presContext->HasPaginatedScrolling())) {
|
||||
return ScrollbarStyles(NS_STYLE_OVERFLOW_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN);
|
||||
return ScrollStyles(NS_STYLE_OVERFLOW_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN);
|
||||
}
|
||||
|
||||
if (!mIsRoot) {
|
||||
const nsStyleDisplay* disp = mOuter->StyleDisplay();
|
||||
return ScrollbarStyles(disp);
|
||||
return ScrollStyles(disp);
|
||||
}
|
||||
|
||||
ScrollbarStyles result = presContext->GetViewportScrollbarStylesOverride();
|
||||
ScrollStyles result = presContext->GetViewportScrollStylesOverride();
|
||||
nsCOMPtr<nsISupports> container = presContext->GetContainerWeak();
|
||||
nsCOMPtr<nsIScrollable> scrollable = do_QueryInterface(container);
|
||||
if (scrollable) {
|
||||
|
|
@ -4004,7 +4004,7 @@ ScrollFrameHelper::ScrollBy(nsIntPoint aDelta,
|
|||
nsPoint newPos = mDestination + nsPoint(aDelta.x*deltaMultiplier.width, aDelta.y*deltaMultiplier.height);
|
||||
|
||||
if (aSnap == nsIScrollableFrame::ENABLE_SNAP) {
|
||||
ScrollbarStyles styles = GetScrollbarStylesFromFrame();
|
||||
ScrollStyles styles = GetScrollStylesFromFrame();
|
||||
if (styles.mScrollSnapTypeY != NS_STYLE_SCROLL_SNAP_TYPE_NONE ||
|
||||
styles.mScrollSnapTypeX != NS_STYLE_SCROLL_SNAP_TYPE_NONE) {
|
||||
nscoord appUnitsPerDevPixel = mOuter->PresContext()->AppUnitsPerDevPixel();
|
||||
|
|
@ -4412,7 +4412,7 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
bool canHaveHorizontal;
|
||||
bool canHaveVertical;
|
||||
if (!mIsRoot) {
|
||||
ScrollbarStyles styles = scrollable->GetScrollbarStyles();
|
||||
ScrollStyles styles = scrollable->GetScrollStyles();
|
||||
canHaveHorizontal = styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN;
|
||||
canHaveVertical = styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN;
|
||||
if (!canHaveHorizontal && !canHaveVertical && !isResizable) {
|
||||
|
|
@ -5094,7 +5094,7 @@ nsXULScrollFrame::XULLayout(nsBoxLayoutState& aState)
|
|||
(if we're the viewport and we added or removed a scrollbar).
|
||||
**************/
|
||||
|
||||
ScrollbarStyles styles = GetScrollbarStyles();
|
||||
ScrollStyles styles = GetScrollStyles();
|
||||
|
||||
// Look at our style do we always have vertical or horizontal scrollbars?
|
||||
if (styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL)
|
||||
|
|
@ -5399,7 +5399,7 @@ bool
|
|||
ScrollFrameHelper::ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas)
|
||||
{
|
||||
nsIScrollableFrame* sf = do_QueryFrame(mOuter);
|
||||
ScrollbarStyles ss = sf->GetScrollbarStyles();
|
||||
ScrollStyles ss = sf->GetScrollStyles();
|
||||
|
||||
// Reflow when the change in overflow leads to one of our scrollbars
|
||||
// changing or might require repositioning the scrolled content due to
|
||||
|
|
@ -6121,7 +6121,7 @@ ComputeScrollSnapInfo(const ScrollFrameHelper& aScrollFrame)
|
|||
{
|
||||
ScrollSnapInfo result;
|
||||
|
||||
ScrollbarStyles styles = aScrollFrame.GetScrollbarStylesFromFrame();
|
||||
ScrollStyles styles = aScrollFrame.GetScrollStylesFromFrame();
|
||||
|
||||
if (styles.mScrollSnapTypeY == NS_STYLE_SCROLL_SNAP_TYPE_NONE &&
|
||||
styles.mScrollSnapTypeX == NS_STYLE_SCROLL_SNAP_TYPE_NONE) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
ScrollFrameHelper(nsContainerFrame* aOuter, bool aIsRoot);
|
||||
~ScrollFrameHelper();
|
||||
|
||||
mozilla::ScrollbarStyles GetScrollbarStylesFromFrame() const;
|
||||
mozilla::ScrollStyles GetScrollStylesFromFrame() const;
|
||||
|
||||
// If a child frame was added or removed on the scrollframe,
|
||||
// reload our child frame list.
|
||||
|
|
@ -775,8 +775,8 @@ public:
|
|||
virtual nsIFrame* GetScrolledFrame() const override {
|
||||
return mHelper.GetScrolledFrame();
|
||||
}
|
||||
virtual mozilla::ScrollbarStyles GetScrollbarStyles() const override {
|
||||
return mHelper.GetScrollbarStylesFromFrame();
|
||||
virtual mozilla::ScrollStyles GetScrollStyles() const override {
|
||||
return mHelper.GetScrollStylesFromFrame();
|
||||
}
|
||||
virtual uint32_t GetScrollbarVisibility() const override {
|
||||
return mHelper.GetScrollbarVisibility();
|
||||
|
|
@ -1199,8 +1199,8 @@ public:
|
|||
virtual nsIFrame* GetScrolledFrame() const override {
|
||||
return mHelper.GetScrolledFrame();
|
||||
}
|
||||
virtual mozilla::ScrollbarStyles GetScrollbarStyles() const override {
|
||||
return mHelper.GetScrollbarStylesFromFrame();
|
||||
virtual mozilla::ScrollStyles GetScrollStyles() const override {
|
||||
return mHelper.GetScrollStylesFromFrame();
|
||||
}
|
||||
virtual uint32_t GetScrollbarVisibility() const override {
|
||||
return mHelper.GetScrollbarVisibility();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "nsCoord.h"
|
||||
#include "DisplayItemClip.h"
|
||||
#include "ScrollbarStyles.h"
|
||||
#include "ScrollStyles.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/gfx/Point.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
|
|
@ -63,7 +63,7 @@ public:
|
|||
* or NS_STYLE_OVERFLOW_AUTO) governing the horizontal and vertical
|
||||
* scrollbars for this frame.
|
||||
*/
|
||||
virtual mozilla::ScrollbarStyles GetScrollbarStyles() const = 0;
|
||||
virtual mozilla::ScrollStyles GetScrollStyles() const = 0;
|
||||
|
||||
enum { HORIZONTAL = 0x01, VERTICAL = 0x02 };
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue