servo: Language changes.
authorJosh Matthews <josh@joshmatthews.net>
Sun, 24 Feb 2013 20:56:11 -0500
changeset 380001 77b7ea9bc4b1372f677f44626d51aedeb454969d
parent 380000 7e79c5afd7aa840ba6004294df44ac4687014e39
child 380002 3bf8e6ea833ec5bf4abcbd0f92ca01af8920c897
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
servo: Language changes. Source-Repo: https://github.com/servo/servo Source-Revision: ce514f2785d5f1762afaa4a3961d56c71d149940
servo/src/servo-gfx/compositor.rs
servo/src/servo-gfx/font_context.rs
servo/src/servo-gfx/fontconfig/font_list.rs
servo/src/servo-gfx/freetype_impl/font_context.rs
servo/src/servo-gfx/render_layers.rs
servo/src/servo-gfx/render_task.rs
servo/src/servo-gfx/resource/file_loader.rs
servo/src/servo-gfx/resource/http_loader.rs
servo/src/servo-gfx/resource/image_cache_task.rs
servo/src/servo-gfx/resource/local_image_cache.rs
servo/src/servo-gfx/resource/resource_task.rs
servo/src/servo-gfx/resource/util.rs
servo/src/servo-gfx/util/cache.rs
servo/src/servo-gfx/util/vec.rs
servo/src/servo/content/content_task.rs
servo/src/servo/dom/bindings/document.rs
servo/src/servo/dom/bindings/element.rs
servo/src/servo/dom/bindings/node.rs
servo/src/servo/dom/cow.rs
servo/src/servo/dom/event.rs
servo/src/servo/dom/node.rs
servo/src/servo/dom/window.rs
servo/src/servo/engine.rs
servo/src/servo/html/cssparse.rs
servo/src/servo/html/hubbub_html_parser.rs
servo/src/servo/layout/aux.rs
servo/src/servo/layout/inline.rs
servo/src/servo/layout/layout_task.rs
servo/src/servo/platform/osmain.rs
servo/src/servo/platform/resize_rate_limiter.rs
servo/src/servo/servo.rc
servo/src/servo/util/task.rs
servo/src/servo/util/tree.rs
--- a/servo/src/servo-gfx/compositor.rs
+++ b/servo/src/servo-gfx/compositor.rs
@@ -17,12 +17,12 @@ pub struct LayerBufferSet {
     buffers: ~[LayerBuffer]
 }
 
 /**
 The interface used to by the renderer to aquire draw targets for
 each rendered frame and submit them to be drawn to the display
 */
 pub trait Compositor {
-    fn begin_drawing(next_dt: pipes::Chan<LayerBufferSet>);
-    fn draw(next_dt: pipes::Chan<LayerBufferSet>, +draw_me: LayerBufferSet);
+    fn begin_drawing(next_dt: comm::Chan<LayerBufferSet>);
+    fn draw(next_dt: comm::Chan<LayerBufferSet>, +draw_me: LayerBufferSet);
 }
 
--- a/servo/src/servo-gfx/font_context.rs
+++ b/servo/src/servo-gfx/font_context.rs
@@ -183,14 +183,17 @@ pub impl FontContext {
             &SelectorStubDummy => {
                 Font::new_from_buffer(&self, test_font_bin(), &desc.style, self.backend)
             },
             // TODO(Issue #174): implement by-platform-name font selectors.
             &SelectorPlatformIdentifier(ref identifier) => { 
                 let result_handle = self.handle.create_font_from_identifier(copy *identifier,
                                                                             copy desc.style);
                 result::chain(result_handle, |handle| {
-                    Ok(Font::new_from_adopted_handle(&self, handle, &desc.style, self.backend))
+                    Ok(Font::new_from_adopted_handle(&self,
+                                                     handle,
+                                                     &desc.style,
+                                                     self.backend))
                 })
             }
         };
     }
 }
--- a/servo/src/servo-gfx/fontconfig/font_list.rs
+++ b/servo/src/servo-gfx/fontconfig/font_list.rs
@@ -1,16 +1,17 @@
 extern mod freetype;
 extern mod fontconfig;
 
 use fc = fontconfig;
 use ft = freetype;
 
-use gfx_font::FontHandle;
+use gfx_font::{FontHandle, FontHandleMethods};
 use gfx_font_list::{FontEntry, FontFamily, FontFamilyMap};
+use gfx_font_context::FontContextHandleMethods;
 use freetype_impl::font_context::FreeTypeFontContextHandle;
 use freetype_impl::font::FreeTypeFontHandle;
 use self::fontconfig::fontconfig::{FcConfig, FcFontSet, FcChar8,
                                    FcResultMatch, FcSetSystem, FcPattern,
                                    FcResultNoMatch, FcMatchPattern};
 use self::fontconfig::fontconfig::bindgen::{
     FcConfigGetCurrent, FcConfigGetFonts, FcPatternGetString,
     FcInitReinitialize, FcPatternDestroy, FcPatternReference,
@@ -85,25 +86,25 @@ pub impl FontconfigFontListHandle {
 
                     for uint::range(0, (*matches).nfont as uint) |i| {
                         let font = (*matches).fonts.offset(i);
                         let file = do str::as_c_str("file") |FC_FILE| {
                             let file: *FcChar8 = ptr::null();
                             if FcPatternGetString(*font, FC_FILE, 0, &file) == FcResultMatch {
                                 str::raw::from_c_str(file as *libc::c_char)
                             } else {
-                                fail;
+                                fail!();
                             }
                         };
                         let index = do str::as_c_str("index") |FC_INDEX| {
                             let index: libc::c_int = 0;
                             if FcPatternGetInteger(*font, FC_INDEX, 0, &index) == FcResultMatch {
                                 index
                             } else {
-                                fail;
+                                fail!();
                             }
                         };
 
                         debug!("variation file: %?", file);
                         debug!("variation index: %?", index);
 
                         let font_handle = FreeTypeFontHandle::new_from_file_unstyled(&self.fctx, file);
                         let font_handle = font_handle.unwrap();
--- a/servo/src/servo-gfx/freetype_impl/font_context.rs
+++ b/servo/src/servo-gfx/freetype_impl/font_context.rs
@@ -31,17 +31,17 @@ struct FreeTypeLibraryHandle {
 pub struct FreeTypeFontContextHandle {
     ctx: @FreeTypeLibraryHandle,
 }
 
 pub impl FreeTypeFontContextHandle {
     static pub fn new() -> FreeTypeFontContextHandle {
         let ctx: FT_Library = ptr::null();
         let result = FT_Init_FreeType(ptr::to_unsafe_ptr(&ctx));
-        if !result.succeeded() { fail; }
+        if !result.succeeded() { fail!(); }
 
         FreeTypeFontContextHandle { 
             ctx: @FreeTypeLibraryHandle { ctx: ctx },
         }
     }
 }
 
 pub impl FontContextHandleMethods for FreeTypeFontContextHandle {
--- a/servo/src/servo-gfx/render_layers.rs
+++ b/servo/src/servo-gfx/render_layers.rs
@@ -1,17 +1,17 @@
 use compositor::{LayerBuffer, LayerBufferSet};
 use display_list::DisplayList;
 use opts::Opts;
 use util::time;
 
 use azure::AzFloat;
 use azure::azure_hl::{B8G8R8A8, DrawTarget};
 use core::libc::c_int;
-use core::pipes::Chan;
+use core::comm::Chan;
 use geom::matrix2d::Matrix2D;
 use geom::point::Point2D;
 use geom::rect::Rect;
 use geom::size::Size2D;
 use std::arc::ARC;
 use std::arc;
 
 pub struct RenderLayer {
@@ -106,17 +106,17 @@ pub fn render_layers(layer_ref: *RenderL
                                                                size.width * 4,
                                                                B8G8R8A8),
                         rect: tile_rect,
                         stride: stride
                     };
                 //}
 
                 // Create a port and channel pair to receive the new buffer.
-                let (new_buffer_port, new_buffer_chan) = pipes::stream();
+                let (new_buffer_port, new_buffer_chan) = comm::stream();
 
                 // Send the buffer to the child.
                 f(layer_ref, buffer, new_buffer_chan);
 
                 // Enqueue the port.
                 new_buffer_ports.push(new_buffer_port);
 
                 x += tile_size;
--- a/servo/src/servo-gfx/render_task.rs
+++ b/servo/src/servo-gfx/render_task.rs
@@ -7,46 +7,46 @@ use geom::matrix2d::Matrix2D;
 use opts::Opts;
 use render_context::RenderContext;
 use render_layers::{RenderLayer, render_layers};
 use resource::util::spawn_listener;
 use util::time::time;
 
 use core::libc::size_t;
 use core::libc::types::common::c99::uint16_t;
-use core::pipes::{Chan, Port, SharedChan};
+use core::comm::{Chan, Port, SharedChan};
 use core::task::SingleThreaded;
 use std::arc::ARC;
 use std::arc;
 use std::cell::Cell;
 use std::task_pool::TaskPool;
 
 pub enum Msg {
     RenderMsg(RenderLayer),
-    ExitMsg(pipes::Chan<()>)
+    ExitMsg(comm::Chan<()>)
 }
 
 pub type RenderTask = SharedChan<Msg>;
 
 pub fn RenderTask<C:Compositor + Owned>(compositor: C, opts: Opts) -> RenderTask {
     let compositor_cell = Cell(compositor);
     let opts_cell = Cell(opts);
     let render_task = do spawn_listener |po: Port<Msg>| {
-        let (layer_buffer_set_port, layer_buffer_channel) = pipes::stream();
+        let (layer_buffer_set_port, layer_buffer_channel) = comm::stream();
 
         let compositor = compositor_cell.take();
         compositor.begin_drawing(layer_buffer_channel);
 
         // FIXME: Annoying three-cell dance here. We need one-shot closures.
         let opts = opts_cell.with_ref(|o| copy *o);
         let n_threads = opts.n_render_threads;
-        let new_opts_cell: Cell<Opts> = Cell(opts);
+        let new_opts_cell = Cell(opts);
 
         let thread_pool = do TaskPool::new(n_threads, Some(SingleThreaded)) {
-            let opts_cell: Cell<Opts> = Cell(new_opts_cell.with_ref(|o| copy *o));
+            let opts_cell = Cell(new_opts_cell.with_ref(|o| copy *o));
             let f: ~fn(uint) -> ThreadRenderContext = |thread_index| {
                 ThreadRenderContext {
                     thread_index: thread_index,
                     font_ctx: @FontContext::new(opts_cell.with_ref(|o| o.render_backend), false),
                     opts: opts_cell.with_ref(|o| copy *o),
                 }
             };
             f
@@ -68,22 +68,22 @@ priv struct ThreadRenderContext {
     thread_index: uint,
     font_ctx: @FontContext,
     opts: Opts,
 }
 
 priv struct Renderer<C> {
     port: Port<Msg>,
     compositor: C,
-    layer_buffer_set_port: Cell<pipes::Port<LayerBufferSet>>,
+    layer_buffer_set_port: Cell<comm::Port<LayerBufferSet>>,
     thread_pool: TaskPool<ThreadRenderContext>,
     opts: Opts,
 }
 
-impl<C: Compositor Owned> Renderer<C> {
+impl<C: Compositor + Owned> Renderer<C> {
     fn start() {
         debug!("renderer: beginning rendering loop");
 
         loop {
             match self.port.recv() {
                 RenderMsg(render_layer) => self.render(render_layer),
                 ExitMsg(response_ch) => {
                     response_ch.send(());
@@ -98,17 +98,17 @@ impl<C: Compositor Owned> Renderer<C> {
 
         let layer_buffer_set_port = self.layer_buffer_set_port.take();
 
         if !layer_buffer_set_port.peek() {
             warn!("renderer: waiting on layer buffer");
         }
 
         let layer_buffer_set = layer_buffer_set_port.recv();
-        let (new_layer_buffer_set_port, layer_buffer_set_channel) = pipes::stream();
+        let (new_layer_buffer_set_port, layer_buffer_set_channel) = comm::stream();
         self.layer_buffer_set_port.put_back(new_layer_buffer_set_port);
 
         let layer_buffer_set_cell = Cell(layer_buffer_set);
         let layer_buffer_set_channel_cell = Cell(layer_buffer_set_channel);
 
         debug!("renderer: rendering");
 
         do time(~"rendering") {
--- a/servo/src/servo-gfx/resource/file_loader.rs
+++ b/servo/src/servo-gfx/resource/file_loader.rs
@@ -1,9 +1,9 @@
-use pipes::Chan;
+use comm::Chan;
 use task::spawn;
 use resource::resource_task::{ProgressMsg, Payload, Done, LoaderTask};
 use std::net::url::Url;
 use io::{file_reader, ReaderUtil};
 
 const READ_SIZE: uint = 1024;
 
 pub fn factory() -> LoaderTask {
--- a/servo/src/servo-gfx/resource/http_loader.rs
+++ b/servo/src/servo-gfx/resource/http_loader.rs
@@ -1,9 +1,9 @@
-use pipes::{Chan, SharedChan};
+use comm::{Chan, SharedChan};
 use task::spawn;
 use resource::resource_task::{ProgressMsg, Payload, Done, LoaderTask};
 use std::cell::Cell;
 use std::net::url::Url;
 use http_client;
 use http_client::{uv_http_request};
 
 pub fn factory() -> LoaderTask {
--- a/servo/src/servo-gfx/resource/image_cache_task.rs
+++ b/servo/src/servo-gfx/resource/image_cache_task.rs
@@ -1,15 +1,15 @@
 use image::base::{Image, load_from_memory, test_image_bin};
 use resource::resource_task;
 use resource::resource_task::ResourceTask;
 use util::url::{make_url, UrlMap, url_map};
 
 use clone_arc = std::arc::clone;
-use core::pipes::{Chan, Port, SharedChan, stream};
+use core::comm::{Chan, Port, SharedChan, stream};
 use core::task::spawn;
 use resource::util::spawn_listener;
 use core::to_str::ToStr;
 use core::util::replace;
 use std::arc::ARC;
 use std::net::url::Url;
 use std::cell::Cell;
 
--- a/servo/src/servo-gfx/resource/local_image_cache.rs
+++ b/servo/src/servo-gfx/resource/local_image_cache.rs
@@ -1,17 +1,17 @@
 /*!
 An adapter for ImageCacheTask that does local caching to avoid
 extra message traffic, it also avoids waiting on the same image
 multiple times and thus triggering reflows multiple times.
 */
 
 use clone_arc = std::arc::clone;
 use std::net::url::Url;
-use pipes::{Port, Chan, stream};
+use comm::{Port, Chan, stream};
 use resource::image_cache_task::{ImageCacheTask, ImageResponseMsg, Prefetch, Decode, GetImage};
 use resource::image_cache_task::{ WaitForImage, ImageReady, ImageNotReady, ImageFailed};
 use util::url::{UrlMap, url_map};
 
 pub fn LocalImageCache(image_cache_task: ImageCacheTask) -> LocalImageCache {
     LocalImageCache {
         image_cache_task: image_cache_task,
         round_number: 1,
@@ -68,71 +68,71 @@ pub impl LocalImageCache {
         let last_round = state.last_request_round;
         // Set the current round number for this image
         state.last_request_round = self.round_number;
 
         match state.last_response {
             ImageReady(ref image) => {
                 // FIXME: appease borrowck
                 unsafe {
-                    let (port, chan) = pipes::stream();
+                    let (port, chan) = comm::stream();
                     chan.send(ImageReady(clone_arc(image)));
                     return port;
                 }
             }
             ImageNotReady => {
                 if last_round == self.round_number {
-                    let (port, chan) = pipes::stream();
+                    let (port, chan) = comm::stream();
                     chan.send(ImageNotReady);
                     return port;
                 } else {
                     // We haven't requested the image from the
                     // remote cache this round
                 }
             }
             ImageFailed => {
-                let (port, chan) = pipes::stream();
+                let (port, chan) = comm::stream();
                 chan.send(ImageFailed);
                 return port;
             }
         }
 
-        let (response_port, response_chan) = pipes::stream();
+        let (response_port, response_chan) = comm::stream();
         self.image_cache_task.send(GetImage(copy *url, response_chan));
 
         let response = response_port.recv();
         match response {
             ImageNotReady => {
                 // Need to reflow when the image is available
                 // FIXME: Instead we should be just passing a Future
                 // to the caller, then to the display list. Finally,
                 // the compositor should be resonsible for waiting
                 // on the image to load and triggering layout
                 let image_cache_task = self.image_cache_task.clone();
                 assert self.on_image_available.is_some();
                 let on_image_available = self.on_image_available.get()();
                 let url = copy *url;
                 do task::spawn {
-                    let (response_port, response_chan) = pipes::stream();
+                    let (response_port, response_chan) = comm::stream();
                     image_cache_task.send(WaitForImage(copy url, response_chan));
                     on_image_available(response_port.recv());
                 }
             }
             _ => ()
         }
 
         // Put a copy of the response in the cache
         let response_copy = match response {
             ImageReady(ref image) => ImageReady(clone_arc(image)),
             ImageNotReady => ImageNotReady,
             ImageFailed => ImageFailed
         };
         state.last_response = response_copy;
 
-        let (port, chan) = pipes::stream();
+        let (port, chan) = comm::stream();
         chan.send(response);
         return port;
     }
 
     priv fn get_state(url: &Url) -> @ImageState {
         match self.state_map.find(url) {
             Some(state) => state,
             None => {
--- a/servo/src/servo-gfx/resource/resource_task.rs
+++ b/servo/src/servo-gfx/resource/resource_task.rs
@@ -1,15 +1,15 @@
 /*!
 
 A task that takes a URL and streams back the binary data
 
 */
 
-use pipes::{Chan, Port, SharedChan};
+use comm::{Chan, Port, SharedChan};
 use resource::util::spawn_listener;
 use std::cell::Cell;
 use std::net::url;
 use std::net::url::{Url, to_str};
 use super::{file_loader, http_loader};
 
 pub enum ControlMsg {
     /// Request the data associated with a particular URL
@@ -64,18 +64,18 @@ pub struct ResourceManager {
     /// Per-scheme resource loaders
     loaders: ~[(~str, LoaderTaskFactory)],
 }
 
 
 pub fn ResourceManager(from_client: Port<ControlMsg>, 
                        loaders: ~[(~str, LoaderTaskFactory)]) -> ResourceManager {
     ResourceManager {
-        from_client: from_client,
-        loaders: loaders,
+        from_client : from_client,
+        loaders : loaders,
     }
 }
 
 
 impl ResourceManager {
     fn start() {
         loop {
             match self.from_client.recv() {
--- a/servo/src/servo-gfx/resource/util.rs
+++ b/servo/src/servo-gfx/resource/util.rs
@@ -1,12 +1,11 @@
-use core::pipes::{Chan, Port};
-use core::pipes;
+use core::comm::{Chan, Port};
 
 pub fn spawn_listener<A: Owned>(f: ~fn(Port<A>)) -> Chan<A> {
-    let (setup_po, setup_ch) = pipes::stream();
+    let (setup_po, setup_ch) = comm::stream();
     do task::spawn {
-        let (po, ch) = pipes::stream();
+        let (po, ch) = comm::stream();
         setup_ch.send(ch);
         f(po);
     }
     setup_po.recv()
 }
--- a/servo/src/servo-gfx/util/cache.rs
+++ b/servo/src/servo-gfx/util/cache.rs
@@ -1,23 +1,23 @@
 use core::cmp::*;
 
-pub trait Cache<K: Copy Eq, V: Copy> {
+pub trait Cache<K: Copy + Eq, V: Copy> {
     static fn new(size: uint) -> Self;
     fn insert(key: &K, value: V);
     fn find(key: &K) -> Option<V>;
     fn find_or_create(key: &K, blk: pure fn&(&K) -> V) -> V;
     fn evict_all();
 }
 
 pub struct MonoCache<K, V> {
     mut entry: Option<(K,V)>,
 }
 
-pub impl<K: Copy Eq, V: Copy> Cache<K,V> for MonoCache<K,V> {
+pub impl<K: Copy + Eq, V: Copy> Cache<K,V> for MonoCache<K,V> {
     static fn new(_size: uint) -> MonoCache<K,V> {
         MonoCache { entry: None }
     }
 
     fn insert(key: &K, value: V) {
         self.entry = Some((copy *key, value));
     }
 
--- a/servo/src/servo-gfx/util/vec.rs
+++ b/servo/src/servo-gfx/util/vec.rs
@@ -1,16 +1,16 @@
 use core::cmp::{Ord, Eq};
 
-pub trait BinarySearchMethods<T: Ord Eq> {
+pub trait BinarySearchMethods<T: Ord + Eq> {
     pure fn binary_search(&self, key: &T) -> Option<&self/T>;
     pure fn binary_search_index(&self, key: &T) -> Option<uint>;
 }
 
-pub impl<T: Ord Eq> BinarySearchMethods<T> for &[T] {
+pub impl<T: Ord + Eq> BinarySearchMethods<T> for &[T] {
     pure fn binary_search(&self, key: &T) -> Option<&self/T> {
         match self.binary_search_index(key) {
             None => None,
             Some(i) => Some(&self[i])
         }
     }
 
     pure fn binary_search_index(&self, key: &T) -> Option<uint> {
@@ -33,25 +33,25 @@ pub impl<T: Ord Eq> BinarySearchMethods<
             } else {
                 return Some(mid as uint);
             }
         }
         return None;
     }
 }
 
-fn test_find_all_elems<T: Eq Ord>(arr: &[T]) {
+fn test_find_all_elems<T: Eq + Ord>(arr: &[T]) {
     let mut i = 0;
     while i < arr.len() {
         assert test_match(&arr[i], arr.binary_search(&arr[i]));
         i += 1;
     }
 }
 
-fn test_miss_all_elems<T: Eq Ord>(arr: &[T], misses: &[T]) {
+fn test_miss_all_elems<T: Eq + Ord>(arr: &[T], misses: &[T]) {
     let mut i = 0;
     while i < misses.len() {
         let res = arr.binary_search(&misses[i]);
         debug!("%? == %? ?", misses[i], res);
         assert !test_match(&misses[i], arr.binary_search(&misses[i]));
         i += 1;
     }
 }
--- a/servo/src/servo/content/content_task.rs
+++ b/servo/src/servo/content/content_task.rs
@@ -8,17 +8,18 @@ use dom::document::Document;
 use dom::node::{Node, NodeScope, define_bindings};
 use dom::event::{Event, ResizeEvent, ReflowEvent};
 use dom::window::Window;
 use layout::layout_task;
 use layout::layout_task::{AddStylesheet, BuildData, BuildMsg, Damage, LayoutTask};
 use layout::layout_task::{MatchSelectorsDamage, NoDamage, ReflowDamage};
 use util::task::spawn_listener;
 
-use core::pipes::{Port, Chan, SharedChan, select2};
+use core::comm::{Port, Chan, SharedChan};
+use core::pipes::select2i;
 use core::either;
 use core::task::{SingleThreaded, spawn, task};
 use core::io::{println, read_whole_file};
 use core::ptr::null;
 use core::util::replace;
 use geom::size::Size2D;
 use gfx::resource::image_cache_task::ImageCacheTask;
 use gfx::resource::resource_task::ResourceTask;
@@ -52,17 +53,17 @@ pub enum PingMsg {
 pub type ContentTask = SharedChan<ControlMsg>;
 
 pub fn ContentTask(layout_task: LayoutTask,
                    dom_event_port: Port<Event>,
                    dom_event_chan: SharedChan<Event>,
                    resource_task: ResourceTask,
                    img_cache_task: ImageCacheTask)
                 -> ContentTask {
-    let (control_port, control_chan) = pipes::stream();
+    let (control_port, control_chan) = comm::stream();
 
     let control_chan = SharedChan(control_chan);
     let control_chan_copy = control_chan.clone();
     let control_port = Cell(control_port);
     let dom_event_port = Cell(dom_event_port);
     let dom_event_chan = Cell(dom_event_chan);
 
     do task().sched_mode(SingleThreaded).spawn {
@@ -76,23 +77,23 @@ pub fn ContentTask(layout_task: LayoutTa
         content.start();
     }
 
     return control_chan;
 }
 
 pub struct Content {
     layout_task: LayoutTask,
-    mut layout_join_port: Option<pipes::Port<()>>,
+    mut layout_join_port: Option<comm::Port<()>>,
 
     image_cache_task: ImageCacheTask,
-    control_port: pipes::Port<ControlMsg>,
-    control_chan: pipes::SharedChan<ControlMsg>,
-    event_port: pipes::Port<Event>,
-    event_chan: pipes::SharedChan<Event>,
+    control_port: comm::Port<ControlMsg>,
+    control_chan: comm::SharedChan<ControlMsg>,
+    event_port: comm::Port<Event>,
+    event_chan: comm::SharedChan<Event>,
 
     scope: NodeScope,
     jsrt: jsrt,
     cx: @Cx,
 
     mut document: Option<@Document>,
     mut window:   Option<@Window>,
     mut doc_url: Option<Url>,
@@ -102,22 +103,22 @@ pub struct Content {
 
     compartment: Option<@mut Compartment>,
 
     // What parts of layout are dirty.
     mut damage: Damage,
 }
 
 pub fn Content(layout_task: LayoutTask, 
-               control_port: pipes::Port<ControlMsg>,
-               control_chan: pipes::SharedChan<ControlMsg>,
+               control_port: comm::Port<ControlMsg>,
+               control_chan: comm::SharedChan<ControlMsg>,
                resource_task: ResourceTask,
                img_cache_task: ImageCacheTask,
-               event_port: pipes::Port<Event>,
-               event_chan: pipes::SharedChan<Event>)
+               event_port: comm::Port<Event>,
+               event_chan: comm::SharedChan<Event>)
             -> @Content {
     let jsrt = jsrt();
     let cx = jsrt.cx();
 
     cx.set_default_options_and_version();
     cx.set_logging_error_reporter();
 
     let compartment = match cx.new_compartment(global_class) {
@@ -164,17 +165,17 @@ pub fn task_from_context(cx: *JSContext)
 impl Content {
     fn start() {
         while self.handle_msg() {
             // Go on ...
         }
     }
 
     fn handle_msg() -> bool {
-        match pipes::select2i(&self.control_port, &self.event_port) {
+        match select2i(&self.control_port, &self.event_port) {
             either::Left(*) => self.handle_control_msg(self.control_port.recv()),
             either::Right(*) => self.handle_event(self.event_port.recv())
         }
     }
 
     fn handle_control_msg(control_msg: ControlMsg) -> bool {
         match control_msg {
           ParseMsg(url) => {
@@ -301,17 +302,17 @@ impl Content {
     fn relayout(document: &Document, doc_url: &Url) {
         debug!("content: performing relayout");
 
         // Now, join the layout so that they will see the latest
         // changes we have made.
         self.join_layout();
 
         // Layout will let us know when it's done
-        let (join_port, join_chan) = pipes::stream();
+        let (join_port, join_chan) = comm::stream();
         self.layout_join_port = Some(join_port);
 
         // Send new document and relevant styles to layout
 
         let data = BuildData {
             node: document.root,
             url: copy *doc_url,
             dom_event_chan: self.event_chan.clone(),
@@ -328,17 +329,17 @@ impl Content {
 
         debug!("content: layout forked");
     }
 
      fn query_layout(query: layout_task::LayoutQuery) -> layout_task::LayoutQueryResponse {
          self.relayout(self.document.get(), &(copy self.doc_url).get());
          self.join_layout();
 
-         let (response_port, response_chan) = pipes::stream();
+         let (response_port, response_chan) = comm::stream();
          self.layout_task.send(layout_task::QueryMsg(query, response_chan));
          return response_port.recv()
     }
 
     /**
        This is the main entry point for receiving and dispatching DOM events.
     */
     // TODO: actually perform DOM event dispatch.
--- a/servo/src/servo/dom/bindings/document.rs
+++ b/servo/src/servo/dom/bindings/document.rs
@@ -1,12 +1,13 @@
 use js::rust::{Compartment, jsobj};
 use js::{JS_ARGV, JSCLASS_HAS_RESERVED_SLOTS, JSPROP_ENUMERATE, JSPROP_SHARED,
             JSVAL_NULL, JS_THIS_OBJECT, JS_SET_RVAL, JSPROP_NATIVE_ACCESSORS};
-use js::jsapi::{JSContext, JSVal, JSObject, JSBool, jsid, JSClass, JSFreeOp};
+use js::jsapi::{JSContext, JSVal, JSObject, JSBool, jsid, JSClass, JSFreeOp,
+                JSPropertySpec, JSPropertyOpWrapper, JSStrictPropertyOpWrapper};
 use js::jsapi::bindgen::{JS_ValueToString, JS_GetStringCharsZAndLength, JS_ReportError,
                             JS_GetReservedSlot, JS_SetReservedSlot, JS_NewStringCopyN,
                             JS_DefineFunctions, JS_DefineProperty, JS_DefineProperties};
 use js::glue::bindgen::*;
 use js::glue::{PROPERTY_STUB, STRICT_PROPERTY_STUB};
 use js::crust::{JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ConvertStub, JS_ResolveStub};
 use ptr::null;
 use libc::c_uint;
@@ -90,26 +91,28 @@ extern fn finalize(_fop: *JSFreeOp, obj:
         let _doc: @Document = cast::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val));
     }
 }
 
 pub fn init(compartment: @mut Compartment, doc: @Document) {
     let obj = utils::define_empty_prototype(~"Document", None, compartment);
 
     let attrs = @~[
-        {name: compartment.add_name(~"documentElement"),
+        JSPropertySpec {
+         name: compartment.add_name(~"documentElement"),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: getDocumentElement, info: null()},
-         setter: {op: null(), info: null()}},
-        {name: null(),
+         getter: JSPropertyOpWrapper {op: getDocumentElement, info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}},
+        JSPropertySpec {
+         name: null(),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: null(), info: null()},
-         setter: {op: null(), info: null()}}];
+         getter: JSPropertyOpWrapper {op: null(), info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}}];
     vec::push(&mut compartment.global_props, attrs);
     vec::as_imm_buf(*attrs, |specs, _len| {
         assert JS_DefineProperties(compartment.cx.ptr, obj.ptr, specs) == 1;
     });
 
     compartment.register_class(utils::instance_jsclass(~"DocumentInstance", finalize));
 
     let instance : jsobj = result::unwrap(
--- a/servo/src/servo/dom/bindings/element.rs
+++ b/servo/src/servo/dom/bindings/element.rs
@@ -1,12 +1,13 @@
 use js::rust::{Compartment, jsobj};
 use js::{JS_ARGV, JSCLASS_HAS_RESERVED_SLOTS, JSPROP_ENUMERATE, JSPROP_SHARED, JSVAL_NULL,
             JS_THIS_OBJECT, JS_SET_RVAL, JSPROP_NATIVE_ACCESSORS};
-use js::jsapi::{JSContext, JSVal, JSObject, JSBool, jsid, JSClass, JSFreeOp, JSPropertySpec};
+use js::jsapi::{JSContext, JSVal, JSObject, JSBool, jsid, JSClass, JSFreeOp, JSPropertySpec,
+                JSPropertyOpWrapper, JSStrictPropertyOpWrapper};
 use js::jsapi::bindgen::{JS_ValueToString, JS_GetStringCharsZAndLength, JS_ReportError,
                             JS_GetReservedSlot, JS_SetReservedSlot, JS_NewStringCopyN,
                             JS_DefineFunctions, JS_DefineProperty};
 use js::jsapi::bindgen::*;
 use js::glue::bindgen::*;
 use js::crust::{JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ConvertStub};
 
 use content::content_task::{Content, task_from_context};
@@ -27,51 +28,53 @@ extern fn finalize(_fop: *JSFreeOp, obj:
         let val = JS_GetReservedSlot(obj, 0);
         let _node: ~NodeBundle = cast::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val));
     }
 }
 
 pub fn init(compartment: @mut Compartment) {
     let obj = utils::define_empty_prototype(~"Element", Some(~"Node"), compartment);
     let attrs = @~[
-        {name: compartment.add_name(~"tagName"),
+        JSPropertySpec {
+         name: compartment.add_name(~"tagName"),
          tinyid: 0,
          flags: (JSPROP_ENUMERATE | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: getTagName, info: null()},
-         setter: {op: null(), info: null()}},
-        {name: null(),
+         getter: JSPropertyOpWrapper {op: getTagName, info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}},
+        JSPropertySpec {
+         name: null(),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: null(), info: null()},
-         setter: {op: null(), info: null()}}];
+         getter: JSPropertyOpWrapper {op: null(), info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}}];
     vec::push(&mut compartment.global_props, attrs);
     vec::as_imm_buf(*attrs, |specs, _len| {
         JS_DefineProperties(compartment.cx.ptr, obj.ptr, specs);
     });
 
     compartment.register_class(utils::instance_jsclass(~"GenericElementInstance",
                                                        finalize));
 
     let _ = utils::define_empty_prototype(~"HTMLElement", Some(~"Element"), compartment);
     let _ = utils::define_empty_prototype(~"HTMLDivElement", Some(~"HTMLElement"), compartment);
     let _ = utils::define_empty_prototype(~"HTMLScriptElement", Some(~"HTMLElement"), compartment);
     let _ = utils::define_empty_prototype(~"HTMLHeadElement", Some(~"HTMLElement"), compartment);
 
     let obj = utils::define_empty_prototype(~"HTMLImageElement", Some(~"HTMLElement"), compartment);
     let attrs = @~[
-        {name: compartment.add_name(~"width"),
+        JSPropertySpec {name: compartment.add_name(~"width"),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: HTMLImageElement_getWidth, info: null()},
-         setter: {op: HTMLImageElement_setWidth, info: null()}},
-        {name: null(),
+         getter: JSPropertyOpWrapper {op: HTMLImageElement_getWidth, info: null()},
+         setter: JSStrictPropertyOpWrapper {op: HTMLImageElement_setWidth, info: null()}},
+        JSPropertySpec {name: null(),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: null(), info: null()},
-         setter: {op: null(), info: null()}}];
+         getter: JSPropertyOpWrapper {op: null(), info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}}];
     vec::push(&mut compartment.global_props, attrs);
     vec::as_imm_buf(*attrs, |specs, _len| {
         JS_DefineProperties(compartment.cx.ptr, obj.ptr, specs);
     });
 }
 
 #[allow(non_implicitly_copyable_typarams)]
 extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVal)
--- a/servo/src/servo/dom/bindings/node.rs
+++ b/servo/src/servo/dom/bindings/node.rs
@@ -1,12 +1,13 @@
 use js::rust::{Compartment, jsobj};
 use js::{JS_ARGV, JSCLASS_HAS_RESERVED_SLOTS, JSPROP_ENUMERATE, JSPROP_SHARED, JSVAL_NULL,
             JS_THIS_OBJECT, JS_SET_RVAL, JSPROP_NATIVE_ACCESSORS};
-use js::jsapi::{JSContext, JSVal, JSObject, JSBool, jsid, JSClass, JSFreeOp, JSPropertySpec};
+use js::jsapi::{JSContext, JSVal, JSObject, JSBool, jsid, JSClass, JSFreeOp, JSPropertySpec,
+                JSPropertyOpWrapper, JSStrictPropertyOpWrapper};
 use js::jsapi::bindgen::{JS_ValueToString, JS_GetStringCharsZAndLength, JS_ReportError,
                             JS_GetReservedSlot, JS_SetReservedSlot, JS_NewStringCopyN,
                             JS_DefineFunctions, JS_DefineProperty, JS_GetContextPrivate};
 use js::jsval::{INT_TO_JSVAL, JSVAL_TO_PRIVATE};
 use js::jsapi::bindgen::*;
 use js::glue::bindgen::*;
 
 use dom::node::{Node, NodeScope, Text, Doctype, Comment, Element};
@@ -17,39 +18,43 @@ use ptr::null;
 use super::utils;
 use super::element;
 use js;
 
 pub fn init(compartment: @mut Compartment) {
     let obj = utils::define_empty_prototype(~"Node", None, compartment);
 
     let attrs = @~[
-        {name: compartment.add_name(~"firstChild"),
+        JSPropertySpec {
+         name: compartment.add_name(~"firstChild"),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: getFirstChild, info: null()},
-         setter: {op: null(), info: null()}},
+         getter: JSPropertyOpWrapper {op: getFirstChild, info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}},
 
-        {name: compartment.add_name(~"nextSibling"),
+        JSPropertySpec {
+         name: compartment.add_name(~"nextSibling"),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: getNextSibling, info: null()},
-         setter: {op: null(), info: null()}},
+         getter: JSPropertyOpWrapper {op: getNextSibling, info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}},
 
-        {name: compartment.add_name(~"nodeType"),
+        JSPropertySpec {
+         name: compartment.add_name(~"nodeType"),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: getNodeType, info: null()},
-         setter: {op: null(), info: null()}},
+         getter: JSPropertyOpWrapper {op: getNodeType, info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}},
         
-        {name: null(),
+        JSPropertySpec {
+         name: null(),
          tinyid: 0,
          flags: (JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS) as u8,
-         getter: {op: null(), info: null()},
-         setter: {op: null(), info: null()}}];
+         getter: JSPropertyOpWrapper {op: null(), info: null()},
+         setter: JSStrictPropertyOpWrapper {op: null(), info: null()}}];
     vec::push(&mut compartment.global_props, attrs);
     vec::as_imm_buf(*attrs, |specs, _len| {
         JS_DefineProperties(compartment.cx.ptr, obj.ptr, specs);
     });
 }
 
 #[allow(non_implicitly_copyable_typarams)]
 pub fn create(cx: *JSContext, node: Node, scope: NodeScope) -> jsobj {
--- a/servo/src/servo/dom/cow.rs
+++ b/servo/src/servo/dom/cow.rs
@@ -58,21 +58,21 @@ to ensure that this data remains live in
 themselves.
 
 */
 
 use core::libc::types::os::arch::c95::size_t;
 use ptr::Ptr;
 use vec::push;
 
-type ScopeData<T,A> = {
+struct ScopeData<T,A> {
     mut layout_active: bool,
     mut free_list: ~[Handle<T,A>],
     mut first_dirty: Handle<T,A>
-};
+}
 
 struct ScopeResource<T,A> {
     d : ScopeData<T,A>,
 
     drop {
         unsafe {
             for self.d.free_list.each |h| { free_handle(*h); }
         }
@@ -144,17 +144,17 @@ impl<T:Owned,A> Handle<T,A> {
 }
 
 impl<T:Owned,A> cmp::Eq for Handle<T,A> {
     pure fn eq(&self, other: &Handle<T,A>) -> bool { **self == **other }
     pure fn ne(&self, other: &Handle<T,A>) -> bool { **self != **other }
 }
 
 // Private methods
-impl<T: Copy Owned,A> Scope<T,A> {
+impl<T: Copy + Owned,A> Scope<T,A> {
     fn clone(v: *T) -> *T {
         unsafe {
             let n: *mut T =
                 cast::reinterpret_cast(&libc::calloc(sys::size_of::<T>() as size_t, 1u as size_t));
 
             // n.b.: this assignment will run the drop glue for <T,A>. *Hopefully* the fact that
             // everything is initialized to NULL by calloc will make this ok.  We may have to make the
             // take glue be tolerant of this.
@@ -185,23 +185,26 @@ pub unsafe fn wrap<T:Owned, A>(data: *Ha
     _Handle(data)
 }
 
 fn null_handle<T:Owned,A>() -> Handle<T,A> {
     _Handle(ptr::null())
 }
 
 pub fn Scope<T:Owned,A>() -> Scope<T,A> {
-    @ScopeResource({mut layout_active: false,
-                    mut free_list: ~[],
-                    mut first_dirty: null_handle()})
+    @ScopeResource(
+        ScopeData {
+            mut layout_active: false,
+            mut free_list: ~[],
+            mut first_dirty: null_handle()
+        })
 }
 
 // Writer methods
-impl<T:Copy Owned,A> Scope<T,A> {
+impl<T:Copy + Owned,A> Scope<T,A> {
     fn is_reader_forked() -> bool {
         self.d.layout_active
     }
 
     fn reader_forked() {
         assert !self.d.layout_active;
         assert self.d.first_dirty.is_null();
         self.d.layout_active = true;
--- a/servo/src/servo/dom/event.rs
+++ b/servo/src/servo/dom/event.rs
@@ -1,5 +1,5 @@
 pub enum Event {
-    ResizeEvent(uint, uint, pipes::Chan<()>),
+    ResizeEvent(uint, uint, comm::Chan<()>),
     ReflowEvent        
 }
 
--- a/servo/src/servo/dom/node.rs
+++ b/servo/src/servo/dom/node.rs
@@ -12,20 +12,20 @@ use js::rust::Compartment;
 use js::{JSPROP_ENUMERATE, JSPROP_SHARED};
 use layout::debug::DebugMethods;
 use layout::flow::FlowContext;
 use ptr::null;
 use std::arc::ARC;
 use util::tree;
 use super::cow;
 
-pub enum NodeData = {
+pub struct NodeData {
     tree: tree::Tree<Node>,
     kind: ~NodeKind,
-};
+}
 
 /* The tree holding Nodes (read-only) */
 pub enum NodeTree { NodeTree }
 
 impl NodeTree {
     fn each_child(node: &Node, f: fn(&Node) -> bool) {
         tree::each_child(&self, node, f)
     }
@@ -119,41 +119,41 @@ pub fn define_bindings(compartment: @mut
     bindings::window::init(compartment, win);
     bindings::document::init(compartment, doc);
     bindings::node::init(compartment);
     bindings::element::init(compartment);
 }
 
 
 /** The COW rd_aux data is a (weak) pointer to the layout data,
-   defined by this `LayoutData` enum. It contains the CSS style object
+   defined by this `LayoutData` struct. It contains the CSS style object
    as well as the primary `RenderBox`.
 
    Note that there may be multiple boxes per DOM node. */
-enum LayoutData = {
+pub struct LayoutData {
     mut style: Option<CompleteSelectResults>,
     mut flow:  Option<@FlowContext>
-};
+}
 
 pub type Node = cow::Handle<NodeData, LayoutData>;
 
 pub type NodeScope = cow::Scope<NodeData, LayoutData>;
 
 pub fn NodeScope() -> NodeScope {
     cow::Scope()
 }
 
 pub trait NodeScopeExtensions {
     fn new_node(+k: NodeKind) -> Node;
 }
 
 #[allow(non_implicitly_copyable_typarams)]
 impl NodeScopeExtensions for NodeScope {
     fn new_node(k: NodeKind) -> Node {
-        self.handle(&NodeData({tree: tree::empty(), kind: ~k}))
+        self.handle(&NodeData {tree: tree::empty(), kind: ~k})
     }
 }
 
 impl NodeScope {
     fn each_child(node: &Node, f: fn(&Node) -> bool) {
         tree::each_child(&self, node, f)
     }
 
--- a/servo/src/servo/dom/window.rs
+++ b/servo/src/servo/dom/window.rs
@@ -1,9 +1,9 @@
-use core::pipes::{Port, Chan};
+use core::comm::{Port, Chan};
 use content::content_task::{ControlMsg, Timer, ExitMsg};
 use js::jsapi::JSVal;
 use dvec::DVec;
 use util::task::spawn_listener;
 use std::timer;
 use std::uv_global_loop;
 
 pub enum TimerControlMsg {
@@ -64,17 +64,17 @@ impl Window {
         // to the relevant content handler that will deal with it.
         timer::delayed_send(&uv_global_loop::get(),
                             timeout,
                             &self.timer_chan,
                             TimerMessage_Fire(~TimerData(argc, argv)));
     }
 }
 
-pub fn Window(content_chan: pipes::SharedChan<ControlMsg>) -> Window {
+pub fn Window(content_chan: comm::SharedChan<ControlMsg>) -> Window {
         
     Window {
         timer_chan: do spawn_listener |timer_port: Port<TimerControlMsg>| {
             loop {
                 match timer_port.recv() {
                     TimerMessage_Close => break,
                     TimerMessage_Fire(td) => {
                         content_chan.send(Timer(td));
--- a/servo/src/servo/engine.rs
+++ b/servo/src/servo/engine.rs
@@ -3,17 +3,17 @@ use content::content_task;
 use dom::event::Event;
 use layout::layout_task;
 use layout::layout_task::LayoutTask;
 use resource::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
 use resource::resource_task::ResourceTask;
 use resource::resource_task;
 use util::task::spawn_listener;
 
-use core::pipes::{Port, Chan};
+use core::comm::{Port, Chan};
 use gfx::compositor::Compositor;
 use gfx::opts::Opts;
 use gfx::render_task::RenderTask;
 use gfx::render_task;
 use std::cell::Cell;
 use std::net::url::Url;
 
 pub type EngineTask = Chan<Msg>;
@@ -30,18 +30,18 @@ pub struct Engine<C> {
     resource_task: ResourceTask,
     image_cache_task: ImageCacheTask,
     layout_task: LayoutTask,
     content_task: ContentTask
 }
 
 pub fn Engine<C:Compositor + Owned + Clone>(compositor: C,
                                             opts: &Opts,
-                                            dom_event_port: pipes::Port<Event>,
-                                            dom_event_chan: pipes::SharedChan<Event>,
+                                            dom_event_port: comm::Port<Event>,
+                                            dom_event_chan: comm::SharedChan<Event>,
                                             resource_task: ResourceTask,
                                             image_cache_task: ImageCacheTask)
                                          -> EngineTask {
     let dom_event_port = Cell(dom_event_port);
     let dom_event_chan = Cell(dom_event_chan);
 
     let opts = Cell(copy *opts);
     do spawn_listener::<Msg> |request| {
@@ -82,17 +82,17 @@ impl<C:Compositor + Owned + Clone> Engin
             }
             return true;
           }
 
           ExitMsg(sender) => {
             self.content_task.send(content_task::ExitMsg);
             self.layout_task.send(layout_task::ExitMsg);
             
-            let (response_port, response_chan) = pipes::stream();
+            let (response_port, response_chan) = comm::stream();
 
             self.render_task.send(render_task::ExitMsg(response_chan));
             response_port.recv();
 
             self.image_cache_task.exit();
             self.resource_task.send(resource_task::Exit);
 
             sender.send(());
--- a/servo/src/servo/html/cssparse.rs
+++ b/servo/src/servo/html/cssparse.rs
@@ -1,15 +1,15 @@
 /*!
 Some little helpers for hooking up the HTML parser with the CSS parser
 */
 
 use resource::resource_task::{ResourceTask, ProgressMsg, Load, Payload, Done};
 
-use core::pipes::{Port, Chan};
+use core::comm::{Port, Chan};
 use core::pipes;
 use core::str;
 use newcss::stylesheet::Stylesheet;
 use newcss::util::DataStream;
 use std::cell::Cell;
 use std::net::url::Url;
 use std::net::url;
 
@@ -17,20 +17,20 @@ use std::net::url;
 pub enum StylesheetProvenance {
     UrlProvenance(Url),
     InlineProvenance(Url, ~str),
 }
 
 pub fn spawn_css_parser(provenance: StylesheetProvenance,
                         resource_task: ResourceTask)
                      -> Port<Stylesheet> {
-    let (result_port, result_chan) = pipes::stream();
+    let (result_port, result_chan) = comm::stream();
 
     let provenance_cell = Cell(provenance);
-    do task::spawn |copy resource_task| {
+    do task::spawn {
         let url = do provenance_cell.with_ref |p| {
             match *p {
                 UrlProvenance(copy the_url) => the_url,
                 InlineProvenance(copy the_url, _) => the_url
             }
         };
 
         let sheet = Stylesheet::new(url, data_stream(provenance_cell.take(),
@@ -39,17 +39,17 @@ pub fn spawn_css_parser(provenance: Styl
     }
 
     return result_port;
 }
 
 fn data_stream(provenance: StylesheetProvenance, resource_task: ResourceTask) -> DataStream {
     match provenance {
         UrlProvenance(url) => {
-            let (input_port, input_chan) = pipes::stream();
+            let (input_port, input_chan) = comm::stream();
             resource_task.send(Load(url, input_chan));
             resource_port_to_data_stream(input_port)
         }
         InlineProvenance(_, data) => {
             data_to_data_stream(data)
         }
     }
 }
--- a/servo/src/servo/html/hubbub_html_parser.rs
+++ b/servo/src/servo/html/hubbub_html_parser.rs
@@ -6,17 +6,17 @@ use dom::element::*;
 use dom::event::{Event, ReflowEvent};
 use dom::node::{Comment, Doctype, DoctypeData, Element, Node, NodeScope, NodeScopeExtensions};
 use dom::node::{Text};
 use resource::image_cache_task::ImageCacheTask;
 use resource::image_cache_task;
 use resource::resource_task::{Done, Load, Payload, ResourceTask};
 use util::task::{spawn_listener, spawn_conversation};
 
-use core::pipes::{Chan, Port, SharedChan};
+use core::comm::{Chan, Port, SharedChan};
 use html::cssparse::{InlineProvenance, StylesheetProvenance, UrlProvenance, spawn_css_parser};
 use hubbub::hubbub::Attribute;
 use hubbub::hubbub;
 use newcss::stylesheet::Stylesheet;
 use std::net::url::Url;
 use std::net::url;
 
 type JSResult = ~[~[u8]];
@@ -79,20 +79,20 @@ fn css_link_listener(to_parent: Chan<Opt
 fn js_script_listener(to_parent: Chan<~[~[u8]]>,
                       from_parent: Port<JSMessage>,
                       resource_task: ResourceTask) {
     let mut result_vec = ~[];
 
     loop {
         match from_parent.recv() {
             JSTaskNewFile(url) => {
-                let (result_port, result_chan) = pipes::stream();
+                let (result_port, result_chan) = comm::stream();
                 let resource_task = resource_task.clone();
                 do task::spawn {
-                    let (input_port, input_chan) = pipes::stream();
+                    let (input_port, input_chan) = comm::stream();
                     // TODO: change copy to move once we can move into closures
                     resource_task.send(Load(copy url, input_chan));
 
                     let mut buf = ~[];
                     loop {
                         match input_port.recv() {
                             Payload(data) => {
                                 buf += data;
@@ -374,17 +374,17 @@ pub fn parse_html(scope: NodeScope,
                     }
                 }
                 complete_script(scope, script, url, js_chan2.clone());
                 debug!("complete script");
             }
         });
         debug!("set tree handler");
 
-        let (input_port, input_chan) = pipes::stream();
+        let (input_port, input_chan) = comm::stream();
         resource_task.send(Load(copy *url, input_chan));
         debug!("loaded page");
         loop {
             match input_port.recv() {
                 Payload(data) => {
                     debug!("received data");
                     parser.parse_chunk(data);
                 }
--- a/servo/src/servo/layout/aux.rs
+++ b/servo/src/servo/layout/aux.rs
@@ -12,20 +12,20 @@ pub trait LayoutAuxMethods {
 
 impl LayoutAuxMethods for Node {
     /** If none exists, creates empty layout data for the node (the reader-auxiliary
      * box in the COW model) and populates it with an empty style object.
      */
     fn initialize_layout_data() -> Option<@LayoutData> {
         match self.has_aux() {
             false => {
-                let data = @LayoutData({
+                let data = @LayoutData {
                     mut style : None,
                     mut flow  : None
-                });
+                };
                 self.set_aux(data); Some(data)
             },
             true => None
         }
     }
 
     /**
      * Initializes layout data and styles for a Node tree, if any nodes do not have
--- a/servo/src/servo/layout/inline.rs
+++ b/servo/src/servo/layout/inline.rs
@@ -317,32 +317,37 @@ priv impl TextRunScanner {
             debug!("%u: %? --> %s", i, nr.range, nr.node.debug_str()); ()
         }
         debug!("--------------------");
 
         self.clump.reset(self.clump.end(), 0);
     } /* /fn flush_clump_to_list */
 }
 
+struct PendingLine {
+    mut range: Range,
+    mut width: Au
+}
+
 struct LineboxScanner {
     flow: @FlowContext,
     new_boxes: DVec<@RenderBox>,
     work_list: @mut DList<@RenderBox>,
-    pending_line: {mut range: Range, mut width: Au},
+    pending_line: PendingLine,
     line_spans: DVec<Range>,
 }
 
 fn LineboxScanner(inline: @FlowContext) -> LineboxScanner {
     assert inline.starts_inline_flow();
 
     LineboxScanner {
         flow: inline,
         new_boxes: DVec(),
         work_list: DList(),
-        pending_line: {mut range: Range::empty(), mut width: Au(0)},
+        pending_line: PendingLine {mut range: Range::empty(), mut width: Au(0)},
         line_spans: DVec()
     }
 }
 
 impl LineboxScanner {
     priv fn reset_scanner(&mut self) {
         debug!("Resetting line box scanner's state for flow f%d.", self.flow.d().id);
         self.line_spans.set(~[]);
--- a/servo/src/servo/layout/layout_task.rs
+++ b/servo/src/servo/layout/layout_task.rs
@@ -13,17 +13,17 @@ use layout::context::LayoutContext;
 use layout::debug::{BoxedDebugMethods, DebugMethods};
 use layout::display_list_builder::{DisplayListBuilder, FlowDisplayListBuilderMethods};
 use layout::traverse::*;
 use resource::image_cache_task::{ImageCacheTask, ImageResponseMsg};
 use resource::local_image_cache::LocalImageCache;
 use util::task::spawn_listener;
 use util::time::time;
 
-use core::pipes::{Chan, Port, SharedChan};
+use core::comm::{Chan, Port, SharedChan};
 use core::dvec::DVec;
 use core::mutable::Mut;
 use core::task::*;
 use core::util::replace;
 use geom::point::Point2D;
 use geom::rect::Rect;
 use geom::size::Size2D;
 use gfx::display_list::DisplayList;
@@ -74,19 +74,19 @@ impl Damage {
             (MatchSelectorsDamage, _) => *self = MatchSelectorsDamage
         }
     }
 }
 
 pub struct BuildData {
     node: Node,
     url: Url,
-    dom_event_chan: pipes::SharedChan<Event>,
+    dom_event_chan: comm::SharedChan<Event>,
     window_size: Size2D<uint>,
-    content_join_chan: pipes::Chan<()>,
+    content_join_chan: comm::Chan<()>,
     damage: Damage,
 }
 
 pub fn LayoutTask(render_task: RenderTask,
                   img_cache_task: ImageCacheTask,
                   opts: Opts) -> LayoutTask {
     SharedChan(spawn_listener::<Msg>(|from_content| {
         Layout(render_task.clone(), img_cache_task.clone(), from_content, &opts).start();
@@ -290,17 +290,17 @@ impl Layout {
         }
     }
 
     // When images can't be loaded in time to display they trigger
     // this callback in some task somewhere. This will send a message
     // to the content task, and ultimately cause the image to be
     // re-requested. We probably don't need to go all the way back to
     // the content task for this.
-    fn make_on_image_available_cb(dom_event_chan: pipes::SharedChan<Event>) -> @fn() -> ~fn(ImageResponseMsg) {
+    fn make_on_image_available_cb(dom_event_chan: comm::SharedChan<Event>) -> @fn() -> ~fn(ImageResponseMsg) {
         // This has a crazy signature because the image cache needs to
         // make multiple copies of the callback, and the dom event
         // channel is not a copyable type, so this is actually a
         // little factory to produce callbacks
         let f: @fn() -> ~fn(ImageResponseMsg) = || {
             let dom_event_chan = dom_event_chan.clone();
             let f: ~fn(ImageResponseMsg) = |_| {
                 dom_event_chan.send(ReflowEvent)
--- a/servo/src/servo/platform/osmain.rs
+++ b/servo/src/servo/platform/osmain.rs
@@ -1,15 +1,15 @@
 use ShareGlContext = sharegl::platform::Context;
 use dom::event::{Event, ResizeEvent};
 use platform::resize_rate_limiter::ResizeRateLimiter;
 
 use azure::azure_hl::{BackendType, B8G8R8A8, DataSourceSurface, DrawTarget, SourceSurfaceMethods};
 use core::dvec::DVec;
-use core::pipes::{Chan, SharedChan, Port};
+use core::comm::{Chan, SharedChan, Port};
 use core::task::TaskBuilder;
 use core::util;
 use geom::matrix::{Matrix4, identity};
 use geom::point::Point2D;
 use geom::rect::Rect;
 use geom::size::Size2D;
 use gfx::compositor::{Compositor, LayerBuffer, LayerBufferSet};
 use gfx::opts::Opts;
@@ -41,23 +41,23 @@ enum Mode {
 }
 
 enum Window {
 	GlutWindow(glut::Window),
 	ShareWindow(ShareGlContext)
 }
 
 pub enum Msg {
-    BeginDrawing(pipes::Chan<LayerBufferSet>),
-    Draw(pipes::Chan<LayerBufferSet>, LayerBufferSet),
-    AddKeyHandler(pipes::Chan<()>),
+    BeginDrawing(comm::Chan<LayerBufferSet>),
+    Draw(comm::Chan<LayerBufferSet>, LayerBufferSet),
+    AddKeyHandler(comm::Chan<()>),
     Exit
 }
 
-pub fn OSMain(dom_event_chan: pipes::SharedChan<Event>, opts: Opts) -> OSMain {
+pub fn OSMain(dom_event_chan: comm::SharedChan<Event>, opts: Opts) -> OSMain {
     let dom_event_chan = Cell(dom_event_chan);
     OSMain {
         chan: SharedChan(on_osmain::<Msg>(|po| {
             let po = Cell(po);
             do platform::runmain {
                 debug!("preparing to enter main loop");
 
                 // FIXME: Use the servo options.
@@ -271,30 +271,30 @@ fn mainloop(mode: Mode,
     }
 }
 
 /**
 Implementation to allow the osmain channel to be used as a graphics
 compositor for the renderer
 */
 impl Compositor for OSMain {
-    fn begin_drawing(next_dt: pipes::Chan<LayerBufferSet>) {
+    fn begin_drawing(next_dt: comm::Chan<LayerBufferSet>) {
         self.chan.send(BeginDrawing(next_dt))
     }
-    fn draw(next_dt: pipes::Chan<LayerBufferSet>, draw_me: LayerBufferSet) {
+    fn draw(next_dt: comm::Chan<LayerBufferSet>, draw_me: LayerBufferSet) {
         self.chan.send(Draw(next_dt, draw_me))
     }
 }
 
 struct SurfaceSet {
     mut front: Surface,
     mut back: Surface,
 }
 
-fn lend_surface(surfaces: &SurfaceSet, receiver: pipes::Chan<LayerBufferSet>) {
+fn lend_surface(surfaces: &SurfaceSet, receiver: comm::Chan<LayerBufferSet>) {
     // We are in a position to lend out the surface?
     assert surfaces.front.have;
     // Ok then take it
     let old_layer_buffers = util::replace(&mut surfaces.front.layer_buffer_set.buffers, ~[]);
     let new_layer_buffers = do old_layer_buffers.map |layer_buffer| {
         let draw_target_ref = &layer_buffer.draw_target;
         let layer_buffer = LayerBuffer {
             draw_target: draw_target_ref.clone(),
@@ -344,19 +344,19 @@ fn Surface(backend: BackendType) -> Surf
         stride: 800
     };
     let layer_buffer_set = LayerBufferSet { buffers: ~[ layer_buffer ] };
     Surface { layer_buffer_set: layer_buffer_set, have: true }
 }
 
 /// A function for spawning into the platform's main thread
 fn on_osmain<T: Owned>(f: fn~(po: Port<T>)) -> Chan<T> {
-    let (setup_po, setup_ch) = pipes::stream();
+    let (setup_po, setup_ch) = comm::stream();
     do task::task().sched_mode(task::PlatformThread).spawn {
-        let (po, ch) = pipes::stream();
+        let (po, ch) = comm::stream();
         setup_ch.send(ch);
         f(po);
     }
     setup_po.recv()
 }
 
 // #[cfg(target_os = "linux")]
 mod platform {
--- a/servo/src/servo/platform/resize_rate_limiter.rs
+++ b/servo/src/servo/platform/resize_rate_limiter.rs
@@ -4,24 +4,24 @@ based on how fast content dispatches tho
 before sending the next. If the window is resized multiple times before an event is handled
 then some events will never be sent.
 */
 
 use dom::event::{Event, ResizeEvent};
 
 pub struct ResizeRateLimiter {
     /// The channel we send resize events on
-    /* priv */ dom_event_chan: pipes::SharedChan<Event>,
+    /* priv */ dom_event_chan: comm::SharedChan<Event>,
     /// The port we are waiting on for a response to the last resize event
-    /* priv */ mut last_response_port: Option<pipes::Port<()>>,
+    /* priv */ mut last_response_port: Option<comm::Port<()>>,
     /// The next window resize event we should fire
     /* priv */ mut next_resize_event: Option<(uint, uint)>
 }
 
-pub fn ResizeRateLimiter(dom_event_chan: pipes::SharedChan<Event>) -> ResizeRateLimiter {
+pub fn ResizeRateLimiter(dom_event_chan: comm::SharedChan<Event>) -> ResizeRateLimiter {
     ResizeRateLimiter {
         dom_event_chan: dom_event_chan,
         last_response_port: None,
         next_resize_event: None
     }
 }
 
 impl ResizeRateLimiter {
@@ -54,13 +54,13 @@ impl ResizeRateLimiter {
                     self.next_resize_event = None;
                 }
             }
             None => ()
         }
     }
 
     priv fn send_event(width: uint, height: uint) {
-        let (port, chan) = pipes::stream();
+        let (port, chan) = comm::stream();
         self.dom_event_chan.send(ResizeEvent(width, height, chan));
         self.last_response_port = Some(port);
     }
 }
--- a/servo/src/servo/servo.rc
+++ b/servo/src/servo/servo.rc
@@ -92,17 +92,17 @@ use servo_util = util;
 extern mod core_graphics;
 #[cfg(target_os="macos")]
 extern mod core_text;
 
 use engine::{Engine, ExitMsg, LoadURLMsg};  // FIXME: "ExitMsg" is pollution.
 use platform::osmain::{AddKeyHandler, OSMain};
 
 use core::option::swap_unwrap;
-use core::pipes::{Port, Chan};
+use core::comm::{Port, Chan};
 
 pub use gfx::opts::{Opts, Png, Screen};  // FIXME: Do we really want "Screen" and "Png" visible?
 pub use gfx::resource;
 pub use gfx::resource::image_cache_task::ImageCacheTask;
 pub use gfx::resource::resource_task::ResourceTask;
 pub use gfx::text;
 pub use gfx::util::url::make_url;
 
@@ -121,24 +121,24 @@ fn run(opts: &Opts) {
             fail!(~"servo asks that you stick to a single URL in PNG output mode")
         }
         run_pipeline_png(opts, *outfile)
       }
     }
 }
 
 fn run_pipeline_screen(opts: &Opts) {
-    let (dom_event_port, dom_event_chan) = pipes::stream();
-    let dom_event_chan = pipes::SharedChan(dom_event_chan);
+    let (dom_event_port, dom_event_chan) = comm::stream();
+    let dom_event_chan = comm::SharedChan(dom_event_chan);
 
     // The platform event handler thread
     let osmain = OSMain(dom_event_chan.clone(), copy *opts);
 
     // Send each file to render then wait for keypress
-    let (keypress_from_osmain, keypress_to_engine) = pipes::stream();
+    let (keypress_from_osmain, keypress_to_engine) = comm::stream();
     osmain.chan.send(AddKeyHandler(keypress_to_engine));
 
     // Create a servo instance
     let resource_task = ResourceTask();
     let image_cache_task = ImageCacheTask(resource_task.clone());
     let engine_task = Engine(osmain.clone(),
                              opts,
                              dom_event_port,
@@ -155,17 +155,17 @@ fn run_pipeline_screen(opts: &Opts) {
         match keypress_from_osmain.try_recv() {
           Some(*) => { }
           None => { error!("keypress stream closed unexpectedly") }
         };
     }
 
     // Shut everything down
     debug!("master: Shut down");
-    let (exit_response_from_engine, exit_chan) = pipes::stream();
+    let (exit_response_from_engine, exit_chan) = comm::stream();
     engine_task.send(engine::ExitMsg(exit_chan));
     exit_response_from_engine.recv();
 
     osmain.chan.send(platform::osmain::Exit);
 }
 
 fn run_pipeline_png(_opts: &Opts, _outfile: &str) {
     fail!(~"PNG compositor is broken");
@@ -176,18 +176,18 @@ fn run_pipeline_png(url: ~str, outfile: 
     // Use a PNG encoder as the graphics compositor
     use gfx::png_compositor;
     use png_compositor::PngCompositor;
     use io::{Writer, buffered_file_writer};
     use resource::resource_task::ResourceTask;
     use resource::image_cache_task::SyncImageCacheTask;
 
     listen(|pngdata_from_compositor| {
-        let (dom_event_port, dom_event_chan) = pipes::stream();
-        let dom_event_chan = pipes::SharedChan(dom_event_chan);
+        let (dom_event_port, dom_event_chan) = comm::stream();
+        let dom_event_chan = comm::SharedChan(dom_event_chan);
 
         let compositor = PngCompositor(pngdata_from_compositor);
         let resource_task = ResourceTask();
         // For the PNG pipeline we are using a synchronous image task so that all images will be
         // fulfilled before the first paint.
         let image_cache_task = SyncImageCacheTask(resource_task);
         let engine_task = Engine(copy compositor,
                                  dom_event_port,
@@ -196,14 +196,14 @@ fn run_pipeline_png(url: ~str, outfile: 
                                  image_cache_task);
         engine_task.send(LoadURLMsg(make_url(copy url, None)));
 
         match buffered_file_writer(&Path(outfile)) {
           Ok(writer) => writer.write(pngdata_from_compositor.recv()),
           Err(e) => fail!(e)
         }
 
-        let (exit_chan, exit_response_from_engine) = pipes::stream();
+        let (exit_chan, exit_response_from_engine) = comm::stream();
         engine_task.send(engine::ExitMsg(exit_chan));
         exit_response_from_engine.recv();
         compositor.send(png_compositor::Exit);
     })
 }
--- a/servo/src/servo/util/task.rs
+++ b/servo/src/servo/util/task.rs
@@ -1,23 +1,22 @@
-use core::pipes::{Chan, Port};
-use core::pipes;
+use core::comm::{Chan, Port};
 use core::task;
 use std::cell::Cell;
 
 pub fn spawn_listener<A: Owned>(f: fn~(Port<A>)) -> Chan<A> {
-    let (setup_po, setup_ch) = pipes::stream();
+    let (setup_po, setup_ch) = comm::stream();
     do task::spawn {
-        let (po, ch) = pipes::stream();
+        let (po, ch) = comm::stream();
         setup_ch.send(ch);
         f(po);
     }
     setup_po.recv()
 }
 
 pub fn spawn_conversation<A: Owned, B: Owned>(f: fn~(Port<A>, Chan<B>)) -> (Port<B>, Chan<A>) {
-    let (from_child, to_parent) = pipes::stream();
+    let (from_child, to_parent) = comm::stream();
     let to_parent = Cell(to_parent);
     let to_child = do spawn_listener |from_parent| {
         f(from_parent, to_parent.take())
     };
     (from_child, to_child)
 }
--- a/servo/src/servo/util/tree.rs
+++ b/servo/src/servo/util/tree.rs
@@ -1,21 +1,21 @@
 use core::vec;
 
 // A generic tree datatype.
 //
 // TODO: Use traits.
 
-pub type Tree<T> = {
+pub struct Tree<T> {
     mut parent: Option<T>,
     mut first_child: Option<T>,
     mut last_child: Option<T>,
     mut prev_sibling: Option<T>,
     mut next_sibling: Option<T>
-};
+}
 
 pub trait ReadMethods<T> {
     fn with_tree_fields<R>(&T, f: fn(&Tree<T>) -> R) -> R;
 }
 
 pub trait WriteMethods<T> {
     fn with_tree_fields<R>(&T, f: fn(&Tree<T>) -> R) -> R;
     pure fn tree_eq(&T, &T) -> bool;
@@ -54,21 +54,23 @@ pub fn prev_sibling<T:Copy,O:ReadMethods
     ops.with_tree_fields(node, |tf| tf.prev_sibling)
 }
 
 pub fn parent<T:Copy,O:ReadMethods<T>>(ops: &O, node: &T) -> Option<T> {
     ops.with_tree_fields(node, |tf| tf.parent)
 }
 
 pub fn empty<T>() -> Tree<T> {
-    {mut parent: None,
-     mut first_child: None,
-     mut last_child: None,
-     mut prev_sibling: None,
-     mut next_sibling: None}
+    Tree {
+        mut parent: None,
+        mut first_child: None,
+        mut last_child: None,
+        mut prev_sibling: None,
+        mut next_sibling: None
+    }
 }
 
 pub fn add_child<T:Copy,O:WriteMethods<T>>(ops: &O, parent: T, child: T) {
     assert !ops.tree_eq(&parent, &child);
 
     ops.with_tree_fields(&child, |child_tf| {
         match child_tf.parent {
           Some(_) => { fail!(~"Already has a parent"); }