aboutsummaryrefslogtreecommitdiff
path: root/ext/js/accessibility/google-docs-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-09-25 09:37:33 -0400
committerGitHub <noreply@github.com>2022-09-25 09:37:33 -0400
commit75d30594511a6593044565829ad55369fecaf4cd (patch)
tree7908a9ffc211f9d8b9342e98bd143a7dc09b500d /ext/js/accessibility/google-docs-util.js
parent8240482e9d0b6da7a996bc581c9b5304ebcf22aa (diff)
TextSource* API updates (#2236)
* Move TextSourceRange static functions to DocumentUtil getWritingMode is also simplified * Update Google Docs range to be empty to match other range sources * Rename imposterContainer to imposterElement * Add static creation functions * Add static creation function * Remove unused collapse function * Don't select imposter elements * Refactor setEndOffset * Adjust argument order for setEndOffset * Update TextSourceRange constructor * Remove unused isConnected * Cache rects * Fix test * Remove unused getRect * Revert "Fix test" * Remove cachedRect * Use the source element rect to handle scroll differences * Writing mode update * Remove _cachedRects update This shouldn't be necessary as the imposter is usually detached almost immediately after scanning, giving no time for the window to be resized or scrolled.
Diffstat (limited to 'ext/js/accessibility/google-docs-util.js')
-rw-r--r--ext/js/accessibility/google-docs-util.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/accessibility/google-docs-util.js b/ext/js/accessibility/google-docs-util.js
index e50ba652..12f2db24 100644
--- a/ext/js/accessibility/google-docs-util.js
+++ b/ext/js/accessibility/google-docs-util.js
@@ -87,7 +87,7 @@ class GoogleDocsUtil {
const range = this._getRangeWithPoint(content, x, y, normalizeCssZoom);
this._setImportantStyle(textStyle, 'pointer-events', 'none');
this._setImportantStyle(textStyle, 'opacity', '0');
- return new TextSourceRange(range, '', svgText, element);
+ return TextSourceRange.createFromImposter(range, svgText, element);
}
static _getRangeWithPoint(textNode, x, y, normalizeCssZoom) {
@@ -110,7 +110,7 @@ class GoogleDocsUtil {
}
}
range.setStart(textNode, start);
- range.setEnd(textNode, end);
+ range.setEnd(textNode, start);
return range;
}