mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1302389 - patch 2 - Add ScrollFrameHelper::IsBidiLTR to return the inline-bidi direction, as opposed to physical LTR-ness, and use this in GetScrolledFrameDir(). r=dholbert
This commit is contained in:
parent
01c9f80e52
commit
19eb5fe1ee
@ -4918,11 +4918,9 @@ void ScrollFrameHelper::PostOverflowEvent()
|
||||
rpc->AddWillPaintObserver(mAsyncScrollPortEvent.get());
|
||||
}
|
||||
|
||||
bool
|
||||
ScrollFrameHelper::IsPhysicalLTR() const
|
||||
nsIFrame*
|
||||
ScrollFrameHelper::GetFrameForDir() const
|
||||
{
|
||||
//TODO make bidi code set these from preferences
|
||||
|
||||
nsIFrame *frame = mOuter;
|
||||
// XXX This is a bit on the slow side.
|
||||
if (mIsRoot) {
|
||||
@ -4946,8 +4944,7 @@ ScrollFrameHelper::IsPhysicalLTR() const
|
||||
}
|
||||
}
|
||||
|
||||
WritingMode wm = frame->GetWritingMode();
|
||||
return wm.IsVertical() ? wm.IsVerticalLR() : wm.IsBidiLTR();
|
||||
return frame;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -5822,7 +5819,7 @@ ScrollFrameHelper::GetScrolledFrameDir() const
|
||||
}
|
||||
}
|
||||
|
||||
return IsPhysicalLTR() ? NS_STYLE_DIRECTION_LTR : NS_STYLE_DIRECTION_RTL;
|
||||
return IsBidiLTR() ? NS_STYLE_DIRECTION_LTR : NS_STYLE_DIRECTION_RTL;
|
||||
}
|
||||
|
||||
nsRect
|
||||
|
@ -329,7 +329,19 @@ public:
|
||||
nsMargin GetDesiredScrollbarSizes(nsBoxLayoutState* aState);
|
||||
nscoord GetNondisappearingScrollbarWidth(nsBoxLayoutState* aState,
|
||||
mozilla::WritingMode aVerticalWM);
|
||||
bool IsPhysicalLTR() const;
|
||||
bool IsPhysicalLTR() const {
|
||||
WritingMode wm = GetFrameForDir()->GetWritingMode();
|
||||
return wm.IsVertical() ? wm.IsVerticalLR() : wm.IsBidiLTR();
|
||||
}
|
||||
bool IsBidiLTR() const {
|
||||
nsIFrame* frame = GetFrameForDir();
|
||||
return frame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_LTR;
|
||||
}
|
||||
private:
|
||||
nsIFrame* GetFrameForDir() const; // helper for Is{Physical,Bidi}LTR to find
|
||||
// the frame whose directionality we use
|
||||
|
||||
public:
|
||||
bool IsScrollbarOnRight() const;
|
||||
bool IsScrollingActive(nsDisplayListBuilder* aBuilder) const;
|
||||
bool IsMaybeScrollingActive() const;
|
||||
|
Loading…
Reference in New Issue
Block a user