aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_bindings/interfaces.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2025-03-29 04:11:27 -0400
committerGitHub <noreply@github.com>2025-03-29 08:11:27 +0000
commitc30ad5a30e10b9aabe5842624db24b9846c3d5d4 (patch)
treec879104dc5ef15647d975da14a6b703d4099df4d /components/script_bindings/interfaces.rs
parent2c9411095255f804a43c2abc05c5aaa2a0becca7 (diff)
downloadservo-c30ad5a30e10b9aabe5842624db24b9846c3d5d4.tar.gz
servo-c30ad5a30e10b9aabe5842624db24b9846c3d5d4.zip
Miscellaneous script splitting preparation changes (#36216)
* script: Move num module to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make JS reflector creation generic over DOM trait. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move bindings-specific lock to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move DOM proto array code to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move finalizer implementations to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move some error routines to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move some DOM interface conversion routines to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make is_array_like generic over DOM trait. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Use generic interfaces for conditional exposure functions. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move a bunch of routines used by codegen to script_bindings. 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> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script_bindings/interfaces.rs')
-rw-r--r--components/script_bindings/interfaces.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/components/script_bindings/interfaces.rs b/components/script_bindings/interfaces.rs
new file mode 100644
index 00000000000..2e7f6017e75
--- /dev/null
+++ b/components/script_bindings/interfaces.rs
@@ -0,0 +1,24 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+use js::rust::HandleObject;
+
+use crate::script_runtime::JSContext;
+
+pub trait DocumentHelpers {
+ fn ensure_safe_to_run_script_or_layout(&self);
+}
+
+pub trait ServoInternalsHelpers {
+ fn is_servo_internal(cx: JSContext, global: HandleObject) -> bool;
+}
+
+pub trait TestBindingHelpers {
+ fn condition_satisfied(cx: JSContext, global: HandleObject) -> bool;
+ fn condition_unsatisfied(cx: JSContext, global: HandleObject) -> bool;
+}
+
+pub trait WebGL2RenderingContextHelpers {
+ fn is_webgl2_enabled(cx: JSContext, global: HandleObject) -> bool;
+}