aboutsummaryrefslogtreecommitdiff
path: root/ext/js/dom
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/dom')
-rw-r--r--ext/js/dom/text-source-generator.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/js/dom/text-source-generator.js b/ext/js/dom/text-source-generator.js
index 68bf036a..c4711411 100644
--- a/ext/js/dom/text-source-generator.js
+++ b/ext/js/dom/text-source-generator.js
@@ -462,6 +462,7 @@ export class TextSourceGenerator {
* @returns {?Range}
*/
_caretPositionFromPointNormalizeStyles(x, y, nextElement) {
+ /** @type {Map<Element, ?string>} */
const previousStyles = new Map();
try {
while (true) {
@@ -490,7 +491,7 @@ export class TextSourceGenerator {
// Elements with user-select: all will return the element
// instead of a text point inside the element.
if (this._isElementUserSelectAll(/** @type {Element} */ (node))) {
- if (previousStyles.has(node)) {
+ if (previousStyles.has(/** @type {Element} */ (node))) {
// Recursive
return null;
}
@@ -524,6 +525,7 @@ export class TextSourceGenerator {
* @returns {?Range}
*/
_caretRangeFromPointExt(x, y, elements, normalizeCssZoom) {
+ /** @type {?Map<Element, ?string>} */
let previousStyles = null;
try {
let i = 0;