Add support for flex-grow, flex-shrink, and flex-basis

Summary: Add support for flex-grow, flex-shrink, and flex-basis properties. The flex property behavior is preserved for backwards compatibility.

Reviewed By: lucasr

Differential Revision: D3714520

fbshipit-source-id: 80d3a9a1e2b6f74b863bbe22357f2c9865fa290e
This commit is contained in:
Emil Sjolander
2016-08-15 09:15:05 -07:00
committed by Facebook Github Bot 6
parent fdd5c8ce82
commit f68521aa69
7 changed files with 221 additions and 160 deletions

View File

@@ -108,10 +108,14 @@ function setupTestTree(node, nodeName, parentName, index) {
overflowValue(node.style[style]) + ');');
break;
case 'flex-grow':
lines.push('CSSNodeStyleSetFlex(' + nodeName + ', ' + node.style[style] + ');');
lines.push('CSSNodeStyleSetFlexGrow(' + nodeName + ', ' + node.style[style] + ');');
break;
case 'flex-shrink':
lines.push('CSSNodeStyleSetFlex(' + nodeName + ', ' + -node.style[style] + ');');
lines.push('CSSNodeStyleSetFlexShrink(' + nodeName + ', ' + node.style[style] + ');');
break;
case 'flex-basis':
lines.push('CSSNodeStyleSetFlexBasis(' + nodeName + ', ' +
pixelValue(node.style[style]) + ');');
break;
case 'left':
lines.push('CSSNodeStyleSetPositionLeft(' + nodeName + ', ' +
@@ -328,6 +332,7 @@ function getCSSLayoutStyle(node) {
'overflow',
'flex-grow',
'flex-shrink',
'flex-basis',
'left',
'top',
'right',