rename CSSWrapType to shorter CSSWrap matching java and csharp

Summary: Java and csharp already use CSSWrap and not CSSWrapType. Let's consolidate and stick with the shorter of the two.

Reviewed By: gkassabli

Differential Revision: D4174257

fbshipit-source-id: ba0bfab996ba158b07863d8c72cf2a41262c9592
This commit is contained in:
Emil Sjolander
2016-11-14 03:27:31 -08:00
committed by Facebook Github Bot
parent 7a3df9999b
commit b99172d28b
12 changed files with 28 additions and 28 deletions

View File

@@ -69,7 +69,7 @@ typedef struct CSSStyle {
CSSAlign alignItems; CSSAlign alignItems;
CSSAlign alignSelf; CSSAlign alignSelf;
CSSPositionType positionType; CSSPositionType positionType;
CSSWrapType flexWrap; CSSWrap flexWrap;
CSSOverflow overflow; CSSOverflow overflow;
float flex; float flex;
float flexGrow; float flexGrow;
@@ -423,7 +423,7 @@ CSS_NODE_STYLE_PROPERTY_IMPL(CSSAlign, AlignContent, alignContent, alignContent)
CSS_NODE_STYLE_PROPERTY_IMPL(CSSAlign, AlignItems, alignItems, alignItems); CSS_NODE_STYLE_PROPERTY_IMPL(CSSAlign, AlignItems, alignItems, alignItems);
CSS_NODE_STYLE_PROPERTY_IMPL(CSSAlign, AlignSelf, alignSelf, alignSelf); CSS_NODE_STYLE_PROPERTY_IMPL(CSSAlign, AlignSelf, alignSelf, alignSelf);
CSS_NODE_STYLE_PROPERTY_IMPL(CSSPositionType, PositionType, positionType, positionType); CSS_NODE_STYLE_PROPERTY_IMPL(CSSPositionType, PositionType, positionType, positionType);
CSS_NODE_STYLE_PROPERTY_IMPL(CSSWrapType, FlexWrap, flexWrap, flexWrap); CSS_NODE_STYLE_PROPERTY_IMPL(CSSWrap, FlexWrap, flexWrap, flexWrap);
CSS_NODE_STYLE_PROPERTY_IMPL(CSSOverflow, Overflow, overflow, overflow); CSS_NODE_STYLE_PROPERTY_IMPL(CSSOverflow, Overflow, overflow, overflow);
CSS_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexGrow, flexGrow, flexGrow); CSS_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexGrow, flexGrow, flexGrow);
@@ -1395,7 +1395,7 @@ static void layoutNodeImpl(const CSSNodeRef node,
const CSSFlexDirection crossAxis = getCrossFlexDirection(mainAxis, direction); const CSSFlexDirection crossAxis = getCrossFlexDirection(mainAxis, direction);
const bool isMainAxisRow = isRowDirection(mainAxis); const bool isMainAxisRow = isRowDirection(mainAxis);
const CSSJustify justifyContent = node->style.justifyContent; const CSSJustify justifyContent = node->style.justifyContent;
const bool isNodeFlexWrap = node->style.flexWrap == CSSWrapTypeWrap; const bool isNodeFlexWrap = node->style.flexWrap == CSSWrapWrap;
CSSNodeRef firstAbsoluteChild = NULL; CSSNodeRef firstAbsoluteChild = NULL;
CSSNodeRef currentAbsoluteChild = NULL; CSSNodeRef currentAbsoluteChild = NULL;

View File

@@ -74,10 +74,10 @@ typedef enum CSSPositionType {
CSSPositionTypeAbsolute, CSSPositionTypeAbsolute,
} CSSPositionType; } CSSPositionType;
typedef enum CSSWrapType { typedef enum CSSWrap {
CSSWrapTypeNoWrap, CSSWrapNoWrap,
CSSWrapTypeWrap, CSSWrapWrap,
} CSSWrapType; } CSSWrap;
typedef enum CSSMeasureMode { typedef enum CSSMeasureMode {
CSSMeasureModeUndefined, CSSMeasureModeUndefined,
@@ -207,7 +207,7 @@ CSS_NODE_STYLE_PROPERTY(CSSAlign, AlignContent, alignContent);
CSS_NODE_STYLE_PROPERTY(CSSAlign, AlignItems, alignItems); CSS_NODE_STYLE_PROPERTY(CSSAlign, AlignItems, alignItems);
CSS_NODE_STYLE_PROPERTY(CSSAlign, AlignSelf, alignSelf); CSS_NODE_STYLE_PROPERTY(CSSAlign, AlignSelf, alignSelf);
CSS_NODE_STYLE_PROPERTY(CSSPositionType, PositionType, positionType); CSS_NODE_STYLE_PROPERTY(CSSPositionType, PositionType, positionType);
CSS_NODE_STYLE_PROPERTY(CSSWrapType, FlexWrap, flexWrap); CSS_NODE_STYLE_PROPERTY(CSSWrap, FlexWrap, flexWrap);
CSS_NODE_STYLE_PROPERTY(CSSOverflow, Overflow, overflow); CSS_NODE_STYLE_PROPERTY(CSSOverflow, Overflow, overflow);
WIN_EXPORT void CSSNodeStyleSetFlex(const CSSNodeRef node, const float flex); WIN_EXPORT void CSSNodeStyleSetFlex(const CSSNodeRef node, const float flex);

View File

@@ -24,7 +24,7 @@
- (void)css_setAlignItems:(CSSAlign)alignItems; - (void)css_setAlignItems:(CSSAlign)alignItems;
- (void)css_setAlignSelf:(CSSAlign)alignSelf; - (void)css_setAlignSelf:(CSSAlign)alignSelf;
- (void)css_setPositionType:(CSSPositionType)positionType; - (void)css_setPositionType:(CSSPositionType)positionType;
- (void)css_setFlexWrap:(CSSWrapType)flexWrap; - (void)css_setFlexWrap:(CSSWrap)flexWrap;
- (void)css_setFlexGrow:(CGFloat)flexGrow; - (void)css_setFlexGrow:(CGFloat)flexGrow;
- (void)css_setFlexShrink:(CGFloat)flexShrink; - (void)css_setFlexShrink:(CGFloat)flexShrink;

View File

@@ -85,7 +85,7 @@
CSSNodeStyleSetPositionType([self cssNode], positionType); CSSNodeStyleSetPositionType([self cssNode], positionType);
} }
- (void)css_setFlexWrap:(CSSWrapType)flexWrap - (void)css_setFlexWrap:(CSSWrap)flexWrap
{ {
CSSNodeStyleSetFlexWrap([self cssNode], flexWrap); CSSNodeStyleSetFlexWrap([self cssNode], flexWrap);
} }

