From 12c3fd32a28b2e723798458f418dbcb6367891f6 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Wed, 12 Jul 2017 12:28:29 -0700 Subject: [PATCH] Bug 1359834 Part 1: Force changes to shape-outside to trigger float reflow, similar to other float changes. r=dholbert MozReview-Commit-ID: 7EgYZIu7aZ9 --HG-- extra : rebase_source : a611fcd77d926f1076dfa38b9b7ebf732021aa46 --- layout/style/nsStyleStruct.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index e4d7d4e21b7d..84a75ef68cd4 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -3527,12 +3527,22 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const } if (mFloat != aNewData.mFloat) { - // Changing which side we float on doesn't affect descendants directly + // Our descendants aren't impacted when our float area only changes + // placement but not size/shape. (e.g. if we change which side we float to). + // But our ancestors/siblings are potentially impacted, so we need to send + // the non-descendant reflow hints. hint |= nsChangeHint_AllReflowHints & ~(nsChangeHint_ClearDescendantIntrinsics | nsChangeHint_NeedDirtyReflow); } + if (aNewData.mFloat != StyleFloat::None && + !mShapeOutside.DefinitelyEquals(aNewData.mShapeOutside)) { + // If we are floating, and our shape-outside property changes, it requires + // the entire frame to be reconstructed. + hint |= nsChangeHint_ReconstructFrame; + } + if (mVerticalAlign != aNewData.mVerticalAlign) { // XXX Can this just be AllReflowHints + RepaintFrame, and be included in // the block below? @@ -3692,8 +3702,7 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const mAnimationFillModeCount != aNewData.mAnimationFillModeCount || mAnimationPlayStateCount != aNewData.mAnimationPlayStateCount || mAnimationIterationCountCount != aNewData.mAnimationIterationCountCount || - mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate || - !mShapeOutside.DefinitelyEquals(aNewData.mShapeOutside))) { + mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate)) { hint |= nsChangeHint_NeutralChange; }