Skip to content

[css-highlight-api][css-contain] static ranges and css-contain #4598

Closed
@frivoal

Description

@frivoal

The interaction of StaticRanges in a highlight range group and css-contain seems problematic: on a fully contained element, you should expect that DOM changes to descendants of that element will not cause invalidation and restyling/repainting of elements outside the contained one.

However, if a static range has a boundary point inside the contained subtree and another boundary point outside of it, and the DOM in the contained subtree is changed so that the boundary point inside no longer points to a valid node, the whole range should be ignored, which would affect painting outside the contained subtree. Is this a weakness of style containment, or of the invalidation logic in https://drafts.csswg.org/css-highlight-api-1/#range-invalidation, or something else?

Maybe we need to say that static ranges cannot cross the boundary of a contained element, either making it always invalid, or equivalent to a static range starting at its specified starting point, but truncated at the contained element boundary? or something else?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions