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

Allow doubles for ProgressEvent's loaded and total #394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

domenic
Copy link
Member

@domenic domenic commented Jan 21, 2025

This allows specifications to use ProgressEvents while not necessarily giving away the exact number of bytes, for example by using numbers between 0 and 1. See discussion in webmachinelearning/writing-assistance-apis#15 for the concrete use case.

  • At least two implementers are interested (and none opposed):
    • Chromium is interested
    • Per comments in this thread, WebKit and Gecko are supportive
  • Tests are written and can be reviewed and commented upon at:
    • I will get these written. The test is basically how synthetic ProgressEvent behavior changes: fractions are preserved, and negatives are now passed through as-is instead of subtracted from 2^64.
  • Implementation bugs are filed:
  • MDN issue is filed: … definitely need one for this change.
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


I wanted to get this PR up to judge implementer interest. It would be a decent bit cleaner if we all agreed this was reasonable and merged the change now, instead of having to float a patch in the relevant specs and thus causing all the databases to have two definitions of ProgressEvent.


Preview | Diff

@annevk
Copy link
Member

annevk commented Jan 21, 2025

I'll double check, in principle it seems fine. @smaug----?

domenic added a commit to webmachinelearning/writing-assistance-apis that referenced this pull request Jan 22, 2025
This allows specifications to use ProgressEvents while not necessarily giving away the exact number of bytes, while maintaining a granularity greater than just 1 part in 100. See discussion in webmachinelearning/writing-assistance-apis#15 for the concrete use case.
@domenic domenic force-pushed the double-progressevent branch from 48e8e0d to 5b4e883 Compare January 22, 2025 05:03
@smaug----
Copy link

smaug---- commented Jan 22, 2025

Should be fine.
Technically not backwards compatible, but I'd be a bit surprised if someone relied on the number -> long long conversion when calling the constructor.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

If you could ping me once Chromium has successfully shipped this I'd appreciate this and I'll be sure to align WebKit at that point.

@domenic
Copy link
Member Author

domenic commented Jan 23, 2025

Awesome. I'm hoping to delegate the implementation and tests to someone else so it might be a week or so, but once we have tests up I'll update this thread with a link to them and open other-browser bugs. And I'll ping again once we have it shipped.

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

Successfully merging this pull request may close these issues.

3 participants