mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
refactor: add CanGc as argument to create_buffer_source (#35597)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
35f21e426b
commit
245a39c07e
22 changed files with 169 additions and 96 deletions
|
@ -776,7 +776,7 @@ impl DOMMatrixReadOnlyMethods<crate::DomTypeHolder> for DOMMatrixReadOnly {
|
|||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-tofloat32array
|
||||
fn ToFloat32Array(&self, cx: JSContext) -> Float32Array {
|
||||
fn ToFloat32Array(&self, cx: JSContext, can_gc: CanGc) -> Float32Array {
|
||||
let vec: Vec<f32> = self
|
||||
.matrix
|
||||
.borrow()
|
||||
|
@ -785,15 +785,20 @@ impl DOMMatrixReadOnlyMethods<crate::DomTypeHolder> for DOMMatrixReadOnly {
|
|||
.map(|&x| x as f32)
|
||||
.collect();
|
||||
rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>());
|
||||
create_buffer_source(cx, &vec, array.handle_mut())
|
||||
create_buffer_source(cx, &vec, array.handle_mut(), can_gc)
|
||||
.expect("Converting matrix to float32 array should never fail")
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-tofloat64array
|
||||
fn ToFloat64Array(&self, cx: JSContext) -> Float64Array {
|
||||
fn ToFloat64Array(&self, cx: JSContext, can_gc: CanGc) -> Float64Array {
|
||||
rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>());
|
||||
create_buffer_source(cx, &self.matrix.borrow().to_array(), array.handle_mut())
|
||||
.expect("Converting matrix to float64 array should never fail")
|
||||
create_buffer_source(
|
||||
cx,
|
||||
&self.matrix.borrow().to_array(),
|
||||
array.handle_mut(),
|
||||
can_gc,
|
||||
)
|
||||
.expect("Converting matrix to float64 array should never fail")
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry/#dommatrixreadonly-stringification-behavior
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue