1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

LibWeb: Use TRY in DOMMatrix and DOMPointReadOnly

This commit is contained in:
Bastiaan van der Plaat 2023-09-09 21:59:09 +02:00 committed by Andrew Kaster
parent 8e7d3a6acc
commit 7e9ea964a8
2 changed files with 3 additions and 12 deletions

View file

@ -39,10 +39,7 @@ DOMPointReadOnly::~DOMPointReadOnly() = default;
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMPoint>> DOMPointReadOnly::matrix_transform(DOMMatrixInit& matrix) const
{
// 1. Let matrixObject be the result of invoking create a DOMMatrix from the dictionary matrix.
auto maybe_matrix_object = DOMMatrix::create_from_dom_matrix_2d_init(realm(), matrix);
if (maybe_matrix_object.is_exception())
return maybe_matrix_object.exception();
auto matrix_object = maybe_matrix_object.release_value();
auto matrix_object = TRY(DOMMatrix::create_from_dom_matrix_2d_init(realm(), matrix));
// 2. Return the result of invoking transform a point with a matrix, given the current point and matrixObject. The current point does not get modified.
return matrix_object->transform_point(*this);