From 434a5f1d8b7fa3e2abd36d832f16381337885e3d Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Fri, 30 Oct 2015 15:40:43 -0400 Subject: [PATCH] Initialize dom struct fields in declaration order --- components/script/dom/cssstyledeclaration.rs | 2 +- components/script/dom/element.rs | 4 ++-- components/script/dom/event.rs | 6 +++--- components/script/dom/xmlhttprequest.rs | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index ba6923c1f6f..f4ab910e913 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -60,8 +60,8 @@ impl CSSStyleDeclaration { CSSStyleDeclaration { reflector_: Reflector::new(), owner: JS::from_ref(owner), - pseudo: pseudo, readonly: modification_access == CSSModificationAccess::Readonly, + pseudo: pseudo, } } diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 306feee6998..d2636820362 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -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), } } diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index 6b63b3a58ee..c56d44e15c3 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -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, } diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 0e998c2fa1c..39b86117b34 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -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),