aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/text-scanner.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-08-09 13:27:21 -0400
committerGitHub <noreply@github.com>2020-08-09 13:27:21 -0400
commit6da02c6eee803756d9a9075bfde333eeb31ce64b (patch)
tree158d81b89ca99095c06db31c1ebc7bb46a57c33a /ext/mixed/js/text-scanner.js
parent480e0e15e3109165d077c18985893d7cca79959e (diff)
document.js refactor (#719)
* Refactor document.js into a class * Move public functions first * Rename private functions * Rename * Rename argument * Use instance of DocumentUtil * Update tests * Refactor * Rename (test-)document.js to (test-)document-util.js
Diffstat (limited to 'ext/mixed/js/text-scanner.js')
-rw-r--r--ext/mixed/js/text-scanner.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index 61e9256d..923784b3 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -17,16 +17,16 @@
/* global
* DOM
- * docRangeFromPoint
*/
class TextScanner extends EventDispatcher {
- constructor({node, ignoreElements, ignorePoint, search}) {
+ constructor({node, ignoreElements, ignorePoint, search, documentUtil}) {
super();
this._node = node;
this._ignoreElements = ignoreElements;
this._ignorePoint = ignorePoint;
this._search = search;
+ this._documentUtil = documentUtil;
this._isPrepared = false;
this._ignoreNodes = null;
@@ -124,7 +124,7 @@ class TextScanner extends EventDispatcher {
return;
}
- const textSource = docRangeFromPoint(x, y, this._deepContentScan);
+ const textSource = this._documentUtil.getRangeFromPoint(x, y, this._deepContentScan);
try {
if (this._textSourceCurrent !== null && this._textSourceCurrent.equals(textSource)) {
return;