mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 23:37:31 +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
|
|
@ -1346,7 +1346,7 @@ nsPresContext::ScreenSizeInchesForFontInflation(bool* aChanged)
|
|||
}
|
||||
|
||||
static bool
|
||||
CheckOverflow(const nsStyleDisplay* aDisplay, ScrollbarStyles* aStyles)
|
||||
CheckOverflow(const nsStyleDisplay* aDisplay, ScrollStyles* aStyles)
|
||||
{
|
||||
if (aDisplay->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE &&
|
||||
aDisplay->mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_AUTO &&
|
||||
|
|
@ -1362,17 +1362,17 @@ CheckOverflow(const nsStyleDisplay* aDisplay, ScrollbarStyles* aStyles)
|
|||
}
|
||||
|
||||
if (aDisplay->mOverflowX == NS_STYLE_OVERFLOW_CLIP) {
|
||||
*aStyles = ScrollbarStyles(NS_STYLE_OVERFLOW_HIDDEN,
|
||||
*aStyles = ScrollStyles(NS_STYLE_OVERFLOW_HIDDEN,
|
||||
NS_STYLE_OVERFLOW_HIDDEN, aDisplay);
|
||||
} else {
|
||||
*aStyles = ScrollbarStyles(aDisplay);
|
||||
*aStyles = ScrollStyles(aDisplay);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static nsIContent*
|
||||
GetPropagatedScrollbarStylesForViewport(nsPresContext* aPresContext,
|
||||
ScrollbarStyles *aStyles)
|
||||
GetPropagatedScrollStylesForViewport(nsPresContext* aPresContext,
|
||||
ScrollStyles *aStyles)
|
||||
{
|
||||
nsIDocument* document = aPresContext->Document();
|
||||
Element* docElement = document->GetRootElement();
|
||||
|
|
@ -1424,16 +1424,16 @@ GetPropagatedScrollbarStylesForViewport(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
nsIContent*
|
||||
nsPresContext::UpdateViewportScrollbarStylesOverride()
|
||||
nsPresContext::UpdateViewportScrollStylesOverride()
|
||||
{
|
||||
// Start off with our default styles, and then update them as needed.
|
||||
mViewportStyleScrollbar = ScrollbarStyles(NS_STYLE_OVERFLOW_AUTO,
|
||||
mViewportStyleScrollbar = ScrollStyles(NS_STYLE_OVERFLOW_AUTO,
|
||||
NS_STYLE_OVERFLOW_AUTO);
|
||||
mViewportScrollbarOverrideNode = nullptr;
|
||||
// Don't propagate the scrollbar state in printing or print preview.
|
||||
if (!IsPaginated()) {
|
||||
mViewportScrollbarOverrideNode =
|
||||
GetPropagatedScrollbarStylesForViewport(this, &mViewportStyleScrollbar);
|
||||
GetPropagatedScrollStylesForViewport(this, &mViewportStyleScrollbar);
|
||||
}
|
||||
|
||||
nsIDocument* document = Document();
|
||||
|
|
@ -1445,7 +1445,7 @@ nsPresContext::UpdateViewportScrollbarStylesOverride()
|
|||
// affected across fullscreen change.
|
||||
if (fullscreenElement != document->GetRootElement() &&
|
||||
fullscreenElement != mViewportScrollbarOverrideNode) {
|
||||
mViewportStyleScrollbar = ScrollbarStyles(NS_STYLE_OVERFLOW_HIDDEN,
|
||||
mViewportStyleScrollbar = ScrollStyles(NS_STYLE_OVERFLOW_HIDDEN,
|
||||
NS_STYLE_OVERFLOW_HIDDEN);
|
||||
}
|
||||
}
|
||||
|
|
@ -1454,7 +1454,7 @@ nsPresContext::UpdateViewportScrollbarStylesOverride()
|
|||
}
|
||||
|
||||
bool
|
||||
nsPresContext::ElementWouldPropagateScrollbarStyles(Element* aElement)
|
||||
nsPresContext::ElementWouldPropagateScrollStyles(Element* aElement)
|
||||
{
|
||||
MOZ_ASSERT(IsPaginated(), "Should only be called on paginated contexts");
|
||||
if (aElement->GetParent() && !aElement->IsHTMLElement(nsGkAtoms::body)) {
|
||||
|
|
@ -1462,13 +1462,13 @@ nsPresContext::ElementWouldPropagateScrollbarStyles(Element* aElement)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Go ahead and just call GetPropagatedScrollbarStylesForViewport, but update
|
||||
// a dummy ScrollbarStyles we don't care about. It'll do a bit of extra work,
|
||||
// Go ahead and just call GetPropagatedScrollStylesForViewport, but update
|
||||
// a dummy ScrollStyles we don't care about. It'll do a bit of extra work,
|
||||
// but saves us having to have more complicated code or more code duplication;
|
||||
// in practice we will make this call quite rarely, because we checked for all
|
||||
// the common cases above.
|
||||
ScrollbarStyles dummy(NS_STYLE_OVERFLOW_AUTO, NS_STYLE_OVERFLOW_AUTO);
|
||||
return GetPropagatedScrollbarStylesForViewport(this, &dummy) == aElement;
|
||||
ScrollStyles dummy(NS_STYLE_OVERFLOW_AUTO, NS_STYLE_OVERFLOW_AUTO);
|
||||
return GetPropagatedScrollStylesForViewport(this, &dummy) == aElement;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue