diff options
author | Moonchild <moonchild@palemoon.org> | 2021-01-19 08:08:18 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-01-19 08:08:18 +0000 |
commit | c76214f0b54cf74b69d0fb4afa0d2eca2e898a98 (patch) | |
tree | 15ee2e9776727ecabcdc52d06de55dfd576485c1 /widget | |
parent | 810c2bf8080da2bc8ec4efb05223fea31817944b (diff) | |
parent | 75286e68d703b1d8a4e0a7c72ce45d089024c124 (diff) | |
download | UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar.gz UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar.lz UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar.xz UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.zip |
Master merge
This merges master into release to replace Redwood.
# Conflicts:
# CLOBBER
# build/moz.configure/old.configure
# config/milestone.txt
# config/moz.build
# config/system-headers
# dom/abort/AbortController.cpp
# dom/abort/AbortController.h
# dom/abort/AbortSignal.cpp
# dom/abort/AbortSignal.h
# dom/abort/moz.build
# dom/abort/tests/moz.build
# dom/animation/KeyframeEffect.cpp
# dom/base/CustomElementRegistry.cpp
# dom/base/DocGroup.cpp
# dom/base/ResizeObserverController.cpp
# dom/base/ResizeObserverController.h
# dom/base/nsContentUtils.cpp
# dom/base/nsContentUtils.h
# dom/base/nsDocument.cpp
# dom/base/nsIDocument.h
# dom/fetch/FetchObserver.cpp
# dom/fetch/FetchObserver.h
# dom/heapsnapshot/AutoMemMap.cpp
# dom/heapsnapshot/AutoMemMap.h
# dom/heapsnapshot/CoreDump.proto
# dom/heapsnapshot/HeapSnapshot.cpp
# dom/heapsnapshot/HeapSnapshotTempFileHelperChild.h
# dom/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp
# dom/heapsnapshot/HeapSnapshotTempFileHelperParent.h
# dom/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl
# dom/heapsnapshot/moz.build
# dom/heapsnapshot/tests/gtest/moz.build
# dom/html/nsGenericHTMLElement.h
# dom/media/platforms/PlatformDecoderModule.h
# dom/media/platforms/moz.build
# dom/script/ModuleLoadRequest.cpp
# dom/script/ModuleLoadRequest.h
# dom/script/ModuleScript.cpp
# dom/script/ModuleScript.h
# dom/script/ScriptElement.cpp
# dom/script/ScriptElement.h
# dom/script/ScriptLoadHandler.cpp
# dom/script/ScriptLoadHandler.h
# dom/script/ScriptLoader.cpp
# dom/script/ScriptLoader.h
# dom/script/ScriptSettings.cpp
# dom/script/ScriptSettings.h
# dom/script/nsIScriptElement.h
# dom/script/nsIScriptLoaderObserver.idl
# dom/webidl/HTMLLinkElement.webidl
# gfx/gl/moz.build
# gfx/graphite2/src/moz.build
# gfx/layers/moz.build
# js/ductwork/inspector/moz.build
# js/ductwork/moz.build
# js/src/gc/Heap.h
# js/src/moz.build
# js/src/vm/UnboxedObject-inl.h
# js/src/vm/UnboxedObject.cpp
# js/src/vm/UnboxedObject.h
# layout/base/crashtests/crashtests.list
# layout/build/moz.build
# layout/generic/AspectRatio.h
# layout/generic/crashtests/crashtests.list
# layout/reftests/bidi/reftest-stylo.list
# layout/reftests/reftest-stylo.list
# layout/reftests/table-bordercollapse/reftest.list
# layout/reftests/writing-mode/reftest-stylo.list
# layout/style/StyleSheet.cpp
# layout/style/nsRuleNode.cpp
# layout/style/nsStyleStruct.cpp
# layout/style/nsStyleStruct.h
# modules/libpref/init/all.js
# nsprpub/pr/src/linking/prlink.c
# parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java
# parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java
# parser/html/nsHtml5AtomList.h
# parser/html/nsHtml5AttributeName.cpp
# parser/html/nsHtml5AttributeName.h
# parser/html/nsHtml5ElementName.cpp
# parser/html/nsHtml5ElementName.h
# parser/html/nsHtml5TreeBuilderCppSupplement.h
# parser/htmlparser/nsElementTable.cpp
# parser/htmlparser/nsHTMLTagList.h
# security/nss/lib/nss/nss.h
# security/nss/lib/softoken/pkcs11.c
# security/nss/lib/softoken/softkver.h
# security/nss/lib/util/nssutil.h
# testing/web-platform/tests/tools/html5lib/html5lib/html5parser.py
# testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/_base.py
# toolkit/modules/AppConstants.jsm
Diffstat (limited to 'widget')
54 files changed, 135 insertions, 109 deletions
diff --git a/widget/BasicEvents.h b/widget/BasicEvents.h index 960cb67c6..0ce0f587d 100644 --- a/widget/BasicEvents.h +++ b/widget/BasicEvents.h @@ -25,6 +25,8 @@ struct ParamTraits; namespace mozilla { +class EventTargetChainItem; + /****************************************************************************** * mozilla::BaseEventFlags * @@ -350,6 +352,7 @@ protected: , mRefPoint(0, 0) , mLastRefPoint(0, 0) , mSpecifiedEventType(nullptr) + , mPath(nullptr) { MOZ_COUNT_CTOR(WidgetEvent); mFlags.Clear(); @@ -361,6 +364,7 @@ protected: WidgetEvent() : WidgetEventTime() + , mPath(nullptr) { MOZ_COUNT_CTOR(WidgetEvent); } @@ -419,6 +423,11 @@ public: nsCOMPtr<dom::EventTarget> mCurrentTarget; nsCOMPtr<dom::EventTarget> mOriginalTarget; + /// The possible related target + nsCOMPtr<dom::EventTarget> mRelatedTarget; + + nsTArray<EventTargetChainItem>* mPath; + dom::EventTarget* GetDOMEventTarget() const; dom::EventTarget* GetCurrentDOMEventTarget() const; dom::EventTarget* GetOriginalDOMEventTarget() const; @@ -436,6 +445,7 @@ public: mTarget = aCopyTargets ? aEvent.mTarget : nullptr; mCurrentTarget = aCopyTargets ? aEvent.mCurrentTarget : nullptr; mOriginalTarget = aCopyTargets ? aEvent.mOriginalTarget : nullptr; + mRelatedTarget = aCopyTargets ? aEvent.mRelatedTarget : nullptr; } /** diff --git a/widget/ContentEvents.h b/widget/ContentEvents.h index be64b7beb..09d4d9928 100644 --- a/widget/ContentEvents.h +++ b/widget/ContentEvents.h @@ -212,9 +212,6 @@ public: return result; } - /// The possible related target - nsCOMPtr<dom::EventTarget> mRelatedTarget; - bool mFromRaise; bool mIsRefocus; @@ -222,7 +219,6 @@ public: { AssignUIEventData(aEvent, aCopyTargets); - mRelatedTarget = aCopyTargets ? aEvent.mRelatedTarget : nullptr; mFromRaise = aEvent.mFromRaise; mIsRefocus = aEvent.mIsRefocus; } diff --git a/widget/FontRange.h b/widget/FontRange.h index 15cb4a01d..ef7b601e9 100644 --- a/widget/FontRange.h +++ b/widget/FontRange.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h index 442ac41e8..4b8ff44ce 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h @@ -110,9 +110,6 @@ public: MOZ_CRASH("WidgetMouseEventBase must not be most-subclass"); } - /// The possible related target - nsCOMPtr<nsISupports> relatedTarget; - enum buttonType { eLeftButton = 0, @@ -162,7 +159,6 @@ public: { AssignInputEventData(aEvent, aCopyTargets); - relatedTarget = aCopyTargets ? aEvent.relatedTarget : nullptr; button = aEvent.button; buttons = aEvent.buttons; pressure = aEvent.pressure; diff --git a/widget/NativeKeyToDOMCodeName.h b/widget/NativeKeyToDOMCodeName.h index 159b0773c..74f2ed1f4 100644 --- a/widget/NativeKeyToDOMCodeName.h +++ b/widget/NativeKeyToDOMCodeName.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/NativeKeyToDOMKeyName.h b/widget/NativeKeyToDOMKeyName.h index ce1e3c3a4..25dafff6f 100644 --- a/widget/NativeKeyToDOMKeyName.h +++ b/widget/NativeKeyToDOMKeyName.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/PCompositorWidget.ipdl b/widget/PCompositorWidget.ipdl index f8ffd8dff..4c83d92fa 100644 --- a/widget/PCompositorWidget.ipdl +++ b/widget/PCompositorWidget.ipdl @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=99: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/PlatformWidgetTypes.ipdlh b/widget/PlatformWidgetTypes.ipdlh index 26933f8de..af2579155 100644 --- a/widget/PlatformWidgetTypes.ipdlh +++ b/widget/PlatformWidgetTypes.ipdlh @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=99: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/ScreenProxy.cpp b/widget/ScreenProxy.cpp index 462dd7476..d8abbad01 100644 --- a/widget/ScreenProxy.cpp +++ b/widget/ScreenProxy.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */ -/* vim: set sw=4 ts=8 et tw=80 : */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/ScreenProxy.h b/widget/ScreenProxy.h index 22e78c36d..6fa1283ca 100644 --- a/widget/ScreenProxy.h +++ b/widget/ScreenProxy.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */ -/* vim: set sw=4 ts=8 et tw=80 : */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/SwipeTracker.h b/widget/cocoa/SwipeTracker.h index b5eb2a481..78940d15c 100644 --- a/widget/cocoa/SwipeTracker.h +++ b/widget/cocoa/SwipeTracker.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/SwipeTracker.mm b/widget/cocoa/SwipeTracker.mm index 9c06ee0c3..51169171a 100644 --- a/widget/cocoa/SwipeTracker.mm +++ b/widget/cocoa/SwipeTracker.mm @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/TextInputHandler.h b/widget/cocoa/TextInputHandler.h index de7c77593..86da354ab 100644 --- a/widget/cocoa/TextInputHandler.h +++ b/widget/cocoa/TextInputHandler.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 sw=2 et tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index 39965d013..348d99ab6 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 sw=2 et tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/VibrancyManager.h b/widget/cocoa/VibrancyManager.h index cae57a269..04b1ad1cd 100644 --- a/widget/cocoa/VibrancyManager.h +++ b/widget/cocoa/VibrancyManager.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/VibrancyManager.mm b/widget/cocoa/VibrancyManager.mm index 93a774254..d02338eb6 100644 --- a/widget/cocoa/VibrancyManager.mm +++ b/widget/cocoa/VibrancyManager.mm @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/ViewRegion.h b/widget/cocoa/ViewRegion.h index a8efccaff..9ff7e6d09 100644 --- a/widget/cocoa/ViewRegion.h +++ b/widget/cocoa/ViewRegion.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/ViewRegion.mm b/widget/cocoa/ViewRegion.mm index b3605caa2..455d54fda 100644 --- a/widget/cocoa/ViewRegion.mm +++ b/widget/cocoa/ViewRegion.mm @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/moz.build b/widget/cocoa/moz.build index 7c995d900..c4f887297 100644 --- a/widget/cocoa/moz.build +++ b/widget/cocoa/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index b141e80b0..a437504fd 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -1,5 +1,4 @@ /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index f93e40f7b..056c453f2 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -2279,6 +2279,12 @@ IsHiDPIContext(nsPresContext* aContext) 2 * aContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom(); } +static bool +IsScrollbarWidthThin(nsIFrame* aFrame) +{ + return aFrame->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::Thin; +} + NS_IMETHODIMP nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, nsIFrame* aFrame, @@ -3392,9 +3398,10 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, // Find our parent scrollbar frame in order to find out whether we're in // a small or a large scrollbar. nsIFrame *scrollbarFrame = GetParentScrollbarFrame(aFrame); - if (!scrollbarFrame) + if (!scrollbarFrame) { return NS_ERROR_FAILURE; - + } + bool isSmall = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL); bool isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL); int32_t& minSize = isHorizontal ? aResult->width : aResult->height; @@ -3419,6 +3426,9 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, else { aResult->SizeTo(16, 16); } + if (IsScrollbarWidthThin(aFrame)) { + aResult->SizeTo(8, 8); + } break; } @@ -3435,6 +3445,9 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, kThemeMetricScrollBarWidth; SInt32 scrollbarWidth = 0; ::GetThemeMetric(themeMetric, &scrollbarWidth); + if (IsScrollbarWidthThin(aFrame)) { + scrollbarWidth /= 2; + } aResult->SizeTo(scrollbarWidth, scrollbarWidth); break; } @@ -3467,22 +3480,26 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, case NS_THEME_SCROLLBARBUTTON_LEFT: case NS_THEME_SCROLLBARBUTTON_RIGHT: { - nsIFrame *scrollbarFrame = GetParentScrollbarFrame(aFrame); - if (!scrollbarFrame) return NS_ERROR_FAILURE; - - // Since there is no NS_THEME_SCROLLBARBUTTON_UP_SMALL we need to ask the parent what appearance style it has. - int32_t themeMetric = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL) ? - kThemeMetricSmallScrollBarWidth : - kThemeMetricScrollBarWidth; - SInt32 scrollbarWidth = 0; - ::GetThemeMetric(themeMetric, &scrollbarWidth); - - // It seems that for both sizes of scrollbar, the buttons are one pixel "longer". - if (aWidgetType == NS_THEME_SCROLLBARBUTTON_LEFT || aWidgetType == NS_THEME_SCROLLBARBUTTON_RIGHT) - aResult->SizeTo(scrollbarWidth+1, scrollbarWidth); - else - aResult->SizeTo(scrollbarWidth, scrollbarWidth+1); - + if (!IsScrollbarWidthThin(aFrame)) { + // Get scrollbar button metrics from the system, except in the case of + // thin scrollbars, where we leave them at 0 (collapse) + + nsIFrame *scrollbarFrame = GetParentScrollbarFrame(aFrame); + if (!scrollbarFrame) return NS_ERROR_FAILURE; + + // Since there is no NS_THEME_SCROLLBARBUTTON_UP_SMALL we need to ask the parent what appearance style it has. + int32_t themeMetric = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL) ? + kThemeMetricSmallScrollBarWidth : + kThemeMetricScrollBarWidth; + SInt32 scrollbarWidth = 0; + ::GetThemeMetric(themeMetric, &scrollbarWidth); + + // It seems that for both sizes of scrollbar, the buttons are one pixel "longer". + if (aWidgetType == NS_THEME_SCROLLBARBUTTON_LEFT || aWidgetType == NS_THEME_SCROLLBARBUTTON_RIGHT) + aResult->SizeTo(scrollbarWidth+1, scrollbarWidth); + else + aResult->SizeTo(scrollbarWidth, scrollbarWidth+1); + } *aIsOverridable = false; break; } diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index 58d7a3681..441bb7bbf 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=4 et sw=4 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/gtk/PCompositorWidget.ipdl b/widget/gtk/PCompositorWidget.ipdl index 178fe78e4..fe98fc116 100644 --- a/widget/gtk/PCompositorWidget.ipdl +++ b/widget/gtk/PCompositorWidget.ipdl @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=99: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/gtk/PlatformWidgetTypes.ipdlh b/widget/gtk/PlatformWidgetTypes.ipdlh index 145d39546..cab34a4cc 100644 --- a/widget/gtk/PlatformWidgetTypes.ipdlh +++ b/widget/gtk/PlatformWidgetTypes.ipdlh @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=99: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/gtk/WidgetStyleCache.cpp b/widget/gtk/WidgetStyleCache.cpp index f35a451aa..7296146f9 100644 --- a/widget/gtk/WidgetStyleCache.cpp +++ b/widget/gtk/WidgetStyleCache.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/gtk/WidgetStyleCache.h b/widget/gtk/WidgetStyleCache.h index 2cbb5f960..fbdfa9349 100644 --- a/widget/gtk/WidgetStyleCache.h +++ b/widget/gtk/WidgetStyleCache.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build index 8d621c0a0..7c802a3c1 100644 --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/gtk/mozgtk/gtk2/moz.build b/widget/gtk/mozgtk/gtk2/moz.build index d07fd06df..db7bb0972 100644 --- a/widget/gtk/mozgtk/gtk2/moz.build +++ b/widget/gtk/mozgtk/gtk2/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/gtk/mozgtk/gtk3/moz.build b/widget/gtk/mozgtk/gtk3/moz.build index 4e9379565..ec9a5ef46 100644 --- a/widget/gtk/mozgtk/gtk3/moz.build +++ b/widget/gtk/mozgtk/gtk3/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/gtk/mozgtk/moz.build b/widget/gtk/mozgtk/moz.build index 528e2e9d0..43f94aabf 100644 --- a/widget/gtk/mozgtk/moz.build +++ b/widget/gtk/mozgtk/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/gtk/mozgtk/stub/moz.build b/widget/gtk/mozgtk/stub/moz.build index 1a8e21001..7713bfaaf 100644 --- a/widget/gtk/mozgtk/stub/moz.build +++ b/widget/gtk/mozgtk/stub/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp index 15b4eeffa..aa5ee2c7a 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=4 et sw=4 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/gtk/nsDragService.h b/widget/gtk/nsDragService.h index 90c113106..f3027eeea 100644 --- a/widget/gtk/nsDragService.h +++ b/widget/gtk/nsDragService.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=4 et sw=4 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index 89b8ab7dc..cb4e7debf 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -1098,6 +1098,12 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, uint8_t aWidgetType, return true; } +static bool +IsScrollbarWidthThin(nsIFrame* aFrame) +{ + return aFrame->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::Thin; +} + NS_IMETHODIMP nsNativeThemeGTK::DrawWidgetBackground(nsRenderingContext* aContext, nsIFrame* aFrame, @@ -1419,32 +1425,39 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, case NS_THEME_SCROLLBARBUTTON_UP: case NS_THEME_SCROLLBARBUTTON_DOWN: { - if (gtk_check_version(3,20,0) == nullptr) { - moz_gtk_get_widget_min_size(MOZ_GTK_SCROLLBAR_BUTTON, - &(aResult->width), &(aResult->height)); - } else { - MozGtkScrollbarMetrics metrics; - moz_gtk_get_scrollbar_metrics(&metrics); + if (!IsScrollbarWidthThin(aFrame)) { + // Get scrollbar button metrics from the system, except in the case of + // thin scrollbars, where we leave them at 0 (collapse) + if (gtk_check_version(3,20,0) == nullptr) { + moz_gtk_get_widget_min_size(MOZ_GTK_SCROLLBAR_BUTTON, + &(aResult->width), &(aResult->height)); + } else { + MozGtkScrollbarMetrics metrics; + moz_gtk_get_scrollbar_metrics(&metrics); - aResult->width = metrics.slider_width; - aResult->height = metrics.stepper_size; + aResult->width = metrics.slider_width; + aResult->height = metrics.stepper_size; + } } - *aIsOverridable = false; } break; case NS_THEME_SCROLLBARBUTTON_LEFT: case NS_THEME_SCROLLBARBUTTON_RIGHT: { - if (gtk_check_version(3,20,0) == nullptr) { - moz_gtk_get_widget_min_size(MOZ_GTK_SCROLLBAR_BUTTON, - &(aResult->width), &(aResult->height)); - } else { - MozGtkScrollbarMetrics metrics; - moz_gtk_get_scrollbar_metrics(&metrics); + if (!IsScrollbarWidthThin(aFrame)) { + // Get scrollbar button metrics from the system, except in the case of + // thin scrollbars, where we leave them at 0 (collapse) + if (gtk_check_version(3,20,0) == nullptr) { + moz_gtk_get_widget_min_size(MOZ_GTK_SCROLLBAR_BUTTON, + &(aResult->width), &(aResult->height)); + } else { + MozGtkScrollbarMetrics metrics; + moz_gtk_get_scrollbar_metrics(&metrics); - aResult->width = metrics.stepper_size; - aResult->height = metrics.slider_width; + aResult->width = metrics.stepper_size; + aResult->height = metrics.slider_width; + } } *aIsOverridable = false; } @@ -1514,6 +1527,24 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, } break; case NS_THEME_SCROLLBARTHUMB_VERTICAL: + { + if (gtk_check_version(3,20,0) == nullptr) { + moz_gtk_get_widget_min_size(NativeThemeToGtkTheme(aWidgetType, aFrame), + &(aResult->width), &(aResult->height)); + } else { + MozGtkScrollbarMetrics metrics; + moz_gtk_get_scrollbar_metrics(&metrics); + + aResult->width = metrics.slider_width; + aResult->height = metrics.min_slider_size; + } + if (IsScrollbarWidthThin(aFrame)) { + // If thin scrollbars, divide the thickness by 3 + aResult->width /= 3; + } + *aIsOverridable = false; + } + break; case NS_THEME_SCROLLBARTHUMB_HORIZONTAL: { if (gtk_check_version(3,20,0) == nullptr) { @@ -1523,13 +1554,12 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, MozGtkScrollbarMetrics metrics; moz_gtk_get_scrollbar_metrics(&metrics); - if (aWidgetType == NS_THEME_SCROLLBARTHUMB_VERTICAL) { - aResult->width = metrics.slider_width; - aResult->height = metrics.min_slider_size; - } else { - aResult->height = metrics.slider_width; - aResult->width = metrics.min_slider_size; - } + aResult->height = metrics.slider_width; + aResult->width = metrics.min_slider_size; + } + if (IsScrollbarWidthThin(aFrame)) { + // If thin scrollbars, divide the thickness by 3 + aResult->height /= 3; } *aIsOverridable = false; } diff --git a/widget/gtkxtbin/gtk2xtbin.c b/widget/gtkxtbin/gtk2xtbin.c index 189478bad..01e4b0bdd 100644 --- a/widget/gtkxtbin/gtk2xtbin.c +++ b/widget/gtkxtbin/gtk2xtbin.c @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * vim: set expandtab shiftwidth=2 tabstop=2: */ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/widget/gtkxtbin/gtk2xtbin.h b/widget/gtkxtbin/gtk2xtbin.h index 60b3a0b34..cffb752e6 100644 --- a/widget/gtkxtbin/gtk2xtbin.h +++ b/widget/gtkxtbin/gtk2xtbin.h @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * vim: set expandtab shiftwidth=2 tabstop=2: */ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/widget/gtkxtbin/moz.build b/widget/gtkxtbin/moz.build index 070aa5777..41b867c3c 100644 --- a/widget/gtkxtbin/moz.build +++ b/widget/gtkxtbin/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/gtkxtbin/xembed.h b/widget/gtkxtbin/xembed.h index 605c128aa..5a5390091 100644 --- a/widget/gtkxtbin/xembed.h +++ b/widget/gtkxtbin/xembed.h @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * vim: set expandtab shiftwidth=2 tabstop=2: */ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/widget/moz.build b/widget/moz.build index 3a52805b0..c72b2066c 100644 --- a/widget/moz.build +++ b/widget/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index c6ec3a406..d3cdf72cf 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/nsDeviceContextSpecProxy.cpp b/widget/nsDeviceContextSpecProxy.cpp index dafbf1549..df0927237 100644 --- a/widget/nsDeviceContextSpecProxy.cpp +++ b/widget/nsDeviceContextSpecProxy.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/nsDeviceContextSpecProxy.h b/widget/nsDeviceContextSpecProxy.h index adde3cc11..df065fc7b 100644 --- a/widget/nsDeviceContextSpecProxy.h +++ b/widget/nsDeviceContextSpecProxy.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/uikit/moz.build b/widget/uikit/moz.build index 50aed405b..2c6c188de 100644 --- a/widget/uikit/moz.build +++ b/widget/uikit/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/windows/InkCollector.cpp b/widget/windows/InkCollector.cpp index 3268fe95b..9871b9661 100644 --- a/widget/windows/InkCollector.cpp +++ b/widget/windows/InkCollector.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -* vim: set ts=2 sw=2 et tw=78: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/windows/InkCollector.h b/widget/windows/InkCollector.h index 9570eea2a..b466ef05b 100644 --- a/widget/windows/InkCollector.h +++ b/widget/windows/InkCollector.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -* vim: set ts=2 sw=2 et tw=78: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/windows/PCompositorWidget.ipdl b/widget/windows/PCompositorWidget.ipdl index 4805c95a4..1a9c65e12 100644 --- a/widget/windows/PCompositorWidget.ipdl +++ b/widget/windows/PCompositorWidget.ipdl @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=99: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/windows/PlatformWidgetTypes.ipdlh b/widget/windows/PlatformWidgetTypes.ipdlh index aad9cf395..1ebc54769 100644 --- a/widget/windows/PlatformWidgetTypes.ipdlh +++ b/widget/windows/PlatformWidgetTypes.ipdlh @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=99: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/windows/WinMouseScrollHandler.cpp b/widget/windows/WinMouseScrollHandler.cpp index e157b1be2..ef6b92ea4 100644 --- a/widget/windows/WinMouseScrollHandler.cpp +++ b/widget/windows/WinMouseScrollHandler.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/windows/WinMouseScrollHandler.h b/widget/windows/WinMouseScrollHandler.h index 5d8c58ba0..7ebd551ea 100644 --- a/widget/windows/WinMouseScrollHandler.h +++ b/widget/windows/WinMouseScrollHandler.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/widget/windows/moz.build b/widget/windows/moz.build index 4a449de95..baa9b8afc 100644 --- a/widget/windows/moz.build +++ b/widget/windows/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index e84a2b80c..0947019ca 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -1388,6 +1388,12 @@ GetThemeDpiScaleFactor(nsIFrame* aFrame) return 1.0; } +static bool +IsScrollbarWidthThin(nsIFrame* aFrame) +{ + return aFrame->StyleUserInterface()->mScrollbarWidth == StyleScrollbarWidth::Thin; +} + NS_IMETHODIMP nsNativeThemeWin::DrawWidgetBackground(nsRenderingContext* aContext, nsIFrame* aFrame, @@ -2788,14 +2794,21 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame, break; case NS_THEME_SCROLLBARBUTTON_UP: case NS_THEME_SCROLLBARBUTTON_DOWN: - (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL); - (*aResult).height = ::GetSystemMetrics(SM_CYVSCROLL); + // Get scrollbar button metrics from the system, except in the case of + // thin scrollbars, where we leave them at 0 (collapsing them to invisible) + if (!IsScrollbarWidthThin(aFrame)) { + (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL); + (*aResult).height = ::GetSystemMetrics(SM_CYVSCROLL); + } *aIsOverridable = false; break; case NS_THEME_SCROLLBARBUTTON_LEFT: case NS_THEME_SCROLLBARBUTTON_RIGHT: - (*aResult).width = ::GetSystemMetrics(SM_CXHSCROLL); - (*aResult).height = ::GetSystemMetrics(SM_CYHSCROLL); + // See comment above. + if (!IsScrollbarWidthThin(aFrame)) { + (*aResult).width = ::GetSystemMetrics(SM_CXHSCROLL); + (*aResult).height = ::GetSystemMetrics(SM_CYHSCROLL); + } *aIsOverridable = false; break; case NS_THEME_SCROLLBAR_VERTICAL: @@ -2871,8 +2884,14 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame, (*aResult).height = ::GetSystemMetrics(SM_CYVTHUMB); // Without theming, divide the thumb size by two in order to look more // native - if (!GetTheme(aWidgetType)) - (*aResult).height >>= 1; + if (!GetTheme(aWidgetType)) { + (*aResult).height /= 2; + } + // If scrollbar-width is thin, divide the thickness by three to make + // it more compact. + if (IsScrollbarWidthThin(aFrame)) { + (*aResult).width /= 3; + } *aIsOverridable = false; break; case NS_THEME_SCROLLBARTHUMB_HORIZONTAL: @@ -2880,8 +2899,14 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame, (*aResult).height = ::GetSystemMetrics(SM_CYHSCROLL); // Without theming, divide the thumb size by two in order to look more // native - if (!GetTheme(aWidgetType)) - (*aResult).width >>= 1; + if (!GetTheme(aWidgetType)) { + (*aResult).width /= 2; + } + // If scrollbar-width is thin, divide the thickness by three to make + // it more compact. + if (IsScrollbarWidthThin(aFrame)) { + (*aResult).height /= 3; + } *aIsOverridable = false; break; case NS_THEME_SCROLLBAR_HORIZONTAL: diff --git a/widget/windows/tests/moz.build b/widget/windows/tests/moz.build index 28919c271..83ed8d9d9 100644 --- a/widget/windows/tests/moz.build +++ b/widget/windows/tests/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/x11/moz.build b/widget/x11/moz.build index 9b5dafb6d..2d5229fc8 100644 --- a/widget/x11/moz.build +++ b/widget/x11/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/widget/xremoteclient/moz.build b/widget/xremoteclient/moz.build index 8d3f01c82..cac9f2d49 100644 --- a/widget/xremoteclient/moz.build +++ b/widget/xremoteclient/moz.build @@ -1,5 +1,4 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. |