Update ProgressEvent to use doubles (#36487)

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

Testing: WPT tests exist for this

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
This commit is contained in:
Sebastian C 2025-04-12 20:41:39 -05:00 committed by GitHub
parent 4c55104b36
commit 85bd0918f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 26 deletions

View file

@ -14,6 +14,7 @@ use js::jsval::{self, JSVal};
use js::rust::HandleObject;
use js::typedarray::{ArrayBuffer, CreateWith};
use mime::{self, Mime};
use script_bindings::num::Finite;
use stylo_atoms::Atom;
use crate::dom::bindings::cell::DomRefCell;
@ -463,8 +464,8 @@ impl FileReader {
EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable,
total.is_some(),
loaded,
total.unwrap_or(0),
Finite::wrap(loaded as f64),
Finite::wrap(total.unwrap_or(0) as f64),
can_gc,
);
progressevent.upcast::<Event>().fire(self.upcast(), can_gc);