← Back to release summary

Update ProgressEvent to use double type for 'loaded' and 'total'

Category
JavaScript
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

WPT details: https://wpt.fyi/results/xhr/progress-events-response-data-gzip.htm?label=experimental&label=master&aligned https://wpt.fyi/results/xhr/progressevent-constructor.html?label=experimental&label=master&aligned https://wpt.fyi/results/xhr/progressevent-interface.html?label=experimental&label=master&aligned

Summary

The ProgressEvent has attributes `loaded` and `total` indicating the progress, and their type is `unsigned long long` now. With this feature, the type for these two attributes is changed to `double` instead, which gives the developer more control over the value. For example, the developers can now create a ProgressEvent with the `total` of 1 and the `loaded` increasing from 0 to 1 gradually. This is aligned with the default behavior of the <progress> HTML element if the max attribute is omitted.

Motivation

https://github.com/webmachinelearning/writing-assistance-apis/issues/15

Standards & signals

Ecosystem

Explainers: https://github.com/whatwg/xhr/pull/394

View on chromestatus.com