-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Remove the unused id
properties from page and thumbnail canvas/image DOM elements (issue 11499)
#11503
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e DOM elements (issue 11499) As described in the issue, having a DOM element with `id=page2` (or any other number) will automatically cause that element to become linkable through the URL hash. That's currently leading to some confusing and outright wrong behaviour, since it obviously only works for pages that have been loaded and rendered. For PDF documents the only officially supported way to reference a particular page through the URL hash is using the `#page=2` format, which also works for all pages regardless if they're loaded or not. As far as I can tell there's nothing in the PDF.js default viewer that actually depends on the page/thumbnail `id` at this point in time, hence why I believe that this removal ought to be safe. Just as a pre-caution this patch adds an `aria-label` to the page canvas, similar to the thumbnail canvas/image, to at least keep this information in the DOM.
…l10n messages in `PDFThumbnailView`
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/fd5e495fb320c47/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/fd5e495fb320c47/output.txt Total script time: 1.75 mins Published |
timvandermeij
approved these changes
Jan 12, 2020
Thank you for cleaning this up! |
MichielDG
pushed a commit
to MichielDG/pdf.js
that referenced
this pull request
Jan 17, 2020
Remove the unused `id` properties from page and thumbnail canvas/image DOM elements (issue 11499)
This was referenced Jun 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove the unused
id
properties from page and thumbnail canvas/image DOM elements (issue 11499)As described in the issue, having a DOM element with
id=page2
(or any other number) will automatically cause that element to become linkable through the URL hash. That's currently leading to some confusing and outright wrong behaviour, since it obviously only works for pages that have been loaded and rendered.For PDF documents the only officially supported way to reference a particular page through the URL hash is using the
#page=2
format, which also works for all pages regardless if they're loaded or not.As far as I can tell there's nothing in the PDF.js default viewer that actually depends on the page/thumbnail
id
at this point in time, hence why I believe that this removal ought to be safe.Just as a pre-caution this patch adds an
aria-label
to the page canvas, similar to the thumbnail canvas/image, to at least keep this information in the DOM.Add helper functions to reduce unnecessary duplication when fetching l10n messages in
PDFThumbnailView
Fixes #11499