aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/document_collection.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/document_collection.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/document_collection.rs')
-rw-r--r--components/script/document_collection.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/document_collection.rs b/components/script/document_collection.rs
index bcff897910e..66563b55513 100644
--- a/components/script/document_collection.rs
+++ b/components/script/document_collection.rs
@@ -24,33 +24,33 @@ pub(crate) struct DocumentCollection {
}
impl DocumentCollection {
- pub fn insert(&mut self, pipeline_id: PipelineId, doc: &Document) {
+ pub(crate) fn insert(&mut self, pipeline_id: PipelineId, doc: &Document) {
self.map.insert(pipeline_id, Dom::from_ref(doc));
}
- pub fn remove(&mut self, pipeline_id: PipelineId) -> Option<DomRoot<Document>> {
+ pub(crate) fn remove(&mut self, pipeline_id: PipelineId) -> Option<DomRoot<Document>> {
self.map
.remove(&pipeline_id)
.map(|ref doc| DomRoot::from_ref(&**doc))
}
- pub fn find_document(&self, pipeline_id: PipelineId) -> Option<DomRoot<Document>> {
+ pub(crate) fn find_document(&self, pipeline_id: PipelineId) -> Option<DomRoot<Document>> {
self.map
.get(&pipeline_id)
.map(|doc| DomRoot::from_ref(&**doc))
}
- pub fn find_window(&self, pipeline_id: PipelineId) -> Option<DomRoot<Window>> {
+ pub(crate) fn find_window(&self, pipeline_id: PipelineId) -> Option<DomRoot<Window>> {
self.find_document(pipeline_id)
.map(|doc| DomRoot::from_ref(doc.window()))
}
- pub fn find_global(&self, pipeline_id: PipelineId) -> Option<DomRoot<GlobalScope>> {
+ pub(crate) fn find_global(&self, pipeline_id: PipelineId) -> Option<DomRoot<GlobalScope>> {
self.find_window(pipeline_id)
.map(|window| DomRoot::from_ref(window.upcast()))
}
- pub fn find_iframe(
+ pub(crate) fn find_iframe(
&self,
pipeline_id: PipelineId,
browsing_context_id: BrowsingContextId,
@@ -63,7 +63,7 @@ impl DocumentCollection {
})
}
- pub fn iter(&self) -> DocumentsIter<'_> {
+ pub(crate) fn iter(&self) -> DocumentsIter<'_> {
DocumentsIter {
iter: self.map.iter(),
}
@@ -101,7 +101,7 @@ impl Default for DocumentCollection {
}
#[allow(crown::unrooted_must_root)]
-pub struct DocumentsIter<'a> {
+pub(crate) struct DocumentsIter<'a> {
iter: hash_map::Iter<'a, PipelineId, Dom<Document>>,
}