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// Bao embedder-callback API (vendor patch) lives on the upstream ScriptThread
26// in event_loop; re-exported here so `servo` crate / bao embedders can reach it.
27pub use event_loop::script_thread::{register_embedder_callback, register_worker_scope_callback};
28pub(crate) mod conversions;
29mod css;
30mod fetch;
31#[macro_use]
32mod dom;
33pub(crate) use dom::canvas_context;
34mod drag;
35mod engine;
36mod event_loop;
37mod runtime;
38mod url;
39
40pub mod layout_dom;
41pub(crate) mod messaging;
42pub(crate) mod mime;
43pub(crate) mod modules;
44mod navigation;
45mod realms;
46mod routed_promise;
47pub mod test;
48mod unminify;
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::{AssociatedMemory, 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;