mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout -> layout_task. Fixes a bunch of ugly imports.
This commit is contained in:
parent
3084d15a36
commit
b5b50e5d20
11 changed files with 33 additions and 28 deletions
|
@ -1,11 +1,16 @@
|
||||||
|
#[doc="
|
||||||
|
The content task is the main task that runs JavaScript and spawns layout
|
||||||
|
tasks.
|
||||||
|
"]
|
||||||
|
|
||||||
export msg, ping;
|
export msg, ping;
|
||||||
export content;
|
export content;
|
||||||
|
|
||||||
import result::extensions;
|
import result::extensions;
|
||||||
import dom::rcu::writer_methods;
|
import dom::rcu::writer_methods;
|
||||||
import dom::style;
|
import dom::style;
|
||||||
import dom=dom::base;
|
import dom = dom::base;
|
||||||
import layout::layout;
|
import layout::layout_task;
|
||||||
import js::rust::methods;
|
import js::rust::methods;
|
||||||
|
|
||||||
enum msg {
|
enum msg {
|
||||||
|
@ -20,17 +25,17 @@ enum ping {
|
||||||
|
|
||||||
// sends a ping to layout and awaits the response.
|
// sends a ping to layout and awaits the response.
|
||||||
fn join_layout(scope: dom::node_scope,
|
fn join_layout(scope: dom::node_scope,
|
||||||
to_layout: chan<layout::msg>) {
|
to_layout: chan<layout_task::msg>) {
|
||||||
if scope.is_reader_forked() {
|
if scope.is_reader_forked() {
|
||||||
comm::listen { |ch|
|
comm::listen { |ch|
|
||||||
to_layout.send(layout::ping(ch));
|
to_layout.send(layout_task::ping(ch));
|
||||||
ch.recv();
|
ch.recv();
|
||||||
}
|
}
|
||||||
scope.reader_joined();
|
scope.reader_joined();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn content(to_layout: chan<layout::msg>) -> chan<msg> {
|
fn content(to_layout: chan<layout_task::msg>) -> chan<msg> {
|
||||||
task::spawn_listener::<msg> {|from_master|
|
task::spawn_listener::<msg> {|from_master|
|
||||||
let scope = dom::node_scope();
|
let scope = dom::node_scope();
|
||||||
let rt = js::rust::rt();
|
let rt = js::rust::rt();
|
||||||
|
@ -75,7 +80,7 @@ fn content(to_layout: chan<layout::msg>) -> chan<msg> {
|
||||||
join_layout(scope, to_layout);
|
join_layout(scope, to_layout);
|
||||||
|
|
||||||
// Send new document to layout.
|
// Send new document to layout.
|
||||||
to_layout.send(layout::build(root, css_rules));
|
to_layout.send(layout_task::build(root, css_rules));
|
||||||
|
|
||||||
// Indicate that reader was forked so any further
|
// Indicate that reader was forked so any further
|
||||||
// changes will be isolated.
|
// changes will be isolated.
|
||||||
|
@ -102,7 +107,7 @@ fn content(to_layout: chan<layout::msg>) -> chan<msg> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit {
|
exit {
|
||||||
to_layout.send(layout::exit);
|
to_layout.send(layout_task::exit);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn engine<S: renderer::sink send copy>(sink: S) -> comm::chan<msg> {
|
||||||
let renderer = renderer::renderer(sink);
|
let renderer = renderer::renderer(sink);
|
||||||
|
|
||||||
// The layout task
|
// The layout task
|
||||||
let layout = layout::layout::layout(renderer);
|
let layout = layout::layout_task::layout(renderer);
|
||||||
|
|
||||||
// The content task
|
// The content task
|
||||||
let content = content::content(layout);
|
let content = content::content(layout);
|
||||||
|
@ -29,7 +29,7 @@ fn engine<S: renderer::sink send copy>(sink: S) -> comm::chan<msg> {
|
||||||
}
|
}
|
||||||
exit(sender) {
|
exit(sender) {
|
||||||
content.send(content::exit);
|
content.send(content::exit);
|
||||||
layout.send(layout::layout::exit);
|
layout.send(layout::layout_task::exit);
|
||||||
listen {|resp_ch|
|
listen {|resp_ch|
|
||||||
renderer.send(renderer::exit(resp_ch));
|
renderer.send(renderer::exit(resp_ch));
|
||||||
resp_ch.recv();
|
resp_ch.recv();
|
||||||
|
|
|
@ -9,10 +9,10 @@ import geom::point::Point2D;
|
||||||
import geom::rect::Rect;
|
import geom::rect::Rect;
|
||||||
import geom::size::Size2D;
|
import geom::size::Size2D;
|
||||||
import image::base::image;
|
import image::base::image;
|
||||||
import /*layout::*/block::block_layout_methods;
|
import layout::block::block_layout_methods;
|
||||||
import /*layout::*/inline::inline_layout_methods;
|
import layout::inline::inline_layout_methods;
|
||||||
import /*layout::*/style::style::*;
|
import layout::style::style::*;
|
||||||
import /*layout::*/text::*;
|
import layout::text::*;
|
||||||
import util::tree;
|
import util::tree;
|
||||||
|
|
||||||
enum box_kind {
|
enum box_kind {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import geom::point::Point2D;
|
import geom::point::Point2D;
|
||||||
import geom::size::Size2D;
|
import geom::size::Size2D;
|
||||||
import gfx::geometry::au;
|
import gfx::geometry::au;
|
||||||
import /*layout::*/base::*; // FIXME: Can't get around import *; resolve bug.
|
import layout::base::*; // FIXME: Can't get around import *; resolve bug.
|
||||||
import util::tree;
|
import util::tree;
|
||||||
|
|
||||||
#[doc="The public block layout methods."]
|
#[doc="The public block layout methods."]
|
||||||
|
|
|
@ -4,11 +4,11 @@ import dom::base::{element, es_div, es_img, nk_element, nk_text, node};
|
||||||
import dom::style::{display_type, di_block, di_inline, di_none};
|
import dom::style::{display_type, di_block, di_inline, di_none};
|
||||||
import dom::rcu::reader_methods;
|
import dom::rcu::reader_methods;
|
||||||
import gfx::geometry;
|
import gfx::geometry;
|
||||||
import /*layout::*/base::{appearance, bk_block, bk_inline, bk_intrinsic};
|
import layout::base::{appearance, bk_block, bk_inline, bk_intrinsic};
|
||||||
import /*layout::*/base::{bk_text, box, box_kind, btree, node_methods, ntree};
|
import layout::base::{bk_text, box, box_kind, btree, node_methods, ntree};
|
||||||
import /*layout::*/base::{rd_tree_ops, wr_tree_ops};
|
import layout::base::{rd_tree_ops, wr_tree_ops};
|
||||||
import /*layout::*/style::style::{style_methods};
|
import layout::style::style::{style_methods};
|
||||||
import /*layout::*/text::text_box;
|
import layout::text::text_box;
|
||||||
import util::tree;
|
import util::tree;
|
||||||
import option::is_none;
|
import option::is_none;
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import dom::rcu::reader_methods;
|
||||||
import geom::point::Point2D;
|
import geom::point::Point2D;
|
||||||
import geom::size::Size2D;
|
import geom::size::Size2D;
|
||||||
import gfx::geometry::au;
|
import gfx::geometry::au;
|
||||||
import /*layout::*/base::*; // FIXME: Can't get around import *; resolve bug.
|
import layout::base::*; // FIXME: Can't get around import *; resolve bug.
|
||||||
import /*layout::*/style::style::*; // ditto
|
import layout::style::style::*; // ditto
|
||||||
import util::tree;
|
import util::tree;
|
||||||
|
|
||||||
#[doc="The main reflow routine for inline layout."]
|
#[doc="The main reflow routine for inline layout."]
|
||||||
|
|
|
@ -14,9 +14,9 @@ import gfx::renderer;
|
||||||
import dom::base::node;
|
import dom::base::node;
|
||||||
import dom::rcu::scope;
|
import dom::rcu::scope;
|
||||||
import dom::style::stylesheet;
|
import dom::style::stylesheet;
|
||||||
import /*layout::*/base::*;
|
import layout::base::*;
|
||||||
import /*layout::*/style::apply::apply_style_methods;
|
import layout::style::apply::apply_style_methods;
|
||||||
import /*layout::*/style::style::style_methods;
|
import layout::style::style::style_methods;
|
||||||
import box_builder::box_builder_methods;
|
import box_builder::box_builder_methods;
|
||||||
import dl = display_list;
|
import dl = display_list;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import dom::base::{es_img, nk_element, node};
|
import dom::base::{es_img, nk_element, node};
|
||||||
import dom::rcu::reader_methods;
|
import dom::rcu::reader_methods;
|
||||||
import image::base::load;
|
import image::base::load;
|
||||||
import /*layout::*/base::*;
|
import layout::base::*;
|
||||||
import style::style_methods;
|
import style::style_methods;
|
||||||
|
|
||||||
impl apply_style_methods for @box {
|
impl apply_style_methods for @box {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import dom::base::{element, es_div, es_head, es_img, nk_element, nk_text};
|
||||||
import dom::base::{node};
|
import dom::base::{node};
|
||||||
import dom::base::node_kind;
|
import dom::base::node_kind;
|
||||||
import dom::rcu::reader_methods;
|
import dom::rcu::reader_methods;
|
||||||
import /*layout::*/base::*; // FIXME: resolve bug requires *
|
import layout::base::*; // FIXME: resolve bug requires *
|
||||||
import matching::matching_methods;
|
import matching::matching_methods;
|
||||||
|
|
||||||
type computed_style = {mut display : display_type,
|
type computed_style = {mut display : display_type,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import geom::size::Size2D;
|
import geom::size::Size2D;
|
||||||
import gfx::geometry::au;
|
import gfx::geometry::au;
|
||||||
import /*layout::*/base::*; // FIXME: Can't get around import *; resolve bug.
|
import layout::base::*; // FIXME: Can't get around import *; resolve bug.
|
||||||
import servo_text::text_run::text_run;
|
import servo_text::text_run::text_run;
|
||||||
|
|
||||||
class text_box {
|
class text_box {
|
||||||
|
|
|
@ -45,7 +45,7 @@ mod layout {
|
||||||
mod box_builder;
|
mod box_builder;
|
||||||
mod display_list;
|
mod display_list;
|
||||||
mod inline;
|
mod inline;
|
||||||
mod layout;
|
mod layout_task;
|
||||||
mod text;
|
mod text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue