Move the content of 'script/style' into the new 'style' crate.

This commit is contained in:
Simon Sapin 2013-10-14 18:17:44 +01:00
parent c0a5e8f6eb
commit dc882b8ecf
18 changed files with 49 additions and 52 deletions

View file

@ -229,21 +229,22 @@ DEPS_gfx = $(CRATE_gfx) $(SRC_gfx) $(DONE_SUBMODULES) $(DONE_util) $(DONE_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 -L $(B)src/components/msg
WEBIDL_script = $(call rwildcard,$(S)src/components/script/,*.webidl)
AUTOGEN_SRC_script = $(patsubst %.webidl, %Binding.rs, $(WEBIDL_script))
MAKO_ZIP = $(S)src/components/script/style/properties/Mako-0.8.1.zip
MAKO_script = $(S)src/components/script/style/properties/mod.rs
MAKO_SRC_script = $(MAKO_script).mako
SRC_script = $(call rwildcard,$(S)src/components/script/,*.rs) $(AUTOGEN_SRC_script) $(MAKO_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
DEPS_script = $(CRATE_script) $(SRC_script) $(DONE_SUBMODULES) $(DONE_util) $(DONE_net) $(DONE_gfx) $(DONE_msg)
RFLAGS_style = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util
SRC_style = $(call rwildcard,$(S)src/components/style/,*.rs)
RFLAGS_style = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/script -L $(B)src/components/gfx -L $(B)src/components/net -L $(B)src/components/msg
MAKO_ZIP = $(S)src/components/style/properties/Mako-0.8.1.zip
MAKO_style = $(S)src/components/style/properties/mod.rs
MAKO_SRC_style = $(MAKO_style).mako
SRC_style = $(call rwildcard,$(S)src/components/style/,*.rs) $(MAKO_style)
CRATE_style = $(S)src/components/style/style.rc
DONE_style = $(B)src/components/style/libstyle.dummy
DEPS_style = $(CRATE_style) $(SRC_style) $(DONE_SUBMODULES) $(DONE_util)
# TODO: reverse the dependency with script
DEPS_style = $(CRATE_style) $(SRC_style) $(DONE_SUBMODULES) $(DONE_util) $(DONE_script)
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 -L $(B)src/components/style -L $(B)src/components/msg
@ -292,7 +293,7 @@ $(AUTOGEN_SRC_script): %Binding.rs: $(bindinggen_dependencies) \
globalgen_dependencies := $(addprefix $(BINDINGS_SRC)/, GlobalGen.py Bindings.conf Configuration.py CodegenRust.py parser/WebIDL.py) $(CACHE_DIR)/.done
$(MAKO_script): $(MAKO_SRC_script)
$(MAKO_style): $(MAKO_SRC_style)
PYTHONPATH=$(MAKO_ZIP) python -c "from mako.template import Template; print(Template(filename='$<').render())" > $@

View file

@ -17,7 +17,6 @@ extern mod hubbub;
extern mod js;
extern mod netsurfcss;
extern mod newcss (name = "css");
extern mod cssparser;
extern mod servo_net (name = "net");
extern mod servo_util (name = "util");
extern mod servo_msg (name = "msg");
@ -143,7 +142,3 @@ pub mod html {
pub mod layout_interface;
pub mod script_task;
// "New" (as of 2013-08) style system, not used yet but included to avoid bitrot.
mod style;

View file

@ -1,20 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// The "real" public API
pub use self::selector_matching::{Stylist, StylesheetOrigin};
// Things that need to be public to make the compiler happy
pub mod stylesheets;
pub mod errors;
pub mod selectors;
pub mod selector_matching;
pub mod properties;
pub mod namespaces;
pub mod media_queries;
pub mod parsing_utils;
#[cfg(test)]
mod tests;

View file

@ -4,9 +4,9 @@
use std::ascii::StrAsciiExt;
use cssparser::*;
use style::errors::{ErrorLoggerIterator, log_css_error};
use style::stylesheets::{CSSRule, CSSMediaRule, parse_style_rule, parse_nested_at_rule};
use style::namespaces::NamespaceMap;
use errors::{ErrorLoggerIterator, log_css_error};
use stylesheets::{CSSRule, CSSMediaRule, parse_style_rule, parse_nested_at_rule};
use namespaces::NamespaceMap;
pub struct MediaRule {

View file

@ -4,7 +4,7 @@
use std::hashmap::HashMap;
use cssparser::*;
use style::errors::log_css_error;
use errors::log_css_error;
pub struct NamespaceMap {
default: Option<~str>, // Optional URL

View file

@ -8,8 +8,8 @@ use std::ascii::StrAsciiExt;
use std::at_vec;
pub use std::iterator;
pub use cssparser::*;
pub use style::errors::{ErrorLoggerIterator, log_css_error};
pub use style::parsing_utils::*;
pub use errors::{ErrorLoggerIterator, log_css_error};
pub use parsing_utils::*;
pub use self::common_types::*;
pub mod common_types;

View file

@ -5,12 +5,12 @@
use std::ascii::StrAsciiExt;
use extra::sort::tim_sort;
use style::selectors::*;
use style::stylesheets::parse_stylesheet;
use style::media_queries::{Device, Screen};
use style::properties::{ComputedValues, cascade, PropertyDeclaration};
use dom::node::{AbstractNode, ScriptView};
use dom::element::Element;
use selectors::*;
use stylesheets::parse_stylesheet;
use media_queries::{Device, Screen};
use properties::{ComputedValues, cascade, PropertyDeclaration};
use script::dom::node::{AbstractNode, ScriptView};
use script::dom::element::Element;
pub enum StylesheetOrigin {

View file

@ -5,7 +5,7 @@
use std::{vec, iterator};
use std::ascii::StrAsciiExt;
use cssparser::*;
use style::namespaces::NamespaceMap;
use namespaces::NamespaceMap;
pub struct Selector {

View file

@ -11,4 +11,25 @@
#[license = "MPL"];
#[crate_type = "lib"];
extern mod extra;
extern mod cssparser;
extern mod script;
// The "real" public API
pub use self::selector_matching::{Stylist, StylesheetOrigin};
// Things that need to be public to make the compiler happy
pub mod stylesheets;
pub mod errors;
pub mod selectors;
pub mod selector_matching;
pub mod properties;
pub mod namespaces;
pub mod media_queries;
pub mod parsing_utils;
#[cfg(test)]
mod tests;

View file

@ -5,12 +5,12 @@
use std::iterator::Iterator;
use std::ascii::StrAsciiExt;
use cssparser::*;
use style::selectors;
use style::properties;
use style::errors::{ErrorLoggerIterator, log_css_error};
use style::namespaces::{NamespaceMap, parse_namespace_rule};
use style::media_queries::{MediaRule, parse_media_rule};
use style::media_queries;
use selectors;
use properties;
use errors::{ErrorLoggerIterator, log_css_error};
use namespaces::{NamespaceMap, parse_namespace_rule};
use media_queries::{MediaRule, parse_media_rule};
use media_queries;
pub struct Stylesheet {