Bug 1143218 patch 2: Add LineLeft and LineRight accessors to LogicalRect, r=jfkthame

This commit is contained in:
Simon Montagu 2015-03-22 11:44:48 +02:00
Родитель 4454a1b4b5
Коммит f66d48dc0f
1 изменённых файлов: 24 добавлений и 13 удалений

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

@ -1471,6 +1471,30 @@ public:
return mRect.height;
}
/**
* Accessors for line-relative coordinates
*/
nscoord LineLeft(WritingMode aWritingMode, nscoord aContainerWidth) const
{
CHECK_WRITING_MODE(aWritingMode);
if (aWritingMode.IsVertical()) {
return IStart(); // sideways-left will require aContainerHeight
} else {
return aWritingMode.IsBidiLTR() ? IStart()
: aContainerWidth - IEnd();
}
}
nscoord LineRight(WritingMode aWritingMode, nscoord aContainerWidth) const
{
CHECK_WRITING_MODE(aWritingMode);
if (aWritingMode.IsVertical()) {
return IEnd(); // sideways-left will require aContainerHeight
} else {
return aWritingMode.IsBidiLTR() ? IEnd()
: aContainerWidth - IStart();
}
}
/**
* Physical coordinates of the rect.
*/
@ -1603,19 +1627,6 @@ public:
return mRect.IsEqualEdges(aOther.mRect);
}
/* XXX are these correct?
nscoord ILeft(WritingMode aWritingMode) const
{
CHECK_WRITING_MODE(aWritingMode);
return aWritingMode.IsBidiLTR() ? IStart() : IEnd();
}
nscoord IRight(WritingMode aWritingMode) const
{
CHECK_WRITING_MODE(aWritingMode);
return aWritingMode.IsBidiLTR() ? IEnd() : IStart();
}
*/
LogicalPoint Origin(WritingMode aWritingMode) const
{
CHECK_WRITING_MODE(aWritingMode);