diff --git a/gentest/gentest-cpp.js b/gentest/gentest-cpp.js index f04e6db2..b174efd2 100644 --- a/gentest/gentest-cpp.js +++ b/gentest/gentest-cpp.js @@ -219,6 +219,20 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, { }, }, + YGNodeStyleSetAspectRatio: { + value: function (nodeName, value) { + this.push( + 'YGNodeStyleSetAspectRatio' + + toFunctionName(value) + + '(' + + nodeName + + ', ' + + toValueCpp(value) + + ');', + ); + }, + }, + YGNodeStyleSetBorder: { value: function (nodeName, edge, value) { this.push( diff --git a/gentest/gentest-java.js b/gentest/gentest-java.js index 3d82b246..b6ec6733 100644 --- a/gentest/gentest-java.js +++ b/gentest/gentest-java.js @@ -239,6 +239,12 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, { }, }, + YGNodeStyleSetAspectRatio: { + value: function (nodeName, value) { + this.push(nodeName + '.setAspectRatio(' + toValueJava(value) + 'f);'); + }, + }, + YGNodeStyleSetBorder: { value: function (nodeName, edge, value) { this.push( diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index c847cc7e..c2197f26 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -222,6 +222,14 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { }, }, + YGNodeStyleSetAspectRatio: { + value: function (nodeName, value) { + this.push( + nodeName + '.setAspectRatio(' + toValueJavascript(value) + ');', + ); + }, + }, + YGNodeStyleSetBorder: { value: function (nodeName, edge, value) { this.push( diff --git a/gentest/gentest.js b/gentest/gentest.js index 5cd500a0..af645b92 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -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);