Skip to content

Commit

Permalink
Move proposed changes to Range interface (#565)
Browse files Browse the repository at this point in the history
* Move proposed changes to Range

* Adjust code example
  • Loading branch information
dlibby- authored Apr 21, 2022
1 parent e40fc8a commit 798996d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions RangeInnerText/explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ async function initiateSpellcheck(editableRegion) {

// `results` is an array of misspelled word + code unit offsets.
results.forEach((result) => {
let misspelling = new StaticRange(range);
let misspelling = new Range(range);
misspelling.adjust("start", result.offset);
misspelling.collapse(/*toStart*/ true);
misspelling.adjust("end", result.text.length);

// Add misspelling range to highlight map so that the
// squiggles are drawn underneath via Highlight API.
CSS.highlights.set("misspellings", new Highlight(mispelling));
CSS.highlights.set("misspellings", new Highlight(new StaticRange(mispelling)));
});
});
}
Expand All @@ -128,7 +128,7 @@ enum Endpoint {
"end"
}
partial interface AbstractRange {
partial interface Range {
readonly DOMString innerText;
void adjust(Endpoint endpoint, long codeunits);
}
Expand Down

0 comments on commit 798996d

Please sign in to comment.