Do not root XMLHttpRequest::upload

This commit is contained in:
Anthony Ramine 2015-10-17 16:46:32 +02:00
parent d28de59e4a
commit 6dc42dd1d6

View file

@ -493,8 +493,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
if !self.sync.get() { if !self.sync.get() {
// Step 8 // Step 8
let upload_target = self.upload.root(); let event_target = EventTargetCast::from_ref(&*self.upload);
let event_target = EventTargetCast::from_ref(upload_target.r());
if event_target.has_handlers() { if event_target.has_handlers() {
self.upload_events.set(true); self.upload_events.set(true);
} }
@ -917,13 +916,12 @@ impl XMLHttpRequest {
fn dispatch_progress_event(&self, upload: bool, type_: DOMString, loaded: u64, total: Option<u64>) { fn dispatch_progress_event(&self, upload: bool, type_: DOMString, loaded: u64, total: Option<u64>) {
let global = self.global.root(); let global = self.global.root();
let upload_target = self.upload.root();
let progressevent = ProgressEvent::new(global.r(), let progressevent = ProgressEvent::new(global.r(),
type_, EventBubbles::DoesNotBubble, EventCancelable::NotCancelable, type_, EventBubbles::DoesNotBubble, EventCancelable::NotCancelable,
total.is_some(), loaded, total.is_some(), loaded,
total.unwrap_or(0)); total.unwrap_or(0));
let target = if upload { let target = if upload {
EventTargetCast::from_ref(upload_target.r()) EventTargetCast::from_ref(&*self.upload)
} else { } else {
EventTargetCast::from_ref(self) EventTargetCast::from_ref(self)
}; };