@@ -100,7 +100,7 @@ Introduction</h2>
100
100
r.setStart(document.body, 0);
101
101
r.setEnd(document.body, 2);
102
102
103
- CSS.highlights.add(new Highlight("example-highlight", [r] ));
103
+ CSS.highlights.add(new Highlight("example-highlight", r ));
104
104
</script>
105
105
</xmp>
106
106
@@ -149,7 +149,7 @@ Creating Custom Highlights</h3>
149
149
<dfn interface>Highlight</dfn> objects,
150
150
[=setlike=] objects whose [=set entries=] are {{AbstractRange}} objects.
151
151
[=Ranges=] can be added to a [=custom highlight=]
152
- either by passing a [=sequence=] of them to its constructor,
152
+ either by passing them to its constructor,
153
153
or by using the usual API of [=setlike=] objects
154
154
to manipulate its [=set entries=] .
155
155
@@ -164,7 +164,7 @@ Creating Custom Highlights</h3>
164
164
<xmp class="idl">
165
165
[Exposed=Window]
166
166
interface Highlight {
167
- constructor(CSSOMString name, optional sequence< AbstractRange> initialRanges = [] );
167
+ constructor(CSSOMString name, AbstractRange... initialRanges);
168
168
setlike<AbstractRange>;
169
169
attribute CSSStyleDeclaration style;
170
170
attribute double priority;
@@ -176,7 +176,7 @@ Creating Custom Highlights</h3>
176
176
and [[#style-attr]] for more information on the {{Highlight/style}} attribute.
177
177
178
178
<div algorithm="to create a custom highlight">
179
- When the <dfn for=Highlight constructor>Highlight(CSSOMString name, optional sequence< AbstractRange> initialRanges = [] )</dfn> constructor is invoked,
179
+ When the <dfn for=Highlight constructor>Highlight(CSSOMString name, AbstractRange... initialRanges)</dfn> constructor is invoked,
180
180
run the following steps:
181
181
182
182
<ol>
@@ -296,7 +296,7 @@ Default Styling of a Custom Highlight</h3>
296
296
r.setStart(document.body, 0);
297
297
r.setEnd(document.body, 2);
298
298
299
- let h = new Highlight("inline-highlight", [r] );
299
+ let h = new Highlight("inline-highlight", r );
300
300
h.style.backgroundColor = "yellow";
301
301
h.style.color = "blue";
302
302
@@ -376,7 +376,7 @@ Painting</h4>
376
376
r2.setStart(document.body, 3);
377
377
r2.setEnd(document.body, 7);
378
378
379
- CSS.highlights.add(new Highlight("sample", [ r1, r2] ));
379
+ CSS.highlights.add(new Highlight("sample", r1, r2));
380
380
</script>
381
381
</xmp>
382
382
@@ -457,8 +457,8 @@ Priority of Overlapping Highlights</h4>
457
457
r2.setStart(document.body, 3);
458
458
r2.setEnd(document.body, 9);
459
459
460
- CSS.highlights.add(new Highlight("foo", [r1] ));
461
- CSS.highlights.add(new Highlight("bar", [r2] ));
460
+ CSS.highlights.add(new Highlight("foo", r1 ));
461
+ CSS.highlights.add(new Highlight("bar", r2 ));
462
462
</script>
463
463
</xmp>
464
464
0 commit comments