aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/imagedata.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/imagedata.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/imagedata.rs')
-rw-r--r--components/script/dom/imagedata.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs
index 4fff85d8b91..4b44cd88a93 100644
--- a/components/script/dom/imagedata.rs
+++ b/components/script/dom/imagedata.rs
@@ -24,7 +24,7 @@ use crate::dom::globalscope::GlobalScope;
use crate::script_runtime::{CanGc, JSContext};
#[dom_struct]
-pub struct ImageData {
+pub(crate) struct ImageData {
reflector_: Reflector,
width: u32,
height: u32,
@@ -34,7 +34,7 @@ pub struct ImageData {
impl ImageData {
#[allow(unsafe_code)]
- pub fn new(
+ pub(crate) fn new(
global: &GlobalScope,
width: u32,
height: u32,
@@ -141,22 +141,22 @@ impl ImageData {
))
}
#[allow(unsafe_code)]
- pub fn to_shared_memory(&self) -> IpcSharedMemory {
+ pub(crate) fn to_shared_memory(&self) -> IpcSharedMemory {
IpcSharedMemory::from_bytes(unsafe { self.as_slice() })
}
#[allow(unsafe_code)]
- pub unsafe fn get_rect(&self, rect: Rect<u64>) -> Cow<[u8]> {
+ pub(crate) unsafe fn get_rect(&self, rect: Rect<u64>) -> Cow<[u8]> {
pixels::rgba8_get_rect(self.as_slice(), self.get_size().to_u64(), rect)
}
- pub fn get_size(&self) -> Size2D<u32> {
+ pub(crate) fn get_size(&self) -> Size2D<u32> {
Size2D::new(self.Width(), self.Height())
}
/// Nothing must change the array on the JS side while the slice is live.
#[allow(unsafe_code)]
- pub unsafe fn as_slice(&self) -> &[u8] {
+ pub(crate) unsafe fn as_slice(&self) -> &[u8] {
assert!(self.data.is_initialized());
let internal_data = self
.data