aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor Brewster <brewsterc@my.caspercollege.edu>2016-05-11 15:01:43 -0600
committerConnor Brewster <brewsterc@my.caspercollege.edu>2016-05-11 15:01:43 -0600
commite50eb2a4d6d67baae55eb67a03b67efe36b582d5 (patch)
tree220349ab030cb737de04e579c2f02ed0101a4d6f
parent9efd214b1e2f4dc8af907bec2ca04eb93fba6eb8 (diff)
downloadservo-e50eb2a4d6d67baae55eb67a03b67efe36b582d5.tar.gz
servo-e50eb2a4d6d67baae55eb67a03b67efe36b582d5.zip
Addressed comment
-rw-r--r--components/script/dom/browsingcontext.rs4
-rw-r--r--components/script/script_thread.rs22
2 files changed, 12 insertions, 14 deletions
diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs
index 54b4c87e4e7..0576c165cc0 100644
--- a/components/script/dom/browsingcontext.rs
+++ b/components/script/dom/browsingcontext.rs
@@ -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> {
@@ -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
}
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 3102a0181e9..9bd7ce26c4f 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -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 => ()
}
}
}
@@ -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