Rename enums
Summary: new name, start by renaming enums Differential Revision: D4244360 fbshipit-source-id: c9fcbdd231098c9ff230a6055676bbc7cbd11001
This commit is contained in:
committed by
Facebook Github Bot
parent
07cf47baad
commit
42b6f6b6e5
@@ -32,7 +32,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
if (experiments.length > 0) {
|
||||
for (var i in experiments) {
|
||||
this.push('CSSLayoutSetExperimentalFeatureEnabled(CSSExperimentalFeature' + experiments[i] +', true);');
|
||||
this.push('CSSLayoutSetExperimentalFeatureEnabled(YGExperimentalFeature' + experiments[i] +', true);');
|
||||
}
|
||||
this.push('');
|
||||
}
|
||||
@@ -51,7 +51,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
if (experiments.length > 0) {
|
||||
this.push('');
|
||||
for (var i in experiments) {
|
||||
this.push('CSSLayoutSetExperimentalFeatureEnabled(CSSExperimentalFeature' + experiments[i] +', false);');
|
||||
this.push('CSSLayoutSetExperimentalFeatureEnabled(YGExperimentalFeature' + experiments[i] +', false);');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,47 +69,47 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
this.push('ASSERT_FLOAT_EQ(' + toFloatString(v0) + ', ' + v1 + ');');
|
||||
}},
|
||||
|
||||
CSSAlignAuto:{value:'CSSAlignAuto'},
|
||||
CSSAlignCenter:{value:'CSSAlignCenter'},
|
||||
CSSAlignFlexEnd:{value:'CSSAlignFlexEnd'},
|
||||
CSSAlignFlexStart:{value:'CSSAlignFlexStart'},
|
||||
CSSAlignStretch:{value:'CSSAlignStretch'},
|
||||
YGAlignAuto:{value:'YGAlignAuto'},
|
||||
YGAlignCenter:{value:'YGAlignCenter'},
|
||||
YGAlignFlexEnd:{value:'YGAlignFlexEnd'},
|
||||
YGAlignFlexStart:{value:'YGAlignFlexStart'},
|
||||
YGAlignStretch:{value:'YGAlignStretch'},
|
||||
|
||||
CSSDirectionInherit:{value:'CSSDirectionInherit'},
|
||||
CSSDirectionLTR:{value:'CSSDirectionLTR'},
|
||||
CSSDirectionRTL:{value:'CSSDirectionRTL'},
|
||||
YGDirectionInherit:{value:'YGDirectionInherit'},
|
||||
YGDirectionLTR:{value:'YGDirectionLTR'},
|
||||
YGDirectionRTL:{value:'YGDirectionRTL'},
|
||||
|
||||
CSSEdgeBottom:{value:'CSSEdgeBottom'},
|
||||
CSSEdgeEnd:{value:'CSSEdgeEnd'},
|
||||
CSSEdgeLeft:{value:'CSSEdgeLeft'},
|
||||
CSSEdgeRight:{value:'CSSEdgeRight'},
|
||||
CSSEdgeStart:{value:'CSSEdgeStart'},
|
||||
CSSEdgeTop:{value:'CSSEdgeTop'},
|
||||
YGEdgeBottom:{value:'YGEdgeBottom'},
|
||||
YGEdgeEnd:{value:'YGEdgeEnd'},
|
||||
YGEdgeLeft:{value:'YGEdgeLeft'},
|
||||
YGEdgeRight:{value:'YGEdgeRight'},
|
||||
YGEdgeStart:{value:'YGEdgeStart'},
|
||||
YGEdgeTop:{value:'YGEdgeTop'},
|
||||
|
||||
CSSFlexDirectionColumn:{value:'CSSFlexDirectionColumn'},
|
||||
CSSFlexDirectionColumnReverse:{value:'CSSFlexDirectionColumnReverse'},
|
||||
CSSFlexDirectionRow:{value:'CSSFlexDirectionRow'},
|
||||
CSSFlexDirectionRowReverse:{value:'CSSFlexDirectionRowReverse'},
|
||||
YGFlexDirectionColumn:{value:'YGFlexDirectionColumn'},
|
||||
YGFlexDirectionColumnReverse:{value:'YGFlexDirectionColumnReverse'},
|
||||
YGFlexDirectionRow:{value:'YGFlexDirectionRow'},
|
||||
YGFlexDirectionRowReverse:{value:'YGFlexDirectionRowReverse'},
|
||||
|
||||
CSSJustifyCenter:{value:'CSSJustifyCenter'},
|
||||
CSSJustifyFlexEnd:{value:'CSSJustifyFlexEnd'},
|
||||
CSSJustifyFlexStart:{value:'CSSJustifyFlexStart'},
|
||||
CSSJustifySpaceAround:{value:'CSSJustifySpaceAround'},
|
||||
CSSJustifySpaceBetween:{value:'CSSJustifySpaceBetween'},
|
||||
YGJustifyCenter:{value:'YGJustifyCenter'},
|
||||
YGJustifyFlexEnd:{value:'YGJustifyFlexEnd'},
|
||||
YGJustifyFlexStart:{value:'YGJustifyFlexStart'},
|
||||
YGJustifySpaceAround:{value:'YGJustifySpaceAround'},
|
||||
YGJustifySpaceBetween:{value:'YGJustifySpaceBetween'},
|
||||
|
||||
CSSOverflowHidden:{value:'CSSOverflowHidden'},
|
||||
CSSOverflowVisible:{value:'CSSOverflowVisible'},
|
||||
YGOverflowHidden:{value:'YGOverflowHidden'},
|
||||
YGOverflowVisible:{value:'YGOverflowVisible'},
|
||||
|
||||
CSSPositionTypeAbsolute:{value:'CSSPositionTypeAbsolute'},
|
||||
CSSPositionTypeRelative:{value:'CSSPositionTypeRelative'},
|
||||
YGPositionTypeAbsolute:{value:'YGPositionTypeAbsolute'},
|
||||
YGPositionTypeRelative:{value:'YGPositionTypeRelative'},
|
||||
|
||||
CSSWrapNoWrap:{value:'CSSWrapNoWrap'},
|
||||
CSSWrapWrap:{value:'CSSWrapWrap'},
|
||||
YGWrapNoWrap:{value:'YGWrapNoWrap'},
|
||||
YGWrapWrap:{value:'YGWrapWrap'},
|
||||
|
||||
CSSUndefined:{value:'CSSUndefined'},
|
||||
YGUndefined:{value:'YGUndefined'},
|
||||
|
||||
CSSNodeCalculateLayout:{value:function(node, dir) {
|
||||
this.push('CSSNodeCalculateLayout(' + node + ', CSSUndefined, CSSUndefined, ' + dir + ');');
|
||||
this.push('CSSNodeCalculateLayout(' + node + ', YGUndefined, YGUndefined, ' + dir + ');');
|
||||
}},
|
||||
|
||||
CSSNodeInsertChild:{value:function(parentName, nodeName, index) {
|
||||
|
@@ -39,7 +39,7 @@ CSEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
if (experiments.length > 0) {
|
||||
for (var i in experiments) {
|
||||
this.push('CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.' + experiments[i] +', true);');
|
||||
this.push('CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.' + experiments[i] +', true);');
|
||||
}
|
||||
this.push('');
|
||||
}
|
||||
@@ -53,7 +53,7 @@ CSEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
if (experiments.length > 0) {
|
||||
this.push('');
|
||||
for (var i in experiments) {
|
||||
this.push('CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.' + experiments[i] +', false);');
|
||||
this.push('CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.' + experiments[i] +', false);');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,44 +78,44 @@ CSEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
this.push('Assert.AreEqual(' + v0 + 'f, ' + v1 + ');');
|
||||
}},
|
||||
|
||||
CSSAlignAuto:{value:'CSSAlign.Auto'},
|
||||
CSSAlignCenter:{value:'CSSAlign.Center'},
|
||||
CSSAlignFlexEnd:{value:'CSSAlign.FlexEnd'},
|
||||
CSSAlignFlexStart:{value:'CSSAlign.FlexStart'},
|
||||
CSSAlignStretch:{value:'CSSAlign.Stretch'},
|
||||
YGAlignAuto:{value:'YogaAlign.Auto'},
|
||||
YGAlignCenter:{value:'YogaAlign.Center'},
|
||||
YGAlignFlexEnd:{value:'YogaAlign.FlexEnd'},
|
||||
YGAlignFlexStart:{value:'YogaAlign.FlexStart'},
|
||||
YGAlignStretch:{value:'YogaAlign.Stretch'},
|
||||
|
||||
CSSDirectionInherit:{value:'CSSDirection.Inherit'},
|
||||
CSSDirectionLTR:{value:'CSSDirection.LTR'},
|
||||
CSSDirectionRTL:{value:'CSSDirection.RTL'},
|
||||
YGDirectionInherit:{value:'YogaDirection.Inherit'},
|
||||
YGDirectionLTR:{value:'YogaDirection.LTR'},
|
||||
YGDirectionRTL:{value:'YogaDirection.RTL'},
|
||||
|
||||
CSSEdgeBottom:{value:'CSSEdge.Bottom'},
|
||||
CSSEdgeEnd:{value:'CSSEdge.End'},
|
||||
CSSEdgeLeft:{value:'CSSEdge.Left'},
|
||||
CSSEdgeRight:{value:'CSSEdge.Right'},
|
||||
CSSEdgeStart:{value:'CSSEdge.Start'},
|
||||
CSSEdgeTop:{value:'CSSEdge.Top'},
|
||||
YGEdgeBottom:{value:'YogaEdge.Bottom'},
|
||||
YGEdgeEnd:{value:'YogaEdge.End'},
|
||||
YGEdgeLeft:{value:'YogaEdge.Left'},
|
||||
YGEdgeRight:{value:'YogaEdge.Right'},
|
||||
YGEdgeStart:{value:'YogaEdge.Start'},
|
||||
YGEdgeTop:{value:'YogaEdge.Top'},
|
||||
|
||||
CSSFlexDirectionColumn:{value:'CSSFlexDirection.Column'},
|
||||
CSSFlexDirectionColumnReverse:{value:'CSSFlexDirection.ColumnReverse'},
|
||||
CSSFlexDirectionRow:{value:'CSSFlexDirection.Row'},
|
||||
CSSFlexDirectionRowReverse:{value:'CSSFlexDirection.RowReverse'},
|
||||
YGFlexDirectionColumn:{value:'YogaFlexDirection.Column'},
|
||||
YGFlexDirectionColumnReverse:{value:'YogaFlexDirection.ColumnReverse'},
|
||||
YGFlexDirectionRow:{value:'YogaFlexDirection.Row'},
|
||||
YGFlexDirectionRowReverse:{value:'YogaFlexDirection.RowReverse'},
|
||||
|
||||
CSSJustifyCenter:{value:'CSSJustify.Center'},
|
||||
CSSJustifyFlexEnd:{value:'CSSJustify.FlexEnd'},
|
||||
CSSJustifyFlexStart:{value:'CSSJustify.FlexStart'},
|
||||
CSSJustifySpaceAround:{value:'CSSJustify.SpaceAround'},
|
||||
CSSJustifySpaceBetween:{value:'CSSJustify.SpaceBetween'},
|
||||
YGJustifyCenter:{value:'YogaJustify.Center'},
|
||||
YGJustifyFlexEnd:{value:'YogaJustify.FlexEnd'},
|
||||
YGJustifyFlexStart:{value:'YogaJustify.FlexStart'},
|
||||
YGJustifySpaceAround:{value:'YogaJustify.SpaceAround'},
|
||||
YGJustifySpaceBetween:{value:'YogaJustify.SpaceBetween'},
|
||||
|
||||
CSSOverflowHidden:{value:'CSSOverflow.Hidden'},
|
||||
CSSOverflowVisible:{value:'CSSOverflow.Visible'},
|
||||
YGOverflowHidden:{value:'YogaOverflow.Hidden'},
|
||||
YGOverflowVisible:{value:'YogaOverflow.Visible'},
|
||||
|
||||
CSSPositionTypeAbsolute:{value:'CSSPositionType.Absolute'},
|
||||
CSSPositionTypeRelative:{value:'CSSPositionType.Relative'},
|
||||
YGPositionTypeAbsolute:{value:'YogaPositionType.Absolute'},
|
||||
YGPositionTypeRelative:{value:'YogaPositionType.Relative'},
|
||||
|
||||
CSSUndefined:{value:'CSSConstants.Undefined'},
|
||||
YGUndefined:{value:'YogaConstants.Undefined'},
|
||||
|
||||
CSSWrapNoWrap:{value:'CSSWrap.NoWrap'},
|
||||
CSSWrapWrap:{value:'CSSWrap.Wrap'},
|
||||
YGWrapNoWrap:{value:'YogaWrap.NoWrap'},
|
||||
YGWrapWrap:{value:'YogaWrap.Wrap'},
|
||||
|
||||
CSSNodeCalculateLayout:{value:function(node, dir) {
|
||||
this.push(node + '.StyleDirection = ' + dir + ';');
|
||||
|
@@ -46,7 +46,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
if (experiments.length > 0) {
|
||||
for (var i in experiments) {
|
||||
this.push('CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.' + toJavaUpper(experiments[i]) +', true);');
|
||||
this.push('CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.' + toJavaUpper(experiments[i]) +', true);');
|
||||
}
|
||||
this.push('');
|
||||
}
|
||||
@@ -60,7 +60,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
if (experiments.length > 0) {
|
||||
this.push('');
|
||||
for (var i in experiments) {
|
||||
this.push('CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.' + toJavaUpper(experiments[i]) +', false);');
|
||||
this.push('CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.' + toJavaUpper(experiments[i]) +', false);');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,44 +83,44 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
this.push('assertEquals(' + v0 + 'f, ' + v1 + ', 0.0f);');
|
||||
}},
|
||||
|
||||
CSSAlignAuto:{value:'CSSAlign.AUTO'},
|
||||
CSSAlignCenter:{value:'CSSAlign.CENTER'},
|
||||
CSSAlignFlexEnd:{value:'CSSAlign.FLEX_END'},
|
||||
CSSAlignFlexStart:{value:'CSSAlign.FLEX_START'},
|
||||
CSSAlignStretch:{value:'CSSAlign.STRETCH'},
|
||||
YGAlignAuto:{value:'YogaAlign.AUTO'},
|
||||
YGAlignCenter:{value:'YogaAlign.CENTER'},
|
||||
YGAlignFlexEnd:{value:'YogaAlign.FLEX_END'},
|
||||
YGAlignFlexStart:{value:'YogaAlign.FLEX_START'},
|
||||
YGAlignStretch:{value:'YogaAlign.STRETCH'},
|
||||
|
||||
CSSDirectionInherit:{value:'CSSDirection.INHERIT'},
|
||||
CSSDirectionLTR:{value:'CSSDirection.LTR'},
|
||||
CSSDirectionRTL:{value:'CSSDirection.RTL'},
|
||||
YGDirectionInherit:{value:'YogaDirection.INHERIT'},
|
||||
YGDirectionLTR:{value:'YogaDirection.LTR'},
|
||||
YGDirectionRTL:{value:'YogaDirection.RTL'},
|
||||
|
||||
CSSEdgeBottom:{value:'CSSEdge.BOTTOM'},
|
||||
CSSEdgeEnd:{value:'CSSEdge.END'},
|
||||
CSSEdgeLeft:{value:'CSSEdge.LEFT'},
|
||||
CSSEdgeRight:{value:'CSSEdge.RIGHT'},
|
||||
CSSEdgeStart:{value:'CSSEdge.START'},
|
||||
CSSEdgeTop:{value:'CSSEdge.TOP'},
|
||||
YGEdgeBottom:{value:'YogaEdge.BOTTOM'},
|
||||
YGEdgeEnd:{value:'YogaEdge.END'},
|
||||
YGEdgeLeft:{value:'YogaEdge.LEFT'},
|
||||
YGEdgeRight:{value:'YogaEdge.RIGHT'},
|
||||
YGEdgeStart:{value:'YogaEdge.START'},
|
||||
YGEdgeTop:{value:'YogaEdge.TOP'},
|
||||
|
||||
CSSFlexDirectionColumn:{value:'CSSFlexDirection.COLUMN'},
|
||||
CSSFlexDirectionColumnReverse:{value:'CSSFlexDirection.COLUMN_REVERSE'},
|
||||
CSSFlexDirectionRow:{value:'CSSFlexDirection.ROW'},
|
||||
CSSFlexDirectionRowReverse:{value:'CSSFlexDirection.ROW_REVERSE'},
|
||||
YGFlexDirectionColumn:{value:'YogaFlexDirection.COLUMN'},
|
||||
YGFlexDirectionColumnReverse:{value:'YogaFlexDirection.COLUMN_REVERSE'},
|
||||
YGFlexDirectionRow:{value:'YogaFlexDirection.ROW'},
|
||||
YGFlexDirectionRowReverse:{value:'YogaFlexDirection.ROW_REVERSE'},
|
||||
|
||||
CSSJustifyCenter:{value:'CSSJustify.CENTER'},
|
||||
CSSJustifyFlexEnd:{value:'CSSJustify.FLEX_END'},
|
||||
CSSJustifyFlexStart:{value:'CSSJustify.FLEX_START'},
|
||||
CSSJustifySpaceAround:{value:'CSSJustify.SPACE_AROUND'},
|
||||
CSSJustifySpaceBetween:{value:'CSSJustify.SPACE_BETWEEN'},
|
||||
YGJustifyCenter:{value:'YogaJustify.CENTER'},
|
||||
YGJustifyFlexEnd:{value:'YogaJustify.FLEX_END'},
|
||||
YGJustifyFlexStart:{value:'YogaJustify.FLEX_START'},
|
||||
YGJustifySpaceAround:{value:'YogaJustify.SPACE_AROUND'},
|
||||
YGJustifySpaceBetween:{value:'YogaJustify.SPACE_BETWEEN'},
|
||||
|
||||
CSSOverflowHidden:{value:'CSSOverflow.HIDDEN'},
|
||||
CSSOverflowVisible:{value:'CSSOverflow.VISIBLE'},
|
||||
YGOverflowHidden:{value:'YogaOverflow.HIDDEN'},
|
||||
YGOverflowVisible:{value:'YogaOverflow.VISIBLE'},
|
||||
|
||||
CSSPositionTypeAbsolute:{value:'CSSPositionType.ABSOLUTE'},
|
||||
CSSPositionTypeRelative:{value:'CSSPositionType.RELATIVE'},
|
||||
YGPositionTypeAbsolute:{value:'YogaPositionType.ABSOLUTE'},
|
||||
YGPositionTypeRelative:{value:'YogaPositionType.RELATIVE'},
|
||||
|
||||
CSSUndefined:{value:'CSSConstants.UNDEFINED'},
|
||||
YGUndefined:{value:'YogaConstants.UNDEFINED'},
|
||||
|
||||
CSSWrapNoWrap:{value:'CSSWrap.NO_WRAP'},
|
||||
CSSWrapWrap:{value:'CSSWrap.WRAP'},
|
||||
YGWrapNoWrap:{value:'YogaWrap.NO_WRAP'},
|
||||
YGWrapWrap:{value:'YogaWrap.WRAP'},
|
||||
|
||||
CSSNodeCalculateLayout:{value:function(node, dir) {
|
||||
this.push(node + '.setDirection(' + dir + ');');
|
||||
|
@@ -87,13 +87,13 @@ function printTest(e, LTRContainer, RTLContainer, genericContainer) {
|
||||
'root',
|
||||
null);
|
||||
|
||||
e.CSSNodeCalculateLayout('root', e.CSSDirectionLTR);
|
||||
e.CSSNodeCalculateLayout('root', e.YGDirectionLTR);
|
||||
e.push('');
|
||||
|
||||
assertTestTree(e, LTRLayoutTree[i], 'root', null);
|
||||
e.push('');
|
||||
|
||||
e.CSSNodeCalculateLayout('root', e.CSSDirectionRTL);
|
||||
e.CSSNodeCalculateLayout('root', e.YGDirectionRTL);
|
||||
e.push('');
|
||||
|
||||
assertTestTree(e, RTLLayoutTree[i], 'root', null);
|
||||
@@ -119,7 +119,7 @@ function assertTestTree(e, node, nodeName, parentName) {
|
||||
}
|
||||
|
||||
function checkDefaultValues() {
|
||||
// Sanity check of the CSSLayout default values by test-template.html
|
||||
// Sanity check of the Yoga default values by test-template.html
|
||||
[
|
||||
{style:'flex-direction', value:'column'},
|
||||
{style:'justify-content', value:'flex-start'},
|
||||
@@ -198,83 +198,83 @@ function setupTestTree(e, parent, node, genericNode, nodeName, parentName, index
|
||||
break;
|
||||
case 'left':
|
||||
if (genericNode.rawStyle.indexOf('start:') >= 0) {
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.CSSEdgeStart, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.YGEdgeStart, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.CSSEdgeLeft, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.YGEdgeLeft, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'top':
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.CSSEdgeTop, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.YGEdgeTop, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'right':
|
||||
if (genericNode.rawStyle.indexOf('end:') >= 0) {
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.CSSEdgeEnd, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.YGEdgeEnd, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.CSSEdgeRight, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.YGEdgeRight, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'bottom':
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.CSSEdgeBottom, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPosition(nodeName, e.YGEdgeBottom, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'margin-left':
|
||||
if (genericNode.rawStyle.indexOf('margin-start:') >= 0) {
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.CSSEdgeStart, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.YGEdgeStart, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.CSSEdgeLeft, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.YGEdgeLeft, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'margin-top':
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.CSSEdgeTop, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.YGEdgeTop, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'margin-right':
|
||||
if (genericNode.rawStyle.indexOf('margin-end:') >= 0) {
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.CSSEdgeEnd, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.YGEdgeEnd, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.CSSEdgeRight, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.YGEdgeRight, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'margin-bottom':
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.CSSEdgeBottom, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetMargin(nodeName, e.YGEdgeBottom, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'padding-left':
|
||||
if (genericNode.rawStyle.indexOf('padding-start:') >= 0) {
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.CSSEdgeStart, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.YGEdgeStart, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.CSSEdgeLeft, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.YGEdgeLeft, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'padding-top':
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.CSSEdgeTop, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.YGEdgeTop, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'padding-right':
|
||||
if (genericNode.rawStyle.indexOf('padding-end:') >= 0) {
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.CSSEdgeEnd, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.YGEdgeEnd, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.CSSEdgeRight, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.YGEdgeRight, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'padding-bottom':
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.CSSEdgeBottom, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetPadding(nodeName, e.YGEdgeBottom, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'border-left-width':
|
||||
if (genericNode.rawStyle.indexOf('border-start-width:') >= 0) {
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.CSSEdgeStart, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.YGEdgeStart, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.CSSEdgeLeft, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.YGEdgeLeft, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'border-top-width':
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.CSSEdgeTop, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.YGEdgeTop, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'border-right-width':
|
||||
if (genericNode.rawStyle.indexOf('border-end-width:') >= 0) {
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.CSSEdgeEnd, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.YGEdgeEnd, pixelValue(e, node.style[style]));
|
||||
} else {
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.CSSEdgeRight, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.YGEdgeRight, pixelValue(e, node.style[style]));
|
||||
}
|
||||
break;
|
||||
case 'border-bottom-width':
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.CSSEdgeBottom, pixelValue(e, node.style[style]));
|
||||
e.CSSNodeStyleSetBorder(nodeName, e.YGEdgeBottom, pixelValue(e, node.style[style]));
|
||||
break;
|
||||
case 'width':
|
||||
e.CSSNodeStyleSetWidth(nodeName, pixelValue(e, node.style[style]));
|
||||
@@ -318,66 +318,66 @@ function setupTestTree(e, parent, node, genericNode, nodeName, parentName, index
|
||||
|
||||
function overflowValue(e, value) {
|
||||
switch (value) {
|
||||
case 'visible': return e.CSSOverflowVisible;
|
||||
case 'hidden': return e.CSSOverflowHidden;
|
||||
case 'visible': return e.YGOverflowVisible;
|
||||
case 'hidden': return e.YGOverflowHidden;
|
||||
}
|
||||
}
|
||||
|
||||
function wrapValue(e, value) {
|
||||
switch (value) {
|
||||
case 'wrap': return e.CSSWrapWrap;
|
||||
case 'nowrap': return e.CSSWrapNoWrap;
|
||||
case 'wrap': return e.YGWrapWrap;
|
||||
case 'nowrap': return e.YGWrapNoWrap;
|
||||
}
|
||||
}
|
||||
|
||||
function flexDirectionValue(e, value) {
|
||||
switch (value) {
|
||||
case 'row': return e.CSSFlexDirectionRow;
|
||||
case 'row-reverse': return e.CSSFlexDirectionRowReverse;
|
||||
case 'column': return e.CSSFlexDirectionColumn;
|
||||
case 'column-reverse': return e.CSSFlexDirectionColumnReverse;
|
||||
case 'row': return e.YGFlexDirectionRow;
|
||||
case 'row-reverse': return e.YGFlexDirectionRowReverse;
|
||||
case 'column': return e.YGFlexDirectionColumn;
|
||||
case 'column-reverse': return e.YGFlexDirectionColumnReverse;
|
||||
}
|
||||
}
|
||||
|
||||
function justifyValue(e, value) {
|
||||
switch (value) {
|
||||
case 'center': return e.CSSJustifyCenter;
|
||||
case 'space-around': return e.CSSJustifySpaceAround;
|
||||
case 'space-between': return e.CSSJustifySpaceBetween;
|
||||
case 'flex-start': return e.CSSJustifyFlexStart;
|
||||
case 'flex-end': return e.CSSJustifyFlexEnd;
|
||||
case 'center': return e.YGJustifyCenter;
|
||||
case 'space-around': return e.YGJustifySpaceAround;
|
||||
case 'space-between': return e.YGJustifySpaceBetween;
|
||||
case 'flex-start': return e.YGJustifyFlexStart;
|
||||
case 'flex-end': return e.YGJustifyFlexEnd;
|
||||
}
|
||||
}
|
||||
|
||||
function positionValue(e, value) {
|
||||
switch (value) {
|
||||
case 'absolute': return e.CSSPositionTypeAbsolute;
|
||||
default: return e.CSSPositionTypeRelative
|
||||
case 'absolute': return e.YGPositionTypeAbsolute;
|
||||
default: return e.YGPositionTypeRelative
|
||||
}
|
||||
}
|
||||
|
||||
function directionValue(e, value) {
|
||||
switch (value) {
|
||||
case 'ltr': return e.CSSDirectionLTR;
|
||||
case 'rtl': return e.CSSDirectionRTL;
|
||||
case 'inherit': return e.CSSDirectionInherit;
|
||||
case 'ltr': return e.YGDirectionLTR;
|
||||
case 'rtl': return e.YGDirectionRTL;
|
||||
case 'inherit': return e.YGDirectionInherit;
|
||||
}
|
||||
}
|
||||
|
||||
function alignValue(e, value) {
|
||||
switch (value) {
|
||||
case 'auto': return e.CSSAlignAuto;
|
||||
case 'center': return e.CSSAlignCenter;
|
||||
case 'stretch': return e.CSSAlignStretch;
|
||||
case 'flex-start': return e.CSSAlignFlexStart;
|
||||
case 'flex-end': return e.CSSAlignFlexEnd;
|
||||
case 'auto': return e.YGAlignAuto;
|
||||
case 'center': return e.YGAlignCenter;
|
||||
case 'stretch': return e.YGAlignStretch;
|
||||
case 'flex-start': return e.YGAlignFlexStart;
|
||||
case 'flex-end': return e.YGAlignFlexEnd;
|
||||
}
|
||||
}
|
||||
|
||||
function pixelValue(e, value) {
|
||||
switch (value) {
|
||||
case 'auto': return e.CSSUndefined;
|
||||
case 'undefined': return e.CSSUndefined;
|
||||
case 'auto': return e.YGUndefined;
|
||||
case 'undefined': return e.YGUndefined;
|
||||
default: return value.replace('px', '');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user