Add option to use aspect-ratio in test fixtures

Summary: Wires up codegen for aspect-ratio styles in JS, Java and CPP gentest fixtures.

Reviewed By: NickGerleman

Differential Revision: D50225805

fbshipit-source-id: 660a3999eab24611b7c2d2e073b1d55180a5d4f0
This commit is contained in:
Eric Rozell
2023-10-12 15:02:00 -07:00
committed by Facebook GitHub Bot
parent fad4d50b8e
commit a876372357
4 changed files with 35 additions and 0 deletions

View File

@@ -211,6 +211,12 @@ function setupTestTree(
if (!isDefaultStyleValue(style, node.style[style])) {
switch (style) {
case 'aspect-ratio':
e.YGNodeStyleSetAspectRatio(
nodeName,
pointValue(e, node.style[style]),
);
break;
case 'gap':
e.YGNodeStyleSetGap(
nodeName,
@@ -742,6 +748,7 @@ function getYogaStyle(node) {
'column-gap',
'row-gap',
'display',
'aspect-ratio',
].reduce((map, key) => {
map[key] =
node.style[key] || getComputedStyle(node, null).getPropertyValue(key);