Back out "Gentest and initial tests for intrinsic sizing" (#1751)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1751

Original commit changeset: 1e3e7214fab0

Original Phabricator Diff: D64145117

Reviewed By: NickGerleman

Differential Revision: D66332308

fbshipit-source-id: 52d6cc754cb931e851e444bac2c946907a098235
This commit is contained in:
Joe Vilches
2024-11-25 00:40:03 -08:00
committed by Facebook GitHub Bot
parent 0b25796676
commit c12e732fab
8 changed files with 73 additions and 6240 deletions

View File

@@ -17,25 +17,13 @@ function toFunctionNameCpp(value) {
return 'Percent';
} else if (value.indexOf('Auto') >= 0) {
return 'Auto';
} else if (value.indexOf('MaxContent') >= 0) {
return 'MaxContent';
} else if (value.indexOf('FitContent') >= 0) {
return 'FitContent';
} else if (value.indexOf('Stretch') >= 0) {
return 'Stretch';
}
return '';
}
function keywordFunctionCpp(functionPrefix, nodeName, value) {
const functionSuffix = toFunctionNameCpp(value);
if (
functionSuffix == 'Auto' ||
functionSuffix == 'MaxContent' ||
functionSuffix == 'FitContent' ||
functionSuffix == 'Stretch'
) {
if (functionSuffix == 'Auto') {
return functionPrefix + functionSuffix + '(' + nodeName + ');';
} else {
return (
@@ -175,10 +163,6 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
YGDisplayContents: {value: 'YGDisplayContents'},
YGAuto: {value: 'YGAuto'},
YGMaxContent: {value: 'MaxContent'},
YGFitContent: {value: 'FitContent'},
YGStretch: {value: 'Stretch'},
YGNodeCalculateLayout: {
value: function (node, dir, _experiments) {
this.push(
@@ -398,25 +382,57 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
YGNodeStyleSetMaxHeight: {
value: function (nodeName, value) {
this.push(keywordFunctionCpp('YGNodeStyleSetMaxHeight', nodeName, value));
this.push(
'YGNodeStyleSetMaxHeight' +
toFunctionNameCpp(value) +
'(' +
nodeName +
', ' +
toValueCpp(value) +
');',
);
},
},
YGNodeStyleSetMaxWidth: {
value: function (nodeName, value) {
this.push(keywordFunctionCpp('YGNodeStyleSetMaxWidth', nodeName, value));
this.push(
'YGNodeStyleSetMaxWidth' +
toFunctionNameCpp(value) +
'(' +
nodeName +
', ' +
toValueCpp(value) +
');',
);
},
},
YGNodeStyleSetMinHeight: {
value: function (nodeName, value) {
this.push(keywordFunctionCpp('YGNodeStyleSetMinHeight', nodeName, value));
this.push(
'YGNodeStyleSetMinHeight' +
toFunctionNameCpp(value) +
'(' +
nodeName +
', ' +
toValueCpp(value) +
');',
);
},
},
YGNodeStyleSetMinWidth: {
value: function (nodeName, value) {
this.push(keywordFunctionCpp('YGNodeStyleSetMinWidth', nodeName, value));
this.push(
'YGNodeStyleSetMinWidth' +
toFunctionNameCpp(value) +
'(' +
nodeName +
', ' +
toValueCpp(value) +
');',
);
},
},