diff options
author | Brian Anderson <banderson@mozilla.com> | 2013-06-24 18:42:17 -0700 |
---|---|---|
committer | Brian Anderson <banderson@mozilla.com> | 2013-06-26 13:44:26 -0700 |
commit | 56e5ba1b825b77eaf56db7211ba7bf9549421c0b (patch) | |
tree | 008ba1ffb9fe69cf189c3cc461d65f41dd0fec9b /src/components/script/html/cssparse.rs | |
parent | a01f6b97f23b06dda6587f9b1c3d4e2ec3cf1f82 (diff) | |
download | servo-56e5ba1b825b77eaf56db7211ba7bf9549421c0b.tar.gz servo-56e5ba1b825b77eaf56db7211ba7bf9549421c0b.zip |
Update for language changes
Diffstat (limited to 'src/components/script/html/cssparse.rs')
-rw-r--r-- | src/components/script/html/cssparse.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/components/script/html/cssparse.rs b/src/components/script/html/cssparse.rs index 7d1e4214462..1278ba47f6c 100644 --- a/src/components/script/html/cssparse.rs +++ b/src/components/script/html/cssparse.rs @@ -4,13 +4,15 @@ /// Some little helpers for hooking up the HTML parser with the CSS parser. -use core::cell::Cell; -use core::comm::Port; -use core::str; +use std::cell::Cell; +use std::comm; +use std::comm::Port; +use std::task; +use std::str; use newcss::stylesheet::Stylesheet; use newcss::util::DataStream; use servo_net::resource_task::{ResourceTask, ProgressMsg, Load, Payload, Done}; -use std::net::url::Url; +use extra::net::url::Url; /// Where a style sheet comes from. pub enum StylesheetProvenance { @@ -23,12 +25,12 @@ pub fn spawn_css_parser(provenance: StylesheetProvenance, -> Port<Stylesheet> { let (result_port, result_chan) = comm::stream(); - let provenance_cell = Cell(provenance); + let provenance_cell = Cell::new(provenance); 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 + UrlProvenance(ref the_url) => copy *the_url, + InlineProvenance(ref the_url, _) => copy *the_url } }; @@ -64,13 +66,14 @@ fn resource_port_to_data_stream(input_port: Port<ProgressMsg>) -> DataStream { } fn data_to_data_stream(data: ~str) -> DataStream { - let data_cell = Cell(data); + let data_cell = Cell::new(data); return || { if data_cell.is_empty() { None } else { // FIXME: Blech, a copy. - Some(str::to_bytes(data_cell.take())) + let data = data_cell.take(); + Some(data.as_bytes().to_owned()) } } } |