aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/elementinternals.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2025-01-10 03:19:19 -0500
committerGitHub <noreply@github.com>2025-01-10 08:19:19 +0000
commitc94d909a8688589209cdf0c7ae58e40f9b8c411e (patch)
tree12febf23eed4438249fd4d276c4d8b35dee22a97 /components/script/dom/elementinternals.rs
parentf220d6d3a52296794cd19935e9e59cc75a179a44 (diff)
downloadservo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.tar.gz
servo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.zip
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>
Diffstat (limited to 'components/script/dom/elementinternals.rs')
-rw-r--r--components/script/dom/elementinternals.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/elementinternals.rs b/components/script/dom/elementinternals.rs
index bb717e9e419..4156a5a725b 100644
--- a/components/script/dom/elementinternals.rs
+++ b/components/script/dom/elementinternals.rs
@@ -53,7 +53,7 @@ impl From<Option<&FileOrUSVStringOrFormData>> for SubmissionValue {
}
#[dom_struct]
-pub struct ElementInternals {
+pub(crate) struct ElementInternals {
reflector_: Reflector,
/// If `attached` is false, we're using this to hold form-related state
/// on an element for which `attachInternals()` wasn't called yet; this is
@@ -87,7 +87,7 @@ impl ElementInternals {
}
}
- pub fn new(element: &HTMLElement) -> DomRoot<ElementInternals> {
+ pub(crate) fn new(element: &HTMLElement) -> DomRoot<ElementInternals> {
let global = element.owner_window();
reflect_dom_object(
Box::new(ElementInternals::new_inherited(element)),
@@ -116,23 +116,23 @@ impl ElementInternals {
*self.state.borrow_mut() = value;
}
- pub fn set_form_owner(&self, form: Option<&HTMLFormElement>) {
+ pub(crate) fn set_form_owner(&self, form: Option<&HTMLFormElement>) {
self.form_owner.set(form);
}
- pub fn form_owner(&self) -> Option<DomRoot<HTMLFormElement>> {
+ pub(crate) fn form_owner(&self) -> Option<DomRoot<HTMLFormElement>> {
self.form_owner.get()
}
- pub fn set_attached(&self) {
+ pub(crate) fn set_attached(&self) {
self.attached.set(true);
}
- pub fn attached(&self) -> bool {
+ pub(crate) fn attached(&self) -> bool {
self.attached.get()
}
- pub fn perform_entry_construction(&self, entry_list: &mut Vec<FormDatum>) {
+ pub(crate) fn perform_entry_construction(&self, entry_list: &mut Vec<FormDatum>) {
if self
.target_element
.upcast::<Element>()
@@ -180,7 +180,7 @@ impl ElementInternals {
}
}
- pub fn is_invalid(&self) -> bool {
+ pub(crate) fn is_invalid(&self) -> bool {
self.is_target_form_associated() &&
self.is_instance_validatable() &&
!self.satisfies_constraints()