mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +00:00
LibWeb/CSS: Implement converting CSSTransformValues to StyleValues
This commit is contained in:
parent
5178d1ebe3
commit
3716db1c61
Notes:
github-actions[bot]
2025-10-14 12:42:50 +00:00
Author: https://github.com/AtkinsSJ
Commit: 3716db1c61
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6466
20 changed files with 198 additions and 5 deletions
|
@ -8,6 +8,8 @@
|
|||
#include <LibWeb/Bindings/CSSRotatePrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CSS/CSSUnitValue.h>
|
||||
#include <LibWeb/CSS/PropertyNameAndID.h>
|
||||
#include <LibWeb/CSS/StyleValues/TransformationStyleValue.h>
|
||||
#include <LibWeb/Geometry/DOMMatrix.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
|
@ -218,4 +220,22 @@ WebIDL::ExceptionOr<void> CSSRotate::set_angle(GC::Ref<CSSNumericValue> value)
|
|||
return {};
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<NonnullRefPtr<TransformationStyleValue const>> CSSRotate::create_style_value(PropertyNameAndID const& property) const
|
||||
{
|
||||
if (is_2d()) {
|
||||
return TransformationStyleValue::create(property.id(), TransformFunction::Rotate,
|
||||
{
|
||||
TRY(m_angle->create_an_internal_representation(property, CSSStyleValue::PerformTypeCheck::No)),
|
||||
});
|
||||
}
|
||||
|
||||
return TransformationStyleValue::create(property.id(), TransformFunction::Rotate3d,
|
||||
{
|
||||
TRY(m_x->create_an_internal_representation(property, CSSStyleValue::PerformTypeCheck::No)),
|
||||
TRY(m_y->create_an_internal_representation(property, CSSStyleValue::PerformTypeCheck::No)),
|
||||
TRY(m_z->create_an_internal_representation(property, CSSStyleValue::PerformTypeCheck::No)),
|
||||
TRY(m_angle->create_an_internal_representation(property, CSSStyleValue::PerformTypeCheck::No)),
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue