diff options
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index ce7dc34e77d..08e526df282 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -27,7 +27,7 @@ use dom::performance::Performance; use dom::screen::Screen; use dom::storage::Storage; use layout_interface::{ReflowGoal, ReflowQueryType, LayoutRPC, LayoutChan, Reflow, Msg}; -use layout_interface::{ContentBoxResponse, ContentBoxesResponse}; +use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ScriptReflow}; use page::Page; use script_task::{TimerSource, ScriptChan}; use script_task::ScriptMsg; @@ -119,7 +119,7 @@ pub struct Window { parent_info: Option<(PipelineId, SubpageId)>, /// Unique id for last reflow request; used for confirming completion reply. - last_reflow_id: Cell<uint>, + last_reflow_id: Cell<u32>, /// Global static data related to the DOM. dom_static: GlobalStaticData, @@ -218,8 +218,7 @@ impl Window { } // http://www.whatwg.org/html/#atob -pub fn base64_btoa(btoa: DOMString) -> Fallible<DOMString> { - let input = btoa.as_slice(); +pub fn base64_btoa(input: DOMString) -> Fallible<DOMString> { // "The btoa() method must throw an InvalidCharacterError exception if // the method's first argument contains any character whose code point // is greater than U+00FF." @@ -239,10 +238,7 @@ pub fn base64_btoa(btoa: DOMString) -> Fallible<DOMString> { } // http://www.whatwg.org/html/#atob -pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> { - // "Let input be the string being parsed." - let input = atob.as_slice(); - +pub fn base64_atob(input: DOMString) -> Fallible<DOMString> { // "Remove all space characters from input." // serialize::base64::from_base64 ignores \r and \n, // but it treats the other space characters as @@ -460,7 +456,7 @@ pub trait WindowHelpers { fn layout(&self) -> &LayoutRPC; fn content_box_query(self, content_box_request: TrustedNodeAddress) -> Rect<Au>; fn content_boxes_query(self, content_boxes_request: TrustedNodeAddress) -> Vec<Rect<Au>>; - fn handle_reflow_complete_msg(self, reflow_id: uint); + fn handle_reflow_complete_msg(self, reflow_id: u32); fn handle_resize_inactive_msg(self, new_size: WindowSizeData); fn set_fragment_name(self, fragment: Option<String>); fn steal_fragment_name(self) -> Option<String>; @@ -568,17 +564,19 @@ impl<'a> WindowHelpers for JSRef<'a, Window> { } // Send new document and relevant styles to layout. - let reflow = box Reflow { + let reflow = box ScriptReflow { + reflow_info: Reflow { + goal: goal, + url: self.get_url(), + iframe: self.parent_info.is_some(), + page_clip_rect: self.page_clip_rect.get(), + }, document_root: root.to_trusted_node_address(), - url: self.get_url(), - iframe: self.parent_info.is_some(), - goal: goal, window_size: window_size, script_chan: self.control_chan.clone(), script_join_chan: join_chan, id: last_reflow_id.get(), query_type: query_type, - page_clip_rect: self.page_clip_rect.get(), }; let LayoutChan(ref chan) = self.layout_chan; @@ -631,7 +629,7 @@ impl<'a> WindowHelpers for JSRef<'a, Window> { rects } - fn handle_reflow_complete_msg(self, reflow_id: uint) { + fn handle_reflow_complete_msg(self, reflow_id: u32) { let last_reflow_id = self.last_reflow_id.get(); if last_reflow_id == reflow_id { *self.layout_join_port.borrow_mut() = None; |