mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Make CSSPerspective correctly clamp its input for toMatrix()
This commit is contained in:
parent
684c543ddb
commit
edccb92da7
Notes:
github-actions[bot]
2025-11-13 14:48:12 +00:00
Author: https://github.com/Psychpsyo
Commit: edccb92da7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6806
Reviewed-by: https://github.com/gmta ✅
2 changed files with 10 additions and 9 deletions
|
|
@ -121,7 +121,7 @@ WebIDL::ExceptionOr<GC::Ref<Geometry::DOMMatrix>> CSSPerspective::to_matrix() co
|
|||
[&matrix](GC::Ref<CSSNumericValue> const& numeric_value) -> WebIDL::ExceptionOr<void> {
|
||||
// NB: to() throws a TypeError if the conversion can't be done.
|
||||
auto distance = TRY(numeric_value->to("px"_fly_string))->value();
|
||||
matrix->set_m34(-1 / (distance <= 0 ? 1 : distance));
|
||||
matrix->set_m34(-1 / max(distance, 1));
|
||||
return {};
|
||||
},
|
||||
[](GC::Ref<CSSKeywordValue> const&) -> WebIDL::ExceptionOr<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue