mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1495169 - Remove cached measuring reflows if we aren't measuring the right thing because we got interrupted. r=dholbert
If we're waiting on an interrupt, then our child items haven't been totally reflowed and our measures would be bogus. This will probably regress performance in the cases bug 1209697 fixed, so we should probably add an interrupt check somewhere in nsFlexContainerFrame to avoid keeping reflowing flex containers indefinitely. We could probably just bail out from our reflow if any kid reflow was interrupted. Filed bug 1495532 to consider that. Differential Revision: https://phabricator.services.mozilla.com/D7288 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c4cd1af1d7
commit
eed1014705
@ -4324,6 +4324,24 @@ FlexLine::PositionItemsInCrossAxis(nscoord aLineStartPosition,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsFlexContainerFrame::DidReflow(nsPresContext* aPresContext,
|
||||
const ReflowInput* aReflowInput)
|
||||
{
|
||||
// Remove the cached values if we got an interrupt because the values will be
|
||||
// the wrong ones for following reflows.
|
||||
//
|
||||
// TODO(emilio): Can we do this only for the kids that are interrupted? We
|
||||
// probably want to figure out what the right thing to do here is regarding
|
||||
// interrupts, see bug 1495532.
|
||||
if (aPresContext->HasPendingInterrupt()) {
|
||||
for (nsIFrame* frame : mFrames) {
|
||||
frame->DeleteProperty(CachedFlexMeasuringReflow());
|
||||
}
|
||||
}
|
||||
nsContainerFrame::DidReflow(aPresContext, aReflowInput);
|
||||
}
|
||||
|
||||
void
|
||||
nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
|
@ -125,6 +125,8 @@ public:
|
||||
const ReflowInput& aReflowInput,
|
||||
nsReflowStatus& aStatus) override;
|
||||
|
||||
void DidReflow(nsPresContext*, const ReflowInput*) final;
|
||||
|
||||
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user