This is the bulk of the changes.
- DisplayItemScrollClip is removed. Instead, we will have 1) ActiveScrolledRoot
and 2) DisplayItemClipChain.
- ActiveScrolledRoot points to a scroll frame and allows traversing up the
scroll frame chain.
- DisplayItemClipChain is a linked list of clips, each clip being associated
with the ActiveScrolledRoot that moves this clip.
- Each display item has an ActiveScrolledRoot and a clip chain.
- nsDisplayItem::GetClip returns the item of the clip chain that scrolls with
the item's ASR. The separation between "regular clip" and "scroll clips"
mostly goes away.
- Tracking clips in the display list builder's clip state happens very
similarly to how regular clips used to be tracked - there's a clip chain for
content descendants and a clip chain for containing block descendants. These
clip chains are intersected to create the combined clip chain.
- There are strict rules for the ASR of a container item: A container item's
ASR should be the innermost ASR which the item has finite clipped bounds with
respect to.
- At some point in the future, ASRs and AGRs should be reunified, but I haven't
done that yet, because I needed to limit the scope of the change.
MozReview-Commit-ID: KYEpWY7qgf2
--HG--
extra : rebase_source : c727f6300a35463750639e165bfa37374c06b851
The asserts are:
###!!! ASSERTION: Bounds computation mismatch: 'mContainerBounds.IsEqualInterior(mAccumulatedChildBounds)', /layout/base/FrameLayerBuilder.cpp, line 4887
###!!! ASSERTION: bad aListVisibleBounds: 'r.GetBounds().IsEqualInterior(aListVisibleBounds)', /layout/base/nsDisplayList.cpp, line 1637
They happen because we have a wrap list item that contains an out of flow frame with no saved clip data. So the patch for this bug changes the scroll clip of the wrap list item from the scroll clip induced by the root scroll frame to the null scroll clip. All of the display items that the wrap list contains have the root scroll frame scroll clip, so this causes the scroll clipped bounds for the wrap list item to expand to the whole content area. These expanded bounds of the wrap list item get incorporated into the bounds of a parent transform item. Later the wrap list item is flattened away, and so it's no longer around to provide the expanded bounds, leading to the assertions.
I've thought through options like changing how scroll clipped bounds work for wrap list items, but I can't seem to find any solution that would be consistent. The best thing would be to get the proper clip on out of flows we are going to descend into, but I can't think of a good way to do that either in this case (or in general).
The asserts are:
###!!! ASSERTION: Bounds computation mismatch: 'mContainerBounds.IsEqualInterior(mAccumulatedChildBounds)', /layout/base/FrameLayerBuilder.cpp, line 4887
###!!! ASSERTION: bad aListVisibleBounds: 'r.GetBounds().IsEqualInterior(aListVisibleBounds)', /layout/base/nsDisplayList.cpp, line 1637
They happen because we have a wrap list item that contains an out of flow frame with no saved clip data. So the patch for this bug changes the scroll clip of the wrap list item from the scroll clip induced by the root scroll frame to the null scroll clip. All of the display items that the wrap list contains have the root scroll frame scroll clip, so this causes the scroll clipped bounds for the wrap list item to expand to the whole content area. These expanded bounds of the wrap list item get incorporated into the bounds of a parent transform item. Later the wrap list item is flattened away, and so it's no longer around to provide the expanded bounds, leading to the assertions.
I've thought through options like changing how scroll clipped bounds work for wrap list items, but I can't seem to find any solution that would be consistent. The best thing would be to get the proper clip on out of flows we are going to descend into, but I can't think of a good way to do that either in this case (or in general).