Skip to content

Commit

Permalink
auto merge of #474 : pcwalton/servo/separation, r=pcwalton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors-servo committed May 30, 2013
2 parents 90b01df + 0b22336 commit 473b094
Show file tree
Hide file tree
Showing 157 changed files with 390 additions and 326 deletions.
30 changes: 20 additions & 10 deletions Makefile.in
Expand Up @@ -192,14 +192,21 @@ DONE_gfx = $(B)src/components/gfx/libgfx.dummy

DEPS_gfx = $(CRATE_gfx) $(SRC_gfx) $(DONE_SUBMODULES) $(DONE_util) $(DONE_net)

RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net
RFLAGS_script = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/gfx
WEBIDL_script = $(call rwildcard,$(S)src/components/script/,*.webidl)
AUTOGEN_SRC_script = $(patsubst %.webidl, %Binding.rs, $(WEBIDL_script))
SRC_script = $(call rwildcard,$(S)src/components/script/,*.rs) $(AUTOGEN_SRC_script)
CRATE_script = $(S)src/components/script/script.rc
DONE_script = $(B)src/components/script/libscript.dummy

WEBIDL_servo = $(call rwildcard,$(S)src/components/main/,*.webidl)
AUTOGEN_SRC_servo = $(patsubst %.webidl, %Binding.rs, $(WEBIDL_servo))
SRC_servo = $(call rwildcard,$(S)src/components/main/,*.rs) $(AUTOGEN_SRC_servo)
DEPS_script = $(CRATE_script) $(SRC_script) $(DONE_SUBMODULES) $(DONE_util) $(DONE_net)

RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script

SRC_servo = $(call rwildcard,$(S)src/components/main/,*.rs)
CRATE_servo = $(S)src/components/main/servo.rc

DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_net)
DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net)

# rules that depend on having correct meta-target vars (DEPS_CLEAN, DEPS_servo, etc)
include $(S)mk/check.mk
Expand All @@ -220,13 +227,16 @@ $(DONE_net): $(DEPS_net)
$(DONE_gfx): $(DEPS_gfx)
$(RUSTC) $(RFLAGS_gfx) -o $@ $< && touch $@

BINDINGS_SRC = $(S)/src/components/main/dom/bindings/codegen
$(DONE_script): $(DEPS_script)
$(RUSTC) $(RFLAGS_script) -o $@ $< && touch $@

BINDINGS_SRC = $(S)/src/components/script/dom/bindings/codegen

CACHE_DIR = $(BINDINGS_SRC)/_cache

bindinggen_dependencies := $(addprefix $(BINDINGS_SRC)/, BindingGen.py Bindings.conf Configuration.py CodegenRust.py parser/WebIDL.py ParserResults.pkl)

$(AUTOGEN_SRC_servo): %Binding.rs: $(bindinggen_dependencies) \
$(AUTOGEN_SRC_script): %Binding.rs: $(bindinggen_dependencies) \
%.webidl
PYTHONDONTWRITEBYTECODE=1 $(CFG_PYTHON2) $(BINDINGS_SRC)/pythonpath.py \
-I$(BINDINGS_SRC)/parser -I$(BINDINGS_SRC)/ply \
Expand All @@ -241,13 +251,13 @@ $(CACHE_DIR)/.done:
@touch $@

$(BINDINGS_SRC)/ParserResults.pkl: $(globalgen_dependencies) \
$(WEBIDL_servo)
$(WEBIDL_script)
PYTHONDONTWRITEBYTECODE=1 $(CFG_PYTHON2) $(BINDINGS_SRC)/pythonpath.py \
-I$(BINDINGS_SRC)/parser -I$(BINDINGS_SRC)/ply \
-D$(BINDINGS_SRC) \
$(BINDINGS_SRC)/GlobalGen.py $(BINDINGS_SRC)/Bindings.conf . \
--cachedir=$(CACHE_DIR) \
$(WEBIDL_servo)
$(WEBIDL_script)

# Servo binaries

Expand All @@ -268,7 +278,7 @@ package: servo

else

bindings: $(AUTOGEN_SRC_servo)
bindings: $(AUTOGEN_SRC_script)

.PHONY: package
package:
Expand Down
1 change: 1 addition & 0 deletions configure
Expand Up @@ -452,6 +452,7 @@ done
make_dir ${CFG_BUILD_DIR}src/components/util
make_dir ${CFG_BUILD_DIR}src/components/net
make_dir ${CFG_BUILD_DIR}src/components/gfx
make_dir ${CFG_BUILD_DIR}src/components/script
make_dir ${CFG_BUILD_DIR}src/components/main
make_dir src/test/html/ref
make_dir src/compiler/rust
Expand Down
5 changes: 4 additions & 1 deletion mk/clean.mk
Expand Up @@ -34,5 +34,8 @@ clean-net:
clean-gfx:
cd $(B)/src/components/gfx/ && rm -rf libservo_gfx*.dylib $(DONE_servo_gfx)

clean-servo: clean-gfx clean-util clean-net
clean-script:
cd $(B)/src/components/script/ && rm -rf libservo_script*.dylib $(DONE_servo_script)

clean-servo: clean-gfx clean-util clean-net clean-script
rm -f servo servo-test
2 changes: 1 addition & 1 deletion src/components/main/compositing/mod.rs
Expand Up @@ -4,7 +4,7 @@

use compositing::resize_rate_limiter::ResizeRateLimiter;
use platform::{Application, Window};
use scripting::script_task::{LoadMsg, ScriptMsg};
use script::script_task::{LoadMsg, ScriptMsg};
use windowing::{ApplicationMethods, WindowMethods};

use azure::azure_hl::{DataSourceSurface, DrawTarget, SourceSurfaceMethods};
Expand Down
5 changes: 2 additions & 3 deletions src/components/main/compositing/resize_rate_limiter.rs
Expand Up @@ -7,10 +7,9 @@
/// 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::ResizeEvent;
use scripting::script_task::{ScriptMsg, SendEventMsg};

use core::comm::{Port, SharedChan};
use script::dom::event::ResizeEvent;
use script::script_task::{ScriptMsg, SendEventMsg};

