Bug 35168 (Part 1) - Add GetNormalRect to nsIFrame. r=dbaron

This commit is contained in:
Seth Fowler 2014-08-19 18:24:57 -07:00
parent 9b86ba77e0
commit 7bc9523238
2 changed files with 18 additions and 0 deletions

View File

@ -5302,6 +5302,19 @@ nsIFrame::MovePositionBy(const nsPoint& aTranslation)
SetPosition(position);
}
nsRect
nsIFrame::GetNormalRect() const
{
// It might be faster to first check
// StyleDisplay()->IsRelativelyPositionedStyle().
nsPoint* normalPosition = static_cast<nsPoint*>
(Properties().Get(NormalPositionProperty()));
if (normalPosition) {
return nsRect(*normalPosition, GetSize());
}
return GetRect();
}
nsPoint
nsIFrame::GetNormalPosition() const
{

View File

@ -749,6 +749,11 @@ public:
MovePositionBy(aTranslation.GetPhysicalPoint(aWritingMode, 0));
}
/**
* Return frame's rect without relative positioning
*/
nsRect GetNormalRect() const;
/**
* Return frame's position without relative positioning
*/