From the "NS_ASSERTION(mFloatManager)" statement in BlockReflowInput's
constructor, we know that BlockReflowInput's mFloatManager is always valid
and equals to aReflowInput.mFloatManager. Therefore, we could just use
ReflowInput's float manager in BlockReflowInput.
Due to the removal of BlockReflowInput's mFloatManager, the logic which
resets mFloatManager near the end of nsBlockFrame::Reflow() is removed as
well. It's safe because beyond that point, no other logic involves floats,
and |state| (i.e. BlockReflowInput) lives only on the stack.
MozReview-Commit-ID: 3dwXMnWkEI6
--HG--
extra : rebase_source : 7f9af1af10fd54456450b23bc0004dd5f15db4e4
Per spec, float positioning and stacking is not affected by defining a float
area with a shape.
https://drafts.csswg.org/css-shapes/#relation-to-box-model-and-float-behavior
So all the call sites of GetFloatAvailableSpace() related to adding a
float are replaced by GetFloatAvailableSpaceForPlacingFloat().
<shape-box> with border-radius will be implemented in next part.
MozReview-Commit-ID: 1RXEeXDhdWo
--HG--
extra : rebase_source : 42cdb0c81b16168e4e30ee2261ceccb562e278cf
In nsBlockFrame::PlaceLine(), we query the float available space by
using the line's BSize(), which may cause the line to reflow again due
to available space shrunk.
The first issue lies in the second reflow. That is, we do not leverage
the line's BSize() computed in the first reflow to query the float
available space when updating the inline reflow engine in
BlockReflowInput::AddFloat(). So some tall inline elements could still
overlap the floats as in the first reflow.
To solve this, we cache current line's BSize so that it could be
used to update the inline reflow engine when redo the line.
Another issue is in nsBlockFrame::PlaceLine(). When determined whether
the available space is shrunk, we use the float manager's state *before*
placing the line. So if current line has floats, they're not considered.
To solve this, we use the current set of floats to get the float available
space for comparison, and leave the original aFloatAvailableSpace to provide
the information when redoing the line.
MozReview-Commit-ID: GqqNlphgxYS
--HG--
extra : rebase_source : e2c64ab1ac363c7a08e532dc043bee69d6455049
After using enum class, a switch-case warning in CombineBreakType is caught.
This is one of such kind safty checks that we would like to gain.
Fix it by adding default case for switch-case in CombineBreakType.
MozReview-Commit-ID: BdS3LPN6qzX
--HG--
extra : rebase_source : 17f24a0d482ed6eb51b23e6942d0ac1c87375e0b