diff --git a/src/rust-css b/src/rust-css index 37cfbe86b6c..b0f9bd32d9d 160000 --- a/src/rust-css +++ b/src/rust-css @@ -1 +1 @@ -Subproject commit 37cfbe86b6c024de87d1815843c956f4de535e9c +Subproject commit b0f9bd32d9de0e2fb3eca6ed02d58c4709a28693 diff --git a/src/servo/content/content_task.rs b/src/servo/content/content_task.rs index f79a22b21a0..7a74b8ade00 100644 --- a/src/servo/content/content_task.rs +++ b/src/servo/content/content_task.rs @@ -197,9 +197,14 @@ impl Content { // Send stylesheets over to layout // FIXME: Need these should be streamed to layout as they are parsed // and do not need to stop here in the content task - // FIXME: This currently expects exactly one stylesheet - let sheet = result.style_port.recv(); - self.layout_task.send(AddStylesheet(move sheet)); + loop { + match result.style_port.recv() { + Some(move sheet) => { + self.layout_task.send(AddStylesheet(move sheet)); + } + None => break + } + } let js_scripts = result.js_port.recv(); debug!("js_scripts: %?", js_scripts); diff --git a/src/servo/css/matching.rs b/src/servo/css/matching.rs index c16f4f8a140..2a7403b450a 100644 --- a/src/servo/css/matching.rs +++ b/src/servo/css/matching.rs @@ -210,7 +210,7 @@ impl Node : MatchingMethods { // the latest rule takes precedence over the others. So we // just overwrite style information as we go. - for styles.each |sty| { + /*for styles.each |sty| { let (selectors, decls) = copy **sty; for selectors.each |sel| { if self.matches_selector(*sel) { @@ -219,9 +219,7 @@ impl Node : MatchingMethods { } } } - } - - self.aux(|a| debug!("Changed the style to: %?", copy *a.style)); + }*/ } } diff --git a/src/servo/html/hubbub_html_parser.rs b/src/servo/html/hubbub_html_parser.rs index 73d1f61444f..d14a0a60fb7 100644 --- a/src/servo/html/hubbub_html_parser.rs +++ b/src/servo/html/hubbub_html_parser.rs @@ -30,7 +30,7 @@ enum JSMessage { struct HtmlParserResult { root: Node, - style_port: comm::Port, + style_port: comm::Port>, js_port: comm::Port, } @@ -49,7 +49,7 @@ spawned, collates them, and sends them to the given result channel. * `from_parent` - A port on which to receive new links. */ -fn css_link_listener(to_parent : comm::Chan, from_parent : comm::Port, +fn css_link_listener(to_parent : comm::Chan>, from_parent : comm::Port, resource_task: ResourceTask) { let mut result_vec = ~[]; @@ -64,9 +64,12 @@ fn css_link_listener(to_parent : comm::Chan, from_parent : comm::Por } } - let css_rules = vec::flat_map(result_vec, |result_port| { result_port.recv() }); - - to_parent.send(move css_rules); + // Send the sheets back in order + // FIXME: Shouldn't wait until after we've recieved CSSTaskExit to start sending these + do vec::consume(move result_vec) |_i, port| { + to_parent.send(Some(port.recv())); + } + to_parent.send(None); } fn js_script_listener(to_parent : comm::Chan<~[~[u8]]>, from_parent : comm::Port, @@ -159,9 +162,9 @@ pub fn parse_html(scope: NodeScope, resource_task: ResourceTask, image_cache_task: ImageCacheTask) -> HtmlParserResult unsafe { // Spawn a CSS parser to receive links to CSS style sheets. - let (css_port, css_chan): (comm::Port, comm::Chan) = + let (css_port, css_chan): (comm::Port>, comm::Chan) = do task::spawn_conversation |css_port: comm::Port, - css_chan: comm::Chan| { + css_chan: comm::Chan>| { css_link_listener(css_chan, css_port, resource_task); };