1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibWeb: Add DOMMatrix multiply

This commit is contained in:
Bastiaan van der Plaat 2023-09-03 12:42:50 +02:00 committed by Andreas Kling
parent ff1bcc694d
commit 61c063f7b3
8 changed files with 61 additions and 4 deletions

View file

@ -239,6 +239,17 @@ bool DOMMatrixReadOnly::is_identity() const
return true;
}
// https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-multiply
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> DOMMatrixReadOnly::multiply(DOMMatrixInit other)
{
// 1. Let result be the resulting matrix initialized to the values of the current matrix.
auto result = DOMMatrix::create_from_dom_matrix_read_only(realm(), *this);
// 2. Perform a multiplySelf() transformation on result with the argument other.
// 3. Return result.
return result->multiply_self(other);
}
// https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-inverse
JS::NonnullGCPtr<DOMMatrix> DOMMatrixReadOnly::inverse() const
{