[whatwg/dom] Add validity criteria for StaticRange (#1009)

Add criteria defining whether a StaticRange is valid.

This will be used by the CSS [Highlight API](https://drafts.csswg.org/css-highlight-api-1/) to determine whether or not to paint highlights specified by StaticRanges. See https://drafts.csswg.org/css-highlight-api-1/#range-invalidation (which will be updated to point to the DOM spec definition) and the CSSWG [resolution](https://github.com/w3c/csswg-drafts/issues/4597#issuecomment-905688814) that Highlight API should use StaticRanges internally rather than backing them with live Ranges.

Resolves #947.

- [X] At least two implementers are interested (and none opposed):
   * Chromium has implemented Highlight API based on StaticRange using this validity criteria. 
   * Webkit has implemented an experimental version of Highlight API, and agreed to the use of StaticRange per the [resolution notes](https://github.com/w3c/csswg-drafts/issues/4597#issuecomment-905688814).
- [X] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://github.com/web-platform-tests/wpt/blob/master/css/css-highlight-api/painting/
     * Note, the validity criteria aren't exposed directly, but these Highlight API painting tests depend on the validity criteria to 
       determine when to paint or paint a given StaticRange. See in particular custom-highlight-painting-invalidation-*.html
- [X] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed (for Highlight API):
   * Chrome: [crbug.com/1164461](https://crbug.com/1164461)
   * Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1703961
   * Safari: https://bugs.webkit.org/show_bug.cgi?id=204903

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/1009

-- Commit Summary --

  * Add validity criteria for StaticRange

-- File Changes --

    M dom.bs (16)

-- Patch Links --

https://github.com/whatwg/dom/pull/1009.patch
https://github.com/whatwg/dom/pull/1009.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1009

Received on Friday, 27 August 2021 21:38:34 UTC