2017-01-02 02:22:45 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-01-02 02:22:45 -08:00
|
|
|
*/
|
|
|
|
|
2017-01-31 09:28:09 -08:00
|
|
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html
|
2017-01-02 02:22:45 -08:00
|
|
|
|
|
|
|
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
|
|
|
|
|
|
|
|
it("justify_content_row_flex_start", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setWidth(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setWidth(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setWidth(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(92 === root_child0.getComputedLeft(), "92 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(82 === root_child1.getComputedLeft(), "82 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(72 === root_child2.getComputedLeft(), "72 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_row_flex_end", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setWidth(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setWidth(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setWidth(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(72 === root_child0.getComputedLeft(), "72 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(82 === root_child1.getComputedLeft(), "82 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(92 === root_child2.getComputedLeft(), "92 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_row_center", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setWidth(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setWidth(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setWidth(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(36 === root_child0.getComputedLeft(), "36 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(56 === root_child2.getComputedLeft(), "56 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(56 === root_child0.getComputedLeft(), "56 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(36 === root_child2.getComputedLeft(), "36 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_row_space_between", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setWidth(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setWidth(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setWidth(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(92 === root_child2.getComputedLeft(), "92 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(92 === root_child0.getComputedLeft(), "92 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_row_space_around", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setWidth(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setWidth(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setWidth(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(12 === root_child0.getComputedLeft(), "12 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(12 === root_child2.getComputedLeft(), "12 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_column_flex_start", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setHeight(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-11-27 03:40:01 -08:00
|
|
|
root_child1.setHeight(10);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setHeight(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
2017-11-27 03:40:01 -08:00
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
2017-02-20 05:31:20 -08:00
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
2017-11-27 03:40:01 -08:00
|
|
|
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
2017-02-20 05:31:20 -08:00
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
2017-11-27 03:40:01 -08:00
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
2017-02-20 05:31:20 -08:00
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
2017-11-27 03:40:01 -08:00
|
|
|
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
2017-02-20 05:31:20 -08:00
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_column_flex_end", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setHeight(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setHeight(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setHeight(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(72 === root_child0.getComputedTop(), "72 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(82 === root_child1.getComputedTop(), "82 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(72 === root_child0.getComputedTop(), "72 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(82 === root_child1.getComputedTop(), "82 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_column_center", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setHeight(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setHeight(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setHeight(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(36 === root_child0.getComputedTop(), "36 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(56 === root_child2.getComputedTop(), "56 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(36 === root_child0.getComputedTop(), "36 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(56 === root_child2.getComputedTop(), "56 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_column_space_between", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setHeight(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setHeight(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setHeight(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
it("justify_content_column_space_around", function () {
|
2017-03-28 10:28:53 -07:00
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
try {
|
2017-03-01 09:19:55 -08:00
|
|
|
var root = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child0 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child0.setHeight(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child1 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child1.setHeight(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
2017-03-01 09:19:55 -08:00
|
|
|
var root_child2 = Yoga.Node.create(config);
|
2017-02-20 05:31:20 -08:00
|
|
|
root_child2.setHeight(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(12 === root_child0.getComputedTop(), "12 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(12 === root_child0.getComputedTop(), "12 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
2017-03-28 10:28:53 -07:00
|
|
|
|
|
|
|
config.free();
|
2017-02-20 05:31:20 -08:00
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
2017-11-24 07:06:16 -08:00
|
|
|
it("justify_content_row_min_width_and_margin", function () {
|
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
|
|
|
try {
|
|
|
|
var root = Yoga.Node.create(config);
|
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
|
|
|
root.setMargin(Yoga.EDGE_LEFT, 100);
|
|
|
|
root.setMinWidth(50);
|
|
|
|
|
|
|
|
var root_child0 = Yoga.Node.create(config);
|
|
|
|
root_child0.setWidth(20);
|
|
|
|
root_child0.setHeight(20);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(15 === root_child0.getComputedLeft(), "15 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(15 === root_child0.getComputedLeft(), "15 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
|
|
|
|
|
|
|
config.free();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
it("justify_content_row_max_width_and_margin", function () {
|
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
|
|
|
try {
|
|
|
|
var root = Yoga.Node.create(config);
|
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
|
|
|
root.setMargin(Yoga.EDGE_LEFT, 100);
|
|
|
|
root.setWidth(100);
|
|
|
|
root.setMaxWidth(80);
|
|
|
|
|
|
|
|
var root_child0 = Yoga.Node.create(config);
|
|
|
|
root_child0.setWidth(20);
|
|
|
|
root_child0.setHeight(20);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(30 === root_child0.getComputedLeft(), "30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(30 === root_child0.getComputedLeft(), "30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
|
|
|
|
|
|
|
config.free();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
it("justify_content_column_min_height_and_margin", function () {
|
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
|
|
|
try {
|
|
|
|
var root = Yoga.Node.create(config);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
|
|
|
root.setMargin(Yoga.EDGE_TOP, 100);
|
|
|
|
root.setMinHeight(50);
|
|
|
|
|
|
|
|
var root_child0 = Yoga.Node.create(config);
|
|
|
|
root_child0.setWidth(20);
|
|
|
|
root_child0.setHeight(20);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(15 === root_child0.getComputedTop(), "15 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(15 === root_child0.getComputedTop(), "15 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
|
|
|
|
|
|
|
config.free();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
it("justify_content_colunn_max_height_and_margin", function () {
|
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
|
|
|
try {
|
|
|
|
var root = Yoga.Node.create(config);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
|
|
|
root.setMargin(Yoga.EDGE_TOP, 100);
|
|
|
|
root.setHeight(100);
|
|
|
|
root.setMaxHeight(80);
|
|
|
|
|
|
|
|
var root_child0 = Yoga.Node.create(config);
|
|
|
|
root_child0.setWidth(20);
|
|
|
|
root_child0.setHeight(20);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
|
|
|
|
|
|
|
config.free();
|
|
|
|
}
|
|
|
|
});
|
2017-11-27 03:40:01 -08:00
|
|
|
it("justify_content_column_space_evenly", function () {
|
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
|
|
|
try {
|
|
|
|
var root = Yoga.Node.create(config);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
|
|
|
var root_child0 = Yoga.Node.create(config);
|
|
|
|
root_child0.setHeight(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
|
|
|
var root_child1 = Yoga.Node.create(config);
|
|
|
|
root_child1.setHeight(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
|
|
|
var root_child2 = Yoga.Node.create(config);
|
|
|
|
root_child2.setHeight(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(18 === root_child0.getComputedTop(), "18 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(74 === root_child2.getComputedTop(), "74 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(18 === root_child0.getComputedTop(), "18 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(74 === root_child2.getComputedTop(), "74 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
|
|
|
|
|
|
|
config.free();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
it("justify_content_row_space_evenly", function () {
|
|
|
|
var config = Yoga.Config.create();
|
|
|
|
|
|
|
|
try {
|
|
|
|
var root = Yoga.Node.create(config);
|
|
|
|
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
|
|
root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY);
|
|
|
|
root.setWidth(102);
|
|
|
|
root.setHeight(102);
|
|
|
|
|
|
|
|
var root_child0 = Yoga.Node.create(config);
|
|
|
|
root_child0.setHeight(10);
|
|
|
|
root.insertChild(root_child0, 0);
|
|
|
|
|
|
|
|
var root_child1 = Yoga.Node.create(config);
|
|
|
|
root_child1.setHeight(10);
|
|
|
|
root.insertChild(root_child1, 1);
|
|
|
|
|
|
|
|
var root_child2 = Yoga.Node.create(config);
|
|
|
|
root_child2.setHeight(10);
|
|
|
|
root.insertChild(root_child2, 2);
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(26 === root_child0.getComputedLeft(), "26 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(51 === root_child1.getComputedLeft(), "51 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(77 === root_child2.getComputedLeft(), "77 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedWidth(), "0 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
|
|
|
|
|
|
|
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
|
|
|
console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
|
|
|
console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(77 === root_child0.getComputedLeft(), "77 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
|
|
|
console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(51 === root_child1.getComputedLeft(), "51 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
|
|
|
|
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
|
|
|
|
|
|
|
|
console.assert(26 === root_child2.getComputedLeft(), "26 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
|
|
|
|
console.assert(0 === root_child2.getComputedWidth(), "0 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
|
|
|
|
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
|
|
|
|
} finally {
|
|
|
|
if (typeof root !== "undefined") {
|
|
|
|
root.freeRecursive();
|
|
|
|
}
|
|
|
|
|
|
|
|
config.free();
|
|
|
|
}
|
|
|
|
});
|