W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2019

[csswg-drafts] [css-highlight-api]: Highlight constructor should accept 0 or more AbstractRanges instead of an optional sequence (#4620)

From: Sanket Joshi via GitHub <sysbot+gh@w3.org>
Date: Fri, 20 Dec 2019 08:09:35 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-540843852-1576829374-sysbot+gh@w3.org>
sanketj has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-highlight-api]: Highlight constructor should accept 0 or more AbstractRanges instead of an optional sequence ==
This can be achieved with the `...` syntax, like append/prepend use here: https://dom.spec.whatwg.org/#parentnode. If more than one highlight need to be added, they can be specified with additional parameters. This will avoid having to create a sequence when creating a Highlight with one range object.
So we would be able to do:
```
    let highlightRange = new Range();
    let highlight = new Highlight('example-highlight', **highlightRange**);
    CSS.highlights.add(highlight);
```
instead of:
```
    let highlightRange = new Range();
    let highlight = new Highlight('example-highlight', **[highlightRange]**);
    CSS.highlights.add(highlight);
```

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4620 using your GitHub account
Received on Friday, 20 December 2019 08:09:37 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:27:05 UTC