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
26pub(crate) mod conversions;
27mod css;
28mod fetch;
29#[macro_use]
30mod dom;
31pub(crate) use dom::canvas_context;
32mod drag;
33mod engine;
34mod event_loop;
35mod runtime;
36mod url;
37
38pub mod layout_dom;
39pub(crate) mod messaging;
40pub(crate) mod mime;
41pub(crate) mod modules;
42mod navigation;
43mod realms;
44mod routed_promise;
45pub mod test;
46mod unminify;
47mod window_named_properties;
48mod xpath;
49
50pub use event_loop::script_thread::ScriptThread;
51pub(crate) use script_bindings::DomTypes;
52pub(crate) use script_bindings::reflector::{AssociatedMemory, DomObject, MutDomObject, Reflector};
53
54pub(crate) use crate::dom::bindings::codegen::DomTypeHolder::DomTypeHolder;
55// These trait exports are public, because they are used in the DOM bindings.
56// Since they are used in derive macros,
57// it is useful that they are accessible at the root of the crate.
58pub(crate) use crate::dom::bindings::inheritance::HasParent;
59pub(crate) use crate::dom::bindings::trace::{CustomTraceable, JSTraceable};
60pub use crate::dom::serviceworker::serviceworker_manager::ServiceWorkerManager;
61pub use crate::engine::handle::JSEngineSetup;
62pub use crate::engine::init::init;