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
23mod animation_timeline;
24mod animations;
25mod script_window_proxies;
26#[macro_use]
27mod task;
28mod body;
29pub(crate) mod clipboard_provider;
30pub(crate) mod conversions;
31mod devtools;
32pub(crate) mod document_loader;
33#[macro_use]
34mod dom;
35pub(crate) use dom::canvas_context;
36pub(crate) mod fetch;
37pub(crate) mod indexed_db;
38mod init;
39mod layout_image;
40
41pub(crate) mod document_collection;
42pub(crate) mod iframe_collection;
43pub(crate) mod image_animation;
44pub mod layout_dom;
45#[allow(unsafe_code)]
46pub(crate) mod messaging;
47mod microtask;
48pub(crate) mod mime;
49mod navigation;
50mod network_listener;
51mod realms;
52mod routed_promise;
53#[allow(dead_code)]
54mod script_module;
55mod script_mutation_observers;
56pub(crate) mod script_runtime;
57#[allow(unsafe_code)]
58pub(crate) mod script_thread;
59pub(crate) mod security_manager;
60pub(crate) mod serviceworker_manager;
61mod stylesheet_loader;
62mod stylesheet_set;
63mod task_manager;
64mod task_queue;
65mod task_source;
66pub mod test;
67#[allow(dead_code)]
68pub mod textinput;
69mod timers;
70mod webdriver_handlers;
71mod window_named_properties;
72mod xpath;
73
74mod unminify;
75
76mod drag_data_store;
77mod links;
78
79pub use init::init;
80pub(crate) use script_bindings::DomTypes;
81pub use script_runtime::JSEngineSetup;
82pub use script_thread::ScriptThread;
83pub use serviceworker_manager::ServiceWorkerManager;
84
85pub(crate) use crate::dom::bindings::codegen::DomTypeHolder::DomTypeHolder;
86// These trait exports are public, because they are used in the DOM bindings.
87// Since they are used in derive macros,
88// it is useful that they are accessible at the root of the crate.
89pub(crate) use crate::dom::bindings::inheritance::HasParent;
90pub(crate) use crate::dom::bindings::reflector::{DomObject, MutDomObject, Reflector};
91pub(crate) use crate::dom::bindings::trace::{CustomTraceable, JSTraceable};