Re-design clip/spatial API for simplicity
jbonisteel opened this issue · comments
There's a few things I want to try here, and not sure how they'll pan out:
- Make ClipChain into a single clip, use parenting for all relationships
- Eliminate ClipChain in favour of direct clip parenting
- OR remove clip parenting
- If ClipChain/Clip distinction is to be preserved:
- Make ClipId only Clips, and not ClipChains
- Make ClipChains only contain ClipIds
- Make items only clipped by ClipChainIds
- Pull image masks out of clips, make them into a kind of Filter (since they're similar to the Opacity filter)
- Factor out SpatialTree and ClipTree from the display list as explicit seperate structures, so that SceneBuilding doesn't need to untangle them itself
- Break StackingContexts into FilterItem, BlendItem, and Picture to make a clearer seperation of concerns..?
Properties that are True about the web, which we might be relying on and which we might want to enforce at the API level:
- All items in the same StackingContext must be part of the same ReferenceFrame (but not necessarily the same ScrollFrame..?)
- One should only ever be clipped by a clip in an ancestor stacking context
- One should only ever be clipped by a clip in the same stacking context (ancestor clipping handled by the fact that the stacking context itself will clip you)
via @mstange
maybe rephrase as: "Items in a stacking context (which are always part of the same reference frame) should only be clipped by clips in that same reference frame"
and "When a clip from an ancestor reference frame needs to be applied, this clip needs to be set on an ancestor stacking context, and then the stacking context will clip you."
@Gankra I think a better place to post the technical details would be in the corresponding bugzilla issue, to which we'd link from here.
yes, i moved to https://bugzilla.mozilla.org/show_bug.cgi?id=1615646