Skip to content

Commit e1da994

Browse files
authored
Merge pull request #6003 from sanketj/highlightsregister-to-highlightregistry
[css-highlight-api-1] Rename HighlightsRegister to HighlightRegistry
2 parents e937d96 + 7a0d4b3 commit e1da994

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

css-highlight-api-1/Overview.bs

+14-14
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Introduction</h2>
8686
<div id=intro-ex class=example>
8787
The following code uses the ''::highlight()'' pseudo-element
8888
to apply a yellow background and blue foreground color to the text <q>One two</q>.
89-
It does so by adding a {{Highlight}} to the {{HighlightsRegister}}
89+
It does so by adding a {{Highlight}} to the {{HighlightRegistry}}
9090
(both of these are new concepts introduced by this specification).
9191
The {{Highlight}} will contain a {{Range}} whose boundary points surround the text <q>One two</q>.
9292

@@ -207,36 +207,36 @@ Registering Custom Highlights</h3>
207207

208208
In order to have any effect,
209209
[=custom highlights=] then needs to be
210-
[=registered=] it into the [=highlights register=].
210+
[=registered=] it into the [=highlight registry=].
211211

212-
The <dfn>highlights register</dfn> is accessed via the {{CSS/highlights}} attribute of the {{CSS}} namespace,
212+
The <dfn>highlight registry</dfn> is accessed via the {{CSS/highlights}} attribute of the {{CSS}} namespace,
213213
and represents all the [=custom highlights=] [=registered=] for the [=current global object=]’s [=associated Document=].
214214
It is a [=setlike=], and can be updated using the usual methods.
215215
It's [=set entries=] is initially empty.
216216

217217
A [=custom highlight=] is said to be <dfn>registered</dfn>
218-
if it is in the [=highlights register=].
218+
if it is in the [=highlight registry=].
219219
It stops being [=registered=] if it is later removed.
220220

221221
<xmp class="idl">
222222
partial namespace CSS {
223-
readonly attribute HighlightsRegister highlights;
223+
readonly attribute HighlightRegistry highlights;
224224
};
225225

226226
[Exposed=Window]
227-
interface HighlightsRegister {
227+
interface HighlightRegistry {
228228
setlike<Highlight>;
229-
HighlightsRegister add(Highlight value);
229+
HighlightRegistry add(Highlight value);
230230
};
231231
</xmp>
232232

233233
<div algorithm="to register a custom highlight">
234234
To [=register=] a [=custom highlight=],
235-
invoke the {{HighlightsRegister/add()}} of the [=highlights register=]
235+
invoke the {{HighlightRegistry/add()}} of the [=highlight registry=]
236236
with the [=custom highlight=] as the argument.
237237

238238
When invoked,
239-
the <dfn method for=HighlightsRegister>add(Highlight value)</dfn> method must run these steps:
239+
the <dfn method for=HighlightRegistry>add(Highlight value)</dfn> method must run these steps:
240240

241241
1. If there is already a [=set entry=] with the same {{Highlight/name}} as the {{Highlight/name}} of {{value}},
242242
then [=throw=] an {{"OperationError"}}.
@@ -405,7 +405,7 @@ Priority of Overlapping Highlights</h4>
405405
As there are no priorities set
406406
(i.e. there is a tie between <code>rg1</code> and <code>rg2</code>),
407407
the custom highlights' styles are stacked
408-
in order of insertion into the [=highlights register=].
408+
in order of insertion into the [=highlight registry=].
409409
The rendered results will have "Som" with blue text on yellow background,
410410
"e t" with blue text on orange background,
411411
and "ext" with the default color on orange background.
@@ -431,7 +431,7 @@ Responding to Changes</h2>
431431
Repaints</h3>
432432

433433
The addition or removal
434-
of a [=custom highlight=] in the [=highlights register=],
434+
of a [=custom highlight=] in the [=highlight registry=],
435435
or of a [=range=] in a [registered=] [=custom highlight=],
436436
must cause the User Agent to reevaluate the rendering,
437437
and to repaint if appropriate.
@@ -482,7 +482,7 @@ Range Updating and Invalidation</h3>
482482

483483
When computing how to render the document,
484484
if [=start node=] or [=end node=] of any [=range=]
485-
in the [=highlights register=]
485+
in the [=highlight regsitry=]
486486
refer to a {{Node}} which is no longer [=in a document tree=],
487487
the User Agent must ignored that [=range=].
488488
If the [=start offset=] or [=end offset=] of any [=range=]
@@ -558,11 +558,11 @@ Appendix C. Changes</h2>
558558
<!-- This text from the explainer seems useful, and should go somewhere. But where?
559559
----
560560
If there are DOM/CSS changes that result in a different cascaded highlight map for a given element,
561-
and there exists one or more Range objects in the highlights register for the cascaded identifiers,
561+
and there exists one or more Range objects in the highlight registry for the cascaded identifiers,
562562
the layout representation of that element should be notified that the painting of the element might have changed.
563563

564564
Ranges that are positioned inside of documents that are not in the view are ignored.
565565

566-
The HighlightsRegister is per-document — therefore, Ranges that are positioned inside of a different document than the HighlightsRegister it is a part of are ignored for rendering.
566+
The HighlightRegistry is per-document — therefore, Ranges that are positioned inside of a different document than the HighlightRegistry it is a part of are ignored for rendering.
567567
-->
568568

0 commit comments

Comments
 (0)