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

@ -22,39 +22,39 @@ use crate::dom::window::LayoutValue;
#[derive(Default, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
pub struct NodeRareData {
pub(crate) struct NodeRareData {
/// The shadow root the node belongs to.
/// This is None if the node is not in a shadow tree or
/// if it is a ShadowRoot.
pub containing_shadow_root: Option<Dom<ShadowRoot>>,
pub(crate) containing_shadow_root: Option<Dom<ShadowRoot>>,
/// Registered observers for this node.
pub mutation_observers: Vec<RegisteredObserver>,
pub(crate) mutation_observers: Vec<RegisteredObserver>,
/// Lazily-generated Unique Id for this node.
pub unique_id: Option<UniqueId>,
pub(crate) unique_id: Option<UniqueId>,
}
#[derive(Default, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
pub struct ElementRareData {
pub(crate) struct ElementRareData {
/// <https://dom.spec.whatwg.org/#dom-element-shadowroot>
/// The ShadowRoot this element is host of.
/// XXX This is currently not exposed to web content. Only for
/// internal use.
pub shadow_root: Option<Dom<ShadowRoot>>,
pub(crate) shadow_root: Option<Dom<ShadowRoot>>,
/// <https://html.spec.whatwg.org/multipage/#custom-element-reaction-queue>
pub custom_element_reaction_queue: Vec<CustomElementReaction>,
pub(crate) custom_element_reaction_queue: Vec<CustomElementReaction>,
/// <https://dom.spec.whatwg.org/#concept-element-custom-element-definition>
#[ignore_malloc_size_of = "Rc"]
pub custom_element_definition: Option<Rc<CustomElementDefinition>>,
pub(crate) custom_element_definition: Option<Rc<CustomElementDefinition>>,
/// <https://dom.spec.whatwg.org/#concept-element-custom-element-state>
pub custom_element_state: CustomElementState,
pub(crate) custom_element_state: CustomElementState,
/// The "name" content attribute; not used as frequently as id, but used
/// in named getter loops so it's worth looking up quickly when present
#[no_trace]
pub name_attribute: Option<Atom>,
pub(crate) name_attribute: Option<Atom>,
/// The client rect reported by layout.
#[no_trace]
pub client_rect: Option<LayoutValue<Rect<i32>>>,
pub(crate) client_rect: Option<LayoutValue<Rect<i32>>>,
/// <https://html.spec.whatwg.org/multipage#elementinternals>
pub element_internals: Option<Dom<ElementInternals>>,
pub(crate) element_internals: Option<Dom<ElementInternals>>,
}