View File

@@ -84,8 +84,8 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
CSSPositionTypeAbsolute:{value:'CSSPositionTypeAbsolute'}, CSSPositionTypeAbsolute:{value:'CSSPositionTypeAbsolute'},
CSSPositionTypeRelative:{value:'CSSPositionTypeRelative'}, CSSPositionTypeRelative:{value:'CSSPositionTypeRelative'},
CSSWrapTypeNoWrap:{value:'CSSWrapTypeNoWrap'}, CSSWrapNoWrap:{value:'CSSWrapNoWrap'},
CSSWrapTypeWrap:{value:'CSSWrapTypeWrap'}, CSSWrapWrap:{value:'CSSWrapWrap'},
CSSUndefined:{value:'CSSUndefined'}, CSSUndefined:{value:'CSSUndefined'},

View File

@@ -100,8 +100,8 @@ CSEmitter.prototype = Object.create(Emitter.prototype, {
CSSUndefined:{value:'CSSConstants.Undefined'}, CSSUndefined:{value:'CSSConstants.Undefined'},
CSSWrapTypeNoWrap:{value:'CSSWrap.NoWrap'}, CSSWrapNoWrap:{value:'CSSWrap.NoWrap'},
CSSWrapTypeWrap:{value:'CSSWrap.Wrap'}, CSSWrapWrap:{value:'CSSWrap.Wrap'},
CSSNodeCalculateLayout:{value:function(node, dir) { CSSNodeCalculateLayout:{value:function(node, dir) {
this.push(node + '.StyleDirection = ' + dir + ';'); this.push(node + '.StyleDirection = ' + dir + ';');

View File

@@ -93,8 +93,8 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
CSSUndefined:{value:'CSSConstants.UNDEFINED'}, CSSUndefined:{value:'CSSConstants.UNDEFINED'},
CSSWrapTypeNoWrap:{value:'CSSWrap.NO_WRAP'}, CSSWrapNoWrap:{value:'CSSWrap.NO_WRAP'},
CSSWrapTypeWrap:{value:'CSSWrap.WRAP'}, CSSWrapWrap:{value:'CSSWrap.WRAP'},
CSSNodeCalculateLayout:{value:function(node, dir) { CSSNodeCalculateLayout:{value:function(node, dir) {
this.push(node + '.setDirection(' + dir + ');'); this.push(node + '.setDirection(' + dir + ');');

View File

@@ -354,8 +354,8 @@ function overflowValue(e, value) {
function wrapValue(e, value) { function wrapValue(e, value) {
switch (value) { switch (value) {
case 'wrap': return e.CSSWrapTypeWrap; case 'wrap': return e.CSSWrapWrap;
case 'nowrap': return e.CSSWrapTypeNoWrap; case 'nowrap': return e.CSSWrapNoWrap;
} }
} }

View File

@@ -203,7 +203,7 @@ CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignItems);
CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignSelf); CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignSelf);
CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignContent); CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignContent);
CSS_NODE_JNI_STYLE_PROP(jint, CSSPositionType, PositionType); CSS_NODE_JNI_STYLE_PROP(jint, CSSPositionType, PositionType);
CSS_NODE_JNI_STYLE_PROP(jint, CSSWrapType, FlexWrap); CSS_NODE_JNI_STYLE_PROP(jint, CSSWrap, FlexWrap);
CSS_NODE_JNI_STYLE_PROP(jint, CSSOverflow, Overflow); CSS_NODE_JNI_STYLE_PROP(jint, CSSOverflow, Overflow);
void jni_CSSNodeStyleSetFlex(alias_ref<jobject>, jlong nativePointer, jfloat value) { void jni_CSSNodeStyleSetFlex(alias_ref<jobject>, jlong nativePointer, jfloat value) {

View File

@@ -49,7 +49,7 @@
TEST(CSSLayoutTest, align_content_flex_start) { TEST(CSSLayoutTest, align_content_flex_start) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetWidth(root, 100); CSSNodeStyleSetWidth(root, 100);
CSSNodeStyleSetHeight(root, 100); CSSNodeStyleSetHeight(root, 100);
@@ -147,7 +147,7 @@ TEST(CSSLayoutTest, align_content_flex_start) {
TEST(CSSLayoutTest, align_content_flex_end) { TEST(CSSLayoutTest, align_content_flex_end) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetAlignContent(root, CSSAlignFlexEnd); CSSNodeStyleSetAlignContent(root, CSSAlignFlexEnd);
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetWidth(root, 100); CSSNodeStyleSetWidth(root, 100);
CSSNodeStyleSetHeight(root, 100); CSSNodeStyleSetHeight(root, 100);
@@ -245,7 +245,7 @@ TEST(CSSLayoutTest, align_content_flex_end) {
TEST(CSSLayoutTest, align_content_center) { TEST(CSSLayoutTest, align_content_center) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetAlignContent(root, CSSAlignCenter); CSSNodeStyleSetAlignContent(root, CSSAlignCenter);
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetWidth(root, 100); CSSNodeStyleSetWidth(root, 100);
CSSNodeStyleSetHeight(root, 100); CSSNodeStyleSetHeight(root, 100);
@@ -343,7 +343,7 @@ TEST(CSSLayoutTest, align_content_center) {
TEST(CSSLayoutTest, align_content_stretch) { TEST(CSSLayoutTest, align_content_stretch) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetAlignContent(root, CSSAlignStretch); CSSNodeStyleSetAlignContent(root, CSSAlignStretch);
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetWidth(root, 100); CSSNodeStyleSetWidth(root, 100);
CSSNodeStyleSetHeight(root, 100); CSSNodeStyleSetHeight(root, 100);

View File

@@ -23,7 +23,7 @@ TEST(CSSLayoutTest, assert_default_values) {
ASSERT_EQ(CSSAlignStretch, CSSNodeStyleGetAlignItems(root)); ASSERT_EQ(CSSAlignStretch, CSSNodeStyleGetAlignItems(root));
ASSERT_EQ(CSSAlignAuto, CSSNodeStyleGetAlignSelf(root)); ASSERT_EQ(CSSAlignAuto, CSSNodeStyleGetAlignSelf(root));
ASSERT_EQ(CSSPositionTypeRelative, CSSNodeStyleGetPositionType(root)); ASSERT_EQ(CSSPositionTypeRelative, CSSNodeStyleGetPositionType(root));
ASSERT_EQ(CSSWrapTypeNoWrap, CSSNodeStyleGetFlexWrap(root)); ASSERT_EQ(CSSWrapNoWrap, CSSNodeStyleGetFlexWrap(root));
ASSERT_EQ(CSSOverflowVisible, CSSNodeStyleGetOverflow(root)); ASSERT_EQ(CSSOverflowVisible, CSSNodeStyleGetOverflow(root));
ASSERT_EQ(0, CSSNodeStyleGetFlexGrow(root)); ASSERT_EQ(0, CSSNodeStyleGetFlexGrow(root));
ASSERT_EQ(0, CSSNodeStyleGetFlexShrink(root)); ASSERT_EQ(0, CSSNodeStyleGetFlexShrink(root));

View File

@@ -45,7 +45,7 @@
TEST(CSSLayoutTest, wrap_column) { TEST(CSSLayoutTest, wrap_column) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetHeight(root, 100); CSSNodeStyleSetHeight(root, 100);
const CSSNodeRef root_child0 = CSSNodeNew(); const CSSNodeRef root_child0 = CSSNodeNew();
@@ -127,7 +127,7 @@ TEST(CSSLayoutTest, wrap_column) {
TEST(CSSLayoutTest, wrap_row) { TEST(CSSLayoutTest, wrap_row) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetFlexDirection(root, CSSFlexDirectionRow); CSSNodeStyleSetFlexDirection(root, CSSFlexDirectionRow);
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetWidth(root, 100); CSSNodeStyleSetWidth(root, 100);
const CSSNodeRef root_child0 = CSSNodeNew(); const CSSNodeRef root_child0 = CSSNodeNew();
@@ -210,7 +210,7 @@ TEST(CSSLayoutTest, wrap_row_align_items_flex_end) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetFlexDirection(root, CSSFlexDirectionRow); CSSNodeStyleSetFlexDirection(root, CSSFlexDirectionRow);
CSSNodeStyleSetAlignItems(root, CSSAlignFlexEnd); CSSNodeStyleSetAlignItems(root, CSSAlignFlexEnd);
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetWidth(root, 100); CSSNodeStyleSetWidth(root, 100);
const CSSNodeRef root_child0 = CSSNodeNew(); const CSSNodeRef root_child0 = CSSNodeNew();
@@ -293,7 +293,7 @@ TEST(CSSLayoutTest, wrap_row_align_items_center) {
const CSSNodeRef root = CSSNodeNew(); const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetFlexDirection(root, CSSFlexDirectionRow); CSSNodeStyleSetFlexDirection(root, CSSFlexDirectionRow);
CSSNodeStyleSetAlignItems(root, CSSAlignCenter); CSSNodeStyleSetAlignItems(root, CSSAlignCenter);
CSSNodeStyleSetFlexWrap(root, CSSWrapTypeWrap); CSSNodeStyleSetFlexWrap(root, CSSWrapWrap);
CSSNodeStyleSetWidth(root, 100); CSSNodeStyleSetWidth(root, 100);
const CSSNodeRef root_child0 = CSSNodeNew(); const CSSNodeRef root_child0 = CSSNodeNew();