mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
feat: add can_gc argument to to_frozen_array (#36043)
* feat: add can_gc argument to to_frozen_array Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * fix: linting issues Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * feat: add can_gc in binding.conf Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * fix: linting issues Signed-off-by: Arya Nair <aryaajitnair@gmail.com> --------- Signed-off-by: Arya Nair <aryaajitnair@gmail.com>
This commit is contained in:
parent
0917e080df
commit
cb56ac8561
21 changed files with 97 additions and 43 deletions
|
@ -9,7 +9,7 @@ use js::rust::MutableHandleValue;
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::utils::to_frozen_array;
|
use crate::dom::bindings::utils::to_frozen_array;
|
||||||
use crate::script_runtime::JSContext;
|
use crate::script_runtime::{CanGc, JSContext};
|
||||||
|
|
||||||
#[derive(JSTraceable)]
|
#[derive(JSTraceable)]
|
||||||
pub(crate) struct CachedFrozenArray {
|
pub(crate) struct CachedFrozenArray {
|
||||||
|
@ -28,6 +28,7 @@ impl CachedFrozenArray {
|
||||||
f: F,
|
f: F,
|
||||||
cx: JSContext,
|
cx: JSContext,
|
||||||
mut retval: MutableHandleValue,
|
mut retval: MutableHandleValue,
|
||||||
|
can_gc: CanGc,
|
||||||
) {
|
) {
|
||||||
if let Some(inner) = &*self.frozen_value.borrow() {
|
if let Some(inner) = &*self.frozen_value.borrow() {
|
||||||
retval.set(inner.get());
|
retval.set(inner.get());
|
||||||
|
@ -35,7 +36,7 @@ impl CachedFrozenArray {
|
||||||
}
|
}
|
||||||
|
|
||||||
let array = f();
|
let array = f();
|
||||||
to_frozen_array(array.as_slice(), cx, retval);
|
to_frozen_array(array.as_slice(), cx, retval, can_gc);
|
||||||
|
|
||||||
// Safety: need to create the Heap value in its final memory location before setting it.
|
// Safety: need to create the Heap value in its final memory location before setting it.
|
||||||
*self.frozen_value.borrow_mut() = Some(Heap::default());
|
*self.frozen_value.borrow_mut() = Some(Heap::default());
|
||||||
|
|
|
@ -123,6 +123,7 @@ pub(crate) fn to_frozen_array<T: ToJSValConvertible>(
|
||||||
convertibles: &[T],
|
convertibles: &[T],
|
||||||
cx: SafeJSContext,
|
cx: SafeJSContext,
|
||||||
rval: MutableHandleValue,
|
rval: MutableHandleValue,
|
||||||
|
_can_gc: CanGc,
|
||||||
) {
|
) {
|
||||||
unsafe { convertibles.to_jsval(*cx, rval) };
|
unsafe { convertibles.to_jsval(*cx, rval) };
|
||||||
|
|
||||||
|
|
|
@ -69,13 +69,13 @@ impl SpecificCSSRule for CSSLayerStatementRule {
|
||||||
|
|
||||||
impl CSSLayerStatementRuleMethods<crate::DomTypeHolder> for CSSLayerStatementRule {
|
impl CSSLayerStatementRuleMethods<crate::DomTypeHolder> for CSSLayerStatementRule {
|
||||||
/// <https://drafts.csswg.org/css-cascade-5/#dom-csslayerstatementrule-namelist>
|
/// <https://drafts.csswg.org/css-cascade-5/#dom-csslayerstatementrule-namelist>
|
||||||
fn NameList(&self, cx: SafeJSContext, retval: MutableHandleValue) {
|
fn NameList(&self, cx: SafeJSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
let names: Vec<DOMString> = self
|
let names: Vec<DOMString> = self
|
||||||
.layerstatementrule
|
.layerstatementrule
|
||||||
.names
|
.names
|
||||||
.iter()
|
.iter()
|
||||||
.map(|name| DOMString::from_string(name.to_css_string()))
|
.map(|name| DOMString::from_string(name.to_css_string()))
|
||||||
.collect();
|
.collect();
|
||||||
to_frozen_array(names.as_slice(), cx, retval)
|
to_frozen_array(names.as_slice(), cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,8 +160,8 @@ impl DataTransferMethods<crate::DomTypeHolder> for DataTransfer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://html.spec.whatwg.org/multipage/#dom-datatransfer-types>
|
/// <https://html.spec.whatwg.org/multipage/#dom-datatransfer-types>
|
||||||
fn Types(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Types(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
self.items.frozen_types(cx, retval);
|
self.items.frozen_types(cx, retval, can_gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://html.spec.whatwg.org/multipage/#dom-datatransfer-getdata>
|
/// <https://html.spec.whatwg.org/multipage/#dom-datatransfer-getdata>
|
||||||
|
|
|
@ -51,7 +51,7 @@ impl DataTransferItemList {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn frozen_types(&self, cx: JSContext, retval: MutableHandleValue) {
|
pub(crate) fn frozen_types(&self, cx: JSContext, retval: MutableHandleValue, can_gc: CanGc) {
|
||||||
self.frozen_types.get_or_init(
|
self.frozen_types.get_or_init(
|
||||||
|| {
|
|| {
|
||||||
self.data_store
|
self.data_store
|
||||||
|
@ -61,6 +61,7 @@ impl DataTransferItemList {
|
||||||
},
|
},
|
||||||
cx,
|
cx,
|
||||||
retval,
|
retval,
|
||||||
|
can_gc,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ impl ExtendableMessageEventMethods<crate::DomTypeHolder> for ExtendableMessageEv
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://w3c.github.io/ServiceWorker/#extendablemessage-event-ports>
|
/// <https://w3c.github.io/ServiceWorker/#extendablemessage-event-ports>
|
||||||
fn Ports(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Ports(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
self.frozen_ports.get_or_init(
|
self.frozen_ports.get_or_init(
|
||||||
|| {
|
|| {
|
||||||
self.ports
|
self.ports
|
||||||
|
@ -217,6 +217,7 @@ impl ExtendableMessageEventMethods<crate::DomTypeHolder> for ExtendableMessageEv
|
||||||
},
|
},
|
||||||
cx,
|
cx,
|
||||||
retval,
|
retval,
|
||||||
|
can_gc,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,8 +126,8 @@ impl GamepadHapticActuator {
|
||||||
|
|
||||||
impl GamepadHapticActuatorMethods<crate::DomTypeHolder> for GamepadHapticActuator {
|
impl GamepadHapticActuatorMethods<crate::DomTypeHolder> for GamepadHapticActuator {
|
||||||
/// <https://www.w3.org/TR/gamepad/#dom-gamepadhapticactuator-effects>
|
/// <https://www.w3.org/TR/gamepad/#dom-gamepadhapticactuator-effects>
|
||||||
fn Effects(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Effects(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
to_frozen_array(self.effects.as_slice(), cx, retval)
|
to_frozen_array(self.effects.as_slice(), cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://www.w3.org/TR/gamepad/#dom-gamepadhapticactuator-playeffect>
|
/// <https://www.w3.org/TR/gamepad/#dom-gamepadhapticactuator-playeffect>
|
||||||
|
|
|
@ -2908,6 +2908,7 @@ impl GlobalScope {
|
||||||
&self,
|
&self,
|
||||||
cx: SafeJSContext,
|
cx: SafeJSContext,
|
||||||
retval: MutableHandleValue,
|
retval: MutableHandleValue,
|
||||||
|
can_gc: CanGc,
|
||||||
) {
|
) {
|
||||||
self.frozen_supported_performance_entry_types.get_or_init(
|
self.frozen_supported_performance_entry_types.get_or_init(
|
||||||
|| {
|
|| {
|
||||||
|
@ -2918,6 +2919,7 @@ impl GlobalScope {
|
||||||
},
|
},
|
||||||
cx,
|
cx,
|
||||||
retval,
|
retval,
|
||||||
|
can_gc,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -691,8 +691,8 @@ impl IntersectionObserverMethods<crate::DomTypeHolder> for IntersectionObserver
|
||||||
/// > constructor, or the sequence is empty, the value of this attribute will be `[0]`.
|
/// > constructor, or the sequence is empty, the value of this attribute will be `[0]`.
|
||||||
///
|
///
|
||||||
/// <https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-thresholds>
|
/// <https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-thresholds>
|
||||||
fn Thresholds(&self, context: JSContext, retval: MutableHandleValue) {
|
fn Thresholds(&self, context: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
to_frozen_array(&self.thresholds.borrow(), context, retval);
|
to_frozen_array(&self.thresholds.borrow(), context, retval, can_gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// > A number indicating the minimum delay in milliseconds between notifications from
|
/// > A number indicating the minimum delay in milliseconds between notifications from
|
||||||
|
|
|
@ -302,7 +302,7 @@ impl MessageEventMethods<crate::DomTypeHolder> for MessageEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://html.spec.whatwg.org/multipage/#dom-messageevent-ports>
|
/// <https://html.spec.whatwg.org/multipage/#dom-messageevent-ports>
|
||||||
fn Ports(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Ports(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
self.frozen_ports.get_or_init(
|
self.frozen_ports.get_or_init(
|
||||||
|| {
|
|| {
|
||||||
self.ports
|
self.ports
|
||||||
|
@ -313,6 +313,7 @@ impl MessageEventMethods<crate::DomTypeHolder> for MessageEvent {
|
||||||
},
|
},
|
||||||
cx,
|
cx,
|
||||||
retval,
|
retval,
|
||||||
|
can_gc,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -214,8 +214,8 @@ impl NavigatorMethods<crate::DomTypeHolder> for Navigator {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-languages
|
// https://html.spec.whatwg.org/multipage/#dom-navigator-languages
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn Languages(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Languages(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
to_frozen_array(&[self.Language()], cx, retval)
|
to_frozen_array(&[self.Language()], cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-plugins
|
// https://html.spec.whatwg.org/multipage/#dom-navigator-plugins
|
||||||
|
|
|
@ -441,7 +441,7 @@ impl NotificationMethods<crate::DomTypeHolder> for Notification {
|
||||||
retval.set(self.data.get());
|
retval.set(self.data.get());
|
||||||
}
|
}
|
||||||
/// <https://notifications.spec.whatwg.org/#dom-notification-actions>
|
/// <https://notifications.spec.whatwg.org/#dom-notification-actions>
|
||||||
fn Actions(&self, cx: SafeJSContext, retval: MutableHandleValue) {
|
fn Actions(&self, cx: SafeJSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
// step 1: Let frozenActions be an empty list of type NotificationAction.
|
// step 1: Let frozenActions be an empty list of type NotificationAction.
|
||||||
let mut frozen_actions: Vec<NotificationAction> = Vec::new();
|
let mut frozen_actions: Vec<NotificationAction> = Vec::new();
|
||||||
|
|
||||||
|
@ -461,11 +461,11 @@ impl NotificationMethods<crate::DomTypeHolder> for Notification {
|
||||||
}
|
}
|
||||||
|
|
||||||
// step 3: Return the result of create a frozen array from frozenActions.
|
// step 3: Return the result of create a frozen array from frozenActions.
|
||||||
to_frozen_array(frozen_actions.as_slice(), cx, retval);
|
to_frozen_array(frozen_actions.as_slice(), cx, retval, can_gc);
|
||||||
}
|
}
|
||||||
/// <https://notifications.spec.whatwg.org/#dom-notification-vibrate>
|
/// <https://notifications.spec.whatwg.org/#dom-notification-vibrate>
|
||||||
fn Vibrate(&self, cx: SafeJSContext, retval: MutableHandleValue) {
|
fn Vibrate(&self, cx: SafeJSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
to_frozen_array(self.vibration_pattern.as_slice(), cx, retval);
|
to_frozen_array(self.vibration_pattern.as_slice(), cx, retval, can_gc);
|
||||||
}
|
}
|
||||||
/// <https://notifications.spec.whatwg.org/#dom-notification-timestamp>
|
/// <https://notifications.spec.whatwg.org/#dom-notification-timestamp>
|
||||||
fn Timestamp(&self) -> u64 {
|
fn Timestamp(&self) -> u64 {
|
||||||
|
|
|
@ -141,10 +141,15 @@ impl PerformanceObserverMethods<crate::DomTypeHolder> for PerformanceObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
|
// https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
|
||||||
fn SupportedEntryTypes(cx: JSContext, global: &GlobalScope, retval: MutableHandleValue) {
|
fn SupportedEntryTypes(
|
||||||
|
cx: JSContext,
|
||||||
|
global: &GlobalScope,
|
||||||
|
can_gc: CanGc,
|
||||||
|
retval: MutableHandleValue,
|
||||||
|
) {
|
||||||
// While this is exposed through a method of PerformanceObserver,
|
// While this is exposed through a method of PerformanceObserver,
|
||||||
// it is specified as associated with the global scope.
|
// it is specified as associated with the global scope.
|
||||||
global.supported_performance_entry_types(cx, retval)
|
global.supported_performance_entry_types(cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe()
|
// https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe()
|
||||||
|
|
|
@ -90,32 +90,37 @@ impl ResizeObserverEntryMethods<crate::DomTypeHolder> for ResizeObserverEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/resize-observer/#dom-resizeobserverentry-borderboxsize>
|
/// <https://drafts.csswg.org/resize-observer/#dom-resizeobserverentry-borderboxsize>
|
||||||
fn BorderBoxSize(&self, cx: SafeJSContext, retval: MutableHandleValue) {
|
fn BorderBoxSize(&self, cx: SafeJSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
let sizes: Vec<DomRoot<ResizeObserverSize>> = self
|
let sizes: Vec<DomRoot<ResizeObserverSize>> = self
|
||||||
.border_box_size
|
.border_box_size
|
||||||
.iter()
|
.iter()
|
||||||
.map(|size| DomRoot::from_ref(&**size))
|
.map(|size| DomRoot::from_ref(&**size))
|
||||||
.collect();
|
.collect();
|
||||||
to_frozen_array(sizes.as_slice(), cx, retval)
|
to_frozen_array(sizes.as_slice(), cx, retval, can_gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/resize-observer/#dom-resizeobserverentry-contentboxsize>
|
/// <https://drafts.csswg.org/resize-observer/#dom-resizeobserverentry-contentboxsize>
|
||||||
fn ContentBoxSize(&self, cx: SafeJSContext, retval: MutableHandleValue) {
|
fn ContentBoxSize(&self, cx: SafeJSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
let sizes: Vec<DomRoot<ResizeObserverSize>> = self
|
let sizes: Vec<DomRoot<ResizeObserverSize>> = self
|
||||||
.content_box_size
|
.content_box_size
|
||||||
.iter()
|
.iter()
|
||||||
.map(|size| DomRoot::from_ref(&**size))
|
.map(|size| DomRoot::from_ref(&**size))
|
||||||
.collect();
|
.collect();
|
||||||
to_frozen_array(sizes.as_slice(), cx, retval);
|
to_frozen_array(sizes.as_slice(), cx, retval, can_gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/resize-observer/#dom-resizeobserverentry-devicepixelcontentboxsize>
|
/// <https://drafts.csswg.org/resize-observer/#dom-resizeobserverentry-devicepixelcontentboxsize>
|
||||||
fn DevicePixelContentBoxSize(&self, cx: SafeJSContext, retval: MutableHandleValue) {
|
fn DevicePixelContentBoxSize(
|
||||||
|
&self,
|
||||||
|
cx: SafeJSContext,
|
||||||
|
can_gc: CanGc,
|
||||||
|
retval: MutableHandleValue,
|
||||||
|
) {
|
||||||
let sizes: Vec<DomRoot<ResizeObserverSize>> = self
|
let sizes: Vec<DomRoot<ResizeObserverSize>> = self
|
||||||
.device_pixel_content_box_size
|
.device_pixel_content_box_size
|
||||||
.iter()
|
.iter()
|
||||||
.map(|size| DomRoot::from_ref(&**size))
|
.map(|size| DomRoot::from_ref(&**size))
|
||||||
.collect();
|
.collect();
|
||||||
to_frozen_array(sizes.as_slice(), cx, retval);
|
to_frozen_array(sizes.as_slice(), cx, retval, can_gc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ impl GPUCompilationInfo {
|
||||||
|
|
||||||
impl GPUCompilationInfoMethods<crate::DomTypeHolder> for GPUCompilationInfo {
|
impl GPUCompilationInfoMethods<crate::DomTypeHolder> for GPUCompilationInfo {
|
||||||
/// <https://gpuweb.github.io/gpuweb/#dom-gpucompilationinfo-messages>
|
/// <https://gpuweb.github.io/gpuweb/#dom-gpucompilationinfo-messages>
|
||||||
fn Messages(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Messages(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
to_frozen_array(self.msg.as_slice(), cx, retval)
|
to_frozen_array(self.msg.as_slice(), cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,9 +85,9 @@ impl XRBoundedReferenceSpaceMethods<crate::DomTypeHolder> for XRBoundedReference
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
to_frozen_array(&points, cx, retval)
|
to_frozen_array(&points, cx, retval, can_gc)
|
||||||
} else {
|
} else {
|
||||||
to_frozen_array::<DomRoot<DOMPointReadOnly>>(&[], cx, retval)
|
to_frozen_array::<DomRoot<DOMPointReadOnly>>(&[], cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,9 +88,9 @@ impl XRInputSourcesChangeEvent {
|
||||||
let _ac = enter_realm(global);
|
let _ac = enter_realm(global);
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
rooted!(in(*cx) let mut frozen_val: JSVal);
|
rooted!(in(*cx) let mut frozen_val: JSVal);
|
||||||
to_frozen_array(added, cx, frozen_val.handle_mut());
|
to_frozen_array(added, cx, frozen_val.handle_mut(), can_gc);
|
||||||
changeevent.added.set(*frozen_val);
|
changeevent.added.set(*frozen_val);
|
||||||
to_frozen_array(removed, cx, frozen_val.handle_mut());
|
to_frozen_array(removed, cx, frozen_val.handle_mut(), can_gc);
|
||||||
changeevent.removed.set(*frozen_val);
|
changeevent.removed.set(*frozen_val);
|
||||||
changeevent
|
changeevent
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,10 +149,10 @@ impl XRRenderStateMethods<crate::DomTypeHolder> for XRRenderState {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://immersive-web.github.io/layers/#dom-xrrenderstate-layers>
|
/// <https://immersive-web.github.io/layers/#dom-xrrenderstate-layers>
|
||||||
fn Layers(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Layers(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
// TODO: cache this array?
|
// TODO: cache this array?
|
||||||
let layers = self.layers.borrow();
|
let layers = self.layers.borrow();
|
||||||
let layers: Vec<&XRLayer> = layers.iter().map(|x| &**x).collect();
|
let layers: Vec<&XRLayer> = layers.iter().map(|x| &**x).collect();
|
||||||
to_frozen_array(&layers[..], cx, retval)
|
to_frozen_array(&layers[..], cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1006,10 +1006,10 @@ impl XRSessionMethods<crate::DomTypeHolder> for XRSession {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://www.w3.org/TR/webxr/#dom-xrsession-enabledfeatures>
|
/// <https://www.w3.org/TR/webxr/#dom-xrsession-enabledfeatures>
|
||||||
fn EnabledFeatures(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn EnabledFeatures(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
let session = self.session.borrow();
|
let session = self.session.borrow();
|
||||||
let features = session.granted_features();
|
let features = session.granted_features();
|
||||||
to_frozen_array(features, cx, retval)
|
to_frozen_array(features, cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://www.w3.org/TR/webxr/#dom-xrsession-issystemkeyboardsupported>
|
/// <https://www.w3.org/TR/webxr/#dom-xrsession-issystemkeyboardsupported>
|
||||||
|
|
|
@ -100,8 +100,8 @@ impl WorkerNavigatorMethods<crate::DomTypeHolder> for WorkerNavigator {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-languages
|
// https://html.spec.whatwg.org/multipage/#dom-navigator-languages
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn Languages(&self, cx: JSContext, retval: MutableHandleValue) {
|
fn Languages(&self, cx: JSContext, can_gc: CanGc, retval: MutableHandleValue) {
|
||||||
to_frozen_array(&[self.Language()], cx, retval)
|
to_frozen_array(&[self.Language()], cx, retval, can_gc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://w3c.github.io/permissions/#navigator-and-workernavigator-extension
|
// https://w3c.github.io/permissions/#navigator-and-workernavigator-extension
|
||||||
|
|
|
@ -99,6 +99,10 @@ DOMInterfaces = {
|
||||||
'canGc': ['AppendRule', 'CssRules', 'DeleteRule', 'FindRule'],
|
'canGc': ['AppendRule', 'CssRules', 'DeleteRule', 'FindRule'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'CSSLayerStatementRule': {
|
||||||
|
'canGc': ['NameList'],
|
||||||
|
},
|
||||||
|
|
||||||
'CSSMediaRule': {
|
'CSSMediaRule': {
|
||||||
'canGc': ['Media'],
|
'canGc': ['Media'],
|
||||||
},
|
},
|
||||||
|
@ -121,7 +125,7 @@ DOMInterfaces = {
|
||||||
},
|
},
|
||||||
|
|
||||||
'DataTransfer': {
|
'DataTransfer': {
|
||||||
'canGc': ['Files']
|
'canGc': ['Files', 'Types']
|
||||||
},
|
},
|
||||||
|
|
||||||
'DataTransferItem': {
|
'DataTransferItem': {
|
||||||
|
@ -201,6 +205,10 @@ DOMInterfaces = {
|
||||||
'canGc': ['DispatchEvent'],
|
'canGc': ['DispatchEvent'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'ExtendableMessageEvent': {
|
||||||
|
'canGc': ['Ports'],
|
||||||
|
},
|
||||||
|
|
||||||
'FakeXRDevice': {
|
'FakeXRDevice': {
|
||||||
'canGc': ['Disconnect'],
|
'canGc': ['Disconnect'],
|
||||||
},
|
},
|
||||||
|
@ -224,7 +232,7 @@ DOMInterfaces = {
|
||||||
|
|
||||||
'GamepadHapticActuator': {
|
'GamepadHapticActuator': {
|
||||||
'inRealms': ['PlayEffect', 'Reset'],
|
'inRealms': ['PlayEffect', 'Reset'],
|
||||||
'canGc': ['PlayEffect', 'Reset'],
|
'canGc': ['PlayEffect', 'Reset', 'Effects'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'GlobalScope': {
|
'GlobalScope': {
|
||||||
|
@ -250,6 +258,10 @@ DOMInterfaces = {
|
||||||
'weakReferenceable': True,
|
'weakReferenceable': True,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'GPUCompilationInfo': {
|
||||||
|
'canGc': ['Messages'],
|
||||||
|
},
|
||||||
|
|
||||||
'GPUDevice': {
|
'GPUDevice': {
|
||||||
'inRealms': [
|
'inRealms': [
|
||||||
'CreateComputePipelineAsync',
|
'CreateComputePipelineAsync',
|
||||||
|
@ -387,6 +399,10 @@ DOMInterfaces = {
|
||||||
'canGc': ['SetText']
|
'canGc': ['SetText']
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'IntersectionObserver': {
|
||||||
|
'canGc': ['Thresholds']
|
||||||
|
},
|
||||||
|
|
||||||
'Location': {
|
'Location': {
|
||||||
'canGc': ['Assign', 'Reload', 'Replace', 'SetHash', 'SetHost', 'SetHostname', 'SetHref', 'SetPathname', 'SetPort', 'SetProtocol', 'SetSearch'],
|
'canGc': ['Assign', 'Reload', 'Replace', 'SetHash', 'SetHost', 'SetHostname', 'SetHref', 'SetPathname', 'SetPort', 'SetProtocol', 'SetSearch'],
|
||||||
},
|
},
|
||||||
|
@ -413,6 +429,10 @@ DOMInterfaces = {
|
||||||
'canGc': ['GetOnmessage'],
|
'canGc': ['GetOnmessage'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'MessageEvent': {
|
||||||
|
'canGc': ['Ports'],
|
||||||
|
},
|
||||||
|
|
||||||
'MouseEvent': {
|
'MouseEvent': {
|
||||||
'canGc': ['OffsetX', 'OffsetY'],
|
'canGc': ['OffsetX', 'OffsetY'],
|
||||||
},
|
},
|
||||||
|
@ -424,6 +444,7 @@ DOMInterfaces = {
|
||||||
|
|
||||||
'Navigator': {
|
'Navigator': {
|
||||||
'inRealms': ['GetVRDisplays'],
|
'inRealms': ['GetVRDisplays'],
|
||||||
|
'canGc': ['Languages'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'Node': {
|
'Node': {
|
||||||
|
@ -435,7 +456,7 @@ DOMInterfaces = {
|
||||||
},
|
},
|
||||||
|
|
||||||
'Notification': {
|
'Notification': {
|
||||||
'canGc': ['RequestPermission'],
|
'canGc': ['RequestPermission', 'Actions', 'Vibrate'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'OfflineAudioContext': {
|
'OfflineAudioContext': {
|
||||||
|
@ -459,6 +480,10 @@ DOMInterfaces = {
|
||||||
'canGc': ['Mark', 'Measure'],
|
'canGc': ['Mark', 'Measure'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'PerformanceObserver': {
|
||||||
|
'canGc': ['SupportedEntryTypes'],
|
||||||
|
},
|
||||||
|
|
||||||
'Permissions': {
|
'Permissions': {
|
||||||
'canGc': ['Query', 'Request', 'Revoke'],
|
'canGc': ['Query', 'Request', 'Revoke'],
|
||||||
},
|
},
|
||||||
|
@ -609,13 +634,17 @@ DOMInterfaces = {
|
||||||
'canGc': ['GetOffsetReferenceSpace'],
|
'canGc': ['GetOffsetReferenceSpace'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'XRRenderState': {
|
||||||
|
'canGc': ['Layers'],
|
||||||
|
},
|
||||||
|
|
||||||
'XRRigidTransform': {
|
'XRRigidTransform': {
|
||||||
'canGc': ['Position', 'Orientation', 'Inverse', 'Matrix'],
|
'canGc': ['Position', 'Orientation', 'Inverse', 'Matrix'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'XRSession': {
|
'XRSession': {
|
||||||
'inRealms': ['RequestReferenceSpace', 'UpdateRenderState', 'UpdateTargetFrameRate'],
|
'inRealms': ['RequestReferenceSpace', 'UpdateRenderState', 'UpdateTargetFrameRate'],
|
||||||
'canGc': ['End', 'RequestReferenceSpace', 'UpdateTargetFrameRate', 'RequestHitTestSource', 'GetSupportedFrameRates'],
|
'canGc': ['End', 'RequestReferenceSpace', 'UpdateTargetFrameRate', 'RequestHitTestSource', 'GetSupportedFrameRates', 'EnabledFeatures'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'XRSystem': {
|
'XRSystem': {
|
||||||
|
@ -656,6 +685,10 @@ DOMInterfaces = {
|
||||||
"canGc": ["Cancel", "Read", "ReleaseLock"]
|
"canGc": ["Cancel", "Read", "ReleaseLock"]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'ResizeObserverEntry': {
|
||||||
|
'canGc': ['BorderBoxSize', 'ContentBoxSize', 'DevicePixelContentBoxSize'],
|
||||||
|
},
|
||||||
|
|
||||||
'WritableStream': {
|
'WritableStream': {
|
||||||
'canGc': ['Abort', 'Close', 'GetWriter'],
|
'canGc': ['Abort', 'Close', 'GetWriter'],
|
||||||
'inRealms': ['Abort', 'Close', 'GetWriter'],
|
'inRealms': ['Abort', 'Close', 'GetWriter'],
|
||||||
|
@ -671,6 +704,10 @@ DOMInterfaces = {
|
||||||
'inRealms': ['Abort', 'Close', 'Write'],
|
'inRealms': ['Abort', 'Close', 'Write'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'WorkerNavigator': {
|
||||||
|
'canGc': ['Languages'],
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionaries = {
|
Dictionaries = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue