mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 63895 (Part 1) - Add helper methods for retrieving overflow areas in the frame's local coordinate space. r=dbaron
This commit is contained in:
parent
e42e0da34f
commit
b222d248ef
@ -5118,12 +5118,39 @@ nsIFrame::GetOverflowAreas() const
|
||||
nsRect(nsPoint(0, 0), GetSize()));
|
||||
}
|
||||
|
||||
nsOverflowAreas
|
||||
nsIFrame::GetOverflowAreasRelativeToSelf() const
|
||||
{
|
||||
if (IsTransformed()) {
|
||||
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
|
||||
(Properties().Get(PreTransformOverflowAreasProperty()));
|
||||
if (preTransformOverflows) {
|
||||
return nsOverflowAreas(preTransformOverflows->VisualOverflow(),
|
||||
preTransformOverflows->ScrollableOverflow());
|
||||
}
|
||||
}
|
||||
return nsOverflowAreas(GetVisualOverflowRect(),
|
||||
GetScrollableOverflowRect());
|
||||
}
|
||||
|
||||
nsRect
|
||||
nsIFrame::GetScrollableOverflowRectRelativeToParent() const
|
||||
{
|
||||
return GetScrollableOverflowRect() + mRect.TopLeft();
|
||||
}
|
||||
|
||||
nsRect
|
||||
nsIFrame::GetScrollableOverflowRectRelativeToSelf() const
|
||||
{
|
||||
if (IsTransformed()) {
|
||||
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
|
||||
(Properties().Get(PreTransformOverflowAreasProperty()));
|
||||
if (preTransformOverflows)
|
||||
return preTransformOverflows->ScrollableOverflow();
|
||||
}
|
||||
return GetScrollableOverflowRect();
|
||||
}
|
||||
|
||||
nsRect
|
||||
nsIFrame::GetVisualOverflowRectRelativeToSelf() const
|
||||
{
|
||||
|
@ -2280,6 +2280,15 @@ public:
|
||||
|
||||
nsOverflowAreas GetOverflowAreas() const;
|
||||
|
||||
/**
|
||||
* Same as GetOverflowAreas, except in this frame's coordinate
|
||||
* system (before transforms are applied).
|
||||
*
|
||||
* @return the overflow areas relative to this frame, before any CSS transforms have
|
||||
* been applied, i.e. in this frame's coordinate system
|
||||
*/
|
||||
nsOverflowAreas GetOverflowAreasRelativeToSelf() const;
|
||||
|
||||
/**
|
||||
* Same as GetScrollableOverflowRect, except relative to the parent
|
||||
* frame.
|
||||
@ -2289,6 +2298,15 @@ public:
|
||||
*/
|
||||
nsRect GetScrollableOverflowRectRelativeToParent() const;
|
||||
|
||||
/**
|
||||
* Same as GetScrollableOverflowRect, except in this frame's coordinate
|
||||
* system (before transforms are applied).
|
||||
*
|
||||
* @return the rect relative to this frame, before any CSS transforms have
|
||||
* been applied, i.e. in this frame's coordinate system
|
||||
*/
|
||||
nsRect GetScrollableOverflowRectRelativeToSelf() const;
|
||||
|
||||
/**
|
||||
* Like GetVisualOverflowRect, except in this frame's
|
||||
* coordinate system (before transforms are applied).
|
||||
|
Loading…
Reference in New Issue
Block a user