зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d76d14db06
Коммит
af955838a6
|
@ -5117,12 +5117,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
|
||||
{
|
||||
|
|
|
@ -2235,6 +2235,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.
|
||||
|
@ -2244,6 +2253,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).
|
||||
|
|
Загрузка…
Ссылка в новой задаче