summaryrefslogtreecommitdiff
path: root/ext/fg/js/text-source-range.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/text-source-range.js')
-rw-r--r--ext/fg/js/text-source-range.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/fg/js/text-source-range.js b/ext/fg/js/text-source-range.js
index 60086e7f..377016da 100644
--- a/ext/fg/js/text-source-range.js
+++ b/ext/fg/js/text-source-range.js
@@ -41,6 +41,13 @@ class TextSourceRange {
return this._imposterSourceElement;
}
+ get isConnected() {
+ return (
+ this._range.startContainer.isConnected &&
+ this._range.endContainer.isConnected
+ );
+ }
+
clone() {
return new TextSourceRange(this._range.cloneRange(), this._content, this._imposterContainer, this._imposterSourceElement);
}
@@ -74,6 +81,11 @@ class TextSourceRange {
return length - state.remainder;
}
+ collapse(toStart) {
+ this._range.collapse(toStart);
+ this._content = '';
+ }
+
getRect() {
return this._range.getBoundingClientRect();
}