Skip to main content

script/
lib.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5#![cfg_attr(crown, feature(register_tool))]
6#![deny(unsafe_code)]
7#![doc = "The script crate contains all matters DOM."]
8// Register the linter `crown`, which is the Servo-specific linter for the script crate.
9#![cfg_attr(crown, register_tool(crown))]
10
11// These are used a lot so let's keep them for now
12#[macro_use]
13extern crate js;
14#[macro_use]
15extern crate jstraceable_derive;
16#[macro_use]
17extern crate log;
18#[macro_use]
19extern crate malloc_size_of_derive;
20#[macro_use]
21extern crate stylo_atoms;
22
23#[macro_use]
24mod tasks;
25
26#[macro_use]
27extern crate script_bindings;
28
29pub(crate) mod conversions;
30mod css;
31mod fetch;
32#[macro_use]
33mod dom;
34pub(crate) use dom::canvas_context;
35mod drag;
36mod engine;
37mod event_loop;
38pub mod layout_dom;
39pub(crate) mod messaging;
40pub(crate) mod mime;
41mod navigation;
42mod realms;
43mod routed_promise;
44mod runtime;
45mod scripting;
46pub mod test;
47mod unminify;
48mod url;
49mod window_named_properties;
50mod xpath;
51
52pub use event_loop::script_thread::ScriptThread;
53pub(crate) use script_bindings::DomTypes;
54pub(crate) use script_bindings::reflector::{DomObject, MutDomObject, Reflector};
55
56pub(crate) use crate::dom::bindings::codegen::DomTypeHolder::DomTypeHolder;
57// These trait exports are public, because they are used in the DOM bindings.
58// Since they are used in derive macros,
59// it is useful that they are accessible at the root of the crate.
60pub(crate) use crate::dom::bindings::inheritance::HasParent;
61pub(crate) use crate::dom::bindings::trace::{CustomTraceable, JSTraceable};
62pub use crate::dom::serviceworker::serviceworker_manager::ServiceWorkerManager;
63pub use crate::engine::handle::JSEngineSetup;
64pub use crate::engine::init::init;