mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1274962 - Part 7: Clean up unecessary parameter for RecomputePerspectiveChildrenOverflow. r=dbaron
This commit is contained in:
parent
7fb4a7ee36
commit
d6c0343e48
@ -8116,12 +8116,18 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
|
|||||||
|
|
||||||
/* If we're transformed, transform the overflow rect by the current transformation. */
|
/* If we're transformed, transform the overflow rect by the current transformation. */
|
||||||
bool hasTransform = IsTransformed();
|
bool hasTransform = IsTransformed();
|
||||||
nsSize oldSize = aOldSize ? *aOldSize : mRect.Size();
|
nsSize oldSize = mRect.Size();
|
||||||
bool sizeChanged = (oldSize != aNewSize);
|
bool sizeChanged = ((aOldSize ? *aOldSize : oldSize) != aNewSize);
|
||||||
|
|
||||||
|
/* Since our size might not actually have been computed yet, we need to make sure that we use the
|
||||||
|
* correct dimensions by overriding the stored bounding rectangle with the value the caller has
|
||||||
|
* ensured us we'll use.
|
||||||
|
*/
|
||||||
|
SetSize(aNewSize);
|
||||||
|
|
||||||
if (ChildrenHavePerspective() && sizeChanged) {
|
if (ChildrenHavePerspective() && sizeChanged) {
|
||||||
nsRect newBounds(nsPoint(0, 0), aNewSize);
|
nsRect newBounds(nsPoint(0, 0), aNewSize);
|
||||||
RecomputePerspectiveChildrenOverflow(this, &newBounds);
|
RecomputePerspectiveChildrenOverflow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasTransform) {
|
if (hasTransform) {
|
||||||
@ -8137,12 +8143,6 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
|
|||||||
*/
|
*/
|
||||||
aOverflowAreas.SetAllTo(nsRect());
|
aOverflowAreas.SetAllTo(nsRect());
|
||||||
} else {
|
} else {
|
||||||
/* Since our size might not actually have been computed yet, we need to make sure that we use the
|
|
||||||
* correct dimensions by overriding the stored bounding rectangle with the value the caller has
|
|
||||||
* ensured us we'll use.
|
|
||||||
*/
|
|
||||||
SetSize(aNewSize);
|
|
||||||
|
|
||||||
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
||||||
nsRect& o = aOverflowAreas.Overflow(otype);
|
nsRect& o = aOverflowAreas.Overflow(otype);
|
||||||
o = nsDisplayTransform::TransformRect(o, this);
|
o = nsDisplayTransform::TransformRect(o, this);
|
||||||
@ -8155,14 +8155,14 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
|
|||||||
if (Extend3DContext()) {
|
if (Extend3DContext()) {
|
||||||
ComputePreserve3DChildrenOverflow(aOverflowAreas);
|
ComputePreserve3DChildrenOverflow(aOverflowAreas);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Revert the size change in case some caller is depending on this. */
|
|
||||||
SetSize(oldSize);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Properties().Delete(nsIFrame::PreTransformOverflowAreasProperty());
|
Properties().Delete(nsIFrame::PreTransformOverflowAreasProperty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Revert the size change in case some caller is depending on this. */
|
||||||
|
SetSize(oldSize);
|
||||||
|
|
||||||
bool anyOverflowChanged;
|
bool anyOverflowChanged;
|
||||||
if (aOverflowAreas != nsOverflowAreas(bounds, bounds)) {
|
if (aOverflowAreas != nsOverflowAreas(bounds, bounds)) {
|
||||||
anyOverflowChanged = SetOverflowAreas(aOverflowAreas);
|
anyOverflowChanged = SetOverflowAreas(aOverflowAreas);
|
||||||
@ -8177,13 +8177,8 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsIFrame::RecomputePerspectiveChildrenOverflow(const nsIFrame* aStartFrame, const nsRect* aBounds)
|
nsIFrame::RecomputePerspectiveChildrenOverflow(const nsIFrame* aStartFrame)
|
||||||
{
|
{
|
||||||
// Children may check our size when getting our transform, make sure it's valid.
|
|
||||||
nsSize oldSize = GetSize();
|
|
||||||
if (aBounds) {
|
|
||||||
SetSize(aBounds->Size());
|
|
||||||
}
|
|
||||||
nsIFrame::ChildListIterator lists(this);
|
nsIFrame::ChildListIterator lists(this);
|
||||||
for (; !lists.IsDone(); lists.Next()) {
|
for (; !lists.IsDone(); lists.Next()) {
|
||||||
nsFrameList::Enumerator childFrames(lists.CurrentList());
|
nsFrameList::Enumerator childFrames(lists.CurrentList());
|
||||||
@ -8210,12 +8205,10 @@ nsIFrame::RecomputePerspectiveChildrenOverflow(const nsIFrame* aStartFrame, cons
|
|||||||
// style context. We must find any descendant frames using our size
|
// style context. We must find any descendant frames using our size
|
||||||
// (by recursing into frames that have the same containing block)
|
// (by recursing into frames that have the same containing block)
|
||||||
// to update their overflow rects too.
|
// to update their overflow rects too.
|
||||||
child->RecomputePerspectiveChildrenOverflow(aStartFrame, nullptr);
|
child->RecomputePerspectiveChildrenOverflow(aStartFrame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Restore our old size just in case something depends on this elesewhere.
|
|
||||||
SetSize(oldSize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2799,7 +2799,7 @@ ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange, nsIAtom* aOri
|
|||||||
if (mOuter->ChildrenHavePerspective()) {
|
if (mOuter->ChildrenHavePerspective()) {
|
||||||
// The overflow areas of descendants may depend on the scroll position,
|
// The overflow areas of descendants may depend on the scroll position,
|
||||||
// so ensure they get updated.
|
// so ensure they get updated.
|
||||||
mOuter->RecomputePerspectiveChildrenOverflow(mOuter, nullptr);
|
mOuter->RecomputePerspectiveChildrenOverflow(mOuter);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScheduleSyntheticMouseMove();
|
ScheduleSyntheticMouseMove();
|
||||||
|
@ -1437,7 +1437,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void ComputePreserve3DChildrenOverflow(nsOverflowAreas& aOverflowAreas);
|
void ComputePreserve3DChildrenOverflow(nsOverflowAreas& aOverflowAreas);
|
||||||
|
|
||||||
void RecomputePerspectiveChildrenOverflow(const nsIFrame* aStartFrame, const nsRect* aBounds);
|
void RecomputePerspectiveChildrenOverflow(const nsIFrame* aStartFrame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of ancestors between this and the root of our frame tree
|
* Returns the number of ancestors between this and the root of our frame tree
|
||||||
|
Loading…
Reference in New Issue
Block a user