Move configuration to new YGConfig and pass them down to CalculateLayout
Summary: Move configuration to new ```YGConfig``` and pass them down to CalculateLayout. See #418 . Adds ```YGConfigNew()``` + ```YGConfigFree```, and changed ```YGSetExperimentalFeatureEnabled``` to use the config. New function for calculation is ```YGNodeCalculateLayoutWithConfig```. Closes https://github.com/facebook/yoga/pull/432 Reviewed By: astreet Differential Revision: D4611359 Pulled By: emilsjolander fbshipit-source-id: a1332f0e1b21cec02129dd021ee57408449e10b0
This commit is contained in:
committed by
Facebook Github Bot
parent
8668e43f6d
commit
37c48257ae
@@ -13,33 +13,33 @@ var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
|
||||
|
||||
it("align_content_flex_start", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(130);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(10);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root_child4.setHeight(10);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -114,30 +114,30 @@ it("align_content_flex_start", function () {
|
||||
});
|
||||
it("align_content_flex_start_without_height_on_children", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(10);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -211,36 +211,36 @@ it("align_content_flex_start_without_height_on_children", function () {
|
||||
});
|
||||
it("align_content_flex_start_with_flex", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(120);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setFlexGrow(1);
|
||||
root_child3.setFlexShrink(1);
|
||||
root_child3.setFlexBasis("0%");
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -314,33 +314,33 @@ it("align_content_flex_start_with_flex", function () {
|
||||
});
|
||||
it("align_content_flex_end", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Yoga.ALIGN_FLEX_END);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(10);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root_child4.setHeight(10);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -415,29 +415,29 @@ it("align_content_flex_end", function () {
|
||||
});
|
||||
it("align_content_stretch", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -511,34 +511,34 @@ it("align_content_stretch", function () {
|
||||
});
|
||||
it("align_content_spacebetween", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(130);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(10);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root_child4.setHeight(10);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -613,34 +613,34 @@ it("align_content_spacebetween", function () {
|
||||
});
|
||||
it("align_content_spacearound", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_SPACE_AROUND);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(140);
|
||||
root.setHeight(120);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(10);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root_child4.setHeight(10);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -715,30 +715,30 @@ it("align_content_spacearound", function () {
|
||||
});
|
||||
it("align_content_stretch_row", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -812,36 +812,36 @@ it("align_content_stretch_row", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_children", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child0_child0 = Yoga.Node.create();
|
||||
var root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.setFlexBasis("0%");
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -925,36 +925,36 @@ it("align_content_stretch_row_with_children", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_flex", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setFlexGrow(1);
|
||||
root_child3.setFlexShrink(1);
|
||||
root_child3.setFlexBasis("0%");
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1028,35 +1028,35 @@ it("align_content_stretch_row_with_flex", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_flex_no_shrink", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setFlexGrow(1);
|
||||
root_child3.setFlexBasis("0%");
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1130,18 +1130,18 @@ it("align_content_stretch_row_with_flex_no_shrink", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_margin", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setMargin(Yoga.EDGE_LEFT, 10);
|
||||
root_child1.setMargin(Yoga.EDGE_TOP, 10);
|
||||
root_child1.setMargin(Yoga.EDGE_RIGHT, 10);
|
||||
@@ -1149,11 +1149,11 @@ it("align_content_stretch_row_with_margin", function () {
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setMargin(Yoga.EDGE_LEFT, 10);
|
||||
root_child3.setMargin(Yoga.EDGE_TOP, 10);
|
||||
root_child3.setMargin(Yoga.EDGE_RIGHT, 10);
|
||||
@@ -1161,7 +1161,7 @@ it("align_content_stretch_row_with_margin", function () {
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1235,18 +1235,18 @@ it("align_content_stretch_row_with_margin", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_padding", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPadding(Yoga.EDGE_LEFT, 10);
|
||||
root_child1.setPadding(Yoga.EDGE_TOP, 10);
|
||||
root_child1.setPadding(Yoga.EDGE_RIGHT, 10);
|
||||
@@ -1254,11 +1254,11 @@ it("align_content_stretch_row_with_padding", function () {
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPadding(Yoga.EDGE_LEFT, 10);
|
||||
root_child3.setPadding(Yoga.EDGE_TOP, 10);
|
||||
root_child3.setPadding(Yoga.EDGE_RIGHT, 10);
|
||||
@@ -1266,7 +1266,7 @@ it("align_content_stretch_row_with_padding", function () {
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1340,18 +1340,18 @@ it("align_content_stretch_row_with_padding", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_single_row", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1395,31 +1395,31 @@ it("align_content_stretch_row_with_single_row", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_fixed_height", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(60);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1493,31 +1493,31 @@ it("align_content_stretch_row_with_fixed_height", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_max_height", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setMaxHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1591,31 +1591,31 @@ it("align_content_stretch_row_with_max_height", function () {
|
||||
});
|
||||
it("align_content_stretch_row_with_min_height", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setMinHeight(80);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setWidth(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1689,38 +1689,38 @@ it("align_content_stretch_row_with_min_height", function () {
|
||||
});
|
||||
it("align_content_stretch_column", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(150);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child0_child0 = Yoga.Node.create();
|
||||
var root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.setFlexBasis("0%");
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setHeight(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setHeight(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
var root_child4 = Yoga.Node.create();
|
||||
var root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setHeight(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -1804,10 +1804,10 @@ it("align_content_stretch_column", function () {
|
||||
});
|
||||
it("align_content_stretch_is_not_overriding_align_items", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
@@ -1815,7 +1815,7 @@ it("align_content_stretch_is_not_overriding_align_items", function () {
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child0_child0 = Yoga.Node.create();
|
||||
var root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0_child0.setHeight(10);
|
||||
|
Reference in New Issue
Block a user