зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1676057 - Disable scrollbar buttons when non-native theme is in use on Linux. r=emilio,spohl
Whether scrollbar buttons are shown is currently determined by LookAndFeel values, and these are exposed through system metric media features. LookAndFeel values are process-wide, but which theme is in use is document-specific. (It can be the platform's native theme or the native basic theme, depending on Document::ShouldAvoidNativeTheme.) So if nsNativeBasicTheme on Linux needs to not support scrollbar buttons, we can't do this by forcing the LookAndFeel values to be false. So instead, we skip creating the native anonymous content for the scrollbar buttons when the non-native theme is in use on Linux. There's no need to support dynamic changes, since whether the non-native theme is in use for a given document never changes. Differential Revision: https://phabricator.services.mozilla.com/D96345
This commit is contained in:
Родитель
b31560e593
Коммит
82fdd2ebea
|
@ -223,6 +223,8 @@ class nsITheme : public nsISupports {
|
|||
* Should we insert a dropmarker inside of combobox button?
|
||||
*/
|
||||
virtual bool ThemeNeedsComboboxDropmarker() = 0;
|
||||
|
||||
virtual bool ThemeSupportsScrollbarButtons() { return true; }
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID)
|
||||
|
|
|
@ -349,7 +349,9 @@ nsresult nsScrollbarFrame::CreateAnonymousContent(
|
|||
nodeInfoManager->GetNodeInfo(nsGkAtoms::scrollbarbutton, nullptr,
|
||||
kNameSpaceID_XUL, nsINode::ELEMENT_NODE);
|
||||
|
||||
{
|
||||
bool createButtons = PresContext()->Theme()->ThemeSupportsScrollbarButtons();
|
||||
|
||||
if (createButtons) {
|
||||
AnonymousContentKey key;
|
||||
mUpTopButton =
|
||||
MakeScrollbarButton(sbbNodeInfo, vertical, /* aBottom */ false,
|
||||
|
@ -357,7 +359,7 @@ nsresult nsScrollbarFrame::CreateAnonymousContent(
|
|||
aElements.AppendElement(ContentInfo(mUpTopButton, key));
|
||||
}
|
||||
|
||||
{
|
||||
if (createButtons) {
|
||||
AnonymousContentKey key;
|
||||
mDownTopButton =
|
||||
MakeScrollbarButton(sbbNodeInfo, vertical, /* aBottom */ false,
|
||||
|
@ -388,7 +390,7 @@ nsresult nsScrollbarFrame::CreateAnonymousContent(
|
|||
mSlider->AppendChildTo(mThumb, false);
|
||||
}
|
||||
|
||||
{
|
||||
if (createButtons) {
|
||||
AnonymousContentKey key;
|
||||
mUpBottomButton =
|
||||
MakeScrollbarButton(sbbNodeInfo, vertical, /* aBottom */ true,
|
||||
|
@ -396,7 +398,7 @@ nsresult nsScrollbarFrame::CreateAnonymousContent(
|
|||
aElements.AppendElement(ContentInfo(mUpBottomButton, key));
|
||||
}
|
||||
|
||||
{
|
||||
if (createButtons) {
|
||||
AnonymousContentKey key;
|
||||
mDownBottomButton =
|
||||
MakeScrollbarButton(sbbNodeInfo, vertical, /* aBottom */ true,
|
||||
|
|
|
@ -35,6 +35,7 @@ class nsNativeBasicThemeGTK : public nsNativeBasicTheme {
|
|||
nsIFrame* aFrame, const ComputedStyle& aStyle,
|
||||
const EventStates& aDocumentState, uint32_t aDpiRatio,
|
||||
bool aIsRoot) override;
|
||||
bool ThemeSupportsScrollbarButtons() override { return false; }
|
||||
|
||||
protected:
|
||||
virtual ~nsNativeBasicThemeGTK() = default;
|
||||
|
|
Загрузка…
Ссылка в новой задаче