Invalidate the cached flow length when the next-in-flow/continuation changes.

This commit is contained in:
Pale Moon
2017-04-21 22:21:30 +02:00
committed by roytam1
parent 22f525fd68
commit 7648075df1
+11 -1
View File
@@ -87,6 +87,9 @@ public:
mNextContinuation = aNextContinuation;
if (aNextContinuation)
aNextContinuation->RemoveStateBits(NS_FRAME_IS_FLUID_CONTINUATION);
// Setting a non-fluid continuation might affect our flow length (they're
// quite rare so we assume it always does) so we delete our cached value:
GetContent()->DeleteProperty(nsGkAtoms::flowlength);
}
virtual nsIFrame* GetNextInFlowVirtual() const override { return GetNextInFlow(); }
nsIFrame* GetNextInFlow() const {
@@ -99,8 +102,15 @@ public:
NS_ASSERTION (!nsSplittableFrame::IsInNextContinuationChain(aNextInFlow, this),
"creating a loop in continuation chain!");
mNextContinuation = aNextInFlow;
if (aNextInFlow)
if (mNextContinuation &&
!mNextContinuation->HasAnyStateBits(NS_FRAME_IS_FLUID_CONTINUATION)) {
// Changing from non-fluid to fluid continuation might affect our flow
// length, so we delete our cached value:
GetContent()->DeleteProperty(nsGkAtoms::flowlength);
}
if (aNextInFlow) {
aNextInFlow->AddStateBits(NS_FRAME_IS_FLUID_CONTINUATION);
}
}
virtual nsIFrame* LastInFlow() const override;
virtual nsIFrame* LastContinuation() const override;