From ade50cbb3903397af87d9438ceba3354bc72ab9a Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 30 May 2013 00:06:42 -0700 Subject: [PATCH] servo: Merge #474 - Separate the DOM and layout into separate crates (from pcwalton:separation); r=pcwalton r? @metajack Source-Repo: https://github.com/servo/servo Source-Revision: 473b0941eca8c6498e5065892de49562dce0b78c --HG-- rename : servo/src/components/main/dom/bindings/clientrect.rs => servo/src/components/script/dom/bindings/clientrect.rs rename : servo/src/components/main/dom/bindings/clientrectlist.rs => servo/src/components/script/dom/bindings/clientrectlist.rs rename : servo/src/components/main/dom/bindings/codegen/BindingGen.py => servo/src/components/script/dom/bindings/codegen/BindingGen.py rename : servo/src/components/main/dom/bindings/codegen/BindingUtils.cpp => servo/src/components/script/dom/bindings/codegen/BindingUtils.cpp rename : servo/src/components/main/dom/bindings/codegen/BindingUtils.h => servo/src/components/script/dom/bindings/codegen/BindingUtils.h rename : servo/src/components/main/dom/bindings/codegen/Bindings.conf => servo/src/components/script/dom/bindings/codegen/Bindings.conf rename : servo/src/components/main/dom/bindings/codegen/ClientRect.webidl => servo/src/components/script/dom/bindings/codegen/ClientRect.webidl rename : servo/src/components/main/dom/bindings/codegen/ClientRectList.webidl => servo/src/components/script/dom/bindings/codegen/ClientRectList.webidl rename : servo/src/components/main/dom/bindings/codegen/Codegen.py => servo/src/components/script/dom/bindings/codegen/Codegen.py rename : servo/src/components/main/dom/bindings/codegen/CodegenRust.py => servo/src/components/script/dom/bindings/codegen/CodegenRust.py rename : servo/src/components/main/dom/bindings/codegen/Configuration.py => servo/src/components/script/dom/bindings/codegen/Configuration.py rename : servo/src/components/main/dom/bindings/codegen/DOMJSClass.h => servo/src/components/script/dom/bindings/codegen/DOMJSClass.h rename : servo/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.cpp => servo/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.cpp rename : servo/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.h => servo/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.h rename : servo/src/components/main/dom/bindings/codegen/DOMParser.webidl => servo/src/components/script/dom/bindings/codegen/DOMParser.webidl rename : servo/src/components/main/dom/bindings/codegen/ErrorResult.h => servo/src/components/script/dom/bindings/codegen/ErrorResult.h rename : servo/src/components/main/dom/bindings/codegen/Errors.msg => servo/src/components/script/dom/bindings/codegen/Errors.msg rename : servo/src/components/main/dom/bindings/codegen/Event.webidl => servo/src/components/script/dom/bindings/codegen/Event.webidl rename : servo/src/components/main/dom/bindings/codegen/EventTarget.webidl => servo/src/components/script/dom/bindings/codegen/EventTarget.webidl rename : servo/src/components/main/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py => servo/src/components/script/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py rename : servo/src/components/main/dom/bindings/codegen/GlobalGen.py => servo/src/components/script/dom/bindings/codegen/GlobalGen.py rename : servo/src/components/main/dom/bindings/codegen/HTMLCollection.webidl => servo/src/components/script/dom/bindings/codegen/HTMLCollection.webidl rename : servo/src/components/main/dom/bindings/codegen/Makefile.in => servo/src/components/script/dom/bindings/codegen/Makefile.in rename : servo/src/components/main/dom/bindings/codegen/Nullable.h => servo/src/components/script/dom/bindings/codegen/Nullable.h rename : servo/src/components/main/dom/bindings/codegen/PrimitiveConversions.h => servo/src/components/script/dom/bindings/codegen/PrimitiveConversions.h rename : servo/src/components/main/dom/bindings/codegen/RegisterBindings.cpp => servo/src/components/script/dom/bindings/codegen/RegisterBindings.cpp rename : servo/src/components/main/dom/bindings/codegen/RegisterBindings.h => servo/src/components/script/dom/bindings/codegen/RegisterBindings.h rename : servo/src/components/main/dom/bindings/codegen/TypedArray.h => servo/src/components/script/dom/bindings/codegen/TypedArray.h rename : servo/src/components/main/dom/bindings/codegen/crashtests/769464.html => servo/src/components/script/dom/bindings/codegen/crashtests/769464.html rename : servo/src/components/main/dom/bindings/codegen/crashtests/crashtests.list => servo/src/components/script/dom/bindings/codegen/crashtests/crashtests.list rename : servo/src/components/main/dom/bindings/codegen/parser/README => servo/src/components/script/dom/bindings/codegen/parser/README rename : servo/src/components/main/dom/bindings/codegen/parser/UPSTREAM => servo/src/components/script/dom/bindings/codegen/parser/UPSTREAM rename : servo/src/components/main/dom/bindings/codegen/parser/WebIDL.py => servo/src/components/script/dom/bindings/codegen/parser/WebIDL.py rename : servo/src/components/main/dom/bindings/codegen/parser/runtests.py => servo/src/components/script/dom/bindings/codegen/parser/runtests.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_any_null.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_any_null.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_argument_novoid.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_argument_novoid.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_array_of_interface.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_array_of_interface.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_arraybuffer.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_attr.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_attr.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_builtin_filename.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_builtin_filename.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_builtins.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_builtins.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_callback.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_callback.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_callback_interface.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_callback_interface.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_const.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_const.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_constructor.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_constructor.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_deduplicate.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_deduplicate.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_dictionary.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_dictionary.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_distinguishability.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_double_null.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_double_null.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_empty_enum.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_empty_enum.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_enum.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_enum.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_error_colno.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_error_colno.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_error_lineno.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_error_lineno.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_extended_attributes.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_forward_decl.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_forward_decl.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_implements.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_implements.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_parent.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_parent.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_types.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_types.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_method.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_method.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_void.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_void.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_optional_constraints.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_optional_constraints.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_overload.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_overload.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_sanity.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_sanity.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_typedef.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_typedef.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_union.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_union.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_union_any.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_union_any.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_union_nullable.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_callback.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_callback.py rename : servo/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_constraints.py => servo/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py rename : servo/src/components/main/dom/bindings/codegen/ply/COPYING => servo/src/components/script/dom/bindings/codegen/ply/COPYING rename : servo/src/components/main/dom/bindings/codegen/ply/README => servo/src/components/script/dom/bindings/codegen/ply/README rename : servo/src/components/main/dom/bindings/codegen/ply/ply/__init__.py => servo/src/components/script/dom/bindings/codegen/ply/ply/__init__.py rename : servo/src/components/main/dom/bindings/codegen/ply/ply/lex.py => servo/src/components/script/dom/bindings/codegen/ply/ply/lex.py rename : servo/src/components/main/dom/bindings/codegen/ply/ply/yacc.py => servo/src/components/script/dom/bindings/codegen/ply/ply/yacc.py rename : servo/src/components/main/dom/bindings/codegen/pythonpath.py => servo/src/components/script/dom/bindings/codegen/pythonpath.py rename : servo/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.cpp => servo/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.cpp rename : servo/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.h => servo/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.h rename : servo/src/components/main/dom/bindings/codegen/stubgenerator/generate.sh => servo/src/components/script/dom/bindings/codegen/stubgenerator/generate.sh rename : servo/src/components/main/dom/bindings/codegen/test/Makefile.in => servo/src/components/script/dom/bindings/codegen/test/Makefile.in rename : servo/src/components/main/dom/bindings/codegen/test/TestBindingHeader.h => servo/src/components/script/dom/bindings/codegen/test/TestBindingHeader.h rename : servo/src/components/main/dom/bindings/codegen/test/TestCodeGen.webidl => servo/src/components/script/dom/bindings/codegen/test/TestCodeGen.webidl rename : servo/src/components/main/dom/bindings/codegen/test/TestDictionary.webidl => servo/src/components/script/dom/bindings/codegen/test/TestDictionary.webidl rename : servo/src/components/main/dom/bindings/codegen/test/TestTypedef.webidl => servo/src/components/script/dom/bindings/codegen/test/TestTypedef.webidl rename : servo/src/components/main/dom/bindings/codegen/test/file_bug775543.html => servo/src/components/script/dom/bindings/codegen/test/file_bug775543.html rename : servo/src/components/main/dom/bindings/codegen/test/forOf_iframe.html => servo/src/components/script/dom/bindings/codegen/test/forOf_iframe.html rename : servo/src/components/main/dom/bindings/codegen/test/test_InstanceOf.html => servo/src/components/script/dom/bindings/codegen/test/test_InstanceOf.html rename : servo/src/components/main/dom/bindings/codegen/test/test_bug773326.html => servo/src/components/script/dom/bindings/codegen/test/test_bug773326.html rename : servo/src/components/main/dom/bindings/codegen/test/test_bug775543.html => servo/src/components/script/dom/bindings/codegen/test/test_bug775543.html rename : servo/src/components/main/dom/bindings/codegen/test/test_bug788369.html => servo/src/components/script/dom/bindings/codegen/test/test_bug788369.html rename : servo/src/components/main/dom/bindings/codegen/test/test_enums.html => servo/src/components/script/dom/bindings/codegen/test/test_enums.html rename : servo/src/components/main/dom/bindings/codegen/test/test_forOf.html => servo/src/components/script/dom/bindings/codegen/test/test_forOf.html rename : servo/src/components/main/dom/bindings/codegen/test/test_integers.html => servo/src/components/script/dom/bindings/codegen/test/test_integers.html rename : servo/src/components/main/dom/bindings/codegen/test/test_interfaceToString.html => servo/src/components/script/dom/bindings/codegen/test/test_interfaceToString.html rename : servo/src/components/main/dom/bindings/codegen/test/test_lookupGetter.html => servo/src/components/script/dom/bindings/codegen/test/test_lookupGetter.html rename : servo/src/components/main/dom/bindings/codegen/test/test_sequence_wrapping.html => servo/src/components/script/dom/bindings/codegen/test/test_sequence_wrapping.html rename : servo/src/components/main/dom/bindings/codegen/test/test_traceProtos.html => servo/src/components/script/dom/bindings/codegen/test/test_traceProtos.html rename : servo/src/components/main/dom/bindings/conversions.rs => servo/src/components/script/dom/bindings/conversions.rs rename : servo/src/components/main/dom/bindings/document.rs => servo/src/components/script/dom/bindings/document.rs rename : servo/src/components/main/dom/bindings/domparser.rs => servo/src/components/script/dom/bindings/domparser.rs rename : servo/src/components/main/dom/bindings/element.rs => servo/src/components/script/dom/bindings/element.rs rename : servo/src/components/main/dom/bindings/event.rs => servo/src/components/script/dom/bindings/event.rs rename : servo/src/components/main/dom/bindings/eventtarget.rs => servo/src/components/script/dom/bindings/eventtarget.rs rename : servo/src/components/main/dom/bindings/htmlcollection.rs => servo/src/components/script/dom/bindings/htmlcollection.rs rename : servo/src/components/main/dom/bindings/node.rs => servo/src/components/script/dom/bindings/node.rs rename : servo/src/components/main/dom/bindings/proxyhandler.rs => servo/src/components/script/dom/bindings/proxyhandler.rs rename : servo/src/components/main/dom/bindings/text.rs => servo/src/components/script/dom/bindings/text.rs rename : servo/src/components/main/dom/bindings/utils.rs => servo/src/components/script/dom/bindings/utils.rs rename : servo/src/components/main/dom/bindings/window.rs => servo/src/components/script/dom/bindings/window.rs rename : servo/src/components/main/dom/characterdata.rs => servo/src/components/script/dom/characterdata.rs rename : servo/src/components/main/dom/clientrect.rs => servo/src/components/script/dom/clientrect.rs rename : servo/src/components/main/dom/clientrectlist.rs => servo/src/components/script/dom/clientrectlist.rs rename : servo/src/components/main/dom/document.rs => servo/src/components/script/dom/document.rs rename : servo/src/components/main/dom/domparser.rs => servo/src/components/script/dom/domparser.rs rename : servo/src/components/main/dom/element.rs => servo/src/components/script/dom/element.rs rename : servo/src/components/main/dom/event.rs => servo/src/components/script/dom/event.rs rename : servo/src/components/main/dom/eventtarget.rs => servo/src/components/script/dom/eventtarget.rs rename : servo/src/components/main/dom/htmlcollection.rs => servo/src/components/script/dom/htmlcollection.rs rename : servo/src/components/main/dom/node.rs => servo/src/components/script/dom/node.rs rename : servo/src/components/main/dom/window.rs => servo/src/components/script/dom/window.rs rename : servo/src/components/main/html/cssparse.rs => servo/src/components/script/html/cssparse.rs rename : servo/src/components/main/html/hubbub_html_parser.rs => servo/src/components/script/html/hubbub_html_parser.rs rename : servo/src/components/main/scripting/script_task.rs => servo/src/components/script/script_task.rs --- servo/Makefile.in | 30 ++-- servo/configure | 1 + servo/mk/clean.mk | 5 +- servo/src/components/main/compositing/mod.rs | 2 +- .../main/compositing/resize_rate_limiter.rs | 5 +- servo/src/components/main/css/matching.rs | 4 +- servo/src/components/main/css/node_style.rs | 2 +- servo/src/components/main/css/node_util.rs | 2 +- .../src/components/main/css/node_void_ptr.rs | 28 --- .../src/components/main/css/select_handler.rs | 5 +- servo/src/components/main/engine.rs | 18 +- servo/src/components/main/layout/aux.rs | 2 +- servo/src/components/main/layout/box.rs | 12 +- .../src/components/main/layout/box_builder.rs | 7 +- servo/src/components/main/layout/debug.rs | 21 --- servo/src/components/main/layout/flow.rs | 12 +- servo/src/components/main/layout/inline.rs | 7 +- .../src/components/main/layout/layout_task.rs | 167 +++++++----------- servo/src/components/main/servo.rc | 51 +----- .../dom/bindings/clientrect.rs | 3 +- .../dom/bindings/clientrectlist.rs | 3 +- .../dom/bindings/codegen/BindingGen.py | 0 .../dom/bindings/codegen/BindingUtils.cpp | 0 .../dom/bindings/codegen/BindingUtils.h | 0 .../dom/bindings/codegen/Bindings.conf | 0 .../dom/bindings/codegen/ClientRect.webidl | 0 .../bindings/codegen/ClientRectList.webidl | 0 .../dom/bindings/codegen/Codegen.py | 0 .../dom/bindings/codegen/CodegenRust.py | 2 +- .../dom/bindings/codegen/Configuration.py | 0 .../dom/bindings/codegen/DOMJSClass.h | 0 .../bindings/codegen/DOMJSProxyHandler.cpp | 0 .../dom/bindings/codegen/DOMJSProxyHandler.h | 0 .../dom/bindings/codegen/DOMParser.webidl | 0 .../dom/bindings/codegen/ErrorResult.h | 0 .../dom/bindings/codegen/Errors.msg | 0 .../dom/bindings/codegen/Event.webidl | 0 .../dom/bindings/codegen/EventTarget.webidl | 0 .../codegen/GenerateCSS2PropertiesWebIDL.py | 0 .../dom/bindings/codegen/GlobalGen.py | 0 .../bindings/codegen/HTMLCollection.webidl | 0 .../dom/bindings/codegen/Makefile.in | 0 .../dom/bindings/codegen/Nullable.h | 0 .../bindings/codegen/PrimitiveConversions.h | 0 .../dom/bindings/codegen/RegisterBindings.cpp | 0 .../dom/bindings/codegen/RegisterBindings.h | 0 .../dom/bindings/codegen/TypedArray.h | 0 .../bindings/codegen/crashtests/769464.html | 0 .../codegen/crashtests/crashtests.list | 0 .../dom/bindings/codegen/parser/README | 0 .../dom/bindings/codegen/parser/UPSTREAM | 0 .../dom/bindings/codegen/parser/WebIDL.py | 0 .../dom/bindings/codegen/parser/runtests.py | 0 .../codegen/parser/tests/test_any_null.py | 0 .../test_argument_identifier_conflicts.py | 0 .../parser/tests/test_argument_novoid.py | 0 .../parser/tests/test_array_of_interface.py | 0 .../codegen/parser/tests/test_arraybuffer.py | 0 .../codegen/parser/tests/test_attr.py | 0 .../parser/tests/test_attr_sequence_type.py | 0 .../parser/tests/test_builtin_filename.py | 0 .../codegen/parser/tests/test_builtins.py | 0 .../codegen/parser/tests/test_callback.py | 0 .../parser/tests/test_callback_interface.py | 0 .../codegen/parser/tests/test_const.py | 0 .../codegen/parser/tests/test_constructor.py | 0 .../test_constructor_no_interface_object.py | 0 .../codegen/parser/tests/test_deduplicate.py | 0 .../codegen/parser/tests/test_dictionary.py | 0 .../parser/tests/test_distinguishability.py | 0 .../codegen/parser/tests/test_double_null.py | 0 .../parser/tests/test_duplicate_qualifiers.py | 0 .../codegen/parser/tests/test_empty_enum.py | 0 .../codegen/parser/tests/test_enum.py | 0 .../tests/test_enum_duplicate_values.py | 0 .../codegen/parser/tests/test_error_colno.py | 0 .../codegen/parser/tests/test_error_lineno.py | 0 .../parser/tests/test_extended_attributes.py | 0 .../codegen/parser/tests/test_forward_decl.py | 0 .../codegen/parser/tests/test_implements.py | 0 .../parser/tests/test_incomplete_parent.py | 0 .../parser/tests/test_incomplete_types.py | 0 .../codegen/parser/tests/test_interface.py | 0 ...st_interface_const_identifier_conflicts.py | 0 ...ace_identifier_conflicts_across_members.py | 0 .../codegen/parser/tests/test_method.py | 0 .../parser/tests/test_nullable_equivalency.py | 0 .../parser/tests/test_nullable_void.py | 0 .../parser/tests/test_optional_constraints.py | 0 .../codegen/parser/tests/test_overload.py | 0 .../codegen/parser/tests/test_sanity.py | 0 .../test_special_method_signature_mismatch.py | 0 .../parser/tests/test_special_methods.py | 0 .../tests/test_special_methods_uniqueness.py | 0 .../tests/test_treatNonCallableAsNull.py | 0 .../codegen/parser/tests/test_typedef.py | 0 .../codegen/parser/tests/test_union.py | 0 .../codegen/parser/tests/test_union_any.py | 0 .../parser/tests/test_union_nullable.py | 0 .../parser/tests/test_variadic_callback.py | 0 .../parser/tests/test_variadic_constraints.py | 0 .../dom/bindings/codegen/ply/COPYING | 0 .../dom/bindings/codegen/ply/README | 0 .../dom/bindings/codegen/ply/ply/__init__.py | 0 .../dom/bindings/codegen/ply/ply/lex.py | 0 .../dom/bindings/codegen/ply/ply/yacc.py | 0 .../dom/bindings/codegen/pythonpath.py | 0 .../codegen/stubgenerator/Skeleton.cpp | 0 .../bindings/codegen/stubgenerator/Skeleton.h | 0 .../codegen/stubgenerator/generate.sh | 0 .../dom/bindings/codegen/test/Makefile.in | 0 .../bindings/codegen/test/TestBindingHeader.h | 0 .../bindings/codegen/test/TestCodeGen.webidl | 0 .../codegen/test/TestDictionary.webidl | 0 .../bindings/codegen/test/TestTypedef.webidl | 0 .../bindings/codegen/test/file_bug775543.html | 0 .../bindings/codegen/test/forOf_iframe.html | 0 .../codegen/test/test_InstanceOf.html | 0 .../bindings/codegen/test/test_bug773326.html | 0 .../bindings/codegen/test/test_bug775543.html | 0 .../bindings/codegen/test/test_bug788369.html | 0 .../dom/bindings/codegen/test/test_enums.html | 0 .../dom/bindings/codegen/test/test_forOf.html | 0 .../bindings/codegen/test/test_integers.html | 0 .../codegen/test/test_interfaceToString.html | 0 .../codegen/test/test_lookupGetter.html | 0 .../codegen/test/test_sequence_wrapping.html | 0 .../codegen/test/test_traceProtos.html | 0 .../dom/bindings/conversions.rs | 0 .../{main => script}/dom/bindings/document.rs | 2 +- .../dom/bindings/domparser.rs | 0 .../{main => script}/dom/bindings/element.rs | 8 +- .../{main => script}/dom/bindings/event.rs | 3 +- .../dom/bindings/eventtarget.rs | 2 +- .../dom/bindings/htmlcollection.rs | 3 +- .../{main => script}/dom/bindings/node.rs | 0 .../dom/bindings/proxyhandler.rs | 0 .../{main => script}/dom/bindings/text.rs | 0 .../{main => script}/dom/bindings/utils.rs | 10 +- .../{main => script}/dom/bindings/window.rs | 0 .../{main => script}/dom/characterdata.rs | 0 .../{main => script}/dom/clientrect.rs | 0 .../{main => script}/dom/clientrectlist.rs | 0 .../{main => script}/dom/document.rs | 2 +- .../{main => script}/dom/domparser.rs | 2 +- .../{main => script}/dom/element.rs | 22 ++- .../components/{main => script}/dom/event.rs | 0 .../{main => script}/dom/eventtarget.rs | 0 .../{main => script}/dom/htmlcollection.rs | 0 .../components/{main => script}/dom/node.rs | 35 +++- .../components/{main => script}/dom/window.rs | 11 +- .../{main => script}/html/cssparse.rs | 0 .../html/hubbub_html_parser.rs | 37 ++-- .../src/components/script/layout_interface.rs | 103 +++++++++++ servo/src/components/script/script.rc | 69 ++++++++ .../{main/scripting => script}/script_task.rs | 19 +- servo/src/etc/tidy.py | 1 + 157 files changed, 391 insertions(+), 327 deletions(-) delete mode 100644 servo/src/components/main/css/node_void_ptr.rs delete mode 100644 servo/src/components/main/layout/debug.rs rename servo/src/components/{main => script}/dom/bindings/clientrect.rs (96%) rename servo/src/components/{main => script}/dom/bindings/clientrectlist.rs (95%) rename servo/src/components/{main => script}/dom/bindings/codegen/BindingGen.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/BindingUtils.cpp (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/BindingUtils.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/Bindings.conf (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ClientRect.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ClientRectList.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/Codegen.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/CodegenRust.py (99%) rename servo/src/components/{main => script}/dom/bindings/codegen/Configuration.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/DOMJSClass.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/DOMJSProxyHandler.cpp (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/DOMJSProxyHandler.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/DOMParser.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ErrorResult.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/Errors.msg (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/Event.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/EventTarget.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/GlobalGen.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/HTMLCollection.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/Makefile.in (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/Nullable.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/PrimitiveConversions.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/RegisterBindings.cpp (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/RegisterBindings.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/TypedArray.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/crashtests/769464.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/crashtests/crashtests.list (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/README (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/UPSTREAM (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/WebIDL.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/runtests.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_any_null.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_argument_novoid.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_array_of_interface.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_arraybuffer.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_attr.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_builtin_filename.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_builtins.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_callback.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_callback_interface.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_const.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_constructor.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_deduplicate.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_dictionary.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_distinguishability.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_double_null.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_empty_enum.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_enum.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_error_colno.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_error_lineno.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_extended_attributes.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_forward_decl.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_implements.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_incomplete_parent.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_incomplete_types.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_interface.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_method.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_nullable_void.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_optional_constraints.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_overload.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_sanity.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_special_methods.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_typedef.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_union.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_union_any.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_union_nullable.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_variadic_callback.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/parser/tests/test_variadic_constraints.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ply/COPYING (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ply/README (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ply/ply/__init__.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ply/ply/lex.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/ply/ply/yacc.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/pythonpath.py (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/stubgenerator/Skeleton.cpp (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/stubgenerator/Skeleton.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/stubgenerator/generate.sh (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/Makefile.in (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/TestBindingHeader.h (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/TestCodeGen.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/TestDictionary.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/TestTypedef.webidl (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/file_bug775543.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/forOf_iframe.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_InstanceOf.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_bug773326.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_bug775543.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_bug788369.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_enums.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_forOf.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_integers.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_interfaceToString.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_lookupGetter.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_sequence_wrapping.html (100%) rename servo/src/components/{main => script}/dom/bindings/codegen/test/test_traceProtos.html (100%) rename servo/src/components/{main => script}/dom/bindings/conversions.rs (100%) rename servo/src/components/{main => script}/dom/bindings/document.rs (99%) rename servo/src/components/{main => script}/dom/bindings/domparser.rs (100%) rename servo/src/components/{main => script}/dom/bindings/element.rs (97%) rename servo/src/components/{main => script}/dom/bindings/event.rs (96%) rename servo/src/components/{main => script}/dom/bindings/eventtarget.rs (96%) rename servo/src/components/{main => script}/dom/bindings/htmlcollection.rs (95%) rename servo/src/components/{main => script}/dom/bindings/node.rs (100%) rename servo/src/components/{main => script}/dom/bindings/proxyhandler.rs (100%) rename servo/src/components/{main => script}/dom/bindings/text.rs (100%) rename servo/src/components/{main => script}/dom/bindings/utils.rs (99%) rename servo/src/components/{main => script}/dom/bindings/window.rs (100%) rename servo/src/components/{main => script}/dom/characterdata.rs (100%) rename servo/src/components/{main => script}/dom/clientrect.rs (100%) rename servo/src/components/{main => script}/dom/clientrectlist.rs (100%) rename servo/src/components/{main => script}/dom/document.rs (97%) rename servo/src/components/{main => script}/dom/domparser.rs (96%) rename servo/src/components/{main => script}/dom/element.rs (94%) rename servo/src/components/{main => script}/dom/event.rs (100%) rename servo/src/components/{main => script}/dom/eventtarget.rs (100%) rename servo/src/components/{main => script}/dom/htmlcollection.rs (100%) rename servo/src/components/{main => script}/dom/node.rs (94%) rename servo/src/components/{main => script}/dom/window.rs (92%) rename servo/src/components/{main => script}/html/cssparse.rs (100%) rename servo/src/components/{main => script}/html/hubbub_html_parser.rs (95%) create mode 100644 servo/src/components/script/layout_interface.rs create mode 100644 servo/src/components/script/script.rc rename servo/src/components/{main/scripting => script}/script_task.rs (96%) diff --git a/servo/Makefile.in b/servo/Makefile.in index a025ec1ce30d..0f0f875ae3ec 100644 --- a/servo/Makefile.in +++ b/servo/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/servo/configure b/servo/configure index 90ed808c4129..e6dddb7ea3aa 100755 --- a/servo/configure +++ b/servo/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/servo/mk/clean.mk b/servo/mk/clean.mk index ca7ec8a0a9c4..273d8090f292 100644 --- a/servo/mk/clean.mk +++ b/servo/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/servo/src/components/main/compositing/mod.rs b/servo/src/components/main/compositing/mod.rs index 14cf0052a5a3..1469acbb57c5 100644 --- a/servo/src/components/main/compositing/mod.rs +++ b/servo/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/servo/src/components/main/compositing/resize_rate_limiter.rs b/servo/src/components/main/compositing/resize_rate_limiter.rs index efbf4e0ff53d..2e358423a63c 100644 --- a/servo/src/components/main/compositing/resize_rate_limiter.rs +++ b/servo/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/servo/src/components/main/css/matching.rs b/servo/src/components/main/css/matching.rs index c792188e4861..50de881b0b6a 100644 --- a/servo/src/components/main/css/matching.rs +++ b/servo/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/servo/src/components/main/css/node_style.rs b/servo/src/components/main/css/node_style.rs index 0f02f52d1865..689b62f93e0b 100644 --- a/servo/src/components/main/css/node_style.rs +++ b/servo/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/servo/src/components/main/css/node_util.rs b/servo/src/components/main/css/node_util.rs index d31f1b0cf830..ff9295d12a8e 100644 --- a/servo/src/components/main/css/node_util.rs +++ b/servo/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/servo/src/components/main/css/node_void_ptr.rs b/servo/src/components/main/css/node_void_ptr.rs deleted file mode 100644 index 733ba563da30..000000000000 --- a/servo/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/servo/src/components/main/css/select_handler.rs b/servo/src/components/main/css/select_handler.rs index 8ce4e58ef323..fb232460b906 100644 --- a/servo/src/components/main/css/select_handler.rs +++ b/servo/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/servo/src/components/main/engine.rs b/servo/src/components/main/engine.rs index 575fbc57bbfc..1d396c1a70fe 100644 --- a/servo/src/components/main/engine.rs +++ b/servo/src/components/main/engine.rs @@ -3,10 +3,7 @@ * 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; @@ -14,11 +11,14 @@ 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; @@ -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(), @@ -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(); diff --git a/servo/src/components/main/layout/aux.rs b/servo/src/components/main/layout/aux.rs index 1cee194b1288..59682ef20b79 100644 --- a/servo/src/components/main/layout/aux.rs +++ b/servo/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/servo/src/components/main/layout/box.rs b/servo/src/components/main/layout/box.rs index 49444f03dc84..a2112882b066 100644 --- a/servo/src/components/main/layout/box.rs +++ b/servo/src/components/main/layout/box.rs @@ -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; @@ -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::*; @@ -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 += ~" "; @@ -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", diff --git a/servo/src/components/main/layout/box_builder.rs b/servo/src/components/main/layout/box_builder.rs index 5e7a067815dd..6a0404d2c3d5 100644 --- a/servo/src/components/main/layout/box_builder.rs +++ b/servo/src/components/main/layout/box_builder.rs @@ -4,16 +4,12 @@ //! 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}; @@ -21,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/servo/src/components/main/layout/debug.rs b/servo/src/components/main/layout/debug.rs deleted file mode 100644 index cbee6b8cf260..000000000000 --- a/servo/src/components/main/layout/debug.rs +++ /dev/null @@ -1,21 +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/. */ - -pub trait BoxedMutDebugMethods { - fn dump(@mut self); - fn dump_indent(@mut self, ident: uint); - fn debug_str(@mut self) -> ~str; -} - -pub trait BoxedDebugMethods { - fn dump(@self); - fn dump_indent(@self, ident: uint); - fn debug_str(@self) -> ~str; -} - -pub trait DebugMethods { - fn dump(&self); - fn dump_indent(&self, ident: uint); - fn debug_str(&self) -> ~str; -} diff --git a/servo/src/components/main/layout/flow.rs b/servo/src/components/main/layout/flow.rs index 5add5fb1cf9b..c840a204d7fb 100644 --- a/servo/src/components/main/layout/flow.rs +++ b/servo/src/components/main/layout/flow.rs @@ -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}; @@ -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 @@ -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 += ~"---- "; @@ -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| { diff --git a/servo/src/components/main/layout/inline.rs b/servo/src/components/main/layout/inline.rs index afa1543ce4f5..3db7e23e34ee 100644 --- a/servo/src/components/main/layout/inline.rs +++ b/servo/src/components/main/layout/inline.rs @@ -4,11 +4,9 @@ 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; -use layout::debug::{BoxedDebugMethods, BoxedMutDebugMethods, DebugMethods}; use layout::display_list_builder::DisplayListBuilder; use layout::flow::{FlowContext, FlowData, InlineFlow}; use layout::text::{UnscannedMethods, adapt_textbox_with_range}; @@ -20,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/servo/src/components/main/layout/layout_task.rs b/servo/src/components/main/layout/layout_task.rs index 5da211854bfb..fc5d2bacc25c 100644 --- a/servo/src/components/main/layout/layout_task.rs +++ b/servo/src/components/main/layout/layout_task.rs @@ -2,20 +2,16 @@ * 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 layout task. Performs layout on the DOM, builds display lists and sends them to be +//! The layout task. Performs layout on the DOM, builds display lists and sends them to be /// rendered. use css::matching::MatchMethods; use css::select::new_css_select_ctx; -use dom::event::ReflowEvent; -use dom::node::{AbstractNode, LayoutView, ScriptView}; use layout::aux::{LayoutData, LayoutAuxMethods}; use layout::box_builder::LayoutTreeBuilder; use layout::context::LayoutContext; -use layout::debug::{BoxedMutDebugMethods, DebugMethods}; use layout::display_list_builder::{DisplayListBuilder, FlowDisplayListBuilderMethods}; use layout::flow::FlowContext; -use scripting::script_task::{ScriptMsg, SendEventMsg}; use util::task::spawn_listener; use servo_util::time; use servo_util::time::time; @@ -37,72 +33,34 @@ 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; -use std::net::url::Url; -pub type LayoutTask = SharedChan; - -pub enum LayoutQuery { - ContentBox(AbstractNode), - ContentBoxes(AbstractNode), -} - -pub type LayoutQueryResponse = Result; - -pub enum LayoutQueryResponse_ { - ContentRect(Rect), - ContentRects(~[Rect]) -} - -pub enum Msg { - AddStylesheet(Stylesheet), - BuildMsg(~BuildData), - QueryMsg(LayoutQuery, Chan), - ExitMsg -} - -// Dirty bits for layout. -pub enum Damage { - NoDamage, // Document is clean; do nothing. - ReflowDamage, // Reflow; don't perform CSS selector matching. - MatchSelectorsDamage, // Perform CSS selector matching and reflow. -} - -impl Damage { - fn add(&mut self, new_damage: Damage) { - match (*self, new_damage) { - (NoDamage, _) => *self = new_damage, - (ReflowDamage, NoDamage) => *self = ReflowDamage, - (ReflowDamage, new_damage) => *self = new_damage, - (MatchSelectorsDamage, _) => *self = MatchSelectorsDamage - } - } -} - -pub struct BuildData { - node: AbstractNode, - url: Url, - script_chan: SharedChan, - window_size: Size2D, - script_join_chan: Chan<()>, - damage: Damage, -} - -pub fn LayoutTask(render_task: RenderTask, - img_cache_task: ImageCacheTask, - opts: Opts, - prof_chan: ProfilerChan) - -> LayoutTask { - SharedChan::new(do spawn_listener:: |from_script| { - let mut layout = Layout(render_task.clone(), - img_cache_task.clone(), - from_script, - &opts, - prof_chan.clone()); +pub fn create_layout_task(render_task: RenderTask, + img_cache_task: ImageCacheTask, + opts: Opts, + profiler_chan: ProfilerChan) + -> LayoutTask { + let chan = do spawn_listener:: |from_script| { + let mut layout = Layout::new(render_task.clone(), + img_cache_task.clone(), + from_script, + &opts, + profiler_chan.clone()); layout.start(); - }) + }; + + LayoutTask { + chan: SharedChan::new(chan), + } } struct Layout { @@ -111,57 +69,54 @@ struct Layout { local_image_cache: @mut LocalImageCache, from_script: Port, font_ctx: @mut FontContext, - // This is used to root reader data + + /// This is used to root reader data. layout_refs: ~[@mut LayoutData], + css_select_ctx: @mut SelectCtx, - prof_chan: ProfilerChan, -} - -fn Layout(render_task: RenderTask, - image_cache_task: ImageCacheTask, - from_script: Port, - opts: &Opts, - prof_chan: ProfilerChan) - -> Layout { - let fctx = @mut FontContext::new(opts.render_backend, true, prof_chan.clone()); - - Layout { - render_task: render_task, - image_cache_task: image_cache_task.clone(), - local_image_cache: @mut LocalImageCache(image_cache_task), - from_script: from_script, - font_ctx: fctx, - layout_refs: ~[], - css_select_ctx: @mut new_css_select_ctx(), - prof_chan: prof_chan.clone() - } + profiler_chan: ProfilerChan, } impl Layout { + fn new(render_task: RenderTask, + image_cache_task: ImageCacheTask, + from_script: Port, + opts: &Opts, + profiler_chan: ProfilerChan) + -> Layout { + let fctx = @mut FontContext::new(opts.render_backend, true, profiler_chan.clone()); + + Layout { + render_task: render_task, + image_cache_task: image_cache_task.clone(), + local_image_cache: @mut LocalImageCache(image_cache_task), + from_script: from_script, + font_ctx: fctx, + layout_refs: ~[], + css_select_ctx: @mut new_css_select_ctx(), + profiler_chan: profiler_chan, + } + } fn start(&mut self) { while self.handle_request() { - // loop indefinitely + // Loop indefinitely. } } fn handle_request(&mut self) -> bool { - match self.from_script.recv() { - AddStylesheet(sheet) => { - self.handle_add_stylesheet(sheet); - } + AddStylesheetMsg(sheet) => self.handle_add_stylesheet(sheet), BuildMsg(data) => { let data = Cell(data); - do profile(time::LayoutPerformCategory, self.prof_chan.clone()) { + do profile(time::LayoutPerformCategory, self.profiler_chan.clone()) { self.handle_build(data.take()); } - } QueryMsg(query, chan) => { let chan = Cell(chan); - do profile(time::LayoutQueryCategory, self.prof_chan.clone()) { + do profile(time::LayoutQueryCategory, self.profiler_chan.clone()) { self.handle_query(query, chan.take()) } } @@ -212,7 +167,7 @@ impl Layout { // Initialize layout data for each node. // // FIXME: This is inefficient. We don't need an entire traversal to do this! - do profile(time::LayoutAuxInitCategory, self.prof_chan.clone()) { + do profile(time::LayoutAuxInitCategory, self.profiler_chan.clone()) { node.initialize_style_for_subtree(&mut self.layout_refs); } @@ -220,7 +175,7 @@ impl Layout { match data.damage { NoDamage | ReflowDamage => {} MatchSelectorsDamage => { - do profile(time::LayoutSelectorMatchCategory, self.prof_chan.clone()) { + do profile(time::LayoutSelectorMatchCategory, self.profiler_chan.clone()) { node.restyle_subtree(self.css_select_ctx); } } @@ -228,7 +183,7 @@ impl Layout { // Construct the flow tree. let layout_root: FlowContext = do profile(time::LayoutTreeBuilderCategory, - self.prof_chan.clone()) { + self.profiler_chan.clone()) { let mut builder = LayoutTreeBuilder::new(); let layout_root: FlowContext = match builder.construct_trees(&layout_ctx, *node) { Ok(root) => root, @@ -243,7 +198,7 @@ impl Layout { // Perform the primary layout passes over the flow tree to compute the locations of all // the boxes. - do profile(time::LayoutMainCategory, self.prof_chan.clone()) { + do profile(time::LayoutMainCategory, self.profiler_chan.clone()) { for layout_root.traverse_postorder |flow| { flow.bubble_widths(&mut layout_ctx); }; @@ -256,7 +211,7 @@ impl Layout { } // Build the display list, and send it to the renderer. - do profile(time::LayoutDispListBuildCategory, self.prof_chan.clone()) { + do profile(time::LayoutDispListBuildCategory, self.profiler_chan.clone()) { let builder = DisplayListBuilder { ctx: &layout_ctx, }; @@ -281,9 +236,9 @@ impl Layout { /// Handles a query from the script task. This is the main routine that DOM functions like /// `getClientRects()` or `getBoundingClientRect()` ultimately invoke. - fn handle_query(&self, query: LayoutQuery, reply_chan: Chan) { + fn handle_query(&self, query: LayoutQuery, reply_chan: Chan>) { match query { - ContentBox(node) => { + ContentBoxQuery(node) => { // FIXME: Isolate this transmutation into a single "bridge" module. let node: AbstractNode = unsafe { transmute(node) @@ -308,14 +263,14 @@ impl Layout { error!("no boxes for node"); Err(()) } - Some(rect) => Ok(ContentRect(rect)) + Some(rect) => Ok(ContentBoxResponse(rect)) } } }; reply_chan.send(response) } - ContentBoxes(node) => { + ContentBoxesQuery(node) => { // FIXME: Isolate this transmutation into a single "bridge" module. let node: AbstractNode = unsafe { transmute(node) @@ -329,7 +284,7 @@ impl Layout { boxes.push(box.content_box()); } - Ok(ContentRects(boxes)) + Ok(ContentBoxesResponse(boxes)) } }; diff --git a/servo/src/components/main/servo.rc b/servo/src/components/main/servo.rc index e4526bacf237..d2c29354bdda 100755 --- a/servo/src/components/main/servo.rc +++ b/servo/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 { @@ -107,7 +64,6 @@ pub mod layout { pub mod box; pub mod box_builder; pub mod context; - pub mod debug; pub mod display_list_builder; pub mod flow; pub mod layout_task; @@ -116,11 +72,6 @@ pub mod layout { mod aux; } -pub mod html { - pub mod cssparse; - pub mod hubbub_html_parser; -} - pub mod windowing; #[path="platform/mod.rs"] diff --git a/servo/src/components/main/dom/bindings/clientrect.rs b/servo/src/components/script/dom/bindings/clientrect.rs similarity index 96% rename from servo/src/components/main/dom/bindings/clientrect.rs rename to servo/src/components/script/dom/bindings/clientrect.rs index ca7317de083f..a21b12cc049d 100644 --- a/servo/src/components/main/dom/bindings/clientrect.rs +++ b/servo/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/servo/src/components/main/dom/bindings/clientrectlist.rs b/servo/src/components/script/dom/bindings/clientrectlist.rs similarity index 95% rename from servo/src/components/main/dom/bindings/clientrectlist.rs rename to servo/src/components/script/dom/bindings/clientrectlist.rs index 783dc78267d9..aca6d85d1f49 100644 --- a/servo/src/components/main/dom/bindings/clientrectlist.rs +++ b/servo/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/servo/src/components/main/dom/bindings/codegen/BindingGen.py b/servo/src/components/script/dom/bindings/codegen/BindingGen.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/BindingGen.py rename to servo/src/components/script/dom/bindings/codegen/BindingGen.py diff --git a/servo/src/components/main/dom/bindings/codegen/BindingUtils.cpp b/servo/src/components/script/dom/bindings/codegen/BindingUtils.cpp similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/BindingUtils.cpp rename to servo/src/components/script/dom/bindings/codegen/BindingUtils.cpp diff --git a/servo/src/components/main/dom/bindings/codegen/BindingUtils.h b/servo/src/components/script/dom/bindings/codegen/BindingUtils.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/BindingUtils.h rename to servo/src/components/script/dom/bindings/codegen/BindingUtils.h diff --git a/servo/src/components/main/dom/bindings/codegen/Bindings.conf b/servo/src/components/script/dom/bindings/codegen/Bindings.conf similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/Bindings.conf rename to servo/src/components/script/dom/bindings/codegen/Bindings.conf diff --git a/servo/src/components/main/dom/bindings/codegen/ClientRect.webidl b/servo/src/components/script/dom/bindings/codegen/ClientRect.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ClientRect.webidl rename to servo/src/components/script/dom/bindings/codegen/ClientRect.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/ClientRectList.webidl b/servo/src/components/script/dom/bindings/codegen/ClientRectList.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ClientRectList.webidl rename to servo/src/components/script/dom/bindings/codegen/ClientRectList.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/Codegen.py b/servo/src/components/script/dom/bindings/codegen/Codegen.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/Codegen.py rename to servo/src/components/script/dom/bindings/codegen/Codegen.py diff --git a/servo/src/components/main/dom/bindings/codegen/CodegenRust.py b/servo/src/components/script/dom/bindings/codegen/CodegenRust.py similarity index 99% rename from servo/src/components/main/dom/bindings/codegen/CodegenRust.py rename to servo/src/components/script/dom/bindings/codegen/CodegenRust.py index 6f2715839cda..3c0c07d5ab53 100644 --- a/servo/src/components/main/dom/bindings/codegen/CodegenRust.py +++ b/servo/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/servo/src/components/main/dom/bindings/codegen/Configuration.py b/servo/src/components/script/dom/bindings/codegen/Configuration.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/Configuration.py rename to servo/src/components/script/dom/bindings/codegen/Configuration.py diff --git a/servo/src/components/main/dom/bindings/codegen/DOMJSClass.h b/servo/src/components/script/dom/bindings/codegen/DOMJSClass.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/DOMJSClass.h rename to servo/src/components/script/dom/bindings/codegen/DOMJSClass.h diff --git a/servo/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.cpp b/servo/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.cpp similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.cpp rename to servo/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.cpp diff --git a/servo/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.h b/servo/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/DOMJSProxyHandler.h rename to servo/src/components/script/dom/bindings/codegen/DOMJSProxyHandler.h diff --git a/servo/src/components/main/dom/bindings/codegen/DOMParser.webidl b/servo/src/components/script/dom/bindings/codegen/DOMParser.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/DOMParser.webidl rename to servo/src/components/script/dom/bindings/codegen/DOMParser.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/ErrorResult.h b/servo/src/components/script/dom/bindings/codegen/ErrorResult.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ErrorResult.h rename to servo/src/components/script/dom/bindings/codegen/ErrorResult.h diff --git a/servo/src/components/main/dom/bindings/codegen/Errors.msg b/servo/src/components/script/dom/bindings/codegen/Errors.msg similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/Errors.msg rename to servo/src/components/script/dom/bindings/codegen/Errors.msg diff --git a/servo/src/components/main/dom/bindings/codegen/Event.webidl b/servo/src/components/script/dom/bindings/codegen/Event.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/Event.webidl rename to servo/src/components/script/dom/bindings/codegen/Event.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/EventTarget.webidl b/servo/src/components/script/dom/bindings/codegen/EventTarget.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/EventTarget.webidl rename to servo/src/components/script/dom/bindings/codegen/EventTarget.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py b/servo/src/components/script/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py rename to servo/src/components/script/dom/bindings/codegen/GenerateCSS2PropertiesWebIDL.py diff --git a/servo/src/components/main/dom/bindings/codegen/GlobalGen.py b/servo/src/components/script/dom/bindings/codegen/GlobalGen.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/GlobalGen.py rename to servo/src/components/script/dom/bindings/codegen/GlobalGen.py diff --git a/servo/src/components/main/dom/bindings/codegen/HTMLCollection.webidl b/servo/src/components/script/dom/bindings/codegen/HTMLCollection.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/HTMLCollection.webidl rename to servo/src/components/script/dom/bindings/codegen/HTMLCollection.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/Makefile.in b/servo/src/components/script/dom/bindings/codegen/Makefile.in similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/Makefile.in rename to servo/src/components/script/dom/bindings/codegen/Makefile.in diff --git a/servo/src/components/main/dom/bindings/codegen/Nullable.h b/servo/src/components/script/dom/bindings/codegen/Nullable.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/Nullable.h rename to servo/src/components/script/dom/bindings/codegen/Nullable.h diff --git a/servo/src/components/main/dom/bindings/codegen/PrimitiveConversions.h b/servo/src/components/script/dom/bindings/codegen/PrimitiveConversions.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/PrimitiveConversions.h rename to servo/src/components/script/dom/bindings/codegen/PrimitiveConversions.h diff --git a/servo/src/components/main/dom/bindings/codegen/RegisterBindings.cpp b/servo/src/components/script/dom/bindings/codegen/RegisterBindings.cpp similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/RegisterBindings.cpp rename to servo/src/components/script/dom/bindings/codegen/RegisterBindings.cpp diff --git a/servo/src/components/main/dom/bindings/codegen/RegisterBindings.h b/servo/src/components/script/dom/bindings/codegen/RegisterBindings.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/RegisterBindings.h rename to servo/src/components/script/dom/bindings/codegen/RegisterBindings.h diff --git a/servo/src/components/main/dom/bindings/codegen/TypedArray.h b/servo/src/components/script/dom/bindings/codegen/TypedArray.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/TypedArray.h rename to servo/src/components/script/dom/bindings/codegen/TypedArray.h diff --git a/servo/src/components/main/dom/bindings/codegen/crashtests/769464.html b/servo/src/components/script/dom/bindings/codegen/crashtests/769464.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/crashtests/769464.html rename to servo/src/components/script/dom/bindings/codegen/crashtests/769464.html diff --git a/servo/src/components/main/dom/bindings/codegen/crashtests/crashtests.list b/servo/src/components/script/dom/bindings/codegen/crashtests/crashtests.list similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/crashtests/crashtests.list rename to servo/src/components/script/dom/bindings/codegen/crashtests/crashtests.list diff --git a/servo/src/components/main/dom/bindings/codegen/parser/README b/servo/src/components/script/dom/bindings/codegen/parser/README similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/README rename to servo/src/components/script/dom/bindings/codegen/parser/README diff --git a/servo/src/components/main/dom/bindings/codegen/parser/UPSTREAM b/servo/src/components/script/dom/bindings/codegen/parser/UPSTREAM similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/UPSTREAM rename to servo/src/components/script/dom/bindings/codegen/parser/UPSTREAM diff --git a/servo/src/components/main/dom/bindings/codegen/parser/WebIDL.py b/servo/src/components/script/dom/bindings/codegen/parser/WebIDL.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/WebIDL.py rename to servo/src/components/script/dom/bindings/codegen/parser/WebIDL.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/runtests.py b/servo/src/components/script/dom/bindings/codegen/parser/runtests.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/runtests.py rename to servo/src/components/script/dom/bindings/codegen/parser/runtests.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_any_null.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_any_null.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_any_null.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_any_null.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_argument_identifier_conflicts.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_argument_novoid.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_argument_novoid.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_argument_novoid.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_argument_novoid.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_array_of_interface.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_array_of_interface.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_array_of_interface.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_array_of_interface.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_arraybuffer.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_arraybuffer.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_attr.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_attr.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_attr.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_attr.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_builtin_filename.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_builtin_filename.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_builtin_filename.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_builtin_filename.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_builtins.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_builtins.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_builtins.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_builtins.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_callback.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_callback.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_callback.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_callback.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_callback_interface.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_callback_interface.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_callback_interface.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_callback_interface.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_const.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_const.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_const.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_const.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_constructor.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_constructor.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_constructor.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_constructor.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_deduplicate.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_deduplicate.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_deduplicate.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_deduplicate.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_dictionary.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_dictionary.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_dictionary.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_dictionary.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_distinguishability.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_distinguishability.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_double_null.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_double_null.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_double_null.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_double_null.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_empty_enum.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_empty_enum.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_empty_enum.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_empty_enum.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_enum.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_enum.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_enum.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_enum.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_error_colno.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_error_colno.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_error_colno.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_error_colno.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_error_lineno.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_error_lineno.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_error_lineno.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_error_lineno.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_extended_attributes.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_extended_attributes.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_forward_decl.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_forward_decl.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_forward_decl.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_forward_decl.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_implements.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_implements.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_implements.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_implements.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_parent.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_parent.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_parent.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_parent.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_types.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_types.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_incomplete_types.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_incomplete_types.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface_const_identifier_conflicts.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_method.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_method.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_method.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_method.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_void.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_void.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_nullable_void.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_nullable_void.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_optional_constraints.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_optional_constraints.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_optional_constraints.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_optional_constraints.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_overload.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_overload.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_overload.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_overload.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_sanity.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_sanity.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_sanity.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_sanity.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_typedef.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_typedef.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_typedef.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_typedef.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_union.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_union.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_union.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_union.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_union_any.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_union_any.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_union_any.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_union_any.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_union_nullable.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_union_nullable.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_callback.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_callback.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_callback.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_callback.py diff --git a/servo/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_constraints.py b/servo/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/parser/tests/test_variadic_constraints.py rename to servo/src/components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py diff --git a/servo/src/components/main/dom/bindings/codegen/ply/COPYING b/servo/src/components/script/dom/bindings/codegen/ply/COPYING similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ply/COPYING rename to servo/src/components/script/dom/bindings/codegen/ply/COPYING diff --git a/servo/src/components/main/dom/bindings/codegen/ply/README b/servo/src/components/script/dom/bindings/codegen/ply/README similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ply/README rename to servo/src/components/script/dom/bindings/codegen/ply/README diff --git a/servo/src/components/main/dom/bindings/codegen/ply/ply/__init__.py b/servo/src/components/script/dom/bindings/codegen/ply/ply/__init__.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ply/ply/__init__.py rename to servo/src/components/script/dom/bindings/codegen/ply/ply/__init__.py diff --git a/servo/src/components/main/dom/bindings/codegen/ply/ply/lex.py b/servo/src/components/script/dom/bindings/codegen/ply/ply/lex.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ply/ply/lex.py rename to servo/src/components/script/dom/bindings/codegen/ply/ply/lex.py diff --git a/servo/src/components/main/dom/bindings/codegen/ply/ply/yacc.py b/servo/src/components/script/dom/bindings/codegen/ply/ply/yacc.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/ply/ply/yacc.py rename to servo/src/components/script/dom/bindings/codegen/ply/ply/yacc.py diff --git a/servo/src/components/main/dom/bindings/codegen/pythonpath.py b/servo/src/components/script/dom/bindings/codegen/pythonpath.py similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/pythonpath.py rename to servo/src/components/script/dom/bindings/codegen/pythonpath.py diff --git a/servo/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.cpp b/servo/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.cpp similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.cpp rename to servo/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.cpp diff --git a/servo/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.h b/servo/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/stubgenerator/Skeleton.h rename to servo/src/components/script/dom/bindings/codegen/stubgenerator/Skeleton.h diff --git a/servo/src/components/main/dom/bindings/codegen/stubgenerator/generate.sh b/servo/src/components/script/dom/bindings/codegen/stubgenerator/generate.sh similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/stubgenerator/generate.sh rename to servo/src/components/script/dom/bindings/codegen/stubgenerator/generate.sh diff --git a/servo/src/components/main/dom/bindings/codegen/test/Makefile.in b/servo/src/components/script/dom/bindings/codegen/test/Makefile.in similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/Makefile.in rename to servo/src/components/script/dom/bindings/codegen/test/Makefile.in diff --git a/servo/src/components/main/dom/bindings/codegen/test/TestBindingHeader.h b/servo/src/components/script/dom/bindings/codegen/test/TestBindingHeader.h similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/TestBindingHeader.h rename to servo/src/components/script/dom/bindings/codegen/test/TestBindingHeader.h diff --git a/servo/src/components/main/dom/bindings/codegen/test/TestCodeGen.webidl b/servo/src/components/script/dom/bindings/codegen/test/TestCodeGen.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/TestCodeGen.webidl rename to servo/src/components/script/dom/bindings/codegen/test/TestCodeGen.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/test/TestDictionary.webidl b/servo/src/components/script/dom/bindings/codegen/test/TestDictionary.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/TestDictionary.webidl rename to servo/src/components/script/dom/bindings/codegen/test/TestDictionary.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/test/TestTypedef.webidl b/servo/src/components/script/dom/bindings/codegen/test/TestTypedef.webidl similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/TestTypedef.webidl rename to servo/src/components/script/dom/bindings/codegen/test/TestTypedef.webidl diff --git a/servo/src/components/main/dom/bindings/codegen/test/file_bug775543.html b/servo/src/components/script/dom/bindings/codegen/test/file_bug775543.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/file_bug775543.html rename to servo/src/components/script/dom/bindings/codegen/test/file_bug775543.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/forOf_iframe.html b/servo/src/components/script/dom/bindings/codegen/test/forOf_iframe.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/forOf_iframe.html rename to servo/src/components/script/dom/bindings/codegen/test/forOf_iframe.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_InstanceOf.html b/servo/src/components/script/dom/bindings/codegen/test/test_InstanceOf.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_InstanceOf.html rename to servo/src/components/script/dom/bindings/codegen/test/test_InstanceOf.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_bug773326.html b/servo/src/components/script/dom/bindings/codegen/test/test_bug773326.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_bug773326.html rename to servo/src/components/script/dom/bindings/codegen/test/test_bug773326.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_bug775543.html b/servo/src/components/script/dom/bindings/codegen/test/test_bug775543.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_bug775543.html rename to servo/src/components/script/dom/bindings/codegen/test/test_bug775543.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_bug788369.html b/servo/src/components/script/dom/bindings/codegen/test/test_bug788369.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_bug788369.html rename to servo/src/components/script/dom/bindings/codegen/test/test_bug788369.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_enums.html b/servo/src/components/script/dom/bindings/codegen/test/test_enums.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_enums.html rename to servo/src/components/script/dom/bindings/codegen/test/test_enums.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_forOf.html b/servo/src/components/script/dom/bindings/codegen/test/test_forOf.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_forOf.html rename to servo/src/components/script/dom/bindings/codegen/test/test_forOf.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_integers.html b/servo/src/components/script/dom/bindings/codegen/test/test_integers.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_integers.html rename to servo/src/components/script/dom/bindings/codegen/test/test_integers.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_interfaceToString.html b/servo/src/components/script/dom/bindings/codegen/test/test_interfaceToString.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_interfaceToString.html rename to servo/src/components/script/dom/bindings/codegen/test/test_interfaceToString.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_lookupGetter.html b/servo/src/components/script/dom/bindings/codegen/test/test_lookupGetter.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_lookupGetter.html rename to servo/src/components/script/dom/bindings/codegen/test/test_lookupGetter.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_sequence_wrapping.html b/servo/src/components/script/dom/bindings/codegen/test/test_sequence_wrapping.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_sequence_wrapping.html rename to servo/src/components/script/dom/bindings/codegen/test/test_sequence_wrapping.html diff --git a/servo/src/components/main/dom/bindings/codegen/test/test_traceProtos.html b/servo/src/components/script/dom/bindings/codegen/test/test_traceProtos.html similarity index 100% rename from servo/src/components/main/dom/bindings/codegen/test/test_traceProtos.html rename to servo/src/components/script/dom/bindings/codegen/test/test_traceProtos.html diff --git a/servo/src/components/main/dom/bindings/conversions.rs b/servo/src/components/script/dom/bindings/conversions.rs similarity index 100% rename from servo/src/components/main/dom/bindings/conversions.rs rename to servo/src/components/script/dom/bindings/conversions.rs diff --git a/servo/src/components/main/dom/bindings/document.rs b/servo/src/components/script/dom/bindings/document.rs similarity index 99% rename from servo/src/components/main/dom/bindings/document.rs rename to servo/src/components/script/dom/bindings/document.rs index 36029e8d5b83..87889f52ff99 100644 --- a/servo/src/components/main/dom/bindings/document.rs +++ b/servo/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/servo/src/components/main/dom/bindings/domparser.rs b/servo/src/components/script/dom/bindings/domparser.rs similarity index 100% rename from servo/src/components/main/dom/bindings/domparser.rs rename to servo/src/components/script/dom/bindings/domparser.rs diff --git a/servo/src/components/main/dom/bindings/element.rs b/servo/src/components/script/dom/bindings/element.rs similarity index 97% rename from servo/src/components/main/dom/bindings/element.rs rename to servo/src/components/script/dom/bindings/element.rs index 66d47931f738..4e296e3bb6ff 100644 --- a/servo/src/components/main/dom/bindings/element.rs +++ b/servo/src/components/script/dom/bindings/element.rs @@ -8,8 +8,8 @@ use dom::bindings::utils::{domstring_to_jsval, WrapNewBindingObject}; use dom::bindings::utils::{str, CacheableWrapper, DOM_OBJECT_SLOT, DOMString}; use dom::element::*; use dom::node::{AbstractNode, Element, ElementNodeTypeId, ScriptView}; -use layout::layout_task; -use scripting::script_task::task_from_context; +use layout_interface::{ContentBoxQuery, ContentBoxResponse}; +use script_task::task_from_context; use super::utils; use core::libc::c_uint; @@ -216,10 +216,10 @@ extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa let width = match node.type_id() { ElementNodeTypeId(HTMLImageElementTypeId) => { let script_context = task_from_context(cx); - match (*script_context).query_layout(layout_task::ContentBox(node)) { + match (*script_context).query_layout(ContentBoxQuery(node)) { Ok(rect) => { match rect { - layout_task::ContentRect(rect) => rect.size.width.to_px(), + ContentBoxResponse(rect) => rect.size.width.to_px(), _ => fail!(~"unexpected layout reply") } } diff --git a/servo/src/components/main/dom/bindings/event.rs b/servo/src/components/script/dom/bindings/event.rs similarity index 96% rename from servo/src/components/main/dom/bindings/event.rs rename to servo/src/components/script/dom/bindings/event.rs index 1463ffe7ea4c..432dee40838a 100644 --- a/servo/src/components/main/dom/bindings/event.rs +++ b/servo/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/servo/src/components/main/dom/bindings/eventtarget.rs b/servo/src/components/script/dom/bindings/eventtarget.rs similarity index 96% rename from servo/src/components/main/dom/bindings/eventtarget.rs rename to servo/src/components/script/dom/bindings/eventtarget.rs index 2b721f92d3eb..7b82f915791c 100644 --- a/servo/src/components/main/dom/bindings/eventtarget.rs +++ b/servo/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/servo/src/components/main/dom/bindings/htmlcollection.rs b/servo/src/components/script/dom/bindings/htmlcollection.rs similarity index 95% rename from servo/src/components/main/dom/bindings/htmlcollection.rs rename to servo/src/components/script/dom/bindings/htmlcollection.rs index 11e3f75e0d06..866e7634ada8 100644 --- a/servo/src/components/main/dom/bindings/htmlcollection.rs +++ b/servo/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/servo/src/components/main/dom/bindings/node.rs b/servo/src/components/script/dom/bindings/node.rs similarity index 100% rename from servo/src/components/main/dom/bindings/node.rs rename to servo/src/components/script/dom/bindings/node.rs diff --git a/servo/src/components/main/dom/bindings/proxyhandler.rs b/servo/src/components/script/dom/bindings/proxyhandler.rs similarity index 100% rename from servo/src/components/main/dom/bindings/proxyhandler.rs rename to servo/src/components/script/dom/bindings/proxyhandler.rs diff --git a/servo/src/components/main/dom/bindings/text.rs b/servo/src/components/script/dom/bindings/text.rs similarity index 100% rename from servo/src/components/main/dom/bindings/text.rs rename to servo/src/components/script/dom/bindings/text.rs diff --git a/servo/src/components/main/dom/bindings/utils.rs b/servo/src/components/script/dom/bindings/utils.rs similarity index 99% rename from servo/src/components/main/dom/bindings/utils.rs rename to servo/src/components/script/dom/bindings/utils.rs index b341c6ae2f88..206cc4224ba7 100644 --- a/servo/src/components/main/dom/bindings/utils.rs +++ b/servo/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/servo/src/components/main/dom/bindings/window.rs b/servo/src/components/script/dom/bindings/window.rs similarity index 100% rename from servo/src/components/main/dom/bindings/window.rs rename to servo/src/components/script/dom/bindings/window.rs diff --git a/servo/src/components/main/dom/characterdata.rs b/servo/src/components/script/dom/characterdata.rs similarity index 100% rename from servo/src/components/main/dom/characterdata.rs rename to servo/src/components/script/dom/characterdata.rs diff --git a/servo/src/components/main/dom/clientrect.rs b/servo/src/components/script/dom/clientrect.rs similarity index 100% rename from servo/src/components/main/dom/clientrect.rs rename to servo/src/components/script/dom/clientrect.rs diff --git a/servo/src/components/main/dom/clientrectlist.rs b/servo/src/components/script/dom/clientrectlist.rs similarity index 100% rename from servo/src/components/main/dom/clientrectlist.rs rename to servo/src/components/script/dom/clientrectlist.rs diff --git a/servo/src/components/main/dom/document.rs b/servo/src/components/script/dom/document.rs similarity index 97% rename from servo/src/components/main/dom/document.rs rename to servo/src/components/script/dom/document.rs index e912e593ec0f..ba52025362ff 100644 --- a/servo/src/components/main/dom/document.rs +++ b/servo/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/servo/src/components/main/dom/domparser.rs b/servo/src/components/script/dom/domparser.rs similarity index 96% rename from servo/src/components/main/dom/domparser.rs rename to servo/src/components/script/dom/domparser.rs index 8e8ed345a080..e5609e60f490 100644 --- a/servo/src/components/main/dom/domparser.rs +++ b/servo/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/servo/src/components/main/dom/element.rs b/servo/src/components/script/dom/element.rs similarity index 94% rename from servo/src/components/main/dom/element.rs rename to servo/src/components/script/dom/element.rs index e3a5e59dae30..742fdb466823 100644 --- a/servo/src/components/main/dom/element.rs +++ b/servo/src/components/script/dom/element.rs @@ -2,19 +2,17 @@ * 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/. */ -// -// Element nodes. -// +//! Element nodes. -use dom::node::{ElementNodeTypeId, Node, ScriptView}; +use dom::bindings::utils::DOMString; use dom::clientrect::ClientRect; use dom::clientrectlist::ClientRectList; -use dom::bindings::utils::DOMString; +use dom::node::{ElementNodeTypeId, Node, ScriptView}; +use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery}; +use layout_interface::{ContentBoxesResponse}; -use layout::layout_task; - -use core::str::eq_slice; use core::cell::Cell; +use core::str::eq_slice; use std::net::url::Url; pub struct Element { @@ -169,9 +167,9 @@ pub impl<'self> Element { let script_context = unsafe { &mut *win.script_context }; - match script_context.query_layout(layout_task::ContentBoxes(node)) { + match script_context.query_layout(ContentBoxesQuery(node)) { Ok(rects) => match rects { - layout_task::ContentRects(rects) => + ContentBoxesResponse(rects) => do rects.map |r| { ClientRect::new( r.origin.y.to_f32(), @@ -209,9 +207,9 @@ pub impl<'self> Element { let node = self.parent.abstract.get(); assert!(node.is_element()); let script_context = unsafe { &mut *win.script_context }; - match script_context.query_layout(layout_task::ContentBox(node)) { + match script_context.query_layout(ContentBoxQuery(node)) { Ok(rect) => match rect { - layout_task::ContentRect(rect) => + ContentBoxResponse(rect) => Some(ClientRect::new( rect.origin.y.to_f32(), (rect.origin.y + rect.size.height).to_f32(), diff --git a/servo/src/components/main/dom/event.rs b/servo/src/components/script/dom/event.rs similarity index 100% rename from servo/src/components/main/dom/event.rs rename to servo/src/components/script/dom/event.rs diff --git a/servo/src/components/main/dom/eventtarget.rs b/servo/src/components/script/dom/eventtarget.rs similarity index 100% rename from servo/src/components/main/dom/eventtarget.rs rename to servo/src/components/script/dom/eventtarget.rs diff --git a/servo/src/components/main/dom/htmlcollection.rs b/servo/src/components/script/dom/htmlcollection.rs similarity index 100% rename from servo/src/components/main/dom/htmlcollection.rs rename to servo/src/components/script/dom/htmlcollection.rs diff --git a/servo/src/components/main/dom/node.rs b/servo/src/components/script/dom/node.rs similarity index 94% rename from servo/src/components/main/dom/node.rs rename to servo/src/components/script/dom/node.rs index 15c4149f5d1d..875c31f83228 100644 --- a/servo/src/components/main/dom/node.rs +++ b/servo/src/components/script/dom/node.rs @@ -12,11 +12,12 @@ use dom::characterdata::CharacterData; use dom::document::Document; use dom::element::{Element, ElementTypeId, HTMLImageElement, HTMLImageElementTypeId}; use dom::element::{HTMLStyleElementTypeId}; -use layout::debug::DebugMethods; -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}; // @@ -354,16 +355,14 @@ impl AbstractNode { obj: raw } } -} -impl DebugMethods for AbstractNode { - // Dumps the subtree rooted at this node, for debugging. - fn dump(&self) { + /// Dumps the subtree rooted at this node, for debugging. + pub fn dump(&self) { self.dump_indent(0); } - // Dumps the node tree, for debugging, with indentation. - fn dump_indent(&self, indent: uint) { + /// Dumps the node tree, for debugging, with indentation. + pub fn dump_indent(&self, indent: uint) { let mut s = ~""; for uint::range(0u, indent) |_i| { s += ~" "; @@ -378,7 +377,8 @@ impl DebugMethods for AbstractNode { } } - fn debug_str(&self) -> ~str { + /// Returns a string that describes this node. + pub fn debug_str(&self) -> ~str { fmt!("%?", self.type_id()) } } @@ -427,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/servo/src/components/main/dom/window.rs b/servo/src/components/script/dom/window.rs similarity index 92% rename from servo/src/components/main/dom/window.rs rename to servo/src/components/script/dom/window.rs index c7eaacd7f319..c94e6488a679 100644 --- a/servo/src/components/main/dom/window.rs +++ b/servo/src/components/script/dom/window.rs @@ -4,11 +4,10 @@ use dom::bindings::utils::WrapperCache; use dom::bindings::window; -use scripting::script_task::{ExitMsg, FireTimerMsg, ScriptMsg, ScriptContext}; -use layout::layout_task::MatchSelectorsDamage; -use util::task::spawn_listener; +use layout_interface::MatchSelectorsDamage; +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/servo/src/components/main/html/cssparse.rs b/servo/src/components/script/html/cssparse.rs similarity index 100% rename from servo/src/components/main/html/cssparse.rs rename to servo/src/components/script/html/cssparse.rs diff --git a/servo/src/components/main/html/hubbub_html_parser.rs b/servo/src/components/script/html/hubbub_html_parser.rs similarity index 95% rename from servo/src/components/main/html/hubbub_html_parser.rs rename to servo/src/components/script/html/hubbub_html_parser.rs index 7d601950cfc3..db67b48f0356 100644 --- a/servo/src/components/main/html/hubbub_html_parser.rs +++ b/servo/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/servo/src/components/script/layout_interface.rs b/servo/src/components/script/layout_interface.rs new file mode 100644 index 000000000000..b442dc440d37 --- /dev/null +++ b/servo/src/components/script/layout_interface.rs @@ -0,0 +1,103 @@ +/* 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 high-level interface from script to layout. Using this abstract interface helps reduce +/// coupling between these two components, and enables the DOM to be placed in a separate crate +/// from layout. + +use dom::node::{AbstractNode, ScriptView}; +use script_task::ScriptMsg; + +use core::comm::{Chan, SharedChan}; +use geom::rect::Rect; +use geom::size::Size2D; +use gfx::geometry::Au; +use newcss::stylesheet::Stylesheet; +use std::net::url::Url; + +/// Asynchronous messages that script can send to layout. +/// +/// FIXME(pcwalton): I think this should probably be merged with `LayoutQuery` below. +pub enum Msg { + /// Adds the given stylesheet to the document. + AddStylesheetMsg(Stylesheet), + + /// Requests a reflow. + /// + /// FIXME(pcwalton): Call this `reflow` instead? + BuildMsg(~BuildData), + + /// Performs a synchronous layout request. + /// + /// FIXME(pcwalton): As noted below, this isn't very type safe. + QueryMsg(LayoutQuery, Chan>), + + /// Requests that the layout task shut down and exit. + ExitMsg, +} + +/// Synchronous messages that script can send to layout. +pub enum LayoutQuery { + /// Requests the dimensions of the content box, as in the `getBoundingClientRect()` call. + ContentBoxQuery(AbstractNode), + /// Requests the dimensions of all the content boxes, as in the `getClientRects()` call. + ContentBoxesQuery(AbstractNode), +} + +/// The reply of a synchronous message from script to layout. +/// +/// FIXME(pcwalton): This isn't very type safe. Maybe `LayoutQuery` objects should include +/// response channels? +pub enum LayoutResponse { + /// A response to the `ContentBoxQuery` message. + ContentBoxResponse(Rect), + /// A response to the `ContentBoxesQuery` message. + ContentBoxesResponse(~[Rect]), +} + +/// Dirty bits for layout. +pub enum Damage { + /// The document is clean; nothing needs to be done. + NoDamage, + /// Reflow, but do not perform CSS selector matching. + ReflowDamage, + /// Perform CSS selector matching and reflow. + MatchSelectorsDamage, +} + +impl Damage { + /// Sets this damage to the maximum of this damage and the given damage. + /// + /// FIXME(pcwalton): This could be refactored to use `max` and the `Ord` trait, and this + /// function removed. + fn add(&mut self, new_damage: Damage) { + match (*self, new_damage) { + (NoDamage, _) => *self = new_damage, + (ReflowDamage, NoDamage) => *self = ReflowDamage, + (ReflowDamage, new_damage) => *self = new_damage, + (MatchSelectorsDamage, _) => *self = MatchSelectorsDamage + } + } +} + +/// Information needed for a reflow. +pub struct BuildData { + node: AbstractNode, + /// What reflow needs to be done. + damage: Damage, + /// The URL of the page. + url: Url, + /// The channel through which messages can be sent back to the script task. + script_chan: SharedChan, + /// The current window size. + window_size: Size2D, + script_join_chan: Chan<()>, +} + +/// Encapsulates a channel to the layout task. +#[deriving(Clone)] +pub struct LayoutTask { + chan: SharedChan, +} + diff --git a/servo/src/components/script/script.rc b/servo/src/components/script/script.rc new file mode 100644 index 000000000000..0c40fc8aab3f --- /dev/null +++ b/servo/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/servo/src/components/main/scripting/script_task.rs b/servo/src/components/script/script_task.rs similarity index 96% rename from servo/src/components/main/scripting/script_task.rs rename to servo/src/components/script/script_task.rs index fb01adef9b78..cf99428c6778 100644 --- a/servo/src/components/main/scripting/script_task.rs +++ b/servo/src/components/script/script_task.rs @@ -10,10 +10,10 @@ use dom::document::Document; use dom::event::{Event, ResizeEvent, ReflowEvent}; use dom::node::define_bindings; use dom::window::Window; -use layout::layout_task::{AddStylesheet, BuildData, BuildMsg, Damage, LayoutQuery}; -use layout::layout_task::{LayoutQueryResponse, LayoutTask, MatchSelectorsDamage, NoDamage}; -use layout::layout_task::{QueryMsg, ReflowDamage}; -use layout::layout_task; +use layout_interface::{AddStylesheetMsg, BuildData, BuildMsg, Damage, LayoutQuery}; +use layout_interface::{LayoutResponse, LayoutTask, MatchSelectorsDamage, NoDamage}; +use layout_interface::{QueryMsg, ReflowDamage}; +use layout_interface; use core::cast::transmute; use core::cell::Cell; @@ -292,7 +292,8 @@ impl ScriptContext { for self.root_frame.each |frame| { frame.document.teardown(); } - self.layout_task.send(layout_task::ExitMsg) + + self.layout_task.chan.send(layout_interface::ExitMsg) } /// The entry point to document loading. Defines bindings, sets up the window and document @@ -321,7 +322,7 @@ impl ScriptContext { // in the script task. loop { match html_parsing_result.style_port.recv() { - Some(sheet) => self.layout_task.send(AddStylesheet(sheet)), + Some(sheet) => self.layout_task.chan.send(AddStylesheetMsg(sheet)), None => break, } } @@ -416,7 +417,7 @@ impl ScriptContext { damage: replace(&mut self.damage, NoDamage), }; - self.layout_task.send(BuildMsg(data)) + self.layout_task.chan.send(BuildMsg(data)) } } @@ -424,11 +425,11 @@ impl ScriptContext { } /// Sends the given query to layout. - pub fn query_layout(&mut self, query: LayoutQuery) -> LayoutQueryResponse { + pub fn query_layout(&mut self, query: LayoutQuery) -> Result { self.join_layout(); let (response_port, response_chan) = comm::stream(); - self.layout_task.send(QueryMsg(query, response_chan)); + self.layout_task.chan.send(QueryMsg(query, response_chan)); response_port.recv() } diff --git a/servo/src/etc/tidy.py b/servo/src/etc/tidy.py index 4ffe776e8c39..28a6ff2a92ea 100644 --- a/servo/src/etc/tidy.py +++ b/servo/src/etc/tidy.py @@ -36,6 +36,7 @@ exceptions = [ "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):