mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
More files with CanGc fixes (#33892)
* More files with CanGc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * removed the can_gc inside !task Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
fde8d72aca
commit
af6154cf63
31 changed files with 226 additions and 100 deletions
|
@ -145,7 +145,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'HTMLCanvasElement': {
|
||||
'canGc': ['CaptureStream'],
|
||||
'canGc': ['CaptureStream', 'GetContext'],
|
||||
},
|
||||
|
||||
'HTMLTemplateElement': {
|
||||
|
@ -245,7 +245,7 @@ DOMInterfaces = {
|
|||
|
||||
'URL': {
|
||||
'weakReferenceable': True,
|
||||
'canGc': ['Parse'],
|
||||
'canGc': ['Parse', 'SearchParams'],
|
||||
},
|
||||
|
||||
'VRDisplay': {
|
||||
|
@ -277,7 +277,7 @@ DOMInterfaces = {
|
|||
|
||||
'XRSession': {
|
||||
'inRealms': ['RequestReferenceSpace', 'UpdateRenderState', 'UpdateTargetFrameRate'],
|
||||
'canGc': ['End'],
|
||||
'canGc': ['End', 'RequestReferenceSpace'],
|
||||
},
|
||||
|
||||
'XRSystem': {
|
||||
|
@ -293,7 +293,19 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'XRRigidTransform': {
|
||||
'canGc': ['Position', 'Orientation'],
|
||||
'canGc': ['Position', 'Orientation', 'Inverse'],
|
||||
},
|
||||
|
||||
'XRReferenceSpace': {
|
||||
'canGc': ['GetOffsetReferenceSpace'],
|
||||
},
|
||||
|
||||
'XRFrame': {
|
||||
'canGc': ['GetViewerPose', 'GetPose', 'GetJointPose'],
|
||||
},
|
||||
|
||||
'XRHitTestResult': {
|
||||
'canGc': ['GetPose'],
|
||||
},
|
||||
|
||||
'SubtleCrypto': {
|
||||
|
|
|
@ -212,8 +212,8 @@ impl WorkerEventLoopMethods for DedicatedWorkerGlobalScope {
|
|||
&self.task_queue
|
||||
}
|
||||
|
||||
fn handle_event(&self, event: MixedMessage, _can_gc: CanGc) -> bool {
|
||||
self.handle_mixed_message(event)
|
||||
fn handle_event(&self, event: MixedMessage, can_gc: CanGc) -> bool {
|
||||
self.handle_mixed_message(event, can_gc)
|
||||
}
|
||||
|
||||
fn handle_worker_post_event(&self, worker: &TrustedWorkerAddress) -> Option<AutoWorkerReset> {
|
||||
|
@ -512,7 +512,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
(chan, Box::new(rx))
|
||||
}
|
||||
|
||||
fn handle_script_event(&self, msg: WorkerScriptMsg) {
|
||||
fn handle_script_event(&self, msg: WorkerScriptMsg, can_gc: CanGc) {
|
||||
match msg {
|
||||
WorkerScriptMsg::DOMMessage { origin, data } => {
|
||||
let scope = self.upcast::<WorkerGlobalScope>();
|
||||
|
@ -528,9 +528,10 @@ impl DedicatedWorkerGlobalScope {
|
|||
Some(&origin.ascii_serialization()),
|
||||
None,
|
||||
ports,
|
||||
can_gc,
|
||||
);
|
||||
} else {
|
||||
MessageEvent::dispatch_error(target, scope.upcast());
|
||||
MessageEvent::dispatch_error(target, scope.upcast(), can_gc);
|
||||
}
|
||||
},
|
||||
WorkerScriptMsg::Common(msg) => {
|
||||
|
@ -539,7 +540,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
}
|
||||
}
|
||||
|
||||
fn handle_mixed_message(&self, msg: MixedMessage) -> bool {
|
||||
fn handle_mixed_message(&self, msg: MixedMessage, can_gc: CanGc) -> bool {
|
||||
// FIXME(#26324): `self.worker` is None in devtools messages.
|
||||
match msg {
|
||||
MixedMessage::Devtools(msg) => match msg {
|
||||
|
@ -553,7 +554,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
},
|
||||
MixedMessage::Worker(DedicatedWorkerScriptMsg::CommonWorker(linked_worker, msg)) => {
|
||||
let _ar = AutoWorkerReset::new(self, linked_worker);
|
||||
self.handle_script_event(msg);
|
||||
self.handle_script_event(msg, can_gc);
|
||||
},
|
||||
MixedMessage::Worker(DedicatedWorkerScriptMsg::WakeUp) => {},
|
||||
MixedMessage::Control(DedicatedWorkerControlMsg::Exit) => {
|
||||
|
@ -614,7 +615,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
let global_scope = self.upcast::<GlobalScope>();
|
||||
let pipeline_id = global_scope.pipeline_id();
|
||||
let task = Box::new(task!(post_worker_message: move || {
|
||||
Worker::handle_message(worker, data);
|
||||
Worker::handle_message(worker, data, CanGc::note());
|
||||
}));
|
||||
self.parent_sender
|
||||
.send(CommonScriptMsg::Task(
|
||||
|
|
|
@ -4687,6 +4687,7 @@ impl DocumentMethods for Document {
|
|||
))),
|
||||
"messageevent" => Ok(DomRoot::upcast(MessageEvent::new_uninitialized(
|
||||
self.window.upcast(),
|
||||
can_gc,
|
||||
))),
|
||||
"mouseevent" | "mouseevents" => Ok(DomRoot::upcast(MouseEvent::new_uninitialized(
|
||||
&self.window,
|
||||
|
|
|
@ -207,7 +207,7 @@ impl EventSourceContext {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dispatchMessage
|
||||
#[allow(unsafe_code)]
|
||||
fn dispatch_event(&mut self) {
|
||||
fn dispatch_event(&mut self, can_gc: CanGc) {
|
||||
let event_source = self.event_source.root();
|
||||
// Step 1
|
||||
*event_source.last_event_id.borrow_mut() = DOMString::from(self.last_event_id.clone());
|
||||
|
@ -247,6 +247,7 @@ impl EventSourceContext {
|
|||
None,
|
||||
event_source.last_event_id.borrow().clone(),
|
||||
Vec::with_capacity(0),
|
||||
can_gc,
|
||||
)
|
||||
};
|
||||
// Step 7
|
||||
|
@ -270,7 +271,7 @@ impl EventSourceContext {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#event-stream-interpretation
|
||||
fn parse(&mut self, stream: Chars) {
|
||||
fn parse(&mut self, stream: Chars, can_gc: CanGc) {
|
||||
let mut stream = stream.peekable();
|
||||
|
||||
while let Some(ch) = stream.next() {
|
||||
|
@ -307,12 +308,12 @@ impl EventSourceContext {
|
|||
self.process_field();
|
||||
},
|
||||
|
||||
('\n', &ParserState::Eol) => self.dispatch_event(),
|
||||
('\n', &ParserState::Eol) => self.dispatch_event(can_gc),
|
||||
('\r', &ParserState::Eol) => {
|
||||
if let Some(&'\n') = stream.peek() {
|
||||
continue;
|
||||
}
|
||||
self.dispatch_event();
|
||||
self.dispatch_event(can_gc);
|
||||
},
|
||||
|
||||
('\n', &ParserState::Comment) => self.parser_state = ParserState::Eol,
|
||||
|
@ -384,7 +385,7 @@ impl FetchResponseListener for EventSourceContext {
|
|||
match incomplete.try_complete(input) {
|
||||
None => return,
|
||||
Some((result, remaining_input)) => {
|
||||
self.parse(result.unwrap_or("\u{FFFD}").chars());
|
||||
self.parse(result.unwrap_or("\u{FFFD}").chars(), CanGc::note());
|
||||
input = remaining_input;
|
||||
},
|
||||
}
|
||||
|
@ -393,7 +394,7 @@ impl FetchResponseListener for EventSourceContext {
|
|||
while !input.is_empty() {
|
||||
match utf8::decode(input) {
|
||||
Ok(s) => {
|
||||
self.parse(s.chars());
|
||||
self.parse(s.chars(), CanGc::note());
|
||||
return;
|
||||
},
|
||||
Err(utf8::DecodeError::Invalid {
|
||||
|
@ -401,15 +402,15 @@ impl FetchResponseListener for EventSourceContext {
|
|||
remaining_input,
|
||||
..
|
||||
}) => {
|
||||
self.parse(valid_prefix.chars());
|
||||
self.parse("\u{FFFD}".chars());
|
||||
self.parse(valid_prefix.chars(), CanGc::note());
|
||||
self.parse("\u{FFFD}".chars(), CanGc::note());
|
||||
input = remaining_input;
|
||||
},
|
||||
Err(utf8::DecodeError::Incomplete {
|
||||
valid_prefix,
|
||||
incomplete_suffix,
|
||||
}) => {
|
||||
self.parse(valid_prefix.chars());
|
||||
self.parse(valid_prefix.chars(), CanGc::note());
|
||||
self.incomplete_utf8 = Some(incomplete_suffix);
|
||||
return;
|
||||
},
|
||||
|
@ -423,7 +424,7 @@ impl FetchResponseListener for EventSourceContext {
|
|||
_response: Result<ResourceFetchTiming, NetworkError>,
|
||||
) {
|
||||
if self.incomplete_utf8.take().is_some() {
|
||||
self.parse("\u{FFFD}".chars());
|
||||
self.parse("\u{FFFD}".chars(), CanGc::note());
|
||||
}
|
||||
self.reestablish_the_connection();
|
||||
}
|
||||
|
|
|
@ -597,7 +597,7 @@ impl MessageListener {
|
|||
let _ = self.task_source.queue_with_canceller(
|
||||
task!(process_new_task: move || {
|
||||
let global = context.root();
|
||||
global.route_task_to_port(port_id, task);
|
||||
global.route_task_to_port(port_id, task, CanGc::note());
|
||||
}),
|
||||
&self.canceller,
|
||||
);
|
||||
|
@ -1087,7 +1087,7 @@ impl GlobalScope {
|
|||
let _ = self.port_message_queue().queue(
|
||||
task!(process_pending_port_messages: move || {
|
||||
let target_global = this.root();
|
||||
target_global.route_task_to_port(port_id, task);
|
||||
target_global.route_task_to_port(port_id, task, CanGc::note());
|
||||
}),
|
||||
self,
|
||||
);
|
||||
|
@ -1143,7 +1143,7 @@ impl GlobalScope {
|
|||
let global = this.root();
|
||||
// Note: we do this in a task, as this will ensure the global and constellation
|
||||
// are aware of any transfer that might still take place in the current task.
|
||||
global.route_task_to_port(entangled_id, task);
|
||||
global.route_task_to_port(entangled_id, task, CanGc::note());
|
||||
}),
|
||||
self,
|
||||
);
|
||||
|
@ -1257,10 +1257,11 @@ impl GlobalScope {
|
|||
Some(&origin.ascii_serialization()),
|
||||
None,
|
||||
ports,
|
||||
CanGc::note()
|
||||
);
|
||||
} else {
|
||||
// Step 10.3, fire an event named messageerror at destination.
|
||||
MessageEvent::dispatch_error(destination.upcast(), &global);
|
||||
MessageEvent::dispatch_error(destination.upcast(), &global, CanGc::note());
|
||||
}
|
||||
}),
|
||||
self,
|
||||
|
@ -1271,7 +1272,7 @@ impl GlobalScope {
|
|||
}
|
||||
|
||||
/// Route the task to be handled by the relevant port.
|
||||
pub fn route_task_to_port(&self, port_id: MessagePortId, task: PortMessageTask) {
|
||||
pub fn route_task_to_port(&self, port_id: MessagePortId, task: PortMessageTask, can_gc: CanGc) {
|
||||
let should_dispatch = if let MessagePortState::Managed(_id, message_ports) =
|
||||
&mut *self.message_port_state.borrow_mut()
|
||||
{
|
||||
|
@ -1310,10 +1311,11 @@ impl GlobalScope {
|
|||
Some(&origin.ascii_serialization()),
|
||||
None,
|
||||
ports,
|
||||
can_gc,
|
||||
);
|
||||
} else {
|
||||
// Step 4, fire messageerror event.
|
||||
MessageEvent::dispatch_error(dom_port.upcast(), self);
|
||||
MessageEvent::dispatch_error(dom_port.upcast(), self, can_gc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,6 +197,7 @@ impl HTMLCanvasElement {
|
|||
&self,
|
||||
cx: JSContext,
|
||||
options: HandleValue,
|
||||
can_gc: CanGc,
|
||||
) -> Option<DomRoot<WebGLRenderingContext>> {
|
||||
if let Some(ctx) = self.context() {
|
||||
return match *ctx {
|
||||
|
@ -208,8 +209,14 @@ impl HTMLCanvasElement {
|
|||
let size = self.get_size();
|
||||
let attrs = Self::get_gl_attributes(cx, options)?;
|
||||
let canvas = HTMLCanvasElementOrOffscreenCanvas::HTMLCanvasElement(DomRoot::from_ref(self));
|
||||
let context =
|
||||
WebGLRenderingContext::new(&window, &canvas, WebGLVersion::WebGL1, size, attrs)?;
|
||||
let context = WebGLRenderingContext::new(
|
||||
&window,
|
||||
&canvas,
|
||||
WebGLVersion::WebGL1,
|
||||
size,
|
||||
attrs,
|
||||
can_gc,
|
||||
)?;
|
||||
*self.context.borrow_mut() = Some(CanvasContext::WebGL(Dom::from_ref(&*context)));
|
||||
Some(context)
|
||||
}
|
||||
|
@ -218,6 +225,7 @@ impl HTMLCanvasElement {
|
|||
&self,
|
||||
cx: JSContext,
|
||||
options: HandleValue,
|
||||
can_gc: CanGc,
|
||||
) -> Option<DomRoot<WebGL2RenderingContext>> {
|
||||
if !WebGL2RenderingContext::is_webgl2_enabled(cx, self.global().reflector().get_jsobject())
|
||||
{
|
||||
|
@ -233,7 +241,7 @@ impl HTMLCanvasElement {
|
|||
let size = self.get_size();
|
||||
let attrs = Self::get_gl_attributes(cx, options)?;
|
||||
let canvas = HTMLCanvasElementOrOffscreenCanvas::HTMLCanvasElement(DomRoot::from_ref(self));
|
||||
let context = WebGL2RenderingContext::new(&window, &canvas, size, attrs)?;
|
||||
let context = WebGL2RenderingContext::new(&window, &canvas, size, attrs, can_gc)?;
|
||||
*self.context.borrow_mut() = Some(CanvasContext::WebGL2(Dom::from_ref(&*context)));
|
||||
Some(context)
|
||||
}
|
||||
|
@ -348,16 +356,17 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
|
|||
cx: JSContext,
|
||||
id: DOMString,
|
||||
options: HandleValue,
|
||||
can_gc: CanGc,
|
||||
) -> Option<RenderingContext> {
|
||||
match &*id {
|
||||
"2d" => self
|
||||
.get_or_init_2d_context()
|
||||
.map(RenderingContext::CanvasRenderingContext2D),
|
||||
"webgl" | "experimental-webgl" => self
|
||||
.get_or_init_webgl_context(cx, options)
|
||||
.get_or_init_webgl_context(cx, options, can_gc)
|
||||
.map(RenderingContext::WebGLRenderingContext),
|
||||
"webgl2" | "experimental-webgl2" => self
|
||||
.get_or_init_webgl2_context(cx, options)
|
||||
.get_or_init_webgl2_context(cx, options, can_gc)
|
||||
.map(RenderingContext::WebGL2RenderingContext),
|
||||
"webgpu" => self
|
||||
.get_or_init_webgpu_context()
|
||||
|
|
|
@ -759,6 +759,7 @@ impl HTMLFormElement {
|
|||
true,
|
||||
true,
|
||||
submitter_button.map(DomRoot::from_ref),
|
||||
can_gc,
|
||||
);
|
||||
let event = event.upcast::<Event>();
|
||||
event.fire(self.upcast::<EventTarget>());
|
||||
|
|
|
@ -91,8 +91,8 @@ impl MessageEvent {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<MessageEvent> {
|
||||
Self::new_uninitialized_with_proto(global, None, CanGc::note())
|
||||
pub fn new_uninitialized(global: &GlobalScope, can_gc: CanGc) -> DomRoot<MessageEvent> {
|
||||
Self::new_uninitialized_with_proto(global, None, can_gc)
|
||||
}
|
||||
|
||||
fn new_uninitialized_with_proto(
|
||||
|
@ -146,6 +146,7 @@ impl MessageEvent {
|
|||
source: Option<&WindowProxyOrMessagePortOrServiceWorker>,
|
||||
lastEventId: DOMString,
|
||||
ports: Vec<DomRoot<MessagePort>>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<MessageEvent> {
|
||||
Self::new_with_proto(
|
||||
global,
|
||||
|
@ -158,7 +159,7 @@ impl MessageEvent {
|
|||
source,
|
||||
lastEventId,
|
||||
ports,
|
||||
CanGc::note(),
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -200,6 +201,7 @@ impl MessageEvent {
|
|||
origin: Option<&str>,
|
||||
source: Option<&WindowProxy>,
|
||||
ports: Vec<DomRoot<MessagePort>>,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
let messageevent = MessageEvent::new(
|
||||
scope,
|
||||
|
@ -215,11 +217,12 @@ impl MessageEvent {
|
|||
.as_ref(),
|
||||
DOMString::new(),
|
||||
ports,
|
||||
can_gc,
|
||||
);
|
||||
messageevent.upcast::<Event>().fire(target);
|
||||
}
|
||||
|
||||
pub fn dispatch_error(target: &EventTarget, scope: &GlobalScope) {
|
||||
pub fn dispatch_error(target: &EventTarget, scope: &GlobalScope, can_gc: CanGc) {
|
||||
let init = MessageEventBinding::MessageEventInit::empty();
|
||||
let messageevent = MessageEvent::new(
|
||||
scope,
|
||||
|
@ -231,6 +234,7 @@ impl MessageEvent {
|
|||
init.source.as_ref(),
|
||||
init.lastEventId.clone(),
|
||||
init.ports.clone(),
|
||||
can_gc,
|
||||
);
|
||||
messageevent.upcast::<Event>().fire(target);
|
||||
}
|
||||
|
|
|
@ -199,6 +199,7 @@ impl RTCDataChannel {
|
|||
Some(&global.origin().immutable().ascii_serialization()),
|
||||
None,
|
||||
vec![],
|
||||
can_gc,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,16 +40,9 @@ impl RTCDataChannelEvent {
|
|||
bubbles: bool,
|
||||
cancelable: bool,
|
||||
channel: &RTCDataChannel,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<RTCDataChannelEvent> {
|
||||
Self::new_with_proto(
|
||||
global,
|
||||
None,
|
||||
type_,
|
||||
bubbles,
|
||||
cancelable,
|
||||
channel,
|
||||
CanGc::note(),
|
||||
)
|
||||
Self::new_with_proto(global, None, type_, bubbles, cancelable, channel, can_gc)
|
||||
}
|
||||
|
||||
fn new_with_proto(
|
||||
|
|
|
@ -47,6 +47,7 @@ impl RTCIceCandidate {
|
|||
sdp_m_id: Option<DOMString>,
|
||||
sdp_m_line_index: Option<u16>,
|
||||
username_fragment: Option<DOMString>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<RTCIceCandidate> {
|
||||
Self::new_with_proto(
|
||||
global,
|
||||
|
@ -55,7 +56,7 @@ impl RTCIceCandidate {
|
|||
sdp_m_id,
|
||||
sdp_m_line_index,
|
||||
username_fragment,
|
||||
CanGc::note(),
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -259,6 +259,7 @@ impl RTCPeerConnection {
|
|||
None,
|
||||
Some(candidate.sdp_mline_index as u16),
|
||||
None,
|
||||
can_gc,
|
||||
);
|
||||
let event = RTCPeerConnectionIceEvent::new(
|
||||
&self.global(),
|
||||
|
@ -327,6 +328,7 @@ impl RTCPeerConnection {
|
|||
false,
|
||||
false,
|
||||
&channel,
|
||||
can_gc,
|
||||
);
|
||||
event.upcast::<Event>().fire(self.upcast());
|
||||
},
|
||||
|
|
|
@ -40,16 +40,9 @@ impl SubmitEvent {
|
|||
bubbles: bool,
|
||||
cancelable: bool,
|
||||
submitter: Option<DomRoot<HTMLElement>>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<SubmitEvent> {
|
||||
Self::new_with_proto(
|
||||
global,
|
||||
None,
|
||||
type_,
|
||||
bubbles,
|
||||
cancelable,
|
||||
submitter,
|
||||
CanGc::note(),
|
||||
)
|
||||
Self::new_with_proto(global, None, type_, bubbles, cancelable, submitter, can_gc)
|
||||
}
|
||||
|
||||
fn new_with_proto(
|
||||
|
|
|
@ -318,9 +318,9 @@ impl URLMethods for URL {
|
|||
}
|
||||
|
||||
/// <https://url.spec.whatwg.org/#dom-url-searchparams>
|
||||
fn SearchParams(&self) -> DomRoot<URLSearchParams> {
|
||||
fn SearchParams(&self, can_gc: CanGc) -> DomRoot<URLSearchParams> {
|
||||
self.search_params
|
||||
.or_init(|| URLSearchParams::new(&self.global(), Some(self)))
|
||||
.or_init(|| URLSearchParams::new(&self.global(), Some(self), can_gc))
|
||||
}
|
||||
|
||||
/// <https://url.spec.whatwg.org/#dom-url-username>
|
||||
|
|
|
@ -38,8 +38,8 @@ impl URLSearchParams {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, url: Option<&URL>) -> DomRoot<URLSearchParams> {
|
||||
Self::new_with_proto(global, None, url, CanGc::note())
|
||||
pub fn new(global: &GlobalScope, url: Option<&URL>, can_gc: CanGc) -> DomRoot<URLSearchParams> {
|
||||
Self::new_with_proto(global, None, url, can_gc)
|
||||
}
|
||||
|
||||
pub fn new_with_proto(
|
||||
|
|
|
@ -69,7 +69,7 @@ use crate::dom::webgluniformlocation::WebGLUniformLocation;
|
|||
use crate::dom::webglvertexarrayobject::WebGLVertexArrayObject;
|
||||
use crate::dom::window::Window;
|
||||
use crate::js::conversions::ToJSValConvertible;
|
||||
use crate::script_runtime::JSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
||||
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
|
@ -143,8 +143,10 @@ impl WebGL2RenderingContext {
|
|||
canvas: &HTMLCanvasElementOrOffscreenCanvas,
|
||||
size: Size2D<u32>,
|
||||
attrs: GLContextAttributes,
|
||||
can_gc: CanGc,
|
||||
) -> Option<WebGL2RenderingContext> {
|
||||
let base = WebGLRenderingContext::new(window, canvas, WebGLVersion::WebGL2, size, attrs)?;
|
||||
let base =
|
||||
WebGLRenderingContext::new(window, canvas, WebGLVersion::WebGL2, size, attrs, can_gc)?;
|
||||
|
||||
let samplers = (0..base.limits().max_combined_texture_image_units)
|
||||
.map(|_| Default::default())
|
||||
|
@ -190,8 +192,9 @@ impl WebGL2RenderingContext {
|
|||
canvas: &HTMLCanvasElementOrOffscreenCanvas,
|
||||
size: Size2D<u32>,
|
||||
attrs: GLContextAttributes,
|
||||
can_gc: CanGc,
|
||||
) -> Option<DomRoot<WebGL2RenderingContext>> {
|
||||
WebGL2RenderingContext::new_inherited(window, canvas, size, attrs)
|
||||
WebGL2RenderingContext::new_inherited(window, canvas, size, attrs, can_gc)
|
||||
.map(|ctx| reflect_dom_object(Box::new(ctx), window))
|
||||
}
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ impl WebGLContextEvent {
|
|||
bubbles: EventBubbles,
|
||||
cancelable: EventCancelable,
|
||||
status_message: DOMString,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<WebGLContextEvent> {
|
||||
Self::new_with_proto(
|
||||
window,
|
||||
|
@ -87,7 +88,7 @@ impl WebGLContextEvent {
|
|||
bubbles,
|
||||
cancelable,
|
||||
status_message,
|
||||
CanGc::note(),
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ use crate::dom::webgluniformlocation::WebGLUniformLocation;
|
|||
use crate::dom::webglvertexarrayobject::WebGLVertexArrayObject;
|
||||
use crate::dom::webglvertexarrayobjectoes::WebGLVertexArrayObjectOES;
|
||||
use crate::dom::window::Window;
|
||||
use crate::script_runtime::JSContext as SafeJSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext as SafeJSContext};
|
||||
|
||||
// From the GLES 2.0.25 spec, page 85:
|
||||
//
|
||||
|
@ -288,6 +288,7 @@ impl WebGLRenderingContext {
|
|||
webgl_version: WebGLVersion,
|
||||
size: Size2D<u32>,
|
||||
attrs: GLContextAttributes,
|
||||
can_gc: CanGc,
|
||||
) -> Option<DomRoot<WebGLRenderingContext>> {
|
||||
match WebGLRenderingContext::new_inherited(window, canvas, webgl_version, size, attrs) {
|
||||
Ok(ctx) => Some(reflect_dom_object(Box::new(ctx), window)),
|
||||
|
@ -299,6 +300,7 @@ impl WebGLRenderingContext {
|
|||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::Cancelable,
|
||||
DOMString::from(msg),
|
||||
can_gc,
|
||||
);
|
||||
match canvas {
|
||||
HTMLCanvasElementOrOffscreenCanvas::HTMLCanvasElement(canvas) => {
|
||||
|
|
|
@ -603,6 +603,7 @@ impl TaskOnce for MessageReceivedTask {
|
|||
Some(&ws.origin().ascii_serialization()),
|
||||
None,
|
||||
vec![],
|
||||
CanGc::note(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2782,12 +2782,14 @@ impl Window {
|
|||
Some(&source_origin.ascii_serialization()),
|
||||
Some(&*source),
|
||||
ports,
|
||||
CanGc::note()
|
||||
);
|
||||
} else {
|
||||
// Step 4, fire messageerror.
|
||||
MessageEvent::dispatch_error(
|
||||
this.upcast(),
|
||||
this.upcast(),
|
||||
CanGc::note()
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -97,7 +97,11 @@ impl Worker {
|
|||
*self.context_for_interrupt.borrow_mut() = Some(cx);
|
||||
}
|
||||
|
||||
pub fn handle_message(address: TrustedWorkerAddress, data: StructuredSerializedData) {
|
||||
pub fn handle_message(
|
||||
address: TrustedWorkerAddress,
|
||||
data: StructuredSerializedData,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
let worker = address.root();
|
||||
|
||||
if worker.is_terminated() {
|
||||
|
@ -109,10 +113,18 @@ impl Worker {
|
|||
let _ac = enter_realm(target);
|
||||
rooted!(in(*GlobalScope::get_cx()) let mut message = UndefinedValue());
|
||||
if let Ok(ports) = structuredclone::read(&global, data, message.handle_mut()) {
|
||||
MessageEvent::dispatch_jsval(target, &global, message.handle(), None, None, ports);
|
||||
MessageEvent::dispatch_jsval(
|
||||
target,
|
||||
&global,
|
||||
message.handle(),
|
||||
None,
|
||||
None,
|
||||
ports,
|
||||
can_gc,
|
||||
);
|
||||
} else {
|
||||
// Step 4 of the "port post message steps" of the implicit messageport, fire messageerror.
|
||||
MessageEvent::dispatch_error(target, &global);
|
||||
MessageEvent::dispatch_error(target, &global, can_gc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,8 +39,12 @@ impl XRBoundedReferenceSpace {
|
|||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn new(global: &GlobalScope, session: &XRSession) -> DomRoot<XRBoundedReferenceSpace> {
|
||||
let offset = XRRigidTransform::identity(global);
|
||||
pub fn new(
|
||||
global: &GlobalScope,
|
||||
session: &XRSession,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRBoundedReferenceSpace> {
|
||||
let offset = XRRigidTransform::identity(global, can_gc);
|
||||
Self::new_offset(global, session, &offset)
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ use crate::dom::xrreferencespace::XRReferenceSpace;
|
|||
use crate::dom::xrsession::{ApiPose, XRSession};
|
||||
use crate::dom::xrspace::XRSpace;
|
||||
use crate::dom::xrviewerpose::XRViewerPose;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRFrame {
|
||||
|
@ -92,6 +93,7 @@ impl XRFrameMethods for XRFrame {
|
|||
fn GetViewerPose(
|
||||
&self,
|
||||
reference: &XRReferenceSpace,
|
||||
can_gc: CanGc,
|
||||
) -> Result<Option<DomRoot<XRViewerPose>>, Error> {
|
||||
if self.session != reference.upcast::<XRSpace>().session() {
|
||||
return Err(Error::InvalidState);
|
||||
|
@ -116,6 +118,7 @@ impl XRFrameMethods for XRFrame {
|
|||
&self.session,
|
||||
to_base,
|
||||
viewer_pose,
|
||||
can_gc,
|
||||
)))
|
||||
}
|
||||
|
||||
|
@ -124,6 +127,7 @@ impl XRFrameMethods for XRFrame {
|
|||
&self,
|
||||
space: &XRSpace,
|
||||
base_space: &XRSpace,
|
||||
can_gc: CanGc,
|
||||
) -> Result<Option<DomRoot<XRPose>>, Error> {
|
||||
if self.session != space.session() || self.session != base_space.session() {
|
||||
return Err(Error::InvalidState);
|
||||
|
@ -142,7 +146,7 @@ impl XRFrameMethods for XRFrame {
|
|||
return Ok(None);
|
||||
};
|
||||
let pose = space.then(&base_space.inverse());
|
||||
Ok(Some(XRPose::new(&self.global(), pose)))
|
||||
Ok(Some(XRPose::new(&self.global(), pose, can_gc)))
|
||||
}
|
||||
|
||||
/// <https://immersive-web.github.io/webxr/#dom-xrframe-getpose>
|
||||
|
@ -150,6 +154,7 @@ impl XRFrameMethods for XRFrame {
|
|||
&self,
|
||||
space: &XRJointSpace,
|
||||
base_space: &XRSpace,
|
||||
can_gc: CanGc,
|
||||
) -> Result<Option<DomRoot<XRJointPose>>, Error> {
|
||||
if self.session != space.upcast::<XRSpace>().session() ||
|
||||
self.session != base_space.session()
|
||||
|
@ -174,6 +179,7 @@ impl XRFrameMethods for XRFrame {
|
|||
&self.global(),
|
||||
pose.cast_unit(),
|
||||
Some(joint_frame.radius),
|
||||
can_gc,
|
||||
)))
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ use crate::dom::globalscope::GlobalScope;
|
|||
use crate::dom::xrframe::XRFrame;
|
||||
use crate::dom::xrpose::XRPose;
|
||||
use crate::dom::xrspace::XRSpace;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRHitTestResult {
|
||||
|
@ -45,9 +46,9 @@ impl XRHitTestResult {
|
|||
|
||||
impl XRHitTestResultMethods for XRHitTestResult {
|
||||
// https://immersive-web.github.io/hit-test/#dom-xrhittestresult-getpose
|
||||
fn GetPose(&self, base: &XRSpace) -> Option<DomRoot<XRPose>> {
|
||||
fn GetPose(&self, base: &XRSpace, can_gc: CanGc) -> Option<DomRoot<XRPose>> {
|
||||
let base = self.frame.get_pose(base)?;
|
||||
let pose = self.result.space.then(&base.inverse());
|
||||
Some(XRPose::new(&self.global(), pose.cast_unit()))
|
||||
Some(XRPose::new(&self.global(), pose.cast_unit(), can_gc))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ use crate::dom::globalscope::GlobalScope;
|
|||
use crate::dom::xrpose::XRPose;
|
||||
use crate::dom::xrrigidtransform::XRRigidTransform;
|
||||
use crate::dom::xrsession::ApiRigidTransform;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRJointPose {
|
||||
|
@ -32,8 +33,9 @@ impl XRJointPose {
|
|||
global: &GlobalScope,
|
||||
pose: ApiRigidTransform,
|
||||
radius: Option<f32>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRJointPose> {
|
||||
let transform = XRRigidTransform::new(global, pose);
|
||||
let transform = XRRigidTransform::new(global, pose, can_gc);
|
||||
reflect_dom_object(
|
||||
Box::new(XRJointPose::new_inherited(&transform, radius)),
|
||||
global,
|
||||
|
|
|
@ -11,6 +11,7 @@ use crate::dom::dompointreadonly::DOMPointReadOnly;
|
|||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::xrrigidtransform::XRRigidTransform;
|
||||
use crate::dom::xrsession::ApiRigidTransform;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRPose {
|
||||
|
@ -27,8 +28,12 @@ impl XRPose {
|
|||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn new(global: &GlobalScope, transform: ApiRigidTransform) -> DomRoot<XRPose> {
|
||||
let transform = XRRigidTransform::new(global, transform);
|
||||
pub fn new(
|
||||
global: &GlobalScope,
|
||||
transform: ApiRigidTransform,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRPose> {
|
||||
let transform = XRRigidTransform::new(global, transform, can_gc);
|
||||
reflect_dom_object(Box::new(XRPose::new_inherited(&transform)), global)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ use crate::dom::globalscope::GlobalScope;
|
|||
use crate::dom::xrrigidtransform::XRRigidTransform;
|
||||
use crate::dom::xrsession::{cast_transform, ApiPose, BaseTransform, XRSession};
|
||||
use crate::dom::xrspace::XRSpace;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRReferenceSpace {
|
||||
|
@ -42,8 +43,9 @@ impl XRReferenceSpace {
|
|||
global: &GlobalScope,
|
||||
session: &XRSession,
|
||||
ty: XRReferenceSpaceType,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRReferenceSpace> {
|
||||
let offset = XRRigidTransform::identity(global);
|
||||
let offset = XRRigidTransform::identity(global, can_gc);
|
||||
Self::new_offset(global, session, ty, &offset)
|
||||
}
|
||||
|
||||
|
@ -79,9 +81,9 @@ impl XRReferenceSpace {
|
|||
|
||||
impl XRReferenceSpaceMethods for XRReferenceSpace {
|
||||
/// <https://immersive-web.github.io/webxr/#dom-xrreferencespace-getoffsetreferencespace>
|
||||
fn GetOffsetReferenceSpace(&self, new: &XRRigidTransform) -> DomRoot<Self> {
|
||||
fn GetOffsetReferenceSpace(&self, new: &XRRigidTransform, can_gc: CanGc) -> DomRoot<Self> {
|
||||
let offset = new.transform().then(&self.offset.transform());
|
||||
let offset = XRRigidTransform::new(&self.global(), offset);
|
||||
let offset = XRRigidTransform::new(&self.global(), offset, can_gc);
|
||||
Self::new_offset(
|
||||
&self.global(),
|
||||
self.upcast::<XRSpace>().session(),
|
||||
|
|
|
@ -44,8 +44,12 @@ impl XRRigidTransform {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, transform: ApiRigidTransform) -> DomRoot<XRRigidTransform> {
|
||||
Self::new_with_proto(global, None, transform, CanGc::note())
|
||||
pub fn new(
|
||||
global: &GlobalScope,
|
||||
transform: ApiRigidTransform,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRRigidTransform> {
|
||||
Self::new_with_proto(global, None, transform, can_gc)
|
||||
}
|
||||
|
||||
fn new_with_proto(
|
||||
|
@ -62,9 +66,9 @@ impl XRRigidTransform {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn identity(window: &GlobalScope) -> DomRoot<XRRigidTransform> {
|
||||
pub fn identity(window: &GlobalScope, can_gc: CanGc) -> DomRoot<XRRigidTransform> {
|
||||
let transform = RigidTransform3D::identity();
|
||||
XRRigidTransform::new(window, transform)
|
||||
XRRigidTransform::new(window, transform, can_gc)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,9 +159,9 @@ impl XRRigidTransformMethods for XRRigidTransform {
|
|||
})
|
||||
}
|
||||
// https://immersive-web.github.io/webxr/#dom-xrrigidtransform-inverse
|
||||
fn Inverse(&self) -> DomRoot<XRRigidTransform> {
|
||||
fn Inverse(&self, can_gc: CanGc) -> DomRoot<XRRigidTransform> {
|
||||
self.inverse.or_init(|| {
|
||||
let transform = XRRigidTransform::new(&self.global(), self.transform.inverse());
|
||||
let transform = XRRigidTransform::new(&self.global(), self.transform.inverse(), can_gc);
|
||||
transform.inverse.set(Some(self));
|
||||
transform
|
||||
})
|
||||
|
|
|
@ -401,7 +401,7 @@ impl XRSession {
|
|||
base == base_space
|
||||
})
|
||||
.for_each(|space| {
|
||||
let offset = XRRigidTransform::new(&self.global(), transform);
|
||||
let offset = XRRigidTransform::new(&self.global(), transform, can_gc);
|
||||
let event = XRReferenceSpaceEvent::new(
|
||||
&self.global(),
|
||||
atom!("reset"),
|
||||
|
@ -824,7 +824,12 @@ impl XRSessionMethods for XRSession {
|
|||
}
|
||||
|
||||
/// <https://immersive-web.github.io/webxr/#dom-xrsession-requestreferencespace>
|
||||
fn RequestReferenceSpace(&self, ty: XRReferenceSpaceType, comp: InRealm) -> Rc<Promise> {
|
||||
fn RequestReferenceSpace(
|
||||
&self,
|
||||
ty: XRReferenceSpaceType,
|
||||
comp: InRealm,
|
||||
can_gc: CanGc,
|
||||
) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_realm(comp);
|
||||
|
||||
// https://immersive-web.github.io/webxr/#create-a-reference-space
|
||||
|
@ -861,13 +866,13 @@ impl XRSessionMethods for XRSession {
|
|||
}
|
||||
}
|
||||
if ty == XRReferenceSpaceType::Bounded_floor {
|
||||
let space = XRBoundedReferenceSpace::new(&self.global(), self);
|
||||
let space = XRBoundedReferenceSpace::new(&self.global(), self, can_gc);
|
||||
self.reference_spaces
|
||||
.borrow_mut()
|
||||
.push(Dom::from_ref(space.reference_space()));
|
||||
p.resolve_native(&space);
|
||||
} else {
|
||||
let space = XRReferenceSpace::new(&self.global(), self, ty);
|
||||
let space = XRReferenceSpace::new(&self.global(), self, ty, can_gc);
|
||||
self.reference_spaces
|
||||
.borrow_mut()
|
||||
.push(Dom::from_ref(&*space));
|
||||
|
|
|
@ -17,7 +17,7 @@ use crate::dom::bindings::root::{Dom, DomRoot};
|
|||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::xrrigidtransform::XRRigidTransform;
|
||||
use crate::dom::xrsession::{cast_transform, BaseSpace, BaseTransform, XRSession};
|
||||
use crate::script_runtime::JSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRView {
|
||||
|
@ -61,9 +61,10 @@ impl XRView {
|
|||
eye: XREye,
|
||||
viewport_index: usize,
|
||||
to_base: &BaseTransform,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRView> {
|
||||
let transform: RigidTransform3D<f32, V, BaseSpace> = view.transform.then(to_base);
|
||||
let transform = XRRigidTransform::new(global, cast_transform(transform));
|
||||
let transform = XRRigidTransform::new(global, cast_transform(transform), can_gc);
|
||||
|
||||
reflect_dom_object(
|
||||
Box::new(XRView::new_inherited(
|
||||
|
|
|
@ -19,7 +19,7 @@ use crate::dom::xrrigidtransform::XRRigidTransform;
|
|||
use crate::dom::xrsession::{cast_transform, BaseSpace, BaseTransform, XRSession};
|
||||
use crate::dom::xrview::XRView;
|
||||
use crate::realms::enter_realm;
|
||||
use crate::script_runtime::JSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRViewerPose {
|
||||
|
@ -42,6 +42,7 @@ impl XRViewerPose {
|
|||
session: &XRSession,
|
||||
to_base: BaseTransform,
|
||||
viewer_pose: &ViewerPose,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XRViewerPose> {
|
||||
let _ac = enter_realm(global);
|
||||
rooted_vec!(let mut views);
|
||||
|
@ -53,12 +54,27 @@ impl XRViewerPose {
|
|||
XREye::None,
|
||||
0,
|
||||
&to_base,
|
||||
can_gc,
|
||||
)),
|
||||
Views::Mono(view) => views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
view,
|
||||
XREye::None,
|
||||
0,
|
||||
&to_base,
|
||||
can_gc,
|
||||
)),
|
||||
Views::Mono(view) => {
|
||||
views.push(XRView::new(global, session, view, XREye::None, 0, &to_base))
|
||||
},
|
||||
Views::Stereo(left, right) => {
|
||||
views.push(XRView::new(global, session, left, XREye::Left, 0, &to_base));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
left,
|
||||
XREye::Left,
|
||||
0,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
|
@ -66,10 +82,19 @@ impl XRViewerPose {
|
|||
XREye::Right,
|
||||
1,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
},
|
||||
Views::StereoCapture(left, right, third_eye) => {
|
||||
views.push(XRView::new(global, session, left, XREye::Left, 0, &to_base));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
left,
|
||||
XREye::Left,
|
||||
0,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
|
@ -77,6 +102,7 @@ impl XRViewerPose {
|
|||
XREye::Right,
|
||||
1,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
|
@ -85,6 +111,7 @@ impl XRViewerPose {
|
|||
XREye::None,
|
||||
2,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
},
|
||||
Views::Cubemap(front, left, right, top, bottom, back) => {
|
||||
|
@ -95,8 +122,17 @@ impl XRViewerPose {
|
|||
XREye::None,
|
||||
0,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
left,
|
||||
XREye::None,
|
||||
1,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(global, session, left, XREye::None, 1, &to_base));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
|
@ -104,8 +140,17 @@ impl XRViewerPose {
|
|||
XREye::None,
|
||||
2,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
top,
|
||||
XREye::None,
|
||||
3,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(global, session, top, XREye::None, 3, &to_base));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
|
@ -113,13 +158,22 @@ impl XRViewerPose {
|
|||
XREye::None,
|
||||
4,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(
|
||||
global,
|
||||
session,
|
||||
back,
|
||||
XREye::None,
|
||||
5,
|
||||
&to_base,
|
||||
can_gc,
|
||||
));
|
||||
views.push(XRView::new(global, session, back, XREye::None, 5, &to_base));
|
||||
},
|
||||
};
|
||||
let transform: RigidTransform3D<f32, Viewer, BaseSpace> =
|
||||
viewer_pose.transform.then(&to_base);
|
||||
let transform = XRRigidTransform::new(global, cast_transform(transform));
|
||||
let transform = XRRigidTransform::new(global, cast_transform(transform), can_gc);
|
||||
let pose = reflect_dom_object(Box::new(XRViewerPose::new_inherited(&transform)), global);
|
||||
|
||||
let cx = GlobalScope::get_cx();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue