mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 866659 - Avoid bad cast in nsNativeTheme::IsRangeHorizontal. r=bz
This commit is contained in:
parent
6c5218e413
commit
a01c162997
@ -664,11 +664,15 @@ nsNativeTheme::IsRangeHorizontal(nsIFrame* aFrame)
|
||||
{
|
||||
nsIFrame* rangeFrame = aFrame;
|
||||
if (rangeFrame->GetType() != nsGkAtoms::rangeFrame) {
|
||||
// If the thumb's frame is passed in, get its range parent:
|
||||
rangeFrame = aFrame->GetParent();
|
||||
}
|
||||
MOZ_ASSERT(rangeFrame->GetType() == nsGkAtoms::rangeFrame);
|
||||
|
||||
return static_cast<nsRangeFrame*>(rangeFrame)->IsHorizontal();
|
||||
if (rangeFrame->GetType() == nsGkAtoms::rangeFrame) {
|
||||
return static_cast<nsRangeFrame*>(rangeFrame)->IsHorizontal();
|
||||
}
|
||||
// Not actually a range frame - just use the ratio of the frame's size to
|
||||
// decide:
|
||||
return aFrame->GetSize().width >= aFrame->GetSize().height;
|
||||
}
|
||||
|
||||
static nsIFrame*
|
||||
|
Loading…
Reference in New Issue
Block a user