1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

LibWeb: Fix DOMMatrix fromMatrix to use complete DOMMatrixInit struct

DOMMatrix fromMatrix was using create_from_dom_matrix_2d_init to make
a DOMMatrix for it's init struct this is wrong because only the 2D
params of the DOMMatrix are put into the new matrix. I have added
a non 2D version of that function that takes the full DOMMatrixInit
so now fromMatrix works correctly again. I also have added some
text tests to test if it works correctly.

I split the dommatrix.html text tests into multiple files because that
file was becoming to big so now every sub function is a seperate file.
This commit is contained in:
Bastiaan van der Plaat 2023-09-07 21:26:21 +02:00 committed by Andrew Kaster
parent 5d37e1c220
commit 67f6a9ee12
14 changed files with 174 additions and 69 deletions

View file

@ -18,6 +18,7 @@ class DOMMatrix : public DOMMatrixReadOnly {
public:
static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> construct_impl(JS::Realm&, Optional<Variant<String, Vector<double>>> const& init);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> create_from_dom_matrix_2d_init(JS::Realm&, DOMMatrix2DInit& init);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> create_from_dom_matrix_init(JS::Realm&, DOMMatrixInit& init);
static JS::NonnullGCPtr<DOMMatrix> create_from_dom_matrix_read_only(JS::Realm&, DOMMatrixReadOnly const& read_only_matrix);
virtual ~DOMMatrix() override;
@ -57,6 +58,7 @@ public:
private:
DOMMatrix(JS::Realm&, double m11, double m12, double m21, double m22, double m41, double m42);
DOMMatrix(JS::Realm&, double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44);
DOMMatrix(JS::Realm&, Optional<Variant<String, Vector<double>>> const& init);
DOMMatrix(JS::Realm&, DOMMatrixReadOnly const& read_only_matrix);