[csswg-drafts] Pull Request: [css-highlight-api-1] Don't paint highlights that cross contain boundaries

sanketj has just labeled a pull request from dandclark for https://github.com/w3c/csswg-drafts as "css-highlight-api-1":

== [css-highlight-api-1] Don't paint highlights that cross contain boundaries ==
If a StaticRange crosses a `contain` boundary and the boundary point inside the contained element is removed, UAs would have to stop painting the full extent of the range. This would violate the `contain` invariant, since a change inside the element with `contain` would have affected the appearance of content outside of that element.

To eliminate this problem, never paint ranges that cross `contain` boundaries.

A slightly more scoped solution would be to apply this limitation only for highlights specified with `StaticRange`, but since there doesn't seem to be any use case for applying highlights across `contain` boundaries, the limitation is applied to live `Range`s as well for consistency's sake.

This PR changes the range-painting criteria into an algorithm, since precisely expressing the concept of "crossing a contain boundary" is clumsy in prose.

Resolves #4598.

See https://github.com/w3c/csswg-drafts/pull/6734


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 19 October 2021 00:37:48 UTC