Skip to content

Commit

Permalink
Initialize dom struct fields in declaration order
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwu committed Oct 30, 2015
1 parent 7e786fb commit 434a5f1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/cssstyledeclaration.rs
Expand Up @@ -60,8 +60,8 @@ impl CSSStyleDeclaration {
CSSStyleDeclaration {
reflector_: Reflector::new(),
owner: JS::from_ref(owner),
pseudo: pseudo,
readonly: modification_access == CSSModificationAccess::Readonly,
pseudo: pseudo,
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/element.rs
Expand Up @@ -155,10 +155,10 @@ impl Element {
namespace: namespace,
prefix: prefix,
attrs: DOMRefCell::new(vec!()),
attr_list: Default::default(),
class_list: Default::default(),
id_attribute: DOMRefCell::new(None),
style_attribute: DOMRefCell::new(None),
attr_list: Default::default(),
class_list: Default::default(),
event_state: Cell::new(state),
}
}
Expand Down
6 changes: 3 additions & 3 deletions components/script/dom/event.rs
Expand Up @@ -62,15 +62,15 @@ impl Event {
reflector_: Reflector::new(),
current_target: Default::default(),
target: Default::default(),
phase: Cell::new(EventPhase::None),
type_: DOMRefCell::new("".to_owned()),
phase: Cell::new(EventPhase::None),
canceled: Cell::new(false),
stop_propagation: Cell::new(false),
stop_immediate: Cell::new(false),
cancelable: Cell::new(false),
bubbles: Cell::new(false),
trusted: Cell::new(false),
dispatching: Cell::new(false),
stop_propagation: Cell::new(false),
stop_immediate: Cell::new(false),
initialized: Cell::new(false),
timestamp: time::get_time().sec as u64,
}
Expand Down
3 changes: 1 addition & 2 deletions components/script/dom/xmlhttprequest.rs
Expand Up @@ -163,10 +163,9 @@ impl XMLHttpRequest {
request_headers: DOMRefCell::new(Headers::new()),
request_body_len: Cell::new(0),
sync: Cell::new(false),
send_flag: Cell::new(false),

upload_complete: Cell::new(false),
upload_events: Cell::new(false),
send_flag: Cell::new(false),

global: GlobalField::from_rooted(&global),
timeout_cancel: DOMRefCell::new(None),
Expand Down

0 comments on commit 434a5f1

Please sign in to comment.