Refactor the container/viewer checks in the BaseViewer constructor

The previous checks prevented specifying a container/viewer that was in another
document/window.
Fixes #12385
This commit is contained in:
Jonathan Grimes 2020-09-17 12:47:55 -05:00
parent 558d3870d3
commit d37a445369

View File

@ -150,8 +150,10 @@ class BaseViewer {
) {
if (
!(
this.container instanceof HTMLDivElement &&
this.viewer instanceof HTMLDivElement
this.container &&
this.container.tagName.toUpperCase() === "DIV" &&
this.viewer &&
this.viewer.tagName.toUpperCase() === "DIV"
)
) {
throw new Error("Invalid `container` and/or `viewer` option.");