mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Issue #1705 - Part 5: Implement scrollbar-width:none for all target platforms.
This commit is contained in:
parent
8e08d8bfd3
commit
7060aae250
1 changed files with 27 additions and 12 deletions
|
|
@ -1054,6 +1054,15 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
|||
reflowScrollCorner = showResizer == mHelper.mCollapsedResizer;
|
||||
mHelper.mCollapsedResizer = !showResizer;
|
||||
}
|
||||
|
||||
// Hide the scrollbar when the scrollbar-width is set to none.
|
||||
// This is only needed for root element because scrollbars of non-
|
||||
// root elements with "scrollbar-width: none" is already suppressed
|
||||
// in ScrollFrameHelper::CreateAnonymousContent.
|
||||
if (this->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::None) {
|
||||
state.mVScrollbar = ShowScrollbar::Never;
|
||||
state.mHScrollbar = ShowScrollbar::Never;
|
||||
}
|
||||
}
|
||||
|
||||
nsRect oldScrollAreaBounds = mHelper.mScrollPort;
|
||||
|
|
@ -4404,24 +4413,30 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
|
||||
nsIScrollableFrame *scrollable = do_QueryFrame(mOuter);
|
||||
|
||||
// If we're the scrollframe for the root, then we want to construct
|
||||
// our scrollbar frames no matter what. That way later dynamic
|
||||
// changes to propagated overflow styles will show or hide
|
||||
// scrollbars on the viewport without requiring frame reconstruction
|
||||
// of the viewport (good!).
|
||||
bool canHaveHorizontal;
|
||||
bool canHaveVertical;
|
||||
if (!mIsRoot) {
|
||||
ScrollStyles styles = scrollable->GetScrollStyles();
|
||||
canHaveHorizontal = styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN;
|
||||
canHaveVertical = styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN;
|
||||
if (mIsRoot) {
|
||||
// If we're the scrollframe for the root, then we want to construct
|
||||
// our scrollbar frames no matter what. That way, later dynamic
|
||||
// changes to propagated overflow styles will show or hide
|
||||
// scrollbars on the viewport without requiring frame reconstruction
|
||||
// of the viewport (which is a Good Thing(tm)!).
|
||||
canHaveHorizontal = true;
|
||||
canHaveVertical = true;
|
||||
} else {
|
||||
if (mOuter->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::None) {
|
||||
// If scrollbar-width is none, don't generate scrollbars.
|
||||
canHaveHorizontal = false;
|
||||
canHaveVertical = false;
|
||||
} else {
|
||||
ScrollStyles styles = scrollable->GetScrollStyles();
|
||||
canHaveHorizontal = styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN;
|
||||
canHaveVertical = styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN;
|
||||
}
|
||||
if (!canHaveHorizontal && !canHaveVertical && !isResizable) {
|
||||
// Nothing to do.
|
||||
return NS_OK;
|
||||
}
|
||||
} else {
|
||||
canHaveHorizontal = true;
|
||||
canHaveVertical = true;
|
||||
}
|
||||
|
||||
// The anonymous <div> used by <inputs> never gets scrollbars.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue