diff --git a/Makefile.in b/Makefile.in index a025ec1ce30..0f0f875ae3e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 @@ -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 \ @@ -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 @@ -268,7 +278,7 @@ package: servo else -bindings: $(AUTOGEN_SRC_servo) +bindings: $(AUTOGEN_SRC_script) .PHONY: package package: diff --git a/configure b/configure index 90ed808c412..e6dddb7ea3a 100755 --- a/configure +++ b/configure @@ -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 diff --git a/mk/clean.mk b/mk/clean.mk index ca7ec8a0a9c..273d8090f29 100644 --- a/mk/clean.mk +++ b/mk/clean.mk @@ -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 diff --git a/src/components/main/compositing/mod.rs b/src/components/main/compositing/mod.rs index 14cf0052a5a..1469acbb57c 100644 --- a/src/components/main/compositing/mod.rs +++ b/src/components/main/compositing/mod.rs @@ -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}; diff --git a/src/components/main/compositing/resize_rate_limiter.rs b/src/components/main/compositing/resize_rate_limiter.rs index efbf4e0ff53..2e358423a63 100644 --- a/src/components/main/compositing/resize_rate_limiter.rs +++ b/src/components/main/compositing/resize_rate_limiter.rs @@ -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 diff --git a/src/components/main/css/matching.rs b/src/components/main/css/matching.rs index c792188e486..50de881b0b6 100644 --- a/src/components/main/css/matching.rs +++ b/src/components/main/css/matching.rs @@ -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 { diff --git a/src/components/main/css/node_style.rs b/src/components/main/css/node_style.rs index 0f02f52d186..689b62f93e0 100644 --- a/src/components/main/css/node_style.rs +++ b/src/components/main/css/node_style.rs @@ -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 { diff --git a/src/components/main/css/node_util.rs b/src/components/main/css/node_util.rs index d31f1b0cf83..ff9295d12a8 100644 --- a/src/components/main/css/node_util.rs +++ b/src/components/main/css/node_util.rs @@ -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; diff --git a/src/components/main/css/node_void_ptr.rs b/src/components/main/css/node_void_ptr.rs deleted file mode 100644 index 733ba563da3..00000000000 --- a/src/components/main/css/node_void_ptr.rs +++ /dev/null @@ -1,28 +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/. */ - -//! CSS library requires that DOM nodes be convertable to *c_void through this trait -extern mod netsurfcss; - -use dom::node::{AbstractNode, LayoutView}; - -use core::cast; - -// FIXME: Rust #3908. rust-css can't reexport VoidPtrLike -use css::node_void_ptr::netsurfcss::util::VoidPtrLike; - -impl VoidPtrLike for AbstractNode { - fn from_void_ptr(node: *libc::c_void) -> AbstractNode { - assert!(node.is_not_null()); - unsafe { - cast::transmute(node) - } - } - - fn to_void_ptr(&self) -> *libc::c_void { - unsafe { - cast::transmute(*self) - } - } -} diff --git a/src/components/main/css/select_handler.rs b/src/components/main/css/select_handler.rs index 8ce4e58ef32..fb232460b90 100644 --- a/src/components/main/css/select_handler.rs +++ b/src/components/main/css/select_handler.rs @@ -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, diff --git a/src/components/main/engine.rs b/src/components/main/engine.rs index c26686262d4..1d396c1a70f 100644 --- a/src/components/main/engine.rs +++ b/src/components/main/engine.rs @@ -4,10 +4,6 @@ use compositing::CompositorTask; use layout::layout_task; -use layout_interface::LayoutTask; -use layout_interface; -use scripting::script_task::{ExecuteMsg, LoadMsg, ScriptMsg, ScriptTask}; -use scripting::script_task; use util::task::spawn_listener; use core::cell::Cell; @@ -15,6 +11,10 @@ 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; diff --git a/src/components/main/layout/aux.rs b/src/components/main/layout/aux.rs index 1cee194b128..59682ef20b7 100644 --- a/src/components/main/layout/aux.rs +++ b/src/components/main/layout/aux.rs @@ -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. diff --git a/src/components/main/layout/box.rs b/src/components/main/layout/box.rs index 59e14d3c6fe..a2112882b06 100644 --- a/src/components/main/layout/box.rs +++ b/src/components/main/layout/box.rs @@ -5,7 +5,6 @@ //! 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::display_list_builder::{DisplayListBuilder, ToGfxColor}; use layout::flow::FlowContext; @@ -28,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::*; diff --git a/src/components/main/layout/box_builder.rs b/src/components/main/layout/box_builder.rs index d06dcb36daf..6a0404d2c3d 100644 --- a/src/components/main/layout/box_builder.rs +++ b/src/components/main/layout/box_builder.rs @@ -4,9 +4,6 @@ //! 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}; @@ -20,6 +17,9 @@ 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}; diff --git a/src/components/main/layout/flow.rs b/src/components/main/layout/flow.rs index c7dfc2252ad..c840a204d7f 100644 --- a/src/components/main/layout/flow.rs +++ b/src/components/main/layout/flow.rs @@ -25,7 +25,6 @@ /// 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; @@ -37,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 diff --git a/src/components/main/layout/inline.rs b/src/components/main/layout/inline.rs index c077d065353..3db7e23e34e 100644 --- a/src/components/main/layout/inline.rs +++ b/src/components/main/layout/inline.rs @@ -4,7 +4,6 @@ use core::cell::Cell; use core; -use dom::node::{AbstractNode, LayoutView}; use layout::box::{CannotSplit, GenericRenderBoxClass, ImageRenderBoxClass, RenderBox}; use layout::box::{SplitDidFit, SplitDidNotFit, TextRenderBoxClass, UnscannedTextRenderBoxClass}; use layout::context::LayoutContext; @@ -19,9 +18,8 @@ use gfx::geometry::Au; use gfx::text::text_run::TextRun; use gfx::text::util::*; use newcss::values::{CSSTextAlignCenter, CSSTextAlignJustify, CSSTextAlignLeft}; -use newcss::values::{CSSTextAlignRight}; -use newcss::values::CSSTextDecorationUnderline; -use newcss::values::CSSTextDecoration; +use newcss::values::{CSSTextAlignRight, CSSTextDecoration, CSSTextDecorationUnderline}; +use script::dom::node::{AbstractNode, LayoutView}; use servo_util::range::Range; use std::deque::Deque; diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index f97ea51f211..fc5d2bacc25 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -7,18 +7,11 @@ use css::matching::MatchMethods; use css::select::new_css_select_ctx; -use dom::event::ReflowEvent; -use dom::node::{AbstractNode, LayoutView}; use layout::aux::{LayoutData, LayoutAuxMethods}; use layout::box_builder::LayoutTreeBuilder; use layout::context::LayoutContext; use layout::display_list_builder::{DisplayListBuilder, FlowDisplayListBuilderMethods}; use layout::flow::FlowContext; -use layout_interface::{AddStylesheetMsg, BuildData, BuildMsg, ContentBoxQuery, ContentBoxResponse}; -use layout_interface::{ContentBoxesQuery, ContentBoxesResponse, ExitMsg, LayoutQuery}; -use layout_interface::{LayoutResponse, LayoutTask, MatchSelectorsDamage, Msg, NoDamage, QueryMsg}; -use layout_interface::{ReflowDamage}; -use scripting::script_task::{ScriptMsg, SendEventMsg}; use util::task::spawn_listener; use servo_util::time; use servo_util::time::time; @@ -40,6 +33,13 @@ use gfx::render_task::{RenderMsg, RenderTask}; use newcss::select::SelectCtx; use newcss::stylesheet::Stylesheet; use newcss::types::OriginAuthor; +use script::dom::event::ReflowEvent; +use script::dom::node::{AbstractNode, LayoutView}; +use script::layout_interface::{AddStylesheetMsg, BuildData, BuildMsg, ContentBoxQuery}; +use script::layout_interface::{ContentBoxResponse, ContentBoxesQuery, ContentBoxesResponse}; +use script::layout_interface::{ExitMsg, LayoutQuery, LayoutResponse, LayoutTask}; +use script::layout_interface::{MatchSelectorsDamage, Msg, NoDamage, QueryMsg, ReflowDamage}; +use script::script_task::{ScriptMsg, SendEventMsg}; use servo_net::image_cache_task::{ImageCacheTask, ImageResponseMsg}; use servo_net::local_image_cache::LocalImageCache; use servo_util::tree::TreeUtils; diff --git a/src/components/main/servo.rc b/src/components/main/servo.rc index 8c448b2d938..d2c29354bdd 100755 --- a/src/components/main/servo.rc +++ b/src/components/main/servo.rc @@ -17,11 +17,11 @@ extern mod geom; extern mod gfx (name = "gfx"); extern mod glut; extern mod http_client; -extern mod hubbub; extern mod js; extern mod layers; extern mod newcss (name = "css"); extern mod opengles; +extern mod script; extern mod servo_net (name = "net"); extern mod servo_util (name = "util"); extern mod sharegl; @@ -48,58 +48,15 @@ pub use servo_util::url::make_url; #[path="compositing/mod.rs"] pub mod compositing; -pub mod scripting { - pub mod script_task; -} - pub mod css { priv mod select_handler; priv mod node_util; - priv mod node_void_ptr; pub mod select; pub mod matching; pub mod node_style; } -pub mod dom { - pub mod bindings { - pub mod document; - pub mod element; - pub mod event; - pub mod eventtarget; - pub mod node; - pub mod text; - pub mod utils; - pub mod conversions; - pub mod window; - pub mod proxyhandler; - pub mod clientrect; - pub mod clientrectlist; - pub mod domparser; - pub mod htmlcollection; - pub mod codegen { - pub mod ClientRectBinding; - pub mod ClientRectListBinding; - pub mod DOMParserBinding; - pub mod EventBinding; - pub mod EventTargetBinding; - pub mod HTMLCollectionBinding; - } - } - pub mod characterdata; - pub mod clientrect; - pub mod clientrectlist; - pub mod document; - pub mod domparser; - pub mod element; - pub mod event; - pub mod eventtarget; - pub mod htmlcollection; - pub mod node; - pub mod window; -} - pub mod engine; pub mod layout { @@ -115,12 +72,6 @@ pub mod layout { mod aux; } -pub mod html { - pub mod cssparse; - pub mod hubbub_html_parser; -} - -pub mod layout_interface; pub mod windowing; #[path="platform/mod.rs"] diff --git a/src/components/main/dom/bindings/clientrect.rs b/src/components/script/dom/bindings/clientrect.rs similarity index 96% rename from src/components/main/dom/bindings/clientrect.rs rename to src/components/script/dom/bindings/clientrect.rs index ca7317de083..a21b12cc049 100644 --- a/src/components/main/dom/bindings/clientrect.rs +++ b/src/components/script/dom/bindings/clientrect.rs @@ -5,9 +5,10 @@ use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject, DerivedWrapper}; use dom::bindings::codegen::ClientRectBinding; use dom::clientrect::ClientRect; +use script_task::{task_from_context, global_script_context}; + use js::jsapi::{JSObject, JSContext, JSVal}; use js::glue::bindgen::RUST_OBJECT_TO_JSVAL; -use scripting::script_task::{task_from_context, global_script_context}; pub impl ClientRect { pub fn init_wrapper(@mut self) { diff --git a/src/components/main/dom/bindings/clientrectlist.rs b/src/components/script/dom/bindings/clientrectlist.rs similarity index 95% rename from src/components/main/dom/bindings/clientrectlist.rs rename to src/components/script/dom/bindings/clientrectlist.rs index 783dc78267d..aca6d85d1f4 100644 --- a/src/components/main/dom/bindings/clientrectlist.rs +++ b/src/components/script/dom/bindings/clientrectlist.rs @@ -5,8 +5,9 @@ use dom::bindings::codegen::ClientRectListBinding; use dom::bindings::utils::{WrapperCache, CacheableWrapper, BindingObject}; use dom::clientrectlist::ClientRectList; +use script_task::{task_from_context, global_script_context}; + use js::jsapi::{JSObject, JSContext}; -use scripting::script_task::{task_from_context, global_script_context}; pub impl ClientRectList { fn init_wrapper(@mut self) { diff --git a/src/components/main/dom/bindings/codegen/BindingGen.py b/src/components/script/dom/bindings/codegen/BindingGen.py similarity index 100% rename from src/components/main/dom/bindings/codegen/BindingGen.py rename to src/components/script/dom/bindings/codegen/BindingGen.py diff --git a/src/components/main/dom/bindings/codegen/BindingUtils.cpp b/src/components/script/dom/bindings/codegen/BindingUtils.cpp similarity index 100% rename from src/components/main/dom/bindings/codegen/BindingUtils.cpp rename to src/components/script/dom/bindings/codegen/BindingUtils.cpp diff --git a/src/components/main/dom/bindings/codegen/BindingUtils.h b/src/components/script/dom/bindings/codegen/BindingUtils.h similarity index 100% rename from src/components/main/dom/bindings/codegen/BindingUtils.h rename to src/components/script/dom/bindings/codegen/BindingUtils.h diff --git a/src/components/main/dom/bindings/codegen/Bindings.conf b/src/components/script/dom/bindings/codegen/Bindings.conf similarity index 100% rename from src/components/main/dom/bindings/codegen/Bindings.conf rename to src/components/script/dom/bindings/codegen/Bindings.conf diff --git a/src/components/main/dom/bindings/codegen/ClientRect.webidl b/src/components/script/dom/bindings/codegen/ClientRect.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/ClientRect.webidl rename to src/components/script/dom/bindings/codegen/ClientRect.webidl diff --git a/src/components/main/dom/bindings/codegen/ClientRectList.webidl b/src/components/script/dom/bindings/codegen/ClientRectList.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/ClientRectList.webidl rename to src/components/script/dom/bindings/codegen/ClientRectList.webidl diff --git a/src/components/main/dom/bindings/codegen/Codegen.py b/src/components/script/dom/bindings/codegen/Codegen.py similarity index 100% rename from src/components/main/dom/bindings/codegen/Codegen.py rename to src/components/script/dom/bindings/codegen/Codegen.py diff --git a/src/components/main/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py similarity index 99% rename from src/components/main/dom/bindings/codegen/CodegenRust.py rename to src/components/script/dom/bindings/codegen/CodegenRust.py index 6f2715839cd..3c0c07d5ab5 100644 --- a/src/components/main/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -4147,7 +4147,7 @@ class CGBindingRoot(CGThing): 'dom::domparser::*', #XXXjdm 'dom::event::*', #XXXjdm 'dom::eventtarget::*', #XXXjdm - 'scripting::script_task::task_from_context', + 'script_task::task_from_context', 'dom::bindings::utils::EnumEntry', 'dom::node::ScriptView', ], diff --git a/src/components/main/dom/bindings/codegen/Configuration.py b/src/components/script/dom/bindings/codegen/Configuration.py similarity index 100% rename from src/components/main/dom/bindings/codegen/Configuration.py rename to src/components/script/dom/bindings/codegen/Configuration.py diff --git a/src/components/main/dom/bindings/codegen/DOMJSClass.h b/src/components/script/dom/bindings/codegen/DOMJSClass.h similarity index 100% rename from src/components/main/dom/bindings/codegen/DOMJSClass.h rename to src/components/script/dom/bindings/codegen/DOMJSClass.h diff --git a/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.cpp b/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.cpp similarity index 100% rename from src/components/main/dom/bindings/codegen/DOMJSProxyHandler.cpp rename to src/components/script/dom/bindings/codegen/DOMJSProxyHandler.cpp diff --git a/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.h b/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.h similarity index 100% rename from src/components/main/dom/bindings/codegen/DOMJSProxyHandler.h rename to src/components/script/dom/bindings/codegen/DOMJSProxyHandler.h diff --git a/src/components/main/dom/bindings/codegen/DOMParser.webidl b/src/components/script/dom/bindings/codegen/DOMParser.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/DOMParser.webidl rename to src/components/script/dom/bindings/codegen/DOMParser.webidl diff --git a/src/components/main/dom/bindings/codegen/ErrorResult.h b/src/components/script/dom/bindings/codegen/ErrorResult.h similarity index 100% rename from src/components/main/dom/bindings/codegen/ErrorResult.h rename to src/components/script/dom/bindings/codegen/ErrorResult.h diff --git a/src/components/main/dom/bindings/codegen/Errors.msg b/src/components/script/dom/bindings/codegen/Errors.msg similarity index 100% rename from src/components/main/dom/bindings/codegen/Errors.msg rename to src/components/script/dom/bindings/codegen/Errors.msg diff --git a/src/components/main/dom/bindings/codegen/Event.webidl b/src/components/script/dom/bindings/codegen/Event.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/Event.webidl rename to src/components/script/dom/bindings/codegen/Event.webidl diff --git a/src/components/main/dom/bindings/codegen/EventTarget.webidl b/src/components/script/dom/bindings/codegen/EventTarget.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/EventTarget.webidl rename to src/components/script/dom/bindings/codegen/EventTarget.webidl diff --git a/src/components/main/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py b/src/components/script/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py similarity index 100% rename from src/components/main/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py rename to src/components/script/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py diff --git a/src/components/main/dom/bindings/codegen/GlobalGen.py b/src/components/script/dom/bindings/codegen/GlobalGen.py similarity index 100% rename from src/components/main/dom/bindings/codegen/GlobalGen.py rename to src/components/script/dom/bindings/codegen/GlobalGen.py diff --git a/src/components/main/dom/bindings/codegen/HTMLCollection.webidl b/src/components/script/dom/bindings/codegen/HTMLCollection.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/HTMLCollection.webidl rename to src/components/script/dom/bindings/codegen/HTMLCollection.webidl diff --git a/src/components/main/dom/bindings/codegen/Makefile.in b/src/components/script/dom/bindings/codegen/Makefile.in similarity index 100% rename from src/components/main/dom/bindings/codegen/Makefile.in rename to src/components/script/dom/bindings/codegen/Makefile.in diff --git a/src/components/main/dom/bindings/codegen/Nullable.h b/src/components/script/dom/bindings/codegen/Nullable.h similarity index 100% rename from src/components/main/dom/bindings/codegen/Nullable.h rename to src/components/script/dom/bindings/codegen/Nullable.h diff --git a/src/components/main/dom/bindings/codegen/PrimitiveConversions.h b/src/components/script/dom/bindings/codegen/PrimitiveConversions.h similarity index 100% rename from src/components/main/dom/bindings/codegen/PrimitiveConversions.h rename to src/components/script/dom/bindings/codegen/PrimitiveConversions.h diff --git a/src/components/main/dom/bindings/codegen/RegisterBindings.cpp b/src/components/script/dom/bindings/codegen/RegisterBindings.cpp similarity index 100% rename from src/components/main/dom/bindings/codegen/RegisterBindings.cpp rename to src/components/script/dom/bindings/codegen/RegisterBindings.cpp diff --git a/src/components/main/dom/bindings/codegen/RegisterBindings.h b/src/components/script/dom/bindings/codegen/RegisterBindings.h similarity index 100% rename from src/components/main/dom/bindings/codegen/RegisterBindings.h rename to src/components/script/dom/bindings/codegen/RegisterBindings.h diff --git a/src/components/main/dom/bindings/codegen/TypedArray.h b/src/components/script/dom/bindings/codegen/TypedArray.h similarity index 100% rename from src/components/main/dom/bindings/codegen/TypedArray.h rename to src/components/script/dom/bindings/codegen/TypedArray.h diff --git a/src/components/main/dom/bindings/codegen/crashtests/769464.html b/src/components/script/dom/bindings/codegen/crashtests/769464.html similarity index 100% rename from src/components/main/dom/bindings/codegen/crashtests/769464.html rename to src/components/script/dom/bindings/codegen/crashtests/769464.html diff --git a/src/components/main/dom/bindings/codegen/crashtests/crashtests.list b/src/components/script/dom/bindings/codegen/crashtests/crashtests.list similarity index 100% rename from src/components/main/dom/bindings/codegen/crashtests/crashtests.list rename to src/components/script/dom/bindings/codegen/crashtests/crashtests.list diff --git a/src/components/main/dom/bindings/codegen/parser/README b/src/components/script/dom/bindings/codegen/parser/README similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/README rename to src/components/script/dom/bindings/codegen/parser/README diff --git a/src/components/main/dom/bindings/codegen/parser/UPSTREAM b/src/components/script/dom/bindings/codegen/parser/UPSTREAM similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/UPSTREAM rename to src/components/script/dom/bindings/codegen/parser/UPSTREAM diff --git a/src/components/main/dom/bindings/codegen/parser/WebIDL.py b/src/components/script/dom/bindings/codegen/parser/WebIDL.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/WebIDL.py rename to src/components/script/dom/bindings/codegen/parser/WebIDL.py diff --git a/src/components/main/dom/bindings/codegen/parser/runtests.py b/src/components/script/dom/bindings/codegen/parser/runtests.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/runtests.py rename to src/components/script/dom/bindings/codegen/parser/runtests.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_any_null.py b/src/components/script/dom/bindings/codegen/parser/tests/test_any_null.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_any_null.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_any_null.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py b/src/components/script/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_argument_novoid.py b/src/components/script/dom/bindings/codegen/parser/tests/test_argument_novoid.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_argument_novoid.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_argument_novoid.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_array_of_interface.py b/src/components/script/dom/bindings/codegen/parser/tests/test_array_of_interface.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_array_of_interface.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_array_of_interface.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_arraybuffer.py b/src/components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_arraybuffer.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_attr.py b/src/components/script/dom/bindings/codegen/parser/tests/test_attr.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_attr.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_attr.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py b/src/components/script/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_builtin_filename.py b/src/components/script/dom/bindings/codegen/parser/tests/test_builtin_filename.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_builtin_filename.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_builtin_filename.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_builtins.py b/src/components/script/dom/bindings/codegen/parser/tests/test_builtins.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_builtins.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_builtins.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_callback.py b/src/components/script/dom/bindings/codegen/parser/tests/test_callback.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_callback.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_callback.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_callback_interface.py b/src/components/script/dom/bindings/codegen/parser/tests/test_callback_interface.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_callback_interface.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_callback_interface.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_const.py b/src/components/script/dom/bindings/codegen/parser/tests/test_const.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_const.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_const.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_constructor.py b/src/components/script/dom/bindings/codegen/parser/tests/test_constructor.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_constructor.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_constructor.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py b/src/components/script/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_deduplicate.py b/src/components/script/dom/bindings/codegen/parser/tests/test_deduplicate.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_deduplicate.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_deduplicate.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_dictionary.py b/src/components/script/dom/bindings/codegen/parser/tests/test_dictionary.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_dictionary.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_dictionary.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_distinguishability.py b/src/components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_distinguishability.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_double_null.py b/src/components/script/dom/bindings/codegen/parser/tests/test_double_null.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_double_null.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_double_null.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py b/src/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_empty_enum.py b/src/components/script/dom/bindings/codegen/parser/tests/test_empty_enum.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_empty_enum.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_empty_enum.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_enum.py b/src/components/script/dom/bindings/codegen/parser/tests/test_enum.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_enum.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_enum.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py b/src/components/script/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_error_colno.py b/src/components/script/dom/bindings/codegen/parser/tests/test_error_colno.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_error_colno.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_error_colno.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_error_lineno.py b/src/components/script/dom/bindings/codegen/parser/tests/test_error_lineno.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_error_lineno.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_error_lineno.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_extended_attributes.py b/src/components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_extended_attributes.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_forward_decl.py b/src/components/script/dom/bindings/codegen/parser/tests/test_forward_decl.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_forward_decl.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_forward_decl.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_implements.py b/src/components/script/dom/bindings/codegen/parser/tests/test_implements.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_implements.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_implements.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_parent.py b/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_parent.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_parent.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_parent.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_types.py b/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_types.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_types.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_types.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_interface.py b/src/components/script/dom/bindings/codegen/parser/tests/test_interface.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_interface.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_interface.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py b/src/components/script/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py b/src/components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_method.py b/src/components/script/dom/bindings/codegen/parser/tests/test_method.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_method.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_method.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py b/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_void.py b/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_void.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_nullable_void.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_nullable_void.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_optional_constraints.py b/src/components/script/dom/bindings/codegen/parser/tests/test_optional_constraints.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_optional_constraints.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_optional_constraints.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_overload.py b/src/components/script/dom/bindings/codegen/parser/tests/test_overload.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_overload.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_overload.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_sanity.py b/src/components/script/dom/bindings/codegen/parser/tests/test_sanity.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_sanity.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_sanity.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py b/src/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods.py b/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_special_methods.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py b/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py b/src/components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_typedef.py b/src/components/script/dom/bindings/codegen/parser/tests/test_typedef.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_typedef.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_typedef.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_union.py b/src/components/script/dom/bindings/codegen/parser/tests/test_union.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_union.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_union.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_union_any.py b/src/components/script/dom/bindings/codegen/parser/tests/test_union_any.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_union_any.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_union_any.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_union_nullable.py b/src/components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_union_nullable.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_callback.py b/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_callback.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_variadic_callback.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_variadic_callback.py diff --git a/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_constraints.py b/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py similarity index 100% rename from src/components/main/dom/bindings/codegen/parser/tests/test_variadic_constraints.py rename to src/components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py diff --git a/src/components/main/dom/bindings/codegen/ply/COPYING b/src/components/script/dom/bindings/codegen/ply/COPYING similarity index 100% rename from src/components/main/dom/bindings/codegen/ply/COPYING rename to src/components/script/dom/bindings/codegen/ply/COPYING diff --git a/src/components/main/dom/bindings/codegen/ply/README b/src/components/script/dom/bindings/codegen/ply/README similarity index 100% rename from src/components/main/dom/bindings/codegen/ply/README rename to src/components/script/dom/bindings/codegen/ply/README diff --git a/src/components/main/dom/bindings/codegen/ply/ply/__init__.py b/src/components/script/dom/bindings/codegen/ply/ply/__init__.py similarity index 100% rename from src/components/main/dom/bindings/codegen/ply/ply/__init__.py rename to src/components/script/dom/bindings/codegen/ply/ply/__init__.py diff --git a/src/components/main/dom/bindings/codegen/ply/ply/lex.py b/src/components/script/dom/bindings/codegen/ply/ply/lex.py similarity index 100% rename from src/components/main/dom/bindings/codegen/ply/ply/lex.py rename to src/components/script/dom/bindings/codegen/ply/ply/lex.py diff --git a/src/components/main/dom/bindings/codegen/ply/ply/yacc.py b/src/components/script/dom/bindings/codegen/ply/ply/yacc.py similarity index 100% rename from src/components/main/dom/bindings/codegen/ply/ply/yacc.py rename to src/components/script/dom/bindings/codegen/ply/ply/yacc.py diff --git a/src/components/main/dom/bindings/codegen/pythonpath.py b/src/components/script/dom/bindings/codegen/pythonpath.py similarity index 100% rename from src/components/main/dom/bindings/codegen/pythonpath.py rename to src/components/script/dom/bindings/codegen/pythonpath.py diff --git a/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.cpp b/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.cpp similarity index 100% rename from src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.cpp rename to src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.cpp diff --git a/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.h b/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.h similarity index 100% rename from src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.h rename to src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.h diff --git a/src/components/main/dom/bindings/codegen/stubgenerator/generate.sh b/src/components/script/dom/bindings/codegen/stubgenerator/generate.sh similarity index 100% rename from src/components/main/dom/bindings/codegen/stubgenerator/generate.sh rename to src/components/script/dom/bindings/codegen/stubgenerator/generate.sh diff --git a/src/components/main/dom/bindings/codegen/test/Makefile.in b/src/components/script/dom/bindings/codegen/test/Makefile.in similarity index 100% rename from src/components/main/dom/bindings/codegen/test/Makefile.in rename to src/components/script/dom/bindings/codegen/test/Makefile.in diff --git a/src/components/main/dom/bindings/codegen/test/TestBindingHeader.h b/src/components/script/dom/bindings/codegen/test/TestBindingHeader.h similarity index 100% rename from src/components/main/dom/bindings/codegen/test/TestBindingHeader.h rename to src/components/script/dom/bindings/codegen/test/TestBindingHeader.h diff --git a/src/components/main/dom/bindings/codegen/test/TestCodeGen.webidl b/src/components/script/dom/bindings/codegen/test/TestCodeGen.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/test/TestCodeGen.webidl rename to src/components/script/dom/bindings/codegen/test/TestCodeGen.webidl diff --git a/src/components/main/dom/bindings/codegen/test/TestDictionary.webidl b/src/components/script/dom/bindings/codegen/test/TestDictionary.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/test/TestDictionary.webidl rename to src/components/script/dom/bindings/codegen/test/TestDictionary.webidl diff --git a/src/components/main/dom/bindings/codegen/test/TestTypedef.webidl b/src/components/script/dom/bindings/codegen/test/TestTypedef.webidl similarity index 100% rename from src/components/main/dom/bindings/codegen/test/TestTypedef.webidl rename to src/components/script/dom/bindings/codegen/test/TestTypedef.webidl diff --git a/src/components/main/dom/bindings/codegen/test/file_bug775543.html b/src/components/script/dom/bindings/codegen/test/file_bug775543.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/file_bug775543.html rename to src/components/script/dom/bindings/codegen/test/file_bug775543.html diff --git a/src/components/main/dom/bindings/codegen/test/forOf_iframe.html b/src/components/script/dom/bindings/codegen/test/forOf_iframe.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/forOf_iframe.html rename to src/components/script/dom/bindings/codegen/test/forOf_iframe.html diff --git a/src/components/main/dom/bindings/codegen/test/test_InstanceOf.html b/src/components/script/dom/bindings/codegen/test/test_InstanceOf.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_InstanceOf.html rename to src/components/script/dom/bindings/codegen/test/test_InstanceOf.html diff --git a/src/components/main/dom/bindings/codegen/test/test_bug773326.html b/src/components/script/dom/bindings/codegen/test/test_bug773326.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_bug773326.html rename to src/components/script/dom/bindings/codegen/test/test_bug773326.html diff --git a/src/components/main/dom/bindings/codegen/test/test_bug775543.html b/src/components/script/dom/bindings/codegen/test/test_bug775543.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_bug775543.html rename to src/components/script/dom/bindings/codegen/test/test_bug775543.html diff --git a/src/components/main/dom/bindings/codegen/test/test_bug788369.html b/src/components/script/dom/bindings/codegen/test/test_bug788369.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_bug788369.html rename to src/components/script/dom/bindings/codegen/test/test_bug788369.html diff --git a/src/components/main/dom/bindings/codegen/test/test_enums.html b/src/components/script/dom/bindings/codegen/test/test_enums.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_enums.html rename to src/components/script/dom/bindings/codegen/test/test_enums.html diff --git a/src/components/main/dom/bindings/codegen/test/test_forOf.html b/src/components/script/dom/bindings/codegen/test/test_forOf.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_forOf.html rename to src/components/script/dom/bindings/codegen/test/test_forOf.html diff --git a/src/components/main/dom/bindings/codegen/test/test_integers.html b/src/components/script/dom/bindings/codegen/test/test_integers.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_integers.html rename to src/components/script/dom/bindings/codegen/test/test_integers.html diff --git a/src/components/main/dom/bindings/codegen/test/test_interfaceToString.html b/src/components/script/dom/bindings/codegen/test/test_interfaceToString.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_interfaceToString.html rename to src/components/script/dom/bindings/codegen/test/test_interfaceToString.html diff --git a/src/components/main/dom/bindings/codegen/test/test_lookupGetter.html b/src/components/script/dom/bindings/codegen/test/test_lookupGetter.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_lookupGetter.html rename to src/components/script/dom/bindings/codegen/test/test_lookupGetter.html diff --git a/src/components/main/dom/bindings/codegen/test/test_sequence_wrapping.html b/src/components/script/dom/bindings/codegen/test/test_sequence_wrapping.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_sequence_wrapping.html rename to src/components/script/dom/bindings/codegen/test/test_sequence_wrapping.html diff --git a/src/components/main/dom/bindings/codegen/test/test_traceProtos.html b/src/components/script/dom/bindings/codegen/test/test_traceProtos.html similarity index 100% rename from src/components/main/dom/bindings/codegen/test/test_traceProtos.html rename to src/components/script/dom/bindings/codegen/test/test_traceProtos.html diff --git a/src/components/main/dom/bindings/conversions.rs b/src/components/script/dom/bindings/conversions.rs similarity index 100% rename from src/components/main/dom/bindings/conversions.rs rename to src/components/script/dom/bindings/conversions.rs diff --git a/src/components/main/dom/bindings/document.rs b/src/components/script/dom/bindings/document.rs similarity index 99% rename from src/components/main/dom/bindings/document.rs rename to src/components/script/dom/bindings/document.rs index 36029e8d5b8..87889f52ff9 100644 --- a/src/components/main/dom/bindings/document.rs +++ b/src/components/script/dom/bindings/document.rs @@ -17,7 +17,7 @@ use js::jsapi::{JSStrictPropertyOpWrapper, JSNativeWrapper, JSFunctionSpec}; use js::rust::{Compartment, jsobj}; use js::{JSPROP_NATIVE_ACCESSORS}; use js::{JS_ARGV, JSPROP_ENUMERATE, JSPROP_SHARED, JSVAL_NULL, JS_THIS_OBJECT, JS_SET_RVAL}; -use scripting::script_task::task_from_context; +use script_task::task_from_context; use core::libc::c_uint; use core::ptr::null; diff --git a/src/components/main/dom/bindings/domparser.rs b/src/components/script/dom/bindings/domparser.rs similarity index 100% rename from src/components/main/dom/bindings/domparser.rs rename to src/components/script/dom/bindings/domparser.rs diff --git a/src/components/main/dom/bindings/element.rs b/src/components/script/dom/bindings/element.rs similarity index 99% rename from src/components/main/dom/bindings/element.rs rename to src/components/script/dom/bindings/element.rs index 11930321136..4e296e3bb6f 100644 --- a/src/components/main/dom/bindings/element.rs +++ b/src/components/script/dom/bindings/element.rs @@ -9,7 +9,7 @@ use dom::bindings::utils::{str, CacheableWrapper, DOM_OBJECT_SLOT, DOMString}; use dom::element::*; use dom::node::{AbstractNode, Element, ElementNodeTypeId, ScriptView}; use layout_interface::{ContentBoxQuery, ContentBoxResponse}; -use scripting::script_task::task_from_context; +use script_task::task_from_context; use super::utils; use core::libc::c_uint; diff --git a/src/components/main/dom/bindings/event.rs b/src/components/script/dom/bindings/event.rs similarity index 96% rename from src/components/main/dom/bindings/event.rs rename to src/components/script/dom/bindings/event.rs index 1463ffe7ea4..432dee40838 100644 --- a/src/components/main/dom/bindings/event.rs +++ b/src/components/script/dom/bindings/event.rs @@ -5,9 +5,10 @@ use dom::bindings::codegen::EventBinding; use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject, DerivedWrapper}; use dom::event::Event_; +use script_task::{task_from_context, global_script_context}; + use js::glue::bindgen::RUST_OBJECT_TO_JSVAL; use js::jsapi::{JSObject, JSContext, JSVal}; -use scripting::script_task::{task_from_context, global_script_context}; pub impl Event_ { pub fn init_wrapper(@mut self) { diff --git a/src/components/main/dom/bindings/eventtarget.rs b/src/components/script/dom/bindings/eventtarget.rs similarity index 96% rename from src/components/main/dom/bindings/eventtarget.rs rename to src/components/script/dom/bindings/eventtarget.rs index 2b721f92d3e..7b82f915791 100644 --- a/src/components/main/dom/bindings/eventtarget.rs +++ b/src/components/script/dom/bindings/eventtarget.rs @@ -5,10 +5,10 @@ use dom::bindings::codegen::EventTargetBinding; use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject, DerivedWrapper}; use dom::eventtarget::EventTarget; +use script_task::{task_from_context, global_script_context}; use js::glue::bindgen::RUST_OBJECT_TO_JSVAL; use js::jsapi::{JSObject, JSContext, JSVal}; -use scripting::script_task::{task_from_context, global_script_context}; pub impl EventTarget { pub fn init_wrapper(@mut self) { diff --git a/src/components/main/dom/bindings/htmlcollection.rs b/src/components/script/dom/bindings/htmlcollection.rs similarity index 95% rename from src/components/main/dom/bindings/htmlcollection.rs rename to src/components/script/dom/bindings/htmlcollection.rs index 11e3f75e0d0..866e7634ada 100644 --- a/src/components/main/dom/bindings/htmlcollection.rs +++ b/src/components/script/dom/bindings/htmlcollection.rs @@ -5,8 +5,9 @@ use dom::bindings::codegen::HTMLCollectionBinding; use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache}; use dom::htmlcollection::HTMLCollection; +use script_task::{task_from_context, global_script_context}; + use js::jsapi::{JSObject, JSContext}; -use scripting::script_task::{task_from_context, global_script_context}; pub impl HTMLCollection { fn init_wrapper(@mut self) { diff --git a/src/components/main/dom/bindings/node.rs b/src/components/script/dom/bindings/node.rs similarity index 100% rename from src/components/main/dom/bindings/node.rs rename to src/components/script/dom/bindings/node.rs diff --git a/src/components/main/dom/bindings/proxyhandler.rs b/src/components/script/dom/bindings/proxyhandler.rs similarity index 100% rename from src/components/main/dom/bindings/proxyhandler.rs rename to src/components/script/dom/bindings/proxyhandler.rs diff --git a/src/components/main/dom/bindings/text.rs b/src/components/script/dom/bindings/text.rs similarity index 100% rename from src/components/main/dom/bindings/text.rs rename to src/components/script/dom/bindings/text.rs diff --git a/src/components/main/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs similarity index 99% rename from src/components/main/dom/bindings/utils.rs rename to src/components/script/dom/bindings/utils.rs index b341c6ae2f8..206cc4224ba 100644 --- a/src/components/main/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -4,6 +4,11 @@ use dom::bindings::node; use dom::node::{AbstractNode, ScriptView}; +use script_task::task_from_context; + +use core::cast; +use core::hashmap::HashMap; +use core::ptr::{null, to_unsafe_ptr}; use js::glue::bindgen::*; use js::glue::bindgen::{DefineFunctionWithReserved, GetObjectJSClass, RUST_OBJECT_TO_JSVAL}; use js::glue::{PROPERTY_STUB, STRICT_PROPERTY_STUB, ENUMERATE_STUB, CONVERT_STUB, RESOLVE_STUB}; @@ -24,11 +29,6 @@ use js::{JSPROP_PERMANENT, JSID_VOID, JSPROP_NATIVE_ACCESSORS, JSPROP_GETTER}; use js::{JSPROP_SETTER, JSVAL_VOID, JSVAL_TRUE, JSVAL_FALSE}; use js::{JS_THIS_OBJECT, JSFUN_CONSTRUCTOR, JS_CALLEE, JSPROP_READONLY}; use js; -use scripting::script_task::task_from_context; - -use core::cast; -use core::hashmap::HashMap; -use core::ptr::{null, to_unsafe_ptr}; static TOSTRING_CLASS_RESERVED_SLOT: u64 = 0; static TOSTRING_NAME_RESERVED_SLOT: u64 = 1; diff --git a/src/components/main/dom/bindings/window.rs b/src/components/script/dom/bindings/window.rs similarity index 100% rename from src/components/main/dom/bindings/window.rs rename to src/components/script/dom/bindings/window.rs diff --git a/src/components/main/dom/characterdata.rs b/src/components/script/dom/characterdata.rs similarity index 100% rename from src/components/main/dom/characterdata.rs rename to src/components/script/dom/characterdata.rs diff --git a/src/components/main/dom/clientrect.rs b/src/components/script/dom/clientrect.rs similarity index 100% rename from src/components/main/dom/clientrect.rs rename to src/components/script/dom/clientrect.rs diff --git a/src/components/main/dom/clientrectlist.rs b/src/components/script/dom/clientrectlist.rs similarity index 100% rename from src/components/main/dom/clientrectlist.rs rename to src/components/script/dom/clientrectlist.rs diff --git a/src/components/main/dom/document.rs b/src/components/script/dom/document.rs similarity index 97% rename from src/components/main/dom/document.rs rename to src/components/script/dom/document.rs index e912e593ec0..ba52025362f 100644 --- a/src/components/main/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -7,7 +7,7 @@ use dom::bindings::utils::{DOMString, WrapperCache}; use dom::htmlcollection::HTMLCollection; use dom::node::{AbstractNode, ScriptView}; use dom::window::Window; -use scripting::script_task::global_script_context; +use script_task::global_script_context; use js::jsapi::bindgen::{JS_AddObjectRoot, JS_RemoveObjectRoot}; use servo_util::tree::{TreeNodeRef, TreeUtils}; diff --git a/src/components/main/dom/domparser.rs b/src/components/script/dom/domparser.rs similarity index 96% rename from src/components/main/dom/domparser.rs rename to src/components/script/dom/domparser.rs index 8e8ed345a08..e5609e60f49 100644 --- a/src/components/main/dom/domparser.rs +++ b/src/components/script/dom/domparser.rs @@ -8,7 +8,7 @@ use dom::document::Document; use dom::element::{Element, HTMLHtmlElement, HTMLHtmlElementTypeId}; use dom::node::Node; use dom::window::Window; -use scripting::script_task::global_script_context; +use script_task::global_script_context; pub struct DOMParser { owner: @mut Window, //XXXjdm Document instead? diff --git a/src/components/main/dom/element.rs b/src/components/script/dom/element.rs similarity index 100% rename from src/components/main/dom/element.rs rename to src/components/script/dom/element.rs diff --git a/src/components/main/dom/event.rs b/src/components/script/dom/event.rs similarity index 100% rename from src/components/main/dom/event.rs rename to src/components/script/dom/event.rs diff --git a/src/components/main/dom/eventtarget.rs b/src/components/script/dom/eventtarget.rs similarity index 100% rename from src/components/main/dom/eventtarget.rs rename to src/components/script/dom/eventtarget.rs diff --git a/src/components/main/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs similarity index 100% rename from src/components/main/dom/htmlcollection.rs rename to src/components/script/dom/htmlcollection.rs diff --git a/src/components/main/dom/node.rs b/src/components/script/dom/node.rs similarity index 96% rename from src/components/main/dom/node.rs rename to src/components/script/dom/node.rs index 98907787f7d..875c31f8322 100644 --- a/src/components/main/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -12,10 +12,12 @@ use dom::characterdata::CharacterData; use dom::document::Document; use dom::element::{Element, ElementTypeId, HTMLImageElement, HTMLImageElementTypeId}; use dom::element::{HTMLStyleElementTypeId}; -use scripting::script_task::global_script_context; +use script_task::global_script_context; use core::cast::transmute; +use core::libc::c_void; use js::rust::Compartment; +use netsurfcss::util::VoidPtrLike; use servo_util::tree::{TreeNode, TreeNodeRef, TreeUtils}; // @@ -425,6 +427,23 @@ impl Node { } } +/// The CSS library requires that DOM nodes be convertible to `*c_void` via the `VoidPtrLike` +/// trait. +impl VoidPtrLike for AbstractNode { + fn from_void_ptr(node: *c_void) -> AbstractNode { + assert!(node.is_not_null()); + unsafe { + cast::transmute(node) + } + } + + fn to_void_ptr(&self) -> *c_void { + unsafe { + cast::transmute(*self) + } + } +} + pub fn define_bindings(compartment: @mut Compartment) { bindings::window::init(compartment); bindings::document::init(compartment); diff --git a/src/components/main/dom/window.rs b/src/components/script/dom/window.rs similarity index 93% rename from src/components/main/dom/window.rs rename to src/components/script/dom/window.rs index 439dca0fd79..c94e6488a67 100644 --- a/src/components/main/dom/window.rs +++ b/src/components/script/dom/window.rs @@ -5,10 +5,9 @@ use dom::bindings::utils::WrapperCache; use dom::bindings::window; use layout_interface::MatchSelectorsDamage; -use scripting::script_task::{ExitMsg, FireTimerMsg, ScriptMsg, ScriptContext}; -use util::task::spawn_listener; +use script_task::{ExitMsg, FireTimerMsg, ScriptMsg, ScriptContext}; -use core::comm::{Port, Chan, SharedChan}; +use core::comm::{Chan, SharedChan}; use js::jsapi::JSVal; use std::timer; use std::uv_global_loop; @@ -95,7 +94,8 @@ pub impl Window { wrapper: WrapperCache::new(), script_chan: script_chan, timer_chan: { - do spawn_listener |timer_port: Port| { + let (timer_port, timer_chan) = comm::stream::(); + do spawn { loop { match timer_port.recv() { TimerMessage_Close => break, @@ -104,6 +104,7 @@ pub impl Window { } } } + timer_chan }, script_context: script_context, }; diff --git a/src/components/main/html/cssparse.rs b/src/components/script/html/cssparse.rs similarity index 100% rename from src/components/main/html/cssparse.rs rename to src/components/script/html/cssparse.rs diff --git a/src/components/main/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs similarity index 95% rename from src/components/main/html/hubbub_html_parser.rs rename to src/components/script/html/hubbub_html_parser.rs index 7d601950cfc..db67b48f035 100644 --- a/src/components/main/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -7,7 +7,6 @@ use dom::node::{AbstractNode, Comment, Doctype, Element, ElementNodeTypeId, Node use dom::node::{Text}; use html::cssparse::{InlineProvenance, StylesheetProvenance, UrlProvenance, spawn_css_parser}; use newcss::stylesheet::Stylesheet; -use util::task::spawn_conversation; use core::cell::Cell; use core::comm::{Chan, Port, SharedChan}; @@ -208,21 +207,27 @@ pub fn parse_html(url: Url, image_cache_task: ImageCacheTask) -> HtmlParserResult { // Spawn a CSS parser to receive links to CSS style sheets. let resource_task2 = resource_task.clone(); - let (css_port, css_chan): (Port>, Chan) = - do spawn_conversation |css_port: Port, - css_chan: Chan>| { - css_link_listener(css_chan, css_port, resource_task2.clone()); - }; - let css_chan = SharedChan::new(css_chan); + + let (stylesheet_port, stylesheet_chan) = comm::stream(); + let stylesheet_chan = Cell(stylesheet_chan); + let (css_msg_port, css_msg_chan) = comm::stream(); + let css_msg_port = Cell(css_msg_port); + do spawn { + css_link_listener(stylesheet_chan.take(), css_msg_port.take(), resource_task2.clone()); + } + + let css_chan = SharedChan::new(css_msg_chan); // Spawn a JS parser to receive JavaScript. let resource_task2 = resource_task.clone(); - let (js_port, js_chan): (Port, Chan) = - do spawn_conversation |js_port: Port, - js_chan: Chan| { - js_script_listener(js_chan, js_port, resource_task2.clone()); - }; - let js_chan = SharedChan::new(js_chan); + let (js_result_port, js_result_chan) = comm::stream(); + let js_result_chan = Cell(js_result_chan); + let (js_msg_port, js_msg_chan) = comm::stream(); + let js_msg_port = Cell(js_msg_port); + do spawn { + js_script_listener(js_result_chan.take(), js_msg_port.take(), resource_task2.clone()); + } + let js_chan = SharedChan::new(js_msg_chan); let url2 = url.clone(), url3 = url.clone(); @@ -424,6 +429,10 @@ pub fn parse_html(url: Url, css_chan.send(CSSTaskExit); js_chan.send(JSTaskExit); - return HtmlParserResult { root: root, style_port: css_port, js_port: js_port }; + HtmlParserResult { + root: root, + style_port: stylesheet_port, + js_port: js_result_port, + } } diff --git a/src/components/main/layout_interface.rs b/src/components/script/layout_interface.rs similarity index 98% rename from src/components/main/layout_interface.rs rename to src/components/script/layout_interface.rs index fc99bb3dcab..b442dc440d3 100644 --- a/src/components/main/layout_interface.rs +++ b/src/components/script/layout_interface.rs @@ -7,7 +7,7 @@ /// from layout. use dom::node::{AbstractNode, ScriptView}; -use scripting::script_task::ScriptMsg; +use script_task::ScriptMsg; use core::comm::{Chan, SharedChan}; use geom::rect::Rect; diff --git a/src/components/script/script.rc b/src/components/script/script.rc new file mode 100644 index 00000000000..0c40fc8aab3 --- /dev/null +++ b/src/components/script/script.rc @@ -0,0 +1,69 @@ +/* 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/. */ + +#[link(name = "script", + vers = "0.1", + uuid = "536a45e2-b605-4ee0-b54c-466810f1ffc1", + url = "http://servo.org/")]; + +#[comment = "The Servo Parallel Browser Project"]; +#[license = "MPL"]; +#[crate_type = "lib"]; + +extern mod geom; +extern mod gfx (name = "gfx"); +extern mod hubbub; +extern mod js; +extern mod netsurfcss; +extern mod newcss (name = "css"); +extern mod servo_net (name = "net"); +extern mod servo_util (name = "util"); +extern mod std; + +pub mod dom { + pub mod bindings { + pub mod document; + pub mod element; + pub mod event; + pub mod eventtarget; + pub mod node; + pub mod text; + pub mod utils; + pub mod conversions; + pub mod window; + pub mod proxyhandler; + pub mod clientrect; + pub mod clientrectlist; + pub mod domparser; + pub mod htmlcollection; + pub mod codegen { + pub mod ClientRectBinding; + pub mod ClientRectListBinding; + pub mod DOMParserBinding; + pub mod EventBinding; + pub mod EventTargetBinding; + pub mod HTMLCollectionBinding; + } + } + pub mod characterdata; + pub mod clientrect; + pub mod clientrectlist; + pub mod document; + pub mod domparser; + pub mod element; + pub mod event; + pub mod eventtarget; + pub mod htmlcollection; + pub mod node; + pub mod window; +} + +pub mod html { + pub mod cssparse; + pub mod hubbub_html_parser; +} + +pub mod layout_interface; +pub mod script_task; + diff --git a/src/components/main/scripting/script_task.rs b/src/components/script/script_task.rs similarity index 100% rename from src/components/main/scripting/script_task.rs rename to src/components/script/script_task.rs diff --git a/src/etc/tidy.py b/src/etc/tidy.py index 4ffe776e8c3..d756bb6c9eb 100644 --- a/src/etc/tidy.py +++ b/src/etc/tidy.py @@ -35,7 +35,7 @@ exceptions = [ "src/support", # Upstream "src/platform", # Upstream "src/compiler", # Upstream - "src/components/main/dom/bindings/codegen", # Generated and upstream code combined with our own. Could use cleanup + "src/components/script/dom/bindings/codegen", # Generated and upstream code combined with our own. Could use cleanup ] def should_check(name):