mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Fix invalid moves per latest rustc build
This commit is contained in:
parent
3ffbaaaa47
commit
2531f4ffc1
11 changed files with 23 additions and 24 deletions
|
@ -62,7 +62,7 @@ fn content(to_layout: chan<layout_task::Msg>) -> chan<ControlMsg> {
|
||||||
let css_port = comm::port();
|
let css_port = comm::port();
|
||||||
let css_chan = comm::chan(css_port);
|
let css_chan = comm::chan(css_port);
|
||||||
task::spawn {||
|
task::spawn {||
|
||||||
let new_file <- new_file;
|
let new_file = copy new_file;
|
||||||
let css_stream = spawn_css_lexer_task(~new_file);
|
let css_stream = spawn_css_lexer_task(~new_file);
|
||||||
let css_rules = build_stylesheet(css_stream);
|
let css_rules = build_stylesheet(css_stream);
|
||||||
css_chan.send(css_rules);
|
css_chan.send(css_rules);
|
||||||
|
@ -70,7 +70,7 @@ fn content(to_layout: chan<layout_task::Msg>) -> chan<ControlMsg> {
|
||||||
|
|
||||||
// Note: we can parse the next document in parallel
|
// Note: we can parse the next document in parallel
|
||||||
// with any previous documents.
|
// with any previous documents.
|
||||||
let stream = spawn_html_parser_task(filename);
|
let stream = spawn_html_parser_task(copy filename);
|
||||||
let root = build_dom(scope, stream);
|
let root = build_dom(scope, stream);
|
||||||
|
|
||||||
// Collect the css stylesheet
|
// Collect the css stylesheet
|
||||||
|
|
|
@ -20,7 +20,7 @@ fn engine<S:renderer::sink send copy>(sink: S) -> chan<Msg> {
|
||||||
loop {
|
loop {
|
||||||
alt self_ch.recv() {
|
alt self_ch.recv() {
|
||||||
LoadURLMsg(url) {
|
LoadURLMsg(url) {
|
||||||
let url <- url;
|
let url = copy url;
|
||||||
if (*url).ends_with(".js") {
|
if (*url).ends_with(".js") {
|
||||||
content.send(content::ExecuteMsg(url))
|
content.send(content::ExecuteMsg(url))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -68,7 +68,7 @@ fn draw_display_list(
|
||||||
draw_solid_color(draw_target, item, r, g, b);
|
draw_solid_color(draw_target, item, r, g, b);
|
||||||
}
|
}
|
||||||
dl::display_item_image(image) {
|
dl::display_item_image(image) {
|
||||||
draw_image(draw_target, item, image);
|
draw_image(draw_target, item, copy image);
|
||||||
}
|
}
|
||||||
dl::display_item_text(text_run) {
|
dl::display_item_text(text_run) {
|
||||||
draw_text(draw_target, item, text_run);
|
draw_text(draw_target, item, text_run);
|
||||||
|
|
|
@ -156,7 +156,7 @@ impl box_builder_priv for Node {
|
||||||
fn determine_box_kind() -> BoxKind {
|
fn determine_box_kind() -> BoxKind {
|
||||||
alt self.read({ |n| copy n.kind }) {
|
alt self.read({ |n| copy n.kind }) {
|
||||||
~Text(string) {
|
~Text(string) {
|
||||||
TextBox(@text_box(string))
|
TextBox(@text_box(copy string))
|
||||||
}
|
}
|
||||||
~Element(element) {
|
~Element(element) {
|
||||||
alt *element.kind {
|
alt *element.kind {
|
||||||
|
|
|
@ -38,7 +38,7 @@ fn layout(to_renderer: chan<renderer::Msg>) -> chan<Msg> {
|
||||||
node.dump();
|
node.dump();
|
||||||
|
|
||||||
node.initialize_style_for_subtree();
|
node.initialize_style_for_subtree();
|
||||||
node.recompute_style_for_subtree(arc(styles));
|
node.recompute_style_for_subtree(arc(copy styles));
|
||||||
|
|
||||||
let this_box = node.construct_boxes();
|
let this_box = node.construct_boxes();
|
||||||
this_box.dump();
|
this_box.dump();
|
||||||
|
|
|
@ -184,7 +184,7 @@ impl matching_methods for Node {
|
||||||
// information as we go.
|
// information as we go.
|
||||||
|
|
||||||
for styles.each { |sty|
|
for styles.each { |sty|
|
||||||
let (selectors, decls) <- *(copy sty);
|
let (selectors, decls) = copy *sty;
|
||||||
for selectors.each { |sel|
|
for selectors.each { |sel|
|
||||||
if self.matches_selector(sel) {
|
if self.matches_selector(sel) {
|
||||||
for decls.each { |decl|
|
for decls.each { |decl|
|
||||||
|
|
|
@ -26,7 +26,7 @@ fn from_cmdline_args(args: [str]) -> opts {
|
||||||
];
|
];
|
||||||
|
|
||||||
let match = alt getopts::getopts(args, opts) {
|
let match = alt getopts::getopts(args, opts) {
|
||||||
result::ok(m) { let m <- m; m }
|
result::ok(m) { copy m }
|
||||||
result::err(f) { fail getopts::fail_str(f) }
|
result::err(f) { fail getopts::fail_str(f) }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ fn from_cmdline_args(args: [str]) -> opts {
|
||||||
};
|
};
|
||||||
|
|
||||||
let render_mode = alt getopts::opt_maybe_str(match, "o") {
|
let render_mode = alt getopts::opt_maybe_str(match, "o") {
|
||||||
some(output_file) { let output_file <- output_file; png(output_file) }
|
some(output_file) { png(copy output_file) }
|
||||||
none { screen }
|
none { screen }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ type token_reader = {stream : port<token>, mut lookahead : option<token>};
|
||||||
impl methods for token_reader {
|
impl methods for token_reader {
|
||||||
fn get() -> token {
|
fn get() -> token {
|
||||||
alt copy self.lookahead {
|
alt copy self.lookahead {
|
||||||
some(tok) { self.lookahead = none; let t <- tok; t }
|
some(tok) { self.lookahead = none; copy tok }
|
||||||
none { recv(self.stream) }
|
none { recv(self.stream) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ impl methods for token_reader {
|
||||||
fn parse_element(reader : token_reader) -> option<~selector> {
|
fn parse_element(reader : token_reader) -> option<~selector> {
|
||||||
// Get the current element type
|
// Get the current element type
|
||||||
let elmt_name = alt reader.get() {
|
let elmt_name = alt reader.get() {
|
||||||
to_elmt(tag) { let t <- tag; t }
|
to_elmt(tag) { copy tag }
|
||||||
to_eof { ret none; }
|
to_eof { ret none; }
|
||||||
_ { fail "Expected an element" }
|
_ { fail "Expected an element" }
|
||||||
};
|
};
|
||||||
|
@ -42,7 +42,7 @@ fn parse_element(reader : token_reader) -> option<~selector> {
|
||||||
loop {
|
loop {
|
||||||
let tok = reader.get();
|
let tok = reader.get();
|
||||||
alt tok {
|
alt tok {
|
||||||
to_attr(attr) { let a <- attr; attr_list += [a]; }
|
to_attr(attr) { attr_list += [copy attr]; }
|
||||||
to_start_desc | to_descendant | to_child | to_sibling
|
to_start_desc | to_descendant | to_child | to_sibling
|
||||||
| to_comma {
|
| to_comma {
|
||||||
reader.unget(tok);
|
reader.unget(tok);
|
||||||
|
@ -68,7 +68,7 @@ fn parse_rule(reader : token_reader) -> option<~rule> {
|
||||||
let mut cur_sel;
|
let mut cur_sel;
|
||||||
|
|
||||||
alt parse_element(reader) {
|
alt parse_element(reader) {
|
||||||
some(elmt) { cur_sel <- elmt; }
|
some(elmt) { cur_sel = copy elmt; }
|
||||||
none { ret none; } // we hit an eof in the middle of a rule
|
none { ret none; } // we hit an eof in the middle of a rule
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ fn parse_rule(reader : token_reader) -> option<~rule> {
|
||||||
alt parse_element(reader) {
|
alt parse_element(reader) {
|
||||||
some(elmt) {
|
some(elmt) {
|
||||||
let built_sel <- cur_sel;
|
let built_sel <- cur_sel;
|
||||||
let new_sel <- elmt;
|
let new_sel = copy elmt;
|
||||||
cur_sel <- ~descendant(built_sel, new_sel)
|
cur_sel <- ~descendant(built_sel, new_sel)
|
||||||
}
|
}
|
||||||
none { ret none; }
|
none { ret none; }
|
||||||
|
@ -89,7 +89,7 @@ fn parse_rule(reader : token_reader) -> option<~rule> {
|
||||||
alt parse_element(reader) {
|
alt parse_element(reader) {
|
||||||
some(elmt) {
|
some(elmt) {
|
||||||
let built_sel <- cur_sel;
|
let built_sel <- cur_sel;
|
||||||
let new_sel <- elmt;
|
let new_sel = copy elmt;
|
||||||
cur_sel <- ~child(built_sel, new_sel)
|
cur_sel <- ~child(built_sel, new_sel)
|
||||||
}
|
}
|
||||||
none { ret none; }
|
none { ret none; }
|
||||||
|
@ -99,7 +99,7 @@ fn parse_rule(reader : token_reader) -> option<~rule> {
|
||||||
alt parse_element(reader) {
|
alt parse_element(reader) {
|
||||||
some(elmt) {
|
some(elmt) {
|
||||||
let built_sel <- cur_sel;
|
let built_sel <- cur_sel;
|
||||||
let new_sel <- elmt;
|
let new_sel = copy elmt;
|
||||||
cur_sel <- ~sibling(built_sel, new_sel)
|
cur_sel <- ~sibling(built_sel, new_sel)
|
||||||
}
|
}
|
||||||
none { ret none; }
|
none { ret none; }
|
||||||
|
@ -186,7 +186,7 @@ fn build_stylesheet(stream : port<token>) -> [~rule] {
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
alt parse_rule(reader) {
|
alt parse_rule(reader) {
|
||||||
some(rule) { let r <- rule; rule_list += [r]; }
|
some(rule) { rule_list += [copy rule]; }
|
||||||
none { break; }
|
none { break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,13 +76,13 @@ fn build_dom(scope: NodeScope, stream: port<token>) -> Node {
|
||||||
parser::to_start_opening_tag(tag_name) {
|
parser::to_start_opening_tag(tag_name) {
|
||||||
#debug["starting tag %s", tag_name];
|
#debug["starting tag %s", tag_name];
|
||||||
let element_kind = build_element_kind(tag_name);
|
let element_kind = build_element_kind(tag_name);
|
||||||
let new_node = scope.new_node(Element(ElementData(tag_name, element_kind)));
|
let new_node = scope.new_node(Element(ElementData(copy tag_name, element_kind)));
|
||||||
scope.add_child(cur, new_node);
|
scope.add_child(cur, new_node);
|
||||||
cur = new_node;
|
cur = new_node;
|
||||||
}
|
}
|
||||||
parser::to_attr(key, value) {
|
parser::to_attr(key, value) {
|
||||||
#debug["attr: %? = %?", key, value];
|
#debug["attr: %? = %?", key, value];
|
||||||
link_up_attribute(scope, cur, key, value);
|
link_up_attribute(scope, cur, copy key, copy value);
|
||||||
}
|
}
|
||||||
parser::to_end_opening_tag {
|
parser::to_end_opening_tag {
|
||||||
#debug("end opening tag");
|
#debug("end opening tag");
|
||||||
|
@ -94,8 +94,7 @@ fn build_dom(scope: NodeScope, stream: port<token>) -> Node {
|
||||||
cur = scope.get_parent(cur).get();
|
cur = scope.get_parent(cur).get();
|
||||||
}
|
}
|
||||||
parser::to_text(s) if !s.is_whitespace() {
|
parser::to_text(s) if !s.is_whitespace() {
|
||||||
let s <- s;
|
let new_node = scope.new_node(Text(copy s));
|
||||||
let new_node = scope.new_node(Text(s));
|
|
||||||
scope.add_child(cur, new_node);
|
scope.add_child(cur, new_node);
|
||||||
}
|
}
|
||||||
parser::to_text(_) {
|
parser::to_text(_) {
|
||||||
|
|
|
@ -480,7 +480,7 @@ fn spawn_html_parser_task(-filename: ~str) -> port<html::token> {
|
||||||
let result_port = port();
|
let result_port = port();
|
||||||
let result_chan = chan(result_port);
|
let result_chan = chan(result_port);
|
||||||
task::spawn {||
|
task::spawn {||
|
||||||
let filename <- *filename;
|
let filename = copy *filename;
|
||||||
assert (copy filename).ends_with(".html");
|
assert (copy filename).ends_with(".html");
|
||||||
let file_data = io::read_whole_file(filename).get();
|
let file_data = io::read_whole_file(filename).get();
|
||||||
let reader = io::bytes_reader(file_data);
|
let reader = io::bytes_reader(file_data);
|
||||||
|
@ -502,7 +502,7 @@ fn spawn_css_lexer_task(-filename: ~str) -> port<css::token> {
|
||||||
let result_port = port();
|
let result_port = port();
|
||||||
let result_chan = chan(result_port);
|
let result_chan = chan(result_port);
|
||||||
task::spawn {||
|
task::spawn {||
|
||||||
let filename <- *filename;
|
let filename = copy *filename;
|
||||||
|
|
||||||
assert (copy filename).ends_with(".css");
|
assert (copy filename).ends_with(".css");
|
||||||
let file_try = io::read_whole_file(filename);
|
let file_try = io::read_whole_file(filename);
|
||||||
|
|
|
@ -65,7 +65,7 @@ fn run_pipeline_png(-url: str, outfile: str) {
|
||||||
listen {|pngdata|
|
listen {|pngdata|
|
||||||
let sink = pngsink::pngsink(pngdata);
|
let sink = pngsink::pngsink(pngdata);
|
||||||
let engine = engine::engine(sink);
|
let engine = engine::engine(sink);
|
||||||
let url <- url;
|
let url = copy url;
|
||||||
engine.send(engine::LoadURLMsg(~url));
|
engine.send(engine::LoadURLMsg(~url));
|
||||||
alt io::buffered_file_writer(outfile) {
|
alt io::buffered_file_writer(outfile) {
|
||||||
result::ok(writer) {
|
result::ok(writer) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue