Skip to content

Commit

Permalink
Addressed comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrewster committed May 11, 2016
1 parent 9efd214 commit e50eb2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/browsingcontext.rs
Expand Up @@ -102,6 +102,7 @@ impl BrowsingContext {
history.drain((self.active_index.get() + 1)..);
history.push(SessionHistoryEntry::new(document, document.url().clone(), document.Title()));
self.active_index.set(self.active_index.get() + 1);
assert_eq!(self.active_index.get(), history.len() - 1);
}

pub fn active_document(&self) -> Root<Document> {
Expand Down Expand Up @@ -202,8 +203,7 @@ impl Iterator for ContextIterator {
if let Some(ref context) = popped {
self.stack.extend(context.children.borrow()
.iter()
.cloned()
.map(|ref c| Root::from_ref(&**c)));
.map(|c| Root::from_ref(&**c)));
}
popped
}
Expand Down
22 changes: 10 additions & 12 deletions components/script/script_thread.rs
Expand Up @@ -625,17 +625,15 @@ impl ScriptThread {
// Gather them first to avoid a double mut borrow on self.
let mut resizes = vec!();

{
let context = self.browsing_context.get();
if let Some(context) = context {
for context in context.iter() {
// Only process a resize if layout is idle.
let window = context.active_window();
let resize_event = window.steal_resize_event();
match resize_event {
Some(size) => resizes.push((window.pipeline(), size)),
None => ()
}
let context = self.browsing_context.get();
if let Some(context) = context {
for context in context.iter() {
// Only process a resize if layout is idle.
let window = context.active_window();
let resize_event = window.steal_resize_event();
match resize_event {
Some(size) => resizes.push((window.pipeline(), size)),
None => ()
}
}
}
Expand Down Expand Up @@ -1396,7 +1394,7 @@ impl ScriptThread {
let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(ConstellationMsg::SetFinalUrl(incomplete.pipeline_id, final_url.clone())).unwrap();
}
debug!("ScriptThread: loading {} on context {:?}", incomplete.url, incomplete.pipeline_id);
debug!("ScriptThread: loading {} on pipeline {:?}", incomplete.url, incomplete.pipeline_id);

let frame_element = incomplete.parent_info.and_then(|(parent_id, subpage_id)| {
// The root context may not exist yet, if the parent of this frame
Expand Down

0 comments on commit e50eb2a

Please sign in to comment.