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

[api-minor] Normalize the view-getter on the worker-thread #15773

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

Please note: I don't really expect that this is will be an observable change, since virtually all PDF documents already order e.g. /MediaBox and /CropBox entries correctly.

By normalizing boundingBoxes already on the worker-thread, we can be sure that even a corrupt document won't cause issues. Note how we're passing the view-getter to the PartialEvaluator.getTextContent method, in order to detect textContent which is outside of the page, hence it makes sense to ensure that it's formatted as expected. Furthermore, by normalizing this once on the worker-tread we should no longer have to worry about a possibly negative width/height in the PageViewport constructor.

Finally, the patch also simplifies the view-getter a little bit.

@Snuffleupagus Snuffleupagus marked this pull request as draft December 2, 2022 14:44
*Please note:* I don't really expect that this is will be an observable change, since virtually all PDF documents already order e.g. /MediaBox and /CropBox entries correctly.

By normalizing boundingBoxes already on the worker-thread, we can be sure that even a corrupt document won't cause issues.
Note how we're passing the `view`-getter to the `PartialEvaluator.getTextContent` method, in order to detect textContent which is outside of the page, hence it makes sense to ensure that it's formatted as expected.
Furthermore, by normalizing this once on the worker-tread we should no longer have to worry about a possibly negative width/height in the `PageViewport` constructor.

Finally, the patch also simplifies the `view`-getter a little bit.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Dec 2, 2022

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/4e00c962d173d3e/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 2, 2022

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/82801291ab7685f/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 2, 2022

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/4e00c962d173d3e/output.txt

Total script time: 25.59 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 7

Image differences available at: http://54.241.84.105:8877/4e00c962d173d3e/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Dec 2, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/82801291ab7685f/output.txt

Total script time: 34.28 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 15

Image differences available at: http://54.193.163.58:8877/82801291ab7685f/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus marked this pull request as ready for review December 2, 2022 15:34
@timvandermeij timvandermeij merged commit 67e1c37 into mozilla:master Dec 2, 2022
@timvandermeij
Copy link
Contributor

LGTM, 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.

3 participants