Bug 1479216: Restore the order of Scrollbarbutton appearance values. r=xidorn

The patch at bug 1478391 comment 6 changed the way the math in Scrollbarbutton*
worked, which pretty surely caused this.

Restore the original order and math to be the same as before bug 1478391.

MozReview-Commit-ID: CK3iOqeX2NW
This commit is contained in:
Emilio Cobos Álvarez 2018-07-29 00:36:09 +02:00
Родитель 638c015ba9
Коммит 8c4ec8b3ba
3 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -129,13 +129,14 @@ enum class StyleAppearance : uint8_t {
// A scrollbar button (up/down/left/right).
// Keep these in order (some code casts these values to `int` in order to
// compare them against each other).
ScrollbarbuttonUp,
ScrollbarbuttonDown,
ScrollbarbuttonLeft,
ScrollbarbuttonRight,
ScrollbarbuttonUp,
// The scrollbar thumb.
ScrollbarthumbHorizontal,
ScrollbarthumbVertical,
// The scrollbar track.
ScrollbartrackHorizontal,
ScrollbartrackVertical,
// The scroll corner

Просмотреть файл

@ -999,10 +999,10 @@ pub enum Appearance {
/// A scrollbar button (up/down/left/right).
/// Keep these in order (some code casts these values to `int` in order to
/// compare them against each other).
ScrollbarbuttonUp,
ScrollbarbuttonDown,
ScrollbarbuttonLeft,
ScrollbarbuttonRight,
ScrollbarbuttonUp,
/// The scrollbar thumb.
ScrollbarthumbHorizontal,
ScrollbarthumbVertical,

Просмотреть файл

@ -1056,7 +1056,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, WidgetType aWidgetType,
case StyleAppearance::ScrollbarbuttonLeft:
case StyleAppearance::ScrollbarbuttonRight: {
aPart = SP_BUTTON;
aState = (int(aWidgetType) - int(StyleAppearance::ScrollbarbuttonDown))*4;
aState = (int(aWidgetType) - int(StyleAppearance::ScrollbarbuttonUp))*4;
EventStates eventState = GetContentState(aFrame, aWidgetType);
if (!aFrame)
aState += TS_NORMAL;
@ -1071,7 +1071,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, WidgetType aWidgetType,
else if (eventState.HasState(NS_EVENT_STATE_HOVER))
aState += TS_HOVER;
else if (parentState.HasState(NS_EVENT_STATE_HOVER))
aState = (int(aWidgetType) - int(StyleAppearance::ScrollbarbuttonDown)) + SP_BUTTON_IMPLICIT_HOVER_BASE;
aState = (int(aWidgetType) - int(StyleAppearance::ScrollbarbuttonUp)) + SP_BUTTON_IMPLICIT_HOVER_BASE;
else
aState += TS_NORMAL;
}