aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/bindings/trace.rs4
-rw-r--r--components/script/dom/bindings/utils.rs2
-rw-r--r--components/script/dom/cssstyledeclaration.rs4
-rw-r--r--components/script/dom/document.rs2
-rw-r--r--components/script/dom/element.rs2
-rw-r--r--components/script/dom/eventdispatcher.rs4
-rw-r--r--components/script/dom/eventtarget.rs4
-rw-r--r--components/script/dom/node.rs2
-rw-r--r--components/script/dom/workerglobalscope.rs4
-rw-r--r--components/script/page.rs4
-rw-r--r--components/script/parse/html.rs4
-rw-r--r--components/script/script_task.rs12
-rw-r--r--components/script/timers.rs6
13 files changed, 27 insertions, 27 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 87e279d4f87..d05e099613f 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -212,7 +212,7 @@ impl JSTraceable for Heap<JSVal> {
impl<T: JSTraceable> JSTraceable for Vec<T> {
#[inline]
fn trace(&self, trc: *mut JSTracer) {
- for e in self.iter() {
+ for e in &*self {
e.trace(trc);
}
}
@@ -254,7 +254,7 @@ impl<K, V, S> JSTraceable for HashMap<K, V, S>
{
#[inline]
fn trace(&self, trc: *mut JSTracer) {
- for (k, v) in self.iter() {
+ for (k, v) in &*self {
k.trace(trc);
v.trace(trc);
}
diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs
index d5c7d589ed4..54ca9c1caa3 100644
--- a/components/script/dom/bindings/utils.rs
+++ b/components/script/dom/bindings/utils.rs
@@ -677,7 +677,7 @@ pub unsafe fn finalize_global(obj: *mut JSObject) {
/// Trace the resources held by reserved slots of a global object
pub unsafe fn trace_global(tracer: *mut JSTracer, obj: *mut JSObject) {
let array = get_proto_or_iface_array(obj);
- for proto in (&*array).iter() {
+ for proto in (*array).iter() {
if !proto.is_null() {
trace_object(tracer, "prototype", &*(proto as *const *mut JSObject as *const Heap<*mut JSObject>));
}
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index bbfdbc8231e..4c5fc207674 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -162,7 +162,7 @@ impl<'a> CSSStyleDeclarationMethods for &'a CSSStyleDeclaration {
let mut list = vec!();
// Step 2.2
- for longhand in longhand_properties.iter() {
+ for longhand in &*longhand_properties {
// Step 2.2.1
let declaration = owner.get_declaration(&Atom::from_slice(&longhand));
@@ -327,7 +327,7 @@ impl<'a> CSSStyleDeclarationMethods for &'a CSSStyleDeclaration {
match longhands_from_shorthand(&property) {
// Step 4
Some(longhands) => {
- for longhand in longhands.iter() {
+ for longhand in &*longhands {
elem.remove_inline_style_property(longhand)
}
}
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index c3d81e20ba5..c538893506b 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -899,7 +899,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
}
} else {
let fragment = NodeCast::from_root(self.CreateDocumentFragment());
- for node in nodes.into_iter() {
+ for node in nodes {
match node {
NodeOrString::eNode(node) => {
try!(fragment.r().AppendChild(node.r()));
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 8da1c8c9373..6c8bdf028ba 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -685,7 +685,7 @@ impl<'a> ElementHelpers<'a> for &'a Element {
// Usually, the reference count will be 1 here. But transitions could make it greater
// than that.
let existing_declarations = Arc::make_unique(existing_declarations);
- for declaration in existing_declarations.iter_mut() {
+ for declaration in &mut *existing_declarations {
if declaration.name() == property_decl.name() {
*declaration = property_decl;
return;
diff --git a/components/script/dom/eventdispatcher.rs b/components/script/dom/eventdispatcher.rs
index a99acb7b911..e8603b3b046 100644
--- a/components/script/dom/eventdispatcher.rs
+++ b/components/script/dom/eventdispatcher.rs
@@ -70,8 +70,8 @@ pub fn dispatch_event<'a, 'b>(target: &'a EventTarget,
event.set_current_target(target.clone());
let opt_listeners = target.get_listeners(&type_);
- for listeners in opt_listeners.iter() {
- for listener in listeners.iter() {
+ for listeners in opt_listeners {
+ for listener in listeners {
// Explicitly drop any exception on the floor.
let _ = listener.HandleEvent_(target, event, Report);
diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs
index 79679ff14d2..cb2b1011a4c 100644
--- a/components/script/dom/eventtarget.rs
+++ b/components/script/dom/eventtarget.rs
@@ -332,8 +332,8 @@ impl<'a> EventTargetMethods for &'a EventTarget {
match listener {
Some(ref listener) => {
let mut handlers = self.handlers.borrow_mut();
- let mut entry = handlers.get_mut(&ty);
- for entry in entry.iter_mut() {
+ let entry = handlers.get_mut(&ty);
+ for entry in entry {
let phase = if capture { ListenerPhase::Capturing } else { ListenerPhase::Bubbling };
let old_entry = EventListenerEntry {
phase: phase,
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 8b4046cc80b..72855380540 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -1867,7 +1867,7 @@ impl Node {
let copy_elem = ElementCast::to_ref(copy.r()).unwrap();
let window = document.r().window();
- for ref attr in node_elem.attrs().iter() {
+ for ref attr in &*node_elem.attrs() {
let attr = attr.root();
let newattr =
Attr::new(window.r(),
diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs
index 23038771656..70477846627 100644
--- a/components/script/dom/workerglobalscope.rs
+++ b/components/script/dom/workerglobalscope.rs
@@ -179,7 +179,7 @@ impl<'a> WorkerGlobalScopeMethods for &'a WorkerGlobalScope {
// https://html.spec.whatwg.org/multipage/#dom-workerglobalscope-importscripts
fn ImportScripts(self, url_strings: Vec<DOMString>) -> ErrorResult {
let mut urls = Vec::with_capacity(url_strings.len());
- for url in url_strings.into_iter() {
+ for url in url_strings {
let url = UrlParser::new().base_url(&self.worker_url)
.parse(&url);
match url {
@@ -188,7 +188,7 @@ impl<'a> WorkerGlobalScopeMethods for &'a WorkerGlobalScope {
};
}
- for url in urls.into_iter() {
+ for url in urls {
let (url, source) = match load_whole_resource(&self.resource_task, url) {
Err(_) => return Err(Network),
Ok((metadata, bytes)) => {
diff --git a/components/script/page.rs b/components/script/page.rs
index f4b3fd6cd18..cea63c08a38 100644
--- a/components/script/page.rs
+++ b/components/script/page.rs
@@ -46,7 +46,7 @@ impl IterablePage for Rc<Page> {
}
fn find(&self, id: PipelineId) -> Option<Rc<Page>> {
if self.id == id { return Some(self.clone()); }
- for page in self.children.borrow().iter() {
+ for page in &*self.children.borrow() {
let found = page.find(id);
if found.is_some() { return found; }
}
@@ -104,7 +104,7 @@ impl Iterator for PageIterator {
fn next(&mut self) -> Option<Rc<Page>> {
match self.stack.pop() {
Some(next) => {
- for child in next.children.borrow().iter() {
+ for child in &*next.children.borrow() {
self.stack.push(child.clone());
}
Some(next)
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs
index 6ea2dc443f8..cd4e6dd1d47 100644
--- a/components/script/parse/html.rs
+++ b/components/script/parse/html.rs
@@ -90,7 +90,7 @@ impl<'a> TreeSink for servohtmlparser::Sink {
let elem = Element::create(name, None, doc.r(),
ElementCreator::ParserCreated);
- for attr in attrs.into_iter() {
+ for attr in attrs {
elem.r().set_attribute_from_parser(attr.name, attr.value.into(), None);
}
@@ -152,7 +152,7 @@ impl<'a> TreeSink for servohtmlparser::Sink {
let node: Root<Node> = target.root();
let elem = ElementCast::to_ref(node.r())
.expect("tried to set attrs on non-Element in HTML parsing");
- for attr in attrs.into_iter() {
+ for attr in attrs {
elem.set_attribute_from_parser(attr.name, attr.value.into(), None);
}
}
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index faf1f06d202..60d8887484c 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -709,7 +709,7 @@ impl ScriptTask {
}
}
- for (id, size) in resizes.into_iter() {
+ for (id, size) in resizes {
self.handle_event(id, ResizeEvent(size));
}
@@ -814,7 +814,7 @@ impl ScriptTask {
}
// Process the gathered events.
- for msg in sequential.into_iter() {
+ for msg in sequential {
match msg {
MixedMessage::FromConstellation(ConstellationControlMsg::ExitPipeline(id, exit_type)) => {
if self.handle_exit_pipeline_msg(id, exit_type) {
@@ -1652,7 +1652,7 @@ impl ScriptTask {
let document = page.document();
let mut prev_mouse_over_targets: RootedVec<JS<Node>> = RootedVec::new();
- for target in self.mouse_over_targets.borrow_mut().iter() {
+ for target in &*self.mouse_over_targets.borrow_mut() {
prev_mouse_over_targets.push(target.clone());
}
@@ -1663,7 +1663,7 @@ impl ScriptTask {
document.r().handle_mouse_move_event(self.js_runtime.rt(), point, &mut mouse_over_targets);
// Notify Constellation about anchors that are no longer mouse over targets.
- for target in prev_mouse_over_targets.iter() {
+ for target in &*prev_mouse_over_targets {
if !mouse_over_targets.contains(target) {
if target.root().r().is_anchor_element() {
let event = ConstellationMsg::NodeStatus(None);
@@ -1675,7 +1675,7 @@ impl ScriptTask {
}
// Notify Constellation about the topmost anchor mouse over target.
- for target in mouse_over_targets.iter() {
+ for target in &*mouse_over_targets {
let target = target.root();
if target.r().is_anchor_element() {
let element = ElementCast::to_ref(target.r()).unwrap();
@@ -1936,7 +1936,7 @@ fn shut_down_layout(page_tree: &Rc<Page>, exit_type: PipelineExitType) {
}
// Destroy the layout task. If there were node leaks, layout will now crash safely.
- for chan in channels.into_iter() {
+ for chan in channels {
chan.send(layout_interface::Msg::ExitNow(exit_type)).ok();
}
}
diff --git a/components/script/timers.rs b/components/script/timers.rs
index 634a6a4e110..579c0d9a2c3 100644
--- a/components/script/timers.rs
+++ b/components/script/timers.rs
@@ -83,7 +83,7 @@ pub struct TimerManager {
impl Drop for TimerManager {
fn drop(&mut self) {
- for (_, timer_handle) in self.active_timers.borrow_mut().iter_mut() {
+ for (_, timer_handle) in &mut *self.active_timers.borrow_mut() {
timer_handle.cancel();
}
}
@@ -125,12 +125,12 @@ impl TimerManager {
}
pub fn suspend(&self) {
- for (_, timer_handle) in self.active_timers.borrow_mut().iter_mut() {
+ for (_, timer_handle) in &mut *self.active_timers.borrow_mut() {
timer_handle.suspend();
}
}
pub fn resume(&self) {
- for (_, timer_handle) in self.active_timers.borrow_mut().iter_mut() {
+ for (_, timer_handle) in &mut *self.active_timers.borrow_mut() {
timer_handle.resume();
}
}