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

@ -21,7 +21,7 @@ use crate::xpath::{NodesetHelpers, Value};
#[repr(u16)]
#[derive(Clone, Copy, Debug, Eq, JSTraceable, MallocSizeOf, Ord, PartialEq, PartialOrd)]
pub enum XPathResultType {
pub(crate) enum XPathResultType {
Any = XPathResultConstants::ANY_TYPE,
Number = XPathResultConstants::NUMBER_TYPE,
String = XPathResultConstants::STRING_TYPE,
@ -55,7 +55,7 @@ impl TryFrom<u16> for XPathResultType {
}
#[derive(JSTraceable, MallocSizeOf)]
pub enum XPathResultValue {
pub(crate) enum XPathResultValue {
Boolean(bool),
/// A IEEE-754 double-precision floating point number
Number(f64),
@ -81,7 +81,7 @@ impl From<Value> for XPathResultValue {
}
#[dom_struct]
pub struct XPathResult {
pub(crate) struct XPathResult {
reflector_: Reflector,
window: Dom<Window>,
result_type: XPathResultType,
@ -122,7 +122,7 @@ impl XPathResult {
/// NB: Blindly trusts `result_type` and constructs an object regardless of the contents
/// of `value`. The exception is `XPathResultType::Any`, for which we look at the value
/// to determine the type.
pub fn new(
pub(crate) fn new(
window: &Window,
proto: Option<HandleObject>,
can_gc: CanGc,