script: implement setMatrixValue for DOMMatrix (#39148)

Even more progress on the geometry suite. Almost there!

Testing: Covered by WPT (css/geometry).

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
This commit is contained in:
lumiscosity 2025-09-04 21:02:54 +02:00 committed by GitHub
parent f3a8ad30f1
commit c7ca281f44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 10 deletions

View file

@ -86,10 +86,33 @@ impl DOMMatrixReadOnly {
self.matrix.borrow()
}
pub(crate) fn set_matrix(&self, value: Transform3D<f64>) {
self.set_m11(value.m11);
self.set_m12(value.m12);
self.set_m13(value.m13);
self.set_m14(value.m14);
self.set_m21(value.m21);
self.set_m22(value.m22);
self.set_m23(value.m23);
self.set_m24(value.m24);
self.set_m31(value.m31);
self.set_m32(value.m32);
self.set_m33(value.m33);
self.set_m34(value.m34);
self.set_m41(value.m41);
self.set_m42(value.m42);
self.set_m43(value.m43);
self.set_m44(value.m44);
}
pub(crate) fn is2D(&self) -> bool {
self.is2D.get()
}
pub(crate) fn set_is2D(&self, value: bool) {
self.is2D.set(value);
}
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m11
pub(crate) fn set_m11(&self, value: f64) {
self.matrix.borrow_mut().m11 = value;