зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1697325 Part 5 - Add GetOverflowAreasRelativeToParent(), and simplify all the call sites. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107740
This commit is contained in:
Родитель
9cb2451f17
Коммит
e1b891089b
|
@ -561,9 +561,7 @@ void nsLayoutUtils::UnionChildOverflow(nsIFrame* aFrame,
|
|||
continue;
|
||||
}
|
||||
for (nsIFrame* child : list) {
|
||||
OverflowAreas childOverflow =
|
||||
child->GetOverflowAreas() + child->GetPosition();
|
||||
aOverflowAreas.UnionWith(childOverflow);
|
||||
aOverflowAreas.UnionWith(child->GetOverflowAreasRelativeToParent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -865,8 +865,7 @@ bool BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat) {
|
|||
|
||||
// Update the float combined area state
|
||||
// XXX Floats should really just get invalidated here if necessary
|
||||
mFloatOverflowAreas.UnionWith(aFloat->GetOverflowAreas() +
|
||||
aFloat->GetPosition());
|
||||
mFloatOverflowAreas.UnionWith(aFloat->GetOverflowAreasRelativeToParent());
|
||||
|
||||
// Place the float in the float manager
|
||||
// calculate region
|
||||
|
|
|
@ -2810,8 +2810,7 @@ void nsContainerFrame::ConsiderChildOverflow(OverflowAreas& aOverflowAreas,
|
|||
OverflowAreas combined = OverflowAreas(childVisual, nsRect());
|
||||
aOverflowAreas.UnionWith(combined + aChildFrame->GetPosition());
|
||||
} else {
|
||||
aOverflowAreas.UnionWith(aChildFrame->GetOverflowAreas() +
|
||||
aChildFrame->GetPosition());
|
||||
aOverflowAreas.UnionWith(aChildFrame->GetOverflowAreasRelativeToParent());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7458,6 +7458,10 @@ OverflowAreas nsIFrame::GetOverflowAreasRelativeToSelf() const {
|
|||
return OverflowAreas(InkOverflowRect(), ScrollableOverflowRect());
|
||||
}
|
||||
|
||||
OverflowAreas nsIFrame::GetOverflowAreasRelativeToParent() const {
|
||||
return GetOverflowAreas() + mRect.TopLeft();
|
||||
}
|
||||
|
||||
nsRect nsIFrame::ScrollableOverflowRectRelativeToParent() const {
|
||||
return ScrollableOverflowRect() + mRect.TopLeft();
|
||||
}
|
||||
|
|
|
@ -3622,6 +3622,14 @@ class nsIFrame : public nsQueryFrame {
|
|||
*/
|
||||
mozilla::OverflowAreas GetOverflowAreasRelativeToSelf() const;
|
||||
|
||||
/**
|
||||
* Same as GetOverflowAreas, except relative to the parent frame.
|
||||
*
|
||||
* @return the overflow area relative to the parent frame, in the parent
|
||||
* frame's coordinate system
|
||||
*/
|
||||
mozilla::OverflowAreas GetOverflowAreasRelativeToParent() const;
|
||||
|
||||
/**
|
||||
* Same as ScrollableOverflowRect, except relative to the parent
|
||||
* frame.
|
||||
|
|
Загрузка…
Ссылка в новой задаче