DescriptionBefore turning objects into spanners, check that they are not already spanners.
During style recalculation, we may end up in a situation where we think that we
go from a state where an object couldn't contain spanners, to being able to
contain them, while in reality, the object was able to contain spanners all
along.
This happens when changing the writing mode on the multicol container and all
objects in the parent chain between the spanner and the multicol container (and
there is nothing that prevents the descendant from being a spanner). The
problem is that when determining whether an object is a writing mode root, we
compare the object's writing mode to that of its parent. If they are different,
we decide that it's a writing mode root. However, if we're in styleWillChange()
for said object, and its writing mode is actually about to change to the same
value as that of the parent, there'll be no writing mode root in the end.
Still, we're going to think that we used to be a writing mode root (i.e. not be
able to contain spanners).
It would be possible to fix it for writing mode roots, to provide a reliable
implementation of isWritingModeRoot(), by using a bit in LayoutObject to
specify whether it's a writing mode root, rather than using current computed
style to determine that. Using computed style during style recalculation is
risky. That said, it's probably better to be fault-tolerant for such situations
in toggleSpannersInSubtree() instead, especially since may be other (unknown,
at the time being) scenarios where this situation may occur.
BUG=662754
Committed: https://crrev.com/3a83cc34b92519d437c479e2e88f69589ebc5427
Cr-Commit-Position: refs/heads/master@{#430887}
Patch Set 1 #
Messages
Total messages: 12 (7 generated)
|