Alter layout engine to conform closer to W3C spec #185
14
dist/css-layout.h
vendored
14
dist/css-layout.h
vendored
@@ -1171,7 +1171,8 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
remainingFreeSpace = -sizeConsumedOnCurrentLine;
|
||||
}
|
||||
|
||||
float remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
float originalRemainingFreeSpace = remainingFreeSpace;
|
||||
float deltaFreeSpace = 0;
|
||||
|
||||
if (!canSkipFlex) {
|
||||
float childFlexBasis;
|
||||
@@ -1194,7 +1195,6 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
// concerns because we know exactly how many passes it'll do.
|
||||
|
||||
// First pass: detect the flex items whose min/max constraints trigger
|
||||
float deltaFreeSpace = 0;
|
||||
float deltaFlexShrinkScaledFactors = 0;
|
||||
float deltaFlexGrowFactors = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
@@ -1213,7 +1213,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor;
|
||||
}
|
||||
}
|
||||
@@ -1229,7 +1229,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexGrowFactors -= flexGrowFactor;
|
||||
}
|
||||
}
|
||||
@@ -1241,9 +1241,9 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
totalFlexShrinkScaledFactors += deltaFlexShrinkScaledFactors;
|
||||
totalFlexGrowFactors += deltaFlexGrowFactors;
|
||||
remainingFreeSpace += deltaFreeSpace;
|
||||
remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
|
||||
// Second pass: resolve the sizes of the flexible items
|
||||
deltaFreeSpace = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
while (currentRelativeChild != NULL) {
|
||||
childFlexBasis = currentRelativeChild->layout.flex_basis;
|
||||
@@ -1267,7 +1267,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpaceAfterFlex -= updatedMainSize - childFlexBasis;
|
||||
deltaFreeSpace -= updatedMainSize - childFlexBasis;
|
||||
|
||||
if (isMainAxisRow) {
|
||||
childWidth = updatedMainSize + getMarginAxis(currentRelativeChild, CSS_FLEX_DIRECTION_ROW);
|
||||
@@ -1303,7 +1303,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpace = remainingFreeSpaceAfterFlex;
|
||||
remainingFreeSpace = originalRemainingFreeSpace + deltaFreeSpace;
|
||||
|
||||
// STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION
|
||||
|
||||
|
BIN
dist/css-layout.jar
vendored
BIN
dist/css-layout.jar
vendored
Binary file not shown.
14
dist/css-layout.js
vendored
14
dist/css-layout.js
vendored
@@ -935,7 +935,8 @@ var computeLayout = (function() {
|
||||
remainingFreeSpace = -sizeConsumedOnCurrentLine;
|
||||
}
|
||||
|
||||
var/*float*/ remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
var/*float*/ originalRemainingFreeSpace = remainingFreeSpace;
|
||||
var/*float*/ deltaFreeSpace = 0;
|
||||
|
||||
if (!canSkipFlex) {
|
||||
var/*float*/ childFlexBasis;
|
||||
@@ -958,7 +959,6 @@ var computeLayout = (function() {
|
||||
// concerns because we know exactly how many passes it'll do.
|
||||
|
||||
// First pass: detect the flex items whose min/max constraints trigger
|
||||
var/*float*/ deltaFreeSpace = 0;
|
||||
var/*float*/ deltaFlexShrinkScaledFactors = 0;
|
||||
var/*float*/ deltaFlexGrowFactors = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
@@ -977,7 +977,7 @@ var computeLayout = (function() {
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor;
|
||||
}
|
||||
}
|
||||
@@ -993,7 +993,7 @@ var computeLayout = (function() {
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexGrowFactors -= flexGrowFactor;
|
||||
}
|
||||
}
|
||||
@@ -1005,9 +1005,9 @@ var computeLayout = (function() {
|
||||
totalFlexShrinkScaledFactors += deltaFlexShrinkScaledFactors;
|
||||
totalFlexGrowFactors += deltaFlexGrowFactors;
|
||||
remainingFreeSpace += deltaFreeSpace;
|
||||
remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
|
||||
// Second pass: resolve the sizes of the flexible items
|
||||
deltaFreeSpace = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
while (currentRelativeChild !== undefined) {
|
||||
childFlexBasis = currentRelativeChild.layout.flexBasis;
|
||||
@@ -1031,7 +1031,7 @@ var computeLayout = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpaceAfterFlex -= updatedMainSize - childFlexBasis;
|
||||
deltaFreeSpace -= updatedMainSize - childFlexBasis;
|
||||
|
||||
if (isMainAxisRow) {
|
||||
childWidth = updatedMainSize + getMarginAxis(currentRelativeChild, CSS_FLEX_DIRECTION_ROW);
|
||||
@@ -1067,7 +1067,7 @@ var computeLayout = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpace = remainingFreeSpaceAfterFlex;
|
||||
remainingFreeSpace = originalRemainingFreeSpace + deltaFreeSpace;
|
||||
|
||||
// STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION
|
||||
|
||||
|
2
dist/css-layout.min.js
vendored
2
dist/css-layout.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/css-layout.min.js.map
vendored
2
dist/css-layout.min.js.map
vendored
File diff suppressed because one or more lines are too long
14
src/Layout.c
14
src/Layout.c
@@ -966,7 +966,8 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
remainingFreeSpace = -sizeConsumedOnCurrentLine;
|
||||
}
|
||||
|
||||
float remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
float originalRemainingFreeSpace = remainingFreeSpace;
|
||||
float deltaFreeSpace = 0;
|
||||
|
||||
if (!canSkipFlex) {
|
||||
float childFlexBasis;
|
||||
@@ -989,7 +990,6 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
// concerns because we know exactly how many passes it'll do.
|
||||
|
||||
// First pass: detect the flex items whose min/max constraints trigger
|
||||
float deltaFreeSpace = 0;
|
||||
float deltaFlexShrinkScaledFactors = 0;
|
||||
float deltaFlexGrowFactors = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
@@ -1008,7 +1008,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor;
|
||||
}
|
||||
}
|
||||
@@ -1024,7 +1024,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexGrowFactors -= flexGrowFactor;
|
||||
}
|
||||
}
|
||||
@@ -1036,9 +1036,9 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
totalFlexShrinkScaledFactors += deltaFlexShrinkScaledFactors;
|
||||
totalFlexGrowFactors += deltaFlexGrowFactors;
|
||||
remainingFreeSpace += deltaFreeSpace;
|
||||
remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
|
||||
// Second pass: resolve the sizes of the flexible items
|
||||
deltaFreeSpace = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
while (currentRelativeChild != NULL) {
|
||||
childFlexBasis = currentRelativeChild->layout.flex_basis;
|
||||
@@ -1062,7 +1062,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpaceAfterFlex -= updatedMainSize - childFlexBasis;
|
||||
deltaFreeSpace -= updatedMainSize - childFlexBasis;
|
||||
|
||||
if (isMainAxisRow) {
|
||||
childWidth = updatedMainSize + getMarginAxis(currentRelativeChild, CSS_FLEX_DIRECTION_ROW);
|
||||
@@ -1098,7 +1098,7 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpace = remainingFreeSpaceAfterFlex;
|
||||
remainingFreeSpace = originalRemainingFreeSpace + deltaFreeSpace;
|
||||
|
||||
// STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION
|
||||
|
||||
|
@@ -916,7 +916,8 @@ var computeLayout = (function() {
|
||||
remainingFreeSpace = -sizeConsumedOnCurrentLine;
|
||||
}
|
||||
|
||||
var/*float*/ remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
var/*float*/ originalRemainingFreeSpace = remainingFreeSpace;
|
||||
var/*float*/ deltaFreeSpace = 0;
|
||||
|
||||
if (!canSkipFlex) {
|
||||
var/*float*/ childFlexBasis;
|
||||
@@ -939,7 +940,6 @@ var computeLayout = (function() {
|
||||
// concerns because we know exactly how many passes it'll do.
|
||||
|
||||
// First pass: detect the flex items whose min/max constraints trigger
|
||||
var/*float*/ deltaFreeSpace = 0;
|
||||
var/*float*/ deltaFlexShrinkScaledFactors = 0;
|
||||
var/*float*/ deltaFlexGrowFactors = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
@@ -958,7 +958,7 @@ var computeLayout = (function() {
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor;
|
||||
}
|
||||
}
|
||||
@@ -974,7 +974,7 @@ var computeLayout = (function() {
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexGrowFactors -= flexGrowFactor;
|
||||
}
|
||||
}
|
||||
@@ -986,9 +986,9 @@ var computeLayout = (function() {
|
||||
totalFlexShrinkScaledFactors += deltaFlexShrinkScaledFactors;
|
||||
totalFlexGrowFactors += deltaFlexGrowFactors;
|
||||
remainingFreeSpace += deltaFreeSpace;
|
||||
remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
|
||||
// Second pass: resolve the sizes of the flexible items
|
||||
deltaFreeSpace = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
while (currentRelativeChild !== undefined) {
|
||||
childFlexBasis = currentRelativeChild.layout.flexBasis;
|
||||
@@ -1012,7 +1012,7 @@ var computeLayout = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpaceAfterFlex -= updatedMainSize - childFlexBasis;
|
||||
deltaFreeSpace -= updatedMainSize - childFlexBasis;
|
||||
|
||||
if (isMainAxisRow) {
|
||||
childWidth = updatedMainSize + getMarginAxis(currentRelativeChild, CSS_FLEX_DIRECTION_ROW);
|
||||
@@ -1048,7 +1048,7 @@ var computeLayout = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpace = remainingFreeSpaceAfterFlex;
|
||||
remainingFreeSpace = originalRemainingFreeSpace + deltaFreeSpace;
|
||||
|
||||
// STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION
|
||||
|
||||
|
@@ -6923,6 +6923,93 @@ int main()
|
||||
test("should layout node with position absolute, top and left and min bounds", root_node, root_layout);
|
||||
}
|
||||
|
||||
{
|
||||
css_node_t *root_node = new_test_css_node();
|
||||
{
|
||||
css_node_t *node_0 = root_node;
|
||||
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
|
||||
node_0->style.justify_content = CSS_JUSTIFY_CENTER;
|
||||
node_0->style.dimensions[CSS_WIDTH] = 1000;
|
||||
node_0->style.dimensions[CSS_HEIGHT] = 1000;
|
||||
init_css_node_children(node_0, 1);
|
||||
{
|
||||
css_node_t *node_1;
|
||||
node_1 = node_0->get_child(node_0->context, 0);
|
||||
node_1->style.flex = 1;
|
||||
node_1->style.dimensions[CSS_HEIGHT] = 1000;
|
||||
node_1->style.maxDimensions[CSS_WIDTH] = 600;
|
||||
}
|
||||
}
|
||||
|
||||
css_node_t *root_layout = new_test_css_node();
|
||||
{
|
||||
css_node_t *node_0 = root_layout;
|
||||
node_0->layout.position[CSS_TOP] = 0;
|
||||
node_0->layout.position[CSS_LEFT] = 0;
|
||||
node_0->layout.dimensions[CSS_WIDTH] = 1000;
|
||||
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
|
||||
init_css_node_children(node_0, 1);
|
||||
{
|
||||
css_node_t *node_1;
|
||||
node_1 = node_0->get_child(node_0->context, 0);
|
||||
node_1->layout.position[CSS_TOP] = 0;
|
||||
node_1->layout.position[CSS_LEFT] = 200;
|
||||
node_1->layout.dimensions[CSS_WIDTH] = 600;
|
||||
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
test("should center flexible item with max size", root_node, root_layout);
|
||||
}
|
||||
|
||||
{
|
||||
css_node_t *root_node = new_test_css_node();
|
||||
{
|
||||
css_node_t *node_0 = root_node;
|
||||
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
|
||||
node_0->style.dimensions[CSS_WIDTH] = 1000;
|
||||
node_0->style.dimensions[CSS_HEIGHT] = 1000;
|
||||
init_css_node_children(node_0, 2);
|
||||
{
|
||||
css_node_t *node_1;
|
||||
node_1 = node_0->get_child(node_0->context, 0);
|
||||
node_1->style.flex = 1;
|
||||
node_1->style.dimensions[CSS_WIDTH] = 100;
|
||||
node_1->style.dimensions[CSS_HEIGHT] = 1000;
|
||||
node_1 = node_0->get_child(node_0->context, 1);
|
||||
node_1->style.flex = 1;
|
||||
node_1->style.dimensions[CSS_WIDTH] = 100;
|
||||
node_1->style.dimensions[CSS_HEIGHT] = 1000;
|
||||
node_1->style.maxDimensions[CSS_WIDTH] = 200;
|
||||
}
|
||||
}
|
||||
|
||||
css_node_t *root_layout = new_test_css_node();
|
||||
{
|
||||
css_node_t *node_0 = root_layout;
|
||||
node_0->layout.position[CSS_TOP] = 0;
|
||||
node_0->layout.position[CSS_LEFT] = 0;
|
||||
node_0->layout.dimensions[CSS_WIDTH] = 1000;
|
||||
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
|
||||
init_css_node_children(node_0, 2);
|
||||
{
|
||||
css_node_t *node_1;
|
||||
node_1 = node_0->get_child(node_0->context, 0);
|
||||
node_1->layout.position[CSS_TOP] = 0;
|
||||
node_1->layout.position[CSS_LEFT] = 0;
|
||||
node_1->layout.dimensions[CSS_WIDTH] = 800;
|
||||
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
|
||||
node_1 = node_0->get_child(node_0->context, 1);
|
||||
node_1->layout.position[CSS_TOP] = 0;
|
||||
node_1->layout.position[CSS_LEFT] = 800;
|
||||
node_1->layout.dimensions[CSS_WIDTH] = 200;
|
||||
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
test("should correctly size flexible items with flex basis and a max width", root_node, root_layout);
|
||||
}
|
||||
|
||||
{
|
||||
css_node_t *root_node = new_test_css_node();
|
||||
{
|
||||
|
@@ -2151,6 +2151,30 @@ describe('Layout', function() {
|
||||
]}
|
||||
);
|
||||
});
|
||||
|
||||
it('should center flexible item with max size', function() {
|
||||
testLayout(
|
||||
{style: {width: 1000, height: 1000, flexDirection: 'row', justifyContent: 'center'}, children: [
|
||||
{style: {flex: 1, maxWidth: 600, height: 1000}}
|
||||
]},
|
||||
{width: 1000, height: 1000, top: 0, left: 0, children: [
|
||||
{width: 600, height: 1000, top: 0, left: 200}
|
||||
]}
|
||||
);
|
||||
});
|
||||
|
||||
it('should correctly size flexible items with flex basis and a max width', function() {
|
||||
testLayout(
|
||||
{style: {width: 1000, height: 1000, flexDirection: 'row'}, children: [
|
||||
{style: {flex: 1, width: 100, height: 1000}},
|
||||
{style: {flex: 1, width: 100, maxWidth: 200, height: 1000}}
|
||||
]},
|
||||
{width: 1000, height: 1000, top: 0, left: 0, children: [
|
||||
{width: 800, height: 1000, top: 0, left: 0},
|
||||
{width: 200, height: 1000, top: 0, left: 800}
|
||||
]}
|
||||
);
|
||||
});
|
||||
|
||||
xit('should layout node with a nested sibling child with width', function() {
|
||||
testLayout(
|
||||
|
@@ -7362,6 +7362,97 @@ public class LayoutEngineTest
|
||||
|
||||
[Test]
|
||||
public void TestCase168()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_node;
|
||||
node_0.style.flexDirection = CSSFlexDirection.Row;
|
||||
node_0.style.justifyContent = CSSJustify.Center;
|
||||
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 1);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.style.flex = 1;
|
||||
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1.style.maxWidth = 600;
|
||||
}
|
||||
}
|
||||
|
||||
TestCSSNode root_layout = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_layout;
|
||||
node_0.layout.position[POSITION_TOP] = 0;
|
||||
node_0.layout.position[POSITION_LEFT] = 0;
|
||||
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 1);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.layout.position[POSITION_TOP] = 0;
|
||||
node_1.layout.position[POSITION_LEFT] = 200;
|
||||
node_1.layout.dimensions[DIMENSION_WIDTH] = 600;
|
||||
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
test("should center flexible item with max size", root_node, root_layout);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase169()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_node;
|
||||
node_0.style.flexDirection = CSSFlexDirection.Row;
|
||||
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 2);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.style.flex = 1;
|
||||
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
|
||||
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1 = node_0.getChildAt(1);
|
||||
node_1.style.flex = 1;
|
||||
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
|
||||
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1.style.maxWidth = 200;
|
||||
}
|
||||
}
|
||||
|
||||
TestCSSNode root_layout = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_layout;
|
||||
node_0.layout.position[POSITION_TOP] = 0;
|
||||
node_0.layout.position[POSITION_LEFT] = 0;
|
||||
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 2);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.layout.position[POSITION_TOP] = 0;
|
||||
node_1.layout.position[POSITION_LEFT] = 0;
|
||||
node_1.layout.dimensions[DIMENSION_WIDTH] = 800;
|
||||
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1 = node_0.getChildAt(1);
|
||||
node_1.layout.position[POSITION_TOP] = 0;
|
||||
node_1.layout.position[POSITION_LEFT] = 800;
|
||||
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
|
||||
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
test("should correctly size flexible items with flex basis and a max width", root_node, root_layout);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase170()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7427,7 +7518,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase169()
|
||||
public void TestCase171()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7499,7 +7590,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase170()
|
||||
public void TestCase172()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7561,7 +7652,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase171()
|
||||
public void TestCase173()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7655,7 +7746,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase172()
|
||||
public void TestCase174()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7736,7 +7827,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase173()
|
||||
public void TestCase175()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7776,7 +7867,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase174()
|
||||
public void TestCase176()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7816,7 +7907,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase175()
|
||||
public void TestCase177()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7856,7 +7947,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase176()
|
||||
public void TestCase178()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7894,7 +7985,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase177()
|
||||
public void TestCase179()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7933,7 +8024,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase178()
|
||||
public void TestCase180()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7971,7 +8062,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase179()
|
||||
public void TestCase181()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8010,7 +8101,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase180()
|
||||
public void TestCase182()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8048,7 +8139,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase181()
|
||||
public void TestCase183()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8087,7 +8178,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase182()
|
||||
public void TestCase184()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8123,7 +8214,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase183()
|
||||
public void TestCase185()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8191,7 +8282,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase184()
|
||||
public void TestCase186()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8268,7 +8359,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase185()
|
||||
public void TestCase187()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8340,7 +8431,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase186()
|
||||
public void TestCase188()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8393,7 +8484,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase187()
|
||||
public void TestCase189()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8483,7 +8574,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase188()
|
||||
public void TestCase190()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8537,7 +8628,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase189()
|
||||
public void TestCase191()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8591,7 +8682,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase190()
|
||||
public void TestCase192()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8661,7 +8752,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase191()
|
||||
public void TestCase193()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8731,7 +8822,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase192()
|
||||
public void TestCase194()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8787,7 +8878,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase193()
|
||||
public void TestCase195()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8842,7 +8933,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase194()
|
||||
public void TestCase196()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8897,7 +8988,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase195()
|
||||
public void TestCase197()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8968,7 +9059,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase196()
|
||||
public void TestCase198()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9039,7 +9130,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase197()
|
||||
public void TestCase199()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9096,7 +9187,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase198()
|
||||
public void TestCase200()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9152,7 +9243,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase199()
|
||||
public void TestCase201()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9208,7 +9299,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase200()
|
||||
public void TestCase202()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9280,7 +9371,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase201()
|
||||
public void TestCase203()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9352,7 +9443,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase202()
|
||||
public void TestCase204()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9411,7 +9502,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase203()
|
||||
public void TestCase205()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9484,7 +9575,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase204()
|
||||
public void TestCase206()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9558,7 +9649,7 @@ public class LayoutEngineTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCase205()
|
||||
public void TestCase207()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
|
@@ -784,7 +784,8 @@ namespace Facebook.CSSLayout
|
||||
remainingFreeSpace = -sizeConsumedOnCurrentLine;
|
||||
}
|
||||
|
||||
float remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
float originalRemainingFreeSpace = remainingFreeSpace;
|
||||
float deltaFreeSpace = 0;
|
||||
|
||||
if (!canSkipFlex) {
|
||||
float childFlexBasis;
|
||||
@@ -807,7 +808,6 @@ namespace Facebook.CSSLayout
|
||||
// concerns because we know exactly how many passes it'll do.
|
||||
|
||||
// First pass: detect the flex items whose min/max constraints trigger
|
||||
float deltaFreeSpace = 0;
|
||||
float deltaFlexShrinkScaledFactors = 0;
|
||||
float deltaFlexGrowFactors = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
@@ -826,7 +826,7 @@ namespace Facebook.CSSLayout
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor;
|
||||
}
|
||||
}
|
||||
@@ -842,7 +842,7 @@ namespace Facebook.CSSLayout
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexGrowFactors -= flexGrowFactor;
|
||||
}
|
||||
}
|
||||
@@ -854,9 +854,9 @@ namespace Facebook.CSSLayout
|
||||
totalFlexShrinkScaledFactors += deltaFlexShrinkScaledFactors;
|
||||
totalFlexGrowFactors += deltaFlexGrowFactors;
|
||||
remainingFreeSpace += deltaFreeSpace;
|
||||
remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
|
||||
// Second pass: resolve the sizes of the flexible items
|
||||
deltaFreeSpace = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
while (currentRelativeChild != null) {
|
||||
childFlexBasis = currentRelativeChild.layout.flexBasis;
|
||||
@@ -880,7 +880,7 @@ namespace Facebook.CSSLayout
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpaceAfterFlex -= updatedMainSize - childFlexBasis;
|
||||
deltaFreeSpace -= updatedMainSize - childFlexBasis;
|
||||
|
||||
if (isMainAxisRow) {
|
||||
childWidth = updatedMainSize + (currentRelativeChild.style.margin.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_ROW], leading[CSS_FLEX_DIRECTION_ROW]) + currentRelativeChild.style.margin.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_ROW], trailing[CSS_FLEX_DIRECTION_ROW]));
|
||||
@@ -916,7 +916,7 @@ namespace Facebook.CSSLayout
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpace = remainingFreeSpaceAfterFlex;
|
||||
remainingFreeSpace = originalRemainingFreeSpace + deltaFreeSpace;
|
||||
|
||||
// STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION
|
||||
|
||||
|
@@ -751,7 +751,8 @@ public class LayoutEngine {
|
||||
remainingFreeSpace = -sizeConsumedOnCurrentLine;
|
||||
}
|
||||
|
||||
float remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
float originalRemainingFreeSpace = remainingFreeSpace;
|
||||
float deltaFreeSpace = 0;
|
||||
|
||||
if (!canSkipFlex) {
|
||||
float childFlexBasis;
|
||||
@@ -774,7 +775,6 @@ public class LayoutEngine {
|
||||
// concerns because we know exactly how many passes it'll do.
|
||||
|
||||
// First pass: detect the flex items whose min/max constraints trigger
|
||||
float deltaFreeSpace = 0;
|
||||
float deltaFlexShrinkScaledFactors = 0;
|
||||
float deltaFlexGrowFactors = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
@@ -793,7 +793,7 @@ public class LayoutEngine {
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor;
|
||||
}
|
||||
}
|
||||
@@ -809,7 +809,7 @@ public class LayoutEngine {
|
||||
// By excluding this item's size and flex factor from remaining, this item's
|
||||
// min/max constraints should also trigger in the second pass resulting in the
|
||||
// item's size calculation being identical in the first and second passes.
|
||||
deltaFreeSpace -= boundMainSize;
|
||||
deltaFreeSpace -= boundMainSize - childFlexBasis;
|
||||
deltaFlexGrowFactors -= flexGrowFactor;
|
||||
}
|
||||
}
|
||||
@@ -821,9 +821,9 @@ public class LayoutEngine {
|
||||
totalFlexShrinkScaledFactors += deltaFlexShrinkScaledFactors;
|
||||
totalFlexGrowFactors += deltaFlexGrowFactors;
|
||||
remainingFreeSpace += deltaFreeSpace;
|
||||
remainingFreeSpaceAfterFlex = remainingFreeSpace;
|
||||
|
||||
// Second pass: resolve the sizes of the flexible items
|
||||
deltaFreeSpace = 0;
|
||||
currentRelativeChild = firstRelativeChild;
|
||||
while (currentRelativeChild != null) {
|
||||
childFlexBasis = currentRelativeChild.layout.flexBasis;
|
||||
@@ -847,7 +847,7 @@ public class LayoutEngine {
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpaceAfterFlex -= updatedMainSize - childFlexBasis;
|
||||
deltaFreeSpace -= updatedMainSize - childFlexBasis;
|
||||
|
||||
if (isMainAxisRow) {
|
||||
childWidth = updatedMainSize + (currentRelativeChild.style.margin.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_ROW], leading[CSS_FLEX_DIRECTION_ROW]) + currentRelativeChild.style.margin.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_ROW], trailing[CSS_FLEX_DIRECTION_ROW]));
|
||||
@@ -883,7 +883,7 @@ public class LayoutEngine {
|
||||
}
|
||||
}
|
||||
|
||||
remainingFreeSpace = remainingFreeSpaceAfterFlex;
|
||||
remainingFreeSpace = originalRemainingFreeSpace + deltaFreeSpace;
|
||||
|
||||
// STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION
|
||||
|
||||
|
@@ -7365,6 +7365,97 @@ public class LayoutEngineTest {
|
||||
|
||||
@Test
|
||||
public void testCase168()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_node;
|
||||
node_0.style.flexDirection = CSSFlexDirection.ROW;
|
||||
node_0.style.justifyContent = CSSJustify.CENTER;
|
||||
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 1);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.style.flex = 1;
|
||||
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1.style.maxWidth = 600;
|
||||
}
|
||||
}
|
||||
|
||||
TestCSSNode root_layout = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_layout;
|
||||
node_0.layout.position[POSITION_TOP] = 0;
|
||||
node_0.layout.position[POSITION_LEFT] = 0;
|
||||
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 1);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.layout.position[POSITION_TOP] = 0;
|
||||
node_1.layout.position[POSITION_LEFT] = 200;
|
||||
node_1.layout.dimensions[DIMENSION_WIDTH] = 600;
|
||||
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
test("should center flexible item with max size", root_node, root_layout);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase169()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_node;
|
||||
node_0.style.flexDirection = CSSFlexDirection.ROW;
|
||||
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 2);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.style.flex = 1;
|
||||
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
|
||||
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1 = node_0.getChildAt(1);
|
||||
node_1.style.flex = 1;
|
||||
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
|
||||
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1.style.maxWidth = 200;
|
||||
}
|
||||
}
|
||||
|
||||
TestCSSNode root_layout = new TestCSSNode();
|
||||
{
|
||||
TestCSSNode node_0 = root_layout;
|
||||
node_0.layout.position[POSITION_TOP] = 0;
|
||||
node_0.layout.position[POSITION_LEFT] = 0;
|
||||
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
|
||||
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
addChildren(node_0, 2);
|
||||
{
|
||||
TestCSSNode node_1;
|
||||
node_1 = node_0.getChildAt(0);
|
||||
node_1.layout.position[POSITION_TOP] = 0;
|
||||
node_1.layout.position[POSITION_LEFT] = 0;
|
||||
node_1.layout.dimensions[DIMENSION_WIDTH] = 800;
|
||||
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
node_1 = node_0.getChildAt(1);
|
||||
node_1.layout.position[POSITION_TOP] = 0;
|
||||
node_1.layout.position[POSITION_LEFT] = 800;
|
||||
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
|
||||
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
test("should correctly size flexible items with flex basis and a max width", root_node, root_layout);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase170()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7430,7 +7521,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase169()
|
||||
public void testCase171()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7502,7 +7593,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase170()
|
||||
public void testCase172()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7564,7 +7655,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase171()
|
||||
public void testCase173()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7658,7 +7749,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase172()
|
||||
public void testCase174()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7739,7 +7830,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase173()
|
||||
public void testCase175()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7779,7 +7870,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase174()
|
||||
public void testCase176()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7819,7 +7910,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase175()
|
||||
public void testCase177()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7859,7 +7950,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase176()
|
||||
public void testCase178()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7897,7 +7988,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase177()
|
||||
public void testCase179()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7936,7 +8027,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase178()
|
||||
public void testCase180()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -7974,7 +8065,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase179()
|
||||
public void testCase181()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8013,7 +8104,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase180()
|
||||
public void testCase182()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8051,7 +8142,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase181()
|
||||
public void testCase183()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8090,7 +8181,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase182()
|
||||
public void testCase184()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8126,7 +8217,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase183()
|
||||
public void testCase185()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8194,7 +8285,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase184()
|
||||
public void testCase186()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8271,7 +8362,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase185()
|
||||
public void testCase187()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8343,7 +8434,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase186()
|
||||
public void testCase188()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8396,7 +8487,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase187()
|
||||
public void testCase189()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8486,7 +8577,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase188()
|
||||
public void testCase190()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8540,7 +8631,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase189()
|
||||
public void testCase191()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8594,7 +8685,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase190()
|
||||
public void testCase192()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8664,7 +8755,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase191()
|
||||
public void testCase193()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8734,7 +8825,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase192()
|
||||
public void testCase194()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8790,7 +8881,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase193()
|
||||
public void testCase195()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8845,7 +8936,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase194()
|
||||
public void testCase196()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8900,7 +8991,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase195()
|
||||
public void testCase197()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -8971,7 +9062,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase196()
|
||||
public void testCase198()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9042,7 +9133,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase197()
|
||||
public void testCase199()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9099,7 +9190,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase198()
|
||||
public void testCase200()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9155,7 +9246,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase199()
|
||||
public void testCase201()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9211,7 +9302,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase200()
|
||||
public void testCase202()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9283,7 +9374,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase201()
|
||||
public void testCase203()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9355,7 +9446,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase202()
|
||||
public void testCase204()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9414,7 +9505,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase203()
|
||||
public void testCase205()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9487,7 +9578,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase204()
|
||||
public void testCase206()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
@@ -9561,7 +9652,7 @@ public class LayoutEngineTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCase205()
|
||||
public void testCase207()
|
||||
{
|
||||
TestCSSNode root_node = new TestCSSNode();
|
||||
{
|
||||
|
Reference in New Issue
Block a user