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

Fix a few issues #6682

Merged
merged 4 commits into from Jul 22, 2015
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix #6674

  • Loading branch information
boghison committed Jul 22, 2015
commit 68d574bc328ae4eac65c726babc0db6928a9772c
@@ -10,7 +10,7 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::utils::reflect_dom_object;
use dom::event::{Event, EventTypeId};
use dom::event::{Event, EventTypeId, EventBubbles, EventCancelable};
use util::str::DOMString;

#[dom_struct]
@@ -37,22 +37,25 @@ impl ProgressEvent {
}
}
pub fn new(global: GlobalRef, type_: DOMString,
can_bubble: bool, cancelable: bool,
can_bubble: EventBubbles, cancelable: EventCancelable,
length_computable: bool, loaded: u64, total: u64) -> Root<ProgressEvent> {
let ev = reflect_dom_object(box ProgressEvent::new_inherited(length_computable, loaded, total),
global,
ProgressEventBinding::Wrap);
{
let event = EventCast::from_ref(ev.r());
event.InitEvent(type_, can_bubble, cancelable);
event.InitEvent(type_, can_bubble == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable);
}
ev
}
pub fn Constructor(global: GlobalRef,
type_: DOMString,
init: &ProgressEventBinding::ProgressEventInit)
-> Fallible<Root<ProgressEvent>> {
let ev = ProgressEvent::new(global, type_, init.parent.bubbles, init.parent.cancelable,
let bubbles = if init.parent.bubbles {EventBubbles::Bubbles} else {EventBubbles::DoesNotBubble};
let cancelable = if init.parent.cancelable {EventCancelable::Cancelable}
else {EventCancelable::NotCancelable};
let ev = ProgressEvent::new(global, type_, bubbles, cancelable,
init.lengthComputable, init.loaded, init.total);
Ok(ev)
}
@@ -942,7 +942,7 @@ impl<'a> PrivateXMLHttpRequestHelpers for &'a XMLHttpRequest {
let global = self.global.root();
let upload_target = self.upload.root();
let progressevent = ProgressEvent::new(global.r(),
type_, false, false,
type_, EventBubbles::DoesNotBubble, EventCancelable::NotCancelable,
total.is_some(), loaded,
total.unwrap_or(0));
let target = if upload {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.