Skip to content

Commit b5c2b09

Browse files
Georgiy Kassablifacebook-github-bot
Georgiy Kassabli
authored andcommitted
Revert D4456312: Fix for Yoga test failure for flexing with min stack dimension
Summary: This reverts commit 82a39bc93cf3bf2374b968e9f7403397e752908e Differential Revision: D4456312 fbshipit-source-id: 6b396f0a8b67619308456599377238b75d0c1ab3
1 parent 46817a3 commit b5c2b09

File tree

6 files changed

+4
-443
lines changed

6 files changed

+4
-443
lines changed

csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs

-107
Original file line numberDiff line numberDiff line change
@@ -348,113 +348,6 @@ public void Test_justify_content_overflow_min_max()
348348
Assert.AreEqual(50f, root_child2.LayoutHeight);
349349
}
350350

351-
[Test]
352-
public void Test_flex_grow_to_min()
353-
{
354-
YogaNode root = new YogaNode();
355-
root.Width = 100;
356-
root.MinHeight = 100;
357-
root.MaxHeight = 500;
358-
359-
YogaNode root_child0 = new YogaNode();
360-
root_child0.FlexGrow = 1;
361-
root_child0.FlexShrink = 1;
362-
root.Insert(0, root_child0);
363-
364-
YogaNode root_child1 = new YogaNode();
365-
root_child1.Height = 50;
366-
root.Insert(1, root_child1);
367-
root.StyleDirection = YogaDirection.LTR;
368-
root.CalculateLayout();
369-
370-
Assert.AreEqual(0f, root.LayoutX);
371-
Assert.AreEqual(0f, root.LayoutY);
372-
Assert.AreEqual(100f, root.LayoutWidth);
373-
Assert.AreEqual(100f, root.LayoutHeight);
374-
375-
Assert.AreEqual(0f, root_child0.LayoutX);
376-
Assert.AreEqual(0f, root_child0.LayoutY);
377-
Assert.AreEqual(100f, root_child0.LayoutWidth);
378-
Assert.AreEqual(50f, root_child0.LayoutHeight);
379-
380-
Assert.AreEqual(0f, root_child1.LayoutX);
381-
Assert.AreEqual(50f, root_child1.LayoutY);
382-
Assert.AreEqual(100f, root_child1.LayoutWidth);
383-
Assert.AreEqual(50f, root_child1.LayoutHeight);
384-
385-
root.StyleDirection = YogaDirection.RTL;
386-
root.CalculateLayout();
387-
388-
Assert.AreEqual(0f, root.LayoutX);
389-
Assert.AreEqual(0f, root.LayoutY);
390-
Assert.AreEqual(100f, root.LayoutWidth);
391-
Assert.AreEqual(100f, root.LayoutHeight);
392-
393-
Assert.AreEqual(0f, root_child0.LayoutX);
394-
Assert.AreEqual(0f, root_child0.LayoutY);
395-
Assert.AreEqual(100f, root_child0.LayoutWidth);
396-
Assert.AreEqual(50f, root_child0.LayoutHeight);
397-
398-
Assert.AreEqual(0f, root_child1.LayoutX);
399-
Assert.AreEqual(50f, root_child1.LayoutY);
400-
Assert.AreEqual(100f, root_child1.LayoutWidth);
401-
Assert.AreEqual(50f, root_child1.LayoutHeight);
402-
}
403-
404-
[Test]
405-
public void Test_flex_grow_in_at_most_container()
406-
{
407-
YogaNode root = new YogaNode();
408-
root.FlexDirection = YogaFlexDirection.Row;
409-
root.AlignItems = YogaAlign.FlexStart;
410-
root.Width = 100;
411-
root.Height = 100;
412-
413-
YogaNode root_child0 = new YogaNode();
414-
root_child0.FlexDirection = YogaFlexDirection.Row;
415-
root.Insert(0, root_child0);
416-
417-
YogaNode root_child0_child0 = new YogaNode();
418-
root_child0_child0.FlexGrow = 1;
419-
root_child0_child0.FlexBasis = 0;
420-
root_child0.Insert(0, root_child0_child0);
421-
root.StyleDirection = YogaDirection.LTR;
422-
root.CalculateLayout();
423-
424-
Assert.AreEqual(0f, root.LayoutX);
425-
Assert.AreEqual(0f, root.LayoutY);
426-
Assert.AreEqual(100f, root.LayoutWidth);
427-
Assert.AreEqual(100f, root.LayoutHeight);
428-
429-
Assert.AreEqual(0f, root_child0.LayoutX);
430-
Assert.AreEqual(0f, root_child0.LayoutY);
431-
Assert.AreEqual(0f, root_child0.LayoutWidth);
432-
Assert.AreEqual(0f, root_child0.LayoutHeight);
433-
434-
Assert.AreEqual(0f, root_child0_child0.LayoutX);
435-
Assert.AreEqual(0f, root_child0_child0.LayoutY);
436-
Assert.AreEqual(0f, root_child0_child0.LayoutWidth);
437-
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
438-
439-
root.StyleDirection = YogaDirection.RTL;
440-
root.CalculateLayout();
441-
442-
Assert.AreEqual(0f, root.LayoutX);
443-
Assert.AreEqual(0f, root.LayoutY);
444-
Assert.AreEqual(100f, root.LayoutWidth);
445-
Assert.AreEqual(100f, root.LayoutHeight);
446-
447-
Assert.AreEqual(100f, root_child0.LayoutX);
448-
Assert.AreEqual(0f, root_child0.LayoutY);
449-
Assert.AreEqual(0f, root_child0.LayoutWidth);
450-
Assert.AreEqual(0f, root_child0.LayoutHeight);
451-
452-
Assert.AreEqual(0f, root_child0_child0.LayoutX);
453-
Assert.AreEqual(0f, root_child0_child0.LayoutY);
454-
Assert.AreEqual(0f, root_child0_child0.LayoutWidth);
455-
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
456-
}
457-
458351
[Test]
459352
public void Test_flex_grow_within_max_width()
460353
{

gentest/fixtures/YGMinMaxDimensionTest.html

-11
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@
3030
<div style="width: 50px; height: 50px;"></div>
3131
</div>
3232

33-
<div id="flex_grow_to_min" style="min-height: 100px; max-height: 500px; width: 100px;">
34-
<div style="flex-grow: 1; flex-shrink: 1;"></div>
35-
<div style="height: 50px;"></div>
36-
</div>
37-
38-
<div id="flex_grow_in_at_most_container" style="width: 100px; height: 100px; background-color: white; flex-direction: row; align-items: flex-start;">
39-
<div style="flex-direction: row;">
40-
<div style="flex-grow: 1; flex-basis: 0px;"></div>
41-
</div>
42-
</div>
43-
4433
<div id="flex_grow_within_max_width" style="width: 200px; height: 100px;">
4534
<div style="flex-direction: row; max-width: 100px;">
4635
<div style="height: 20px; flex-grow: 1;"></div>

java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java

-105
Original file line numberDiff line numberDiff line change
@@ -340,111 +340,6 @@ public void test_justify_content_overflow_min_max() {
340340
assertEquals(50f, root_child2.getLayoutHeight(), 0.0f);
341341
}
342342

343-
@Test
344-
public void test_flex_grow_to_min() {
345-
final YogaNode root = new YogaNode();
346-
root.setWidth(100f);
347-
root.setMinHeight(100f);
348-
root.setMaxHeight(500f);
349-
350-
final YogaNode root_child0 = new YogaNode();
351-
root_child0.setFlexGrow(1f);
352-
root_child0.setFlexShrink(1f);
353-
root.addChildAt(root_child0, 0);
354-
355-
final YogaNode root_child1 = new YogaNode();
356-
root_child1.setHeight(50f);
357-
root.addChildAt(root_child1, 1);
358-
root.setDirection(YogaDirection.LTR);
359-
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
360-
361-
assertEquals(0f, root.getLayoutX(), 0.0f);
362-
assertEquals(0f, root.getLayoutY(), 0.0f);
363-
assertEquals(100f, root.getLayoutWidth(), 0.0f);
364-
assertEquals(100f, root.getLayoutHeight(), 0.0f);
365-
366-
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
367-
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
368-
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
369-
assertEquals(50f, root_child0.getLayoutHeight(), 0.0f);
370-
371-
assertEquals(0f, root_child1.getLayoutX(), 0.0f);
372-
assertEquals(50f, root_child1.getLayoutY(), 0.0f);
373-
assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
374-
assertEquals(50f, root_child1.getLayoutHeight(), 0.0f);
375-
376-
root.setDirection(YogaDirection.RTL);
377-
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
378-
379-
assertEquals(0f, root.getLayoutX(), 0.0f);
380-
assertEquals(0f, root.getLayoutY(), 0.0f);
381-
assertEquals(100f, root.getLayoutWidth(), 0.0f);
382-
assertEquals(100f, root.getLayoutHeight(), 0.0f);
383-
384-
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
385-
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
386-
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
387-
assertEquals(50f, root_child0.getLayoutHeight(), 0.0f);
388-
389-
assertEquals(0f, root_child1.getLayoutX(), 0.0f);
390-
assertEquals(50f, root_child1.getLayoutY(), 0.0f);
391-
assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
392-
assertEquals(50f, root_child1.getLayoutHeight(), 0.0f);
393-
}
394-
395-
@Test
396-
public void test_flex_grow_in_at_most_container() {
397-
final YogaNode root = new YogaNode();
398-
root.setFlexDirection(YogaFlexDirection.ROW);
399-
root.setAlignItems(YogaAlign.FLEX_START);
400-
root.setWidth(100f);
401-
root.setHeight(100f);
402-
403-
final YogaNode root_child0 = new YogaNode();
404-
root_child0.setFlexDirection(YogaFlexDirection.ROW);
405-
root.addChildAt(root_child0, 0);
406-
407-
final YogaNode root_child0_child0 = new YogaNode();
408-
root_child0_child0.setFlexGrow(1f);
409-
root_child0_child0.setFlexBasis(0f);
410-
root_child0.addChildAt(root_child0_child0, 0);
411-
root.setDirection(YogaDirection.LTR);
412-
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
413-
414-
assertEquals(0f, root.getLayoutX(), 0.0f);
415-
assertEquals(0f, root.getLayoutY(), 0.0f);
416-
assertEquals(100f, root.getLayoutWidth(), 0.0f);
417-
assertEquals(100f, root.getLayoutHeight(), 0.0f);
418-
419-
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
420-
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
421-
assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
422-
assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
423-
424-
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
425-
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
426-
assertEquals(0f, root_child0_child0.getLayoutWidth(), 0.0f);
427-
assertEquals(0f, root_child0_child0.getLayoutHeight(), 0.0f);
428-
429-
root.setDirection(YogaDirection.RTL);
430-
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
431-
432-
assertEquals(0f, root.getLayoutX(), 0.0f);
433-
assertEquals(0f, root.getLayoutY(), 0.0f);
434-
assertEquals(100f, root.getLayoutWidth(), 0.0f);
435-
assertEquals(100f, root.getLayoutHeight(), 0.0f);
436-
437-
assertEquals(100f, root_child0.getLayoutX(), 0.0f);
438-
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
439-
assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
440-
assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
441-
442-
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
443-
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
444-
assertEquals(0f, root_child0_child0.getLayoutWidth(), 0.0f);
445-
assertEquals(0f, root_child0_child0.getLayoutHeight(), 0.0f);
446-
}
447-
448343
@Test
449344
public void test_flex_grow_within_max_width() {
450345
final YogaNode root = new YogaNode();

javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js

-109
Original file line numberDiff line numberDiff line change
@@ -349,115 +349,6 @@ it("justify_content_overflow_min_max", function () {
349349
(typeof gc !== "undefined") && gc();
350350
console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")");
351351
});
352-
it("flex_grow_to_min", function () {
353-
var root = Yoga.Node.create();
354-
root.setWidth(100);
355-
root.setMinHeight(100);
356-
root.setMaxHeight(500);
357-
358-
var root_child0 = Yoga.Node.create();
359-
root_child0.setFlexGrow(1);
360-
root_child0.setFlexShrink(1);
361-
root.insertChild(root_child0, 0);
362-
363-
var root_child1 = Yoga.Node.create();
364-
root_child1.setHeight(50);
365-
root.insertChild(root_child1, 1);
366-
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
367-
368-
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
369-
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
370-
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
371-
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
372-
373-
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
374-
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
375-
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
376-
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
377-
378-
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
379-
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
380-
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
381-
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
382-
383-
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
384-
385-
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
386-
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
387-
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
388-
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
389-
390-
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
391-
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
392-
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
393-
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
394-
395-
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
396-
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
397-
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
398-
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
399-
400-
if (typeof root !== "undefined")
401-
root.freeRecursive();
402-
403-
(typeof gc !== "undefined") && gc();
404-
console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")");
405-
});
406-
it("flex_grow_in_at_most_container", function () {
407-
var root = Yoga.Node.create();
408-
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
409-
root.setAlignItems(Yoga.ALIGN_FLEX_START);
410-
root.setWidth(100);
411-
root.setHeight(100);
412-
413-
var root_child0 = Yoga.Node.create();
414-
root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
415-
root.insertChild(root_child0, 0);
416-
417-
var root_child0_child0 = Yoga.Node.create();
418-
root_child0_child0.setFlexGrow(1);
419-
root_child0_child0.setFlexBasis(0);
420-
root_child0.insertChild(root_child0_child0, 0);
421-
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
422-
423-
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
424-
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
425-
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
426-
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
427-
428-
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
429-
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
430-
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
431-
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
432-
433-
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
434-
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
435-
console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
436-
console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
437-
438-
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
439-
440-
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
441-
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
442-
console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
443-
console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
444-
445-
console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
446-
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
447-
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
448-
console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
449-
450-
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
451-
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
452-
console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
453-
console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
454-
455-
if (typeof root !== "undefined")
456-
root.freeRecursive();
457-
458-
(typeof gc !== "undefined") && gc();
459-
console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")");
460-
});
461352
it("flex_grow_within_max_width", function () {
462353
var root = Yoga.Node.create();
463354
root.setWidth(200);

0 commit comments

Comments
 (0)