Report loading progress "automatically" when using the PDFDataTransportStream class, and remove the PDFDataRangeTransport.prototype.onDataProgress method#20615
Merged
Snuffleupagus merged 2 commits intomozilla:masterfrom Feb 1, 2026
Conversation
…ortStream` class, and remove the `PDFDataRangeTransport.prototype.onDataProgress` method This is consistent with the other `BasePDFStream` implementations, and simplifies the API surface of the `PDFDataRangeTransport` class (note the changes in the viewer). Given that the `onDataProgress` method was changed to a no-op this won't affect third-party users, assuming there even are any since this code was written specifically for the Firefox PDF Viewer.
After https://bugzilla.mozilla.org/show_bug.cgi?id=1985121 this functionality is now guaranteed to be available in Firefox. Unfortunately general browser support is still somewhat lacking; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sumPrecise#browser_compatibility Also, while unrelated, use the `MathClamp` helper in the `applyOpacity` function.
timvandermeij
approved these changes
Feb 1, 2026
Contributor
timvandermeij
left a comment
There was a problem hiding this comment.
r=me, with passing tests. Thank you for simplifying this code!
Collaborator
Author
|
/botio unittest |
Collaborator
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/80b483cfa5de63b/output.txt |
Collaborator
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/4ca45cbfb86c310/output.txt |
Collaborator
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/80b483cfa5de63b/output.txt Total script time: 2.72 mins
|
Collaborator
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/4ca45cbfb86c310/output.txt Total script time: 8.73 mins
|
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
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.
This is consistent with the other
BasePDFStreamimplementations, and simplifies the API surface of thePDFDataRangeTransportclass (note the changes in the viewer).Given that the
onDataProgressmethod was changed to a no-op this won't affect third-party users, assuming there even are any since this code was written specifically for the Firefox PDF Viewer.