Bug 1359834 Part 3: Force changes to shape-outside to trigger reflow and overflow recalculation.
MozReview-Commit-ID: 7EgYZIu7aZ9
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3526,16 +3526,37 @@ nsStyleDisplay::CalcDifference(const nsS
* if this does become common perhaps a faster-path might be worth while.
*/
if (mFloat != aNewData.mFloat) {
// Changing which side we're floating on (float:none was handled above).
hint |= nsChangeHint_ReflowHintsForFloatAreaChange;
}
+ if (!mShapeOutside.DefinitelyEquals(aNewData.mShapeOutside)) {
+ if (aNewData.mFloat != StyleFloat::None) {
+ // If we are floating, and our shape-outside property changes, our
+ // descendants are not impacted, but our ancestor and siblings are.
+ // This is similar to a float-only change, but since the ISize of the
+ // float area changes arbitrarily along its block axis, more is required
+ // to get the siblings to adjust properly. Hinting overflow change is
+ // sufficient to trigger the correct calculation, but may be too
+ // heavyweight.
+
+ // XXX What is the minimum hint to ensure mShapeInfo is regenerated in
+ // the next reflow?
+ hint |= nsChangeHint_ReflowHintsForFloatAreaChange |
+ nsChangeHint_CSSOverflowChange;
+ } else {
+ // shape-outside changed, but we don't need to reflow because we're not
+ // floating.
+ hint |= nsChangeHint_NeutralChange;
+ }
+ }
+
if (mVerticalAlign != aNewData.mVerticalAlign) {
// XXX Can this just be AllReflowHints + RepaintFrame, and be included in
// the block below?
hint |= NS_STYLE_HINT_REFLOW;
}
// XXX the following is conservative, for now: changing float breaking shouldn't
// necessarily require a repaint, reflow should suffice.
@@ -3685,18 +3706,17 @@ nsStyleDisplay::CalcDifference(const nsS
mAnimationTimingFunctionCount != aNewData.mAnimationTimingFunctionCount ||
mAnimationDurationCount != aNewData.mAnimationDurationCount ||
mAnimationDelayCount != aNewData.mAnimationDelayCount ||
mAnimationNameCount != aNewData.mAnimationNameCount ||
mAnimationDirectionCount != aNewData.mAnimationDirectionCount ||
mAnimationFillModeCount != aNewData.mAnimationFillModeCount ||
mAnimationPlayStateCount != aNewData.mAnimationPlayStateCount ||
mAnimationIterationCountCount != aNewData.mAnimationIterationCountCount ||
- mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate ||
- !mShapeOutside.DefinitelyEquals(aNewData.mShapeOutside))) {
+ mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate)) {
hint |= nsChangeHint_NeutralChange;
}
return hint;
}
// --------------------
// nsStyleVisibility