script: Limit public exports. (#34915)

* script: Restrict reexport visibility of DOM types.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mass pub->pub(crate) conversion.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide existing dead code warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix unit tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* More formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-10 03:19:19 -05:00 committed by GitHub
parent f220d6d3a5
commit c94d909a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
585 changed files with 5411 additions and 5013 deletions

View file

@ -29,39 +29,42 @@ mod animations;
#[macro_use]
mod task;
mod body;
pub mod clipboard_provider;
pub mod conversions;
pub(crate) mod clipboard_provider;
pub(crate) mod conversions;
mod devtools;
pub mod document_loader;
pub(crate) mod document_loader;
#[macro_use]
mod dom;
mod canvas_state;
pub mod fetch;
pub(crate) mod fetch;
mod image_listener;
mod init;
mod layout_image;
pub mod document_collection;
pub mod iframe_collection;
pub(crate) mod document_collection;
pub(crate) mod iframe_collection;
pub mod layout_dom;
mod mem;
#[allow(unsafe_code)]
pub mod messaging;
pub(crate) mod messaging;
mod microtask;
mod network_listener;
#[allow(dead_code)]
mod realms;
#[allow(dead_code)]
mod script_module;
pub mod script_runtime;
pub(crate) mod script_runtime;
#[allow(unsafe_code)]
pub mod script_thread;
pub mod security_manager;
pub mod serviceworker_manager;
pub(crate) mod script_thread;
pub(crate) mod security_manager;
pub(crate) mod serviceworker_manager;
mod stylesheet_loader;
mod stylesheet_set;
mod task_manager;
mod task_queue;
mod task_source;
pub mod test;
#[allow(dead_code)]
pub mod textinput;
mod timers;
mod unpremultiplytable;
@ -76,12 +79,14 @@ mod xpath;
pub use init::init;
pub use script_runtime::JSEngineSetup;
pub use script_thread::ScriptThread;
pub use serviceworker_manager::ServiceWorkerManager;
pub use crate::dom::bindings::codegen::DomTypeHolder::DomTypeHolder;
pub use crate::dom::bindings::codegen::DomTypes::DomTypes;
pub(crate) use crate::dom::bindings::codegen::DomTypeHolder::DomTypeHolder;
pub(crate) use crate::dom::bindings::codegen::DomTypes::DomTypes;
// These trait exports are public, because they are used in the DOM bindings.
// Since they are used in derive macros,
// it is useful that they are accessible at the root of the crate.
pub use crate::dom::bindings::inheritance::HasParent;
pub use crate::dom::bindings::reflector::{DomObject, MutDomObject, Reflector};
pub use crate::dom::bindings::trace::{CustomTraceable, JSTraceable};
pub(crate) use crate::dom::bindings::inheritance::HasParent;
pub(crate) use crate::dom::bindings::reflector::{DomObject, MutDomObject, Reflector};
pub(crate) use crate::dom::bindings::trace::{CustomTraceable, JSTraceable};