diff options
-rw-r--r-- | dom/base/nsGkAtomList.h | 1 | ||||
-rw-r--r-- | layout/generic/nsGfxScrollFrame.cpp | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h index e5008c420b..ad2eda2116 100644 --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -1133,6 +1133,7 @@ GK_ATOM(scrollbarDownBottom, "scrollbar-down-bottom") GK_ATOM(scrollbarDownTop, "scrollbar-down-top") GK_ATOM(scrollbarUpBottom, "scrollbar-up-bottom") GK_ATOM(scrollbarUpTop, "scrollbar-up-top") +GK_ATOM(scrollbarwidth, "scrollbarwidth") GK_ATOM(scrollbox, "scrollbox") GK_ATOM(scrollcorner, "scrollcorner") GK_ATOM(scrolling, "scrolling") diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 83f5cff2be..8b76dc712d 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -4448,6 +4448,7 @@ ScrollFrameHelper::CreateAnonymousContent( kNameSpaceID_XUL, nsIDOMNode::ELEMENT_NODE); NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY); + StyleScrollbarWidth scrollWidth = mOuter->StyleUserInterface()->mScrollbarWidth; if (canHaveHorizontal) { RefPtr<NodeInfo> ni = nodeInfo; @@ -4464,6 +4465,17 @@ 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. + if (scrollWidth == StyleScrollbarWidth::None) { + mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth, + NS_LITERAL_STRING("none"), false); + } else if (scrollWidth == StyleScrollbarWidth::Thin) { + mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth, + NS_LITERAL_STRING("thin"), false); + } else { + mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth, + NS_LITERAL_STRING("auto"), false); + } if (mIsRoot) { mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::root_, NS_LITERAL_STRING("true"), false); @@ -4487,6 +4499,17 @@ 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. + if (scrollWidth == StyleScrollbarWidth::None) { + mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth, + NS_LITERAL_STRING("none"), false); + } else if (scrollWidth == StyleScrollbarWidth::Thin) { + mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth, + NS_LITERAL_STRING("thin"), false); + } else { + mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::scrollbarwidth, + NS_LITERAL_STRING("auto"), false); + } if (mIsRoot) { mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::root_, NS_LITERAL_STRING("true"), false); |