mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
f220d6d3a5
commit
c94d909a86
585 changed files with 5411 additions and 5013 deletions
|
@ -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>>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue