W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2021

Re: [csswg-drafts] [css-highlight-api] invalidation of static ranges (#4597)

From: Dan Clark via GitHub <sysbot+gh@w3.org>
Date: Mon, 30 Aug 2021 16:59:53 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-908512815-1630342792-sysbot+gh@w3.org>
> It is unclear to me from the resolution how using Static Ranges works if one modifies DOM. If one has 2 sibling nodes, and a StaticRange selecting them both, and then one add a new node between those siblings, StaticRange would select the first two ones, but not the last node, yet it is the last node which the user of the API wanted to be selected. Rather odd API behavior.

For StaticRange, the developer has the responsibility to update the ranges when DOM mutations occur. So if the developer fails to do this, they'll observe odd behavior like in the case you pointed out. There is a deliberate tradeoff here between between ease-of-use and performance for live range vs static range.

GitHub Notification of comment by dandclark
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4597#issuecomment-908512815 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 30 August 2021 16:59:55 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:43 UTC