pub struct ResizeRateLimiter {
/// The channel we send resize events on
Expand Down
4 changes: 2 additions & 2 deletions src/components/main/css/matching.rs
Expand Up @@ -6,10 +6,10 @@

use css::node_util::NodeUtil;
use css::select_handler::NodeSelectHandler;
use dom::node::{AbstractNode, LayoutView};

use script::dom::node::{AbstractNode, LayoutView};
use newcss::complete::CompleteSelectResults;
use newcss::select::{SelectCtx, SelectResults};

use servo_util::tree::TreeUtils;

pub trait MatchMethods {
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/css/node_style.rs
Expand Up @@ -5,9 +5,9 @@
// Style retrieval from DOM elements.

use css::node_util::NodeUtil;
use dom::node::{AbstractNode, LayoutView};

use newcss::complete::CompleteStyle;
use script::dom::node::{AbstractNode, LayoutView};

/// Node mixin providing `style` method that returns a `NodeStyle`
pub trait StyledNode {
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/css/node_util.rs
Expand Up @@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use dom::node::{AbstractNode, LayoutView};
use layout::aux::LayoutAuxMethods;

use core::cast::transmute;
use newcss::complete::CompleteSelectResults;
use script::dom::node::{AbstractNode, LayoutView};

pub trait NodeUtil<'self> {
fn get_css_select_results(self) -> &'self CompleteSelectResults;
Expand Down
28 changes: 0 additions & 28 deletions src/components/main/css/node_void_ptr.rs

This file was deleted.

5 changes: 2 additions & 3 deletions src/components/main/css/select_handler.rs
Expand Up @@ -6,10 +6,9 @@
/// Implementation of the callbacks that the CSS selector engine uses to query the DOM.
///

use dom::node::{AbstractNode, LayoutView};
use newcss::select::SelectHandler;

use core::str::eq_slice;
use newcss::select::SelectHandler;
use script::dom::node::{AbstractNode, LayoutView};

pub struct NodeSelectHandler {
node: AbstractNode<LayoutView>,
Expand Down
18 changes: 9 additions & 9 deletions src/components/main/engine.rs
Expand Up @@ -3,22 +3,22 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use compositing::CompositorTask;
use layout::layout_task::LayoutTask;
use layout::layout_task;
use scripting::script_task::{ExecuteMsg, LoadMsg, ScriptMsg, ScriptTask};
use scripting::script_task;
use util::task::spawn_listener;

use core::cell::Cell;
use core::comm::{Chan, Port, SharedChan};
use gfx::opts::Opts;
use gfx::render_task::RenderTask;
use gfx::render_task;
use script::layout_interface::LayoutTask;
use script::layout_interface;
use script::script_task::{ExecuteMsg, LoadMsg, ScriptMsg, ScriptTask};
use script::script_task;
use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
use servo_net::resource_task::ResourceTask;
use servo_net::resource_task;
use servo_util::time::{ProfilerChan, ProfilerPort, ProfilerTask};
use servo_util::time;
use std::net::url::Url;

pub type EngineTask = Chan<Msg>;
Expand Down Expand Up @@ -61,10 +61,10 @@ impl Engine {
let profiler_task = ProfilerTask::new(profiler_port.take(), profiler_chan.clone());

let opts = opts.take();
let layout_task = LayoutTask(render_task.clone(),
image_cache_task.clone(),
opts,
profiler_task.chan.clone());
let layout_task = layout_task::create_layout_task(render_task.clone(),
image_cache_task.clone(),
opts,
profiler_task.chan.clone());

let script_task = ScriptTask::new(script_port.take(),
script_chan.take(),
Expand Down Expand Up @@ -105,7 +105,7 @@ impl Engine {

ExitMsg(sender) => {
self.script_task.chan.send(script_task::ExitMsg);
self.layout_task.send(layout_task::ExitMsg);
self.layout_task.chan.send(layout_interface::ExitMsg);

let (response_port, response_chan) = comm::stream();

Expand Down
2 changes: 1 addition & 1 deletion src/components/main/layout/aux.rs
Expand Up @@ -4,10 +4,10 @@

//! Code for managing the layout data in the DOM.

use dom::node::{AbstractNode, LayoutView};
use layout::flow::FlowContext;

use newcss::complete::CompleteSelectResults;
use script::dom::node::{AbstractNode, LayoutView};
use servo_util::tree::TreeUtils;

/// Data that layout associates with a node.
Expand Down
12 changes: 5 additions & 7 deletions src/components/main/layout/box.rs
Expand Up @@ -5,9 +5,7 @@
//! The `RenderBox` type, which represents the leaves of the layout tree.

use css::node_style::StyledNode;
use dom::node::{AbstractNode, LayoutView};
use layout::context::LayoutContext;
use layout::debug::DebugMethods;
use layout::display_list_builder::{DisplayListBuilder, ToGfxColor};
use layout::flow::FlowContext;
use layout::text;
Expand All @@ -29,6 +27,7 @@ use newcss::values::{CSSFontSizeLength, CSSFontStyleItalic, CSSFontStyleNormal};
use newcss::values::{CSSFontStyleOblique, CSSTextAlign, CSSTextDecoration};
use newcss::values::{CSSTextDecorationNone, CSSFloatNone, CSSPositionStatic};
use newcss::values::{CSSDisplayInlineBlock, CSSDisplayInlineTable};
use script::dom::node::{AbstractNode, LayoutView};
use servo_net::image::holder::ImageHolder;
use servo_net::local_image_cache::LocalImageCache;
use servo_util::range::*;
Expand Down Expand Up @@ -795,15 +794,14 @@ pub impl RenderBox {
}
get_propagated_text_decoration(self.nearest_ancestor_element())
}
}

impl DebugMethods for RenderBox {
fn dump(&self) {
/// Dumps this node, for debugging.
pub fn dump(&self) {
self.dump_indent(0);
}

/// Dumps a render box for debugging, with indentation.
fn dump_indent(&self, indent: uint) {
pub fn dump_indent(&self, indent: uint) {
let mut string = ~"";
for uint::range(0u, indent) |_i| {
string += ~" ";
Expand All @@ -814,7 +812,7 @@ impl DebugMethods for RenderBox {
}

/// Returns a debugging string describing this box.
fn debug_str(&self) -> ~str {
pub fn debug_str(&self) -> ~str {
let representation = match *self {
GenericRenderBoxClass(*) => ~"GenericRenderBox",
ImageRenderBoxClass(*) => ~"ImageRenderBox",
Expand Down
7 changes: 3 additions & 4 deletions src/components/main/layout/box_builder.rs
Expand Up @@ -4,23 +4,22 @@

//! Creates CSS boxes from a DOM tree.

use dom::element::*;
use dom::node::{AbstractNode, CommentNodeTypeId, DoctypeNodeTypeId};
use dom::node::{ElementNodeTypeId, LayoutView, TextNodeTypeId};
use layout::aux::LayoutAuxMethods;
use layout::block::BlockFlowData;
use layout::box::{GenericRenderBoxClass, ImageRenderBox, ImageRenderBoxClass, RenderBox};
use layout::box::{RenderBoxBase, RenderBoxType, RenderBox_Generic, RenderBox_Image};
use layout::box::{RenderBox_Text, UnscannedTextRenderBox, UnscannedTextRenderBoxClass};
use layout::context::LayoutContext;
use layout::debug::{BoxedMutDebugMethods, DebugMethods};
use layout::flow::{AbsoluteFlow, BlockFlow, FloatFlow, Flow_Absolute, Flow_Block, Flow_Float};
use layout::flow::{Flow_Inline, Flow_InlineBlock, Flow_Root, Flow_Table, FlowContext};
use layout::flow::{FlowContextType, FlowData, InlineBlockFlow, InlineFlow, TableFlow};
use layout::inline::{InlineFlowData, InlineLayout};

use newcss::values::{CSSDisplay, CSSDisplayBlock, CSSDisplayInline, CSSDisplayInlineBlock};
use newcss::values::{CSSDisplayNone};
use script::dom::element::*;
use script::dom::node::{AbstractNode, CommentNodeTypeId, DoctypeNodeTypeId};
use script::dom::node::{ElementNodeTypeId, LayoutView, TextNodeTypeId};
use servo_util::range::Range;
use servo_util::tree::{TreeNodeRef, TreeUtils};

Expand Down
21 changes: 0 additions & 21 deletions src/components/main/layout/debug.rs

This file was deleted.

12 changes: 5 additions & 7 deletions src/components/main/layout/flow.rs
Expand Up @@ -25,11 +25,9 @@
/// line breaks and mapping to CSS boxes, for the purpose of handling `getClientRects()` and
/// similar methods.

use dom::node::{AbstractNode, LayoutView};
use layout::block::BlockFlowData;
use layout::box::RenderBox;
use layout::context::LayoutContext;
use layout::debug::DebugMethods;
use layout::display_list_builder::DisplayListBuilder;
use layout::inline::{InlineFlowData};

Expand All @@ -38,6 +36,7 @@ use geom::point::Point2D;
use geom::rect::Rect;
use gfx::display_list::DisplayList;
use gfx::geometry::Au;
use script::dom::node::{AbstractNode, LayoutView};
use servo_util::tree::{TreeNode, TreeNodeRef, TreeUtils};

/// The type of the formatting context and data specific to each context, such as line box
Expand Down Expand Up @@ -372,15 +371,14 @@ impl<'self> FlowContext {

true
}
}

impl DebugMethods for FlowContext {
fn dump(&self) {
/// Dumps the flow tree for debugging.
pub fn dump(&self) {
self.dump_indent(0);
}

/// Dumps the flow tree, for debugging, with indentation.
fn dump_indent(&self, indent: uint) {
pub fn dump_indent(&self, indent: uint) {
let mut s = ~"|";
for uint::range(0, indent) |_i| {
s += ~"---- ";
Expand All @@ -395,7 +393,7 @@ impl DebugMethods for FlowContext {
}
}

fn debug_str(&self) -> ~str {
pub fn debug_str(&self) -> ~str {
let repr = match *self {
InlineFlow(inline) => {
let mut s = inline.boxes.foldl(~"InlineFlow(children=", |s, box| {
Expand Down

0 comments on commit 473b094

Please sign in to comment.