aboutsummaryrefslogtreecommitdiff
path: root/ext/js/dom
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/dom')
-rw-r--r--ext/js/dom/document-util.js14
-rw-r--r--ext/js/dom/dom-text-scanner.js5
-rw-r--r--ext/js/dom/simple-dom-parser.js3
3 files changed, 10 insertions, 12 deletions
diff --git a/ext/js/dom/document-util.js b/ext/js/dom/document-util.js
index 549a8195..b2aa8f81 100644
--- a/ext/js/dom/document-util.js
+++ b/ext/js/dom/document-util.js
@@ -210,7 +210,7 @@ export class DocumentUtil {
*/
static computeZoomScale(node) {
if (this._cssZoomSupported === null) {
- // @ts-ignore - zoom is a non-standard property that exists in Chromium-based browsers
+ // @ts-expect-error - zoom is a non-standard property that exists in Chromium-based browsers
this._cssZoomSupported = (typeof document.createElement('div').style.zoom === 'string');
}
if (!this._cssZoomSupported) { return 1; }
@@ -387,11 +387,11 @@ export class DocumentUtil {
static getFullscreenElement() {
return (
document.fullscreenElement ||
- // @ts-ignore - vendor prefix
+ // @ts-expect-error - vendor prefix
document.msFullscreenElement ||
- // @ts-ignore - vendor prefix
+ // @ts-expect-error - vendor prefix
document.mozFullScreenElement ||
- // @ts-ignore - vendor prefix
+ // @ts-expect-error - vendor prefix
document.webkitFullscreenElement ||
null
);
@@ -808,7 +808,7 @@ export class DocumentUtil {
return document.caretRangeFromPoint(x, y);
}
- // @ts-ignore - caretPositionFromPoint is non-standard
+ // @ts-expect-error - caretPositionFromPoint is non-standard
if (typeof document.caretPositionFromPoint === 'function') {
// Firefox
return this._caretPositionFromPoint(x, y);
@@ -824,7 +824,7 @@ export class DocumentUtil {
* @returns {?Range}
*/
static _caretPositionFromPoint(x, y) {
- // @ts-ignore - caretPositionFromPoint is non-standard
+ // @ts-expect-error - caretPositionFromPoint is non-standard
const position = /** @type {(x: number, y: number) => ?{offsetNode: Node, offset: number}} */ (document.caretPositionFromPoint)(x, y);
if (position === null) {
return null;
@@ -876,7 +876,7 @@ export class DocumentUtil {
nextElement.style.setProperty('user-select', 'text', 'important');
}
- // @ts-ignore - caretPositionFromPoint is non-standard
+ // @ts-expect-error - caretPositionFromPoint is non-standard
const position = /** @type {(x: number, y: number) => ?{offsetNode: Node, offset: number}} */ (document.caretPositionFromPoint)(x, y);
if (position === null) {
return null;
diff --git a/ext/js/dom/dom-text-scanner.js b/ext/js/dom/dom-text-scanner.js
index 3a785680..42e0acc9 100644
--- a/ext/js/dom/dom-text-scanner.js
+++ b/ext/js/dom/dom-text-scanner.js
@@ -520,11 +520,10 @@ export class DOMTextScanner {
static isStyleSelectable(style) {
return !(
style.userSelect === 'none' ||
- // @ts-ignore - vendor prefix
style.webkitUserSelect === 'none' ||
- // @ts-ignore - vendor prefix
+ // @ts-expect-error - vendor prefix
style.MozUserSelect === 'none' ||
- // @ts-ignore - vendor prefix
+ // @ts-expect-error - vendor prefix
style.msUserSelect === 'none'
);
}
diff --git a/ext/js/dom/simple-dom-parser.js b/ext/js/dom/simple-dom-parser.js
index a1f63890..bca1cd88 100644
--- a/ext/js/dom/simple-dom-parser.js
+++ b/ext/js/dom/simple-dom-parser.js
@@ -27,7 +27,7 @@ export class SimpleDOMParser {
*/
constructor(content) {
/** @type {import('parse5')} */
- // @ts-ignore - parse5 global is not defined in typescript declaration
+ // @ts-expect-error - parse5 global is not defined in typescript declaration
this._parse5Lib = /** @type {import('parse5')} */ (parse5);
/** @type {import('parse5').TreeAdapter<import('parse5').DefaultTreeAdapterMap>} */
this._treeAdapter = this._parse5Lib.defaultTreeAdapter;
@@ -131,7 +131,6 @@ export class SimpleDOMParser {
* @returns {boolean}
*/
static isSupported() {
- // @ts-ignore - parse5 global is not defined in typescript declaration
return typeof parse5 !== 'undefined';
}