Merge pull request #15031 from Snuffleupagus/prefer-modern-dom-apis
Enable the `unicorn/prefer-modern-dom-apis` ESLint plugin rule
This commit is contained in:
commit
1a6ae5f034
@ -55,6 +55,7 @@
|
|||||||
"unicorn/prefer-date-now": "error",
|
"unicorn/prefer-date-now": "error",
|
||||||
"unicorn/prefer-dom-node-append": "error",
|
"unicorn/prefer-dom-node-append": "error",
|
||||||
"unicorn/prefer-dom-node-remove": "error",
|
"unicorn/prefer-dom-node-remove": "error",
|
||||||
|
"unicorn/prefer-modern-dom-apis": "error",
|
||||||
"unicorn/prefer-string-starts-ends-with": "error",
|
"unicorn/prefer-string-starts-ends-with": "error",
|
||||||
|
|
||||||
// Possible errors
|
// Possible errors
|
||||||
|
@ -133,7 +133,7 @@ function updateEmbedElement(elem) {
|
|||||||
elem.type = "text/html";
|
elem.type = "text/html";
|
||||||
elem.src = getEmbeddedViewerURL(elem.src);
|
elem.src = getEmbeddedViewerURL(elem.src);
|
||||||
if (parentNode) {
|
if (parentNode) {
|
||||||
parentNode.insertBefore(elem, nextSibling);
|
nextSibling.before(elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2559,9 +2559,9 @@ class AnnotationLayer {
|
|||||||
if (!firstChild) {
|
if (!firstChild) {
|
||||||
element.append(canvas);
|
element.append(canvas);
|
||||||
} else if (firstChild.nodeName === "CANVAS") {
|
} else if (firstChild.nodeName === "CANVAS") {
|
||||||
element.replaceChild(canvas, firstChild);
|
firstChild.replaceWith(canvas);
|
||||||
} else {
|
} else {
|
||||||
element.insertBefore(canvas, firstChild);
|
firstChild.before(canvas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
annotationCanvasMap.clear();
|
annotationCanvasMap.clear();
|
||||||
|
@ -627,7 +627,7 @@ class PDFPageView {
|
|||||||
|
|
||||||
if (lastDivBeforeTextDiv) {
|
if (lastDivBeforeTextDiv) {
|
||||||
// The annotation layer needs to stay on top.
|
// The annotation layer needs to stay on top.
|
||||||
div.insertBefore(canvasWrapper, lastDivBeforeTextDiv);
|
lastDivBeforeTextDiv.before(canvasWrapper);
|
||||||
} else {
|
} else {
|
||||||
div.append(canvasWrapper);
|
div.append(canvasWrapper);
|
||||||
}
|
}
|
||||||
@ -640,7 +640,7 @@ class PDFPageView {
|
|||||||
textLayerDiv.style.height = canvasWrapper.style.height;
|
textLayerDiv.style.height = canvasWrapper.style.height;
|
||||||
if (lastDivBeforeTextDiv) {
|
if (lastDivBeforeTextDiv) {
|
||||||
// The annotation layer needs to stay on top.
|
// The annotation layer needs to stay on top.
|
||||||
div.insertBefore(textLayerDiv, lastDivBeforeTextDiv);
|
lastDivBeforeTextDiv.before(textLayerDiv);
|
||||||
} else {
|
} else {
|
||||||
div.append(textLayerDiv);
|
div.append(textLayerDiv);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user