mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:07:43 +00:00
LibWeb: Implement matrix3d transform function from css-transforms-2
This commit is contained in:
parent
0fdd924db2
commit
dbe12662b8
3 changed files with 13 additions and 0 deletions
|
@ -458,6 +458,9 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
|||
VERIFY(layout_node.paintable());
|
||||
auto const& paintable_box = verify_cast<Painting::PaintableBox const>(layout_node.paintable());
|
||||
VERIFY(paintable_box->stacking_context());
|
||||
|
||||
// FIXME: This needs to serialize to matrix3d if the transformation matrix is a 3D matrix.
|
||||
// https://w3c.github.io/csswg-drafts/css-transforms-2/#serialization-of-the-computed-value
|
||||
auto affine_matrix = paintable_box->stacking_context()->affine_transform_matrix();
|
||||
|
||||
NonnullRefPtrVector<StyleValue> parameters;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
"matrix": {
|
||||
"parameters": "<number>{6}"
|
||||
},
|
||||
"matrix3d": {
|
||||
"parameters": "<number>{16}"
|
||||
},
|
||||
"translate": {
|
||||
"parameters": "<length-percentage>{1,2}"
|
||||
},
|
||||
|
|
|
@ -199,6 +199,13 @@ Gfx::FloatMatrix4x4 StackingContext::get_transformation_matrix(CSS::Transformati
|
|||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
break;
|
||||
case CSS::TransformFunction::Matrix3d:
|
||||
if (count == 16)
|
||||
return Gfx::FloatMatrix4x4(value(0), value(4), value(8), value(12),
|
||||
value(1), value(5), value(9), value(13),
|
||||
value(2), value(6), value(10), value(14),
|
||||
value(3), value(7), value(11), value(15));
|
||||
break;
|
||||
case CSS::TransformFunction::Translate:
|
||||
if (count == 1)
|
||||
return Gfx::FloatMatrix4x4(1, 0, 0, value(0, width),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue