mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -18,7 +18,7 @@ use crate::dom::xrsession::XRSession;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRInputSourceArray {
|
||||
pub(crate) struct XRInputSourceArray {
|
||||
reflector_: Reflector,
|
||||
input_sources: DomRefCell<Vec<Dom<XRInputSource>>>,
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ impl XRInputSourceArray {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<XRInputSourceArray> {
|
||||
pub(crate) fn new(global: &GlobalScope) -> DomRoot<XRInputSourceArray> {
|
||||
reflect_dom_object(
|
||||
Box::new(XRInputSourceArray::new_inherited()),
|
||||
global,
|
||||
|
@ -39,7 +39,12 @@ impl XRInputSourceArray {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn add_input_sources(&self, session: &XRSession, inputs: &[InputSource], can_gc: CanGc) {
|
||||
pub(crate) fn add_input_sources(
|
||||
&self,
|
||||
session: &XRSession,
|
||||
inputs: &[InputSource],
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
let global = self.global();
|
||||
|
||||
let mut added = vec![];
|
||||
|
@ -72,7 +77,7 @@ impl XRInputSourceArray {
|
|||
event.upcast::<Event>().fire(session.upcast(), can_gc);
|
||||
}
|
||||
|
||||
pub fn remove_input_source(&self, session: &XRSession, id: InputId, can_gc: CanGc) {
|
||||
pub(crate) fn remove_input_source(&self, session: &XRSession, id: InputId, can_gc: CanGc) {
|
||||
let global = self.global();
|
||||
let removed = if let Some(i) = self.input_sources.borrow().iter().find(|i| i.id() == id) {
|
||||
i.gamepad().update_connected(false, false, can_gc);
|
||||
|
@ -95,7 +100,7 @@ impl XRInputSourceArray {
|
|||
event.upcast::<Event>().fire(session.upcast(), can_gc);
|
||||
}
|
||||
|
||||
pub fn add_remove_input_source(
|
||||
pub(crate) fn add_remove_input_source(
|
||||
&self,
|
||||
session: &XRSession,
|
||||
id: InputId,
|
||||
|
@ -131,7 +136,7 @@ impl XRInputSourceArray {
|
|||
event.upcast::<Event>().fire(session.upcast(), can_gc);
|
||||
}
|
||||
|
||||
pub fn find(&self, id: InputId) -> Option<DomRoot<XRInputSource>> {
|
||||
pub(crate) fn find(&self, id: InputId) -> Option<DomRoot<XRInputSource>> {
|
||||
self.input_sources
|
||||
.borrow()
|
||||
.iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue