-
Notifications
You must be signed in to change notification settings - Fork 23k
chore: Change ints to 'number' for ProgressEvent properties #39574
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
Conversation
|
CC @domenic |
|
Preview URLs
(comment last updated: 2025-06-02 16:20:46) |
Josh-Cena
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need BCD too I reckon, +1 for content, but not sure if it fixes the issue completely.
Also as a reader I would be curious to know what a fraction of a byte even means.
Yeah that's a good point, motivation is:
https://webmachinelearning.github.io/writing-assistance-apis/#note-download-progress-fraction |
|
@Josh-Cena do you want to have another look? I've made a deeper tidy at 9291ddb. Some of the bytes-specific wording was added here: |
Josh-Cena
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, for ProgressEvents dispatched by the browser you still get sizes in bytes; for ProgressEvents created by yourself (which I'm not even sure happens a lot) you can plug in any number you want, not just 0–1 normalized. Perhaps you want to make that even clearer...? Leaving my +1
Co-authored-by: Joshua Chen <[email protected]>
Yeah that's right, let me go over once again to make sure it's clear, tnx |
|
I think this is good enough for a merge now to land the improvements. I may call this out for another set of eyes, too. Thanks, Josh 👍🏻 |
* chore: Change ints to doubles for ProgressEvent properties * Apply suggestions from code review * Apply suggestions from code review * Update files/en-us/web/api/progressevent/loaded/index.md * feat: Clarify when progressevents use decimals * Apply suggestions from code review Co-authored-by: Joshua Chen <[email protected]> * feat: Clarify when progressevents use decimals --------- Co-authored-by: Joshua Chen <[email protected]>
Description
The docs are explicit about ints here, and changes have landed allowing doubles:
https://xhr.spec.whatwg.org/#dom-progresseventinit-loaded
Related issues and pull requests
Fixes mdn/mdn#641
ProgressEvent()constructor optionsloaded+totalaccept double in Chrome 136 + Firefox 138 browser-compat-data#26956