Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the container/viewer checks in the BaseViewer constructor #12388

Merged
merged 1 commit into from
Sep 17, 2020
Merged

Refactor the container/viewer checks in the BaseViewer constructor #12388

merged 1 commit into from
Sep 17, 2020

Conversation

jsg2021
Copy link
Contributor

@jsg2021 jsg2021 commented Sep 17, 2020

Fixes #12385

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution implemented here feels way too complex, considering that the purpose of these checks were simply to catch outright user error. Can this be implemented simpler, e.g. by just checking the tagName instead?

Furthermore, note that the existing checks are only relevant for one particular build and consequently we do not want to add this code in e.g. MOZCENTRAL builds.

@jsg2021 jsg2021 changed the title use the correct instance when checking of HTMLDivElement type More simple container/viewer checks Sep 17, 2020
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve the commit message, since it's currently a bit difficult to tell what the patch does without looking at the code and the linked issue.

For example, something like "Refactor the container/viewer checks in the BaseViewer constructor" might work. Furthermore, please also explain in the commit message why these changes are necessary; by mentioning the iframe use-case.

web/base_viewer.js Outdated Show resolved Hide resolved
@jsg2021
Copy link
Contributor Author

jsg2021 commented Sep 17, 2020

Sure thing! :)

@jsg2021 jsg2021 changed the title More simple container/viewer checks Refactor the container/viewer checks in the BaseViewer constructor Sep 17, 2020
web/base_viewer.js Outdated Show resolved Hide resolved
The previous checks prevented specifying a container/viewer that was in another
document/window.
Fixes #12385
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/9340338045b1e3a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/9340338045b1e3a/output.txt

Total script time: 3.53 mins

Published

@timvandermeij timvandermeij merged commit 802b4c0 into mozilla:master Sep 17, 2020
@timvandermeij
Copy link
Contributor

Looks good to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Viewer Constructor blocks remote rendering
5 participants