Bug 1028716 part 3 - Widget updates to support the extended set of -moz-orient values. r=roc

This commit is contained in:
Jonathan Kew 2014-06-24 19:26:13 +01:00
parent b68965af5a
commit 3ffbad09c7
3 changed files with 18 additions and 5 deletions

View File

@ -2672,7 +2672,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
}
}
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame, eventState),
aFrame->StyleDisplay()->mOrient != NS_STYLE_ORIENT_VERTICAL,
!IsVerticalProgress(aFrame),
value, maxValue, aFrame);
break;
}

View File

@ -597,7 +597,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
EventStates eventStates = GetContentState(stateFrame, aWidgetType);
aGtkWidgetType = IsIndeterminateProgress(stateFrame, eventStates)
? (stateFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL)
? IsVerticalProgress(stateFrame)
? MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE
: MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE
: MOZ_GTK_PROGRESS_CHUNK;

View File

@ -557,15 +557,28 @@ nsNativeTheme::IsIndeterminateProgress(nsIFrame* aFrame,
bool
nsNativeTheme::IsVerticalProgress(nsIFrame* aFrame)
{
return aFrame &&
aFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
if (!aFrame) {
return false;
}
return IsVerticalMeter(aFrame);
}
bool
nsNativeTheme::IsVerticalMeter(nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "You have to pass a non-null aFrame");
return aFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
switch (aFrame->StyleDisplay()->mOrient) {
case NS_STYLE_ORIENT_HORIZONTAL:
return false;
case NS_STYLE_ORIENT_VERTICAL:
return true;
case NS_STYLE_ORIENT_INLINE:
return aFrame->GetWritingMode().IsVertical();
case NS_STYLE_ORIENT_BLOCK:
return !aFrame->GetWritingMode().IsVertical();
}
NS_NOTREACHED("unexpected -moz-orient value");
return false;
}
// menupopup: