mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Issue #3050 - Follow-up: extend attribution mapping to resize and corner controls to allow themes to respond to scrollbar-width.
Also clean up the comments and whitespace a bit.
This commit is contained in:
parent
4bdd388989
commit
94f3f356ed
1 changed files with 31 additions and 2 deletions
|
|
@ -4474,7 +4474,8 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
NS_LITERAL_STRING("horizontal"), false);
|
||||
mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::clickthrough,
|
||||
NS_LITERAL_STRING("always"), false);
|
||||
// Map scrollbar-width to an attribute for browser themes.
|
||||
|
||||
// Map scrollbar-width to an attribute on horizontal scrollbars for browser themes.
|
||||
if (scrollWidth == StyleScrollbarWidth::None) {
|
||||
mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("none"), false);
|
||||
|
|
@ -4485,6 +4486,7 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("auto"), false);
|
||||
}
|
||||
|
||||
if (mIsRoot) {
|
||||
mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::root_,
|
||||
NS_LITERAL_STRING("true"), false);
|
||||
|
|
@ -4508,7 +4510,8 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
NS_LITERAL_STRING("vertical"), false);
|
||||
mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::clickthrough,
|
||||
NS_LITERAL_STRING("always"), false);
|
||||
// Map scrollbar-width to an attribute for browser themes.
|
||||
|
||||
// Map scrollbar-width to an attribute on vertical scrollbars for browser themes.
|
||||
if (scrollWidth == StyleScrollbarWidth::None) {
|
||||
mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("none"), false);
|
||||
|
|
@ -4519,6 +4522,7 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("auto"), false);
|
||||
}
|
||||
|
||||
if (mIsRoot) {
|
||||
mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::root_,
|
||||
NS_LITERAL_STRING("true"), false);
|
||||
|
|
@ -4557,6 +4561,18 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
}
|
||||
mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::dir, dir, false);
|
||||
|
||||
// Map scrollbar-width to an attribute on resizers for browser themes.
|
||||
if (scrollWidth == StyleScrollbarWidth::None) {
|
||||
mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("none"), false);
|
||||
} else if (scrollWidth == StyleScrollbarWidth::Thin) {
|
||||
mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("thin"), false);
|
||||
} else {
|
||||
mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("auto"), false);
|
||||
}
|
||||
|
||||
if (mIsRoot) {
|
||||
nsIContent* browserRoot = GetBrowserRoot(mOuter->GetContent());
|
||||
mCollapsedResizer = !(browserRoot &&
|
||||
|
|
@ -4579,6 +4595,19 @@ ScrollFrameHelper::CreateAnonymousContent(
|
|||
kNameSpaceID_XUL,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
NS_TrustedNewXULElement(getter_AddRefs(mScrollCornerContent), nodeInfo.forget());
|
||||
|
||||
// Map scrollbar-width to an attribute on scrollcorners for browser themes.
|
||||
if (scrollWidth == StyleScrollbarWidth::None) {
|
||||
mScrollCornerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("none"), false);
|
||||
} else if (scrollWidth == StyleScrollbarWidth::Thin) {
|
||||
mScrollCornerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("thin"), false);
|
||||
} else {
|
||||
mScrollCornerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth,
|
||||
NS_LITERAL_STRING("auto"), false);
|
||||
}
|
||||
|
||||
if (!aElements.AppendElement(mScrollCornerContent))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue