diff --git a/.github/actions/black/action.yml b/.github/actions/black/action.yml
new file mode 100644
index 00000000..63b6c423
--- /dev/null
+++ b/.github/actions/black/action.yml
@@ -0,0 +1,25 @@
+name: Black Formatter
+inputs:
+ directory:
+ description: Directory to Lint
+ required: true
+ version:
+ description: pypi version of "black" to use
+ required: false
+ default: 22.3.0
+
+runs:
+ using: "composite"
+ steps:
+ - name: Ensure supported Python selected
+ uses: actions/setup-python@v4
+ with:
+ python-version: '>=3.6.2'
+
+ - name: pip install
+ shell: bash
+ run: pip install black==${{ inputs.version }}
+
+ - name: black
+ shell: bash
+ run: black --check ${{ inputs.directory }}
diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml
index a0d52af2..b81af54f 100644
--- a/.github/actions/clang-format/action.yml
+++ b/.github/actions/clang-format/action.yml
@@ -18,7 +18,6 @@ runs:
- name: clang-format
working-directory: ${{ inputs.directory }}
shell: bash
- run: |
- shopt -s globstar
- shopt -s nullglob
- clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h **/*.m **/*.mm
+ env:
+ BASHOPTS: extglob:nullglob
+ run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.{h,hh,hpp,c,cpp,cc,m,mm}
diff --git a/.github/actions/install-emsdk/action.yml b/.github/actions/install-emsdk/action.yml
new file mode 100644
index 00000000..8f0be736
--- /dev/null
+++ b/.github/actions/install-emsdk/action.yml
@@ -0,0 +1,23 @@
+name: Install emsdk (including emcc)
+inputs:
+ version:
+ description: EMCC Version to install
+ required: false
+ default: 3.1.28
+
+runs:
+ using: "composite"
+ steps:
+ - name: Clone emsdk repo
+ working-directory: ${{ runner.temp }}
+ shell: bash
+ run: git clone https://github.com/emscripten-core/emsdk.git
+
+ - name: emdsk install
+ working-directory: ${{ runner.temp }}/emsdk
+ shell: bash
+ run: |
+ ./emsdk install ${{ inputs.version }}
+ ./emsdk activate ${{ inputs.version }}
+ echo $RUNNER_TEMP/emsdk >> $GITHUB_PATH
+ echo $RUNNER_TEMP/emsdk/upstream/emscripten >> $GITHUB_PATH
diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml
index c2666453..39bbbcee 100644
--- a/.github/actions/setup-android/action.yml
+++ b/.github/actions/setup-android/action.yml
@@ -3,11 +3,8 @@ name: Setup Android envirionment
runs:
using: "composite"
steps:
- - name: Install JDK 1.8
- uses: actions/setup-java@v1
+ - name: Select Java Version
+ uses: actions/setup-java@v2
with:
- java-version: 1.8
-
- - name: Install NDK 21
- shell: bash
- run: echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT}
+ distribution: temurin
+ java-version: 8
diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml
new file mode 100644
index 00000000..3694fb17
--- /dev/null
+++ b/.github/actions/setup-js/action.yml
@@ -0,0 +1,27 @@
+name: Setup JavaScript envirionment
+
+runs:
+ using: "composite"
+ steps:
+ - name: Install Node
+ uses: actions/setup-node@v1
+ with:
+ node-version: 18.x
+
+ - name: Install emsdk
+ uses: ./.github/actions/install-emsdk
+
+ - name: Install ninja (Linux)
+ if: ${{ runner.os == 'Linux' }}
+ shell: bash
+ run: sudo apt-get install -y ninja-build
+
+ - name: Install ninja (Windows)
+ if: ${{ runner.os == 'Windows' }}
+ shell: powershell
+ run: choco install ninja
+
+ - name: yarn install
+ shell: bash
+ run: yarn install --frozen-lockfile
+ working-directory: javascript
diff --git a/.github/actions/setup-website/action.yml b/.github/actions/setup-website/action.yml
index d7cfe42d..0473cee3 100644
--- a/.github/actions/setup-website/action.yml
+++ b/.github/actions/setup-website/action.yml
@@ -3,11 +3,15 @@ name: Setup Website envirionment
runs:
using: "composite"
steps:
- - name: Install NodeJS 12
+ # TODO: Update to latest when website is moved to the workspace version of
+ # yoga-layout
+ - name: Install Node
uses: actions/setup-node@v1
with:
node-version: 12.x
+ # TODO: the website should be in a yarn workspace with the library, but the
+ # current version of gatsby is incompatible with hoisting.
- name: yarn install
shell: bash
run: yarn install --frozen-lockfile
diff --git a/.github/workflows/validate-android.yml b/.github/workflows/validate-android.yml
index 4935fb27..3da04e98 100644
--- a/.github/workflows/validate-android.yml
+++ b/.github/workflows/validate-android.yml
@@ -9,11 +9,12 @@ on:
jobs:
build:
- name: Build (${{ matrix.mode }})
- runs-on: ubuntu-latest
+ name: Build [${{ matrix.os }}][${{ matrix.mode }}]
+ runs-on: ${{ matrix.os }}
strategy:
matrix:
mode: [Debug, Release]
+ os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/validate-apple.yml b/.github/workflows/validate-apple.yml
index 3f90e67d..3b569812 100644
--- a/.github/workflows/validate-apple.yml
+++ b/.github/workflows/validate-apple.yml
@@ -10,7 +10,6 @@ on:
jobs:
lint-pods:
name: Lint
- if: ${{ false }} # Apple Build is Broken
runs-on: macos-latest
steps:
@@ -21,10 +20,10 @@ jobs:
- name: pod spec lint
run: pod spec lint --verbose
+ continue-on-error: true # Apple Build is Broken
build-sample:
- name: Build (${{ matrix.mode }})
- if: ${{ false }} # Apple Build is Broken
+ name: Build [${{ matrix.mode }}]
runs-on: macos-latest
strategy:
matrix:
@@ -37,8 +36,9 @@ jobs:
uses: ./.github/actions/setup-apple
- name: pod install
- working-directory: ./YogaKit/YogaKitSample
run: pod install
+ working-directory: ./YogaKit/YogaKitSample
+ continue-on-error: true # Apple Build is Broken
# TODO: xcodebuild
diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml
new file mode 100644
index 00000000..2b856906
--- /dev/null
+++ b/.github/workflows/validate-js.yml
@@ -0,0 +1,74 @@
+name: JavaScript
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+env:
+ FORCE_COLOR: 3
+
+jobs:
+ benchmark:
+ name: Benchmark [${{ matrix.os }}]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest]
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup
+ uses: ./.github/actions/setup-js
+
+ - name: yarn benchmark
+ run: yarn benchmark
+ working-directory: javascript
+
+ build:
+ name: Build [${{ matrix.os }}]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest]
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup
+ uses: ./.github/actions/setup-js
+
+ - name: yarn build
+ run: yarn build
+ working-directory: javascript
+
+ test:
+ name: Test [${{ matrix.os }}]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest]
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup
+ uses: ./.github/actions/setup-js
+
+ - name: yarn test
+ run: yarn test
+ working-directory: javascript
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: yarn install
+ run: yarn install --frozen-lockfile
+ working-directory: javascript
+
+ - name: yarn lint
+ run: yarn lint
+ working-directory: javascript
diff --git a/.github/workflows/validate-python.yml b/.github/workflows/validate-python.yml
new file mode 100644
index 00000000..6ff392d2
--- /dev/null
+++ b/.github/workflows/validate-python.yml
@@ -0,0 +1,21 @@
+name: Python
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ format:
+ name: Format
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: black --check
+ uses: ./.github/actions/black
+ with:
+ directory: ${{ github.workspace }}
diff --git a/csharp/tests/Facebook.Yoga/YGGapTest.cs b/csharp/tests/Facebook.Yoga/YGGapTest.cs
index fd6ecc84..173e10f0 100644
--- a/csharp/tests/Facebook.Yoga/YGGapTest.cs
+++ b/csharp/tests/Facebook.Yoga/YGGapTest.cs
@@ -1597,6 +1597,74 @@ namespace Facebook.Yoga
Assert.AreEqual(150f, root_child4.LayoutHeight);
}
+ [Test]
+ public void Test_column_gap_determines_parent_width()
+ {
+ YogaConfig config = new YogaConfig();
+
+ YogaNode root = new YogaNode(config);
+ root.FlexDirection = YogaFlexDirection.Row;
+ root.Height = 100;
+ root.ColumnGap = 10;
+
+ YogaNode root_child0 = new YogaNode(config);
+ root_child0.Width = 10;
+ root.Insert(0, root_child0);
+
+ YogaNode root_child1 = new YogaNode(config);
+ root_child1.Width = 20;
+ root.Insert(1, root_child1);
+
+ YogaNode root_child2 = new YogaNode(config);
+ root_child2.Width = 30;
+ root.Insert(2, root_child2);
+ root.StyleDirection = YogaDirection.LTR;
+ root.CalculateLayout();
+
+ Assert.AreEqual(0f, root.LayoutX);
+ Assert.AreEqual(0f, root.LayoutY);
+ Assert.AreEqual(80f, root.LayoutWidth);
+ Assert.AreEqual(100f, root.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child0.LayoutX);
+ Assert.AreEqual(0f, root_child0.LayoutY);
+ Assert.AreEqual(10f, root_child0.LayoutWidth);
+ Assert.AreEqual(100f, root_child0.LayoutHeight);
+
+ Assert.AreEqual(20f, root_child1.LayoutX);
+ Assert.AreEqual(0f, root_child1.LayoutY);
+ Assert.AreEqual(20f, root_child1.LayoutWidth);
+ Assert.AreEqual(100f, root_child1.LayoutHeight);
+
+ Assert.AreEqual(50f, root_child2.LayoutX);
+ Assert.AreEqual(0f, root_child2.LayoutY);
+ Assert.AreEqual(30f, root_child2.LayoutWidth);
+ Assert.AreEqual(100f, root_child2.LayoutHeight);
+
+ root.StyleDirection = YogaDirection.RTL;
+ root.CalculateLayout();
+
+ Assert.AreEqual(0f, root.LayoutX);
+ Assert.AreEqual(0f, root.LayoutY);
+ Assert.AreEqual(80f, root.LayoutWidth);
+ Assert.AreEqual(100f, root.LayoutHeight);
+
+ Assert.AreEqual(70f, root_child0.LayoutX);
+ Assert.AreEqual(0f, root_child0.LayoutY);
+ Assert.AreEqual(10f, root_child0.LayoutWidth);
+ Assert.AreEqual(100f, root_child0.LayoutHeight);
+
+ Assert.AreEqual(40f, root_child1.LayoutX);
+ Assert.AreEqual(0f, root_child1.LayoutY);
+ Assert.AreEqual(20f, root_child1.LayoutWidth);
+ Assert.AreEqual(100f, root_child1.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child2.LayoutX);
+ Assert.AreEqual(0f, root_child2.LayoutY);
+ Assert.AreEqual(30f, root_child2.LayoutWidth);
+ Assert.AreEqual(100f, root_child2.LayoutHeight);
+ }
+
[Test]
public void Test_row_gap_align_items_stretch()
{
@@ -1981,5 +2049,72 @@ namespace Facebook.Yoga
Assert.AreEqual(0f, root_child2.LayoutHeight);
}
+ [Test]
+ public void Test_row_gap_determines_parent_height()
+ {
+ YogaConfig config = new YogaConfig();
+
+ YogaNode root = new YogaNode(config);
+ root.Width = 100;
+ root.RowGap = 10;
+
+ YogaNode root_child0 = new YogaNode(config);
+ root_child0.Height = 10;
+ root.Insert(0, root_child0);
+
+ YogaNode root_child1 = new YogaNode(config);
+ root_child1.Height = 20;
+ root.Insert(1, root_child1);
+
+ YogaNode root_child2 = new YogaNode(config);
+ root_child2.Height = 30;
+ root.Insert(2, root_child2);
+ root.StyleDirection = YogaDirection.LTR;
+ root.CalculateLayout();
+
+ Assert.AreEqual(0f, root.LayoutX);
+ Assert.AreEqual(0f, root.LayoutY);
+ Assert.AreEqual(100f, root.LayoutWidth);
+ Assert.AreEqual(80f, root.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child0.LayoutX);
+ Assert.AreEqual(0f, root_child0.LayoutY);
+ Assert.AreEqual(100f, root_child0.LayoutWidth);
+ Assert.AreEqual(10f, root_child0.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child1.LayoutX);
+ Assert.AreEqual(20f, root_child1.LayoutY);
+ Assert.AreEqual(100f, root_child1.LayoutWidth);
+ Assert.AreEqual(20f, root_child1.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child2.LayoutX);
+ Assert.AreEqual(50f, root_child2.LayoutY);
+ Assert.AreEqual(100f, root_child2.LayoutWidth);
+ Assert.AreEqual(30f, root_child2.LayoutHeight);
+
+ root.StyleDirection = YogaDirection.RTL;
+ root.CalculateLayout();
+
+ Assert.AreEqual(0f, root.LayoutX);
+ Assert.AreEqual(0f, root.LayoutY);
+ Assert.AreEqual(100f, root.LayoutWidth);
+ Assert.AreEqual(80f, root.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child0.LayoutX);
+ Assert.AreEqual(0f, root_child0.LayoutY);
+ Assert.AreEqual(100f, root_child0.LayoutWidth);
+ Assert.AreEqual(10f, root_child0.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child1.LayoutX);
+ Assert.AreEqual(20f, root_child1.LayoutY);
+ Assert.AreEqual(100f, root_child1.LayoutWidth);
+ Assert.AreEqual(20f, root_child1.LayoutHeight);
+
+ Assert.AreEqual(0f, root_child2.LayoutX);
+ Assert.AreEqual(50f, root_child2.LayoutY);
+ Assert.AreEqual(100f, root_child2.LayoutWidth);
+ Assert.AreEqual(30f, root_child2.LayoutHeight);
+ }
+
}
}
diff --git a/enums.py b/enums.py
index 03152072..d39bddba 100644
--- a/enums.py
+++ b/enums.py
@@ -222,38 +222,56 @@ for name, values in sorted(ENUMS.items()):
f.write("}\n")
# write out javascript file
-with open(root + "/javascript/sources/YGEnums.js", "w") as f:
+with open(root + "/javascript/src_js/generated/YGEnums.js", "w") as f:
f.write(get_license("js"))
- f.write("// @flow\n")
- f.write("// @format\n")
- f.write("const CONSTANTS = {\n")
+ f.write("module.exports = {\n")
items = sorted(ENUMS.items())
for name, values in items:
- f.write(" %s_COUNT: %s,\n" % (to_java_upper(name), len(values)))
base = 0
for value in values:
- if isinstance(value, tuple):
- f.write(
- " %s_%s: %d,\n"
- % (to_java_upper(name), to_java_upper(value[0]), value[1])
- )
- base = value[1] + 1
- else:
- f.write(
- " %s_%s: %d,\n" % (to_java_upper(name), to_java_upper(value), base)
- )
- base += 1
+ value_arg = value[0] if isinstance(value, tuple) else value
+ ordinal_arg = value[1] if isinstance(value, tuple) else base
+
+ f.write(
+ " %s_%s: %d,\n"
+ % (to_java_upper(name), to_java_upper(value_arg), ordinal_arg)
+ )
+ base = ordinal_arg + 1
if name != items[-1][0]:
f.write("\n")
f.write("};\n")
+with open(root + "/javascript/src_js/generated/YGEnums.d.ts", "w") as f:
+ f.write(get_license("js"))
+
for name, values in sorted(ENUMS.items()):
- f.write("export type Yoga${} =\n".format(name))
+ base = 0
+ for value in values:
+ value_arg = value[0] if isinstance(value, tuple) else value
+ ordinal_arg = value[1] if isinstance(value, tuple) else base
+
+ f.write(
+ (
+ "type {name}_{value} = {ordinal} & ['{name}']\n"
+ + "export const {name}_{value}: {name}_{value};\n\n"
+ ).format(
+ name=to_java_upper(name),
+ value=to_java_upper(value_arg),
+ ordinal=ordinal_arg,
+ )
+ )
+
+ base = ordinal_arg + 1
+
+ f.write("\n")
+
+ for name, values in sorted(ENUMS.items()):
+ f.write("export type {} =\n".format(name))
for value in values:
unpackedValue = value[0] if isinstance(value, tuple) else value
f.write(
- " | typeof CONSTANTS.{}_{}".format(
+ " | typeof {}_{}".format(
to_java_upper(name), to_java_upper(unpackedValue)
)
)
@@ -263,4 +281,3 @@ with open(root + "/javascript/sources/YGEnums.js", "w") as f:
f.write("\n")
f.write("\n")
- f.write("module.exports = CONSTANTS;\n")
diff --git a/gentest/Gemfile.lock b/gentest/Gemfile.lock
index 57313752..48781c15 100644
--- a/gentest/Gemfile.lock
+++ b/gentest/Gemfile.lock
@@ -3,10 +3,10 @@ GEM
specs:
childprocess (4.1.0)
mini_portile2 (2.8.0)
- nokogiri (1.13.9)
+ nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
- racc (1.6.0)
+ racc (1.6.1)
regexp_parser (2.6.0)
rexml (3.2.5)
rubyzip (2.3.2)
diff --git a/gentest/fixtures/YGGapTest.html b/gentest/fixtures/YGGapTest.html
index 7b412256..4bfc7753 100644
--- a/gentest/fixtures/YGGapTest.html
+++ b/gentest/fixtures/YGGapTest.html
@@ -123,6 +123,12 @@
+
+
+
+
diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js
index 668173cf..2b005aad 100644
--- a/gentest/gentest-javascript.js
+++ b/gentest/gentest-javascript.js
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
-var JavascriptEmitter = function() {
+const JavascriptEmitter = function() {
Emitter.call(this, 'js', ' ');
};
@@ -17,9 +17,8 @@ function toValueJavascript(value) {
}
function toJavascriptUpper(symbol) {
- var out = '';
- for (var i = 0; i < symbol.length; i++) {
- var c = symbol[i];
+ let out = '';
+ for (const c of symbol) {
if (c == c.toUpperCase() && i != 0 && symbol[i - 1] != symbol[i - 1].toUpperCase()) {
out += '_';
}
@@ -31,21 +30,17 @@ function toJavascriptUpper(symbol) {
JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
constructor:{value:JavascriptEmitter},
- emitPrologue:{value:function() {
- this.push([
- 'var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);',
- ''
- ]);
- }},
+ emitPrologue:{value:function() {}},
emitTestPrologue:{value:function(name, experiments) {
- this.push('it(' + JSON.stringify(name) + ', function () {');
+ this.push('test(' + JSON.stringify(name) + ', () => {');
this.pushIndent();
- this.push('var config = Yoga.Config.create();');
+ this.push('const config = Yoga.Config.create();');
+ this.push('let root;');
this.push('');
if (experiments.length > 0) {
- for (var i in experiments) {
+ for (const i in experiments) {
this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiments[i]) + ', true);');
}
this.push('');
@@ -56,7 +51,11 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
}},
emitTestTreePrologue:{value:function(nodeName) {
- this.push('var ' + nodeName + ' = Yoga.Node.create(config);');
+ if (nodeName === 'root') {
+ this.push(`root = Yoga.Node.create(config);`);
+ } else {
+ this.push(`const ${nodeName} = Yoga.Node.create(config);`);
+ }
}},
emitTestEpilogue:{value:function(experiments) {
@@ -84,7 +83,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
}},
AssertEQ:{value:function(v0, v1) {
- this.push('console.assert(' + v0 + ' === ' + v1 + ', "' + v0 + ' === ' + v1 + ' (" + ' + v1 + ' + ")");');
+ this.push(`expect(${v1}).toBe(${v0});`);
}},
YGAlignAuto:{value:'Yoga.ALIGN_AUTO'},
diff --git a/gentest/gentest.rb b/gentest/gentest.rb
index 54481ac3..22c93721 100644
--- a/gentest/gentest.rb
+++ b/gentest/gentest.rb
@@ -42,7 +42,7 @@ Dir['fixtures/*.html'].each do |file|
browser.goto('file://' + Dir.pwd + '/test.html')
logs = browser.driver.logs.get(:browser)
- f = File.open("../tests/#{name}.cpp", 'w')
+ f = File.open("../tests/generated/#{name}.cpp", 'w')
f.write eval(logs[0].message.sub(/^[^"]*/, ''))
f.close
@@ -56,7 +56,7 @@ Dir['fixtures/*.html'].each do |file|
print logs[4]
- f = File.open("../javascript/tests/Facebook.Yoga/#{name}.js", 'w')
+ f = File.open("../javascript/tests/generated/#{name}.test.js", 'w')
f.write eval(logs[3].message.sub(/^[^"]*/, '')).sub('YogaTest', name)
f.close
end
diff --git a/java/build.gradle b/java/build.gradle
index 1672a9ea..0b990b8a 100644
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -53,7 +53,6 @@ dependencies {
implementation project(':yoga:proguard-annotations')
implementation 'com.facebook.soloader:soloader:0.10.4'
testImplementation 'junit:junit:4.12'
- testImplementation project(':testutil')
}
apply plugin: 'com.vanniktech.maven.publish'
diff --git a/java/tests/com/facebook/yoga/YGGapTest.java b/java/tests/com/facebook/yoga/YGGapTest.java
index b22d5656..29d08d8f 100644
--- a/java/tests/com/facebook/yoga/YGGapTest.java
+++ b/java/tests/com/facebook/yoga/YGGapTest.java
@@ -1589,6 +1589,73 @@ public class YGGapTest {
assertEquals(150f, root_child4.getLayoutHeight(), 0.0f);
}
+ @Test
+ public void test_column_gap_determines_parent_width() {
+ YogaConfig config = YogaConfigFactory.create();
+
+ final YogaNode root = createNode(config);
+ root.setFlexDirection(YogaFlexDirection.ROW);
+ root.setHeight(100f);
+ root.setGap(YogaGutter.COLUMN, 10f);
+
+ final YogaNode root_child0 = createNode(config);
+ root_child0.setWidth(10f);
+ root.addChildAt(root_child0, 0);
+
+ final YogaNode root_child1 = createNode(config);
+ root_child1.setWidth(20f);
+ root.addChildAt(root_child1, 1);
+
+ final YogaNode root_child2 = createNode(config);
+ root_child2.setWidth(30f);
+ root.addChildAt(root_child2, 2);
+ root.setDirection(YogaDirection.LTR);
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
+
+ assertEquals(0f, root.getLayoutX(), 0.0f);
+ assertEquals(0f, root.getLayoutY(), 0.0f);
+ assertEquals(80f, root.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
+ assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
+
+ assertEquals(20f, root_child1.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
+ assertEquals(20f, root_child1.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
+
+ assertEquals(50f, root_child2.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child2.getLayoutY(), 0.0f);
+ assertEquals(30f, root_child2.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
+
+ root.setDirection(YogaDirection.RTL);
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
+
+ assertEquals(0f, root.getLayoutX(), 0.0f);
+ assertEquals(0f, root.getLayoutY(), 0.0f);
+ assertEquals(80f, root.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
+
+ assertEquals(70f, root_child0.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
+ assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
+
+ assertEquals(40f, root_child1.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
+ assertEquals(20f, root_child1.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child2.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child2.getLayoutY(), 0.0f);
+ assertEquals(30f, root_child2.getLayoutWidth(), 0.0f);
+ assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
+ }
+
@Test
public void test_row_gap_align_items_stretch() {
YogaConfig config = YogaConfigFactory.create();
@@ -1969,6 +2036,72 @@ public class YGGapTest {
assertEquals(0f, root_child2.getLayoutHeight(), 0.0f);
}
+ @Test
+ public void test_row_gap_determines_parent_height() {
+ YogaConfig config = YogaConfigFactory.create();
+
+ final YogaNode root = createNode(config);
+ root.setWidth(100f);
+ root.setGap(YogaGutter.ROW, 10f);
+
+ final YogaNode root_child0 = createNode(config);
+ root_child0.setHeight(10f);
+ root.addChildAt(root_child0, 0);
+
+ final YogaNode root_child1 = createNode(config);
+ root_child1.setHeight(20f);
+ root.addChildAt(root_child1, 1);
+
+ final YogaNode root_child2 = createNode(config);
+ root_child2.setHeight(30f);
+ root.addChildAt(root_child2, 2);
+ root.setDirection(YogaDirection.LTR);
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
+
+ assertEquals(0f, root.getLayoutX(), 0.0f);
+ assertEquals(0f, root.getLayoutY(), 0.0f);
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
+ assertEquals(80f, root.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
+ assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
+ assertEquals(20f, root_child1.getLayoutY(), 0.0f);
+ assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
+ assertEquals(20f, root_child1.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child2.getLayoutX(), 0.0f);
+ assertEquals(50f, root_child2.getLayoutY(), 0.0f);
+ assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
+ assertEquals(30f, root_child2.getLayoutHeight(), 0.0f);
+
+ root.setDirection(YogaDirection.RTL);
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
+
+ assertEquals(0f, root.getLayoutX(), 0.0f);
+ assertEquals(0f, root.getLayoutY(), 0.0f);
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
+ assertEquals(80f, root.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
+ assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
+ assertEquals(20f, root_child1.getLayoutY(), 0.0f);
+ assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
+ assertEquals(20f, root_child1.getLayoutHeight(), 0.0f);
+
+ assertEquals(0f, root_child2.getLayoutX(), 0.0f);
+ assertEquals(50f, root_child2.getLayoutY(), 0.0f);
+ assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
+ assertEquals(30f, root_child2.getLayoutHeight(), 0.0f);
+ }
+
private YogaNode createNode(YogaConfig config) {
return mNodeFactory.create(config);
}
diff --git a/java/tests/com/facebook/yoga/YogaNodeTest.java b/java/tests/com/facebook/yoga/YogaNodeTest.java
index ffc6fa7f..12c6390a 100644
--- a/java/tests/com/facebook/yoga/YogaNodeTest.java
+++ b/java/tests/com/facebook/yoga/YogaNodeTest.java
@@ -32,9 +32,7 @@ public class YogaNodeTest {
@Test
public void testInit() {
- TestUtil.startCountingNodes();
final YogaNode node = createNode();
- assertEquals(1, TestUtil.stopCountingNodes());
}
@Test
diff --git a/javascript/.babelrc b/javascript/.babelrc
deleted file mode 100644
index d52d4dd5..00000000
--- a/javascript/.babelrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "presets": ["stage-3", "es2015"],
- "plugins": [
- "transform-flow-strip-types",
- [
- "replace-require",
- {
- "fs": "{}",
- "path": "{}"
- }
- ]
- ]
-}
diff --git a/javascript/.babelrc.js b/javascript/.babelrc.js
new file mode 100644
index 00000000..6a57844c
--- /dev/null
+++ b/javascript/.babelrc.js
@@ -0,0 +1,14 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+module.exports = {
+ "presets": [
+ ["@babel/preset-env", {"targets": "defaults"}]
+ ],
+};
diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js
new file mode 100644
index 00000000..6cedc194
--- /dev/null
+++ b/javascript/.eslintrc.js
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+module.exports = {
+ ignorePatterns: ["dist/**", "**/*.d.ts"],
+ parser: "@babel/eslint-parser",
+ extends: [
+ "eslint:recommended",
+ "plugin:jest/recommended",
+ "plugin:prettier/recommended",
+ ],
+ rules: {
+ "no-var": "error",
+ "prefer-arrow-callback": "error",
+ "prefer-const": "error",
+ "prefer-object-spread": "error",
+ "prefer-spread": "error",
+ "require-await": "error",
+ },
+ env: {
+ commonjs: true,
+ es6: true,
+ },
+ overrides: [
+ {
+ files: ["jest.*", "just.config.js", "tests/**"],
+ env: {
+ node: true,
+ },
+ globals: {
+ getMeasureCounter: "writable",
+ getMeasureCounterMax: "writable",
+ getMeasureCounterMin: "writable",
+ Yoga: "writable",
+ YGBENCHMARK: "writable",
+ },
+ },
+ ],
+};
diff --git a/javascript/.gitignore b/javascript/.gitignore
index 2be86e61..29751e5c 100644
--- a/javascript/.gitignore
+++ b/javascript/.gitignore
@@ -1,10 +1,3 @@
-node_modules
-
-*.gypi
-!/final-flags.gypi
-
+/build
/dist
-/build/*
-/sources/yoga
-
-npm-debug.log*
+/node_modules
diff --git a/javascript/.hgignore b/javascript/.hgignore
deleted file mode 100644
index 81e96ec0..00000000
--- a/javascript/.hgignore
+++ /dev/null
@@ -1,15 +0,0 @@
-syntax:glob
-
-node_modules
-
-*.gypi
-!/final-flags.gypi
-
-/dist
-/build/*
-!/build/Release
-/build/Release/*
-!/build/Release/nbind.js
-/sources/yoga
-
-npm-debug.log*
diff --git a/javascript/.prettierignore b/javascript/.prettierignore
new file mode 100644
index 00000000..a70ec0e5
--- /dev/null
+++ b/javascript/.prettierignore
@@ -0,0 +1 @@
+tests/generated/
diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt
new file mode 100644
index 00000000..1068ec89
--- /dev/null
+++ b/javascript/CMakeLists.txt
@@ -0,0 +1,72 @@
+# Copyright (c) Meta Platforms, Inc. and affiliates.
+#
+# This source code is licensed under the MIT license found in the
+# LICENSE file in the root directory of this source tree.
+
+cmake_minimum_required(VERSION 3.13)
+set(CMAKE_VERBOSE_MAKEFILE on)
+project(yoga)
+
+file(GLOB SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/../yoga/*.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../yoga/**/*.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/src_native/*.cc)
+
+include_directories(..)
+
+set(CXX_STANDARD, 11)
+
+add_compile_definitions(
+ EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0)
+
+set(COMPILE_OPTIONS
+ -flto
+ -fno-exceptions
+ -fno-rtti
+ -g0
+ -Os
+ "SHELL:-s STRICT=1")
+
+add_compile_options(${COMPILE_OPTIONS})
+
+add_link_options(
+ ${COMPILE_OPTIONS}
+ --closure 1
+ --memory-init-file 0
+ --no-entry
+ "SHELL:-s ALLOW_MEMORY_GROWTH=1"
+ "SHELL:-s ASSERTIONS=0"
+ "SHELL:-s DYNAMIC_EXECUTION=0"
+ "SHELL:-s ENVIRONMENT='web,node'"
+ "SHELL:-s EXPORT_NAME='loadYoga'"
+ "SHELL:-s FETCH_SUPPORT_INDEXEDDB=0"
+ "SHELL:-s FILESYSTEM=0"
+ "SHELL:-s MALLOC='emmalloc'"
+ "SHELL:-s MODULARIZE=1"
+ "SHELL:-s TEXTDECODER=0")
+
+link_libraries(embind)
+
+add_library(yogaObjLib OBJECT ${SOURCES})
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist/build)
+
+add_executable(asmjs-sync $)
+target_link_options(asmjs-sync PUBLIC
+ "SHELL:-s WASM=0"
+ "SHELL:-s WASM_ASYNC_COMPILATION=0")
+
+add_executable(asmjs-async $)
+target_link_options(asmjs-async PUBLIC
+ "SHELL:-s WASM=0"
+ "SHELL:-s WASM_ASYNC_COMPILATION=1")
+
+add_executable(wasm-sync $)
+target_link_options(wasm-sync PUBLIC
+ "SHELL:-s WASM=1"
+ "SHELL:-s WASM_ASYNC_COMPILATION=0")
+
+add_executable(wasm-async $)
+target_link_options(wasm-async PUBLIC
+ "SHELL:-s WASM=1"
+ "SHELL:-s WASM_ASYNC_COMPILATION=1")
diff --git a/javascript/README.md b/javascript/README.md
new file mode 100644
index 00000000..6f7b4d1a
--- /dev/null
+++ b/javascript/README.md
@@ -0,0 +1,76 @@
+# yoga-layout
+
+This package provides prebuilt JavaScript bindings for the Yoga layout engine. Both WebAssembly and asm.js variants are packaged, with the optimal loaded based on platform.
+
+## Usage
+
+The default entrypoint provides an asynchronous loader function to return a Yoga instance.
+
+```ts
+import { loadYoga, ALIGN_CENTER } from "yoga-layout";
+
+const Yoga = await loadYoga();
+
+const node = Yoga.Node.create();
+node.setAlignContent(ALIGN_CENTER);
+```
+
+An alternative synchronous API is provided for compatibility, but requires using asm.js in browsers instead of WebAssembly, leading to worse performance and larger assets.
+
+```ts
+import Yoga, { ALIGN_CENTER } from "yoga-layout/sync";
+
+const node = Yoga.Node.create();
+node.setAlignContent(ALIGN_CENTER);
+```
+
+Objects created by `Yoga.<>.create()` are not automatically garbage collected and should be freed once they are no longer in use.
+
+```ts
+// Free a config
+config.free();
+
+// Free a tree of Nodes
+node.freeRecursive();
+
+// Free a single Node
+node.free();
+```
+
+## Selecting WebAssembly or asm.js
+
+For better performance and smaller packages, WebAssembly is preferred to asm.js where available. `yoga-layout` tries to provide the right default using [export maps](https://webpack.js.org/guides/package-exports/#conditional-syntax) so that platforms which can take advantage of WebAssembly use it by default.
+
+A specific entrypoint may be specified on platforms which do not understand export conditions.
+
+```ts
+import { loadYoga } from "yoga-layout/dist/entrypoint/wasm-async";
+```
+
+
+## Contributing
+
+### Requirements
+
+1. Emscripten SDK
+1. CMake >= 3.13
+1. (Optional) ninja, for faster builds
+
+### Building
+
+```bash
+git clone https://github.com/facebook/yoga.git
+cd yoga/javascript
+yarn install
+yarn build
+```
+
+### Testing
+
+```bash
+# Build and test all entrypoints
+yarn test
+
+# Build and test a specific entrypoint
+yarn test:asmjs-sync
+```
diff --git a/javascript/autogypi.json b/javascript/autogypi.json
deleted file mode 100644
index b81b491c..00000000
--- a/javascript/autogypi.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "dependencies": [
- "nbind"
- ],
- "includes": []
-}
diff --git a/javascript/binding.gyp b/javascript/binding.gyp
deleted file mode 100644
index da48de18..00000000
--- a/javascript/binding.gyp
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "targets": [{
- "includes": [
- "auto.gypi",
- "final-flags.gypi"
- ],
-
- "sources": [
- " {
+ if (process.env["SYNC"] == true && process.env["WASM"] == true) {
+ global.Yoga = require("./dist/entrypoint/wasm-sync");
+ } else if (process.env["SYNC"] == true) {
+ global.Yoga = require("./dist/entrypoint/asmjs-sync");
+ } else if (process.env["WASM"] == true) {
+ global.Yoga = await require("./dist/entrypoint/wasm-async").loadYoga();
+ } else {
+ global.Yoga = await require("./dist/entrypoint/asmjs-async").loadYoga();
+ }
+};
+
+Object.defineProperty(global, "YGBENCHMARK", {
+ get: () => global.test,
+});
diff --git a/javascript/just.config.js b/javascript/just.config.js
new file mode 100644
index 00000000..b221a090
--- /dev/null
+++ b/javascript/just.config.js
@@ -0,0 +1,143 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const {
+ argv,
+ copyTask,
+ eslintTask,
+ logger,
+ jestTask,
+ option,
+ parallel,
+ series,
+ spawn,
+ task,
+} = require("just-scripts");
+
+const glob = require("glob");
+const which = require("which");
+
+const node = process.execPath;
+
+option("fix");
+
+task(
+ "prepare-for-build",
+ parallel(
+ babelTransformTask({ paths: ["src_js"], dest: "dist" }),
+ copyTask({ paths: ["src_js/**/*.d.ts"], dest: "dist" }),
+ emcmakeGenerateTask()
+ )
+);
+
+function defineFlavor(flavor, env) {
+ task(`cmake-build:${flavor}`, cmakeBuildTask([flavor]));
+ task(`jest:${flavor}`, jestTask({ env }));
+ task(
+ `test:${flavor}`,
+ series("prepare-for-build", `cmake-build:${flavor}`, `jest:${flavor}`)
+ );
+}
+
+defineFlavor("asmjs-async", { WASM: 0, SYNC: 0 });
+defineFlavor("asmjs-sync", { WASM: 0, SYNC: 1 });
+defineFlavor("wasm-async", { WASM: 1, SYNC: 0 });
+defineFlavor("wasm-sync", { WASM: 1, SYNC: 1 });
+
+task("cmake-build:all", cmakeBuildTask());
+task("cmake-build:async", cmakeBuildTask(["asmjs-async", "wasm-async"]));
+task("cmake-build:sync", cmakeBuildTask(["asmjs-sync", "wasm-sync"]));
+
+task("build", series("prepare-for-build", "cmake-build:all"));
+
+task(
+ "test",
+ series(
+ "prepare-for-build",
+ series("cmake-build:asmjs-async", "jest:asmjs-async"),
+ series("cmake-build:asmjs-sync", "jest:asmjs-sync"),
+ series("cmake-build:wasm-async", "jest:wasm-async"),
+ series("cmake-build:wasm-sync", "jest:wasm-sync")
+ )
+);
+
+task(
+ "benchmark",
+ series("prepare-for-build", "cmake-build:sync", runBenchTask())
+);
+
+task(
+ "lint",
+ series(eslintTask({ fix: argv().fix }), clangFormatTask({ fix: argv().fix }))
+);
+
+function babelTransformTask(opts) {
+ return () => {
+ const args = [...opts.paths, "--source-maps", "--out-dir", opts.dest];
+ logger.info(`Transforming [${opts.paths.join(",")}] to '${opts.dest}'`);
+
+ return spawn(node, [require.resolve("@babel/cli/bin/babel"), ...args]);
+ };
+}
+
+function runBenchTask() {
+ return () => {
+ const files = glob.sync("./tests/Benchmarks/**/*.js");
+ const args = ["./tests/run-bench.js", ...files];
+ logger.info(args.join(" "));
+
+ return spawn(node, args, { stdio: "inherit" });
+ };
+}
+
+function emcmakeGenerateTask() {
+ return () => {
+ const emcmake = which.sync("emcmake");
+ const ninja = which.sync("ninja", { nothrow: true });
+ const args = [
+ "cmake",
+ "-S",
+ ".",
+ "-B",
+ "build",
+ ...(ninja ? ["-G", "Ninja"] : []),
+ ];
+ logger.info(["encmake", ...args].join(" "));
+
+ return spawn(emcmake, args);
+ };
+}
+
+function cmakeBuildTask(targets) {
+ return () => {
+ const cmake = which.sync("cmake");
+ const args = [
+ "--build",
+ "build",
+ ...(targets ? ["--target", ...targets] : []),
+ ];
+ logger.info(["cmake", ...args].join(" "));
+
+ return spawn(cmake, args, { stdio: "inherit" });
+ };
+}
+
+function clangFormatTask(opts) {
+ return () => {
+ const args = [
+ ...(opts.fix ? ["-i"] : ["--dry-run", "--Werror"]),
+ ...glob.sync("**/*.{h,hh,hpp,c,cpp,cc,m,mm}"),
+ ];
+ logger.info(["clang-format", ...args].join(" "));
+
+ return spawn(node, [require.resolve("clang-format"), ...args], {
+ stdio: "inherit",
+ });
+ };
+}
diff --git a/javascript/package.json b/javascript/package.json
index 3966d210..201542f2 100644
--- a/javascript/package.json
+++ b/javascript/package.json
@@ -1,49 +1,55 @@
{
"name": "yoga-layout",
- "version": "1.9.3",
- "description": "Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.",
+ "version": "2.0.0-beta.1",
+ "description": "JavaScript bindings for the Yoga layout engine",
"license": "MIT",
"repository": {
"type": "git",
"url": "git@github.com:facebook/yoga.git"
},
- "main": "./dist/entry-node",
- "browser": "./dist/entry-browser",
- "config": {
- "platform": "all"
+ "main": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "exports": {
+ ".": {
+ "browser": "./dist/entrypoint/wasm-async.js",
+ "node": "./dist/entrypoint/wasm-async.js",
+ "default": "./dist/entrypoint/asmjs-async.js"
+ },
+ "./sync": {
+ "browser": "./dist/entrypoint/asmjs-sync.js",
+ "node": "./dist/entrypoint/wasm-sync.js",
+ "default": "./dist/entrypoint/asmjs-sync.js"
+ }
},
+ "files": [
+ "dist/**",
+ "src_js/**"
+ ],
"scripts": {
- "which": "which",
- "autogypi": "autogypi",
- "node-gyp": "node-gyp",
- "emcc-path": "emcc-path",
- "is-monolithic": "test \"$(basename \"$(pwd)\")\" = javascript",
- "copy-sources": "! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)",
- "build:node": "npm run copy-sources && autogypi && node-gyp configure build",
- "build:browser": "npm run copy-sources && autogypi && node-gyp configure build --asmjs=1",
- "build:all": "npm run build:node && npm run build:browser",
- "build": "cross-env \"npm --if-present run build:$npm_package_config_platform\"",
- "test:node": "TEST_ENTRY=node time mocha --compilers js:babel-core/register --expose-gc -r tests/tools.js tests/Facebook.Yoga/**/*.js",
- "test:browser": "TEST_ENTRY=browser time mocha --compilers js:babel-core/register --expose-gc -r tests/tools.js tests/Facebook.Yoga/**/*.js",
- "test": "npm run test:node && npm run test:browser",
- "benchmark": "npm run prepublish && node tests/run-bench $(find tests/Benchmarks -name '*.js')",
- "install": "npm run build:node",
- "prepublish": "npm run copy-sources && babel sources --out-dir dist && flow-copy-source sources dist"
- },
- "dependencies": {
- "autogypi": "^0.2.2",
- "nbind": "^0.3.14",
- "node-gyp": "^3.6.2"
+ "benchmark": "just benchmark",
+ "build": "just build",
+ "lint": "just lint",
+ "lint:fix": "just lint --fix",
+ "test": "just test",
+ "test:asmjs-async": "just test:asmjs-async",
+ "test:asmjs-sync": "just test:asmjs-sync",
+ "test:wasm-async": "just test:wasm-async",
+ "test:wasm-sync": "just test:wasm-sync"
},
"devDependencies": {
- "babel-cli": "^6.24.1",
- "babel-core": "^6.25.0",
- "babel-plugin-replace-require": "^0.0.4",
- "babel-plugin-transform-flow-strip-types": "^6.22.0",
- "babel-preset-es2015": "^6.24.1",
- "babel-preset-stage-3": "^6.24.1",
- "cross-env": "^4.0.0",
- "flow-copy-source": "^2.0.7",
- "mocha": "^3.2.0"
+ "@babel/cli": "^7.20.7",
+ "@babel/core": "^7.20.7",
+ "@babel/eslint-parser": "^7.19.1",
+ "@babel/preset-env": "^7.20.2",
+ "clang-format": "^1.8.0",
+ "eslint": "^8.30.0",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-plugin-jest": "^27.1.7",
+ "eslint-plugin-prettier": "^4.2.1",
+ "glob": "^8.0.3",
+ "jest": "^29.3.1",
+ "just-scripts": "^2.1.0",
+ "prettier": "^2.4.1",
+ "which": "^3.0.0"
}
}
diff --git a/javascript/sources/YGEnums.js b/javascript/sources/YGEnums.js
deleted file mode 100644
index 96905ce4..00000000
--- a/javascript/sources/YGEnums.js
+++ /dev/null
@@ -1,211 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by enums.py
-
-// @flow
-// @format
-const CONSTANTS = {
- ALIGN_COUNT: 8,
- ALIGN_AUTO: 0,
- ALIGN_FLEX_START: 1,
- ALIGN_CENTER: 2,
- ALIGN_FLEX_END: 3,
- ALIGN_STRETCH: 4,
- ALIGN_BASELINE: 5,
- ALIGN_SPACE_BETWEEN: 6,
- ALIGN_SPACE_AROUND: 7,
-
- DIMENSION_COUNT: 2,
- DIMENSION_WIDTH: 0,
- DIMENSION_HEIGHT: 1,
-
- DIRECTION_COUNT: 3,
- DIRECTION_INHERIT: 0,
- DIRECTION_LTR: 1,
- DIRECTION_RTL: 2,
-
- DISPLAY_COUNT: 2,
- DISPLAY_FLEX: 0,
- DISPLAY_NONE: 1,
-
- EDGE_COUNT: 9,
- EDGE_LEFT: 0,
- EDGE_TOP: 1,
- EDGE_RIGHT: 2,
- EDGE_BOTTOM: 3,
- EDGE_START: 4,
- EDGE_END: 5,
- EDGE_HORIZONTAL: 6,
- EDGE_VERTICAL: 7,
- EDGE_ALL: 8,
-
- EXPERIMENTAL_FEATURE_COUNT: 1,
- EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0,
-
- FLEX_DIRECTION_COUNT: 4,
- FLEX_DIRECTION_COLUMN: 0,
- FLEX_DIRECTION_COLUMN_REVERSE: 1,
- FLEX_DIRECTION_ROW: 2,
- FLEX_DIRECTION_ROW_REVERSE: 3,
-
- GUTTER_COUNT: 3,
- GUTTER_COLUMN: 0,
- GUTTER_ROW: 1,
- GUTTER_ALL: 2,
-
- JUSTIFY_COUNT: 6,
- JUSTIFY_FLEX_START: 0,
- JUSTIFY_CENTER: 1,
- JUSTIFY_FLEX_END: 2,
- JUSTIFY_SPACE_BETWEEN: 3,
- JUSTIFY_SPACE_AROUND: 4,
- JUSTIFY_SPACE_EVENLY: 5,
-
- LOG_LEVEL_COUNT: 6,
- LOG_LEVEL_ERROR: 0,
- LOG_LEVEL_WARN: 1,
- LOG_LEVEL_INFO: 2,
- LOG_LEVEL_DEBUG: 3,
- LOG_LEVEL_VERBOSE: 4,
- LOG_LEVEL_FATAL: 5,
-
- MEASURE_MODE_COUNT: 3,
- MEASURE_MODE_UNDEFINED: 0,
- MEASURE_MODE_EXACTLY: 1,
- MEASURE_MODE_AT_MOST: 2,
-
- NODE_TYPE_COUNT: 2,
- NODE_TYPE_DEFAULT: 0,
- NODE_TYPE_TEXT: 1,
-
- OVERFLOW_COUNT: 3,
- OVERFLOW_VISIBLE: 0,
- OVERFLOW_HIDDEN: 1,
- OVERFLOW_SCROLL: 2,
-
- POSITION_TYPE_COUNT: 3,
- POSITION_TYPE_STATIC: 0,
- POSITION_TYPE_RELATIVE: 1,
- POSITION_TYPE_ABSOLUTE: 2,
-
- PRINT_OPTIONS_COUNT: 3,
- PRINT_OPTIONS_LAYOUT: 1,
- PRINT_OPTIONS_STYLE: 2,
- PRINT_OPTIONS_CHILDREN: 4,
-
- UNIT_COUNT: 4,
- UNIT_UNDEFINED: 0,
- UNIT_POINT: 1,
- UNIT_PERCENT: 2,
- UNIT_AUTO: 3,
-
- WRAP_COUNT: 3,
- WRAP_NO_WRAP: 0,
- WRAP_WRAP: 1,
- WRAP_WRAP_REVERSE: 2,
-};
-export type Yoga$Align =
- | typeof CONSTANTS.ALIGN_AUTO
- | typeof CONSTANTS.ALIGN_FLEX_START
- | typeof CONSTANTS.ALIGN_CENTER
- | typeof CONSTANTS.ALIGN_FLEX_END
- | typeof CONSTANTS.ALIGN_STRETCH
- | typeof CONSTANTS.ALIGN_BASELINE
- | typeof CONSTANTS.ALIGN_SPACE_BETWEEN
- | typeof CONSTANTS.ALIGN_SPACE_AROUND;
-
-export type Yoga$Dimension =
- | typeof CONSTANTS.DIMENSION_WIDTH
- | typeof CONSTANTS.DIMENSION_HEIGHT;
-
-export type Yoga$Direction =
- | typeof CONSTANTS.DIRECTION_INHERIT
- | typeof CONSTANTS.DIRECTION_LTR
- | typeof CONSTANTS.DIRECTION_RTL;
-
-export type Yoga$Display =
- | typeof CONSTANTS.DISPLAY_FLEX
- | typeof CONSTANTS.DISPLAY_NONE;
-
-export type Yoga$Edge =
- | typeof CONSTANTS.EDGE_LEFT
- | typeof CONSTANTS.EDGE_TOP
- | typeof CONSTANTS.EDGE_RIGHT
- | typeof CONSTANTS.EDGE_BOTTOM
- | typeof CONSTANTS.EDGE_START
- | typeof CONSTANTS.EDGE_END
- | typeof CONSTANTS.EDGE_HORIZONTAL
- | typeof CONSTANTS.EDGE_VERTICAL
- | typeof CONSTANTS.EDGE_ALL;
-
-export type Yoga$ExperimentalFeature =
- | typeof CONSTANTS.EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS;
-
-export type Yoga$FlexDirection =
- | typeof CONSTANTS.FLEX_DIRECTION_COLUMN
- | typeof CONSTANTS.FLEX_DIRECTION_COLUMN_REVERSE
- | typeof CONSTANTS.FLEX_DIRECTION_ROW
- | typeof CONSTANTS.FLEX_DIRECTION_ROW_REVERSE;
-
-export type Yoga$Gutter =
- | typeof CONSTANTS.GUTTER_COLUMN
- | typeof CONSTANTS.GUTTER_ROW
- | typeof CONSTANTS.GUTTER_ALL;
-
-export type Yoga$Justify =
- | typeof CONSTANTS.JUSTIFY_FLEX_START
- | typeof CONSTANTS.JUSTIFY_CENTER
- | typeof CONSTANTS.JUSTIFY_FLEX_END
- | typeof CONSTANTS.JUSTIFY_SPACE_BETWEEN
- | typeof CONSTANTS.JUSTIFY_SPACE_AROUND
- | typeof CONSTANTS.JUSTIFY_SPACE_EVENLY;
-
-export type Yoga$LogLevel =
- | typeof CONSTANTS.LOG_LEVEL_ERROR
- | typeof CONSTANTS.LOG_LEVEL_WARN
- | typeof CONSTANTS.LOG_LEVEL_INFO
- | typeof CONSTANTS.LOG_LEVEL_DEBUG
- | typeof CONSTANTS.LOG_LEVEL_VERBOSE
- | typeof CONSTANTS.LOG_LEVEL_FATAL;
-
-export type Yoga$MeasureMode =
- | typeof CONSTANTS.MEASURE_MODE_UNDEFINED
- | typeof CONSTANTS.MEASURE_MODE_EXACTLY
- | typeof CONSTANTS.MEASURE_MODE_AT_MOST;
-
-export type Yoga$NodeType =
- | typeof CONSTANTS.NODE_TYPE_DEFAULT
- | typeof CONSTANTS.NODE_TYPE_TEXT;
-
-export type Yoga$Overflow =
- | typeof CONSTANTS.OVERFLOW_VISIBLE
- | typeof CONSTANTS.OVERFLOW_HIDDEN
- | typeof CONSTANTS.OVERFLOW_SCROLL;
-
-export type Yoga$PositionType =
- | typeof CONSTANTS.POSITION_TYPE_STATIC
- | typeof CONSTANTS.POSITION_TYPE_RELATIVE
- | typeof CONSTANTS.POSITION_TYPE_ABSOLUTE;
-
-export type Yoga$PrintOptions =
- | typeof CONSTANTS.PRINT_OPTIONS_LAYOUT
- | typeof CONSTANTS.PRINT_OPTIONS_STYLE
- | typeof CONSTANTS.PRINT_OPTIONS_CHILDREN;
-
-export type Yoga$Unit =
- | typeof CONSTANTS.UNIT_UNDEFINED
- | typeof CONSTANTS.UNIT_POINT
- | typeof CONSTANTS.UNIT_PERCENT
- | typeof CONSTANTS.UNIT_AUTO;
-
-export type Yoga$Wrap =
- | typeof CONSTANTS.WRAP_NO_WRAP
- | typeof CONSTANTS.WRAP_WRAP
- | typeof CONSTANTS.WRAP_WRAP_REVERSE;
-
-module.exports = CONSTANTS;
diff --git a/javascript/sources/entry-browser.js b/javascript/sources/entry-browser.js
deleted file mode 100644
index 118e95fc..00000000
--- a/javascript/sources/entry-browser.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow
- * @format
- */
-
-const Yoga = require('./entry-common');
-const nbind = require('../build/Release/nbind.js');
-
-let ran = false;
-let ret = null;
-
-nbind({}, function(err, result) {
- if (ran) {
- return;
- }
-
- ran = true;
-
- if (err) {
- throw err;
- }
-
- ret = result;
-});
-
-if (!ran) {
- throw new Error(
- "Failed to load the yoga module - it needed to be loaded synchronously, but didn't",
- );
-}
-
-// $FlowFixMe ret will not be null here
-module.exports = Yoga(ret.bind, ret.lib);
-
-export type {
- Yoga$Justify,
- Yoga$Align,
- Yoga$FlexDirection,
- Yoga$Direction,
- Yoga$Wrap,
- Yoga$Gutter,
- Yoga$Edge,
- Yoga$Display,
- Yoga$Unit,
- Yoga$Overflow,
- Yoga$PositionType,
- Yoga$ExperimentalFeature,
-} from './YGEnums.js';
-
-export type {Yoga$Node, Yoga$Config} from './entry-common';
diff --git a/javascript/sources/entry-common.js b/javascript/sources/entry-common.js
deleted file mode 100644
index 7a0a753f..00000000
--- a/javascript/sources/entry-common.js
+++ /dev/null
@@ -1,360 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow
- * @format
- */
-
-
-const CONSTANTS = require('./YGEnums');
-import type {
- Yoga$Edge,
- Yoga$Wrap,
- Yoga$Align,
- Yoga$FlexDirection,
- Yoga$Gap,
- Yoga$Direction,
- Yoga$PositionType,
- Yoga$Overflow,
- Yoga$Justify,
- Yoga$Display,
- Yoga$ExperimentalFeature,
-} from './YGEnums';
-
-class Layout {
- left: number;
- right: number;
- top: number;
- bottom: number;
- width: number;
- height: number;
-
- constructor(left, right, top, bottom, width, height) {
- this.left = left;
- this.right = right;
- this.top = top;
- this.bottom = bottom;
- this.width = width;
- this.height = height;
- }
-
- fromJS(expose) {
- expose(
- this.left,
- this.right,
- this.top,
- this.bottom,
- this.width,
- this.height,
- );
- }
-
- toString() {
- return ``;
- }
-}
-
-class Size {
- static fromJS({width, height}) {
- return new Size(width, height);
- }
-
- width: number;
- height: number;
-
- constructor(width, height) {
- this.width = width;
- this.height = height;
- }
-
- fromJS(expose) {
- expose(this.width, this.height);
- }
-
- toString() {
- return ``;
- }
-}
-
-class Value {
- unit: number;
- value: number;
-
- constructor(unit, value) {
- this.unit = unit;
- this.value = value;
- }
-
- fromJS(expose) {
- expose(this.unit, this.value);
- }
-
- toString() {
- switch (this.unit) {
- case CONSTANTS.UNIT_POINT:
- return String(this.value);
- case CONSTANTS.UNIT_PERCENT:
- return `${this.value}%`;
- case CONSTANTS.UNIT_AUTO:
- return 'auto';
- default: {
- return `${this.value}?`;
- }
- }
- }
-
- valueOf() {
- return this.value;
- }
-}
-
-export type Yoga$Config = {
- isExperimentalFeatureEnabled(feature: Yoga$ExperimentalFeature): boolean,
- setExperimentalFeatureEnabled(
- feature: Yoga$ExperimentalFeature,
- enabled: boolean,
- ): void,
- setPointScaleFactor(factor: number): void,
-};
-
-export type Yoga$Node = {
- calculateLayout(
- width?: number,
- height?: number,
- direction?: Yoga$Direction,
- ): void,
- copyStyle(node: Yoga$Node): void,
- free(): void,
- freeRecursive(): void,
- getAlignContent(): Yoga$Align,
- getAlignItems(): Yoga$Align,
- getAlignSelf(): Yoga$Align,
- getAspectRatio(): number,
- getBorder(edge: Yoga$Edge): number,
- getChild(index: number): Yoga$Node,
- getChildCount(): number,
- getComputedBorder(edge: Yoga$Edge): number,
- getComputedBottom(): number,
- getComputedHeight(): number,
- getComputedLayout(): Layout,
- getComputedLeft(): number,
- getComputedMargin(edge: Yoga$Edge): number,
- getComputedPadding(edge: Yoga$Edge): number,
- getComputedRight(): number,
- getComputedTop(): number,
- getComputedWidth(): number,
- getDisplay(): Yoga$Display,
- getFlexBasis(): number,
- getFlexDirection(): Yoga$FlexDirection,
- getFlexGrow(): number,
- getFlexShrink(): number,
- getFlexWrap(): Yoga$Wrap,
- getHeight(): Value,
- getJustifyContent(): Yoga$Justify,
- getGap(gutter: Yoga$Gutter): Value,
- getMargin(edge: Yoga$Edge): Value,
- getMaxHeight(): Value,
- getMaxWidth(): Value,
- getMinHeight(): Value,
- getMinWidth(): Value,
- getOverflow(): Yoga$Overflow,
- getPadding(edge: Yoga$Edge): Value,
- getParent(): ?Yoga$Node,
- getPosition(edge: Yoga$Edge): Value,
- getPositionType(): Yoga$PositionType,
- getWidth(): Value,
- insertChild(child: Yoga$Node, index: number): void,
- isDirty(): boolean,
- markDirty(): void,
- removeChild(child: Yoga$Node): void,
- reset(): void,
- setAlignContent(alignContent: Yoga$Align): void,
- setAlignItems(alignItems: Yoga$Align): void,
- setAlignSelf(alignSelf: Yoga$Align): void,
- setAspectRatio(aspectRatio: number): void,
- setBorder(edge: Yoga$Edge, borderWidth: number): void,
- setDisplay(display: Yoga$Display): void,
- setFlex(flex: number): void,
- setFlexBasis(flexBasis: number | string): void,
- setFlexBasisPercent(flexBasis: number): void,
- setFlexBasisAuto(): void,
- setFlexDirection(flexDirection: Yoga$FlexDirection): void,
- setFlexGrow(flexGrow: number): void,
- setFlexShrink(flexShrink: number): void,
- setFlexWrap(flexWrap: Yoga$Wrap): void,
- setHeight(height: number | string): void,
- setHeightAuto(): void,
- setHeightPercent(height: number): void,
- setJustifyContent(justifyContent: Yoga$Justify): void,
- setGap(gutter: Yoga$Gutter, gapLength: number): Value,
- setMargin(edge: Yoga$Edge, margin: number): void,
- setMarginAuto(edge: Yoga$Edge): void,
- setMarginPercent(edge: Yoga$Edge, margin: number): void,
- setMaxHeight(maxHeight: number | string): void,
- setMaxHeightPercent(maxHeight: number): void,
- setMaxWidth(maxWidth: number | string): void,
- setMaxWidthPercent(maxWidth: number): void,
- setMeasureFunc(measureFunc: ?Function): void,
- setMinHeight(minHeight: number | string): void,
- setMinHeightPercent(minHeight: number): void,
- setMinWidth(minWidth: number | string): void,
- setMinWidthPercent(minWidth: number): void,
- setOverflow(overflow: Yoga$Overflow): void,
- setPadding(edge: Yoga$Edge, padding: number | string): void,
- setPaddingPercent(edge: Yoga$Edge, padding: number): void,
- setPosition(edge: Yoga$Edge, position: number | string): void,
- setPositionPercent(edge: Yoga$Edge, position: number): void,
- setPositionType(positionType: Yoga$PositionType): void,
- setWidth(width: number | string): void,
- setWidthAuto(): void,
- setWidthPercent(width: number): void,
- unsetMeasureFun(): void,
-};
-
-type Yoga = {
- Config: {
- create(): Yoga$Config,
- destroy(config: Yoga$Config): any,
- },
- Node: {
- create(): Yoga$Node,
- createDefault(): Yoga$Node,
- createWithConfig(config: Yoga$Config): Yoga$Node,
- destroy(node: Yoga$Node): any,
- },
- Layout: Layout,
- Size: Size,
- Value: Value,
- getInstanceCount(): number,
- ...typeof CONSTANTS,
-};
-
-module.exports = (bind: any, lib: any): Yoga => {
- function patch(prototype, name, fn) {
- let original = prototype[name];
-
- prototype[name] = function(...args) {
- return fn.call(this, original, ...args);
- };
- }
-
- for (let fnName of [
- 'setPosition',
- 'setMargin',
- 'setFlexBasis',
- 'setWidth',
- 'setHeight',
- 'setMinWidth',
- 'setMinHeight',
- 'setMaxWidth',
- 'setMaxHeight',
- 'setPadding',
- ]) {
- let methods = {
- [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName],
- [CONSTANTS.UNIT_PERCENT]: lib.Node.prototype[`${fnName}Percent`],
- [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`],
- };
-
- patch(lib.Node.prototype, fnName, function(original, ...args) {
- // We patch all these functions to add support for the following calls:
- // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto")
-
- let value = args.pop();
- let unit, asNumber;
-
- if (value === 'auto') {
- unit = CONSTANTS.UNIT_AUTO;
- asNumber = undefined;
- } else if (value instanceof Value) {
- unit = value.unit;
- asNumber = value.valueOf();
- } else {
- unit =
- typeof value === 'string' && value.endsWith('%')
- ? CONSTANTS.UNIT_PERCENT
- : CONSTANTS.UNIT_POINT;
- asNumber = parseFloat(value);
- if (!Number.isNaN(value) && Number.isNaN(asNumber)) {
- throw new Error(`Invalid value ${value} for ${fnName}`);
- }
- }
-
- if (!methods[unit])
- throw new Error(
- `Failed to execute "${fnName}": Unsupported unit '${value}'`,
- );
-
- if (asNumber !== undefined) {
- return methods[unit].call(this, ...args, asNumber);
- } else {
- return methods[unit].call(this, ...args);
- }
- });
- }
-
- patch(lib.Config.prototype, 'free', function() {
- // Since we handle the memory allocation ourselves (via lib.Config.create),
- // we also need to handle the deallocation
- lib.Config.destroy(this);
- });
-
- patch(lib.Node, 'create', function(_, config) {
- // We decide the constructor we want to call depending on the parameters
- return config
- ? lib.Node.createWithConfig(config)
- : lib.Node.createDefault();
- });
-
- patch(lib.Node.prototype, 'free', function() {
- // Since we handle the memory allocation ourselves (via lib.Node.create),
- // we also need to handle the deallocation
- lib.Node.destroy(this);
- });
-
- patch(lib.Node.prototype, 'freeRecursive', function() {
- for (let t = 0, T = this.getChildCount(); t < T; ++t) {
- this.getChild(0).freeRecursive();
- }
- this.free();
- });
-
- patch(lib.Node.prototype, 'setMeasureFunc', function(original, measureFunc) {
- // This patch is just a convenience patch, since it helps write more
- // idiomatic source code (such as .setMeasureFunc(null))
- // We also automatically convert the return value of the measureFunc
- // to a Size object, so that we can return anything that has .width and
- // .height properties
- if (measureFunc) {
- return original.call(this, (...args) =>
- Size.fromJS(measureFunc(...args)),
- );
- } else {
- return this.unsetMeasureFunc();
- }
- });
-
- patch(lib.Node.prototype, 'calculateLayout', function(
- original,
- width = NaN,
- height = NaN,
- direction = CONSTANTS.DIRECTION_LTR,
- ) {
- // Just a small patch to add support for the function default parameters
- return original.call(this, width, height, direction);
- });
-
- return {
- Config: lib.Config,
- Node: lib.Node,
- Layout: bind('Layout', Layout),
- Size: bind('Size', Size),
- Value: bind('Value', Value),
- ...CONSTANTS,
- };
-};
diff --git a/javascript/sources/entry-node.js b/javascript/sources/entry-node.js
deleted file mode 100644
index f70b6c0c..00000000
--- a/javascript/sources/entry-node.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow
- * @format
- */
-
-const Yoga = require('./entry-common');
-const nbind = require('nbind');
-const {bind, lib} = nbind.init(__dirname + '/../');
-module.exports = Yoga(bind, lib);
-export type {
- Yoga$Justify,
- Yoga$Align,
- Yoga$FlexDirection,
- Yoga$Direction,
- Yoga$Wrap,
- Yoga$Gutter,
- Yoga$Edge,
- Yoga$Display,
- Yoga$Unit,
- Yoga$Overflow,
- Yoga$PositionType,
- Yoga$ExperimentalFeature,
-} from './YGEnums.js';
-
-export type {Yoga$Node, Yoga$Config} from './entry-common';
diff --git a/javascript/sources/nbind.cc b/javascript/sources/nbind.cc
deleted file mode 100644
index 385935ba..00000000
--- a/javascript/sources/nbind.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#include
-
-#include "./Node.hh"
-#include "./Layout.hh"
-#include "./Size.hh"
-#include "./Value.hh"
-#include "./Config.hh"
-
-#include
-
-NBIND_CLASS(Size) {
- construct<>();
- construct();
-}
-
-NBIND_CLASS(Layout) {
- construct<>();
-}
-
-NBIND_CLASS(Value) {
- construct<>();
- construct();
-}
-
-NBIND_CLASS(Config) {
- method(create);
-
- method(destroy);
-
- method(setExperimentalFeatureEnabled);
- method(setPointScaleFactor);
-
- method(isExperimentalFeatureEnabled);
-}
-
-NBIND_CLASS(Node) {
- method(createDefault);
- method(createWithConfig);
- method(destroy);
-
- method(reset);
-
- method(copyStyle);
-
- method(setPositionType);
- method(setPosition);
- method(setPositionPercent);
-
- method(setAlignContent);
- method(setAlignItems);
- method(setAlignSelf);
- method(setFlexDirection);
- method(setFlexWrap);
- method(setJustifyContent);
-
- method(setMargin);
- method(setMarginPercent);
- method(setMarginAuto);
-
- method(setOverflow);
- method(setDisplay);
-
- method(setFlex);
- method(setFlexBasis);
- method(setFlexBasisPercent);
- method(setFlexBasisAuto);
- method(setFlexGrow);
- method(setFlexShrink);
-
- method(setWidth);
- method(setWidthPercent);
- method(setWidthAuto);
- method(setHeight);
- method(setHeightPercent);
- method(setHeightAuto);
-
- method(setMinWidth);
- method(setMinWidthPercent);
- method(setMinHeight);
- method(setMinHeightPercent);
-
- method(setMaxWidth);
- method(setMaxWidthPercent);
- method(setMaxHeight);
- method(setMaxHeightPercent);
-
- method(setAspectRatio);
-
- method(setBorder);
-
- method(setPadding);
- method(setPaddingPercent);
-
- method(setGap);
-
- method(getPositionType);
- method(getPosition);
-
- method(getAlignContent);
- method(getAlignItems);
- method(getAlignSelf);
- method(getFlexDirection);
- method(getFlexWrap);
- method(getJustifyContent);
-
- method(getMargin);
-
- method(getFlexBasis);
- method(getFlexGrow);
- method(getFlexShrink);
-
- method(getWidth);
- method(getHeight);
-
- method(getMinWidth);
- method(getMinHeight);
-
- method(getMaxWidth);
- method(getMaxHeight);
-
- method(getAspectRatio);
-
- method(getBorder);
-
- method(getOverflow);
- method(getDisplay);
-
- method(getPadding);
-
- method(getGap);
-
- method(insertChild);
- method(removeChild);
-
- method(getChildCount);
-
- method(getParent);
- method(getChild);
-
- method(isReferenceBaseline);
- method(setIsReferenceBaseline);
-
- method(setMeasureFunc);
- method(unsetMeasureFunc);
-
- method(setDirtiedFunc);
- method(unsetDirtiedFunc);
-
- method(markDirty);
- method(isDirty);
-
- method(calculateLayout);
-
- method(getComputedLeft);
- method(getComputedRight);
-
- method(getComputedTop);
- method(getComputedBottom);
-
- method(getComputedWidth);
- method(getComputedHeight);
-
- method(getComputedLayout);
-
- method(getComputedMargin);
- method(getComputedBorder);
- method(getComputedPadding);
-}
diff --git a/javascript/src_js/entrypoint/_entryAsync.js b/javascript/src_js/entrypoint/_entryAsync.js
new file mode 100644
index 00000000..942296a7
--- /dev/null
+++ b/javascript/src_js/entrypoint/_entryAsync.js
@@ -0,0 +1,15 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const wrapAsm = require("../wrapAsm");
+
+module.exports = (loadAsm) => ({
+ loadYoga: () => loadAsm().then(wrapAsm),
+ ...require("../generated/YGEnums"),
+});
diff --git a/javascript/src_js/entrypoint/_entrySync.js b/javascript/src_js/entrypoint/_entrySync.js
new file mode 100644
index 00000000..42de4bee
--- /dev/null
+++ b/javascript/src_js/entrypoint/_entrySync.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const wrapAsm = require("../wrapAsm");
+module.exports = (asm) => wrapAsm(asm());
diff --git a/javascript/src_js/entrypoint/asmjs-async.js b/javascript/src_js/entrypoint/asmjs-async.js
new file mode 100644
index 00000000..dcab5f92
--- /dev/null
+++ b/javascript/src_js/entrypoint/asmjs-async.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const asm = require("../build/asmjs-async");
+module.exports = require("./_entryAsync")(asm);
diff --git a/javascript/src_js/entrypoint/asmjs-sync.js b/javascript/src_js/entrypoint/asmjs-sync.js
new file mode 100644
index 00000000..ac940b7f
--- /dev/null
+++ b/javascript/src_js/entrypoint/asmjs-sync.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const asm = require("../build/asmjs-sync");
+module.exports = require("./_entrySync")(asm);
diff --git a/javascript/src_js/entrypoint/wasm-async.js b/javascript/src_js/entrypoint/wasm-async.js
new file mode 100644
index 00000000..80dc1f5f
--- /dev/null
+++ b/javascript/src_js/entrypoint/wasm-async.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const asm = require("../build/wasm-async");
+module.exports = require("./_entryAsync")(asm);
diff --git a/javascript/src_js/entrypoint/wasm-sync.js b/javascript/src_js/entrypoint/wasm-sync.js
new file mode 100644
index 00000000..e0404a60
--- /dev/null
+++ b/javascript/src_js/entrypoint/wasm-sync.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const asm = require("../build/wasm-sync");
+module.exports = require("./_entrySync")(asm);
diff --git a/javascript/src_js/generated/YGEnums.d.ts b/javascript/src_js/generated/YGEnums.d.ts
new file mode 100644
index 00000000..26272de5
--- /dev/null
+++ b/javascript/src_js/generated/YGEnums.d.ts
@@ -0,0 +1,320 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by enums.py
+
+type ALIGN_AUTO = 0 & ['ALIGN']
+export const ALIGN_AUTO: ALIGN_AUTO;
+
+type ALIGN_FLEX_START = 1 & ['ALIGN']
+export const ALIGN_FLEX_START: ALIGN_FLEX_START;
+
+type ALIGN_CENTER = 2 & ['ALIGN']
+export const ALIGN_CENTER: ALIGN_CENTER;
+
+type ALIGN_FLEX_END = 3 & ['ALIGN']
+export const ALIGN_FLEX_END: ALIGN_FLEX_END;
+
+type ALIGN_STRETCH = 4 & ['ALIGN']
+export const ALIGN_STRETCH: ALIGN_STRETCH;
+
+type ALIGN_BASELINE = 5 & ['ALIGN']
+export const ALIGN_BASELINE: ALIGN_BASELINE;
+
+type ALIGN_SPACE_BETWEEN = 6 & ['ALIGN']
+export const ALIGN_SPACE_BETWEEN: ALIGN_SPACE_BETWEEN;
+
+type ALIGN_SPACE_AROUND = 7 & ['ALIGN']
+export const ALIGN_SPACE_AROUND: ALIGN_SPACE_AROUND;
+
+
+type DIMENSION_WIDTH = 0 & ['DIMENSION']
+export const DIMENSION_WIDTH: DIMENSION_WIDTH;
+
+type DIMENSION_HEIGHT = 1 & ['DIMENSION']
+export const DIMENSION_HEIGHT: DIMENSION_HEIGHT;
+
+
+type DIRECTION_INHERIT = 0 & ['DIRECTION']
+export const DIRECTION_INHERIT: DIRECTION_INHERIT;
+
+type DIRECTION_LTR = 1 & ['DIRECTION']
+export const DIRECTION_LTR: DIRECTION_LTR;
+
+type DIRECTION_RTL = 2 & ['DIRECTION']
+export const DIRECTION_RTL: DIRECTION_RTL;
+
+
+type DISPLAY_FLEX = 0 & ['DISPLAY']
+export const DISPLAY_FLEX: DISPLAY_FLEX;
+
+type DISPLAY_NONE = 1 & ['DISPLAY']
+export const DISPLAY_NONE: DISPLAY_NONE;
+
+
+type EDGE_LEFT = 0 & ['EDGE']
+export const EDGE_LEFT: EDGE_LEFT;
+
+type EDGE_TOP = 1 & ['EDGE']
+export const EDGE_TOP: EDGE_TOP;
+
+type EDGE_RIGHT = 2 & ['EDGE']
+export const EDGE_RIGHT: EDGE_RIGHT;
+
+type EDGE_BOTTOM = 3 & ['EDGE']
+export const EDGE_BOTTOM: EDGE_BOTTOM;
+
+type EDGE_START = 4 & ['EDGE']
+export const EDGE_START: EDGE_START;
+
+type EDGE_END = 5 & ['EDGE']
+export const EDGE_END: EDGE_END;
+
+type EDGE_HORIZONTAL = 6 & ['EDGE']
+export const EDGE_HORIZONTAL: EDGE_HORIZONTAL;
+
+type EDGE_VERTICAL = 7 & ['EDGE']
+export const EDGE_VERTICAL: EDGE_VERTICAL;
+
+type EDGE_ALL = 8 & ['EDGE']
+export const EDGE_ALL: EDGE_ALL;
+
+
+type EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0 & ['EXPERIMENTAL_FEATURE']
+export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS;
+
+
+type FLEX_DIRECTION_COLUMN = 0 & ['FLEX_DIRECTION']
+export const FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN;
+
+type FLEX_DIRECTION_COLUMN_REVERSE = 1 & ['FLEX_DIRECTION']
+export const FLEX_DIRECTION_COLUMN_REVERSE: FLEX_DIRECTION_COLUMN_REVERSE;
+
+type FLEX_DIRECTION_ROW = 2 & ['FLEX_DIRECTION']
+export const FLEX_DIRECTION_ROW: FLEX_DIRECTION_ROW;
+
+type FLEX_DIRECTION_ROW_REVERSE = 3 & ['FLEX_DIRECTION']
+export const FLEX_DIRECTION_ROW_REVERSE: FLEX_DIRECTION_ROW_REVERSE;
+
+
+type GUTTER_COLUMN = 0 & ['GUTTER']
+export const GUTTER_COLUMN: GUTTER_COLUMN;
+
+type GUTTER_ROW = 1 & ['GUTTER']
+export const GUTTER_ROW: GUTTER_ROW;
+
+type GUTTER_ALL = 2 & ['GUTTER']
+export const GUTTER_ALL: GUTTER_ALL;
+
+
+type JUSTIFY_FLEX_START = 0 & ['JUSTIFY']
+export const JUSTIFY_FLEX_START: JUSTIFY_FLEX_START;
+
+type JUSTIFY_CENTER = 1 & ['JUSTIFY']
+export const JUSTIFY_CENTER: JUSTIFY_CENTER;
+
+type JUSTIFY_FLEX_END = 2 & ['JUSTIFY']
+export const JUSTIFY_FLEX_END: JUSTIFY_FLEX_END;
+
+type JUSTIFY_SPACE_BETWEEN = 3 & ['JUSTIFY']
+export const JUSTIFY_SPACE_BETWEEN: JUSTIFY_SPACE_BETWEEN;
+
+type JUSTIFY_SPACE_AROUND = 4 & ['JUSTIFY']
+export const JUSTIFY_SPACE_AROUND: JUSTIFY_SPACE_AROUND;
+
+type JUSTIFY_SPACE_EVENLY = 5 & ['JUSTIFY']
+export const JUSTIFY_SPACE_EVENLY: JUSTIFY_SPACE_EVENLY;
+
+
+type LOG_LEVEL_ERROR = 0 & ['LOG_LEVEL']
+export const LOG_LEVEL_ERROR: LOG_LEVEL_ERROR;
+
+type LOG_LEVEL_WARN = 1 & ['LOG_LEVEL']
+export const LOG_LEVEL_WARN: LOG_LEVEL_WARN;
+
+type LOG_LEVEL_INFO = 2 & ['LOG_LEVEL']
+export const LOG_LEVEL_INFO: LOG_LEVEL_INFO;
+
+type LOG_LEVEL_DEBUG = 3 & ['LOG_LEVEL']
+export const LOG_LEVEL_DEBUG: LOG_LEVEL_DEBUG;
+
+type LOG_LEVEL_VERBOSE = 4 & ['LOG_LEVEL']
+export const LOG_LEVEL_VERBOSE: LOG_LEVEL_VERBOSE;
+
+type LOG_LEVEL_FATAL = 5 & ['LOG_LEVEL']
+export const LOG_LEVEL_FATAL: LOG_LEVEL_FATAL;
+
+
+type MEASURE_MODE_UNDEFINED = 0 & ['MEASURE_MODE']
+export const MEASURE_MODE_UNDEFINED: MEASURE_MODE_UNDEFINED;
+
+type MEASURE_MODE_EXACTLY = 1 & ['MEASURE_MODE']
+export const MEASURE_MODE_EXACTLY: MEASURE_MODE_EXACTLY;
+
+type MEASURE_MODE_AT_MOST = 2 & ['MEASURE_MODE']
+export const MEASURE_MODE_AT_MOST: MEASURE_MODE_AT_MOST;
+
+
+type NODE_TYPE_DEFAULT = 0 & ['NODE_TYPE']
+export const NODE_TYPE_DEFAULT: NODE_TYPE_DEFAULT;
+
+type NODE_TYPE_TEXT = 1 & ['NODE_TYPE']
+export const NODE_TYPE_TEXT: NODE_TYPE_TEXT;
+
+
+type OVERFLOW_VISIBLE = 0 & ['OVERFLOW']
+export const OVERFLOW_VISIBLE: OVERFLOW_VISIBLE;
+
+type OVERFLOW_HIDDEN = 1 & ['OVERFLOW']
+export const OVERFLOW_HIDDEN: OVERFLOW_HIDDEN;
+
+type OVERFLOW_SCROLL = 2 & ['OVERFLOW']
+export const OVERFLOW_SCROLL: OVERFLOW_SCROLL;
+
+
+type POSITION_TYPE_STATIC = 0 & ['POSITION_TYPE']
+export const POSITION_TYPE_STATIC: POSITION_TYPE_STATIC;
+
+type POSITION_TYPE_RELATIVE = 1 & ['POSITION_TYPE']
+export const POSITION_TYPE_RELATIVE: POSITION_TYPE_RELATIVE;
+
+type POSITION_TYPE_ABSOLUTE = 2 & ['POSITION_TYPE']
+export const POSITION_TYPE_ABSOLUTE: POSITION_TYPE_ABSOLUTE;
+
+
+type PRINT_OPTIONS_LAYOUT = 1 & ['PRINT_OPTIONS']
+export const PRINT_OPTIONS_LAYOUT: PRINT_OPTIONS_LAYOUT;
+
+type PRINT_OPTIONS_STYLE = 2 & ['PRINT_OPTIONS']
+export const PRINT_OPTIONS_STYLE: PRINT_OPTIONS_STYLE;
+
+type PRINT_OPTIONS_CHILDREN = 4 & ['PRINT_OPTIONS']
+export const PRINT_OPTIONS_CHILDREN: PRINT_OPTIONS_CHILDREN;
+
+
+type UNIT_UNDEFINED = 0 & ['UNIT']
+export const UNIT_UNDEFINED: UNIT_UNDEFINED;
+
+type UNIT_POINT = 1 & ['UNIT']
+export const UNIT_POINT: UNIT_POINT;
+
+type UNIT_PERCENT = 2 & ['UNIT']
+export const UNIT_PERCENT: UNIT_PERCENT;
+
+type UNIT_AUTO = 3 & ['UNIT']
+export const UNIT_AUTO: UNIT_AUTO;
+
+
+type WRAP_NO_WRAP = 0 & ['WRAP']
+export const WRAP_NO_WRAP: WRAP_NO_WRAP;
+
+type WRAP_WRAP = 1 & ['WRAP']
+export const WRAP_WRAP: WRAP_WRAP;
+
+type WRAP_WRAP_REVERSE = 2 & ['WRAP']
+export const WRAP_WRAP_REVERSE: WRAP_WRAP_REVERSE;
+
+
+export type Align =
+ | typeof ALIGN_AUTO
+ | typeof ALIGN_FLEX_START
+ | typeof ALIGN_CENTER
+ | typeof ALIGN_FLEX_END
+ | typeof ALIGN_STRETCH
+ | typeof ALIGN_BASELINE
+ | typeof ALIGN_SPACE_BETWEEN
+ | typeof ALIGN_SPACE_AROUND;
+
+export type Dimension =
+ | typeof DIMENSION_WIDTH
+ | typeof DIMENSION_HEIGHT;
+
+export type Direction =
+ | typeof DIRECTION_INHERIT
+ | typeof DIRECTION_LTR
+ | typeof DIRECTION_RTL;
+
+export type Display =
+ | typeof DISPLAY_FLEX
+ | typeof DISPLAY_NONE;
+
+export type Edge =
+ | typeof EDGE_LEFT
+ | typeof EDGE_TOP
+ | typeof EDGE_RIGHT
+ | typeof EDGE_BOTTOM
+ | typeof EDGE_START
+ | typeof EDGE_END
+ | typeof EDGE_HORIZONTAL
+ | typeof EDGE_VERTICAL
+ | typeof EDGE_ALL;
+
+export type ExperimentalFeature =
+ | typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS;
+
+export type FlexDirection =
+ | typeof FLEX_DIRECTION_COLUMN
+ | typeof FLEX_DIRECTION_COLUMN_REVERSE
+ | typeof FLEX_DIRECTION_ROW
+ | typeof FLEX_DIRECTION_ROW_REVERSE;
+
+export type Gutter =
+ | typeof GUTTER_COLUMN
+ | typeof GUTTER_ROW
+ | typeof GUTTER_ALL;
+
+export type Justify =
+ | typeof JUSTIFY_FLEX_START
+ | typeof JUSTIFY_CENTER
+ | typeof JUSTIFY_FLEX_END
+ | typeof JUSTIFY_SPACE_BETWEEN
+ | typeof JUSTIFY_SPACE_AROUND
+ | typeof JUSTIFY_SPACE_EVENLY;
+
+export type LogLevel =
+ | typeof LOG_LEVEL_ERROR
+ | typeof LOG_LEVEL_WARN
+ | typeof LOG_LEVEL_INFO
+ | typeof LOG_LEVEL_DEBUG
+ | typeof LOG_LEVEL_VERBOSE
+ | typeof LOG_LEVEL_FATAL;
+
+export type MeasureMode =
+ | typeof MEASURE_MODE_UNDEFINED
+ | typeof MEASURE_MODE_EXACTLY
+ | typeof MEASURE_MODE_AT_MOST;
+
+export type NodeType =
+ | typeof NODE_TYPE_DEFAULT
+ | typeof NODE_TYPE_TEXT;
+
+export type Overflow =
+ | typeof OVERFLOW_VISIBLE
+ | typeof OVERFLOW_HIDDEN
+ | typeof OVERFLOW_SCROLL;
+
+export type PositionType =
+ | typeof POSITION_TYPE_STATIC
+ | typeof POSITION_TYPE_RELATIVE
+ | typeof POSITION_TYPE_ABSOLUTE;
+
+export type PrintOptions =
+ | typeof PRINT_OPTIONS_LAYOUT
+ | typeof PRINT_OPTIONS_STYLE
+ | typeof PRINT_OPTIONS_CHILDREN;
+
+export type Unit =
+ | typeof UNIT_UNDEFINED
+ | typeof UNIT_POINT
+ | typeof UNIT_PERCENT
+ | typeof UNIT_AUTO;
+
+export type Wrap =
+ | typeof WRAP_NO_WRAP
+ | typeof WRAP_WRAP
+ | typeof WRAP_WRAP_REVERSE;
+
diff --git a/javascript/src_js/generated/YGEnums.js b/javascript/src_js/generated/YGEnums.js
new file mode 100644
index 00000000..b9a4cbde
--- /dev/null
+++ b/javascript/src_js/generated/YGEnums.js
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by enums.py
+
+module.exports = {
+ ALIGN_AUTO: 0,
+ ALIGN_FLEX_START: 1,
+ ALIGN_CENTER: 2,
+ ALIGN_FLEX_END: 3,
+ ALIGN_STRETCH: 4,
+ ALIGN_BASELINE: 5,
+ ALIGN_SPACE_BETWEEN: 6,
+ ALIGN_SPACE_AROUND: 7,
+
+ DIMENSION_WIDTH: 0,
+ DIMENSION_HEIGHT: 1,
+
+ DIRECTION_INHERIT: 0,
+ DIRECTION_LTR: 1,
+ DIRECTION_RTL: 2,
+
+ DISPLAY_FLEX: 0,
+ DISPLAY_NONE: 1,
+
+ EDGE_LEFT: 0,
+ EDGE_TOP: 1,
+ EDGE_RIGHT: 2,
+ EDGE_BOTTOM: 3,
+ EDGE_START: 4,
+ EDGE_END: 5,
+ EDGE_HORIZONTAL: 6,
+ EDGE_VERTICAL: 7,
+ EDGE_ALL: 8,
+
+ EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0,
+
+ FLEX_DIRECTION_COLUMN: 0,
+ FLEX_DIRECTION_COLUMN_REVERSE: 1,
+ FLEX_DIRECTION_ROW: 2,
+ FLEX_DIRECTION_ROW_REVERSE: 3,
+
+ GUTTER_COLUMN: 0,
+ GUTTER_ROW: 1,
+ GUTTER_ALL: 2,
+
+ JUSTIFY_FLEX_START: 0,
+ JUSTIFY_CENTER: 1,
+ JUSTIFY_FLEX_END: 2,
+ JUSTIFY_SPACE_BETWEEN: 3,
+ JUSTIFY_SPACE_AROUND: 4,
+ JUSTIFY_SPACE_EVENLY: 5,
+
+ LOG_LEVEL_ERROR: 0,
+ LOG_LEVEL_WARN: 1,
+ LOG_LEVEL_INFO: 2,
+ LOG_LEVEL_DEBUG: 3,
+ LOG_LEVEL_VERBOSE: 4,
+ LOG_LEVEL_FATAL: 5,
+
+ MEASURE_MODE_UNDEFINED: 0,
+ MEASURE_MODE_EXACTLY: 1,
+ MEASURE_MODE_AT_MOST: 2,
+
+ NODE_TYPE_DEFAULT: 0,
+ NODE_TYPE_TEXT: 1,
+
+ OVERFLOW_VISIBLE: 0,
+ OVERFLOW_HIDDEN: 1,
+ OVERFLOW_SCROLL: 2,
+
+ POSITION_TYPE_STATIC: 0,
+ POSITION_TYPE_RELATIVE: 1,
+ POSITION_TYPE_ABSOLUTE: 2,
+
+ PRINT_OPTIONS_LAYOUT: 1,
+ PRINT_OPTIONS_STYLE: 2,
+ PRINT_OPTIONS_CHILDREN: 4,
+
+ UNIT_UNDEFINED: 0,
+ UNIT_POINT: 1,
+ UNIT_PERCENT: 2,
+ UNIT_AUTO: 3,
+
+ WRAP_NO_WRAP: 0,
+ WRAP_WRAP: 1,
+ WRAP_WRAP_REVERSE: 2,
+};
diff --git a/javascript/src_js/index.d.ts b/javascript/src_js/index.d.ts
new file mode 100644
index 00000000..fb2830e4
--- /dev/null
+++ b/javascript/src_js/index.d.ts
@@ -0,0 +1,15 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+import type {Yoga} from './wrapAsm';
+
+export * from './generated/YGEnums';
+export * from './wrapAsm';
+
+export function loadYoga(): Promise;
diff --git a/javascript/src_js/index.js b/javascript/src_js/index.js
new file mode 100644
index 00000000..bea46e9b
--- /dev/null
+++ b/javascript/src_js/index.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+// Fallback for when the export map is not followed
+module.exports = require("./entrypoint/asmjs-async");
diff --git a/javascript/src_js/sync.d.ts b/javascript/src_js/sync.d.ts
new file mode 100644
index 00000000..27bd8ecc
--- /dev/null
+++ b/javascript/src_js/sync.d.ts
@@ -0,0 +1,16 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+import type {Yoga} from './wrapAsm';
+
+export * from './generated/YGEnums';
+export * from './wrapAsm';
+
+declare const yoga: Yoga;
+export default yoga;
diff --git a/javascript/src_js/sync.js b/javascript/src_js/sync.js
new file mode 100644
index 00000000..70fd4660
--- /dev/null
+++ b/javascript/src_js/sync.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+// Fallback for when the export map is not followed
+module.exports = require("./entrypoint/asmjs-sync");
diff --git a/javascript/src_js/wrapAsm.d.ts b/javascript/src_js/wrapAsm.d.ts
new file mode 100644
index 00000000..cca5026e
--- /dev/null
+++ b/javascript/src_js/wrapAsm.d.ts
@@ -0,0 +1,174 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+import type {
+ Edge,
+ Wrap,
+ Align,
+ FlexDirection,
+ Gutter,
+ Direction,
+ PositionType,
+ Overflow,
+ Justify,
+ Display,
+ ExperimentalFeature,
+} from './generated/YGEnums';
+
+import type * as YGEnums from './generated/YGEnums';
+
+type Layout = {
+ left: number;
+ right: number;
+ top: number;
+ bottom: number;
+ width: number;
+ height: number;
+}
+
+type Size = {
+ width: number;
+ height: number;
+}
+
+type Value = {
+ unit: number;
+ value: number;
+}
+
+export type Config = {
+ free(): void;
+ isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean,
+ setExperimentalFeatureEnabled(
+ feature: ExperimentalFeature,
+ enabled: boolean,
+ ): void,
+ setPointScaleFactor(factor: number): void,
+ useLegacyStretchBehaviour(): boolean,
+ setUseLegacyStretchBehaviour(useLegacyStretchBehaviour: boolean): void,
+ useWebDefaults(): boolean,
+ setUseWebDefaults(useWebDefaults): void,
+};
+
+export type MeasureFunction = (
+ width: number,
+ widthMode: number,
+ height: number,
+ heightMode: number
+) => Size;
+
+export type Node = {
+ calculateLayout(
+ width?: number,
+ height?: number,
+ direction?: Direction,
+ ): void,
+ copyStyle(node: Node): void,
+ free(): void,
+ freeRecursive(): void,
+ getAlignContent(): Align,
+ getAlignItems(): Align,
+ getAlignSelf(): Align,
+ getAspectRatio(): number,
+ getBorder(edge: Edge): number,
+ getChild(index: number): Node,
+ getChildCount(): number,
+ getComputedBorder(edge: Edge): number,
+ getComputedBottom(): number,
+ getComputedHeight(): number,
+ getComputedLayout(): Layout,
+ getComputedLeft(): number,
+ getComputedMargin(edge: Edge): number,
+ getComputedPadding(edge: Edge): number,
+ getComputedRight(): number,
+ getComputedTop(): number,
+ getComputedWidth(): number,
+ getDisplay(): Display,
+ getFlexBasis(): number,
+ getFlexDirection(): FlexDirection,
+ getFlexGrow(): number,
+ getFlexShrink(): number,
+ getFlexWrap(): Wrap,
+ getHeight(): Value,
+ getJustifyContent(): Justify,
+ getGap(gutter: Gutter): Value,
+ getMargin(edge: Edge): Value,
+ getMaxHeight(): Value,
+ getMaxWidth(): Value,
+ getMinHeight(): Value,
+ getMinWidth(): Value,
+ getOverflow(): Overflow,
+ getPadding(edge: Edge): Value,
+ getParent(): Node | null,
+ getPosition(edge: Edge): Value,
+ getPositionType(): PositionType,
+ getWidth(): Value,
+ insertChild(child: Node, index: number): void,
+ isDirty(): boolean,
+ markDirty(): void,
+ removeChild(child: Node): void,
+ reset(): void,
+ setAlignContent(alignContent: Align): void,
+ setAlignItems(alignItems: Align): void,
+ setAlignSelf(alignSelf: Align): void,
+ setAspectRatio(aspectRatio: number): void,
+ setBorder(edge: Edge, borderWidth: number): void,
+ setDisplay(display: Display): void,
+ setFlex(flex: number): void,
+ setFlexBasis(flexBasis: number | string): void,
+ setFlexBasisPercent(flexBasis: number): void,
+ setFlexBasisAuto(): void,
+ setFlexDirection(flexDirection: FlexDirection): void,
+ setFlexGrow(flexGrow: number): void,
+ setFlexShrink(flexShrink: number): void,
+ setFlexWrap(flexWrap: Wrap): void,
+ setHeight(height: number | string): void,
+ setHeightAuto(): void,
+ setHeightPercent(height: number): void,
+ setJustifyContent(justifyContent: Justify): void,
+ setGap(gutter: Gutter, gapLength: number): Value,
+ setMargin(edge: Edge, margin: number): void,
+ setMarginAuto(edge: Edge): void,
+ setMarginPercent(edge: Edge, margin: number): void,
+ setMaxHeight(maxHeight: number | string): void,
+ setMaxHeightPercent(maxHeight: number): void,
+ setMaxWidth(maxWidth: number | string): void,
+ setMaxWidthPercent(maxWidth: number): void,
+ setMeasureFunc(measureFunc: MeasureFunction | null): void,
+ setMinHeight(minHeight: number | string): void,
+ setMinHeightPercent(minHeight: number): void,
+ setMinWidth(minWidth: number | string): void,
+ setMinWidthPercent(minWidth: number): void,
+ setOverflow(overflow: Overflow): void,
+ setPadding(edge: Edge, padding: number | string): void,
+ setPaddingPercent(edge: Edge, padding: number): void,
+ setPosition(edge: Edge, position: number | string): void,
+ setPositionPercent(edge: Edge, position: number): void,
+ setPositionType(positionType: PositionType): void,
+ setWidth(width: number | string): void,
+ setWidthAuto(): void,
+ setWidthPercent(width: number): void,
+ unsetMeasureFun(): void,
+};
+
+export type Yoga = {
+ Config: {
+ create(): Config,
+ destroy(config: Config): any,
+ },
+ Node: {
+ create(): Node,
+ createDefault(): Node,
+ createWithConfig(config: Config): Node,
+ destroy(node: Node): any,
+ },
+} & typeof YGEnums;
+
+declare const wrapAsm: () => Yoga;
+export default wrapAsm;
diff --git a/javascript/src_js/wrapAsm.js b/javascript/src_js/wrapAsm.js
new file mode 100644
index 00000000..3c03269f
--- /dev/null
+++ b/javascript/src_js/wrapAsm.js
@@ -0,0 +1,147 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+const CONSTANTS = require("./generated/YGEnums");
+
+module.exports = (lib) => {
+ function patch(prototype, name, fn) {
+ const original = prototype[name];
+
+ prototype[name] = function (...args) {
+ return fn.call(this, original, ...args);
+ };
+ }
+
+ for (const fnName of [
+ "setPosition",
+ "setMargin",
+ "setFlexBasis",
+ "setWidth",
+ "setHeight",
+ "setMinWidth",
+ "setMinHeight",
+ "setMaxWidth",
+ "setMaxHeight",
+ "setPadding",
+ ]) {
+ const methods = {
+ [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName],
+ [CONSTANTS.UNIT_PERCENT]: lib.Node.prototype[`${fnName}Percent`],
+ [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`],
+ };
+
+ patch(lib.Node.prototype, fnName, function (original, ...args) {
+ // We patch all these functions to add support for the following calls:
+ // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto")
+
+ const value = args.pop();
+ let unit, asNumber;
+
+ if (value === "auto") {
+ unit = CONSTANTS.UNIT_AUTO;
+ asNumber = undefined;
+ } else if (typeof value === "object") {
+ unit = value.unit;
+ asNumber = value.valueOf();
+ } else {
+ unit =
+ typeof value === "string" && value.endsWith("%")
+ ? CONSTANTS.UNIT_PERCENT
+ : CONSTANTS.UNIT_POINT;
+ asNumber = parseFloat(value);
+ if (!Number.isNaN(value) && Number.isNaN(asNumber)) {
+ throw new Error(`Invalid value ${value} for ${fnName}`);
+ }
+ }
+
+ if (!methods[unit])
+ throw new Error(
+ `Failed to execute "${fnName}": Unsupported unit '${value}'`
+ );
+
+ if (asNumber !== undefined) {
+ return methods[unit].call(this, ...args, asNumber);
+ } else {
+ return methods[unit].call(this, ...args);
+ }
+ });
+ }
+
+ function wrapMeasureFunction(measureFunction) {
+ return lib.MeasureCallback.implement({ measure: measureFunction });
+ }
+
+ patch(lib.Node.prototype, "setMeasureFunc", function (original, measureFunc) {
+ original.call(this, wrapMeasureFunction(measureFunc));
+ });
+
+ function wrapDirtiedFunc(dirtiedFunction) {
+ return lib.DirtiedCallback.implement({ dirtied: dirtiedFunction });
+ }
+
+ patch(lib.Node.prototype, "setDirtiedFunc", function (original, dirtiedFunc) {
+ original.call(this, wrapDirtiedFunc(dirtiedFunc));
+ });
+
+ patch(lib.Config.prototype, "free", function () {
+ // Since we handle the memory allocation ourselves (via lib.Config.create),
+ // we also need to handle the deallocation
+ lib.Config.destroy(this);
+ });
+
+ patch(lib.Node, "create", (_, config) => {
+ // We decide the constructor we want to call depending on the parameters
+ return config
+ ? lib.Node.createWithConfig(config)
+ : lib.Node.createDefault();
+ });
+
+ patch(lib.Node.prototype, "free", function () {
+ // Since we handle the memory allocation ourselves (via lib.Node.create),
+ // we also need to handle the deallocation
+ lib.Node.destroy(this);
+ });
+
+ patch(lib.Node.prototype, "freeRecursive", function () {
+ for (let t = 0, T = this.getChildCount(); t < T; ++t) {
+ this.getChild(0).freeRecursive();
+ }
+ this.free();
+ });
+
+ patch(lib.Node.prototype, "setMeasureFunc", function (original, measureFunc) {
+ // This patch is just a convenience patch, since it helps write more
+ // idiomatic source code (such as .setMeasureFunc(null))
+ if (measureFunc) {
+ return original.call(this, (...args) => measureFunc(...args));
+ } else {
+ return this.unsetMeasureFunc();
+ }
+ });
+
+ patch(
+ lib.Node.prototype,
+ "calculateLayout",
+ function (
+ original,
+ width = NaN,
+ height = NaN,
+ direction = CONSTANTS.DIRECTION_LTR
+ ) {
+ // Just a small patch to add support for the function default parameters
+ return original.call(this, width, height, direction);
+ }
+ );
+
+ return {
+ Config: lib.Config,
+ Node: lib.Node,
+ ...CONSTANTS,
+ };
+};
diff --git a/javascript/sources/Config.cc b/javascript/src_native/Config.cc
similarity index 67%
rename from javascript/sources/Config.cc
rename to javascript/src_native/Config.cc
index a23aa20f..3824f519 100644
--- a/javascript/sources/Config.cc
+++ b/javascript/src_native/Config.cc
@@ -32,7 +32,23 @@ void Config::setPointScaleFactor(float pixelsInPoint) {
YGConfigSetPointScaleFactor(m_config, pixelsInPoint);
}
+void Config::setUseLegacyStretchBehaviour(bool useLegacyStretchBehaviour) {
+ YGConfigSetUseLegacyStretchBehaviour(m_config, useLegacyStretchBehaviour);
+}
+
+void Config::setUseWebDefaults(bool useWebDefaults) {
+ YGConfigSetUseWebDefaults(m_config, useWebDefaults);
+}
+
bool Config::isExperimentalFeatureEnabled(int feature) const {
return YGConfigIsExperimentalFeatureEnabled(
m_config, static_cast(feature));
}
+
+bool Config::useLegacyStretchBehaviour() {
+ return YGConfigGetUseLegacyStretchBehaviour(m_config);
+}
+
+bool Config::useWebDefaults() {
+ return YGConfigGetUseWebDefaults(m_config);
+}
diff --git a/javascript/sources/Config.hh b/javascript/src_native/Config.hh
similarity index 81%
rename from javascript/sources/Config.hh
rename to javascript/src_native/Config.hh
index a9eb57bb..ccebfa67 100644
--- a/javascript/sources/Config.hh
+++ b/javascript/src_native/Config.hh
@@ -7,8 +7,6 @@
#pragma once
-#include
-#include
#include
class Config {
@@ -34,9 +32,13 @@ public: // Prevent accidental copy
public: // Setters
void setExperimentalFeatureEnabled(int feature, bool enabled);
void setPointScaleFactor(float pixelsInPoint);
+ void setUseLegacyStretchBehaviour(bool useLegacyStretchBehaviour);
+ void setUseWebDefaults(bool useWebDefaults);
public: // Getters
bool isExperimentalFeatureEnabled(int feature) const;
+ bool useLegacyStretchBehaviour();
+ bool useWebDefaults();
private:
YGConfigRef m_config;
diff --git a/javascript/sources/Layout.hh b/javascript/src_native/Layout.hh
similarity index 67%
rename from javascript/sources/Layout.hh
rename to javascript/src_native/Layout.hh
index 1116ad84..72380afe 100644
--- a/javascript/sources/Layout.hh
+++ b/javascript/src_native/Layout.hh
@@ -7,9 +7,6 @@
#pragma once
-#include
-#include
-
struct Layout {
double left;
double right;
@@ -19,8 +16,4 @@ struct Layout {
double width;
double height;
-
- void toJS(nbind::cbOutput expose) const {
- expose(left, right, top, bottom, width, height);
- }
};
diff --git a/javascript/sources/Node.cc b/javascript/src_native/Node.cc
similarity index 95%
rename from javascript/sources/Node.cc
rename to javascript/src_native/Node.cc
index 9fc631b7..daadf753 100644
--- a/javascript/sources/Node.cc
+++ b/javascript/src_native/Node.cc
@@ -331,9 +331,8 @@ Value Node::getPadding(int edge) const {
YGNodeStyleGetPadding(m_node, static_cast(edge)));
}
-Value Node::getGap(int gutter, ) {
- return Value::fromYGValue(
- YGNodeStyleGetGap(m_node, static_cast(gutter)));
+float Node::getGap(int gutter) {
+ return YGNodeStyleGetGap(m_node, static_cast(gutter));
}
bool Node::isReferenceBaseline() {
@@ -370,8 +369,8 @@ Node* Node::getChild(unsigned index) {
return Node::fromYGNode(nodePtr);
}
-void Node::setMeasureFunc(nbind::cbFunction& measureFunc) {
- m_measureFunc.reset(new nbind::cbFunction(measureFunc));
+void Node::setMeasureFunc(MeasureCallback* measureFunc) {
+ m_measureFunc.reset(measureFunc);
YGNodeSetMeasureFunc(m_node, &globalMeasureFunc);
}
@@ -387,11 +386,11 @@ Size Node::callMeasureFunc(
int widthMode,
double height,
int heightMode) const {
- return m_measureFunc->call(width, widthMode, height, heightMode);
+ return m_measureFunc->measure(width, widthMode, height, heightMode);
}
-void Node::setDirtiedFunc(nbind::cbFunction& dirtiedFunc) {
- m_dirtiedFunc.reset(new nbind::cbFunction(dirtiedFunc));
+void Node::setDirtiedFunc(DirtiedCallback* dirtiedFunc) {
+ m_dirtiedFunc.reset(dirtiedFunc);
YGNodeSetDirtiedFunc(m_node, &globalDirtiedFunc);
}
@@ -403,7 +402,7 @@ void Node::unsetDirtiedFunc(void) {
}
void Node::callDirtiedFunc(void) const {
- m_dirtiedFunc->call();
+ m_dirtiedFunc->dirtied();
}
void Node::markDirty(void) {
diff --git a/javascript/sources/Node.hh b/javascript/src_native/Node.hh
similarity index 82%
rename from javascript/sources/Node.hh
rename to javascript/src_native/Node.hh
index 1a984033..d416f8e0 100644
--- a/javascript/sources/Node.hh
+++ b/javascript/src_native/Node.hh
@@ -9,8 +9,7 @@
#include
-#include
-#include
+#include
#include
#include "./Layout.hh"
@@ -18,6 +17,36 @@
#include "./Value.hh"
#include "./Config.hh"
+class MeasureCallback {
+public:
+ virtual ~MeasureCallback() {}
+ virtual Size measure(
+ float width,
+ int widthMode,
+ float height,
+ int heightMode) = 0;
+};
+
+class MeasureCallbackWrapper : public emscripten::wrapper {
+public:
+ EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper);
+ Size measure(float width, int widthMode, float height, int heightMode) {
+ return call("measure", width, widthMode, height, heightMode);
+ }
+};
+
+class DirtiedCallback {
+public:
+ virtual ~DirtiedCallback() {}
+ virtual void dirtied() = 0;
+};
+
+class DirtiedCallbackWrapper : public emscripten::wrapper {
+public:
+ EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper);
+ void dirtied() { return call("dirtied"); }
+};
+
class Node {
public:
@@ -132,7 +161,7 @@ public: // Style getters
Value getPadding(int edge) const;
- Value getGap(int gutter);
+ float getGap(int gutter);
public: // Tree hierarchy mutators
void insertChild(Node* child, unsigned index);
@@ -148,7 +177,7 @@ public: // Tree hierarchy inspectors
Node* getChild(unsigned index);
public: // Measure func mutators
- void setMeasureFunc(nbind::cbFunction& measureFunc);
+ void setMeasureFunc(MeasureCallback* measureFunc);
void unsetMeasureFunc(void);
public: // Measure func inspectors
@@ -159,7 +188,7 @@ public: // Measure func inspectors
int heightMode) const;
public: // Dirtied func mutators
- void setDirtiedFunc(nbind::cbFunction& dirtiedFunc);
+ void setDirtiedFunc(DirtiedCallback* dirtiedFunc);
void unsetDirtiedFunc(void);
public: // Dirtied func inspectors
@@ -194,6 +223,6 @@ public:
YGNodeRef m_node;
- std::unique_ptr m_measureFunc;
- std::unique_ptr m_dirtiedFunc;
+ std::unique_ptr m_measureFunc;
+ std::unique_ptr m_dirtiedFunc;
};
diff --git a/javascript/sources/Size.hh b/javascript/src_native/Size.hh
similarity index 74%
rename from javascript/sources/Size.hh
rename to javascript/src_native/Size.hh
index 906ec7f1..c42bb90a 100644
--- a/javascript/sources/Size.hh
+++ b/javascript/src_native/Size.hh
@@ -7,9 +7,6 @@
#pragma once
-#include
-#include
-
struct Size {
double width;
double height;
@@ -17,6 +14,4 @@ struct Size {
Size(void) : width(0.0), height(0.0) {}
Size(double width, double height) : width(width), height(height) {}
-
- void toJS(nbind::cbOutput expose) const { expose(width, height); }
};
diff --git a/javascript/sources/Value.hh b/javascript/src_native/Value.hh
similarity index 88%
rename from javascript/sources/Value.hh
rename to javascript/src_native/Value.hh
index b7948e5b..2a37d0e9 100644
--- a/javascript/sources/Value.hh
+++ b/javascript/src_native/Value.hh
@@ -20,6 +20,4 @@ struct Value {
Value(void) : unit(YGUnitUndefined), value(0.0) {}
Value(int unit, double value) : unit(unit), value(value) {}
-
- void toJS(nbind::cbOutput expose) const { expose(unit, value); }
};
diff --git a/javascript/src_native/embind.cc b/javascript/src_native/embind.cc
new file mode 100644
index 00000000..91e6afc3
--- /dev/null
+++ b/javascript/src_native/embind.cc
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+#include "./Node.hh"
+#include "./Layout.hh"
+#include "./Size.hh"
+#include "./Value.hh"
+#include "./Config.hh"
+
+#include
+#include
+
+using namespace emscripten;
+
+EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
+ class_("MeasureCallback")
+ .function("measure", &MeasureCallback::measure, pure_virtual())
+ .allow_subclass("MeasureCallbackWrapper");
+ class_("DirtiedCallback")
+ .function("dirtied", &DirtiedCallback::dirtied, pure_virtual())
+ .allow_subclass("DirtiedCallbackWrapper");
+
+ class_("Config")
+ .constructor<>(&Config::create, allow_raw_pointers())
+ .class_function<>("create", &Config::create, allow_raw_pointers())
+ .class_function<>("destroy", &Config::destroy, allow_raw_pointers())
+ .function(
+ "setExperimentalFeatureEnabled",
+ &Config::setExperimentalFeatureEnabled)
+ .function("setPointScaleFactor", &Config::setPointScaleFactor)
+ .function(
+ "setUseLegacyStretchBehaviour", &Config::setUseLegacyStretchBehaviour)
+ .function("setUseWebDefaults", &Config::setUseWebDefaults)
+ .function(
+ "isExperimentalFeatureEnabled", &Config::isExperimentalFeatureEnabled)
+ .function("useLegacyStretchBehaviour", &Config::useLegacyStretchBehaviour)
+ .function("useWebDefaults", &Config::useWebDefaults);
+
+ value_object("Layout")
+ .field("left", &Layout::left)
+ .field("right", &Layout::right)
+ .field("top", &Layout::top)
+ .field("bottom", &Layout::bottom)
+ .field("width", &Layout::width)
+ .field("height", &Layout::height);
+
+ value_object("Size")
+ .field("width", &Size::width)
+ .field("height", &Size::height);
+
+ value_object("Value")
+ .field("value", &Value::value)
+ .field("unit", &Value::unit);
+
+ class_("Node")
+ .constructor<>(&Node::createDefault, allow_raw_pointers())
+
+ .class_function<>(
+ "createDefault", &Node::createDefault, allow_raw_pointers())
+ .class_function<>(
+ "createWithConfig", &Node::createWithConfig, allow_raw_pointers())
+ .class_function<>("destroy", &Node::destroy, allow_raw_pointers())
+ .function("reset", &Node::reset)
+
+ .function("copyStyle", &Node::copyStyle)
+
+ .function("setPositionType", &Node::setPositionType)
+ .function("setPosition", &Node::setPosition)
+ .function("setPositionPercent", &Node::setPositionPercent)
+
+ .function("setAlignContent", &Node::setAlignContent)
+ .function("setAlignItems", &Node::setAlignItems)
+ .function("setAlignSelf", &Node::setAlignSelf)
+ .function("setFlexDirection", &Node::setFlexDirection)
+ .function("setFlexWrap", &Node::setFlexWrap)
+ .function("setJustifyContent", &Node::setJustifyContent)
+
+ .function("setMargin", &Node::setMargin)
+ .function("setMarginPercent", &Node::setMarginPercent)
+ .function("setMarginAuto", &Node::setMarginAuto)
+
+ .function("setOverflow", &Node::setOverflow)
+ .function("setDisplay", &Node::setDisplay)
+
+ .function("setFlex", &Node::setFlex)
+ .function("setFlexBasis", &Node::setFlexBasis)
+ .function("setFlexBasisPercent", &Node::setFlexBasisPercent)
+ .function("setFlexGrow", &Node::setFlexGrow)
+ .function("setFlexShrink", &Node::setFlexShrink)
+
+ .function("setWidth", &Node::setWidth)
+ .function("setWidthPercent", &Node::setWidthPercent)
+ .function("setWidthAuto", &Node::setWidthAuto)
+ .function("setHeight", &Node::setHeight)
+ .function("setHeightPercent", &Node::setHeightPercent)
+ .function("setHeightAuto", &Node::setHeightAuto)
+
+ .function("setMinWidth", &Node::setMinWidth)
+ .function("setMinWidthPercent", &Node::setMinWidthPercent)
+ .function("setMinHeight", &Node::setMinHeight)
+ .function("setMinHeightPercent", &Node::setMinHeightPercent)
+
+ .function("setMaxWidth", &Node::setMaxWidth)
+ .function("setMaxWidthPercent", &Node::setMaxWidthPercent)
+ .function("setMaxHeight", &Node::setMaxHeight)
+ .function("setMaxHeightPercent", &Node::setMaxHeightPercent)
+
+ .function("setAspectRatio", &Node::setAspectRatio)
+
+ .function("setBorder", &Node::setBorder)
+
+ .function("setPadding", &Node::setPadding)
+ .function("setPaddingPercent", &Node::setPaddingPercent)
+ .function("setGap", &Node::setGap)
+
+ .function("getPositionType", &Node::getPositionType)
+ .function("getPosition", &Node::getPosition)
+
+ .function("getAlignContent", &Node::getAlignContent)
+ .function("getAlignItems", &Node::getAlignItems)
+ .function("getAlignSelf", &Node::getAlignSelf)
+ .function("getFlexDirection", &Node::getFlexDirection)
+ .function("getFlexWrap", &Node::getFlexWrap)
+ .function("getJustifyContent", &Node::getJustifyContent)
+
+ .function("getMargin", &Node::getMargin)
+
+ .function("getFlexBasis", &Node::getFlexBasis)
+ .function("getFlexGrow", &Node::getFlexGrow)
+ .function("getFlexShrink", &Node::getFlexShrink)
+
+ .function("getWidth", &Node::getWidth)
+ .function("getHeight", &Node::getHeight)
+
+ .function("getMinWidth", &Node::getMinWidth)
+ .function("getMinHeight", &Node::getMinHeight)
+
+ .function("getMaxWidth", &Node::getMaxWidth)
+ .function("getMaxHeight", &Node::getMaxHeight)
+
+ .function("getAspectRatio", &Node::getAspectRatio)
+
+ .function("getBorder", &Node::getBorder)
+
+ .function("getOverflow", &Node::getOverflow)
+ .function("getDisplay", &Node::getDisplay)
+
+ .function("getPadding", &Node::getPadding)
+ .function("getGap", &Node::getGap)
+
+ .function("insertChild", &Node::insertChild, allow_raw_pointers())
+ .function("removeChild", &Node::removeChild, allow_raw_pointers())
+
+ .function("getChildCount", &Node::getChildCount)
+
+ .function("getParent", &Node::getParent, allow_raw_pointers())
+ .function("getChild", &Node::getChild, allow_raw_pointers())
+
+ .function("isReferenceBaseline", &Node::isReferenceBaseline)
+ .function("setIsReferenceBaseline", &Node::setIsReferenceBaseline)
+
+ .function("setMeasureFunc", &Node::setMeasureFunc, allow_raw_pointers())
+ .function("unsetMeasureFunc", &Node::unsetMeasureFunc)
+
+ .function("setDirtiedFunc", &Node::setDirtiedFunc, allow_raw_pointers())
+ .function("unsetDirtiedFunc", &Node::unsetDirtiedFunc)
+
+ .function("markDirty", &Node::markDirty)
+ .function("isDirty", &Node::isDirty)
+
+ .function("calculateLayout", &Node::calculateLayout)
+
+ .function("getComputedLeft", &Node::getComputedLeft)
+ .function("getComputedRight", &Node::getComputedRight)
+
+ .function("getComputedTop", &Node::getComputedTop)
+ .function("getComputedBottom", &Node::getComputedBottom)
+
+ .function("getComputedWidth", &Node::getComputedWidth)
+ .function("getComputedHeight", &Node::getComputedHeight)
+
+ .function("getComputedLayout", &Node::getComputedLayout)
+
+ .function("getComputedMargin", &Node::getComputedMargin)
+ .function("getComputedBorder", &Node::getComputedBorder)
+ .function("getComputedPadding", &Node::getComputedPadding);
+}
diff --git a/javascript/tests/Benchmarks/YGBenchmark.js b/javascript/tests/Benchmarks/YGBenchmark.test.js
similarity index 58%
rename from javascript/tests/Benchmarks/YGBenchmark.js
rename to javascript/tests/Benchmarks/YGBenchmark.test.js
index 296cd365..d41bfe6c 100644
--- a/javascript/tests/Benchmarks/YGBenchmark.js
+++ b/javascript/tests/Benchmarks/YGBenchmark.test.js
@@ -5,18 +5,16 @@
* LICENSE file in the root directory of this source tree.
*/
-var Yoga = Yoga || require("../../dist/entry-" + process.env.TEST_ENTRY);
+const ITERATIONS = 2000;
-var ITERATIONS = 2000;
-
-YGBENCHMARK("Stack with flex", function() {
- var root = Yoga.Node.create();
+YGBENCHMARK("Stack with flex", () => {
+ const root = Yoga.Node.create();
root.setWidth(100);
root.setHeight(100);
- var measureCounter = getMeasureCounter(Yoga);
+ const measureCounter = getMeasureCounter(Yoga);
- for (var i = 0; i < ITERATIONS; i++) {
+ for (let i = 0; i < ITERATIONS; i++) {
const child = Yoga.Node.create();
child.setMeasureFunc(measureCounter.inc);
child.setFlex(1);
@@ -27,13 +25,13 @@ YGBENCHMARK("Stack with flex", function() {
root.freeRecursive();
});
-YGBENCHMARK("Align stretch in undefined axis", function() {
- var root = Yoga.Node.create();
+YGBENCHMARK("Align stretch in undefined axis", () => {
+ const root = Yoga.Node.create();
- var measureCounter = getMeasureCounter(Yoga);
+ const measureCounter = getMeasureCounter(Yoga);
- for (var i = 0; i < ITERATIONS; i++) {
- var child = Yoga.Node.create();
+ for (let i = 0; i < ITERATIONS; i++) {
+ const child = Yoga.Node.create();
child.setMeasureFunc(measureCounter.inc);
child.setHeight(20);
root.insertChild(child, 0);
@@ -43,20 +41,20 @@ YGBENCHMARK("Align stretch in undefined axis", function() {
root.freeRecursive();
});
-YGBENCHMARK("Nested flex", function() {
- var root = Yoga.Node.create();
+YGBENCHMARK("Nested flex", () => {
+ const root = Yoga.Node.create();
- var measureCounter = getMeasureCounter(Yoga);
+ const measureCounter = getMeasureCounter(Yoga);
- var iterations = Math.pow(ITERATIONS, 1 / 2);
+ const iterations = Math.pow(ITERATIONS, 1 / 2);
- for (var i = 0; i < iterations; i++) {
- var child = Yoga.Node.create();
+ for (let i = 0; i < iterations; i++) {
+ const child = Yoga.Node.create();
child.setFlex(1);
root.insertChild(child, 0);
- for (var ii = 0; ii < iterations; ii++) {
- var grandChild = Yoga.Node.create();
+ for (let ii = 0; ii < iterations; ii++) {
+ const grandChild = Yoga.Node.create();
grandChild.setMeasureFunc(measureCounter.inc);
grandChild.setFlex(1);
child.insertChild(grandChild, 0);
@@ -67,35 +65,35 @@ YGBENCHMARK("Nested flex", function() {
root.freeRecursive();
});
-YGBENCHMARK("Huge nested layout", function() {
- var root = Yoga.Node.create();
+YGBENCHMARK("Huge nested layout", () => {
+ const root = Yoga.Node.create();
- var iterations = Math.pow(ITERATIONS, 1 / 4);
+ const iterations = Math.pow(ITERATIONS, 1 / 4);
- for (var i = 0; i < iterations; i++) {
- var child = Yoga.Node.create();
+ for (let i = 0; i < iterations; i++) {
+ const child = Yoga.Node.create();
child.setFlexGrow(1);
child.setWidth(10);
child.setHeight(10);
root.insertChild(child, 0);
- for (var ii = 0; ii < iterations; ii++) {
- var grandChild = Yoga.Node.create();
+ for (let ii = 0; ii < iterations; ii++) {
+ const grandChild = Yoga.Node.create();
grandChild.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
grandChild.setFlexGrow(1);
grandChild.setWidth(10);
grandChild.setHeight(10);
child.insertChild(grandChild, 0);
- for (var iii = 0; iii < iterations; iii++) {
- var grandGrandChild = Yoga.Node.create();
+ for (let iii = 0; iii < iterations; iii++) {
+ const grandGrandChild = Yoga.Node.create();
grandGrandChild.setFlexGrow(1);
grandGrandChild.setWidth(10);
grandGrandChild.setHeight(10);
grandChild.insertChild(grandGrandChild, 0);
- for (var iiii = 0; iiii < iterations; iiii++) {
- var grandGrandGrandChild = Yoga.Node.create();
+ for (let iiii = 0; iiii < iterations; iiii++) {
+ const grandGrandGrandChild = Yoga.Node.create();
grandGrandGrandChild.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
grandGrandGrandChild.setFlexGrow(1);
grandGrandGrandChild.setWidth(10);
diff --git a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js
deleted file mode 100644
index 26f9b853..00000000
--- a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js
+++ /dev/null
@@ -1,1094 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("absolute_layout_width_height_start_top", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_START, 10);
- root_child0.setPosition(Yoga.EDGE_TOP, 10);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_width_height_end_bottom", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_END, 10);
- root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_start_top_end_bottom", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_START, 10);
- root_child0.setPosition(Yoga.EDGE_TOP, 10);
- root_child0.setPosition(Yoga.EDGE_END, 10);
- root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_width_height_start_top_end_bottom", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_START, 10);
- root_child0.setPosition(Yoga.EDGE_TOP, 10);
- root_child0.setPosition(Yoga.EDGE_END, 10);
- root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setOverflow(Yoga.OVERFLOW_HIDDEN);
- root.setWidth(50);
- root.setHeight(50);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_START, 0);
- root_child0.setPosition(Yoga.EDGE_TOP, 0);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(100);
- root_child0_child0.setHeight(100);
- root_child0.insertChild(root_child0_child0, 0);
- 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(50 === root.getComputedWidth(), "50 === 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(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-50 === root_child0.getComputedLeft(), "-50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_within_border", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setMargin(Yoga.EDGE_LEFT, 10);
- root.setMargin(Yoga.EDGE_TOP, 10);
- root.setMargin(Yoga.EDGE_RIGHT, 10);
- root.setMargin(Yoga.EDGE_BOTTOM, 10);
- root.setPadding(Yoga.EDGE_LEFT, 10);
- root.setPadding(Yoga.EDGE_TOP, 10);
- root.setPadding(Yoga.EDGE_RIGHT, 10);
- root.setPadding(Yoga.EDGE_BOTTOM, 10);
- root.setBorder(Yoga.EDGE_LEFT, 10);
- root.setBorder(Yoga.EDGE_TOP, 10);
- root.setBorder(Yoga.EDGE_RIGHT, 10);
- root.setBorder(Yoga.EDGE_BOTTOM, 10);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_LEFT, 0);
- root_child0.setPosition(Yoga.EDGE_TOP, 0);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child1.setPosition(Yoga.EDGE_RIGHT, 0);
- root_child1.setPosition(Yoga.EDGE_BOTTOM, 0);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child2.setPosition(Yoga.EDGE_LEFT, 0);
- root_child2.setPosition(Yoga.EDGE_TOP, 0);
- root_child2.setMargin(Yoga.EDGE_LEFT, 10);
- root_child2.setMargin(Yoga.EDGE_TOP, 10);
- root_child2.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child2.setMargin(Yoga.EDGE_BOTTOM, 10);
- root_child2.setWidth(50);
- root_child2.setHeight(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child3.setPosition(Yoga.EDGE_RIGHT, 0);
- root_child3.setPosition(Yoga.EDGE_BOTTOM, 0);
- root_child3.setMargin(Yoga.EDGE_LEFT, 10);
- root_child3.setMargin(Yoga.EDGE_TOP, 10);
- root_child3.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child3.setMargin(Yoga.EDGE_BOTTOM, 10);
- root_child3.setWidth(50);
- root_child3.setHeight(50);
- root.insertChild(root_child3, 3);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(10 === root.getComputedLeft(), "10 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(10 === root.getComputedTop(), "10 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
-
- console.assert(10 === root.getComputedLeft(), "10 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(10 === root.getComputedTop(), "10 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_and_justify_content_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_and_justify_content_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
- root.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(60 === root_child0.getComputedTop(), "60 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(60 === root_child0.getComputedTop(), "60 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_justify_content_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_center_on_child_only", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_CENTER);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_and_justify_content_center_and_top_position", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_TOP, 10);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_and_justify_content_center_and_bottom_position", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_and_justify_content_center_and_left_position", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_LEFT, 5);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_align_items_and_justify_content_center_and_right_position", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexGrow(1);
- root.setWidth(110);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_RIGHT, 5);
- root_child0.setWidth(60);
- root_child0.setHeight(40);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("position_root_with_rtl_should_position_withoutdirection", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setPosition(Yoga.EDGE_LEFT, 72);
- root.setWidth(52);
- root.setHeight(52);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(72 === root.getComputedLeft(), "72 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
-
- console.assert(72 === root.getComputedLeft(), "72 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_percentage_bottom_based_on_parent_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_TOP, "50%");
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child1.setPosition(Yoga.EDGE_BOTTOM, "50%");
- root_child1.setWidth(10);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child2.setPosition(Yoga.EDGE_TOP, "10%");
- root_child2.setPosition(Yoga.EDGE_BOTTOM, "10%");
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === 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(90 === root_child1.getComputedTop(), "90 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(10 === root_child1.getComputedWidth(), "10 === 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(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(160 === root_child2.getComputedHeight(), "160 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(90 === root_child1.getComputedLeft(), "90 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(90 === root_child1.getComputedTop(), "90 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(90 === root_child2.getComputedLeft(), "90 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(160 === root_child2.getComputedHeight(), "160 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("absolute_layout_in_wrap_reverse_column_container", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(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("absolute_layout_in_wrap_reverse_row_container", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === 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("absolute_layout_in_wrap_reverse_column_container_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(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("absolute_layout_in_wrap_reverse_row_container_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(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();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js b/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js
deleted file mode 100644
index 828dbf14..00000000
--- a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("align_baseline_parent_using_child_in_column_as_reference", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(1000);
- root.setHeight(1000);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
- root_child0.setWidth(500);
- root_child0.setHeight(600);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
- root_child1.setWidth(500);
- root_child1.setHeight(800);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
- root_child1_child0.setWidth(500);
- root_child1_child0.setHeight(300);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child1_child1 = Yoga.Node.create(config);
- root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
- root_child1_child1.setWidth(500);
- root_child1_child1.setHeight(400);
- root_child1_child1.setIsReferenceBaseline(true);
- root_child1.insertChild(root_child1_child1, 1);
-
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root_child0.getComputedLeft(),
- "0 === root_child0.getComputedLeft() (" +
- root_child0.getComputedLeft() + ")");
- console.assert(100 === root_child0.getComputedTop(),
- "100 === root_child0.getComputedTop() (" +
- root_child0.getComputedTop() + ")");
-
- console.assert(500 === root_child1.getComputedLeft(),
- "500 === root_child1.getComputedLeft() (" +
- root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(),
- "0 === root_child1.getComputedTop() (" +
- root_child1.getComputedTop() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(),
- "0 === root_child1_child0.getComputedLeft() (" +
- root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(),
- "0 === root_child1_child0.getComputedTop() (" +
- root_child1_child0.getComputedTop() + ")");
-
- console.assert(0 === root_child1_child1.getComputedLeft(),
- "0 === root_child1_child1.getComputedLeft() (" +
- root_child1_child1.getComputedLeft() + ")");
- console.assert(300 === root_child1_child1.getComputedTop(),
- "300 === root_child1_child1.getComputedTop() (" +
- root_child1_child1.getComputedTop() + ")");
-
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-
-it("align_baseline_parent_using_child_in_row_as_reference", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(1000);
- root.setHeight(1000);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
- root_child0.setWidth(500);
- root_child0.setHeight(600);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child1.setWidth(500);
- root_child1.setHeight(800);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
- root_child1_child0.setWidth(500);
- root_child1_child0.setHeight(500);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child1_child1 = Yoga.Node.create(config);
- root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
- root_child1_child1.setWidth(500);
- root_child1_child1.setHeight(400);
- root_child1_child1.setIsReferenceBaseline(true);
- root_child1.insertChild(root_child1_child1, 1);
-
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- 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(500 === root_child1.getComputedLeft(),
- "500 === root_child1.getComputedLeft() (" +
- root_child1.getComputedLeft() + ")");
- console.assert(200 === root_child1.getComputedTop(),
- "200 === root_child1.getComputedTop() (" +
- root_child1.getComputedTop() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(),
- "0 === root_child1_child0.getComputedLeft() (" +
- root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(),
- "0 === root_child1_child0.getComputedTop() (" +
- root_child1_child0.getComputedTop() + ")");
-
- console.assert(500 === root_child1_child1.getComputedLeft(),
- "500 === root_child1_child1.getComputedLeft() (" +
- root_child1_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1.getComputedTop(),
- "0 === root_child1_child1.getComputedTop() (" +
- root_child1_child1.getComputedTop() + ")");
-
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js
deleted file mode 100644
index fb54f199..00000000
--- a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js
+++ /dev/null
@@ -1,1935 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("align_content_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(130);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(10);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(10);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root_child4.setHeight(10);
- root.insertChild(root_child4, 4);
- 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(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === 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(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.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(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(80 === root_child4.getComputedLeft(), "80 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_flex_start_without_height_on_children", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(10);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === 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(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_flex_start_with_flex", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(120);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("0%");
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexBasis("0%");
- root_child1.setWidth(50);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setFlexGrow(1);
- root_child3.setFlexShrink(1);
- root_child3.setFlexBasis("0%");
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(120 === root.getComputedHeight(), "120 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(40 === root_child1.getComputedHeight(), "40 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(120 === root_child4.getComputedTop(), "120 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(120 === root.getComputedHeight(), "120 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(120 === root_child4.getComputedTop(), "120 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignContent(Yoga.ALIGN_FLEX_END);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(10);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(10);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root_child4.setHeight(10);
- root.insertChild(root_child4, 4);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === 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(50 === root_child1.getComputedWidth(), "50 === 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(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_spacebetween", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(130);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(10);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(10);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root_child4.setHeight(10);
- root.insertChild(root_child4, 4);
- 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(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === 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(45 === root_child2.getComputedTop(), "45 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(45 === root_child3.getComputedTop(), "45 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.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(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(45 === root_child2.getComputedTop(), "45 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(45 === root_child3.getComputedTop(), "45 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(80 === root_child4.getComputedLeft(), "80 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_spacearound", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_SPACE_AROUND);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(140);
- root.setHeight(120);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(10);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(10);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root_child4.setHeight(10);
- root.insertChild(root_child4, 4);
- 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(140 === root.getComputedWidth(), "140 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(120 === root.getComputedHeight(), "120 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(15 === root_child1.getComputedTop(), "15 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === 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(55 === root_child2.getComputedTop(), "55 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(55 === root_child3.getComputedTop(), "55 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(95 === root_child4.getComputedTop(), "95 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.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(140 === root.getComputedWidth(), "140 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(120 === root.getComputedHeight(), "120 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(15 === root_child0.getComputedTop(), "15 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(15 === root_child1.getComputedTop(), "15 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(90 === root_child2.getComputedLeft(), "90 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(55 === root_child2.getComputedTop(), "55 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(40 === root_child3.getComputedLeft(), "40 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(55 === root_child3.getComputedTop(), "55 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(90 === root_child4.getComputedLeft(), "90 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(95 === root_child4.getComputedTop(), "95 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_children", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0_child0.setFlexBasis("0%");
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_flex", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setFlexGrow(1);
- root_child3.setFlexShrink(1);
- root_child3.setFlexBasis("0%");
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- 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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === 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(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child1.getComputedLeft(), "100 === 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(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_flex_no_shrink", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setFlexGrow(1);
- root_child3.setFlexBasis("0%");
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- 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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === 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(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child1.getComputedLeft(), "100 === 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(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_margin", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setMargin(Yoga.EDGE_LEFT, 10);
- root_child1.setMargin(Yoga.EDGE_TOP, 10);
- root_child1.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child1.setMargin(Yoga.EDGE_BOTTOM, 10);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setMargin(Yoga.EDGE_LEFT, 10);
- root_child3.setMargin(Yoga.EDGE_TOP, 10);
- root_child3.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child3.setMargin(Yoga.EDGE_BOTTOM, 10);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(60 === root_child1.getComputedLeft(), "60 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(40 === root_child2.getComputedHeight(), "40 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(60 === root_child3.getComputedLeft(), "60 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(40 === root_child2.getComputedHeight(), "40 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(40 === root_child3.getComputedLeft(), "40 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_padding", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setPadding(Yoga.EDGE_LEFT, 10);
- root_child1.setPadding(Yoga.EDGE_TOP, 10);
- root_child1.setPadding(Yoga.EDGE_RIGHT, 10);
- root_child1.setPadding(Yoga.EDGE_BOTTOM, 10);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setPadding(Yoga.EDGE_LEFT, 10);
- root_child3.setPadding(Yoga.EDGE_TOP, 10);
- root_child3.setPadding(Yoga.EDGE_RIGHT, 10);
- root_child3.setPadding(Yoga.EDGE_BOTTOM, 10);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_single_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_fixed_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(60);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(60 === root_child1.getComputedHeight(), "60 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(80 === root_child2.getComputedHeight(), "80 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(60 === root_child1.getComputedHeight(), "60 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(80 === root_child2.getComputedHeight(), "80 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_max_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setMaxHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_row_with_min_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setMinHeight(80);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(90 === root_child1.getComputedHeight(), "90 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(90 === root_child1.getComputedHeight(), "90 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(150);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0_child0.setFlexBasis("0%");
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setHeight(50);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setHeight(50);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setHeight(50);
- root.insertChild(root_child4, 4);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(150 === root.getComputedHeight(), "150 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(100 === root_child3.getComputedTop(), "100 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(150 === root.getComputedHeight(), "150 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(100 === root_child3.getComputedTop(), "100 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_content_stretch_is_not_overriding_align_items", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0.setAlignItems(Yoga.ALIGN_CENTER);
- root_child0.setWidth(100);
- root_child0.setHeight(100);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0.setWidth(10);
- root_child0_child0.setHeight(10);
- root_child0.insertChild(root_child0_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(45 === root_child0_child0.getComputedTop(), "45 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(90 === root_child0_child0.getComputedLeft(), "90 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(45 === root_child0_child0.getComputedTop(), "45 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js
deleted file mode 100644
index 887c4d78..00000000
--- a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js
+++ /dev/null
@@ -1,2242 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("align_items_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child_multiline", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(60);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child1.setFlexWrap(Yoga.WRAP_WRAP);
- root_child1.setWidth(50);
- root_child1.setHeight(25);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(25);
- root_child1_child0.setHeight(20);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child1_child1 = Yoga.Node.create(config);
- root_child1_child1.setWidth(25);
- root_child1_child1.setHeight(10);
- root_child1.insertChild(root_child1_child1, 1);
-
- var root_child1_child2 = Yoga.Node.create(config);
- root_child1_child2.setWidth(25);
- root_child1_child2.setHeight(20);
- root_child1.insertChild(root_child1_child2, 2);
-
- var root_child1_child3 = Yoga.Node.create(config);
- root_child1_child3.setWidth(25);
- root_child1_child3.setHeight(10);
- root_child1.insertChild(root_child1_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child1.getComputedLeft(), "25 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child3.getComputedLeft(), "25 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")");
- console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")");
- console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")");
- console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child0.getComputedLeft(), "25 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child2.getComputedLeft(), "25 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child3.getComputedLeft(), "0 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")");
- console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")");
- console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")");
- console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child_multiline_override", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(60);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child1.setFlexWrap(Yoga.WRAP_WRAP);
- root_child1.setWidth(50);
- root_child1.setHeight(25);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(25);
- root_child1_child0.setHeight(20);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child1_child1 = Yoga.Node.create(config);
- root_child1_child1.setAlignSelf(Yoga.ALIGN_BASELINE);
- root_child1_child1.setWidth(25);
- root_child1_child1.setHeight(10);
- root_child1.insertChild(root_child1_child1, 1);
-
- var root_child1_child2 = Yoga.Node.create(config);
- root_child1_child2.setWidth(25);
- root_child1_child2.setHeight(20);
- root_child1.insertChild(root_child1_child2, 2);
-
- var root_child1_child3 = Yoga.Node.create(config);
- root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE);
- root_child1_child3.setWidth(25);
- root_child1_child3.setHeight(10);
- root_child1.insertChild(root_child1_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child1.getComputedLeft(), "25 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child3.getComputedLeft(), "25 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")");
- console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")");
- console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")");
- console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child0.getComputedLeft(), "25 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child2.getComputedLeft(), "25 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child3.getComputedLeft(), "0 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")");
- console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")");
- console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")");
- console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child_multiline_no_override_on_secondline", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(60);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child1.setFlexWrap(Yoga.WRAP_WRAP);
- root_child1.setWidth(50);
- root_child1.setHeight(25);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(25);
- root_child1_child0.setHeight(20);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child1_child1 = Yoga.Node.create(config);
- root_child1_child1.setWidth(25);
- root_child1_child1.setHeight(10);
- root_child1.insertChild(root_child1_child1, 1);
-
- var root_child1_child2 = Yoga.Node.create(config);
- root_child1_child2.setWidth(25);
- root_child1_child2.setHeight(20);
- root_child1.insertChild(root_child1_child2, 2);
-
- var root_child1_child3 = Yoga.Node.create(config);
- root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE);
- root_child1_child3.setWidth(25);
- root_child1_child3.setHeight(10);
- root_child1.insertChild(root_child1_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child1.getComputedLeft(), "25 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child3.getComputedLeft(), "25 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")");
- console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")");
- console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")");
- console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child0.getComputedLeft(), "25 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(25 === root_child1_child2.getComputedLeft(), "25 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child3.getComputedLeft(), "0 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")");
- console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")");
- console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")");
- console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child_top", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPosition(Yoga.EDGE_TOP, 10);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child_top2", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setPosition(Yoga.EDGE_TOP, 5);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(45 === root_child1.getComputedTop(), "45 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(45 === root_child1.getComputedTop(), "45 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_double_nested_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(50);
- root_child0_child0.setHeight(20);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(15);
- root_child1.insertChild(root_child1_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(15 === root_child1_child0.getComputedHeight(), "15 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(15 === root_child1_child0.getComputedHeight(), "15 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child_margin", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, 5);
- root_child0.setMargin(Yoga.EDGE_TOP, 5);
- root_child0.setMargin(Yoga.EDGE_RIGHT, 5);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 5);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setMargin(Yoga.EDGE_LEFT, 1);
- root_child1_child0.setMargin(Yoga.EDGE_TOP, 1);
- root_child1_child0.setMargin(Yoga.EDGE_RIGHT, 1);
- root_child1_child0.setMargin(Yoga.EDGE_BOTTOM, 1);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(60 === root_child1.getComputedLeft(), "60 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(44 === root_child1.getComputedTop(), "44 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(1 === root_child1_child0.getComputedLeft(), "1 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(1 === root_child1_child0.getComputedTop(), "1 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(-10 === root_child1.getComputedLeft(), "-10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(44 === root_child1.getComputedTop(), "44 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(-1 === root_child1_child0.getComputedLeft(), "-1 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(1 === root_child1_child0.getComputedTop(), "1 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_child_padding", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setPadding(Yoga.EDGE_LEFT, 5);
- root.setPadding(Yoga.EDGE_TOP, 5);
- root.setPadding(Yoga.EDGE_RIGHT, 5);
- root.setPadding(Yoga.EDGE_BOTTOM, 5);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setPadding(Yoga.EDGE_LEFT, 5);
- root_child1.setPadding(Yoga.EDGE_TOP, 5);
- root_child1.setPadding(Yoga.EDGE_RIGHT, 5);
- root_child1.setPadding(Yoga.EDGE_BOTTOM, 5);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(55 === root_child1.getComputedLeft(), "55 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(5 === root_child1_child0.getComputedLeft(), "5 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(5 === root_child1_child0.getComputedTop(), "5 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(-5 === root_child1.getComputedLeft(), "-5 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(-5 === root_child1_child0.getComputedLeft(), "-5 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(5 === root_child1_child0.getComputedTop(), "5 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_multiline", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child2_child0 = Yoga.Node.create(config);
- root_child2_child0.setWidth(50);
- root_child2_child0.setHeight(10);
- root_child2.insertChild(root_child2_child0, 0);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(50);
- root.insertChild(root_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_multiline_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(20);
- root_child1_child0.setHeight(20);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(40);
- root_child2.setHeight(70);
- root.insertChild(root_child2, 2);
-
- var root_child2_child0 = Yoga.Node.create(config);
- root_child2_child0.setWidth(10);
- root_child2_child0.setHeight(10);
- root_child2.insertChild(root_child2_child0, 0);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(70 === root_child1.getComputedLeft(), "70 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child1_child0.getComputedLeft(), "10 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(30 === root_child2_child0.getComputedLeft(), "30 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_multiline_column2", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(20);
- root_child1_child0.setHeight(20);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(40);
- root_child2.setHeight(70);
- root.insertChild(root_child2, 2);
-
- var root_child2_child0 = Yoga.Node.create(config);
- root_child2_child0.setWidth(10);
- root_child2_child0.setHeight(10);
- root_child2.insertChild(root_child2_child0, 0);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(70 === root_child1.getComputedLeft(), "70 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child1_child0.getComputedLeft(), "10 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(30 === root_child2_child0.getComputedLeft(), "30 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_baseline_multiline_row_and_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_BASELINE);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child2_child0 = Yoga.Node.create(config);
- root_child2_child0.setWidth(50);
- root_child2_child0.setHeight(10);
- root_child2.insertChild(root_child2_child0, 0);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(50);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")");
- console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")");
- console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")");
- console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_center_child_with_margin_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignItems(Yoga.ALIGN_CENTER);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10);
- root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child0_child0.setWidth(52);
- root_child0_child0.setHeight(52);
- root_child0.insertChild(root_child0_child0, 0);
- 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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_flex_end_child_with_margin_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10);
- root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child0_child0.setWidth(52);
- root_child0_child0.setHeight(52);
- root_child0.insertChild(root_child0_child0, 0);
- 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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_center_child_without_margin_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignItems(Yoga.ALIGN_CENTER);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(72);
- root_child0_child0.setHeight(72);
- root_child0.insertChild(root_child0_child0, 0);
- 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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_flex_end_child_without_margin_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(72);
- root_child0_child0.setHeight(72);
- root_child0.insertChild(root_child0_child0, 0);
- 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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_center_should_size_based_on_content", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setMargin(Yoga.EDGE_TOP, 20);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root_child0.setFlexShrink(1);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setWidth(20);
- root_child0_child0_child0.setHeight(20);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(40 === root_child0.getComputedLeft(), "40 === 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() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(20 === root_child0_child0.getComputedWidth(), "20 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(40 === root_child0.getComputedLeft(), "40 === 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() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(20 === root_child0_child0.getComputedWidth(), "20 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_stretch_should_size_based_on_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setMargin(Yoga.EDGE_TOP, 20);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root_child0.setFlexShrink(1);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setWidth(20);
- root_child0_child0_child0.setHeight(20);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(80 === root_child0_child0_child0.getComputedLeft(), "80 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_flex_start_with_shrinking_children", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setFlexGrow(1);
- root_child0_child0_child0.setFlexShrink(1);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
- 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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(500 === root_child0_child0.getComputedLeft(), "500 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_flex_start_with_stretching_children", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setFlexGrow(1);
- root_child0_child0_child0.setFlexShrink(1);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
- 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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(500 === root_child0_child0_child0.getComputedWidth(), "500 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(500 === root_child0_child0_child0.getComputedWidth(), "500 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_flex_start_with_shrinking_children_with_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setFlexGrow(1);
- root_child0_child0_child0.setFlexShrink(1);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
- 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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(500 === root_child0_child0.getComputedLeft(), "500 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js
deleted file mode 100644
index e1e41950..00000000
--- a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("align_self_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_CENTER);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_self_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_self_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_FLEX_START);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_self_flex_end_override_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_self_baseline", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setAlignSelf(Yoga.ALIGN_BASELINE);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setAlignSelf(Yoga.ALIGN_BASELINE);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth(50);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js b/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js
deleted file mode 100644
index a5adc1e0..00000000
--- a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js
+++ /dev/null
@@ -1,294 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("android_news_feed", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setWidth(1080);
-
- var root_child0 = Yoga.Node.create(config);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
-
- var root_child0_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
- root_child0_child0_child0_child0.setMargin(Yoga.EDGE_START, 36);
- root_child0_child0_child0_child0.setMargin(Yoga.EDGE_TOP, 24);
- root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0);
-
- var root_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0);
-
- var root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0_child0_child0_child0.setWidth(120);
- root_child0_child0_child0_child0_child0_child0.setHeight(120);
- root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0);
-
- var root_child0_child0_child0_child0_child1 = Yoga.Node.create(config);
- root_child0_child0_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0_child0_child1.setFlexShrink(1);
- root_child0_child0_child0_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
- root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_LEFT, 36);
- root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_TOP, 21);
- root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36);
- root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
- root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child1, 1);
-
- var root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config);
- root_child0_child0_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0_child0_child1_child0.setFlexShrink(1);
- root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0);
-
- var root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config);
- root_child0_child0_child0_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0_child0_child1_child1.setFlexShrink(1);
- root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1);
-
- var root_child0_child0_child1 = Yoga.Node.create(config);
- root_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0.insertChild(root_child0_child0_child1, 1);
-
- var root_child0_child0_child1_child0 = Yoga.Node.create(config);
- root_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child1_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
- root_child0_child0_child1_child0.setMargin(Yoga.EDGE_START, 174);
- root_child0_child0_child1_child0.setMargin(Yoga.EDGE_TOP, 24);
- root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0);
-
- var root_child0_child0_child1_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child1_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child1_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0);
-
- var root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child1_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child1_child0_child0_child0.setWidth(72);
- root_child0_child0_child1_child0_child0_child0.setHeight(72);
- root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0);
-
- var root_child0_child0_child1_child0_child1 = Yoga.Node.create(config);
- root_child0_child0_child1_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child1_child0_child1.setFlexShrink(1);
- root_child0_child0_child1_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
- root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_LEFT, 36);
- root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_TOP, 21);
- root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36);
- root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
- root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child1, 1);
-
- var root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config);
- root_child0_child0_child1_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child1_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child1_child0_child1_child0.setFlexShrink(1);
- root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0);
-
- var root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config);
- root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child1_child0_child1_child1.setFlexShrink(1);
- root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1);
- 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(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(240 === root.getComputedHeight(), "240 === 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(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child0_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")");
- console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")");
- console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(120 === root_child0_child0_child0_child0_child1.getComputedLeft(), "120 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")");
- console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")");
- console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")");
- console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")");
- console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")");
-
- console.assert(174 === root_child0_child0_child1_child0.getComputedLeft(), "174 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")");
- console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")");
- console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child1_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(72 === root_child0_child0_child1_child0_child1.getComputedLeft(), "72 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")");
- console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.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(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(240 === root.getComputedHeight(), "240 === 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(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")");
- console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")");
- console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(924 === root_child0_child0_child0_child0_child0.getComputedLeft(), "924 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(816 === root_child0_child0_child0_child0_child1.getComputedLeft(), "816 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")");
- console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")");
- console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")");
- console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")");
- console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child1_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")");
- console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")");
- console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")");
-
- console.assert(834 === root_child0_child0_child1_child0_child0.getComputedLeft(), "834 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(726 === root_child0_child0_child1_child0_child1.getComputedLeft(), "726 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")");
- console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")");
- console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")");
-
- console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")");
- console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGBorderTest.js b/javascript/tests/Facebook.Yoga/YGBorderTest.js
deleted file mode 100644
index 7b2861c0..00000000
--- a/javascript/tests/Facebook.Yoga/YGBorderTest.js
+++ /dev/null
@@ -1,227 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("border_no_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setBorder(Yoga.EDGE_LEFT, 10);
- root.setBorder(Yoga.EDGE_TOP, 10);
- root.setBorder(Yoga.EDGE_RIGHT, 10);
- root.setBorder(Yoga.EDGE_BOTTOM, 10);
- 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(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.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(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("border_container_match_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setBorder(Yoga.EDGE_LEFT, 10);
- root.setBorder(Yoga.EDGE_TOP, 10);
- root.setBorder(Yoga.EDGE_RIGHT, 10);
- root.setBorder(Yoga.EDGE_BOTTOM, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("border_flex_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setBorder(Yoga.EDGE_LEFT, 10);
- root.setBorder(Yoga.EDGE_TOP, 10);
- root.setBorder(Yoga.EDGE_RIGHT, 10);
- root.setBorder(Yoga.EDGE_BOTTOM, 10);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setWidth(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("border_stretch_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setBorder(Yoga.EDGE_LEFT, 10);
- root.setBorder(Yoga.EDGE_TOP, 10);
- root.setBorder(Yoga.EDGE_RIGHT, 10);
- root.setBorder(Yoga.EDGE_BOTTOM, 10);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("border_center_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setBorder(Yoga.EDGE_START, 10);
- root.setBorder(Yoga.EDGE_END, 20);
- root.setBorder(Yoga.EDGE_BOTTOM, 20);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js
deleted file mode 100644
index a80fad7f..00000000
--- a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("border_start", function () {
- var root = Yoga.Node.create();
- root.setWidth(100);
- root.setHeight(100);
- root.setBorder(Yoga.EDGE_START, 10);
-
- root.calculateLayout(100, 100, Yoga.DIRECTION_LTR);
-
- console.assert(10 === root.getComputedBorder(Yoga.EDGE_LEFT), "10 === root.getComputedBorder(Yoga.EDGE_LEFT)");
- console.assert(0 === root.getComputedBorder(Yoga.EDGE_RIGHT), "0 === root.getComputedBorder(Yoga.EDGE_RIGHT)");
-
- root.calculateLayout(100, 100, Yoga.DIRECTION_RTL);
-
- console.assert(0 === root.getComputedBorder(Yoga.EDGE_LEFT), "0 === root.getComputedBorder(Yoga.EDGE_LEFT)");
- console.assert(10 === root.getComputedBorder(Yoga.EDGE_RIGHT), "10 === root.getComputedBorder(Yoga.EDGE_RIGHT)");
-
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- (typeof gc !== "undefined") && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
-});
diff --git a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js
deleted file mode 100644
index 8ded6d5d..00000000
--- a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("margin_start", function () {
- var root = Yoga.Node.create();
- root.setWidth(100);
- root.setHeight(100);
- root.setMargin(Yoga.EDGE_START, `10%`);
-
- root.calculateLayout(100, 100, Yoga.DIRECTION_LTR);
-
- console.assert(10 === root.getComputedMargin(Yoga.EDGE_LEFT), "10 === root.getComputedMargin(Yoga.EDGE_LEFT)");
- console.assert(0 === root.getComputedMargin(Yoga.EDGE_RIGHT), "0 === root.getComputedMargin(Yoga.EDGE_RIGHT)");
-
- root.calculateLayout(100, 100, Yoga.DIRECTION_RTL);
-
- console.assert(0 === root.getComputedMargin(Yoga.EDGE_LEFT), "0 === root.getComputedMargin(Yoga.EDGE_LEFT)");
- console.assert(10 === root.getComputedMargin(Yoga.EDGE_RIGHT), "10 === root.getComputedMargin(Yoga.EDGE_RIGHT)");
-
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- (typeof gc !== "undefined") && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
-});
diff --git a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js
deleted file mode 100644
index d5571b1d..00000000
--- a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("padding_start", function () {
- var root = Yoga.Node.create();
- root.setWidth(100);
- root.setHeight(100);
- root.setPadding(Yoga.EDGE_START, `10%`);
-
- root.calculateLayout(100, 100, Yoga.DIRECTION_LTR);
-
- console.assert(10 === root.getComputedPadding(Yoga.EDGE_LEFT), "10 === root.getComputedPadding(Yoga.EDGE_LEFT)");
- console.assert(0 === root.getComputedPadding(Yoga.EDGE_RIGHT), "0 === root.getComputedPadding(Yoga.EDGE_RIGHT)");
-
- root.calculateLayout(100, 100, Yoga.DIRECTION_RTL);
-
- console.assert(0 === root.getComputedPadding(Yoga.EDGE_LEFT), "0 === root.getComputedPadding(Yoga.EDGE_LEFT)");
- console.assert(10 === root.getComputedPadding(Yoga.EDGE_RIGHT), "10 === root.getComputedPadding(Yoga.EDGE_RIGHT)");
-
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- (typeof gc !== "undefined") && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
-});
diff --git a/javascript/tests/Facebook.Yoga/YGDimensionTest.js b/javascript/tests/Facebook.Yoga/YGDimensionTest.js
deleted file mode 100644
index c6018771..00000000
--- a/javascript/tests/Facebook.Yoga/YGDimensionTest.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("wrap_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(100);
- root_child0.setHeight(100);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_grandchild", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
-
- var root_child0 = Yoga.Node.create(config);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(100);
- root_child0_child0.setHeight(100);
- root_child0.insertChild(root_child0_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGDisplayTest.js b/javascript/tests/Facebook.Yoga/YGDisplayTest.js
deleted file mode 100644
index d874a4ba..00000000
--- a/javascript/tests/Facebook.Yoga/YGDisplayTest.js
+++ /dev/null
@@ -1,390 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("display_none", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setDisplay(Yoga.DISPLAY_NONE);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("display_none_fixed_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root_child1.setHeight(20);
- root_child1.setDisplay(Yoga.DISPLAY_NONE);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("display_none_with_margin", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, 10);
- root_child0.setMargin(Yoga.EDGE_TOP, 10);
- root_child0.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
- root_child0.setWidth(20);
- root_child0.setHeight(20);
- root_child0.setDisplay(Yoga.DISPLAY_NONE);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("display_none_with_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis("0%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root_child1.setDisplay(Yoga.DISPLAY_NONE);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setFlexGrow(1);
- root_child1_child0.setFlexShrink(1);
- root_child1_child0.setFlexBasis("0%");
- root_child1_child0.setWidth(20);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- root_child2.setFlexShrink(1);
- root_child2.setFlexBasis("0%");
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(0 === root_child1_child0.getComputedWidth(), "0 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(0 === root_child1_child0.getComputedWidth(), "0 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("display_none_with_position", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setPosition(Yoga.EDGE_TOP, 10);
- root_child1.setDisplay(Yoga.DISPLAY_NONE);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === 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(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("display_none_with_position_absolute", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setWidth(100);
- root_child0.setHeight(100);
- root_child0.setDisplay(Yoga.DISPLAY_NONE);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js
deleted file mode 100644
index e82ee4b6..00000000
--- a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js
+++ /dev/null
@@ -1,433 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("flex_direction_column_no_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
-
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(30 === root.getComputedHeight(), "30 === 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(100 === root_child0.getComputedWidth(), "100 === 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(100 === root_child1.getComputedWidth(), "100 === 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(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(30 === root.getComputedHeight(), "30 === 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(100 === root_child0.getComputedWidth(), "100 === 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(100 === root_child1.getComputedWidth(), "100 === 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(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === 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("flex_direction_row_no_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedHeight(), "100 === 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(100 === root_child1.getComputedHeight(), "100 === 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(100 === root_child2.getComputedHeight(), "100 === 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(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedHeight(), "100 === 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(100 === root_child1.getComputedHeight(), "100 === 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(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_direction_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === 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(100 === root_child1.getComputedWidth(), "100 === 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(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === 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(100 === root_child1.getComputedWidth(), "100 === 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(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === 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("flex_direction_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedHeight(), "100 === 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(100 === root_child1.getComputedHeight(), "100 === 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(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(80 === root_child1.getComputedLeft(), "80 === 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(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(70 === root_child2.getComputedLeft(), "70 === 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(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_direction_column_reverse", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE);
- root.setWidth(100);
- root.setHeight(100);
-
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(90 === root_child0.getComputedTop(), "90 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === 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(80 === root_child1.getComputedTop(), "80 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === 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(70 === root_child2.getComputedTop(), "70 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(90 === root_child0.getComputedTop(), "90 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === 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(80 === root_child1.getComputedTop(), "80 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === 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(70 === root_child2.getComputedTop(), "70 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === 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("flex_direction_row_reverse", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(80 === root_child1.getComputedLeft(), "80 === 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(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(70 === root_child2.getComputedLeft(), "70 === 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(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedHeight(), "100 === 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(100 === root_child1.getComputedHeight(), "100 === 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(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGFlexTest.js b/javascript/tests/Facebook.Yoga/YGFlexTest.js
deleted file mode 100644
index 817d604a..00000000
--- a/javascript/tests/Facebook.Yoga/YGFlexTest.js
+++ /dev/null
@@ -1,638 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("flex_basis_flex_grow_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_shrink_flex_grow_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexShrink(1);
- root_child0.setWidth(500);
- root_child0.setHeight(100);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexShrink(1);
- root_child1.setWidth(500);
- root_child1.setHeight(100);
- root.insertChild(root_child1, 1);
- 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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_shrink_flex_grow_child_flex_shrink_other_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexShrink(1);
- root_child0.setWidth(500);
- root_child0.setHeight(100);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setWidth(500);
- root_child1.setHeight(100);
- root.insertChild(root_child1, 1);
- 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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_basis_flex_grow_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(75 === root_child0.getComputedWidth(), "75 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(75 === root_child0.getComputedWidth(), "75 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_basis_flex_shrink_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis(100);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexBasis(50);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_basis_flex_shrink_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis(100);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexBasis(50);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_shrink_to_zero", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setHeight(75);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexShrink(1);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(50);
- 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(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(75 === root.getComputedHeight(), "75 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === 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(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(75 === root.getComputedHeight(), "75 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_basis_overrides_main_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === 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(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === 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(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_shrink_at_most", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexShrink(1);
- root_child0.insertChild(root_child0_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_less_than_factor_one", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(0.2);
- root_child0.setFlexBasis(40);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(0.2);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(0.4);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(132 === root_child0.getComputedHeight(), "132 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(132 === root_child1.getComputedTop(), "132 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(92 === root_child1.getComputedHeight(), "92 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(224 === root_child2.getComputedTop(), "224 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(200 === root_child2.getComputedWidth(), "200 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(184 === root_child2.getComputedHeight(), "184 === 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(132 === root_child0.getComputedHeight(), "132 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(132 === root_child1.getComputedTop(), "132 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(92 === root_child1.getComputedHeight(), "92 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(224 === root_child2.getComputedTop(), "224 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(200 === root_child2.getComputedWidth(), "200 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(184 === root_child2.getComputedHeight(), "184 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js
deleted file mode 100644
index 572ea959..00000000
--- a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js
+++ /dev/null
@@ -1,1795 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("wrap_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(30);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(30);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(30);
- root.insertChild(root_child3, 3);
- 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(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(60 === root_child2.getComputedTop(), "60 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.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(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(30 === root_child2.getComputedLeft(), "30 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(60 === root_child2.getComputedTop(), "60 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(30);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(30);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(30);
- root.insertChild(root_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(60 === root.getComputedHeight(), "60 === 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(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_row_align_items_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(30);
- root.insertChild(root_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_row_align_items_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(30);
- root.insertChild(root_child3, 3);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_wrap_children_with_min_main_overriding_flex_basis", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexBasis(50);
- root_child0.setMinWidth(55);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexBasis(50);
- root_child1.setMinWidth(55);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(55 === root_child0.getComputedWidth(), "55 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(55 === root_child1.getComputedWidth(), "55 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(55 === root_child0.getComputedWidth(), "55 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(45 === root_child1.getComputedLeft(), "45 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(55 === root_child1.getComputedWidth(), "55 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_wrap_wrap_to_child_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
- root_child0.setFlexWrap(Yoga.WRAP_WRAP);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(100);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setWidth(100);
- root_child0_child0_child0.setHeight(100);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(100);
- root_child1.setHeight(100);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedWidth(), "100 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedWidth(), "100 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_wrap_align_stretch_fits_one_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(150);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.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(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_reverse_row_align_content_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(40);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(30);
- root_child4.setHeight(50);
- root.insertChild(root_child4, 4);
- 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(100 === root.getComputedWidth(), "100 === 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(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_reverse_row_align_content_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_CENTER);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(40);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(30);
- root_child4.setHeight(50);
- root.insertChild(root_child4, 4);
- 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(100 === root.getComputedWidth(), "100 === 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(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_reverse_row_single_line_different_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(300);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(40);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(30);
- root_child4.setHeight(50);
- root.insertChild(root_child4, 4);
- 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(300 === root.getComputedWidth(), "300 === 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(40 === root_child0.getComputedTop(), "40 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(90 === root_child3.getComputedLeft(), "90 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(120 === root_child4.getComputedLeft(), "120 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(300 === root.getComputedWidth(), "300 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(270 === root_child0.getComputedLeft(), "270 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(40 === root_child0.getComputedTop(), "40 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(240 === root_child1.getComputedLeft(), "240 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(210 === root_child2.getComputedLeft(), "210 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(180 === root_child3.getComputedLeft(), "180 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(150 === root_child4.getComputedLeft(), "150 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_reverse_row_align_content_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(40);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(30);
- root_child4.setHeight(50);
- root.insertChild(root_child4, 4);
- 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(100 === root.getComputedWidth(), "100 === 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(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_reverse_row_align_content_space_around", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_SPACE_AROUND);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(40);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(30);
- root_child4.setHeight(50);
- root.insertChild(root_child4, 4);
- 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(100 === root.getComputedWidth(), "100 === 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(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_reverse_column_fixed_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
- root.setWidth(200);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(30);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(30);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(30);
- root_child2.setHeight(30);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(30);
- root_child3.setHeight(40);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(30);
- root_child4.setHeight(50);
- root.insertChild(root_child4, 4);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(170 === root_child0.getComputedLeft(), "170 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(170 === root_child1.getComputedLeft(), "170 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(170 === root_child2.getComputedLeft(), "170 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(30 === root_child2.getComputedTop(), "30 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(170 === root_child3.getComputedLeft(), "170 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(140 === root_child4.getComputedLeft(), "140 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(30 === root_child0.getComputedWidth(), "30 === 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(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(30 === root_child2.getComputedTop(), "30 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrapped_row_within_align_items_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setFlexWrap(Yoga.WRAP_WRAP);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(150);
- root_child0_child0.setHeight(80);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setWidth(80);
- root_child0_child1.setHeight(80);
- root_child0.insertChild(root_child0_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(120 === root_child0_child1.getComputedLeft(), "120 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrapped_row_within_align_items_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setFlexWrap(Yoga.WRAP_WRAP);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(150);
- root_child0_child0.setHeight(80);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setWidth(80);
- root_child0_child1.setHeight(80);
- root_child0.insertChild(root_child0_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(120 === root_child0_child1.getComputedLeft(), "120 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrapped_row_within_align_items_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setFlexWrap(Yoga.WRAP_WRAP);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(150);
- root_child0_child0.setHeight(80);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setWidth(80);
- root_child0_child1.setHeight(80);
- root_child0.insertChild(root_child0_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(120 === root_child0_child1.getComputedLeft(), "120 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrapped_column_max_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignContent(Yoga.ALIGN_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(700);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(100);
- root_child0.setHeight(500);
- root_child0.setMaxHeight(200);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setMargin(Yoga.EDGE_LEFT, 20);
- root_child1.setMargin(Yoga.EDGE_TOP, 20);
- root_child1.setMargin(Yoga.EDGE_RIGHT, 20);
- root_child1.setMargin(Yoga.EDGE_BOTTOM, 20);
- root_child1.setWidth(200);
- root_child1.setHeight(200);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(100);
- root_child2.setHeight(100);
- 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(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(200 === root_child1.getComputedLeft(), "200 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(250 === root_child1.getComputedTop(), "250 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(420 === root_child2.getComputedLeft(), "420 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(200 === root_child2.getComputedTop(), "200 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(350 === root_child0.getComputedLeft(), "350 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(300 === root_child1.getComputedLeft(), "300 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(250 === root_child1.getComputedTop(), "250 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(180 === root_child2.getComputedLeft(), "180 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(200 === root_child2.getComputedTop(), "200 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrapped_column_max_height_flex", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignContent(Yoga.ALIGN_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(700);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis("0%");
- root_child0.setWidth(100);
- root_child0.setHeight(500);
- root_child0.setMaxHeight(200);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root_child1.setMargin(Yoga.EDGE_LEFT, 20);
- root_child1.setMargin(Yoga.EDGE_TOP, 20);
- root_child1.setMargin(Yoga.EDGE_RIGHT, 20);
- root_child1.setMargin(Yoga.EDGE_BOTTOM, 20);
- root_child1.setWidth(200);
- root_child1.setHeight(200);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(100);
- root_child2.setHeight(100);
- 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(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(300 === root_child0.getComputedLeft(), "300 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(180 === root_child0.getComputedHeight(), "180 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(180 === root_child1.getComputedHeight(), "180 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(300 === root_child2.getComputedLeft(), "300 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(400 === root_child2.getComputedTop(), "400 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(300 === root_child0.getComputedLeft(), "300 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(180 === root_child0.getComputedHeight(), "180 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(180 === root_child1.getComputedHeight(), "180 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(300 === root_child2.getComputedLeft(), "300 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(400 === root_child2.getComputedTop(), "400 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_nodes_with_content_sizing_overflowing_margin", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setFlexWrap(Yoga.WRAP_WRAP);
- root_child0.setWidth(85);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setWidth(40);
- root_child0_child0_child0.setHeight(40);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child0.insertChild(root_child0_child1, 1);
-
- var root_child0_child1_child0 = Yoga.Node.create(config);
- root_child0_child1_child0.setWidth(40);
- root_child0_child1_child0.setHeight(40);
- root_child0_child1.insertChild(root_child0_child1_child0, 0);
- 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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(85 === root_child0.getComputedWidth(), "85 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(40 === root_child0_child1.getComputedTop(), "40 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(415 === root_child0.getComputedLeft(), "415 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(85 === root_child0.getComputedWidth(), "85 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(45 === root_child0_child0.getComputedLeft(), "45 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(35 === root_child0_child1.getComputedLeft(), "35 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(40 === root_child0_child1.getComputedTop(), "40 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("wrap_nodes_with_content_sizing_margin_cross", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setFlexWrap(Yoga.WRAP_WRAP);
- root_child0.setWidth(70);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setWidth(40);
- root_child0_child0_child0.setHeight(40);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setMargin(Yoga.EDGE_TOP, 10);
- root_child0.insertChild(root_child0_child1, 1);
-
- var root_child0_child1_child0 = Yoga.Node.create(config);
- root_child0_child1_child0.setWidth(40);
- root_child0_child1_child0.setHeight(40);
- root_child0_child1.insertChild(root_child0_child1_child0, 0);
- 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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(70 === root_child0.getComputedWidth(), "70 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(50 === root_child0_child1.getComputedTop(), "50 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.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(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(430 === root_child0.getComputedLeft(), "430 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(70 === root_child0.getComputedWidth(), "70 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child0_child0.getComputedLeft(), "30 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child0_child1.getComputedLeft(), "30 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(50 === root_child0_child1.getComputedTop(), "50 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")");
- console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGGapTest.js b/javascript/tests/Facebook.Yoga/YGGapTest.js
deleted file mode 100644
index 07175f74..00000000
--- a/javascript/tests/Facebook.Yoga/YGGapTest.js
+++ /dev/null
@@ -1,2040 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("column_gap_flexible", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(80);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis("0%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- root_child2.setFlexShrink(1);
- root_child2.setFlexBasis("0%");
- 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(60 === root_child0.getComputedLeft(), "60 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_inflexible", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(80);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(60 === root_child0.getComputedLeft(), "60 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_mixed_flexible", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(80);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(60 === root_child0.getComputedLeft(), "60 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_child_margins", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(80);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis("0%");
- root_child0.setMargin(Yoga.EDGE_LEFT, 2);
- root_child0.setMargin(Yoga.EDGE_RIGHT, 2);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root_child1.setMargin(Yoga.EDGE_LEFT, 10);
- root_child1.setMargin(Yoga.EDGE_RIGHT, 10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- root_child2.setFlexShrink(1);
- root_child2.setFlexBasis("0%");
- root_child2.setMargin(Yoga.EDGE_LEFT, 15);
- root_child2.setMargin(Yoga.EDGE_RIGHT, 15);
- 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(2 === root_child0.getComputedLeft(), "2 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(2 === root_child0.getComputedWidth(), "2 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(26 === root_child1.getComputedLeft(), "26 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(2 === root_child1.getComputedWidth(), "2 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(63 === root_child2.getComputedLeft(), "63 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(2 === root_child2.getComputedWidth(), "2 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(76 === root_child0.getComputedLeft(), "76 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(2 === root_child0.getComputedWidth(), "2 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(52 === root_child1.getComputedLeft(), "52 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(2 === root_child1.getComputedWidth(), "2 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(15 === root_child2.getComputedLeft(), "15 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(2 === root_child2.getComputedWidth(), "2 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_row_gap_wrapping", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(80);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root_child4.setHeight(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root_child5.setHeight(20);
- root.insertChild(root_child5, 5);
-
- var root_child6 = Yoga.Node.create(config);
- root_child6.setWidth(20);
- root_child6.setHeight(20);
- root.insertChild(root_child6, 6);
-
- var root_child7 = Yoga.Node.create(config);
- root_child7.setWidth(20);
- root_child7.setHeight(20);
- root.insertChild(root_child7, 7);
-
- var root_child8 = Yoga.Node.create(config);
- root_child8.setWidth(20);
- root_child8.setHeight(20);
- root.insertChild(root_child8, 8);
- 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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
-
- console.assert(0 === root_child6.getComputedLeft(), "0 === root_child6.getComputedLeft() (" + root_child6.getComputedLeft() + ")");
- console.assert(80 === root_child6.getComputedTop(), "80 === root_child6.getComputedTop() (" + root_child6.getComputedTop() + ")");
- console.assert(20 === root_child6.getComputedWidth(), "20 === root_child6.getComputedWidth() (" + root_child6.getComputedWidth() + ")");
- console.assert(20 === root_child6.getComputedHeight(), "20 === root_child6.getComputedHeight() (" + root_child6.getComputedHeight() + ")");
-
- console.assert(30 === root_child7.getComputedLeft(), "30 === root_child7.getComputedLeft() (" + root_child7.getComputedLeft() + ")");
- console.assert(80 === root_child7.getComputedTop(), "80 === root_child7.getComputedTop() (" + root_child7.getComputedTop() + ")");
- console.assert(20 === root_child7.getComputedWidth(), "20 === root_child7.getComputedWidth() (" + root_child7.getComputedWidth() + ")");
- console.assert(20 === root_child7.getComputedHeight(), "20 === root_child7.getComputedHeight() (" + root_child7.getComputedHeight() + ")");
-
- console.assert(60 === root_child8.getComputedLeft(), "60 === root_child8.getComputedLeft() (" + root_child8.getComputedLeft() + ")");
- console.assert(80 === root_child8.getComputedTop(), "80 === root_child8.getComputedTop() (" + root_child8.getComputedTop() + ")");
- console.assert(20 === root_child8.getComputedWidth(), "20 === root_child8.getComputedWidth() (" + root_child8.getComputedWidth() + ")");
- console.assert(20 === root_child8.getComputedHeight(), "20 === root_child8.getComputedHeight() (" + root_child8.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(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(60 === root_child0.getComputedLeft(), "60 === 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() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(60 === root_child3.getComputedLeft(), "60 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(0 === root_child5.getComputedLeft(), "0 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
-
- console.assert(60 === root_child6.getComputedLeft(), "60 === root_child6.getComputedLeft() (" + root_child6.getComputedLeft() + ")");
- console.assert(80 === root_child6.getComputedTop(), "80 === root_child6.getComputedTop() (" + root_child6.getComputedTop() + ")");
- console.assert(20 === root_child6.getComputedWidth(), "20 === root_child6.getComputedWidth() (" + root_child6.getComputedWidth() + ")");
- console.assert(20 === root_child6.getComputedHeight(), "20 === root_child6.getComputedHeight() (" + root_child6.getComputedHeight() + ")");
-
- console.assert(30 === root_child7.getComputedLeft(), "30 === root_child7.getComputedLeft() (" + root_child7.getComputedLeft() + ")");
- console.assert(80 === root_child7.getComputedTop(), "80 === root_child7.getComputedTop() (" + root_child7.getComputedTop() + ")");
- console.assert(20 === root_child7.getComputedWidth(), "20 === root_child7.getComputedWidth() (" + root_child7.getComputedWidth() + ")");
- console.assert(20 === root_child7.getComputedHeight(), "20 === root_child7.getComputedHeight() (" + root_child7.getComputedHeight() + ")");
-
- console.assert(0 === root_child8.getComputedLeft(), "0 === root_child8.getComputedLeft() (" + root_child8.getComputedLeft() + ")");
- console.assert(80 === root_child8.getComputedTop(), "80 === root_child8.getComputedTop() (" + root_child8.getComputedTop() + ")");
- console.assert(20 === root_child8.getComputedWidth(), "20 === root_child8.getComputedWidth() (" + root_child8.getComputedWidth() + ")");
- console.assert(20 === root_child8.getComputedHeight(), "20 === root_child8.getComputedHeight() (" + root_child8.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_justify_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_justify_center", 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.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(70 === root_child2.getComputedLeft(), "70 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(70 === root_child0.getComputedLeft(), "70 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_justify_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(60 === root_child0.getComputedLeft(), "60 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_justify_space_between", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_justify_space_around", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(3 === root_child0.getComputedLeft(), "3 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(3 === root_child2.getComputedLeft(), "3 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_justify_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(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(5 === root_child0.getComputedLeft(), "5 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(75 === root_child2.getComputedLeft(), "75 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(5 === root_child2.getComputedLeft(), "5 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_wrap_align_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root_child4.setHeight(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root_child5.setHeight(20);
- root.insertChild(root_child5, 5);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_wrap_align_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_CENTER);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root_child4.setHeight(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root_child5.setHeight(20);
- root.insertChild(root_child5, 5);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === 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() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(20 === root_child1.getComputedTop(), "20 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(60 === root_child4.getComputedTop(), "60 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(60 === root_child5.getComputedTop(), "60 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === 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() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(20 === root_child1.getComputedTop(), "20 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(60 === root_child4.getComputedTop(), "60 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(60 === root_child5.getComputedTop(), "60 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_wrap_align_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_FLEX_END);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root_child4.setHeight(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root_child5.setHeight(20);
- root.insertChild(root_child5, 5);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(40 === root_child0.getComputedTop(), "40 === 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() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(40 === root_child0.getComputedTop(), "40 === 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() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_wrap_align_space_between", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root_child4.setHeight(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root_child5.setHeight(20);
- root.insertChild(root_child5, 5);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_wrap_align_space_around", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_SPACE_AROUND);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(100);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root_child1.setHeight(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root_child2.setHeight(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root_child3.setHeight(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root_child4.setHeight(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root_child5.setHeight(20);
- root.insertChild(root_child5, 5);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === 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() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(70 === root_child4.getComputedTop(), "70 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(70 === root_child5.getComputedTop(), "70 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === 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() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(70 === root_child4.getComputedTop(), "70 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(70 === root_child5.getComputedTop(), "70 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("column_gap_wrap_align_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(300);
- root.setHeight(300);
- root.setGap(Yoga.GUTTER_COLUMN, 5);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMinWidth(60);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setMinWidth(60);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- root_child2.setMinWidth(60);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setFlexGrow(1);
- root_child3.setMinWidth(60);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setFlexGrow(1);
- root_child4.setMinWidth(60);
- root.insertChild(root_child4, 4);
- 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(300 === root.getComputedWidth(), "300 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(300 === root.getComputedHeight(), "300 === 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(71 === root_child0.getComputedWidth(), "71 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(76 === root_child1.getComputedLeft(), "76 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(72 === root_child1.getComputedWidth(), "72 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(153 === root_child2.getComputedLeft(), "153 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(71 === root_child2.getComputedWidth(), "71 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(150 === root_child2.getComputedHeight(), "150 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(229 === root_child3.getComputedLeft(), "229 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(71 === root_child3.getComputedWidth(), "71 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(150 === root_child3.getComputedHeight(), "150 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(150 === root_child4.getComputedTop(), "150 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(300 === root_child4.getComputedWidth(), "300 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(150 === root_child4.getComputedHeight(), "150 === root_child4.getComputedHeight() (" + root_child4.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(300 === root.getComputedWidth(), "300 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(300 === root.getComputedHeight(), "300 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(229 === root_child0.getComputedLeft(), "229 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(71 === root_child0.getComputedWidth(), "71 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(153 === root_child1.getComputedLeft(), "153 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(71 === root_child1.getComputedWidth(), "71 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(76 === root_child2.getComputedLeft(), "76 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(72 === root_child2.getComputedWidth(), "72 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(150 === root_child2.getComputedHeight(), "150 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(71 === root_child3.getComputedWidth(), "71 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(150 === root_child3.getComputedHeight(), "150 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(150 === root_child4.getComputedTop(), "150 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(300 === root_child4.getComputedWidth(), "300 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(150 === root_child4.getComputedHeight(), "150 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("row_gap_align_items_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(200);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root.insertChild(root_child5, 5);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(90 === root_child1.getComputedHeight(), "90 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(110 === root_child3.getComputedTop(), "110 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(90 === root_child3.getComputedHeight(), "90 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(110 === root_child4.getComputedTop(), "110 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(90 === root_child4.getComputedHeight(), "90 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(110 === root_child5.getComputedTop(), "110 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(90 === root_child5.getComputedHeight(), "90 === root_child5.getComputedHeight() (" + root_child5.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(90 === root_child1.getComputedHeight(), "90 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(110 === root_child3.getComputedTop(), "110 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(90 === root_child3.getComputedHeight(), "90 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(110 === root_child4.getComputedTop(), "110 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(90 === root_child4.getComputedHeight(), "90 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(110 === root_child5.getComputedTop(), "110 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(90 === root_child5.getComputedHeight(), "90 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("row_gap_align_items_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(200);
- root.setGap(Yoga.GUTTER_COLUMN, 10);
- root.setGap(Yoga.GUTTER_ROW, 20);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(20);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(20);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setWidth(20);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setWidth(20);
- root.insertChild(root_child4, 4);
-
- var root_child5 = Yoga.Node.create(config);
- root_child5.setWidth(20);
- root.insertChild(root_child5, 5);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(20 === root_child3.getComputedTop(), "20 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(20 === root_child5.getComputedTop(), "20 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(0 === root_child5.getComputedHeight(), "0 === root_child5.getComputedHeight() (" + root_child5.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === 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(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(20 === root_child3.getComputedTop(), "20 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
-
- console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")");
- console.assert(20 === root_child5.getComputedTop(), "20 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")");
- console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")");
- console.assert(0 === root_child5.getComputedHeight(), "0 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("row_gap_column_child_margins", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(200);
- root.setGap(Yoga.GUTTER_ROW, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis("0%");
- root_child0.setMargin(Yoga.EDGE_TOP, 2);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 2);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexShrink(1);
- root_child1.setFlexBasis("0%");
- root_child1.setMargin(Yoga.EDGE_TOP, 10);
- root_child1.setMargin(Yoga.EDGE_BOTTOM, 10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- root_child2.setFlexShrink(1);
- root_child2.setFlexBasis("0%");
- root_child2.setMargin(Yoga.EDGE_TOP, 15);
- root_child2.setMargin(Yoga.EDGE_BOTTOM, 15);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(42 === root_child0.getComputedHeight(), "42 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(66 === root_child1.getComputedTop(), "66 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(42 === root_child1.getComputedHeight(), "42 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(143 === root_child2.getComputedTop(), "143 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(42 === root_child2.getComputedHeight(), "42 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(42 === root_child0.getComputedHeight(), "42 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(66 === root_child1.getComputedTop(), "66 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(42 === root_child1.getComputedHeight(), "42 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(143 === root_child2.getComputedTop(), "143 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(42 === root_child2.getComputedHeight(), "42 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("row_gap_row_wrap_child_margins", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setFlexWrap(Yoga.WRAP_WRAP);
- root.setWidth(100);
- root.setHeight(200);
- root.setGap(Yoga.GUTTER_ROW, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, 2);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 2);
- root_child0.setWidth(60);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setMargin(Yoga.EDGE_TOP, 10);
- root_child1.setMargin(Yoga.EDGE_BOTTOM, 10);
- root_child1.setWidth(60);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setMargin(Yoga.EDGE_TOP, 15);
- root_child2.setMargin(Yoga.EDGE_BOTTOM, 15);
- root_child2.setWidth(60);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(24 === root_child1.getComputedTop(), "24 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(60 === root_child1.getComputedWidth(), "60 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(59 === root_child2.getComputedTop(), "59 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(60 === root_child2.getComputedWidth(), "60 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(24 === root_child1.getComputedTop(), "24 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(60 === root_child1.getComputedWidth(), "60 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(40 === root_child2.getComputedLeft(), "40 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(59 === root_child2.getComputedTop(), "59 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(60 === root_child2.getComputedWidth(), "60 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js
deleted file mode 100644
index 4fc2329b..00000000
--- a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js
+++ /dev/null
@@ -1,1207 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("justify_content_row_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(102);
- root.setHeight(102);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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();
- }
-
- config.free();
- }
-});
-it("justify_content_row_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
- root.setWidth(102);
- root.setHeight(102);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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();
- }
-
- config.free();
- }
-});
-it("justify_content_row_center", 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.setWidth(102);
- root.setHeight(102);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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();
- }
-
- config.free();
- }
-});
-it("justify_content_row_space_between", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
- root.setWidth(102);
- root.setHeight(102);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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();
- }
-
- config.free();
- }
-});
-it("justify_content_row_space_around", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
- root.setWidth(102);
- root.setHeight(102);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- 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();
- }
-
- config.free();
- }
-});
-it("justify_content_column_flex_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- 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(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() + ")");
- 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(20 === root_child2.getComputedTop(), "20 === 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(10 === root_child1.getComputedTop(), "10 === 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(20 === root_child2.getComputedTop(), "20 === 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_column_flex_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
- 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(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();
- }
-
- config.free();
- }
-});
-it("justify_content_column_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- 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(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();
- }
-
- config.free();
- }
-});
-it("justify_content_column_space_between", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
- 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(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();
- }
-
- config.free();
- }
-});
-it("justify_content_column_space_around", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
- 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(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();
- }
-
- config.free();
- }
-});
-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();
- }
-});
-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();
- }
-});
-it("justify_content_min_width_with_padding_child_width_greater_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setWidth(1000);
- root.setHeight(1584);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0.setPadding(Yoga.EDGE_LEFT, 100);
- root_child0_child0.setPadding(Yoga.EDGE_RIGHT, 100);
- root_child0_child0.setMinWidth(400);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0.setWidth(300);
- root_child0_child0_child0.setHeight(100);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
- 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(1000 === root.getComputedWidth(), "1000 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(1584 === root.getComputedHeight(), "1584 === 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(1000 === root_child0.getComputedWidth(), "1000 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child0_child0_child0.getComputedLeft(), "100 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(300 === root_child0_child0_child0.getComputedWidth(), "300 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.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(1000 === root.getComputedWidth(), "1000 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(1584 === root.getComputedHeight(), "1584 === 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(1000 === root_child0.getComputedWidth(), "1000 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(500 === root_child0_child0.getComputedLeft(), "500 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child0_child0_child0.getComputedLeft(), "100 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(300 === root_child0_child0_child0.getComputedWidth(), "300 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("justify_content_min_width_with_padding_child_width_lower_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignContent(Yoga.ALIGN_STRETCH);
- root.setWidth(1080);
- root.setHeight(1584);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0.setPadding(Yoga.EDGE_LEFT, 100);
- root_child0_child0.setPadding(Yoga.EDGE_RIGHT, 100);
- root_child0_child0.setMinWidth(400);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
- root_child0_child0_child0.setWidth(199);
- root_child0_child0_child0.setHeight(100);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
- 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(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(1584 === root.getComputedHeight(), "1584 === 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(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(400 === root_child0_child0.getComputedWidth(), "400 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(101 === root_child0_child0_child0.getComputedLeft(), "101 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(199 === root_child0_child0_child0.getComputedWidth(), "199 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.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(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(1584 === root.getComputedHeight(), "1584 === 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(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(680 === root_child0_child0.getComputedLeft(), "680 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(400 === root_child0_child0.getComputedWidth(), "400 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(101 === root_child0_child0_child0.getComputedLeft(), "101 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(199 === root_child0_child0_child0.getComputedWidth(), "199 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGMarginTest.js b/javascript/tests/Facebook.Yoga/YGMarginTest.js
deleted file mode 100644
index c1d8bab3..00000000
--- a/javascript/tests/Facebook.Yoga/YGMarginTest.js
+++ /dev/null
@@ -1,1816 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("margin_start", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_START, 10);
- root_child0.setWidth(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === 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(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_top", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, 10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_END, 10);
- root_child0.setWidth(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === 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(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_bottom", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_and_flex_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMargin(Yoga.EDGE_START, 10);
- root_child0.setMargin(Yoga.EDGE_END, 10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_and_flex_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMargin(Yoga.EDGE_TOP, 10);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_and_stretch_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMargin(Yoga.EDGE_TOP, 10);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_and_stretch_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMargin(Yoga.EDGE_START, 10);
- root_child0.setMargin(Yoga.EDGE_END, 10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_with_sibling_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMargin(Yoga.EDGE_END, 10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(45 === root_child0.getComputedWidth(), "45 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(55 === root_child1.getComputedLeft(), "55 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(45 === root_child1.getComputedWidth(), "45 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(55 === root_child0.getComputedLeft(), "55 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(45 === root_child0.getComputedWidth(), "45 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(45 === root_child1.getComputedWidth(), "45 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_with_sibling_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(45 === root_child0.getComputedHeight(), "45 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(55 === root_child1.getComputedTop(), "55 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(45 === root_child1.getComputedHeight(), "45 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(45 === root_child0.getComputedHeight(), "45 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(55 === root_child1.getComputedTop(), "55 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(45 === root_child1.getComputedHeight(), "45 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_bottom", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_top", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_bottom_and_top", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, "auto");
- root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_bottom_and_top_justify_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, "auto");
- root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_mutiple_children_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setMargin(Yoga.EDGE_TOP, "auto");
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(50);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(25 === root_child0.getComputedTop(), "25 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(75 === root_child2.getComputedLeft(), "75 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(150 === root_child2.getComputedTop(), "150 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(25 === root_child0.getComputedTop(), "25 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(75 === root_child2.getComputedLeft(), "75 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(150 === root_child2.getComputedTop(), "150 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_mutiple_children_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(50);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(150 === root_child2.getComputedLeft(), "150 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(75 === root_child2.getComputedTop(), "75 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(125 === root_child0.getComputedLeft(), "125 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(75 === root_child2.getComputedTop(), "75 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_and_right_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_and_right", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_start_and_end_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_START, "auto");
- root_child0.setMargin(Yoga.EDGE_END, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_start_and_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_START, "auto");
- root_child0.setMargin(Yoga.EDGE_END, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_and_right_column_and_center", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_right", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_and_right_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_top_and_bottom_stretch", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, "auto");
- root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_should_not_be_part_of_max_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(250);
- root.setHeight(250);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_TOP, 20);
- root_child0.setWidth(100);
- root_child0.setHeight(100);
- root_child0.setMaxHeight(100);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(250 === root.getComputedHeight(), "250 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(250 === root.getComputedHeight(), "250 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_should_not_be_part_of_max_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(250);
- root.setHeight(250);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, 20);
- root_child0.setWidth(100);
- root_child0.setMaxWidth(100);
- root_child0.setHeight(100);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(250 === root.getComputedHeight(), "250 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(250 === root.getComputedHeight(), "250 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_right_child_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(72);
- root_child0.setHeight(72);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-20 === root_child0.getComputedLeft(), "-20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_child_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setWidth(72);
- root_child0.setHeight(72);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-20 === root_child0.getComputedLeft(), "-20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_fix_left_auto_right_child_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, 10);
- root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
- root_child0.setWidth(72);
- root_child0.setHeight(72);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-20 === root_child0.getComputedLeft(), "-20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_fix_right_child_bigger_than_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setWidth(52);
- root.setHeight(52);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root_child0.setMargin(Yoga.EDGE_RIGHT, 10);
- root_child0.setWidth(72);
- root_child0.setHeight(72);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-30 === root_child0.getComputedLeft(), "-30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_top_stretching_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis("0%");
- root_child0.setMargin(Yoga.EDGE_TOP, "auto");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === 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(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === 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(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("margin_auto_left_stretching_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis("0%");
- root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(200 === root_child0.getComputedLeft(), "200 === 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(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(200 === root_child0.getComputedLeft(), "200 === 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(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGMeasureTest.js b/javascript/tests/Facebook.Yoga/YGMeasureTest.js
deleted file mode 100644
index 7b8fa8a5..00000000
--- a/javascript/tests/Facebook.Yoga/YGMeasureTest.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("dont_measure_single_grow_shrink_child", function () {
- var root = Yoga.Node.create();
- root.setWidth(100);
- root.setHeight(100);
-
- var measureCounter = getMeasureCounter(Yoga, null, 100, 100);
-
- var root_child0 = Yoga.Node.create();
- root_child0.setMeasureFunc(measureCounter.inc);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root.insertChild(root_child0, 0);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === measureCounter.get(), "0 === measureCounter.get() (" + measureCounter.get() + ")");
-
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- (typeof gc !== "undefined") && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
-});
diff --git a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js
deleted file mode 100644
index ea7499cd..00000000
--- a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js
+++ /dev/null
@@ -1,1260 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("max_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMaxWidth(50);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("max_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setMaxHeight(50);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedHeight(), "50 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("justify_content_min_max", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setWidth(100);
- root.setMinHeight(100);
- root.setMaxHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(60);
- root_child0.setHeight(60);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("align_items_min_max", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setMinWidth(100);
- root.setMaxWidth(200);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(60);
- root_child0.setHeight(60);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("justify_content_overflow_min_max", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setMinHeight(100);
- root.setMaxHeight(110);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(50);
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(50);
- root_child2.setHeight(50);
- 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(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(110 === root.getComputedHeight(), "110 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-20 === root_child0.getComputedTop(), "-20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === 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(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(110 === root.getComputedHeight(), "110 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-20 === root_child0.getComputedTop(), "-20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === 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(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_to_min", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setMinHeight(100);
- root.setMaxHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexShrink(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_in_at_most_container", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexBasis(0);
- root_child0.insertChild(root_child0_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === 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(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(0);
- root_child0.setHeight(100);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_within_constrained_min_max_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setMinHeight(100);
- root.setMaxHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_within_max_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setMaxWidth(100);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setHeight(20);
- root_child0.insertChild(root_child0_child0, 0);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_within_constrained_max_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setMaxWidth(300);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setHeight(20);
- root_child0.insertChild(root_child0_child0, 0);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_root_ignored", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexGrow(1);
- root.setWidth(100);
- root.setMinHeight(100);
- root.setMaxHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(200);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setHeight(100);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(300 === root.getComputedHeight(), "300 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(300 === root.getComputedHeight(), "300 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_root_minimized", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setMinHeight(100);
- root.setMaxHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMinHeight(100);
- root_child0.setMaxHeight(500);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexBasis(200);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setHeight(100);
- root_child0.insertChild(root_child0_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(300 === root.getComputedHeight(), "300 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(300 === root_child0.getComputedHeight(), "300 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(200 === root_child0_child1.getComputedTop(), "200 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(300 === root.getComputedHeight(), "300 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(300 === root_child0.getComputedHeight(), "300 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(200 === root_child0_child1.getComputedTop(), "200 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_height_maximized", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMinHeight(100);
- root_child0.setMaxHeight(500);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexBasis(200);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setHeight(100);
- root_child0.insertChild(root_child0_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(500 === root_child0.getComputedHeight(), "500 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(400 === root_child0_child0.getComputedHeight(), "400 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(400 === root_child0_child1.getComputedTop(), "400 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(500 === root_child0.getComputedHeight(), "500 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(400 === root_child0_child0.getComputedHeight(), "400 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(400 === root_child0_child1.getComputedTop(), "400 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_within_constrained_min_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setMinWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setWidth(50);
- root.insertChild(root_child1, 1);
- root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
-
- console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
- console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_within_constrained_min_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setMinHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_within_constrained_max_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setMaxWidth(100);
- root_child0.setHeight(100);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexShrink(1);
- root_child0_child0.setFlexBasis(100);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setWidth(50);
- root_child0.insertChild(root_child0_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child0_child1.getComputedLeft(), "50 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(50 === root_child0_child1.getComputedWidth(), "50 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(50 === root_child0_child1.getComputedWidth(), "50 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("flex_grow_within_constrained_max_column", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setMaxHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis(100);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setHeight(50);
- root.insertChild(root_child1, 1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("child_min_max_width_flexing", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(120);
- root.setHeight(50);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(0);
- root_child0.setMinWidth(60);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexBasis("50%");
- root_child1.setMaxWidth(20);
- root.insertChild(root_child1, 1);
- 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(120 === root.getComputedWidth(), "120 === 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(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.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(120 === root.getComputedWidth(), "120 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(50 === root.getComputedHeight(), "50 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("min_width_overrides_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(50);
- root.setMinWidth(100);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("max_width_overrides_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setMaxWidth(100);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("min_height_overrides_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setHeight(50);
- root.setMinHeight(100);
- 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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("max_height_overrides_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setHeight(200);
- root.setMaxHeight(100);
- 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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.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(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("min_max_percent_no_width_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setMinWidth("10%");
- root_child0.setMaxWidth("10%");
- root_child0.setMinHeight("10%");
- root_child0.setMaxHeight("10%");
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === 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(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGPaddingTest.js b/javascript/tests/Facebook.Yoga/YGPaddingTest.js
deleted file mode 100644
index db0488ab..00000000
--- a/javascript/tests/Facebook.Yoga/YGPaddingTest.js
+++ /dev/null
@@ -1,276 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("padding_no_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setPadding(Yoga.EDGE_LEFT, 10);
- root.setPadding(Yoga.EDGE_TOP, 10);
- root.setPadding(Yoga.EDGE_RIGHT, 10);
- root.setPadding(Yoga.EDGE_BOTTOM, 10);
- 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(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.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(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("padding_container_match_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setPadding(Yoga.EDGE_LEFT, 10);
- root.setPadding(Yoga.EDGE_TOP, 10);
- root.setPadding(Yoga.EDGE_RIGHT, 10);
- root.setPadding(Yoga.EDGE_BOTTOM, 10);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("padding_flex_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setPadding(Yoga.EDGE_LEFT, 10);
- root.setPadding(Yoga.EDGE_TOP, 10);
- root.setPadding(Yoga.EDGE_RIGHT, 10);
- root.setPadding(Yoga.EDGE_BOTTOM, 10);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setWidth(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("padding_stretch_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setPadding(Yoga.EDGE_LEFT, 10);
- root.setPadding(Yoga.EDGE_TOP, 10);
- root.setPadding(Yoga.EDGE_RIGHT, 10);
- root.setPadding(Yoga.EDGE_BOTTOM, 10);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("padding_center_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setPadding(Yoga.EDGE_START, 10);
- root.setPadding(Yoga.EDGE_END, 20);
- root.setPadding(Yoga.EDGE_BOTTOM, 20);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("child_with_padding_align_end", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
- root.setAlignItems(Yoga.ALIGN_FLEX_END);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPadding(Yoga.EDGE_LEFT, 20);
- root_child0.setPadding(Yoga.EDGE_TOP, 20);
- root_child0.setPadding(Yoga.EDGE_RIGHT, 20);
- root_child0.setPadding(Yoga.EDGE_BOTTOM, 20);
- root_child0.setWidth(100);
- root_child0.setHeight(100);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGPercentageTest.js b/javascript/tests/Facebook.Yoga/YGPercentageTest.js
deleted file mode 100644
index 17129fe3..00000000
--- a/javascript/tests/Facebook.Yoga/YGPercentageTest.js
+++ /dev/null
@@ -1,1196 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("percentage_width_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth("30%");
- root_child0.setHeight("30%");
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(140 === root_child0.getComputedLeft(), "140 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_position_left_top", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(400);
- root.setHeight(400);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPosition(Yoga.EDGE_LEFT, "10%");
- root_child0.setPosition(Yoga.EDGE_TOP, "20%");
- root_child0.setWidth("45%");
- root_child0.setHeight("55%");
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(400 === root.getComputedWidth(), "400 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(400 === root.getComputedHeight(), "400 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(180 === root_child0.getComputedWidth(), "180 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(220 === root_child0.getComputedHeight(), "220 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(400 === root.getComputedWidth(), "400 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(400 === root.getComputedHeight(), "400 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(260 === root_child0.getComputedLeft(), "260 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(180 === root_child0.getComputedWidth(), "180 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(220 === root_child0.getComputedHeight(), "220 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_position_bottom_right", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(500);
- root.setHeight(500);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPosition(Yoga.EDGE_RIGHT, "20%");
- root_child0.setPosition(Yoga.EDGE_BOTTOM, "10%");
- root_child0.setWidth("55%");
- root_child0.setHeight("15%");
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(-100 === root_child0.getComputedLeft(), "-100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-50 === root_child0.getComputedTop(), "-50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(275 === root_child0.getComputedWidth(), "275 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(75 === root_child0.getComputedHeight(), "75 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(125 === root_child0.getComputedLeft(), "125 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(-50 === root_child0.getComputedTop(), "-50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(275 === root_child0.getComputedWidth(), "275 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("50%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexBasis("25%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(125 === root_child0.getComputedWidth(), "125 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(125 === root_child1.getComputedLeft(), "125 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(75 === root_child1.getComputedWidth(), "75 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(125 === root_child0.getComputedWidth(), "125 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(75 === root_child1.getComputedWidth(), "75 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis_cross", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("50%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setFlexBasis("25%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(125 === root_child0.getComputedHeight(), "125 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(125 === root_child1.getComputedTop(), "125 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(75 === root_child1.getComputedHeight(), "75 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(125 === root_child0.getComputedHeight(), "125 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(125 === root_child1.getComputedTop(), "125 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(75 === root_child1.getComputedHeight(), "75 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis_main_max_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("10%");
- root_child0.setMaxHeight("60%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(4);
- root_child1.setFlexBasis("10%");
- root_child1.setMaxHeight("20%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(52 === root_child0.getComputedWidth(), "52 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(52 === root_child1.getComputedLeft(), "52 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(148 === root_child1.getComputedWidth(), "148 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(148 === root_child0.getComputedLeft(), "148 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(52 === root_child0.getComputedWidth(), "52 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(148 === root_child1.getComputedWidth(), "148 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis_cross_max_height", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("10%");
- root_child0.setMaxHeight("60%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(4);
- root_child1.setFlexBasis("10%");
- root_child1.setMaxHeight("20%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(120 === root_child1.getComputedTop(), "120 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(120 === root_child1.getComputedTop(), "120 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis_main_max_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("15%");
- root_child0.setMaxWidth("60%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(4);
- root_child1.setFlexBasis("10%");
- root_child1.setMaxWidth("20%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(120 === root_child1.getComputedLeft(), "120 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis_cross_max_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("10%");
- root_child0.setMaxWidth("60%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(4);
- root_child1.setFlexBasis("15%");
- root_child1.setMaxWidth("20%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(160 === root_child1.getComputedLeft(), "160 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis_main_min_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("15%");
- root_child0.setMinWidth("60%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(4);
- root_child1.setFlexBasis("10%");
- root_child1.setMinWidth("20%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(120 === root_child1.getComputedLeft(), "120 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(80 === root_child1.getComputedWidth(), "80 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(80 === root_child1.getComputedWidth(), "80 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_flex_basis_cross_min_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("10%");
- root_child0.setMinWidth("60%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(4);
- root_child1.setFlexBasis("15%");
- root_child1.setMinWidth("20%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis("10%");
- root_child0.setMargin(Yoga.EDGE_LEFT, 5);
- root_child0.setMargin(Yoga.EDGE_TOP, 5);
- root_child0.setMargin(Yoga.EDGE_RIGHT, 5);
- root_child0.setMargin(Yoga.EDGE_BOTTOM, 5);
- root_child0.setPadding(Yoga.EDGE_LEFT, 3);
- root_child0.setPadding(Yoga.EDGE_TOP, 3);
- root_child0.setPadding(Yoga.EDGE_RIGHT, 3);
- root_child0.setPadding(Yoga.EDGE_BOTTOM, 3);
- root_child0.setMinWidth("60%");
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setMargin(Yoga.EDGE_LEFT, 5);
- root_child0_child0.setMargin(Yoga.EDGE_TOP, 5);
- root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 5);
- root_child0_child0.setMargin(Yoga.EDGE_BOTTOM, 5);
- root_child0_child0.setPadding(Yoga.EDGE_LEFT, "3%");
- root_child0_child0.setPadding(Yoga.EDGE_TOP, "3%");
- root_child0_child0.setPadding(Yoga.EDGE_RIGHT, "3%");
- root_child0_child0.setPadding(Yoga.EDGE_BOTTOM, "3%");
- root_child0_child0.setWidth("50%");
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setMargin(Yoga.EDGE_LEFT, "5%");
- root_child0_child0_child0.setMargin(Yoga.EDGE_TOP, "5%");
- root_child0_child0_child0.setMargin(Yoga.EDGE_RIGHT, "5%");
- root_child0_child0_child0.setMargin(Yoga.EDGE_BOTTOM, "5%");
- root_child0_child0_child0.setPadding(Yoga.EDGE_LEFT, 3);
- root_child0_child0_child0.setPadding(Yoga.EDGE_TOP, 3);
- root_child0_child0_child0.setPadding(Yoga.EDGE_RIGHT, 3);
- root_child0_child0_child0.setPadding(Yoga.EDGE_BOTTOM, 3);
- root_child0_child0_child0.setWidth("45%");
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(4);
- root_child1.setFlexBasis("15%");
- root_child1.setMinWidth("20%");
- root.insertChild(root_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(190 === root_child0.getComputedWidth(), "190 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(48 === root_child0.getComputedHeight(), "48 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(8 === root_child0_child0.getComputedLeft(), "8 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(8 === root_child0_child0.getComputedTop(), "8 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(92 === root_child0_child0.getComputedWidth(), "92 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(25 === root_child0_child0.getComputedHeight(), "25 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(10 === root_child0_child0_child0.getComputedLeft(), "10 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0_child0_child0.getComputedTop(), "10 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(36 === root_child0_child0_child0.getComputedWidth(), "36 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(6 === root_child0_child0_child0.getComputedHeight(), "6 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(58 === root_child1.getComputedTop(), "58 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(142 === root_child1.getComputedHeight(), "142 === root_child1.getComputedHeight() (" + root_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(190 === root_child0.getComputedWidth(), "190 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(48 === root_child0.getComputedHeight(), "48 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(90 === root_child0_child0.getComputedLeft(), "90 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(8 === root_child0_child0.getComputedTop(), "8 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(92 === root_child0_child0.getComputedWidth(), "92 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(25 === root_child0_child0.getComputedHeight(), "25 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(46 === root_child0_child0_child0.getComputedLeft(), "46 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0_child0_child0.getComputedTop(), "10 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(36 === root_child0_child0_child0.getComputedWidth(), "36 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(6 === root_child0_child0_child0.getComputedHeight(), "6 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(58 === root_child1.getComputedTop(), "58 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(142 === root_child1.getComputedHeight(), "142 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_margin_should_calculate_based_only_on_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setMargin(Yoga.EDGE_LEFT, "10%");
- root_child0.setMargin(Yoga.EDGE_TOP, "10%");
- root_child0.setMargin(Yoga.EDGE_RIGHT, "10%");
- root_child0.setMargin(Yoga.EDGE_BOTTOM, "10%");
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(10);
- root_child0_child0.setHeight(10);
- root_child0.insertChild(root_child0_child0, 0);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(160 === root_child0.getComputedWidth(), "160 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(160 === root_child0.getComputedWidth(), "160 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(150 === root_child0_child0.getComputedLeft(), "150 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_padding_should_calculate_based_only_on_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setPadding(Yoga.EDGE_LEFT, "10%");
- root_child0.setPadding(Yoga.EDGE_TOP, "10%");
- root_child0.setPadding(Yoga.EDGE_RIGHT, "10%");
- root_child0.setPadding(Yoga.EDGE_BOTTOM, "10%");
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(10);
- root_child0_child0.setHeight(10);
- root_child0.insertChild(root_child0_child0, 0);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(20 === root_child0_child0.getComputedLeft(), "20 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0_child0.getComputedTop(), "20 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(170 === root_child0_child0.getComputedLeft(), "170 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(20 === root_child0_child0.getComputedTop(), "20 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_absolute_position", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(200);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_LEFT, "30%");
- root_child0.setPosition(Yoga.EDGE_TOP, "10%");
- root_child0.setWidth(10);
- root_child0.setHeight(10);
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_width_height_undefined_parent_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth("50%");
- root_child0.setHeight("50%");
- 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(0 === root.getComputedHeight(), "0 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === 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(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(0 === root.getComputedHeight(), "0 === 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(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percent_within_flex_grow", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(350);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(100);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setWidth("100%");
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setWidth(100);
- 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(350 === root.getComputedWidth(), "350 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(150 === root_child1.getComputedWidth(), "150 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(150 === root_child1_child0.getComputedWidth(), "150 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(250 === root_child2.getComputedLeft(), "250 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(350 === root.getComputedWidth(), "350 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(150 === root_child1.getComputedWidth(), "150 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(150 === root_child1_child0.getComputedWidth(), "150 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percentage_container_in_wrapping_container", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root.setAlignItems(Yoga.ALIGN_CENTER);
- root.setWidth(200);
- root.setHeight(200);
-
- var root_child0 = Yoga.Node.create(config);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
- root_child0_child0.setWidth("100%");
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child0_child0 = Yoga.Node.create(config);
- root_child0_child0_child0.setWidth(50);
- root_child0_child0_child0.setHeight(50);
- root_child0_child0.insertChild(root_child0_child0_child0, 0);
-
- var root_child0_child0_child1 = Yoga.Node.create(config);
- root_child0_child0_child1.setWidth(50);
- root_child0_child0_child1.setHeight(50);
- root_child0_child0.insertChild(root_child0_child0_child1, 1);
- 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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0_child0.getComputedWidth(), "50 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0_child0.getComputedHeight(), "50 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child0_child0_child1.getComputedLeft(), "50 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")");
- console.assert(50 === root_child0_child0_child1.getComputedWidth(), "50 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0_child1.getComputedHeight(), "50 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.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(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(50 === root_child0_child0_child0.getComputedLeft(), "50 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
- console.assert(50 === root_child0_child0_child0.getComputedWidth(), "50 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0_child0.getComputedHeight(), "50 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")");
- console.assert(50 === root_child0_child0_child1.getComputedWidth(), "50 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0_child1.getComputedHeight(), "50 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("percent_absolute_position", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(60);
- root.setHeight(50);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
- root_child0.setPosition(Yoga.EDGE_LEFT, "50%");
- root_child0.setWidth("100%");
- root_child0.setHeight(50);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth("100%");
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setWidth("100%");
- root_child0.insertChild(root_child0_child1, 1);
- 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(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(50 === root.getComputedHeight(), "50 === 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(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(60 === root_child0_child0.getComputedWidth(), "60 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(60 === root_child0_child1.getComputedLeft(), "60 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(60 === root_child0_child1.getComputedWidth(), "60 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(50 === root_child0_child1.getComputedHeight(), "50 === root_child0_child1.getComputedHeight() (" + root_child0_child1.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(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(50 === root.getComputedHeight(), "50 === 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(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(60 === root_child0_child0.getComputedWidth(), "60 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(-60 === root_child0_child1.getComputedLeft(), "-60 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(60 === root_child0_child1.getComputedWidth(), "60 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(50 === root_child0_child1.getComputedHeight(), "50 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGRoundingTest.js b/javascript/tests/Facebook.Yoga/YGRoundingTest.js
deleted file mode 100644
index 4359eede..00000000
--- a/javascript/tests/Facebook.Yoga/YGRoundingTest.js
+++ /dev/null
@@ -1,1116 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("rounding_flex_basis_flex_grow_row_width_of_100", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(33 === root_child0.getComputedWidth(), "33 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(33 === root_child1.getComputedLeft(), "33 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(34 === root_child1.getComputedWidth(), "34 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(67 === root_child2.getComputedLeft(), "67 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(33 === root_child2.getComputedWidth(), "33 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(67 === root_child0.getComputedLeft(), "67 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(33 === root_child0.getComputedWidth(), "33 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(33 === root_child1.getComputedLeft(), "33 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(34 === root_child1.getComputedWidth(), "34 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(33 === root_child2.getComputedWidth(), "33 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_flex_basis_flex_grow_row_prime_number_width", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(113);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- root.insertChild(root_child2, 2);
-
- var root_child3 = Yoga.Node.create(config);
- root_child3.setFlexGrow(1);
- root.insertChild(root_child3, 3);
-
- var root_child4 = Yoga.Node.create(config);
- root_child4.setFlexGrow(1);
- root.insertChild(root_child4, 4);
- 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(113 === root.getComputedWidth(), "113 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(23 === root_child0.getComputedWidth(), "23 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(23 === root_child1.getComputedLeft(), "23 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(22 === root_child1.getComputedWidth(), "22 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(45 === root_child2.getComputedLeft(), "45 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(23 === root_child2.getComputedWidth(), "23 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(68 === root_child3.getComputedLeft(), "68 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(22 === root_child3.getComputedWidth(), "22 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(90 === root_child4.getComputedLeft(), "90 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(23 === root_child4.getComputedWidth(), "23 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.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(113 === root.getComputedWidth(), "113 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(23 === root_child0.getComputedWidth(), "23 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(68 === root_child1.getComputedLeft(), "68 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(22 === root_child1.getComputedWidth(), "22 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(45 === root_child2.getComputedLeft(), "45 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(23 === root_child2.getComputedWidth(), "23 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
-
- console.assert(23 === root_child3.getComputedLeft(), "23 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");
- console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");
- console.assert(22 === root_child3.getComputedWidth(), "22 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");
- console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");
-
- console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");
- console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");
- console.assert(23 === root_child4.getComputedWidth(), "23 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");
- console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_flex_basis_flex_shrink_row", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(101);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexShrink(1);
- root_child0.setFlexBasis(100);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexBasis(25);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexBasis(25);
- 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(101 === root.getComputedWidth(), "101 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(51 === root_child0.getComputedWidth(), "51 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === 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(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(76 === root_child2.getComputedLeft(), "76 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(25 === root_child2.getComputedWidth(), "25 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === 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(101 === root.getComputedWidth(), "101 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(51 === root_child0.getComputedWidth(), "51 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(25 === root_child1.getComputedLeft(), "25 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(100 === root_child1.getComputedHeight(), "100 === 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(25 === root_child2.getComputedWidth(), "25 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_flex_basis_overrides_main_size", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(113);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_total_fractial", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(87.4);
- root.setHeight(113.4);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(0.7);
- root_child0.setFlexBasis(50.3);
- root_child0.setHeight(20.3);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1.6);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1.1);
- root_child2.setHeight(10.7);
- 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(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === 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(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_total_fractial_nested", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(87.4);
- root.setHeight(113.4);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(0.7);
- root_child0.setFlexBasis(50.3);
- root_child0.setHeight(20.3);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setFlexGrow(1);
- root_child0_child0.setFlexBasis(0.3);
- root_child0_child0.setPosition(Yoga.EDGE_BOTTOM, 13.3);
- root_child0_child0.setHeight(9.9);
- root_child0.insertChild(root_child0_child0, 0);
-
- var root_child0_child1 = Yoga.Node.create(config);
- root_child0_child1.setFlexGrow(4);
- root_child0_child1.setFlexBasis(0.3);
- root_child0_child1.setPosition(Yoga.EDGE_TOP, 13.3);
- root_child0_child1.setHeight(1.1);
- root_child0.insertChild(root_child0_child1, 1);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1.6);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1.1);
- root_child2.setHeight(10.7);
- 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(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(-13 === root_child0_child0.getComputedTop(), "-13 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(87 === root_child0_child0.getComputedWidth(), "87 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(12 === root_child0_child0.getComputedHeight(), "12 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(25 === root_child0_child1.getComputedTop(), "25 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(87 === root_child0_child1.getComputedWidth(), "87 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(47 === root_child0_child1.getComputedHeight(), "47 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === 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(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(-13 === root_child0_child0.getComputedTop(), "-13 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(87 === root_child0_child0.getComputedWidth(), "87 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(12 === root_child0_child0.getComputedHeight(), "12 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");
- console.assert(25 === root_child0_child1.getComputedTop(), "25 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");
- console.assert(87 === root_child0_child1.getComputedWidth(), "87 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");
- console.assert(47 === root_child0_child1.getComputedHeight(), "47 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_fractial_input_1", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(113.4);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_fractial_input_2", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(113.6);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(114 === root.getComputedHeight(), "114 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(65 === root_child1.getComputedTop(), "65 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(25 === root_child2.getComputedHeight(), "25 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(114 === root.getComputedHeight(), "114 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(65 === root_child1.getComputedTop(), "65 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_fractial_input_3", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setPosition(Yoga.EDGE_TOP, 0.3);
- root.setWidth(100);
- root.setHeight(113.4);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(114 === root.getComputedHeight(), "114 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(25 === root_child2.getComputedHeight(), "25 === 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(114 === root.getComputedHeight(), "114 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_fractial_input_4", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setPosition(Yoga.EDGE_TOP, 0.7);
- root.setWidth(100);
- root.setHeight(113.4);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setFlexBasis(50);
- root_child0.setHeight(20);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(1 === root.getComputedTop(), "1 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === 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(1 === root.getComputedTop(), "1 === root.getComputedTop() (" + root.getComputedTop() + ")");
- console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(113 === root.getComputedHeight(), "113 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_inner_node_controversy_horizontal", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(320);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setHeight(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight(10);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setFlexGrow(1);
- root_child1_child0.setHeight(10);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(320 === root.getComputedWidth(), "320 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(10 === root.getComputedHeight(), "10 === 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(107 === root_child0.getComputedWidth(), "107 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(107 === root_child1.getComputedLeft(), "107 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(106 === root_child1.getComputedWidth(), "106 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(106 === root_child1_child0.getComputedWidth(), "106 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(213 === root_child2.getComputedLeft(), "213 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(107 === root_child2.getComputedWidth(), "107 === 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(320 === root.getComputedWidth(), "320 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(10 === root.getComputedHeight(), "10 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(213 === root_child0.getComputedLeft(), "213 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(107 === root_child0.getComputedWidth(), "107 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(107 === root_child1.getComputedLeft(), "107 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(106 === root_child1.getComputedWidth(), "106 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(106 === root_child1_child0.getComputedWidth(), "106 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.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(107 === root_child2.getComputedWidth(), "107 === 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("rounding_inner_node_controversy_vertical", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setHeight(320);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setWidth(10);
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setWidth(10);
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setFlexGrow(1);
- root_child1_child0.setWidth(10);
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- 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(10 === root.getComputedWidth(), "10 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(320 === root.getComputedHeight(), "320 === 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(107 === root_child0.getComputedHeight(), "107 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(107 === root_child1.getComputedTop(), "107 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(106 === root_child1.getComputedHeight(), "106 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(10 === root_child1_child0.getComputedWidth(), "10 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(106 === root_child1_child0.getComputedHeight(), "106 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(213 === root_child2.getComputedTop(), "213 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(107 === root_child2.getComputedHeight(), "107 === 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(10 === root.getComputedWidth(), "10 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(320 === root.getComputedHeight(), "320 === 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(107 === root_child0.getComputedHeight(), "107 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(107 === root_child1.getComputedTop(), "107 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(106 === root_child1.getComputedHeight(), "106 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(10 === root_child1_child0.getComputedWidth(), "10 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(106 === root_child1_child0.getComputedHeight(), "106 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(213 === root_child2.getComputedTop(), "213 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(107 === root_child2.getComputedHeight(), "107 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("rounding_inner_node_controversy_combined", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
- root.setWidth(640);
- root.setHeight(320);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setFlexGrow(1);
- root_child0.setHeight("100%");
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create(config);
- root_child1.setFlexGrow(1);
- root_child1.setHeight("100%");
- root.insertChild(root_child1, 1);
-
- var root_child1_child0 = Yoga.Node.create(config);
- root_child1_child0.setFlexGrow(1);
- root_child1_child0.setWidth("100%");
- root_child1.insertChild(root_child1_child0, 0);
-
- var root_child1_child1 = Yoga.Node.create(config);
- root_child1_child1.setFlexGrow(1);
- root_child1_child1.setWidth("100%");
- root_child1.insertChild(root_child1_child1, 1);
-
- var root_child1_child1_child0 = Yoga.Node.create(config);
- root_child1_child1_child0.setFlexGrow(1);
- root_child1_child1_child0.setWidth("100%");
- root_child1_child1.insertChild(root_child1_child1_child0, 0);
-
- var root_child1_child2 = Yoga.Node.create(config);
- root_child1_child2.setFlexGrow(1);
- root_child1_child2.setWidth("100%");
- root_child1.insertChild(root_child1_child2, 2);
-
- var root_child2 = Yoga.Node.create(config);
- root_child2.setFlexGrow(1);
- root_child2.setHeight("100%");
- 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(640 === root.getComputedWidth(), "640 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(320 === root.getComputedHeight(), "320 === 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(213 === root_child0.getComputedWidth(), "213 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(320 === root_child0.getComputedHeight(), "320 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(213 === root_child1.getComputedLeft(), "213 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(214 === root_child1.getComputedWidth(), "214 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(320 === root_child1.getComputedHeight(), "320 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(214 === root_child1_child0.getComputedWidth(), "214 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(107 === root_child1_child0.getComputedHeight(), "107 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(107 === root_child1_child1.getComputedTop(), "107 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(214 === root_child1_child1.getComputedWidth(), "214 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(106 === root_child1_child1.getComputedHeight(), "106 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child1_child0.getComputedLeft(), "0 === root_child1_child1_child0.getComputedLeft() (" + root_child1_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1_child0.getComputedTop(), "0 === root_child1_child1_child0.getComputedTop() (" + root_child1_child1_child0.getComputedTop() + ")");
- console.assert(214 === root_child1_child1_child0.getComputedWidth(), "214 === root_child1_child1_child0.getComputedWidth() (" + root_child1_child1_child0.getComputedWidth() + ")");
- console.assert(106 === root_child1_child1_child0.getComputedHeight(), "106 === root_child1_child1_child0.getComputedHeight() (" + root_child1_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(213 === root_child1_child2.getComputedTop(), "213 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(214 === root_child1_child2.getComputedWidth(), "214 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(107 === root_child1_child2.getComputedHeight(), "107 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");
-
- console.assert(427 === root_child2.getComputedLeft(), "427 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
- console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
- console.assert(213 === root_child2.getComputedWidth(), "213 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(320 === root_child2.getComputedHeight(), "320 === 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(640 === root.getComputedWidth(), "640 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
-
- console.assert(427 === root_child0.getComputedLeft(), "427 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
- console.assert(213 === root_child0.getComputedWidth(), "213 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(320 === root_child0.getComputedHeight(), "320 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(213 === root_child1.getComputedLeft(), "213 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
- console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
- console.assert(214 === root_child1.getComputedWidth(), "214 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
- console.assert(320 === root_child1.getComputedHeight(), "320 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");
- console.assert(214 === root_child1_child0.getComputedWidth(), "214 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
- console.assert(107 === root_child1_child0.getComputedHeight(), "107 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");
- console.assert(107 === root_child1_child1.getComputedTop(), "107 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");
- console.assert(214 === root_child1_child1.getComputedWidth(), "214 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");
- console.assert(106 === root_child1_child1.getComputedHeight(), "106 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child1_child0.getComputedLeft(), "0 === root_child1_child1_child0.getComputedLeft() (" + root_child1_child1_child0.getComputedLeft() + ")");
- console.assert(0 === root_child1_child1_child0.getComputedTop(), "0 === root_child1_child1_child0.getComputedTop() (" + root_child1_child1_child0.getComputedTop() + ")");
- console.assert(214 === root_child1_child1_child0.getComputedWidth(), "214 === root_child1_child1_child0.getComputedWidth() (" + root_child1_child1_child0.getComputedWidth() + ")");
- console.assert(106 === root_child1_child1_child0.getComputedHeight(), "106 === root_child1_child1_child0.getComputedHeight() (" + root_child1_child1_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");
- console.assert(213 === root_child1_child2.getComputedTop(), "213 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");
- console.assert(214 === root_child1_child2.getComputedWidth(), "214 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");
- console.assert(107 === root_child1_child2.getComputedHeight(), "107 === root_child1_child2.getComputedHeight() (" + root_child1_child2.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(213 === root_child2.getComputedWidth(), "213 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
- console.assert(320 === root_child2.getComputedHeight(), "320 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js b/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js
deleted file mode 100644
index e68746a3..00000000
--- a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js
+++ /dev/null
@@ -1,182 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html
-
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("nested_overflowing_child", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(200);
- root_child0_child0.setHeight(200);
- root_child0.insertChild(root_child0_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(-100 === root_child0_child0.getComputedLeft(), "-100 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("nested_overflowing_child_in_constraint_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(100);
- root_child0.setHeight(100);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(200);
- root_child0_child0.setHeight(200);
- root_child0.insertChild(root_child0_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(-100 === root_child0_child0.getComputedLeft(), "-100 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
-it("parent_wrap_child_size_overflowing_parent", function () {
- var config = Yoga.Config.create();
-
- try {
- var root = Yoga.Node.create(config);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create(config);
- root_child0.setWidth(100);
- root.insertChild(root_child0, 0);
-
- var root_child0_child0 = Yoga.Node.create(config);
- root_child0_child0.setWidth(100);
- root_child0_child0.setHeight(200);
- root_child0.insertChild(root_child0_child0, 0);
- 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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.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(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
- console.assert(100 === root.getComputedHeight(), "100 === 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(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
-
- console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
- console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
- console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
- console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
- } finally {
- if (typeof root !== "undefined") {
- root.freeRecursive();
- }
-
- config.free();
- }
-});
diff --git a/javascript/tests/YGAlignBaselineTest.test.js b/javascript/tests/YGAlignBaselineTest.test.js
new file mode 100644
index 00000000..6c99fa74
--- /dev/null
+++ b/javascript/tests/YGAlignBaselineTest.test.js
@@ -0,0 +1,122 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+test("align_baseline_parent_using_child_in_column_as_reference", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(1000);
+ root.setHeight(1000);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
+ root_child0.setWidth(500);
+ root_child0.setHeight(600);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
+ root_child1.setWidth(500);
+ root_child1.setHeight(800);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
+ root_child1_child0.setWidth(500);
+ root_child1_child0.setHeight(300);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child1_child1 = Yoga.Node.create(config);
+ root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
+ root_child1_child1.setWidth(500);
+ root_child1_child1.setHeight(400);
+ root_child1_child1.setIsReferenceBaseline(true);
+ root_child1.insertChild(root_child1_child1, 1);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(500);
+ expect(root_child1.getComputedTop()).toBe(0);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(0);
+ expect(root_child1_child1.getComputedTop()).toBe(300);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+
+test("align_baseline_parent_using_child_in_row_as_reference", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(1000);
+ root.setHeight(1000);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
+ root_child0.setWidth(500);
+ root_child0.setHeight(600);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child1.setWidth(500);
+ root_child1.setHeight(800);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
+ root_child1_child0.setWidth(500);
+ root_child1_child0.setHeight(500);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child1_child1 = Yoga.Node.create(config);
+ root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
+ root_child1_child1.setWidth(500);
+ root_child1_child1.setHeight(400);
+ root_child1_child1.setIsReferenceBaseline(true);
+ root_child1.insertChild(root_child1_child1, 1);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(500);
+ expect(root_child1.getComputedTop()).toBe(200);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(500);
+ expect(root_child1_child1.getComputedTop()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/YGComputedBorderTest.test.js b/javascript/tests/YGComputedBorderTest.test.js
new file mode 100644
index 00000000..60445800
--- /dev/null
+++ b/javascript/tests/YGComputedBorderTest.test.js
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+test("border_start", () => {
+ const root = Yoga.Node.create();
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setBorder(Yoga.EDGE_START, 10);
+
+ root.calculateLayout(100, 100, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedBorder(Yoga.EDGE_LEFT)).toBe(10);
+ expect(root.getComputedBorder(Yoga.EDGE_RIGHT)).toBe(0);
+
+ root.calculateLayout(100, 100, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedBorder(Yoga.EDGE_LEFT)).toBe(0);
+ expect(root.getComputedBorder(Yoga.EDGE_RIGHT)).toBe(10);
+
+ root.freeRecursive();
+});
diff --git a/javascript/tests/YGComputedMarginTest.test.js b/javascript/tests/YGComputedMarginTest.test.js
new file mode 100644
index 00000000..a2e54a42
--- /dev/null
+++ b/javascript/tests/YGComputedMarginTest.test.js
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+test("margin_start", () => {
+ const root = Yoga.Node.create();
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setMargin(Yoga.EDGE_START, `10%`);
+
+ root.calculateLayout(100, 100, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedMargin(Yoga.EDGE_LEFT)).toBe(10);
+ expect(root.getComputedMargin(Yoga.EDGE_RIGHT)).toBe(0);
+
+ root.calculateLayout(100, 100, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedMargin(Yoga.EDGE_LEFT)).toBe(0);
+ expect(root.getComputedMargin(Yoga.EDGE_RIGHT)).toBe(10);
+
+ root.freeRecursive();
+});
diff --git a/javascript/tests/YGComputedPaddingTest.test.js b/javascript/tests/YGComputedPaddingTest.test.js
new file mode 100644
index 00000000..cb538697
--- /dev/null
+++ b/javascript/tests/YGComputedPaddingTest.test.js
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+test("padding_start", () => {
+ const root = Yoga.Node.create();
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setPadding(Yoga.EDGE_START, `10%`);
+
+ root.calculateLayout(100, 100, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedPadding(Yoga.EDGE_LEFT)).toBe(10);
+ expect(root.getComputedPadding(Yoga.EDGE_RIGHT)).toBe(0);
+
+ root.calculateLayout(100, 100, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedPadding(Yoga.EDGE_LEFT)).toBe(0);
+ expect(root.getComputedPadding(Yoga.EDGE_RIGHT)).toBe(10);
+
+ root.freeRecursive();
+});
diff --git a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js b/javascript/tests/YGDirtiedTest.test.js
similarity index 53%
rename from javascript/tests/Facebook.Yoga/YGDirtiedTest.js
rename to javascript/tests/YGDirtiedTest.test.js
index fcfb305b..befcc0e3 100644
--- a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js
+++ b/javascript/tests/YGDirtiedTest.test.js
@@ -5,10 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("dirtied", function() {
- var root = Yoga.Node.create();
+test("dirtied", () => {
+ const root = Yoga.Node.create();
root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100);
root.setHeight(100);
@@ -16,41 +14,39 @@ it("dirtied", function() {
root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
let dirtied = 0;
- root.setDirtiedFunc(function() { dirtied++; });
+ root.setDirtiedFunc(() => {
+ dirtied++;
+ });
// only nodes with a measure function can be marked dirty
- root.setMeasureFunc(function() {});
+ root.setMeasureFunc(() => {});
- console.assert(0 === dirtied, "0 === dirtied");
+ expect(dirtied).toBe(0);
// dirtied func MUST be called in case of explicit dirtying.
root.markDirty();
- console.assert(1 === dirtied, "1 === dirtied");
+ expect(dirtied).toBe(1);
// dirtied func MUST be called ONCE.
root.markDirty();
- console.assert(1 === dirtied, "1 === dirtied");
+ expect(dirtied).toBe(1);
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- typeof gc !== "undefined" && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
+ root.freeRecursive();
});
-it("dirtied_propagation", function() {
- var root = Yoga.Node.create();
+test("dirtied_propagation", () => {
+ const root = Yoga.Node.create();
root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100);
root.setHeight(100);
- var root_child0 = Yoga.Node.create();
+ const root_child0 = Yoga.Node.create();
root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
root_child0.setWidth(50);
root_child0.setHeight(20);
- root_child0.setMeasureFunc(function() {});
+ root_child0.setMeasureFunc(() => {});
root.insertChild(root_child0, 0);
- var root_child1 = Yoga.Node.create();
+ const root_child1 = Yoga.Node.create();
root_child1.setAlignItems(Yoga.ALIGN_FLEX_START);
root_child1.setWidth(50);
root_child1.setHeight(20);
@@ -59,91 +55,85 @@ it("dirtied_propagation", function() {
root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
let dirtied = 0;
- root.setDirtiedFunc(function() { dirtied++; });
-
- console.assert(0 === dirtied, "0 === dirtied");
-
- // dirtied func MUST be called for the first time.
- root_child0.markDirty();
- console.assert(1 === dirtied, "1 === dirtied");
-
- // dirtied func must NOT be called for the second time.
- root_child0.markDirty();
- console.assert(1 === dirtied, "1 === dirtied");
-
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- typeof gc !== "undefined" && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
-});
-
-it("dirtied_hierarchy", function() {
- var root = Yoga.Node.create();
- root.setAlignItems(Yoga.ALIGN_FLEX_START);
- root.setWidth(100);
- root.setHeight(100);
-
- var root_child0 = Yoga.Node.create();
- root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
- root_child0.setWidth(50);
- root_child0.setHeight(20);
- root_child0.setMeasureFunc(function() {});
- root.insertChild(root_child0, 0);
-
- var root_child1 = Yoga.Node.create();
- root_child1.setAlignItems(Yoga.ALIGN_FLEX_START);
- root_child1.setWidth(50);
- root_child1.setHeight(20);
- root_child1.setMeasureFunc(function() {});
- root.insertChild(root_child1, 0);
-
- root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
-
- let dirtied = 0;
- root_child0.setDirtiedFunc(function() {
+ root.setDirtiedFunc(() => {
dirtied++;
});
- console.assert(0 === dirtied, "0 === dirtied");
+ expect(dirtied).toBe(0);
+
+ // dirtied func MUST be called for the first time.
+ root_child0.markDirty();
+ expect(dirtied).toBe(1);
+
+ // dirtied func must NOT be called for the second time.
+ root_child0.markDirty();
+ expect(dirtied).toBe(1);
+
+ root.freeRecursive();
+});
+
+test("dirtied_hierarchy", () => {
+ const root = Yoga.Node.create();
+ root.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create();
+ root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root_child0.setWidth(50);
+ root_child0.setHeight(20);
+ root_child0.setMeasureFunc(() => {});
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create();
+ root_child1.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root_child1.setMeasureFunc(() => {});
+ root.insertChild(root_child1, 0);
+
+ root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
+
+ let dirtied = 0;
+ root_child0.setDirtiedFunc(() => {
+ dirtied++;
+ });
+
+ expect(dirtied).toBe(0);
// dirtied func must NOT be called for descendants.
// NOTE: nodes without a measure function cannot be marked dirty manually,
// but nodes with a measure function can not have children.
// Update the width to dirty the node instead.
root.setWidth(110);
- console.assert(0 === dirtied, "0 === dirtied");
+ expect(dirtied).toBe(0);
// dirtied func MUST be called in case of explicit dirtying.
root_child0.markDirty();
- console.assert(1 === dirtied, "1 === dirtied");
+ expect(dirtied).toBe(1);
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- typeof gc !== "undefined" && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
+ root.freeRecursive();
});
-it("dirtied_reset", function() {
- var root = Yoga.Node.create();
+test("dirtied_reset", () => {
+ const root = Yoga.Node.create();
root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100);
root.setHeight(100);
- root.setMeasureFunc(function() {});
+ root.setMeasureFunc(() => {});
root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
let dirtied = 0;
- root.setDirtiedFunc(function() {
+ root.setDirtiedFunc(() => {
dirtied++;
});
- console.assert(0 === dirtied, "0 === dirtied");
+ expect(dirtied).toBe(0);
// dirtied func MUST be called in case of explicit dirtying.
root.markDirty();
- console.assert(1 === dirtied, "1 === dirtied");
+ expect(dirtied).toBe(1);
// recalculate so the root is no longer dirty
root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
@@ -152,17 +142,13 @@ it("dirtied_reset", function() {
root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100);
root.setHeight(100);
- root.setMeasureFunc(function() {});
+ root.setMeasureFunc(() => {});
root.markDirty();
// dirtied func must NOT be called after reset.
root.markDirty();
- console.assert(1 === dirtied, "1 === dirtied");
+ expect(dirtied).toBe(1);
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- typeof gc !== "undefined" && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
+ root.freeRecursive();
});
diff --git a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js b/javascript/tests/YGMeasureCacheTest.test.js
similarity index 50%
rename from javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js
rename to javascript/tests/YGMeasureCacheTest.test.js
index a14dee88..08c4e485 100644
--- a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js
+++ b/javascript/tests/YGMeasureCacheTest.test.js
@@ -5,29 +5,23 @@
* LICENSE file in the root directory of this source tree.
*/
-var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
-
-it("measure_once_single_flexible_child", function () {
- var root = Yoga.Node.create();
+test("measure_once_single_flexible_child", () => {
+ const root = Yoga.Node.create();
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
root.setAlignItems(Yoga.ALIGN_FLEX_START);
root.setWidth(100);
root.setHeight(100);
- var measureCounter = getMeasureCounterMax(Yoga);
+ const measureCounter = getMeasureCounterMax(Yoga);
- var root_child0 = Yoga.Node.create();
+ const root_child0 = Yoga.Node.create();
root_child0.setMeasureFunc(measureCounter.inc);
root_child0.setFlexGrow(1);
root.insertChild(root_child0, 0);
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
- console.assert(1 === measureCounter.get(), "1 === measureCounter.get()");
+ expect(measureCounter.get()).toBe(1);
- if (typeof root !== "undefined")
- root.freeRecursive();
-
- (typeof gc !== "undefined") && gc();
- // TODO Add event support in js and check instace allocation and de allocation using that
+ root.freeRecursive();
});
diff --git a/javascript/tests/YGMeasureTest.test.js b/javascript/tests/YGMeasureTest.test.js
new file mode 100644
index 00000000..d222af6f
--- /dev/null
+++ b/javascript/tests/YGMeasureTest.test.js
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+test("dont_measure_single_grow_shrink_child", () => {
+ const root = Yoga.Node.create();
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const measureCounter = getMeasureCounter(Yoga, null, 100, 100);
+
+ const root_child0 = Yoga.Node.create();
+ root_child0.setMeasureFunc(measureCounter.inc);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(measureCounter.get()).toBe(0);
+
+ root.freeRecursive();
+});
diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js
new file mode 100644
index 00000000..7cd75cc1
--- /dev/null
+++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js
@@ -0,0 +1,1113 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html
+
+test("absolute_layout_width_height_start_top", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_START, 10);
+ root_child0.setPosition(Yoga.EDGE_TOP, 10);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_width_height_end_bottom", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_END, 10);
+ root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_start_top_end_bottom", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_START, 10);
+ root_child0.setPosition(Yoga.EDGE_TOP, 10);
+ root_child0.setPosition(Yoga.EDGE_END, 10);
+ root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_width_height_start_top_end_bottom", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_START, 10);
+ root_child0.setPosition(Yoga.EDGE_TOP, 10);
+ root_child0.setPosition(Yoga.EDGE_END, 10);
+ root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setOverflow(Yoga.OVERFLOW_HIDDEN);
+ root.setWidth(50);
+ root.setHeight(50);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_START, 0);
+ root_child0.setPosition(Yoga.EDGE_TOP, 0);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(100);
+ root_child0_child0.setHeight(100);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(-50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_within_border", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setMargin(Yoga.EDGE_LEFT, 10);
+ root.setMargin(Yoga.EDGE_TOP, 10);
+ root.setMargin(Yoga.EDGE_RIGHT, 10);
+ root.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root.setPadding(Yoga.EDGE_LEFT, 10);
+ root.setPadding(Yoga.EDGE_TOP, 10);
+ root.setPadding(Yoga.EDGE_RIGHT, 10);
+ root.setPadding(Yoga.EDGE_BOTTOM, 10);
+ root.setBorder(Yoga.EDGE_LEFT, 10);
+ root.setBorder(Yoga.EDGE_TOP, 10);
+ root.setBorder(Yoga.EDGE_RIGHT, 10);
+ root.setBorder(Yoga.EDGE_BOTTOM, 10);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_LEFT, 0);
+ root_child0.setPosition(Yoga.EDGE_TOP, 0);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child1.setPosition(Yoga.EDGE_RIGHT, 0);
+ root_child1.setPosition(Yoga.EDGE_BOTTOM, 0);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child2.setPosition(Yoga.EDGE_LEFT, 0);
+ root_child2.setPosition(Yoga.EDGE_TOP, 0);
+ root_child2.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child2.setMargin(Yoga.EDGE_TOP, 10);
+ root_child2.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child2.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root_child2.setWidth(50);
+ root_child2.setHeight(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child3.setPosition(Yoga.EDGE_RIGHT, 0);
+ root_child3.setPosition(Yoga.EDGE_BOTTOM, 0);
+ root_child3.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child3.setMargin(Yoga.EDGE_TOP, 10);
+ root_child3.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child3.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root_child3.setWidth(50);
+ root_child3.setHeight(50);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(10);
+ expect(root.getComputedTop()).toBe(10);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(30);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(10);
+ expect(root.getComputedTop()).toBe(10);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(30);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_and_justify_content_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_and_justify_content_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
+ root.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(60);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(60);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_justify_content_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_center_on_child_only", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_CENTER);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_and_justify_content_center_and_top_position", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_TOP, 10);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_BOTTOM, 10);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_and_justify_content_center_and_left_position", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_LEFT, 5);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(5);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(5);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_align_items_and_justify_content_center_and_right_position", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexGrow(1);
+ root.setWidth(110);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_RIGHT, 5);
+ root_child0.setWidth(60);
+ root_child0.setHeight(40);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(110);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("position_root_with_rtl_should_position_withoutdirection", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setPosition(Yoga.EDGE_LEFT, 72);
+ root.setWidth(52);
+ root.setHeight(52);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(72);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(72);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_percentage_bottom_based_on_parent_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_TOP, "50%");
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child1.setPosition(Yoga.EDGE_BOTTOM, "50%");
+ root_child1.setWidth(10);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child2.setPosition(Yoga.EDGE_TOP, "10%");
+ root_child2.setPosition(Yoga.EDGE_BOTTOM, "10%");
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(100);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(90);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(160);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(100);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(90);
+ expect(root_child1.getComputedTop()).toBe(90);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(90);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(160);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_in_wrap_reverse_column_container", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_in_wrap_reverse_row_container", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.js
new file mode 100644
index 00000000..bd3ec73e
--- /dev/null
+++ b/javascript/tests/generated/YGAlignContentTest.test.js
@@ -0,0 +1,1952 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html
+
+test("align_content_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(130);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(10);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root_child4.setHeight(10);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(130);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(10);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(20);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(130);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(80);
+ expect(root_child2.getComputedTop()).toBe(10);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(30);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(80);
+ expect(root_child4.getComputedTop()).toBe(20);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_flex_start_without_height_on_children", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(10);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(10);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(20);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(10);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(20);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_flex_start_with_flex", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(120);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("0%");
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setWidth(50);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setFlexGrow(1);
+ root_child3.setFlexShrink(1);
+ root_child3.setFlexBasis("0%");
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(120);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(40);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(120);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(120);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(40);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(120);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignContent(Yoga.ALIGN_FLEX_END);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(10);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root_child4.setHeight(10);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(40);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(40);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(0);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(100);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(0);
+
+ expect(root_child4.getComputedLeft()).toBe(100);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_spacebetween", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(130);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(10);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root_child4.setHeight(10);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(130);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(45);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(45);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(90);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(130);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(80);
+ expect(root_child2.getComputedTop()).toBe(45);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(30);
+ expect(root_child3.getComputedTop()).toBe(45);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(80);
+ expect(root_child4.getComputedTop()).toBe(90);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_spacearound", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_SPACE_AROUND);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(140);
+ root.setHeight(120);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(10);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root_child4.setHeight(10);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(140);
+ expect(root.getComputedHeight()).toBe(120);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(15);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(15);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(55);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(55);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(95);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(140);
+ expect(root.getComputedHeight()).toBe(120);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(15);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(15);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(90);
+ expect(root_child2.getComputedTop()).toBe(55);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(40);
+ expect(root_child3.getComputedTop()).toBe(55);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(90);
+ expect(root_child4.getComputedTop()).toBe(95);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_children", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0_child0.setFlexBasis("0%");
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_flex", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setFlexGrow(1);
+ root_child3.setFlexShrink(1);
+ root_child3.setFlexBasis("0%");
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(0);
+ expect(root_child3.getComputedHeight()).toBe(100);
+
+ expect(root_child4.getComputedLeft()).toBe(100);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(100);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(0);
+ expect(root_child3.getComputedHeight()).toBe(100);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_flex_no_shrink", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setFlexGrow(1);
+ root_child3.setFlexBasis("0%");
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(0);
+ expect(root_child3.getComputedHeight()).toBe(100);
+
+ expect(root_child4.getComputedLeft()).toBe(100);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(100);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(0);
+ expect(root_child3.getComputedHeight()).toBe(100);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child1.setMargin(Yoga.EDGE_TOP, 10);
+ root_child1.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child1.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child3.setMargin(Yoga.EDGE_TOP, 10);
+ root_child3.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child3.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child1.getComputedLeft()).toBe(60);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(40);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(40);
+
+ expect(root_child3.getComputedLeft()).toBe(60);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(40);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(40);
+
+ expect(root_child3.getComputedLeft()).toBe(40);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(100);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_padding", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setPadding(Yoga.EDGE_LEFT, 10);
+ root_child1.setPadding(Yoga.EDGE_TOP, 10);
+ root_child1.setPadding(Yoga.EDGE_RIGHT, 10);
+ root_child1.setPadding(Yoga.EDGE_BOTTOM, 10);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setPadding(Yoga.EDGE_LEFT, 10);
+ root_child3.setPadding(Yoga.EDGE_TOP, 10);
+ root_child3.setPadding(Yoga.EDGE_RIGHT, 10);
+ root_child3.setPadding(Yoga.EDGE_BOTTOM, 10);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_single_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_fixed_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(60);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(60);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(80);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(60);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(80);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_max_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setMaxHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(50);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(50);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_row_with_min_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setMinHeight(80);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(90);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(90);
+
+ expect(root_child2.getComputedLeft()).toBe(100);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(90);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(90);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(90);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(90);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(90);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(90);
+
+ expect(root_child3.getComputedLeft()).toBe(100);
+ expect(root_child3.getComputedTop()).toBe(90);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(10);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(90);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(150);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0_child0.setFlexBasis("0%");
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(50);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setHeight(50);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setHeight(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(150);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(100);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(150);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(100);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(50);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_content_stretch_is_not_overriding_align_items", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0.setAlignItems(Yoga.ALIGN_CENTER);
+ root_child0.setWidth(100);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0.setWidth(10);
+ root_child0_child0.setHeight(10);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(45);
+ expect(root_child0_child0.getComputedWidth()).toBe(10);
+ expect(root_child0_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(90);
+ expect(root_child0_child0.getComputedTop()).toBe(45);
+ expect(root_child0_child0.getComputedWidth()).toBe(10);
+ expect(root_child0_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js
new file mode 100644
index 00000000..4f27c016
--- /dev/null
+++ b/javascript/tests/generated/YGAlignItemsTest.test.js
@@ -0,0 +1,2268 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html
+
+test("align_items_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child_multiline", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(60);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child1.setFlexWrap(Yoga.WRAP_WRAP);
+ root_child1.setWidth(50);
+ root_child1.setHeight(25);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(25);
+ root_child1_child0.setHeight(20);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child1_child1 = Yoga.Node.create(config);
+ root_child1_child1.setWidth(25);
+ root_child1_child1.setHeight(10);
+ root_child1.insertChild(root_child1_child1, 1);
+
+ const root_child1_child2 = Yoga.Node.create(config);
+ root_child1_child2.setWidth(25);
+ root_child1_child2.setHeight(20);
+ root_child1.insertChild(root_child1_child2, 2);
+
+ const root_child1_child3 = Yoga.Node.create(config);
+ root_child1_child3.setWidth(25);
+ root_child1_child3.setHeight(10);
+ root_child1.insertChild(root_child1_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(25);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(25);
+ expect(root_child1_child1.getComputedTop()).toBe(0);
+ expect(root_child1_child1.getComputedWidth()).toBe(25);
+ expect(root_child1_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(0);
+ expect(root_child1_child2.getComputedTop()).toBe(20);
+ expect(root_child1_child2.getComputedWidth()).toBe(25);
+ expect(root_child1_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child3.getComputedLeft()).toBe(25);
+ expect(root_child1_child3.getComputedTop()).toBe(20);
+ expect(root_child1_child3.getComputedWidth()).toBe(25);
+ expect(root_child1_child3.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(25);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(25);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(0);
+ expect(root_child1_child1.getComputedTop()).toBe(0);
+ expect(root_child1_child1.getComputedWidth()).toBe(25);
+ expect(root_child1_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(25);
+ expect(root_child1_child2.getComputedTop()).toBe(20);
+ expect(root_child1_child2.getComputedWidth()).toBe(25);
+ expect(root_child1_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child3.getComputedLeft()).toBe(0);
+ expect(root_child1_child3.getComputedTop()).toBe(20);
+ expect(root_child1_child3.getComputedWidth()).toBe(25);
+ expect(root_child1_child3.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child_multiline_override", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(60);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child1.setFlexWrap(Yoga.WRAP_WRAP);
+ root_child1.setWidth(50);
+ root_child1.setHeight(25);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(25);
+ root_child1_child0.setHeight(20);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child1_child1 = Yoga.Node.create(config);
+ root_child1_child1.setAlignSelf(Yoga.ALIGN_BASELINE);
+ root_child1_child1.setWidth(25);
+ root_child1_child1.setHeight(10);
+ root_child1.insertChild(root_child1_child1, 1);
+
+ const root_child1_child2 = Yoga.Node.create(config);
+ root_child1_child2.setWidth(25);
+ root_child1_child2.setHeight(20);
+ root_child1.insertChild(root_child1_child2, 2);
+
+ const root_child1_child3 = Yoga.Node.create(config);
+ root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE);
+ root_child1_child3.setWidth(25);
+ root_child1_child3.setHeight(10);
+ root_child1.insertChild(root_child1_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(25);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(25);
+ expect(root_child1_child1.getComputedTop()).toBe(0);
+ expect(root_child1_child1.getComputedWidth()).toBe(25);
+ expect(root_child1_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(0);
+ expect(root_child1_child2.getComputedTop()).toBe(20);
+ expect(root_child1_child2.getComputedWidth()).toBe(25);
+ expect(root_child1_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child3.getComputedLeft()).toBe(25);
+ expect(root_child1_child3.getComputedTop()).toBe(20);
+ expect(root_child1_child3.getComputedWidth()).toBe(25);
+ expect(root_child1_child3.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(25);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(25);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(0);
+ expect(root_child1_child1.getComputedTop()).toBe(0);
+ expect(root_child1_child1.getComputedWidth()).toBe(25);
+ expect(root_child1_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(25);
+ expect(root_child1_child2.getComputedTop()).toBe(20);
+ expect(root_child1_child2.getComputedWidth()).toBe(25);
+ expect(root_child1_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child3.getComputedLeft()).toBe(0);
+ expect(root_child1_child3.getComputedTop()).toBe(20);
+ expect(root_child1_child3.getComputedWidth()).toBe(25);
+ expect(root_child1_child3.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child_multiline_no_override_on_secondline", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(60);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child1.setFlexWrap(Yoga.WRAP_WRAP);
+ root_child1.setWidth(50);
+ root_child1.setHeight(25);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(25);
+ root_child1_child0.setHeight(20);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child1_child1 = Yoga.Node.create(config);
+ root_child1_child1.setWidth(25);
+ root_child1_child1.setHeight(10);
+ root_child1.insertChild(root_child1_child1, 1);
+
+ const root_child1_child2 = Yoga.Node.create(config);
+ root_child1_child2.setWidth(25);
+ root_child1_child2.setHeight(20);
+ root_child1.insertChild(root_child1_child2, 2);
+
+ const root_child1_child3 = Yoga.Node.create(config);
+ root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE);
+ root_child1_child3.setWidth(25);
+ root_child1_child3.setHeight(10);
+ root_child1.insertChild(root_child1_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(25);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(25);
+ expect(root_child1_child1.getComputedTop()).toBe(0);
+ expect(root_child1_child1.getComputedWidth()).toBe(25);
+ expect(root_child1_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(0);
+ expect(root_child1_child2.getComputedTop()).toBe(20);
+ expect(root_child1_child2.getComputedWidth()).toBe(25);
+ expect(root_child1_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child3.getComputedLeft()).toBe(25);
+ expect(root_child1_child3.getComputedTop()).toBe(20);
+ expect(root_child1_child3.getComputedWidth()).toBe(25);
+ expect(root_child1_child3.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(25);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(25);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(0);
+ expect(root_child1_child1.getComputedTop()).toBe(0);
+ expect(root_child1_child1.getComputedWidth()).toBe(25);
+ expect(root_child1_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(25);
+ expect(root_child1_child2.getComputedTop()).toBe(20);
+ expect(root_child1_child2.getComputedWidth()).toBe(25);
+ expect(root_child1_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child3.getComputedLeft()).toBe(0);
+ expect(root_child1_child3.getComputedTop()).toBe(20);
+ expect(root_child1_child3.getComputedWidth()).toBe(25);
+ expect(root_child1_child3.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child_top", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPosition(Yoga.EDGE_TOP, 10);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child_top2", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setPosition(Yoga.EDGE_TOP, 5);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(45);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(45);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_double_nested_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(50);
+ root_child0_child0.setHeight(20);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(15);
+ root_child1.insertChild(root_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(5);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(15);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(5);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(15);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, 5);
+ root_child0.setMargin(Yoga.EDGE_TOP, 5);
+ root_child0.setMargin(Yoga.EDGE_RIGHT, 5);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 5);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setMargin(Yoga.EDGE_LEFT, 1);
+ root_child1_child0.setMargin(Yoga.EDGE_TOP, 1);
+ root_child1_child0.setMargin(Yoga.EDGE_RIGHT, 1);
+ root_child1_child0.setMargin(Yoga.EDGE_BOTTOM, 1);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(5);
+ expect(root_child0.getComputedTop()).toBe(5);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(60);
+ expect(root_child1.getComputedTop()).toBe(44);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(1);
+ expect(root_child1_child0.getComputedTop()).toBe(1);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(5);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(-10);
+ expect(root_child1.getComputedTop()).toBe(44);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(-1);
+ expect(root_child1_child0.getComputedTop()).toBe(1);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_child_padding", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setPadding(Yoga.EDGE_LEFT, 5);
+ root.setPadding(Yoga.EDGE_TOP, 5);
+ root.setPadding(Yoga.EDGE_RIGHT, 5);
+ root.setPadding(Yoga.EDGE_BOTTOM, 5);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setPadding(Yoga.EDGE_LEFT, 5);
+ root_child1.setPadding(Yoga.EDGE_TOP, 5);
+ root_child1.setPadding(Yoga.EDGE_RIGHT, 5);
+ root_child1.setPadding(Yoga.EDGE_BOTTOM, 5);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(5);
+ expect(root_child0.getComputedTop()).toBe(5);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(55);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(5);
+ expect(root_child1_child0.getComputedTop()).toBe(5);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(5);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(-5);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(-5);
+ expect(root_child1_child0.getComputedTop()).toBe(5);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_multiline", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child2_child0 = Yoga.Node.create(config);
+ root_child2_child0.setWidth(50);
+ root_child2_child0.setHeight(10);
+ root_child2.insertChild(root_child2_child0, 0);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(50);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(100);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(0);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(50);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(60);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(100);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(0);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(50);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(60);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_multiline_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(20);
+ root_child1_child0.setHeight(20);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(40);
+ root_child2.setHeight(70);
+ root.insertChild(root_child2, 2);
+
+ const root_child2_child0 = Yoga.Node.create(config);
+ root_child2_child0.setWidth(10);
+ root_child2_child0.setHeight(10);
+ root_child2.insertChild(root_child2_child0, 0);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(20);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(40);
+ expect(root_child2.getComputedHeight()).toBe(70);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(0);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(10);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(70);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(70);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(10);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(20);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(40);
+ expect(root_child2.getComputedHeight()).toBe(70);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(30);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(10);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(70);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_multiline_column2", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(20);
+ root_child1_child0.setHeight(20);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(40);
+ root_child2.setHeight(70);
+ root.insertChild(root_child2, 2);
+
+ const root_child2_child0 = Yoga.Node.create(config);
+ root_child2_child0.setWidth(10);
+ root_child2_child0.setHeight(10);
+ root_child2.insertChild(root_child2_child0, 0);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(20);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(40);
+ expect(root_child2.getComputedHeight()).toBe(70);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(0);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(10);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(70);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(70);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(10);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(20);
+ expect(root_child1_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(40);
+ expect(root_child2.getComputedHeight()).toBe(70);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(30);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(10);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(70);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_baseline_multiline_row_and_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_BASELINE);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child2_child0 = Yoga.Node.create(config);
+ root_child2_child0.setWidth(50);
+ root_child2_child0.setHeight(10);
+ root_child2.insertChild(root_child2_child0, 0);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(50);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(100);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(0);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(50);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(50);
+ expect(root_child3.getComputedTop()).toBe(90);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(100);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child2_child0.getComputedLeft()).toBe(0);
+ expect(root_child2_child0.getComputedTop()).toBe(0);
+ expect(root_child2_child0.getComputedWidth()).toBe(50);
+ expect(root_child2_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(90);
+ expect(root_child3.getComputedWidth()).toBe(50);
+ expect(root_child3.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_center_child_with_margin_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignItems(Yoga.ALIGN_CENTER);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child0_child0.setWidth(52);
+ root_child0_child0.setHeight(52);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(52);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(10);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(52);
+ expect(root_child0_child0.getComputedHeight()).toBe(52);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(52);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(10);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(52);
+ expect(root_child0_child0.getComputedHeight()).toBe(52);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_flex_end_child_with_margin_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child0_child0.setWidth(52);
+ root_child0_child0.setHeight(52);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(52);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(10);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(52);
+ expect(root_child0_child0.getComputedHeight()).toBe(52);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(52);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(10);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(52);
+ expect(root_child0_child0.getComputedHeight()).toBe(52);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_center_child_without_margin_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignItems(Yoga.ALIGN_CENTER);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(72);
+ root_child0_child0.setHeight(72);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0.getComputedHeight()).toBe(72);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0.getComputedHeight()).toBe(72);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_flex_end_child_without_margin_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(72);
+ root_child0_child0.setHeight(72);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0.getComputedHeight()).toBe(72);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-10);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0.getComputedHeight()).toBe(72);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_center_should_size_based_on_content", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setMargin(Yoga.EDGE_TOP, 20);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root_child0.setFlexShrink(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setWidth(20);
+ root_child0_child0_child0.setHeight(20);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(20);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(40);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(20);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(20);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(20);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(40);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(20);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(20);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_stretch_should_size_based_on_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setMargin(Yoga.EDGE_TOP, 20);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root_child0.setFlexShrink(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setWidth(20);
+ root_child0_child0_child0.setHeight(20);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(20);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(20);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(20);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(80);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(20);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_flex_start_with_shrinking_children", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setFlexGrow(1);
+ root_child0_child0_child0.setFlexShrink(1);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(500);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(500);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(500);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_flex_start_with_stretching_children", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setFlexGrow(1);
+ root_child0_child0_child0.setFlexShrink(1);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(500);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(500);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(500);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(500);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(500);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(500);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_flex_start_with_shrinking_children_with_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setFlexGrow(1);
+ root_child0_child0_child0.setFlexShrink(1);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(500);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(500);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(500);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js
new file mode 100644
index 00000000..b8f1db3f
--- /dev/null
+++ b/javascript/tests/generated/YGAlignSelfTest.test.js
@@ -0,0 +1,267 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html
+
+test("align_self_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_CENTER);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_self_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_self_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_FLEX_START);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_self_flex_end_override_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_self_baseline", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setAlignSelf(Yoga.ALIGN_BASELINE);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setAlignSelf(Yoga.ALIGN_BASELINE);
+ root_child1.setWidth(50);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth(50);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(50);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js
new file mode 100644
index 00000000..c198cae1
--- /dev/null
+++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js
@@ -0,0 +1,293 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
+
+test("android_news_feed", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setWidth(1080);
+
+ const root_child0 = Yoga.Node.create(config);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+
+ const root_child0_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root_child0_child0_child0_child0.setMargin(Yoga.EDGE_START, 36);
+ root_child0_child0_child0_child0.setMargin(Yoga.EDGE_TOP, 24);
+ root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0);
+
+ const root_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0);
+
+ const root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0_child0_child0_child0.setWidth(120);
+ root_child0_child0_child0_child0_child0_child0.setHeight(120);
+ root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0);
+
+ const root_child0_child0_child0_child0_child1 = Yoga.Node.create(config);
+ root_child0_child0_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0_child0_child1.setFlexShrink(1);
+ root_child0_child0_child0_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
+ root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_LEFT, 36);
+ root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_TOP, 21);
+ root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36);
+ root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
+ root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child1, 1);
+
+ const root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0_child0_child1_child0.setFlexShrink(1);
+ root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0);
+
+ const root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config);
+ root_child0_child0_child0_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0_child0_child1_child1.setFlexShrink(1);
+ root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1);
+
+ const root_child0_child0_child1 = Yoga.Node.create(config);
+ root_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0.insertChild(root_child0_child0_child1, 1);
+
+ const root_child0_child0_child1_child0 = Yoga.Node.create(config);
+ root_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child1_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root_child0_child0_child1_child0.setMargin(Yoga.EDGE_START, 174);
+ root_child0_child0_child1_child0.setMargin(Yoga.EDGE_TOP, 24);
+ root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0);
+
+ const root_child0_child0_child1_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child1_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child1_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0);
+
+ const root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child1_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child1_child0_child0_child0.setWidth(72);
+ root_child0_child0_child1_child0_child0_child0.setHeight(72);
+ root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0);
+
+ const root_child0_child0_child1_child0_child1 = Yoga.Node.create(config);
+ root_child0_child0_child1_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child1_child0_child1.setFlexShrink(1);
+ root_child0_child0_child1_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
+ root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_LEFT, 36);
+ root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_TOP, 21);
+ root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36);
+ root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
+ root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child1, 1);
+
+ const root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config);
+ root_child0_child0_child1_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child1_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child1_child0_child1_child0.setFlexShrink(1);
+ root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0);
+
+ const root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config);
+ root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child1_child0_child1_child1.setFlexShrink(1);
+ root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(1080);
+ expect(root.getComputedHeight()).toBe(240);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0.getComputedHeight()).toBe(240);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0_child0.getComputedHeight()).toBe(240);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(144);
+
+ expect(root_child0_child0_child0_child0.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child0_child0.getComputedTop()).toBe(24);
+ expect(root_child0_child0_child0_child0.getComputedWidth()).toBe(1044);
+ expect(root_child0_child0_child0_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
+ expect(root_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child0_child0_child0_child0_child1.getComputedLeft()).toBe(120);
+ expect(root_child0_child0_child0_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0_child0_child1.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child0_child0_child1.getComputedHeight()).toBe(39);
+
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child1.getComputedTop()).toBe(144);
+ expect(root_child0_child0_child1.getComputedWidth()).toBe(1080);
+ expect(root_child0_child0_child1.getComputedHeight()).toBe(96);
+
+ expect(root_child0_child0_child1_child0.getComputedLeft()).toBe(174);
+ expect(root_child0_child0_child1_child0.getComputedTop()).toBe(24);
+ expect(root_child0_child0_child1_child0.getComputedWidth()).toBe(906);
+ expect(root_child0_child0_child1_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0_child1_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child1_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child1_child0_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0_child1_child0_child1.getComputedLeft()).toBe(72);
+ expect(root_child0_child0_child1_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1_child0_child1.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child1_child0_child1.getComputedHeight()).toBe(39);
+
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(1080);
+ expect(root.getComputedHeight()).toBe(240);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0.getComputedHeight()).toBe(240);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0_child0.getComputedHeight()).toBe(240);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(144);
+
+ expect(root_child0_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0_child0.getComputedTop()).toBe(24);
+ expect(root_child0_child0_child0_child0.getComputedWidth()).toBe(1044);
+ expect(root_child0_child0_child0_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child0_child0_child0_child0_child0.getComputedLeft()).toBe(924);
+ expect(root_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
+ expect(root_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120);
+ expect(root_child0_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child0_child0_child0_child0_child1.getComputedLeft()).toBe(816);
+ expect(root_child0_child0_child0_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0_child0_child1.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child0_child0_child1.getComputedHeight()).toBe(39);
+
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0_child0_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child0_child0_child1_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child1.getComputedTop()).toBe(144);
+ expect(root_child0_child0_child1.getComputedWidth()).toBe(1080);
+ expect(root_child0_child0_child1.getComputedHeight()).toBe(96);
+
+ expect(root_child0_child0_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child1_child0.getComputedTop()).toBe(24);
+ expect(root_child0_child0_child1_child0.getComputedWidth()).toBe(906);
+ expect(root_child0_child0_child1_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0_child1_child0_child0.getComputedLeft()).toBe(834);
+ expect(root_child0_child0_child1_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child1_child0_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child1_child0_child0_child0.getComputedHeight()).toBe(72);
+
+ expect(root_child0_child0_child1_child0_child1.getComputedLeft()).toBe(726);
+ expect(root_child0_child0_child1_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1_child0_child1.getComputedWidth()).toBe(72);
+ expect(root_child0_child0_child1_child0_child1.getComputedHeight()).toBe(39);
+
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child1_child0_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedLeft()).toBe(36);
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedTop()).toBe(21);
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0);
+ expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js
new file mode 100644
index 00000000..edd8aab8
--- /dev/null
+++ b/javascript/tests/generated/YGBorderTest.test.js
@@ -0,0 +1,230 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html
+
+test("border_no_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setBorder(Yoga.EDGE_LEFT, 10);
+ root.setBorder(Yoga.EDGE_TOP, 10);
+ root.setBorder(Yoga.EDGE_RIGHT, 10);
+ root.setBorder(Yoga.EDGE_BOTTOM, 10);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("border_container_match_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setBorder(Yoga.EDGE_LEFT, 10);
+ root.setBorder(Yoga.EDGE_TOP, 10);
+ root.setBorder(Yoga.EDGE_RIGHT, 10);
+ root.setBorder(Yoga.EDGE_BOTTOM, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(30);
+ expect(root.getComputedHeight()).toBe(30);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(30);
+ expect(root.getComputedHeight()).toBe(30);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("border_flex_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setBorder(Yoga.EDGE_LEFT, 10);
+ root.setBorder(Yoga.EDGE_TOP, 10);
+ root.setBorder(Yoga.EDGE_RIGHT, 10);
+ root.setBorder(Yoga.EDGE_BOTTOM, 10);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("border_stretch_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setBorder(Yoga.EDGE_LEFT, 10);
+ root.setBorder(Yoga.EDGE_TOP, 10);
+ root.setBorder(Yoga.EDGE_RIGHT, 10);
+ root.setBorder(Yoga.EDGE_BOTTOM, 10);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("border_center_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setBorder(Yoga.EDGE_START, 10);
+ root.setBorder(Yoga.EDGE_END, 20);
+ root.setBorder(Yoga.EDGE_BOTTOM, 20);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(40);
+ expect(root_child0.getComputedTop()).toBe(35);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(35);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js
new file mode 100644
index 00000000..582b4e61
--- /dev/null
+++ b/javascript/tests/generated/YGDimensionTest.test.js
@@ -0,0 +1,106 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html
+
+test("wrap_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(100);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_grandchild", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+
+ const root_child0 = Yoga.Node.create(config);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(100);
+ root_child0_child0.setHeight(100);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js
new file mode 100644
index 00000000..004ff905
--- /dev/null
+++ b/javascript/tests/generated/YGDisplayTest.test.js
@@ -0,0 +1,394 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html
+
+test("display_none", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setDisplay(Yoga.DISPLAY_NONE);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("display_none_fixed_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root_child1.setHeight(20);
+ root_child1.setDisplay(Yoga.DISPLAY_NONE);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("display_none_with_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child0.setMargin(Yoga.EDGE_TOP, 10);
+ root_child0.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root_child0.setDisplay(Yoga.DISPLAY_NONE);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("display_none_with_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis("0%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setDisplay(Yoga.DISPLAY_NONE);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setFlexGrow(1);
+ root_child1_child0.setFlexShrink(1);
+ root_child1_child0.setFlexBasis("0%");
+ root_child1_child0.setWidth(20);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setFlexShrink(1);
+ root_child2.setFlexBasis("0%");
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(0);
+ expect(root_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(0);
+ expect(root_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("display_none_with_position", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setPosition(Yoga.EDGE_TOP, 10);
+ root_child1.setDisplay(Yoga.DISPLAY_NONE);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("display_none_with_position_absolute", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setWidth(100);
+ root_child0.setHeight(100);
+ root_child0.setDisplay(Yoga.DISPLAY_NONE);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js
new file mode 100644
index 00000000..d7c5e0d7
--- /dev/null
+++ b/javascript/tests/generated/YGFlexDirectionTest.test.js
@@ -0,0 +1,437 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html
+
+test("flex_direction_column_no_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(30);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(30);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_direction_row_no_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(30);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(10);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(30);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(10);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_direction_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_direction_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(10);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(80);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(70);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_direction_column_reverse", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(90);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(80);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(70);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(90);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(80);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(70);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_direction_row_reverse", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(80);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(70);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(10);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js
new file mode 100644
index 00000000..141ad7cf
--- /dev/null
+++ b/javascript/tests/generated/YGFlexTest.test.js
@@ -0,0 +1,646 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
+
+test("flex_basis_flex_grow_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(75);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(75);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_shrink_flex_grow_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexShrink(1);
+ root_child0.setWidth(500);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexShrink(1);
+ root_child1.setWidth(500);
+ root_child1.setHeight(100);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(250);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(250);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(250);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(250);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(250);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(250);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexShrink(1);
+ root_child0.setWidth(500);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setWidth(500);
+ root_child1.setHeight(100);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(250);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(250);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(250);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(250);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(250);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(250);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_basis_flex_grow_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(75);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(25);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(25);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(75);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(25);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_basis_flex_shrink_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexBasis(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_basis_flex_shrink_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexBasis(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_shrink_to_zero", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setHeight(75);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexShrink(1);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(50);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(75);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(75);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_basis_overrides_main_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_shrink_at_most", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexShrink(1);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_less_than_factor_one", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(0.2);
+ root_child0.setFlexBasis(40);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(0.2);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(0.4);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(132);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(132);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(92);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(224);
+ expect(root_child2.getComputedWidth()).toBe(200);
+ expect(root_child2.getComputedHeight()).toBe(184);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(132);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(132);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(92);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(224);
+ expect(root_child2.getComputedWidth()).toBe(200);
+ expect(root_child2.getComputedHeight()).toBe(184);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js
new file mode 100644
index 00000000..cd0388dd
--- /dev/null
+++ b/javascript/tests/generated/YGFlexWrapTest.test.js
@@ -0,0 +1,1813 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html
+
+test("wrap_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(30);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(30);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(30);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(60);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(30);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(60);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(30);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(60);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(30);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(30);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(30);
+ expect(root_child2.getComputedTop()).toBe(60);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(30);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(30);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(30);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(60);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(30);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(60);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(30);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(70);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_row_align_items_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(30);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(60);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(60);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(70);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_row_align_items_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(30);
+ root.insertChild(root_child3, 3);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(60);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(5);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(60);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(5);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(70);
+ expect(root_child3.getComputedTop()).toBe(30);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(30);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_wrap_children_with_min_main_overriding_flex_basis", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexBasis(50);
+ root_child0.setMinWidth(55);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexBasis(50);
+ root_child1.setMinWidth(55);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(55);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(55);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(45);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(55);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(45);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(55);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_wrap_wrap_to_child_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root_child0.setFlexWrap(Yoga.WRAP_WRAP);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(100);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setWidth(100);
+ root_child0_child0_child0.setHeight(100);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(100);
+ root_child1.setHeight(100);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(100);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(100);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_wrap_align_stretch_fits_one_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(150);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(150);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_reverse_row_align_content_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(40);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(30);
+ root_child4.setHeight(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(70);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(40);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_reverse_row_align_content_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_CENTER);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(40);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(30);
+ root_child4.setHeight(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(70);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(40);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_reverse_row_single_line_different_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(300);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(40);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(30);
+ root_child4.setHeight(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(300);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(40);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(90);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(120);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(300);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(270);
+ expect(root_child0.getComputedTop()).toBe(40);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(240);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(210);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(180);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(150);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_reverse_row_align_content_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(40);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(30);
+ root_child4.setHeight(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(70);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(40);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_reverse_row_align_content_space_around", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_SPACE_AROUND);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(40);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(30);
+ root_child4.setHeight(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(70);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(60);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(70);
+ expect(root_child3.getComputedTop()).toBe(10);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(40);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_reverse_column_fixed_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE);
+ root.setWidth(200);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(30);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(30);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(30);
+ root_child3.setHeight(40);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(30);
+ root_child4.setHeight(50);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(170);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(170);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(170);
+ expect(root_child2.getComputedTop()).toBe(30);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(170);
+ expect(root_child3.getComputedTop()).toBe(60);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(140);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(30);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(30);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(30);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(60);
+ expect(root_child3.getComputedWidth()).toBe(30);
+ expect(root_child3.getComputedHeight()).toBe(40);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(30);
+ expect(root_child4.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrapped_row_within_align_items_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setFlexWrap(Yoga.WRAP_WRAP);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(150);
+ root_child0_child0.setHeight(80);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setWidth(80);
+ root_child0_child1.setHeight(80);
+ root_child0.insertChild(root_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(160);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(150);
+ expect(root_child0_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(80);
+ expect(root_child0_child1.getComputedWidth()).toBe(80);
+ expect(root_child0_child1.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(160);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(50);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(150);
+ expect(root_child0_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(120);
+ expect(root_child0_child1.getComputedTop()).toBe(80);
+ expect(root_child0_child1.getComputedWidth()).toBe(80);
+ expect(root_child0_child1.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrapped_row_within_align_items_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setFlexWrap(Yoga.WRAP_WRAP);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(150);
+ root_child0_child0.setHeight(80);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setWidth(80);
+ root_child0_child1.setHeight(80);
+ root_child0.insertChild(root_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(160);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(150);
+ expect(root_child0_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(80);
+ expect(root_child0_child1.getComputedWidth()).toBe(80);
+ expect(root_child0_child1.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(160);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(50);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(150);
+ expect(root_child0_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(120);
+ expect(root_child0_child1.getComputedTop()).toBe(80);
+ expect(root_child0_child1.getComputedWidth()).toBe(80);
+ expect(root_child0_child1.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrapped_row_within_align_items_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setFlexWrap(Yoga.WRAP_WRAP);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(150);
+ root_child0_child0.setHeight(80);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setWidth(80);
+ root_child0_child1.setHeight(80);
+ root_child0.insertChild(root_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(160);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(150);
+ expect(root_child0_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(80);
+ expect(root_child0_child1.getComputedWidth()).toBe(80);
+ expect(root_child0_child1.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(160);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(50);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(150);
+ expect(root_child0_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(120);
+ expect(root_child0_child1.getComputedTop()).toBe(80);
+ expect(root_child0_child1.getComputedWidth()).toBe(80);
+ expect(root_child0_child1.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrapped_column_max_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignContent(Yoga.ALIGN_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(700);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(100);
+ root_child0.setHeight(500);
+ root_child0.setMaxHeight(200);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setMargin(Yoga.EDGE_LEFT, 20);
+ root_child1.setMargin(Yoga.EDGE_TOP, 20);
+ root_child1.setMargin(Yoga.EDGE_RIGHT, 20);
+ root_child1.setMargin(Yoga.EDGE_BOTTOM, 20);
+ root_child1.setWidth(200);
+ root_child1.setHeight(200);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(100);
+ root_child2.setHeight(100);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(700);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(250);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(200);
+ expect(root_child1.getComputedTop()).toBe(250);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(200);
+
+ expect(root_child2.getComputedLeft()).toBe(420);
+ expect(root_child2.getComputedTop()).toBe(200);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(700);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(350);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(300);
+ expect(root_child1.getComputedTop()).toBe(250);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(200);
+
+ expect(root_child2.getComputedLeft()).toBe(180);
+ expect(root_child2.getComputedTop()).toBe(200);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrapped_column_max_height_flex", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignContent(Yoga.ALIGN_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(700);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis("0%");
+ root_child0.setWidth(100);
+ root_child0.setHeight(500);
+ root_child0.setMaxHeight(200);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setMargin(Yoga.EDGE_LEFT, 20);
+ root_child1.setMargin(Yoga.EDGE_TOP, 20);
+ root_child1.setMargin(Yoga.EDGE_RIGHT, 20);
+ root_child1.setMargin(Yoga.EDGE_BOTTOM, 20);
+ root_child1.setWidth(200);
+ root_child1.setHeight(200);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(100);
+ root_child2.setHeight(100);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(700);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(300);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(180);
+
+ expect(root_child1.getComputedLeft()).toBe(250);
+ expect(root_child1.getComputedTop()).toBe(200);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(180);
+
+ expect(root_child2.getComputedLeft()).toBe(300);
+ expect(root_child2.getComputedTop()).toBe(400);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(700);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(300);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(180);
+
+ expect(root_child1.getComputedLeft()).toBe(250);
+ expect(root_child1.getComputedTop()).toBe(200);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(180);
+
+ expect(root_child2.getComputedLeft()).toBe(300);
+ expect(root_child2.getComputedTop()).toBe(400);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_nodes_with_content_sizing_overflowing_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setFlexWrap(Yoga.WRAP_WRAP);
+ root_child0.setWidth(85);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setWidth(40);
+ root_child0_child0_child0.setHeight(40);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child0.insertChild(root_child0_child1, 1);
+
+ const root_child0_child1_child0 = Yoga.Node.create(config);
+ root_child0_child1_child0.setWidth(40);
+ root_child0_child1_child0.setHeight(40);
+ root_child0_child1.insertChild(root_child0_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(85);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(40);
+ expect(root_child0_child1.getComputedWidth()).toBe(40);
+ expect(root_child0_child1.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child1_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child1_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(415);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(85);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(45);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(35);
+ expect(root_child0_child1.getComputedTop()).toBe(40);
+ expect(root_child0_child1.getComputedWidth()).toBe(40);
+ expect(root_child0_child1.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child1_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child1_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("wrap_nodes_with_content_sizing_margin_cross", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setFlexWrap(Yoga.WRAP_WRAP);
+ root_child0.setWidth(70);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setWidth(40);
+ root_child0_child0_child0.setHeight(40);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setMargin(Yoga.EDGE_TOP, 10);
+ root_child0.insertChild(root_child0_child1, 1);
+
+ const root_child0_child1_child0 = Yoga.Node.create(config);
+ root_child0_child1_child0.setWidth(40);
+ root_child0_child1_child0.setHeight(40);
+ root_child0_child1.insertChild(root_child0_child1_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(70);
+ expect(root_child0.getComputedHeight()).toBe(90);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(50);
+ expect(root_child0_child1.getComputedWidth()).toBe(40);
+ expect(root_child0_child1.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child1_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child1_child0.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(430);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(70);
+ expect(root_child0.getComputedHeight()).toBe(90);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(30);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(30);
+ expect(root_child0_child1.getComputedTop()).toBe(50);
+ expect(root_child0_child1.getComputedWidth()).toBe(40);
+ expect(root_child0_child1.getComputedHeight()).toBe(40);
+
+ expect(root_child0_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child1_child0.getComputedWidth()).toBe(40);
+ expect(root_child0_child1_child0.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js
new file mode 100644
index 00000000..11ffa6d6
--- /dev/null
+++ b/javascript/tests/generated/YGGapTest.test.js
@@ -0,0 +1,2202 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html
+
+test("column_gap_flexible", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(80);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis("0%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setFlexShrink(1);
+ root_child2.setFlexBasis("0%");
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(60);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_inflexible", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(80);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(60);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_mixed_flexible", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(80);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(60);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_child_margins", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(80);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis("0%");
+ root_child0.setMargin(Yoga.EDGE_LEFT, 2);
+ root_child0.setMargin(Yoga.EDGE_RIGHT, 2);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child1.setMargin(Yoga.EDGE_RIGHT, 10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setFlexShrink(1);
+ root_child2.setFlexBasis("0%");
+ root_child2.setMargin(Yoga.EDGE_LEFT, 15);
+ root_child2.setMargin(Yoga.EDGE_RIGHT, 15);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(2);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(2);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(26);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(2);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(63);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(2);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(76);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(2);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(52);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(2);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(15);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(2);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_row_gap_wrapping", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(80);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root_child4.setHeight(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root_child5.setHeight(20);
+ root.insertChild(root_child5, 5);
+
+ const root_child6 = Yoga.Node.create(config);
+ root_child6.setWidth(20);
+ root_child6.setHeight(20);
+ root.insertChild(root_child6, 6);
+
+ const root_child7 = Yoga.Node.create(config);
+ root_child7.setWidth(20);
+ root_child7.setHeight(20);
+ root.insertChild(root_child7, 7);
+
+ const root_child8 = Yoga.Node.create(config);
+ root_child8.setWidth(20);
+ root_child8.setHeight(20);
+ root.insertChild(root_child8, 8);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(40);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(40);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(40);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+
+ expect(root_child6.getComputedLeft()).toBe(0);
+ expect(root_child6.getComputedTop()).toBe(80);
+ expect(root_child6.getComputedWidth()).toBe(20);
+ expect(root_child6.getComputedHeight()).toBe(20);
+
+ expect(root_child7.getComputedLeft()).toBe(30);
+ expect(root_child7.getComputedTop()).toBe(80);
+ expect(root_child7.getComputedWidth()).toBe(20);
+ expect(root_child7.getComputedHeight()).toBe(20);
+
+ expect(root_child8.getComputedLeft()).toBe(60);
+ expect(root_child8.getComputedTop()).toBe(80);
+ expect(root_child8.getComputedWidth()).toBe(20);
+ expect(root_child8.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(60);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(60);
+ expect(root_child3.getComputedTop()).toBe(40);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(40);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(0);
+ expect(root_child5.getComputedTop()).toBe(40);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+
+ expect(root_child6.getComputedLeft()).toBe(60);
+ expect(root_child6.getComputedTop()).toBe(80);
+ expect(root_child6.getComputedWidth()).toBe(20);
+ expect(root_child6.getComputedHeight()).toBe(20);
+
+ expect(root_child7.getComputedLeft()).toBe(30);
+ expect(root_child7.getComputedTop()).toBe(80);
+ expect(root_child7.getComputedWidth()).toBe(20);
+ expect(root_child7.getComputedHeight()).toBe(20);
+
+ expect(root_child8.getComputedLeft()).toBe(0);
+ expect(root_child8.getComputedTop()).toBe(80);
+ expect(root_child8.getComputedWidth()).toBe(20);
+ expect(root_child8.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_justify_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_justify_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(70);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(10);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_justify_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(80);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(60);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_justify_space_between", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(80);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_justify_space_around", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(3);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(77);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(77);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(3);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_justify_space_evenly", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(5);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(75);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(5);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_wrap_align_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root_child4.setHeight(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root_child5.setHeight(20);
+ root.insertChild(root_child5, 5);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(40);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(40);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(40);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(80);
+ expect(root_child3.getComputedTop()).toBe(40);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(40);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(20);
+ expect(root_child5.getComputedTop()).toBe(40);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_wrap_align_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_CENTER);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root_child4.setHeight(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root_child5.setHeight(20);
+ root.insertChild(root_child5, 5);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(20);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(60);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(60);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(60);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(20);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(80);
+ expect(root_child3.getComputedTop()).toBe(60);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(60);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(20);
+ expect(root_child5.getComputedTop()).toBe(60);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_wrap_align_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_FLEX_END);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root_child4.setHeight(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root_child5.setHeight(20);
+ root.insertChild(root_child5, 5);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(40);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(40);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(80);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(40);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(40);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(40);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(80);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(20);
+ expect(root_child5.getComputedTop()).toBe(80);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_wrap_align_space_between", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root_child4.setHeight(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root_child5.setHeight(20);
+ root.insertChild(root_child5, 5);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(80);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(80);
+ expect(root_child3.getComputedTop()).toBe(80);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(80);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(20);
+ expect(root_child5.getComputedTop()).toBe(80);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_wrap_align_space_around", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_SPACE_AROUND);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root_child2.setHeight(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root_child3.setHeight(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root_child4.setHeight(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root_child5.setHeight(20);
+ root.insertChild(root_child5, 5);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(10);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(70);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(70);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(70);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(10);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(20);
+
+ expect(root_child3.getComputedLeft()).toBe(80);
+ expect(root_child3.getComputedTop()).toBe(70);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(20);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(70);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(20);
+
+ expect(root_child5.getComputedLeft()).toBe(20);
+ expect(root_child5.getComputedTop()).toBe(70);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_wrap_align_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(300);
+ root.setHeight(300);
+ root.setGap(Yoga.GUTTER_COLUMN, 5);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMinWidth(60);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setMinWidth(60);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setMinWidth(60);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setFlexGrow(1);
+ root_child3.setMinWidth(60);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setFlexGrow(1);
+ root_child4.setMinWidth(60);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(300);
+ expect(root.getComputedHeight()).toBe(300);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(71);
+ expect(root_child0.getComputedHeight()).toBe(150);
+
+ expect(root_child1.getComputedLeft()).toBe(76);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(72);
+ expect(root_child1.getComputedHeight()).toBe(150);
+
+ expect(root_child2.getComputedLeft()).toBe(153);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(71);
+ expect(root_child2.getComputedHeight()).toBe(150);
+
+ expect(root_child3.getComputedLeft()).toBe(229);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(71);
+ expect(root_child3.getComputedHeight()).toBe(150);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(150);
+ expect(root_child4.getComputedWidth()).toBe(300);
+ expect(root_child4.getComputedHeight()).toBe(150);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(300);
+ expect(root.getComputedHeight()).toBe(300);
+
+ expect(root_child0.getComputedLeft()).toBe(229);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(71);
+ expect(root_child0.getComputedHeight()).toBe(150);
+
+ expect(root_child1.getComputedLeft()).toBe(153);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(71);
+ expect(root_child1.getComputedHeight()).toBe(150);
+
+ expect(root_child2.getComputedLeft()).toBe(76);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(72);
+ expect(root_child2.getComputedHeight()).toBe(150);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(71);
+ expect(root_child3.getComputedHeight()).toBe(150);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(150);
+ expect(root_child4.getComputedWidth()).toBe(300);
+ expect(root_child4.getComputedHeight()).toBe(150);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("column_gap_determines_parent_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setHeight(100);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(30);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(20);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(50);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(70);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(30);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("row_gap_align_items_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(200);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root.insertChild(root_child5, 5);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(90);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(90);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(90);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(110);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(90);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(110);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(90);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(110);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(90);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(90);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(90);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(90);
+
+ expect(root_child3.getComputedLeft()).toBe(80);
+ expect(root_child3.getComputedTop()).toBe(110);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(90);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(110);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(90);
+
+ expect(root_child5.getComputedLeft()).toBe(20);
+ expect(root_child5.getComputedTop()).toBe(110);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(90);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("row_gap_align_items_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(200);
+ root.setGap(Yoga.GUTTER_COLUMN, 10);
+ root.setGap(Yoga.GUTTER_ROW, 20);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(20);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setWidth(20);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setWidth(20);
+ root.insertChild(root_child4, 4);
+
+ const root_child5 = Yoga.Node.create(config);
+ root_child5.setWidth(20);
+ root.insertChild(root_child5, 5);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(30);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(60);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(0);
+ expect(root_child3.getComputedTop()).toBe(20);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(0);
+
+ expect(root_child4.getComputedLeft()).toBe(30);
+ expect(root_child4.getComputedTop()).toBe(20);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(0);
+
+ expect(root_child5.getComputedLeft()).toBe(60);
+ expect(root_child5.getComputedTop()).toBe(20);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(20);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ expect(root_child3.getComputedLeft()).toBe(80);
+ expect(root_child3.getComputedTop()).toBe(20);
+ expect(root_child3.getComputedWidth()).toBe(20);
+ expect(root_child3.getComputedHeight()).toBe(0);
+
+ expect(root_child4.getComputedLeft()).toBe(50);
+ expect(root_child4.getComputedTop()).toBe(20);
+ expect(root_child4.getComputedWidth()).toBe(20);
+ expect(root_child4.getComputedHeight()).toBe(0);
+
+ expect(root_child5.getComputedLeft()).toBe(20);
+ expect(root_child5.getComputedTop()).toBe(20);
+ expect(root_child5.getComputedWidth()).toBe(20);
+ expect(root_child5.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("row_gap_column_child_margins", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(200);
+ root.setGap(Yoga.GUTTER_ROW, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis("0%");
+ root_child0.setMargin(Yoga.EDGE_TOP, 2);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 2);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexShrink(1);
+ root_child1.setFlexBasis("0%");
+ root_child1.setMargin(Yoga.EDGE_TOP, 10);
+ root_child1.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setFlexShrink(1);
+ root_child2.setFlexBasis("0%");
+ root_child2.setMargin(Yoga.EDGE_TOP, 15);
+ root_child2.setMargin(Yoga.EDGE_BOTTOM, 15);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(2);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(42);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(66);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(42);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(143);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(42);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(2);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(42);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(66);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(42);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(143);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(42);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("row_gap_row_wrap_child_margins", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setFlexWrap(Yoga.WRAP_WRAP);
+ root.setWidth(100);
+ root.setHeight(200);
+ root.setGap(Yoga.GUTTER_ROW, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, 2);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 2);
+ root_child0.setWidth(60);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setMargin(Yoga.EDGE_TOP, 10);
+ root_child1.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root_child1.setWidth(60);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setMargin(Yoga.EDGE_TOP, 15);
+ root_child2.setMargin(Yoga.EDGE_BOTTOM, 15);
+ root_child2.setWidth(60);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(2);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(24);
+ expect(root_child1.getComputedWidth()).toBe(60);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(59);
+ expect(root_child2.getComputedWidth()).toBe(60);
+ expect(root_child2.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(40);
+ expect(root_child0.getComputedTop()).toBe(2);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(24);
+ expect(root_child1.getComputedWidth()).toBe(60);
+ expect(root_child1.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(40);
+ expect(root_child2.getComputedTop()).toBe(59);
+ expect(root_child2.getComputedWidth()).toBe(60);
+ expect(root_child2.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("row_gap_determines_parent_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setGap(Yoga.GUTTER_ROW, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(20);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(30);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(20);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(30);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(20);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(20);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(50);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(30);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js
new file mode 100644
index 00000000..145eb54a
--- /dev/null
+++ b/javascript/tests/generated/YGJustifyContentTest.test.js
@@ -0,0 +1,1223 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html
+
+test("justify_content_row_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(10);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(20);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(92);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(82);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(72);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_row_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(72);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(82);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(92);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(10);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_row_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(36);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(46);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(56);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(56);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(46);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(36);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_row_space_between", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(46);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(92);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(92);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(46);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_row_space_around", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(12);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(46);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(80);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(102);
+
+ expect(root_child1.getComputedLeft()).toBe(46);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(102);
+
+ expect(root_child2.getComputedLeft()).toBe(12);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(102);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_column_flex_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(10);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(20);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_column_flex_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(72);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(82);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(92);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(72);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(82);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(92);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_column_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(36);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(56);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(36);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(56);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_column_space_between", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(92);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(92);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_column_space_around", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(12);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(12);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_row_min_width_and_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ 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);
+
+ const 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);
+
+ expect(root.getComputedLeft()).toBe(100);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(20);
+
+ expect(root_child0.getComputedLeft()).toBe(15);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(100);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(20);
+
+ expect(root_child0.getComputedLeft()).toBe(15);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_row_max_width_and_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ 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);
+
+ const 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);
+
+ expect(root.getComputedLeft()).toBe(100);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(20);
+
+ expect(root_child0.getComputedLeft()).toBe(30);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(100);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(80);
+ expect(root.getComputedHeight()).toBe(20);
+
+ expect(root_child0.getComputedLeft()).toBe(30);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_column_min_height_and_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setMargin(Yoga.EDGE_TOP, 100);
+ root.setMinHeight(50);
+
+ const 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);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(100);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(15);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(100);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(15);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_colunn_max_height_and_margin", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setMargin(Yoga.EDGE_TOP, 100);
+ root.setHeight(100);
+ root.setMaxHeight(80);
+
+ const 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);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(100);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(100);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(80);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(30);
+ expect(root_child0.getComputedWidth()).toBe(20);
+ expect(root_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_column_space_evenly", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(18);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(74);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(18);
+ expect(root_child0.getComputedWidth()).toBe(102);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(46);
+ expect(root_child1.getComputedWidth()).toBe(102);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(74);
+ expect(root_child2.getComputedWidth()).toBe(102);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_row_space_evenly", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY);
+ root.setWidth(102);
+ root.setHeight(102);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(26);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(51);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(77);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(0);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(102);
+ expect(root.getComputedHeight()).toBe(102);
+
+ expect(root_child0.getComputedLeft()).toBe(77);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(51);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(26);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(0);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_min_width_with_padding_child_width_greater_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setWidth(1000);
+ root.setHeight(1584);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0.setPadding(Yoga.EDGE_LEFT, 100);
+ root_child0_child0.setPadding(Yoga.EDGE_RIGHT, 100);
+ root_child0_child0.setMinWidth(400);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0.setWidth(300);
+ root_child0_child0_child0.setHeight(100);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(1000);
+ expect(root.getComputedHeight()).toBe(1584);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(1000);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(500);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(100);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(300);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(1000);
+ expect(root.getComputedHeight()).toBe(1584);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(1000);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(500);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(500);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(100);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(300);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_min_width_with_padding_child_width_lower_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.setWidth(1080);
+ root.setHeight(1584);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0.setPadding(Yoga.EDGE_LEFT, 100);
+ root_child0_child0.setPadding(Yoga.EDGE_RIGHT, 100);
+ root_child0_child0.setMinWidth(400);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
+ root_child0_child0_child0.setWidth(199);
+ root_child0_child0_child0.setHeight(100);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(1080);
+ expect(root.getComputedHeight()).toBe(1584);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(400);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(101);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(199);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(1080);
+ expect(root.getComputedHeight()).toBe(1584);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(1080);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(680);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(400);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(101);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(199);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js
new file mode 100644
index 00000000..888b189a
--- /dev/null
+++ b/javascript/tests/generated/YGMarginTest.test.js
@@ -0,0 +1,1847 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html
+
+test("margin_start", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_START, 10);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_top", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, 10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_END, 10);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_bottom", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_and_flex_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMargin(Yoga.EDGE_START, 10);
+ root_child0.setMargin(Yoga.EDGE_END, 10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_and_flex_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMargin(Yoga.EDGE_TOP, 10);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_and_stretch_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMargin(Yoga.EDGE_TOP, 10);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_and_stretch_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMargin(Yoga.EDGE_START, 10);
+ root_child0.setMargin(Yoga.EDGE_END, 10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_with_sibling_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMargin(Yoga.EDGE_END, 10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(45);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(55);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(45);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(55);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(45);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(45);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_with_sibling_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(45);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(55);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(45);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(45);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(55);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(45);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_bottom", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_top", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(100);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(100);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_bottom_and_top", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, "auto");
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_bottom_and_top_justify_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, "auto");
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(150);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(150);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_mutiple_children_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setMargin(Yoga.EDGE_TOP, "auto");
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(50);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(25);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(100);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(75);
+ expect(root_child2.getComputedTop()).toBe(150);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(25);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(100);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(75);
+ expect(root_child2.getComputedTop()).toBe(150);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_mutiple_children_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(50);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(150);
+ expect(root_child2.getComputedTop()).toBe(75);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(125);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(75);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_and_right_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(150);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_and_right", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(150);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_start_and_end_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_START, "auto");
+ root_child0.setMargin(Yoga.EDGE_END, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(150);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(75);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_start_and_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_START, "auto");
+ root_child0.setMargin(Yoga.EDGE_END, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(150);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_and_right_column_and_center", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(150);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(150);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_right", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_and_right_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(150);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_top_and_bottom_stretch", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, "auto");
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto");
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(150);
+ expect(root_child0.getComputedTop()).toBe(50);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(150);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_should_not_be_part_of_max_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(250);
+ root.setHeight(250);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_TOP, 20);
+ root_child0.setWidth(100);
+ root_child0.setHeight(100);
+ root_child0.setMaxHeight(100);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(250);
+ expect(root.getComputedHeight()).toBe(250);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(250);
+ expect(root.getComputedHeight()).toBe(250);
+
+ expect(root_child0.getComputedLeft()).toBe(150);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_should_not_be_part_of_max_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(250);
+ root.setHeight(250);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, 20);
+ root_child0.setWidth(100);
+ root_child0.setMaxWidth(100);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(250);
+ expect(root.getComputedHeight()).toBe(250);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(250);
+ expect(root.getComputedHeight()).toBe(250);
+
+ expect(root_child0.getComputedLeft()).toBe(150);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_right_child_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(72);
+ root_child0.setHeight(72);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-20);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_child_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setWidth(72);
+ root_child0.setHeight(72);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-20);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_fix_left_auto_right_child_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, 10);
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "auto");
+ root_child0.setWidth(72);
+ root_child0.setHeight(72);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-20);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_fix_right_child_bigger_than_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(52);
+ root.setHeight(52);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root_child0.setMargin(Yoga.EDGE_RIGHT, 10);
+ root_child0.setWidth(72);
+ root_child0.setHeight(72);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(52);
+ expect(root.getComputedHeight()).toBe(52);
+
+ expect(root_child0.getComputedLeft()).toBe(-30);
+ expect(root_child0.getComputedTop()).toBe(-10);
+ expect(root_child0.getComputedWidth()).toBe(72);
+ expect(root_child0.getComputedHeight()).toBe(72);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_top_stretching_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis("0%");
+ root_child0.setMargin(Yoga.EDGE_TOP, "auto");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(150);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(150);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("margin_auto_left_stretching_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis("0%");
+ root_child0.setMargin(Yoga.EDGE_LEFT, "auto");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(200);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(150);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(200);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(150);
+
+ expect(root_child1.getComputedLeft()).toBe(75);
+ expect(root_child1.getComputedTop()).toBe(150);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js
new file mode 100644
index 00000000..0642e299
--- /dev/null
+++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js
@@ -0,0 +1,1282 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html
+
+test("max_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMaxWidth(50);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("max_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setMaxHeight(50);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_min_max", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setWidth(100);
+ root.setMinHeight(100);
+ root.setMaxHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(60);
+ root_child0.setHeight(60);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(40);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(60);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("align_items_min_max", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setMinWidth(100);
+ root.setMaxWidth(200);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(60);
+ root_child0.setHeight(60);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(60);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("justify_content_overflow_min_max", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setMinHeight(100);
+ root.setMaxHeight(110);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(50);
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(50);
+ root_child2.setHeight(50);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(110);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(-20);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(50);
+ expect(root.getComputedHeight()).toBe(110);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(-20);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(30);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(80);
+ expect(root_child2.getComputedWidth()).toBe(50);
+ expect(root_child2.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_to_min", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setMinHeight(100);
+ root.setMaxHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexShrink(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_in_at_most_container", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexBasis(0);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(0);
+ expect(root_child0_child0.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(0);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_within_constrained_min_max_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setMinHeight(100);
+ root.setMaxHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_within_max_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setMaxWidth(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setHeight(20);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_within_constrained_max_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setMaxWidth(300);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setHeight(20);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(200);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(20);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(200);
+ expect(root_child0_child0.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_root_ignored", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexGrow(1);
+ root.setWidth(100);
+ root.setMinHeight(100);
+ root.setMaxHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(200);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(100);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(300);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(200);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(300);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(200);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_root_minimized", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setMinHeight(100);
+ root.setMaxHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMinHeight(100);
+ root_child0.setMaxHeight(500);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexBasis(200);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setHeight(100);
+ root_child0.insertChild(root_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(300);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(300);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(200);
+ expect(root_child0_child1.getComputedWidth()).toBe(100);
+ expect(root_child0_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(300);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(300);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(200);
+ expect(root_child0_child1.getComputedWidth()).toBe(100);
+ expect(root_child0_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_height_maximized", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMinHeight(100);
+ root_child0.setMaxHeight(500);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexBasis(200);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setHeight(100);
+ root_child0.insertChild(root_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(500);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(400);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(400);
+ expect(root_child0_child1.getComputedWidth()).toBe(100);
+ expect(root_child0_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(500);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(400);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(400);
+ expect(root_child0_child1.getComputedWidth()).toBe(100);
+ expect(root_child0_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_within_constrained_min_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setMinWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setWidth(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(50);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(50);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(50);
+ expect(root_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_within_constrained_min_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setMinHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(0);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_within_constrained_max_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setMaxWidth(100);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexShrink(1);
+ root_child0_child0.setFlexBasis(100);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setWidth(50);
+ root_child0.insertChild(root_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(50);
+ expect(root_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child1.getComputedWidth()).toBe(50);
+ expect(root_child0_child1.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(50);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child1.getComputedWidth()).toBe(50);
+ expect(root_child0_child1.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("flex_grow_within_constrained_max_column", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setMaxHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setHeight(50);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("child_min_max_width_flexing", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(120);
+ root.setHeight(50);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(0);
+ root_child0.setMinWidth(60);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexBasis("50%");
+ root_child1.setMaxWidth(20);
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(120);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(100);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(120);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(20);
+ expect(root_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("min_width_overrides_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(50);
+ root.setMinWidth(100);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("max_width_overrides_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setMaxWidth(100);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("min_height_overrides_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setHeight(50);
+ root.setMinHeight(100);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("max_height_overrides_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setHeight(200);
+ root.setMaxHeight(100);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("min_max_percent_no_width_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setAlignItems(Yoga.ALIGN_FLEX_START);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setMinWidth("10%");
+ root_child0.setMaxWidth("10%");
+ root_child0.setMinHeight("10%");
+ root_child0.setMaxHeight("10%");
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js
new file mode 100644
index 00000000..1f9498c3
--- /dev/null
+++ b/javascript/tests/generated/YGPaddingTest.test.js
@@ -0,0 +1,280 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html
+
+test("padding_no_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setPadding(Yoga.EDGE_LEFT, 10);
+ root.setPadding(Yoga.EDGE_TOP, 10);
+ root.setPadding(Yoga.EDGE_RIGHT, 10);
+ root.setPadding(Yoga.EDGE_BOTTOM, 10);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(20);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(20);
+ expect(root.getComputedHeight()).toBe(20);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("padding_container_match_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setPadding(Yoga.EDGE_LEFT, 10);
+ root.setPadding(Yoga.EDGE_TOP, 10);
+ root.setPadding(Yoga.EDGE_RIGHT, 10);
+ root.setPadding(Yoga.EDGE_BOTTOM, 10);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(30);
+ expect(root.getComputedHeight()).toBe(30);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(30);
+ expect(root.getComputedHeight()).toBe(30);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("padding_flex_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setPadding(Yoga.EDGE_LEFT, 10);
+ root.setPadding(Yoga.EDGE_TOP, 10);
+ root.setPadding(Yoga.EDGE_RIGHT, 10);
+ root.setPadding(Yoga.EDGE_BOTTOM, 10);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(80);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(80);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("padding_stretch_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setPadding(Yoga.EDGE_LEFT, 10);
+ root.setPadding(Yoga.EDGE_TOP, 10);
+ root.setPadding(Yoga.EDGE_RIGHT, 10);
+ root.setPadding(Yoga.EDGE_BOTTOM, 10);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(10);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(80);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("padding_center_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setPadding(Yoga.EDGE_START, 10);
+ root.setPadding(Yoga.EDGE_END, 20);
+ root.setPadding(Yoga.EDGE_BOTTOM, 20);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(40);
+ expect(root_child0.getComputedTop()).toBe(35);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(35);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("child_with_padding_align_end", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_FLEX_END);
+ root.setAlignItems(Yoga.ALIGN_FLEX_END);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPadding(Yoga.EDGE_LEFT, 20);
+ root_child0.setPadding(Yoga.EDGE_TOP, 20);
+ root_child0.setPadding(Yoga.EDGE_RIGHT, 20);
+ root_child0.setPadding(Yoga.EDGE_BOTTOM, 20);
+ root_child0.setWidth(100);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(100);
+ expect(root_child0.getComputedTop()).toBe(100);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(100);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js
new file mode 100644
index 00000000..2c34df61
--- /dev/null
+++ b/javascript/tests/generated/YGPercentageTest.test.js
@@ -0,0 +1,1213 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html
+
+test("percentage_width_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth("30%");
+ root_child0.setHeight("30%");
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(140);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(60);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_position_left_top", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(400);
+ root.setHeight(400);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPosition(Yoga.EDGE_LEFT, "10%");
+ root_child0.setPosition(Yoga.EDGE_TOP, "20%");
+ root_child0.setWidth("45%");
+ root_child0.setHeight("55%");
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(400);
+ expect(root.getComputedHeight()).toBe(400);
+
+ expect(root_child0.getComputedLeft()).toBe(40);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(180);
+ expect(root_child0.getComputedHeight()).toBe(220);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(400);
+ expect(root.getComputedHeight()).toBe(400);
+
+ expect(root_child0.getComputedLeft()).toBe(260);
+ expect(root_child0.getComputedTop()).toBe(80);
+ expect(root_child0.getComputedWidth()).toBe(180);
+ expect(root_child0.getComputedHeight()).toBe(220);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_position_bottom_right", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(500);
+ root.setHeight(500);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPosition(Yoga.EDGE_RIGHT, "20%");
+ root_child0.setPosition(Yoga.EDGE_BOTTOM, "10%");
+ root_child0.setWidth("55%");
+ root_child0.setHeight("15%");
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(-100);
+ expect(root_child0.getComputedTop()).toBe(-50);
+ expect(root_child0.getComputedWidth()).toBe(275);
+ expect(root_child0.getComputedHeight()).toBe(75);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(500);
+ expect(root.getComputedHeight()).toBe(500);
+
+ expect(root_child0.getComputedLeft()).toBe(125);
+ expect(root_child0.getComputedTop()).toBe(-50);
+ expect(root_child0.getComputedWidth()).toBe(275);
+ expect(root_child0.getComputedHeight()).toBe(75);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("50%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexBasis("25%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(125);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(125);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(75);
+ expect(root_child1.getComputedHeight()).toBe(200);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(75);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(125);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(75);
+ expect(root_child1.getComputedHeight()).toBe(200);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis_cross", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("50%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setFlexBasis("25%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(125);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(125);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(75);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(125);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(125);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(75);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis_main_max_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("10%");
+ root_child0.setMaxHeight("60%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(4);
+ root_child1.setFlexBasis("10%");
+ root_child1.setMaxHeight("20%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(52);
+ expect(root_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child1.getComputedLeft()).toBe(52);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(148);
+ expect(root_child1.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(148);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(52);
+ expect(root_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(148);
+ expect(root_child1.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis_cross_max_height", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("10%");
+ root_child0.setMaxHeight("60%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(4);
+ root_child1.setFlexBasis("10%");
+ root_child1.setMaxHeight("20%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(120);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(40);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(120);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(120);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(40);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis_main_max_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("15%");
+ root_child0.setMaxWidth("60%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(4);
+ root_child1.setFlexBasis("10%");
+ root_child1.setMaxWidth("20%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(120);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(120);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(40);
+ expect(root_child1.getComputedHeight()).toBe(200);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(120);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(40);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(40);
+ expect(root_child1.getComputedHeight()).toBe(200);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis_cross_max_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("10%");
+ root_child0.setMaxWidth("60%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(4);
+ root_child1.setFlexBasis("15%");
+ root_child1.setMaxWidth("20%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(120);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(40);
+ expect(root_child1.getComputedHeight()).toBe(150);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(120);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(160);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(40);
+ expect(root_child1.getComputedHeight()).toBe(150);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis_main_min_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("15%");
+ root_child0.setMinWidth("60%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(4);
+ root_child1.setFlexBasis("10%");
+ root_child1.setMinWidth("20%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(120);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(120);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(80);
+ expect(root_child1.getComputedHeight()).toBe(200);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(80);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(120);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(80);
+ expect(root_child1.getComputedHeight()).toBe(200);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_flex_basis_cross_min_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("10%");
+ root_child0.setMinWidth("60%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(4);
+ root_child1.setFlexBasis("15%");
+ root_child1.setMinWidth("20%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(150);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(50);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(150);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis("10%");
+ root_child0.setMargin(Yoga.EDGE_LEFT, 5);
+ root_child0.setMargin(Yoga.EDGE_TOP, 5);
+ root_child0.setMargin(Yoga.EDGE_RIGHT, 5);
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, 5);
+ root_child0.setPadding(Yoga.EDGE_LEFT, 3);
+ root_child0.setPadding(Yoga.EDGE_TOP, 3);
+ root_child0.setPadding(Yoga.EDGE_RIGHT, 3);
+ root_child0.setPadding(Yoga.EDGE_BOTTOM, 3);
+ root_child0.setMinWidth("60%");
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setMargin(Yoga.EDGE_LEFT, 5);
+ root_child0_child0.setMargin(Yoga.EDGE_TOP, 5);
+ root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 5);
+ root_child0_child0.setMargin(Yoga.EDGE_BOTTOM, 5);
+ root_child0_child0.setPadding(Yoga.EDGE_LEFT, "3%");
+ root_child0_child0.setPadding(Yoga.EDGE_TOP, "3%");
+ root_child0_child0.setPadding(Yoga.EDGE_RIGHT, "3%");
+ root_child0_child0.setPadding(Yoga.EDGE_BOTTOM, "3%");
+ root_child0_child0.setWidth("50%");
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setMargin(Yoga.EDGE_LEFT, "5%");
+ root_child0_child0_child0.setMargin(Yoga.EDGE_TOP, "5%");
+ root_child0_child0_child0.setMargin(Yoga.EDGE_RIGHT, "5%");
+ root_child0_child0_child0.setMargin(Yoga.EDGE_BOTTOM, "5%");
+ root_child0_child0_child0.setPadding(Yoga.EDGE_LEFT, 3);
+ root_child0_child0_child0.setPadding(Yoga.EDGE_TOP, 3);
+ root_child0_child0_child0.setPadding(Yoga.EDGE_RIGHT, 3);
+ root_child0_child0_child0.setPadding(Yoga.EDGE_BOTTOM, 3);
+ root_child0_child0_child0.setWidth("45%");
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(4);
+ root_child1.setFlexBasis("15%");
+ root_child1.setMinWidth("20%");
+ root.insertChild(root_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(5);
+ expect(root_child0.getComputedTop()).toBe(5);
+ expect(root_child0.getComputedWidth()).toBe(190);
+ expect(root_child0.getComputedHeight()).toBe(48);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(8);
+ expect(root_child0_child0.getComputedTop()).toBe(8);
+ expect(root_child0_child0.getComputedWidth()).toBe(92);
+ expect(root_child0_child0.getComputedHeight()).toBe(25);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(10);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(10);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(36);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(6);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(58);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(142);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(5);
+ expect(root_child0.getComputedTop()).toBe(5);
+ expect(root_child0.getComputedWidth()).toBe(190);
+ expect(root_child0.getComputedHeight()).toBe(48);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(90);
+ expect(root_child0_child0.getComputedTop()).toBe(8);
+ expect(root_child0_child0.getComputedWidth()).toBe(92);
+ expect(root_child0_child0.getComputedHeight()).toBe(25);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(46);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(10);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(36);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(6);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(58);
+ expect(root_child1.getComputedWidth()).toBe(200);
+ expect(root_child1.getComputedHeight()).toBe(142);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_margin_should_calculate_based_only_on_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setMargin(Yoga.EDGE_LEFT, "10%");
+ root_child0.setMargin(Yoga.EDGE_TOP, "10%");
+ root_child0.setMargin(Yoga.EDGE_RIGHT, "10%");
+ root_child0.setMargin(Yoga.EDGE_BOTTOM, "10%");
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(10);
+ root_child0_child0.setHeight(10);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(160);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(10);
+ expect(root_child0_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(20);
+ expect(root_child0.getComputedTop()).toBe(20);
+ expect(root_child0.getComputedWidth()).toBe(160);
+ expect(root_child0.getComputedHeight()).toBe(60);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(150);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(10);
+ expect(root_child0_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_padding_should_calculate_based_only_on_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setPadding(Yoga.EDGE_LEFT, "10%");
+ root_child0.setPadding(Yoga.EDGE_TOP, "10%");
+ root_child0.setPadding(Yoga.EDGE_RIGHT, "10%");
+ root_child0.setPadding(Yoga.EDGE_BOTTOM, "10%");
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(10);
+ root_child0_child0.setHeight(10);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(20);
+ expect(root_child0_child0.getComputedTop()).toBe(20);
+ expect(root_child0_child0.getComputedWidth()).toBe(10);
+ expect(root_child0_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(200);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(170);
+ expect(root_child0_child0.getComputedTop()).toBe(20);
+ expect(root_child0_child0.getComputedWidth()).toBe(10);
+ expect(root_child0_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_absolute_position", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(200);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_LEFT, "30%");
+ root_child0.setPosition(Yoga.EDGE_TOP, "10%");
+ root_child0.setWidth(10);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(60);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(60);
+ expect(root_child0.getComputedTop()).toBe(10);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_width_height_undefined_parent_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth("50%");
+ root_child0.setHeight("50%");
+ root.insertChild(root_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(0);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(0);
+ expect(root.getComputedHeight()).toBe(0);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(0);
+ expect(root_child0.getComputedHeight()).toBe(0);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percent_within_flex_grow", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(350);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setWidth("100%");
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setWidth(100);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(350);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(100);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(150);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(150);
+ expect(root_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(250);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(350);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(250);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(100);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(150);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(150);
+ expect(root_child1_child0.getComputedHeight()).toBe(0);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percentage_container_in_wrapping_container", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root.setAlignItems(Yoga.ALIGN_CENTER);
+ root.setWidth(200);
+ root.setHeight(200);
+
+ const root_child0 = Yoga.Node.create(config);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER);
+ root_child0_child0.setWidth("100%");
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0_child0.setWidth(50);
+ root_child0_child0_child0.setHeight(50);
+ root_child0_child0.insertChild(root_child0_child0_child0, 0);
+
+ const root_child0_child0_child1 = Yoga.Node.create(config);
+ root_child0_child0_child1.setWidth(50);
+ root_child0_child0_child1.setHeight(50);
+ root_child0_child0.insertChild(root_child0_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0_child1.getComputedLeft()).toBe(50);
+ expect(root_child0_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1.getComputedWidth()).toBe(50);
+ expect(root_child0_child0_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(200);
+ expect(root.getComputedHeight()).toBe(200);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(75);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0_child0.getComputedLeft()).toBe(50);
+ expect(root_child0_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child0.getComputedWidth()).toBe(50);
+ expect(root_child0_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child0_child1.getComputedWidth()).toBe(50);
+ expect(root_child0_child0_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("percent_absolute_position", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(60);
+ root.setHeight(50);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE);
+ root_child0.setPosition(Yoga.EDGE_LEFT, "50%");
+ root_child0.setWidth("100%");
+ root_child0.setHeight(50);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth("100%");
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setWidth("100%");
+ root_child0.insertChild(root_child0_child1, 1);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(60);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(30);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(60);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(60);
+ expect(root_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child1.getComputedWidth()).toBe(60);
+ expect(root_child0_child1.getComputedHeight()).toBe(50);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(60);
+ expect(root.getComputedHeight()).toBe(50);
+
+ expect(root_child0.getComputedLeft()).toBe(30);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(60);
+ expect(root_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(60);
+ expect(root_child0_child0.getComputedHeight()).toBe(50);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(-60);
+ expect(root_child0_child1.getComputedTop()).toBe(0);
+ expect(root_child0_child1.getComputedWidth()).toBe(60);
+ expect(root_child0_child1.getComputedHeight()).toBe(50);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js
new file mode 100644
index 00000000..c1cac6e4
--- /dev/null
+++ b/javascript/tests/generated/YGRoundingTest.test.js
@@ -0,0 +1,1127 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html
+
+test("rounding_flex_basis_flex_grow_row_width_of_100", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(33);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(33);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(34);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(67);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(33);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(67);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(33);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(33);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(34);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(33);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_flex_basis_flex_grow_row_prime_number_width", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(113);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root.insertChild(root_child2, 2);
+
+ const root_child3 = Yoga.Node.create(config);
+ root_child3.setFlexGrow(1);
+ root.insertChild(root_child3, 3);
+
+ const root_child4 = Yoga.Node.create(config);
+ root_child4.setFlexGrow(1);
+ root.insertChild(root_child4, 4);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(113);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(23);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(23);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(22);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(45);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(23);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ expect(root_child3.getComputedLeft()).toBe(68);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(22);
+ expect(root_child3.getComputedHeight()).toBe(100);
+
+ expect(root_child4.getComputedLeft()).toBe(90);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(23);
+ expect(root_child4.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(113);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(90);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(23);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(68);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(22);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(45);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(23);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ expect(root_child3.getComputedLeft()).toBe(23);
+ expect(root_child3.getComputedTop()).toBe(0);
+ expect(root_child3.getComputedWidth()).toBe(22);
+ expect(root_child3.getComputedHeight()).toBe(100);
+
+ expect(root_child4.getComputedLeft()).toBe(0);
+ expect(root_child4.getComputedTop()).toBe(0);
+ expect(root_child4.getComputedWidth()).toBe(23);
+ expect(root_child4.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_flex_basis_flex_shrink_row", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(101);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexShrink(1);
+ root_child0.setFlexBasis(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexBasis(25);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexBasis(25);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(101);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(51);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(51);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(25);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(76);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(25);
+ expect(root_child2.getComputedHeight()).toBe(100);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(101);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(50);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(51);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child1.getComputedLeft()).toBe(25);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(25);
+ expect(root_child1.getComputedHeight()).toBe(100);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(25);
+ expect(root_child2.getComputedHeight()).toBe(100);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_flex_basis_overrides_main_size", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(113);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(64);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(24);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(64);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(24);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_total_fractial", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(87.4);
+ root.setHeight(113.4);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(0.7);
+ root_child0.setFlexBasis(50.3);
+ root_child0.setHeight(20.3);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1.6);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1.1);
+ root_child2.setHeight(10.7);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(87);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(87);
+ expect(root_child0.getComputedHeight()).toBe(59);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(59);
+ expect(root_child1.getComputedWidth()).toBe(87);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(87);
+ expect(root_child2.getComputedHeight()).toBe(24);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(87);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(87);
+ expect(root_child0.getComputedHeight()).toBe(59);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(59);
+ expect(root_child1.getComputedWidth()).toBe(87);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(87);
+ expect(root_child2.getComputedHeight()).toBe(24);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_total_fractial_nested", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(87.4);
+ root.setHeight(113.4);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(0.7);
+ root_child0.setFlexBasis(50.3);
+ root_child0.setHeight(20.3);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setFlexGrow(1);
+ root_child0_child0.setFlexBasis(0.3);
+ root_child0_child0.setPosition(Yoga.EDGE_BOTTOM, 13.3);
+ root_child0_child0.setHeight(9.9);
+ root_child0.insertChild(root_child0_child0, 0);
+
+ const root_child0_child1 = Yoga.Node.create(config);
+ root_child0_child1.setFlexGrow(4);
+ root_child0_child1.setFlexBasis(0.3);
+ root_child0_child1.setPosition(Yoga.EDGE_TOP, 13.3);
+ root_child0_child1.setHeight(1.1);
+ root_child0.insertChild(root_child0_child1, 1);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1.6);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1.1);
+ root_child2.setHeight(10.7);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(87);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(87);
+ expect(root_child0.getComputedHeight()).toBe(59);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(-13);
+ expect(root_child0_child0.getComputedWidth()).toBe(87);
+ expect(root_child0_child0.getComputedHeight()).toBe(12);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(25);
+ expect(root_child0_child1.getComputedWidth()).toBe(87);
+ expect(root_child0_child1.getComputedHeight()).toBe(47);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(59);
+ expect(root_child1.getComputedWidth()).toBe(87);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(87);
+ expect(root_child2.getComputedHeight()).toBe(24);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(87);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(87);
+ expect(root_child0.getComputedHeight()).toBe(59);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(-13);
+ expect(root_child0_child0.getComputedWidth()).toBe(87);
+ expect(root_child0_child0.getComputedHeight()).toBe(12);
+
+ expect(root_child0_child1.getComputedLeft()).toBe(0);
+ expect(root_child0_child1.getComputedTop()).toBe(25);
+ expect(root_child0_child1.getComputedWidth()).toBe(87);
+ expect(root_child0_child1.getComputedHeight()).toBe(47);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(59);
+ expect(root_child1.getComputedWidth()).toBe(87);
+ expect(root_child1.getComputedHeight()).toBe(30);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(87);
+ expect(root_child2.getComputedHeight()).toBe(24);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_fractial_input_1", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(113.4);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(64);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(24);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(64);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(24);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_fractial_input_2", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(113.6);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(114);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(65);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(65);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(24);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(25);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(114);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(65);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(65);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(24);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(25);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_fractial_input_3", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setPosition(Yoga.EDGE_TOP, 0.3);
+ root.setWidth(100);
+ root.setHeight(113.4);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(114);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(65);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(24);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(25);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(114);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(65);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(24);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(25);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_fractial_input_4", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setPosition(Yoga.EDGE_TOP, 0.7);
+ root.setWidth(100);
+ root.setHeight(113.4);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setFlexBasis(50);
+ root_child0.setHeight(20);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(1);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(64);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(24);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(1);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(113);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(64);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(64);
+ expect(root_child1.getComputedWidth()).toBe(100);
+ expect(root_child1.getComputedHeight()).toBe(25);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(89);
+ expect(root_child2.getComputedWidth()).toBe(100);
+ expect(root_child2.getComputedHeight()).toBe(24);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_inner_node_controversy_horizontal", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(320);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setHeight(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setFlexGrow(1);
+ root_child1_child0.setHeight(10);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(320);
+ expect(root.getComputedHeight()).toBe(10);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(107);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(107);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(106);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(106);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(213);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(107);
+ expect(root_child2.getComputedHeight()).toBe(10);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(320);
+ expect(root.getComputedHeight()).toBe(10);
+
+ expect(root_child0.getComputedLeft()).toBe(213);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(107);
+ expect(root_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child1.getComputedLeft()).toBe(107);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(106);
+ expect(root_child1.getComputedHeight()).toBe(10);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(106);
+ expect(root_child1_child0.getComputedHeight()).toBe(10);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(107);
+ expect(root_child2.getComputedHeight()).toBe(10);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_inner_node_controversy_vertical", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setHeight(320);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setWidth(10);
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setWidth(10);
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setFlexGrow(1);
+ root_child1_child0.setWidth(10);
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setWidth(10);
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(10);
+ expect(root.getComputedHeight()).toBe(320);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(107);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(107);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(106);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(10);
+ expect(root_child1_child0.getComputedHeight()).toBe(106);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(213);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(107);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(10);
+ expect(root.getComputedHeight()).toBe(320);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(10);
+ expect(root_child0.getComputedHeight()).toBe(107);
+
+ expect(root_child1.getComputedLeft()).toBe(0);
+ expect(root_child1.getComputedTop()).toBe(107);
+ expect(root_child1.getComputedWidth()).toBe(10);
+ expect(root_child1.getComputedHeight()).toBe(106);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(10);
+ expect(root_child1_child0.getComputedHeight()).toBe(106);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(213);
+ expect(root_child2.getComputedWidth()).toBe(10);
+ expect(root_child2.getComputedHeight()).toBe(107);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("rounding_inner_node_controversy_combined", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
+ root.setWidth(640);
+ root.setHeight(320);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setFlexGrow(1);
+ root_child0.setHeight("100%");
+ root.insertChild(root_child0, 0);
+
+ const root_child1 = Yoga.Node.create(config);
+ root_child1.setFlexGrow(1);
+ root_child1.setHeight("100%");
+ root.insertChild(root_child1, 1);
+
+ const root_child1_child0 = Yoga.Node.create(config);
+ root_child1_child0.setFlexGrow(1);
+ root_child1_child0.setWidth("100%");
+ root_child1.insertChild(root_child1_child0, 0);
+
+ const root_child1_child1 = Yoga.Node.create(config);
+ root_child1_child1.setFlexGrow(1);
+ root_child1_child1.setWidth("100%");
+ root_child1.insertChild(root_child1_child1, 1);
+
+ const root_child1_child1_child0 = Yoga.Node.create(config);
+ root_child1_child1_child0.setFlexGrow(1);
+ root_child1_child1_child0.setWidth("100%");
+ root_child1_child1.insertChild(root_child1_child1_child0, 0);
+
+ const root_child1_child2 = Yoga.Node.create(config);
+ root_child1_child2.setFlexGrow(1);
+ root_child1_child2.setWidth("100%");
+ root_child1.insertChild(root_child1_child2, 2);
+
+ const root_child2 = Yoga.Node.create(config);
+ root_child2.setFlexGrow(1);
+ root_child2.setHeight("100%");
+ root.insertChild(root_child2, 2);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(640);
+ expect(root.getComputedHeight()).toBe(320);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(213);
+ expect(root_child0.getComputedHeight()).toBe(320);
+
+ expect(root_child1.getComputedLeft()).toBe(213);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(214);
+ expect(root_child1.getComputedHeight()).toBe(320);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(214);
+ expect(root_child1_child0.getComputedHeight()).toBe(107);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(0);
+ expect(root_child1_child1.getComputedTop()).toBe(107);
+ expect(root_child1_child1.getComputedWidth()).toBe(214);
+ expect(root_child1_child1.getComputedHeight()).toBe(106);
+
+ expect(root_child1_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child1_child0.getComputedWidth()).toBe(214);
+ expect(root_child1_child1_child0.getComputedHeight()).toBe(106);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(0);
+ expect(root_child1_child2.getComputedTop()).toBe(213);
+ expect(root_child1_child2.getComputedWidth()).toBe(214);
+ expect(root_child1_child2.getComputedHeight()).toBe(107);
+
+ expect(root_child2.getComputedLeft()).toBe(427);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(213);
+ expect(root_child2.getComputedHeight()).toBe(320);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(640);
+ expect(root.getComputedHeight()).toBe(320);
+
+ expect(root_child0.getComputedLeft()).toBe(427);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(213);
+ expect(root_child0.getComputedHeight()).toBe(320);
+
+ expect(root_child1.getComputedLeft()).toBe(213);
+ expect(root_child1.getComputedTop()).toBe(0);
+ expect(root_child1.getComputedWidth()).toBe(214);
+ expect(root_child1.getComputedHeight()).toBe(320);
+
+ expect(root_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child0.getComputedWidth()).toBe(214);
+ expect(root_child1_child0.getComputedHeight()).toBe(107);
+
+ expect(root_child1_child1.getComputedLeft()).toBe(0);
+ expect(root_child1_child1.getComputedTop()).toBe(107);
+ expect(root_child1_child1.getComputedWidth()).toBe(214);
+ expect(root_child1_child1.getComputedHeight()).toBe(106);
+
+ expect(root_child1_child1_child0.getComputedLeft()).toBe(0);
+ expect(root_child1_child1_child0.getComputedTop()).toBe(0);
+ expect(root_child1_child1_child0.getComputedWidth()).toBe(214);
+ expect(root_child1_child1_child0.getComputedHeight()).toBe(106);
+
+ expect(root_child1_child2.getComputedLeft()).toBe(0);
+ expect(root_child1_child2.getComputedTop()).toBe(213);
+ expect(root_child1_child2.getComputedWidth()).toBe(214);
+ expect(root_child1_child2.getComputedHeight()).toBe(107);
+
+ expect(root_child2.getComputedLeft()).toBe(0);
+ expect(root_child2.getComputedTop()).toBe(0);
+ expect(root_child2.getComputedWidth()).toBe(213);
+ expect(root_child2.getComputedHeight()).toBe(320);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js
new file mode 100644
index 00000000..6fa2c119
--- /dev/null
+++ b/javascript/tests/generated/YGSizeOverflowTest.test.js
@@ -0,0 +1,183 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html
+
+test("nested_overflowing_child", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(200);
+ root_child0_child0.setHeight(200);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(200);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(-100);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(200);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("nested_overflowing_child_in_constraint_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(100);
+ root_child0.setHeight(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(200);
+ root_child0_child0.setHeight(200);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(200);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(100);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(-100);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(200);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
+test("parent_wrap_child_size_overflowing_parent", () => {
+ const config = Yoga.Config.create();
+ let root;
+
+ try {
+ root = Yoga.Node.create(config);
+ root.setWidth(100);
+ root.setHeight(100);
+
+ const root_child0 = Yoga.Node.create(config);
+ root_child0.setWidth(100);
+ root.insertChild(root_child0, 0);
+
+ const root_child0_child0 = Yoga.Node.create(config);
+ root_child0_child0.setWidth(100);
+ root_child0_child0.setHeight(200);
+ root_child0.insertChild(root_child0_child0, 0);
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+
+ root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
+
+ expect(root.getComputedLeft()).toBe(0);
+ expect(root.getComputedTop()).toBe(0);
+ expect(root.getComputedWidth()).toBe(100);
+ expect(root.getComputedHeight()).toBe(100);
+
+ expect(root_child0.getComputedLeft()).toBe(0);
+ expect(root_child0.getComputedTop()).toBe(0);
+ expect(root_child0.getComputedWidth()).toBe(100);
+ expect(root_child0.getComputedHeight()).toBe(200);
+
+ expect(root_child0_child0.getComputedLeft()).toBe(0);
+ expect(root_child0_child0.getComputedTop()).toBe(0);
+ expect(root_child0_child0.getComputedWidth()).toBe(100);
+ expect(root_child0_child0.getComputedHeight()).toBe(200);
+ } finally {
+ if (typeof root !== "undefined") {
+ root.freeRecursive();
+ }
+
+ config.free();
+ }
+});
diff --git a/javascript/tests/index.html b/javascript/tests/index.html
deleted file mode 100644
index dde606d8..00000000
--- a/javascript/tests/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js
index ce793ad1..57940928 100644
--- a/javascript/tests/run-bench.js
+++ b/javascript/tests/run-bench.js
@@ -1,3 +1,4 @@
+#!/usr/bin/env node
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -9,25 +10,27 @@
require(`./tools`);
-let fs = require(`fs`);
-let vm = require(`vm`);
+const fs = require(`fs`);
+const vm = require(`vm`);
-let WARMUP_ITERATIONS = 3;
-let BENCHMARK_ITERATIONS = 10;
+const WARMUP_ITERATIONS = 3;
+const BENCHMARK_ITERATIONS = 10;
-let testFiles = process.argv.slice(2).map(file => {
+const testFiles = process.argv.slice(2).map((file) => {
return fs.readFileSync(file).toString();
});
-let testResults = new Map();
+const testResults = new Map();
-for (let type of [`node`, `browser`]) {
- for (let file of testFiles) {
+for (const type of ["asmjs", "wasm"]) {
+ for (const file of testFiles) {
vm.runInNewContext(
file,
Object.assign(Object.create(global), {
- Yoga: require(`../dist/entry-${type}`),
- YGBENCHMARK: function(name, fn) {
+ Yoga: require(type === "asmjs"
+ ? "../dist/entrypoint/asmjs-sync"
+ : "../dist/entrypoint/wasm-sync"),
+ YGBENCHMARK: function (name, fn) {
let testEntry = testResults.get(name);
if (testEntry === undefined)
@@ -35,33 +38,33 @@ for (let type of [`node`, `browser`]) {
for (let t = 0; t < WARMUP_ITERATIONS; ++t) fn();
- let start = Date.now();
+ const start = Date.now();
for (let t = 0; t < BENCHMARK_ITERATIONS; ++t) fn();
- let end = Date.now();
+ const end = Date.now();
testEntry.set(type, (end - start) / BENCHMARK_ITERATIONS);
},
- }),
+ })
);
}
}
console.log(
- `Note: those tests are independants; there is no time relation to be expected between them`,
+ `Note: those tests are independants; there is no time relation to be expected between them`
);
-for (let [name, results] of testResults) {
+for (const [name, results] of testResults) {
console.log();
- let min = Math.min(Infinity, ...results.values());
+ const min = Math.min(Infinity, ...results.values());
console.log(name);
- for (let [type, result] of results) {
+ for (const [type, result] of results) {
console.log(
- ` - ${type}: ${result}ms (${Math.round((result / min) * 10000) / 100}%)`,
+ ` - ${type}: ${result}ms (${Math.round((result / min) * 10000) / 100}%)`
);
}
}
diff --git a/javascript/tests/tools.js b/javascript/tests/tools.js
index ac18e450..a72464ee 100644
--- a/javascript/tests/tools.js
+++ b/javascript/tests/tools.js
@@ -7,59 +7,48 @@
* @format
*/
-var target = typeof global !== 'undefined' ? global : window;
-
-target.getMeasureCounter = function(Yoga, cb, staticWidth, staticHeight) {
- var counter = 0;
+global.getMeasureCounter = function (Yoga, cb, staticWidth, staticHeight) {
+ let counter = 0;
return {
- inc: function(width, widthMode, height, heightMode) {
+ inc: function (width, widthMode, height, heightMode) {
counter += 1;
return cb
? cb(width, widthMode, height, heightMode)
- : {width: staticWidth, height: staticHeight};
+ : { width: staticWidth, height: staticHeight };
},
- get: function() {
+ get: function () {
return counter;
},
};
};
-target.getMeasureCounterMax = function(Yoga) {
- return getMeasureCounter(Yoga, function(
- width,
- widthMode,
- height,
- heightMode,
- ) {
- var measuredWidth = widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width;
- var measuredHeight =
+global.getMeasureCounterMax = function (Yoga) {
+ return getMeasureCounter(Yoga, (width, widthMode, height, heightMode) => {
+ const measuredWidth =
+ widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width;
+ const measuredHeight =
heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height;
- return {width: measuredWidth, height: measuredHeight};
+ return { width: measuredWidth, height: measuredHeight };
});
};
-target.getMeasureCounterMin = function(Yoga) {
- return getMeasureCounter(Yoga, function(
- width,
- widthMode,
- height,
- heightMode,
- ) {
- var measuredWidth =
+global.getMeasureCounterMin = function (Yoga) {
+ return getMeasureCounter(Yoga, (width, widthMode, height, heightMode) => {
+ const measuredWidth =
widthMode === Yoga.MEASURE_MODE_UNDEFINED ||
(widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10)
? 10
: width;
- var measuredHeight =
+ const measuredHeight =
heightMode === Yoga.MEASURE_MODE_UNDEFINED ||
(heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10)
? 10
: height;
- return {width: measuredWidth, height: measuredHeight};
+ return { width: measuredWidth, height: measuredHeight };
});
};
diff --git a/javascript/yarn.lock b/javascript/yarn.lock
index 08abeebf..0cfd027e 100644
--- a/javascript/yarn.lock
+++ b/javascript/yarn.lock
@@ -2,12 +2,1485 @@
# yarn lockfile v1
-abbrev@1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
- integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
+"@ampproject/remapping@^2.1.0":
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d"
+ integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==
+ dependencies:
+ "@jridgewell/gen-mapping" "^0.1.0"
+ "@jridgewell/trace-mapping" "^0.3.9"
-ajv@^6.12.3:
+"@babel/cli@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.20.7.tgz#8fc12e85c744a1a617680eacb488fab1fcd35b7c"
+ integrity sha512-WylgcELHB66WwQqItxNILsMlaTd8/SO6SgTTjMp4uCI7P4QyH1r3nqgFmO3BfM4AtfniHgFMH3EpYFj/zynBkQ==
+ dependencies:
+ "@jridgewell/trace-mapping" "^0.3.8"
+ commander "^4.0.1"
+ convert-source-map "^1.1.0"
+ fs-readdir-recursive "^1.1.0"
+ glob "^7.2.0"
+ make-dir "^2.1.0"
+ slash "^2.0.0"
+ optionalDependencies:
+ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3"
+ chokidar "^3.4.0"
+
+"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a"
+ integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==
+ dependencies:
+ "@babel/highlight" "^7.18.6"
+
+"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.1", "@babel/compat-data@^7.20.5":
+ version "7.20.5"
+ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.5.tgz#86f172690b093373a933223b4745deeb6049e733"
+ integrity sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==
+
+"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.7.tgz#37072f951bd4d28315445f66e0ec9f6ae0c8c35f"
+ integrity sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw==
+ dependencies:
+ "@ampproject/remapping" "^2.1.0"
+ "@babel/code-frame" "^7.18.6"
+ "@babel/generator" "^7.20.7"
+ "@babel/helper-compilation-targets" "^7.20.7"
+ "@babel/helper-module-transforms" "^7.20.7"
+ "@babel/helpers" "^7.20.7"
+ "@babel/parser" "^7.20.7"
+ "@babel/template" "^7.20.7"
+ "@babel/traverse" "^7.20.7"
+ "@babel/types" "^7.20.7"
+ convert-source-map "^1.7.0"
+ debug "^4.1.0"
+ gensync "^1.0.0-beta.2"
+ json5 "^2.2.1"
+ semver "^6.3.0"
+
+"@babel/eslint-parser@^7.19.1":
+ version "7.19.1"
+ resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz#4f68f6b0825489e00a24b41b6a1ae35414ecd2f4"
+ integrity sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==
+ dependencies:
+ "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1"
+ eslint-visitor-keys "^2.1.0"
+ semver "^6.3.0"
+
+"@babel/generator@^7.20.7", "@babel/generator@^7.7.2":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a"
+ integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==
+ dependencies:
+ "@babel/types" "^7.20.7"
+ "@jridgewell/gen-mapping" "^0.3.2"
+ jsesc "^2.5.1"
+
+"@babel/helper-annotate-as-pure@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb"
+ integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==
+ dependencies:
+ "@babel/types" "^7.18.6"
+
+"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb"
+ integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==
+ dependencies:
+ "@babel/helper-explode-assignable-expression" "^7.18.6"
+ "@babel/types" "^7.18.9"
+
+"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.0", "@babel/helper-compilation-targets@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb"
+ integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==
+ dependencies:
+ "@babel/compat-data" "^7.20.5"
+ "@babel/helper-validator-option" "^7.18.6"
+ browserslist "^4.21.3"
+ lru-cache "^5.1.1"
+ semver "^6.3.0"
+
+"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.5", "@babel/helper-create-class-features-plugin@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.7.tgz#d0e1f8d7e4ed5dac0389364d9c0c191d948ade6f"
+ integrity sha512-LtoWbDXOaidEf50hmdDqn9g8VEzsorMexoWMQdQODbvmqYmaF23pBP5VNPAGIFHsFQCIeKokDiz3CH5Y2jlY6w==
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.18.6"
+ "@babel/helper-environment-visitor" "^7.18.9"
+ "@babel/helper-function-name" "^7.19.0"
+ "@babel/helper-member-expression-to-functions" "^7.20.7"
+ "@babel/helper-optimise-call-expression" "^7.18.6"
+ "@babel/helper-replace-supers" "^7.20.7"
+ "@babel/helper-split-export-declaration" "^7.18.6"
+
+"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5":
+ version "7.20.5"
+ resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca"
+ integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.18.6"
+ regexpu-core "^5.2.1"
+
+"@babel/helper-define-polyfill-provider@^0.3.3":
+ version "0.3.3"
+ resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a"
+ integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==
+ dependencies:
+ "@babel/helper-compilation-targets" "^7.17.7"
+ "@babel/helper-plugin-utils" "^7.16.7"
+ debug "^4.1.1"
+ lodash.debounce "^4.0.8"
+ resolve "^1.14.2"
+ semver "^6.1.2"
+
+"@babel/helper-environment-visitor@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be"
+ integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==
+
+"@babel/helper-explode-assignable-expression@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096"
+ integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==
+ dependencies:
+ "@babel/types" "^7.18.6"
+
+"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0":
+ version "7.19.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c"
+ integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==
+ dependencies:
+ "@babel/template" "^7.18.10"
+ "@babel/types" "^7.19.0"
+
+"@babel/helper-hoist-variables@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678"
+ integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==
+ dependencies:
+ "@babel/types" "^7.18.6"
+
+"@babel/helper-member-expression-to-functions@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz#a6f26e919582275a93c3aa6594756d71b0bb7f05"
+ integrity sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw==
+ dependencies:
+ "@babel/types" "^7.20.7"
+
+"@babel/helper-module-imports@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e"
+ integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==
+ dependencies:
+ "@babel/types" "^7.18.6"
+
+"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.6", "@babel/helper-module-transforms@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.7.tgz#7a6c9a1155bef55e914af574153069c9d9470c43"
+ integrity sha512-FNdu7r67fqMUSVuQpFQGE6BPdhJIhitoxhGzDbAXNcA07uoVG37fOiMk3OSV8rEICuyG6t8LGkd9EE64qIEoIA==
+ dependencies:
+ "@babel/helper-environment-visitor" "^7.18.9"
+ "@babel/helper-module-imports" "^7.18.6"
+ "@babel/helper-simple-access" "^7.20.2"
+ "@babel/helper-split-export-declaration" "^7.18.6"
+ "@babel/helper-validator-identifier" "^7.19.1"
+ "@babel/template" "^7.20.7"
+ "@babel/traverse" "^7.20.7"
+ "@babel/types" "^7.20.7"
+
+"@babel/helper-optimise-call-expression@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe"
+ integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==
+ dependencies:
+ "@babel/types" "^7.18.6"
+
+"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3":
+ version "7.20.2"
+ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629"
+ integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==
+
+"@babel/helper-remap-async-to-generator@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519"
+ integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.18.6"
+ "@babel/helper-environment-visitor" "^7.18.9"
+ "@babel/helper-wrap-function" "^7.18.9"
+ "@babel/types" "^7.18.9"
+
+"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331"
+ integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==
+ dependencies:
+ "@babel/helper-environment-visitor" "^7.18.9"
+ "@babel/helper-member-expression-to-functions" "^7.20.7"
+ "@babel/helper-optimise-call-expression" "^7.18.6"
+ "@babel/template" "^7.20.7"
+ "@babel/traverse" "^7.20.7"
+ "@babel/types" "^7.20.7"
+
+"@babel/helper-simple-access@^7.20.2":
+ version "7.20.2"
+ resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9"
+ integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==
+ dependencies:
+ "@babel/types" "^7.20.2"
+
+"@babel/helper-skip-transparent-expression-wrappers@^7.20.0":
+ version "7.20.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684"
+ integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==
+ dependencies:
+ "@babel/types" "^7.20.0"
+
+"@babel/helper-split-export-declaration@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075"
+ integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==
+ dependencies:
+ "@babel/types" "^7.18.6"
+
+"@babel/helper-string-parser@^7.19.4":
+ version "7.19.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63"
+ integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==
+
+"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1":
+ version "7.19.1"
+ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
+ integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==
+
+"@babel/helper-validator-option@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8"
+ integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==
+
+"@babel/helper-wrap-function@^7.18.9":
+ version "7.20.5"
+ resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3"
+ integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==
+ dependencies:
+ "@babel/helper-function-name" "^7.19.0"
+ "@babel/template" "^7.18.10"
+ "@babel/traverse" "^7.20.5"
+ "@babel/types" "^7.20.5"
+
+"@babel/helpers@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.7.tgz#04502ff0feecc9f20ecfaad120a18f011a8e6dce"
+ integrity sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA==
+ dependencies:
+ "@babel/template" "^7.20.7"
+ "@babel/traverse" "^7.20.7"
+ "@babel/types" "^7.20.7"
+
+"@babel/highlight@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf"
+ integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==
+ dependencies:
+ "@babel/helper-validator-identifier" "^7.18.6"
+ chalk "^2.0.0"
+ js-tokens "^4.0.0"
+
+"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b"
+ integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==
+
+"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2"
+ integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz#d9c85589258539a22a901033853101a6198d4ef1"
+ integrity sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0"
+ "@babel/plugin-proposal-optional-chaining" "^7.20.7"
+
+"@babel/plugin-proposal-async-generator-functions@^7.20.1":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326"
+ integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==
+ dependencies:
+ "@babel/helper-environment-visitor" "^7.18.9"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-remap-async-to-generator" "^7.18.9"
+ "@babel/plugin-syntax-async-generators" "^7.8.4"
+
+"@babel/plugin-proposal-class-properties@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3"
+ integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==
+ dependencies:
+ "@babel/helper-create-class-features-plugin" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-proposal-class-static-block@^7.18.6":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz#92592e9029b13b15be0f7ce6a7aedc2879ca45a7"
+ integrity sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ==
+ dependencies:
+ "@babel/helper-create-class-features-plugin" "^7.20.7"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/plugin-syntax-class-static-block" "^7.14.5"
+
+"@babel/plugin-proposal-dynamic-import@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94"
+ integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+ "@babel/plugin-syntax-dynamic-import" "^7.8.3"
+
+"@babel/plugin-proposal-export-namespace-from@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203"
+ integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.9"
+ "@babel/plugin-syntax-export-namespace-from" "^7.8.3"
+
+"@babel/plugin-proposal-json-strings@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b"
+ integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+ "@babel/plugin-syntax-json-strings" "^7.8.3"
+
+"@babel/plugin-proposal-logical-assignment-operators@^7.18.9":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83"
+ integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4"
+
+"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1"
+ integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+ "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3"
+
+"@babel/plugin-proposal-numeric-separator@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75"
+ integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+ "@babel/plugin-syntax-numeric-separator" "^7.10.4"
+
+"@babel/plugin-proposal-object-rest-spread@^7.20.2":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a"
+ integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==
+ dependencies:
+ "@babel/compat-data" "^7.20.5"
+ "@babel/helper-compilation-targets" "^7.20.7"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/plugin-syntax-object-rest-spread" "^7.8.3"
+ "@babel/plugin-transform-parameters" "^7.20.7"
+
+"@babel/plugin-proposal-optional-catch-binding@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb"
+ integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+ "@babel/plugin-syntax-optional-catch-binding" "^7.8.3"
+
+"@babel/plugin-proposal-optional-chaining@^7.18.9", "@babel/plugin-proposal-optional-chaining@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz#49f2b372519ab31728cc14115bb0998b15bfda55"
+ integrity sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0"
+ "@babel/plugin-syntax-optional-chaining" "^7.8.3"
+
+"@babel/plugin-proposal-private-methods@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea"
+ integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==
+ dependencies:
+ "@babel/helper-create-class-features-plugin" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-proposal-private-property-in-object@^7.18.6":
+ version "7.20.5"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz#309c7668f2263f1c711aa399b5a9a6291eef6135"
+ integrity sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.18.6"
+ "@babel/helper-create-class-features-plugin" "^7.20.5"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/plugin-syntax-private-property-in-object" "^7.14.5"
+
+"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e"
+ integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==
+ dependencies:
+ "@babel/helper-create-regexp-features-plugin" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-syntax-async-generators@^7.8.4":
+ version "7.8.4"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d"
+ integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-bigint@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea"
+ integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3":
+ version "7.12.13"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10"
+ integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.12.13"
+
+"@babel/plugin-syntax-class-static-block@^7.14.5":
+ version "7.14.5"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406"
+ integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.14.5"
+
+"@babel/plugin-syntax-dynamic-import@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3"
+ integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-export-namespace-from@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a"
+ integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.3"
+
+"@babel/plugin-syntax-import-assertions@^7.20.0":
+ version "7.20.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4"
+ integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.19.0"
+
+"@babel/plugin-syntax-import-meta@^7.8.3":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51"
+ integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.10.4"
+
+"@babel/plugin-syntax-json-strings@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a"
+ integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-jsx@^7.7.2":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0"
+ integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699"
+ integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.10.4"
+
+"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"
+ integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-numeric-separator@^7.10.4", "@babel/plugin-syntax-numeric-separator@^7.8.3":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97"
+ integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.10.4"
+
+"@babel/plugin-syntax-object-rest-spread@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871"
+ integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-optional-catch-binding@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1"
+ integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-optional-chaining@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a"
+ integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-private-property-in-object@^7.14.5":
+ version "7.14.5"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad"
+ integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.14.5"
+
+"@babel/plugin-syntax-top-level-await@^7.14.5", "@babel/plugin-syntax-top-level-await@^7.8.3":
+ version "7.14.5"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c"
+ integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.14.5"
+
+"@babel/plugin-syntax-typescript@^7.7.2":
+ version "7.20.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7"
+ integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.19.0"
+
+"@babel/plugin-transform-arrow-functions@^7.18.6":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551"
+ integrity sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+
+"@babel/plugin-transform-async-to-generator@^7.18.6":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz#dfee18623c8cb31deb796aa3ca84dda9cea94354"
+ integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==
+ dependencies:
+ "@babel/helper-module-imports" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-remap-async-to-generator" "^7.18.9"
+
+"@babel/plugin-transform-block-scoped-functions@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8"
+ integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-block-scoping@^7.20.2":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.7.tgz#5cc9cc3f3976de7f632d3f20eab3abee299ed36e"
+ integrity sha512-C1njwSKnumUgtgc4j1LAWR48PkfwfHHRd8bWyolSCLShKnqA52VX1+B+GZhJteQlwZeSqYddCQh9Str816Jxtw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+
+"@babel/plugin-transform-classes@^7.20.2":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.7.tgz#f438216f094f6bb31dc266ebfab8ff05aecad073"
+ integrity sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ==
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.18.6"
+ "@babel/helper-compilation-targets" "^7.20.7"
+ "@babel/helper-environment-visitor" "^7.18.9"
+ "@babel/helper-function-name" "^7.19.0"
+ "@babel/helper-optimise-call-expression" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-replace-supers" "^7.20.7"
+ "@babel/helper-split-export-declaration" "^7.18.6"
+ globals "^11.1.0"
+
+"@babel/plugin-transform-computed-properties@^7.18.9":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz#704cc2fd155d1c996551db8276d55b9d46e4d0aa"
+ integrity sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/template" "^7.20.7"
+
+"@babel/plugin-transform-destructuring@^7.20.2":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.7.tgz#8bda578f71620c7de7c93af590154ba331415454"
+ integrity sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+
+"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8"
+ integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==
+ dependencies:
+ "@babel/helper-create-regexp-features-plugin" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-duplicate-keys@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e"
+ integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.9"
+
+"@babel/plugin-transform-exponentiation-operator@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd"
+ integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==
+ dependencies:
+ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-for-of@^7.18.8":
+ version "7.18.8"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1"
+ integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-function-name@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0"
+ integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==
+ dependencies:
+ "@babel/helper-compilation-targets" "^7.18.9"
+ "@babel/helper-function-name" "^7.18.9"
+ "@babel/helper-plugin-utils" "^7.18.9"
+
+"@babel/plugin-transform-literals@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc"
+ integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.9"
+
+"@babel/plugin-transform-member-expression-literals@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e"
+ integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-modules-amd@^7.19.6":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.7.tgz#1e5cfeb4e5f9b392e86f85698896336b442f8760"
+ integrity sha512-+1IVLD+dHOzRZWNFFSoyPZz4ffsVmOP+OhhjeahLKpU97v/52LcCb9RabRl5eHM1/HAuH5Dl0q9Pyzrq1v2otQ==
+ dependencies:
+ "@babel/helper-module-transforms" "^7.20.7"
+ "@babel/helper-plugin-utils" "^7.20.2"
+
+"@babel/plugin-transform-modules-commonjs@^7.19.6":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.20.7.tgz#abb5f84695e74d46acf48244082f6cbf8bb23120"
+ integrity sha512-76jqqFiFdCD+RJwEdtBHUG2/rEKQAmpejPbAKyQECEE3/y4U5CMPc9IXvipS990vgQhzq+ZRw6WJ+q4xJ/P24w==
+ dependencies:
+ "@babel/helper-module-transforms" "^7.20.7"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-simple-access" "^7.20.2"
+
+"@babel/plugin-transform-modules-systemjs@^7.19.6":
+ version "7.19.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.6.tgz#59e2a84064b5736a4471b1aa7b13d4431d327e0d"
+ integrity sha512-fqGLBepcc3kErfR9R3DnVpURmckXP7gj7bAlrTQyBxrigFqszZCkFkcoxzCp2v32XmwXLvbw+8Yq9/b+QqksjQ==
+ dependencies:
+ "@babel/helper-hoist-variables" "^7.18.6"
+ "@babel/helper-module-transforms" "^7.19.6"
+ "@babel/helper-plugin-utils" "^7.19.0"
+ "@babel/helper-validator-identifier" "^7.19.1"
+
+"@babel/plugin-transform-modules-umd@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9"
+ integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==
+ dependencies:
+ "@babel/helper-module-transforms" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-named-capturing-groups-regex@^7.19.1":
+ version "7.20.5"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8"
+ integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==
+ dependencies:
+ "@babel/helper-create-regexp-features-plugin" "^7.20.5"
+ "@babel/helper-plugin-utils" "^7.20.2"
+
+"@babel/plugin-transform-new-target@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8"
+ integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-object-super@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c"
+ integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+ "@babel/helper-replace-supers" "^7.18.6"
+
+"@babel/plugin-transform-parameters@^7.20.1", "@babel/plugin-transform-parameters@^7.20.7":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.7.tgz#0ee349e9d1bc96e78e3b37a7af423a4078a7083f"
+ integrity sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+
+"@babel/plugin-transform-property-literals@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3"
+ integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-regenerator@^7.18.6":
+ version "7.20.5"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d"
+ integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+ regenerator-transform "^0.15.1"
+
+"@babel/plugin-transform-reserved-words@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a"
+ integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-shorthand-properties@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9"
+ integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-spread@^7.19.0":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz#c2d83e0b99d3bf83e07b11995ee24bf7ca09401e"
+ integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0"
+
+"@babel/plugin-transform-sticky-regex@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc"
+ integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/plugin-transform-template-literals@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e"
+ integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.9"
+
+"@babel/plugin-transform-typeof-symbol@^7.18.9":
+ version "7.18.9"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0"
+ integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.9"
+
+"@babel/plugin-transform-unicode-escapes@^7.18.10":
+ version "7.18.10"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246"
+ integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.18.9"
+
+"@babel/plugin-transform-unicode-regex@^7.18.6":
+ version "7.18.6"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca"
+ integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==
+ dependencies:
+ "@babel/helper-create-regexp-features-plugin" "^7.18.6"
+ "@babel/helper-plugin-utils" "^7.18.6"
+
+"@babel/preset-env@^7.20.2":
+ version "7.20.2"
+ resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.20.2.tgz#9b1642aa47bb9f43a86f9630011780dab7f86506"
+ integrity sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg==
+ dependencies:
+ "@babel/compat-data" "^7.20.1"
+ "@babel/helper-compilation-targets" "^7.20.0"
+ "@babel/helper-plugin-utils" "^7.20.2"
+ "@babel/helper-validator-option" "^7.18.6"
+ "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6"
+ "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9"
+ "@babel/plugin-proposal-async-generator-functions" "^7.20.1"
+ "@babel/plugin-proposal-class-properties" "^7.18.6"
+ "@babel/plugin-proposal-class-static-block" "^7.18.6"
+ "@babel/plugin-proposal-dynamic-import" "^7.18.6"
+ "@babel/plugin-proposal-export-namespace-from" "^7.18.9"
+ "@babel/plugin-proposal-json-strings" "^7.18.6"
+ "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9"
+ "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6"
+ "@babel/plugin-proposal-numeric-separator" "^7.18.6"
+ "@babel/plugin-proposal-object-rest-spread" "^7.20.2"
+ "@babel/plugin-proposal-optional-catch-binding" "^7.18.6"
+ "@babel/plugin-proposal-optional-chaining" "^7.18.9"
+ "@babel/plugin-proposal-private-methods" "^7.18.6"
+ "@babel/plugin-proposal-private-property-in-object" "^7.18.6"
+ "@babel/plugin-proposal-unicode-property-regex" "^7.18.6"
+ "@babel/plugin-syntax-async-generators" "^7.8.4"
+ "@babel/plugin-syntax-class-properties" "^7.12.13"
+ "@babel/plugin-syntax-class-static-block" "^7.14.5"
+ "@babel/plugin-syntax-dynamic-import" "^7.8.3"
+ "@babel/plugin-syntax-export-namespace-from" "^7.8.3"
+ "@babel/plugin-syntax-import-assertions" "^7.20.0"
+ "@babel/plugin-syntax-json-strings" "^7.8.3"
+ "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4"
+ "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3"
+ "@babel/plugin-syntax-numeric-separator" "^7.10.4"
+ "@babel/plugin-syntax-object-rest-spread" "^7.8.3"
+ "@babel/plugin-syntax-optional-catch-binding" "^7.8.3"
+ "@babel/plugin-syntax-optional-chaining" "^7.8.3"
+ "@babel/plugin-syntax-private-property-in-object" "^7.14.5"
+ "@babel/plugin-syntax-top-level-await" "^7.14.5"
+ "@babel/plugin-transform-arrow-functions" "^7.18.6"
+ "@babel/plugin-transform-async-to-generator" "^7.18.6"
+ "@babel/plugin-transform-block-scoped-functions" "^7.18.6"
+ "@babel/plugin-transform-block-scoping" "^7.20.2"
+ "@babel/plugin-transform-classes" "^7.20.2"
+ "@babel/plugin-transform-computed-properties" "^7.18.9"
+ "@babel/plugin-transform-destructuring" "^7.20.2"
+ "@babel/plugin-transform-dotall-regex" "^7.18.6"
+ "@babel/plugin-transform-duplicate-keys" "^7.18.9"
+ "@babel/plugin-transform-exponentiation-operator" "^7.18.6"
+ "@babel/plugin-transform-for-of" "^7.18.8"
+ "@babel/plugin-transform-function-name" "^7.18.9"
+ "@babel/plugin-transform-literals" "^7.18.9"
+ "@babel/plugin-transform-member-expression-literals" "^7.18.6"
+ "@babel/plugin-transform-modules-amd" "^7.19.6"
+ "@babel/plugin-transform-modules-commonjs" "^7.19.6"
+ "@babel/plugin-transform-modules-systemjs" "^7.19.6"
+ "@babel/plugin-transform-modules-umd" "^7.18.6"
+ "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.1"
+ "@babel/plugin-transform-new-target" "^7.18.6"
+ "@babel/plugin-transform-object-super" "^7.18.6"
+ "@babel/plugin-transform-parameters" "^7.20.1"
+ "@babel/plugin-transform-property-literals" "^7.18.6"
+ "@babel/plugin-transform-regenerator" "^7.18.6"
+ "@babel/plugin-transform-reserved-words" "^7.18.6"
+ "@babel/plugin-transform-shorthand-properties" "^7.18.6"
+ "@babel/plugin-transform-spread" "^7.19.0"
+ "@babel/plugin-transform-sticky-regex" "^7.18.6"
+ "@babel/plugin-transform-template-literals" "^7.18.9"
+ "@babel/plugin-transform-typeof-symbol" "^7.18.9"
+ "@babel/plugin-transform-unicode-escapes" "^7.18.10"
+ "@babel/plugin-transform-unicode-regex" "^7.18.6"
+ "@babel/preset-modules" "^0.1.5"
+ "@babel/types" "^7.20.2"
+ babel-plugin-polyfill-corejs2 "^0.3.3"
+ babel-plugin-polyfill-corejs3 "^0.6.0"
+ babel-plugin-polyfill-regenerator "^0.4.1"
+ core-js-compat "^3.25.1"
+ semver "^6.3.0"
+
+"@babel/preset-modules@^0.1.5":
+ version "0.1.5"
+ resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9"
+ integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+ "@babel/plugin-proposal-unicode-property-regex" "^7.4.4"
+ "@babel/plugin-transform-dotall-regex" "^7.4.4"
+ "@babel/types" "^7.4.4"
+ esutils "^2.0.2"
+
+"@babel/runtime@^7.8.4":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd"
+ integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ==
+ dependencies:
+ regenerator-runtime "^0.13.11"
+
+"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8"
+ integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==
+ dependencies:
+ "@babel/code-frame" "^7.18.6"
+ "@babel/parser" "^7.20.7"
+ "@babel/types" "^7.20.7"
+
+"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.7.tgz#114f992fa989a390896ea72db5220780edab509c"
+ integrity sha512-xueOL5+ZKX2dJbg8z8o4f4uTRTqGDRjilva9D1hiRlayJbTY8jBRL+Ph67IeRTIE439/VifHk+Z4g0SwRtQE0A==
+ dependencies:
+ "@babel/code-frame" "^7.18.6"
+ "@babel/generator" "^7.20.7"
+ "@babel/helper-environment-visitor" "^7.18.9"
+ "@babel/helper-function-name" "^7.19.0"
+ "@babel/helper-hoist-variables" "^7.18.6"
+ "@babel/helper-split-export-declaration" "^7.18.6"
+ "@babel/parser" "^7.20.7"
+ "@babel/types" "^7.20.7"
+ debug "^4.1.0"
+ globals "^11.1.0"
+
+"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
+ version "7.20.7"
+ resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f"
+ integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==
+ dependencies:
+ "@babel/helper-string-parser" "^7.19.4"
+ "@babel/helper-validator-identifier" "^7.19.1"
+ to-fast-properties "^2.0.0"
+
+"@bcoe/v8-coverage@^0.2.3":
+ version "0.2.3"
+ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
+ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
+
+"@colors/colors@1.5.0":
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
+ integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
+
+"@eslint/eslintrc@^1.4.0":
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.0.tgz#8ec64e0df3e7a1971ee1ff5158da87389f167a63"
+ integrity sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==
+ dependencies:
+ ajv "^6.12.4"
+ debug "^4.3.2"
+ espree "^9.4.0"
+ globals "^13.19.0"
+ ignore "^5.2.0"
+ import-fresh "^3.2.1"
+ js-yaml "^4.1.0"
+ minimatch "^3.1.2"
+ strip-json-comments "^3.1.1"
+
+"@humanwhocodes/config-array@^0.11.8":
+ version "0.11.8"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9"
+ integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==
+ dependencies:
+ "@humanwhocodes/object-schema" "^1.2.1"
+ debug "^4.1.1"
+ minimatch "^3.0.5"
+
+"@humanwhocodes/module-importer@^1.0.1":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c"
+ integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==
+
+"@humanwhocodes/object-schema@^1.2.1":
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
+ integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
+
+"@istanbuljs/load-nyc-config@^1.0.0":
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
+ integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==
+ dependencies:
+ camelcase "^5.3.1"
+ find-up "^4.1.0"
+ get-package-type "^0.1.0"
+ js-yaml "^3.13.1"
+ resolve-from "^5.0.0"
+
+"@istanbuljs/schema@^0.1.2":
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98"
+ integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==
+
+"@jest/console@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.3.1.tgz#3e3f876e4e47616ea3b1464b9fbda981872e9583"
+ integrity sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg==
+ dependencies:
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ chalk "^4.0.0"
+ jest-message-util "^29.3.1"
+ jest-util "^29.3.1"
+ slash "^3.0.0"
+
+"@jest/core@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.1.tgz#bff00f413ff0128f4debec1099ba7dcd649774a1"
+ integrity sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw==
+ dependencies:
+ "@jest/console" "^29.3.1"
+ "@jest/reporters" "^29.3.1"
+ "@jest/test-result" "^29.3.1"
+ "@jest/transform" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ ansi-escapes "^4.2.1"
+ chalk "^4.0.0"
+ ci-info "^3.2.0"
+ exit "^0.1.2"
+ graceful-fs "^4.2.9"
+ jest-changed-files "^29.2.0"
+ jest-config "^29.3.1"
+ jest-haste-map "^29.3.1"
+ jest-message-util "^29.3.1"
+ jest-regex-util "^29.2.0"
+ jest-resolve "^29.3.1"
+ jest-resolve-dependencies "^29.3.1"
+ jest-runner "^29.3.1"
+ jest-runtime "^29.3.1"
+ jest-snapshot "^29.3.1"
+ jest-util "^29.3.1"
+ jest-validate "^29.3.1"
+ jest-watcher "^29.3.1"
+ micromatch "^4.0.4"
+ pretty-format "^29.3.1"
+ slash "^3.0.0"
+ strip-ansi "^6.0.0"
+
+"@jest/environment@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6"
+ integrity sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag==
+ dependencies:
+ "@jest/fake-timers" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ jest-mock "^29.3.1"
+
+"@jest/expect-utils@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6"
+ integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g==
+ dependencies:
+ jest-get-type "^29.2.0"
+
+"@jest/expect@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.1.tgz#456385b62894349c1d196f2d183e3716d4c6a6cd"
+ integrity sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg==
+ dependencies:
+ expect "^29.3.1"
+ jest-snapshot "^29.3.1"
+
+"@jest/fake-timers@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.1.tgz#b140625095b60a44de820876d4c14da1aa963f67"
+ integrity sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A==
+ dependencies:
+ "@jest/types" "^29.3.1"
+ "@sinonjs/fake-timers" "^9.1.2"
+ "@types/node" "*"
+ jest-message-util "^29.3.1"
+ jest-mock "^29.3.1"
+ jest-util "^29.3.1"
+
+"@jest/globals@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.1.tgz#92be078228e82d629df40c3656d45328f134a0c6"
+ integrity sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q==
+ dependencies:
+ "@jest/environment" "^29.3.1"
+ "@jest/expect" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ jest-mock "^29.3.1"
+
+"@jest/reporters@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.1.tgz#9a6d78c109608e677c25ddb34f907b90e07b4310"
+ integrity sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA==
+ dependencies:
+ "@bcoe/v8-coverage" "^0.2.3"
+ "@jest/console" "^29.3.1"
+ "@jest/test-result" "^29.3.1"
+ "@jest/transform" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@jridgewell/trace-mapping" "^0.3.15"
+ "@types/node" "*"
+ chalk "^4.0.0"
+ collect-v8-coverage "^1.0.0"
+ exit "^0.1.2"
+ glob "^7.1.3"
+ graceful-fs "^4.2.9"
+ istanbul-lib-coverage "^3.0.0"
+ istanbul-lib-instrument "^5.1.0"
+ istanbul-lib-report "^3.0.0"
+ istanbul-lib-source-maps "^4.0.0"
+ istanbul-reports "^3.1.3"
+ jest-message-util "^29.3.1"
+ jest-util "^29.3.1"
+ jest-worker "^29.3.1"
+ slash "^3.0.0"
+ string-length "^4.0.1"
+ strip-ansi "^6.0.0"
+ v8-to-istanbul "^9.0.1"
+
+"@jest/schemas@^29.0.0":
+ version "29.0.0"
+ resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a"
+ integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA==
+ dependencies:
+ "@sinclair/typebox" "^0.24.1"
+
+"@jest/source-map@^29.2.0":
+ version "29.2.0"
+ resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744"
+ integrity sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ==
+ dependencies:
+ "@jridgewell/trace-mapping" "^0.3.15"
+ callsites "^3.0.0"
+ graceful-fs "^4.2.9"
+
+"@jest/test-result@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.3.1.tgz#92cd5099aa94be947560a24610aa76606de78f50"
+ integrity sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw==
+ dependencies:
+ "@jest/console" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/istanbul-lib-coverage" "^2.0.0"
+ collect-v8-coverage "^1.0.0"
+
+"@jest/test-sequencer@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.1.tgz#fa24b3b050f7a59d48f7ef9e0b782ab65123090d"
+ integrity sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA==
+ dependencies:
+ "@jest/test-result" "^29.3.1"
+ graceful-fs "^4.2.9"
+ jest-haste-map "^29.3.1"
+ slash "^3.0.0"
+
+"@jest/transform@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.1.tgz#1e6bd3da4af50b5c82a539b7b1f3770568d6e36d"
+ integrity sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug==
+ dependencies:
+ "@babel/core" "^7.11.6"
+ "@jest/types" "^29.3.1"
+ "@jridgewell/trace-mapping" "^0.3.15"
+ babel-plugin-istanbul "^6.1.1"
+ chalk "^4.0.0"
+ convert-source-map "^2.0.0"
+ fast-json-stable-stringify "^2.1.0"
+ graceful-fs "^4.2.9"
+ jest-haste-map "^29.3.1"
+ jest-regex-util "^29.2.0"
+ jest-util "^29.3.1"
+ micromatch "^4.0.4"
+ pirates "^4.0.4"
+ slash "^3.0.0"
+ write-file-atomic "^4.0.1"
+
+"@jest/types@^29.3.1":
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3"
+ integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA==
+ dependencies:
+ "@jest/schemas" "^29.0.0"
+ "@types/istanbul-lib-coverage" "^2.0.0"
+ "@types/istanbul-reports" "^3.0.0"
+ "@types/node" "*"
+ "@types/yargs" "^17.0.8"
+ chalk "^4.0.0"
+
+"@jridgewell/gen-mapping@^0.1.0":
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996"
+ integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==
+ dependencies:
+ "@jridgewell/set-array" "^1.0.0"
+ "@jridgewell/sourcemap-codec" "^1.4.10"
+
+"@jridgewell/gen-mapping@^0.3.2":
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9"
+ integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==
+ dependencies:
+ "@jridgewell/set-array" "^1.0.1"
+ "@jridgewell/sourcemap-codec" "^1.4.10"
+ "@jridgewell/trace-mapping" "^0.3.9"
+
+"@jridgewell/resolve-uri@3.1.0":
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78"
+ integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==
+
+"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1":
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72"
+ integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==
+
+"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10":
+ version "1.4.14"
+ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"
+ integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==
+
+"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.8", "@jridgewell/trace-mapping@^0.3.9":
+ version "0.3.17"
+ resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985"
+ integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==
+ dependencies:
+ "@jridgewell/resolve-uri" "3.1.0"
+ "@jridgewell/sourcemap-codec" "1.4.14"
+
+"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3":
+ version "2.1.8-no-fsevents.3"
+ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b"
+ integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==
+
+"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1":
+ version "5.1.1-v1"
+ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129"
+ integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==
+ dependencies:
+ eslint-scope "5.1.1"
+
+"@nodelib/fs.scandir@2.1.5":
+ version "2.1.5"
+ resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
+ integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==
+ dependencies:
+ "@nodelib/fs.stat" "2.0.5"
+ run-parallel "^1.1.9"
+
+"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2":
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b"
+ integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==
+
+"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8":
+ version "1.2.8"
+ resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a"
+ integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==
+ dependencies:
+ "@nodelib/fs.scandir" "2.1.5"
+ fastq "^1.6.0"
+
+"@rushstack/node-core-library@3.53.3":
+ version "3.53.3"
+ resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.53.3.tgz#e78e0dc1545f6cd7d80b0408cf534aefc62fbbe2"
+ integrity sha512-H0+T5koi5MFhJUd5ND3dI3bwLhvlABetARl78L3lWftJVQEPyzcgTStvTTRiIM5mCltyTM8VYm6BuCtNUuxD0Q==
+ dependencies:
+ "@types/node" "12.20.24"
+ colors "~1.2.1"
+ fs-extra "~7.0.1"
+ import-lazy "~4.0.0"
+ jju "~1.4.0"
+ resolve "~1.17.0"
+ semver "~7.3.0"
+ z-schema "~5.0.2"
+
+"@rushstack/package-deps-hash@^3.2.5":
+ version "3.2.66"
+ resolved "https://registry.yarnpkg.com/@rushstack/package-deps-hash/-/package-deps-hash-3.2.66.tgz#1fc4f121500aa3670c4c5edf388722ffb001ddbd"
+ integrity sha512-LpsJZ8H7bmEvPEluw9/6Ucf92xiqomZ0P4RSw1YGABYfwt/eOGBYQ2VhyBJsfkQFTRBlIOGCy3GvwvRMRUKz+A==
+ dependencies:
+ "@rushstack/node-core-library" "3.53.3"
+
+"@sinclair/typebox@^0.24.1":
+ version "0.24.51"
+ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f"
+ integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==
+
+"@sinonjs/commons@^1.7.0":
+ version "1.8.6"
+ resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9"
+ integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==
+ dependencies:
+ type-detect "4.0.8"
+
+"@sinonjs/fake-timers@^9.1.2":
+ version "9.1.2"
+ resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c"
+ integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==
+ dependencies:
+ "@sinonjs/commons" "^1.7.0"
+
+"@types/babel__core@^7.1.14":
+ version "7.1.20"
+ resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.20.tgz#e168cdd612c92a2d335029ed62ac94c95b362359"
+ integrity sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ==
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+ "@types/babel__generator" "*"
+ "@types/babel__template" "*"
+ "@types/babel__traverse" "*"
+
+"@types/babel__generator@*":
+ version "7.6.4"
+ resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7"
+ integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@types/babel__template@*":
+ version "7.4.1"
+ resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969"
+ integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6":
+ version "7.18.3"
+ resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.3.tgz#dfc508a85781e5698d5b33443416b6268c4b3e8d"
+ integrity sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==
+ dependencies:
+ "@babel/types" "^7.3.0"
+
+"@types/graceful-fs@^4.1.3":
+ version "4.1.5"
+ resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15"
+ integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==
+ dependencies:
+ "@types/node" "*"
+
+"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
+ integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==
+
+"@types/istanbul-lib-report@*":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686"
+ integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==
+ dependencies:
+ "@types/istanbul-lib-coverage" "*"
+
+"@types/istanbul-reports@^3.0.0":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff"
+ integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==
+ dependencies:
+ "@types/istanbul-lib-report" "*"
+
+"@types/json-schema@^7.0.9":
+ version "7.0.11"
+ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
+ integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==
+
+"@types/node@*":
+ version "18.11.17"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.17.tgz#5c009e1d9c38f4a2a9d45c0b0c493fe6cdb4bcb5"
+ integrity sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==
+
+"@types/node@12.20.24":
+ version "12.20.24"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.24.tgz#c37ac69cb2948afb4cef95f424fa0037971a9a5c"
+ integrity sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==
+
+"@types/prettier@^2.1.5":
+ version "2.7.2"
+ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0"
+ integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==
+
+"@types/semver@^7.3.12":
+ version "7.3.13"
+ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91"
+ integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==
+
+"@types/stack-utils@^2.0.0":
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"
+ integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==
+
+"@types/yargs-parser@*":
+ version "21.0.0"
+ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b"
+ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==
+
+"@types/yargs@^17.0.8":
+ version "17.0.17"
+ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.17.tgz#5672e5621f8e0fca13f433a8017aae4b7a2a03e7"
+ integrity sha512-72bWxFKTK6uwWJAVT+3rF6Jo6RTojiJ27FQo8Rf60AL+VZbzoVPnMFhKsUnbjR8A3BTCYQ7Mv3hnl8T0A+CX9g==
+ dependencies:
+ "@types/yargs-parser" "*"
+
+"@typescript-eslint/scope-manager@5.47.0":
+ version "5.47.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.47.0.tgz#f58144a6b0ff58b996f92172c488813aee9b09df"
+ integrity sha512-dvJab4bFf7JVvjPuh3sfBUWsiD73aiftKBpWSfi3sUkysDQ4W8x+ZcFpNp7Kgv0weldhpmMOZBjx1wKN8uWvAw==
+ dependencies:
+ "@typescript-eslint/types" "5.47.0"
+ "@typescript-eslint/visitor-keys" "5.47.0"
+
+"@typescript-eslint/types@5.47.0":
+ version "5.47.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.47.0.tgz#67490def406eaa023dbbd8da42ee0d0c9b5229d3"
+ integrity sha512-eslFG0Qy8wpGzDdYKu58CEr3WLkjwC5Usa6XbuV89ce/yN5RITLe1O8e+WFEuxnfftHiJImkkOBADj58ahRxSg==
+
+"@typescript-eslint/typescript-estree@5.47.0":
+ version "5.47.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.0.tgz#ed971a11c5c928646d6ba7fc9dfdd6e997649aca"
+ integrity sha512-LxfKCG4bsRGq60Sqqu+34QT5qT2TEAHvSCCJ321uBWywgE2dS0LKcu5u+3sMGo+Vy9UmLOhdTw5JHzePV/1y4Q==
+ dependencies:
+ "@typescript-eslint/types" "5.47.0"
+ "@typescript-eslint/visitor-keys" "5.47.0"
+ debug "^4.3.4"
+ globby "^11.1.0"
+ is-glob "^4.0.3"
+ semver "^7.3.7"
+ tsutils "^3.21.0"
+
+"@typescript-eslint/utils@^5.10.0":
+ version "5.47.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.47.0.tgz#b5005f7d2696769a1fdc1e00897005a25b3a0ec7"
+ integrity sha512-U9xcc0N7xINrCdGVPwABjbAKqx4GK67xuMV87toI+HUqgXj26m6RBp9UshEXcTrgCkdGYFzgKLt8kxu49RilDw==
+ dependencies:
+ "@types/json-schema" "^7.0.9"
+ "@types/semver" "^7.3.12"
+ "@typescript-eslint/scope-manager" "5.47.0"
+ "@typescript-eslint/types" "5.47.0"
+ "@typescript-eslint/typescript-estree" "5.47.0"
+ eslint-scope "^5.1.1"
+ eslint-utils "^3.0.0"
+ semver "^7.3.7"
+
+"@typescript-eslint/visitor-keys@5.47.0":
+ version "5.47.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.0.tgz#4aca4efbdf6209c154df1f7599852d571b80bb45"
+ integrity sha512-ByPi5iMa6QqDXe/GmT/hR6MZtVPi0SqMQPDx15FczCBXJo/7M8T88xReOALAfpBLm+zxpPfmhuEvPb577JRAEg==
+ dependencies:
+ "@typescript-eslint/types" "5.47.0"
+ eslint-visitor-keys "^3.3.0"
+
+acorn-jsx@^5.3.2:
+ version "5.3.2"
+ resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
+ integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
+
+acorn@^8.8.0:
+ version "8.8.1"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73"
+ integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==
+
+ajv@^6.10.0, ajv@^6.12.4:
version "6.12.6"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
@@ -17,788 +1490,267 @@ ajv@^6.12.3:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
-ansi-regex@^2.0.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
- integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==
+ansi-escapes@^4.2.1, ansi-escapes@^4.3.1:
+ version "4.3.2"
+ resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e"
+ integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==
+ dependencies:
+ type-fest "^0.21.3"
ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
-ansi-styles@^2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
- integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==
+ansi-styles@^3.2.1:
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
+ integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
+ dependencies:
+ color-convert "^1.9.0"
-ansi-styles@^4.0.0:
+ansi-styles@^4.0.0, ansi-styles@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
-anymatch@^1.3.0:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
- integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==
- dependencies:
- micromatch "^2.1.5"
- normalize-path "^2.0.0"
+ansi-styles@^5.0.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
+ integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==
-anymatch@~3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
- integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
+ansicolors@~0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979"
+ integrity sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==
+
+anymatch@^3.0.3, anymatch@~3.1.2:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
+ integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"
-aproba@^1.0.3:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
- integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
-
-are-we-there-yet@~1.1.2:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146"
- integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==
+argparse@^1.0.7:
+ version "1.0.10"
+ resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
+ integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
dependencies:
- delegates "^1.0.0"
- readable-stream "^2.0.6"
+ sprintf-js "~1.0.2"
-arr-diff@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
- integrity sha512-dtXTVMkh6VkEEA7OhXnN1Ecb8aAGFdZ1LFxtOCoqj4qkyOJMt7+qs6Ahdy6p/NQCPYsRSXXivhSB/J5E9jmYKA==
+argparse@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
+ integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
+
+arr-filter@^1.1.1:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee"
+ integrity sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==
dependencies:
- arr-flatten "^1.0.1"
+ make-iterator "^1.0.0"
-arr-diff@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
- integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==
-
-arr-flatten@^1.0.1, arr-flatten@^1.1.0:
+arr-flatten@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1"
integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==
-arr-union@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
- integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==
-
-array-unique@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
- integrity sha512-G2n5bG5fSUCpnsXz4+8FUkYsGPkNfLn9YvS66U5qbTIXI2Ynnlo4Bi42bWv+omKUCqz+ejzfClwne0alJWJPhg==
-
-array-unique@^0.3.2:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
- integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==
-
-asn1@~0.2.3:
- version "0.2.6"
- resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d"
- integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==
+arr-map@^2.0.0, arr-map@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4"
+ integrity sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==
dependencies:
- safer-buffer "~2.1.0"
+ make-iterator "^1.0.0"
-assert-plus@1.0.0, assert-plus@^1.0.0:
+array-each@^1.0.0, array-each@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f"
+ integrity sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==
+
+array-initial@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795"
+ integrity sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==
+ dependencies:
+ array-slice "^1.0.0"
+ is-number "^4.0.0"
+
+array-last@^1.1.1:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336"
+ integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==
+ dependencies:
+ is-number "^4.0.0"
+
+array-slice@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4"
+ integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==
+
+array-union@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
+ integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
+
+async-done@^1.2.2:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2"
+ integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==
+ dependencies:
+ end-of-stream "^1.1.0"
+ once "^1.3.2"
+ process-nextick-args "^2.0.0"
+ stream-exhaust "^1.0.1"
+
+async-done@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/async-done/-/async-done-2.0.0.tgz#f1ec5df738c6383a52b0a30d0902fd897329c15a"
+ integrity sha512-j0s3bzYq9yKIVLKGE/tWlCpa3PfFLcrDZLTSVdnnCTGagXuXBJO4SsY9Xdk/fQBirCkH4evW5xOeJXqlAQFdsw==
+ dependencies:
+ end-of-stream "^1.4.4"
+ once "^1.4.0"
+ stream-exhaust "^1.0.2"
+
+async-settle@^1.0.0:
version "1.0.0"
- resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
- integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==
-
-assign-symbols@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
- integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==
-
-async-each@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf"
- integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==
-
-asynckit@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
- integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==
-
-atob@^2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
- integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
-
-autogypi@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/autogypi/-/autogypi-0.2.2.tgz#258bab5f7857755b09beac6a641fea130ff4622d"
- integrity sha512-NkDsjbybxo98NEUpvDULvV6w4OxhnX8owBptd8/GlQLhi81TZrh7siRYX9zVEoAYpYaX5QrRuIZAtgYD9PGDXg==
+ resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b"
+ integrity sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==
dependencies:
- bluebird "^3.4.0"
- commander "~2.9.0"
- resolve "~1.1.7"
+ async-done "^1.2.2"
-aws-sign2@~0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
- integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==
-
-aws4@^1.8.0:
- version "1.11.0"
- resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
- integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==
-
-babel-cli@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1"
- integrity sha512-wau+BDtQfuSBGQ9PzzFL3REvR9Sxnd4LKwtcHAiPjhugA7K/80vpHXafj+O5bAqJOuSefjOx5ZJnNSR2J1Qw6Q==
+async-settle@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-2.0.0.tgz#c695ad14e070f6a755d019d32d6eb38029020287"
+ integrity sha512-Obu/KE8FurfQRN6ODdHN9LuXqwC+JFIM9NRyZqJJ4ZfLJmIYN9Rg0/kb+wF70VV5+fJusTMQlJ1t5rF7J/ETdg==
dependencies:
- babel-core "^6.26.0"
- babel-polyfill "^6.26.0"
- babel-register "^6.26.0"
- babel-runtime "^6.26.0"
- commander "^2.11.0"
- convert-source-map "^1.5.0"
- fs-readdir-recursive "^1.0.0"
- glob "^7.1.2"
- lodash "^4.17.4"
- output-file-sync "^1.1.2"
- path-is-absolute "^1.0.1"
- slash "^1.0.0"
- source-map "^0.5.6"
- v8flags "^2.1.1"
- optionalDependencies:
- chokidar "^1.6.1"
+ async-done "^2.0.0"
-babel-code-frame@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
- integrity sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==
+async@^3.2.3:
+ version "3.2.4"
+ resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c"
+ integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==
+
+babel-jest@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44"
+ integrity sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA==
dependencies:
- chalk "^1.1.3"
- esutils "^2.0.2"
- js-tokens "^3.0.2"
+ "@jest/transform" "^29.3.1"
+ "@types/babel__core" "^7.1.14"
+ babel-plugin-istanbul "^6.1.1"
+ babel-preset-jest "^29.2.0"
+ chalk "^4.0.0"
+ graceful-fs "^4.2.9"
+ slash "^3.0.0"
-babel-core@^6.25.0, babel-core@^6.26.0:
- version "6.26.3"
- resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207"
- integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==
+babel-plugin-istanbul@^6.1.1:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73"
+ integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==
dependencies:
- babel-code-frame "^6.26.0"
- babel-generator "^6.26.0"
- babel-helpers "^6.24.1"
- babel-messages "^6.23.0"
- babel-register "^6.26.0"
- babel-runtime "^6.26.0"
- babel-template "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- convert-source-map "^1.5.1"
- debug "^2.6.9"
- json5 "^0.5.1"
- lodash "^4.17.4"
- minimatch "^3.0.4"
- path-is-absolute "^1.0.1"
- private "^0.1.8"
- slash "^1.0.0"
- source-map "^0.5.7"
+ "@babel/helper-plugin-utils" "^7.0.0"
+ "@istanbuljs/load-nyc-config" "^1.0.0"
+ "@istanbuljs/schema" "^0.1.2"
+ istanbul-lib-instrument "^5.0.4"
+ test-exclude "^6.0.0"
-babel-generator@^6.26.0:
- version "6.26.1"
- resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90"
- integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==
+babel-plugin-jest-hoist@^29.2.0:
+ version "29.2.0"
+ resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz#23ee99c37390a98cfddf3ef4a78674180d823094"
+ integrity sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA==
dependencies:
- babel-messages "^6.23.0"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- detect-indent "^4.0.0"
- jsesc "^1.3.0"
- lodash "^4.17.4"
- source-map "^0.5.7"
- trim-right "^1.0.1"
+ "@babel/template" "^7.3.3"
+ "@babel/types" "^7.3.3"
+ "@types/babel__core" "^7.1.14"
+ "@types/babel__traverse" "^7.0.6"
-babel-helper-builder-binary-assignment-operator-visitor@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664"
- integrity sha512-gCtfYORSG1fUMX4kKraymq607FWgMWg+j42IFPc18kFQEsmtaibP4UrqsXt8FlEJle25HUd4tsoDR7H2wDhe9Q==
+babel-plugin-polyfill-corejs2@^0.3.3:
+ version "0.3.3"
+ resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122"
+ integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==
dependencies:
- babel-helper-explode-assignable-expression "^6.24.1"
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
+ "@babel/compat-data" "^7.17.7"
+ "@babel/helper-define-polyfill-provider" "^0.3.3"
+ semver "^6.1.1"
-babel-helper-call-delegate@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d"
- integrity sha512-RL8n2NiEj+kKztlrVJM9JT1cXzzAdvWFh76xh/H1I4nKwunzE4INBXn8ieCZ+wh4zWszZk7NBS1s/8HR5jDkzQ==
+babel-plugin-polyfill-corejs3@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a"
+ integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==
dependencies:
- babel-helper-hoist-variables "^6.24.1"
- babel-runtime "^6.22.0"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
+ "@babel/helper-define-polyfill-provider" "^0.3.3"
+ core-js-compat "^3.25.1"
-babel-helper-define-map@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f"
- integrity sha512-bHkmjcC9lM1kmZcVpA5t2om2nzT/xiZpo6TJq7UlZ3wqKfzia4veeXbIhKvJXAMzhhEBd3cR1IElL5AenWEUpA==
+babel-plugin-polyfill-regenerator@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747"
+ integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==
dependencies:
- babel-helper-function-name "^6.24.1"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- lodash "^4.17.4"
+ "@babel/helper-define-polyfill-provider" "^0.3.3"
-babel-helper-explode-assignable-expression@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa"
- integrity sha512-qe5csbhbvq6ccry9G7tkXbzNtcDiH4r51rrPUbwwoTzZ18AqxWYRZT6AOmxrpxKnQBW0pYlBI/8vh73Z//78nQ==
+babel-preset-current-node-syntax@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b"
+ integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==
dependencies:
- babel-runtime "^6.22.0"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
+ "@babel/plugin-syntax-async-generators" "^7.8.4"
+ "@babel/plugin-syntax-bigint" "^7.8.3"
+ "@babel/plugin-syntax-class-properties" "^7.8.3"
+ "@babel/plugin-syntax-import-meta" "^7.8.3"
+ "@babel/plugin-syntax-json-strings" "^7.8.3"
+ "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3"
+ "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3"
+ "@babel/plugin-syntax-numeric-separator" "^7.8.3"
+ "@babel/plugin-syntax-object-rest-spread" "^7.8.3"
+ "@babel/plugin-syntax-optional-catch-binding" "^7.8.3"
+ "@babel/plugin-syntax-optional-chaining" "^7.8.3"
+ "@babel/plugin-syntax-top-level-await" "^7.8.3"
-babel-helper-function-name@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
- integrity sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q==
+babel-preset-jest@^29.2.0:
+ version "29.2.0"
+ resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz#3048bea3a1af222e3505e4a767a974c95a7620dc"
+ integrity sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA==
dependencies:
- babel-helper-get-function-arity "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
+ babel-plugin-jest-hoist "^29.2.0"
+ babel-preset-current-node-syntax "^1.0.0"
-babel-helper-get-function-arity@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d"
- integrity sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng==
+bach@^1.0.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880"
+ integrity sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==
dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
+ arr-filter "^1.1.1"
+ arr-flatten "^1.0.1"
+ arr-map "^2.0.0"
+ array-each "^1.0.0"
+ array-initial "^1.0.0"
+ array-last "^1.1.1"
+ async-done "^1.2.2"
+ async-settle "^1.0.0"
+ now-and-later "^2.0.0"
-babel-helper-hoist-variables@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76"
- integrity sha512-zAYl3tqerLItvG5cKYw7f1SpvIxS9zi7ohyGHaI9cgDUjAT6YcY9jIEH5CstetP5wHIVSceXwNS7Z5BpJg+rOw==
+bach@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/bach/-/bach-2.0.1.tgz#45a3a3cbf7dbba3132087185c60357482b988972"
+ integrity sha512-A7bvGMGiTOxGMpNupYl9HQTf0FFDNF4VCmks4PJpFyN1AX2pdKuxuwdvUz2Hu388wcgp+OvGFNsumBfFNkR7eg==
dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-helper-optimise-call-expression@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257"
- integrity sha512-Op9IhEaxhbRT8MDXx2iNuMgciu2V8lDvYCNQbDGjdBNCjaMvyLf4wl4A3b8IgndCyQF8TwfgsQ8T3VD8aX1/pA==
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-helper-regex@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72"
- integrity sha512-VlPiWmqmGJp0x0oK27Out1D+71nVVCTSdlbhIVoaBAj2lUgrNjBCRR9+llO4lTSb2O4r7PJg+RobRkhBrf6ofg==
- dependencies:
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- lodash "^4.17.4"
-
-babel-helper-remap-async-to-generator@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b"
- integrity sha512-RYqaPD0mQyQIFRu7Ho5wE2yvA/5jxqCIj/Lv4BXNq23mHYu/vxikOy2JueLiBxQknwapwrJeNCesvY0ZcfnlHg==
- dependencies:
- babel-helper-function-name "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-helper-replace-supers@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a"
- integrity sha512-sLI+u7sXJh6+ToqDr57Bv973kCepItDhMou0xCP2YPVmR1jkHSCY+p1no8xErbV1Siz5QE8qKT1WIwybSWlqjw==
- dependencies:
- babel-helper-optimise-call-expression "^6.24.1"
- babel-messages "^6.23.0"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-helpers@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2"
- integrity sha512-n7pFrqQm44TCYvrCDb0MqabAF+JUBq+ijBvNMUxpkLjJaAu32faIexewMumrH5KLLJ1HDyT0PTEqRyAe/GwwuQ==
- dependencies:
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-messages@^6.23.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
- integrity sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-check-es2015-constants@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"
- integrity sha512-B1M5KBP29248dViEo1owyY32lk1ZSH2DaNNrXLGt8lyjjHm7pBqAdQ7VKUPR6EEDO323+OvT3MQXbCin8ooWdA==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-replace-require@^0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/babel-plugin-replace-require/-/babel-plugin-replace-require-0.0.4.tgz#2afe99c8cfd1a9faf5fa2a807bdb35c30a4970f8"
- integrity sha512-d9P6UT7ffqRfuM8Kaec4YMpC1XyQE8bbRgM2OsMNZO5xwE2OzmKIDg3qajjOG2iInMQSOQDXviyDYZx8hYf5Nw==
- dependencies:
- babylon "^6.14.1"
-
-babel-plugin-syntax-async-functions@^6.8.0:
- version "6.13.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"
- integrity sha512-4Zp4unmHgw30A1eWI5EpACji2qMocisdXhAftfhXoSV9j0Tvj6nRFE3tOmRY912E0FMRm/L5xWE7MGVT2FoLnw==
-
-babel-plugin-syntax-async-generators@^6.5.0:
- version "6.13.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a"
- integrity sha512-EbciFN5Jb9iqU9bqaLmmFLx2G8pAUsvpWJ6OzOWBNrSY9qTohXj+7YfZx6Ug1Qqh7tCb1EA7Jvn9bMC1HBiucg==
-
-babel-plugin-syntax-exponentiation-operator@^6.8.0:
- version "6.13.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"
- integrity sha512-Z/flU+T9ta0aIEKl1tGEmN/pZiI1uXmCiGFRegKacQfEJzp7iNsKloZmyJlQr+75FCJtiFfGIK03SiCvCt9cPQ==
-
-babel-plugin-syntax-flow@^6.18.0:
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d"
- integrity sha512-HbTDIoG1A1op7Tl/wIFQPULIBA61tsJ8Ntq2FAhLwuijrzosM/92kAfgU1Q3Kc7DH/cprJg5vDfuTY4QUL4rDA==
-
-babel-plugin-syntax-object-rest-spread@^6.8.0:
- version "6.13.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
- integrity sha512-C4Aq+GaAj83pRQ0EFgTvw5YO6T3Qz2KGrNRwIj9mSoNHVvdZY4KO2uA6HNtNXCw993iSZnckY1aLW8nOi8i4+w==
-
-babel-plugin-syntax-trailing-function-commas@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
- integrity sha512-Gx9CH3Q/3GKbhs07Bszw5fPTlU+ygrOGfAhEt7W2JICwufpC4SuO0mG0+4NykPBSYPMJhqvVlDBU17qB1D+hMQ==
-
-babel-plugin-transform-async-generator-functions@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db"
- integrity sha512-uT7eovUxtXe8Q2ufcjRuJIOL0hg6VAUJhiWJBLxH/evYAw+aqoJLcYTR8hqx13iOx/FfbCMHgBmXWZjukbkyPg==
- dependencies:
- babel-helper-remap-async-to-generator "^6.24.1"
- babel-plugin-syntax-async-generators "^6.5.0"
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-async-to-generator@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
- integrity sha512-7BgYJujNCg0Ti3x0c/DL3tStvnKS6ktIYOmo9wginv/dfZOrbSZ+qG4IRRHMBOzZ5Awb1skTiAsQXg/+IWkZYw==
- dependencies:
- babel-helper-remap-async-to-generator "^6.24.1"
- babel-plugin-syntax-async-functions "^6.8.0"
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-arrow-functions@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
- integrity sha512-PCqwwzODXW7JMrzu+yZIaYbPQSKjDTAsNNlK2l5Gg9g4rz2VzLnZsStvp/3c46GfXpwkyufb3NCyG9+50FF1Vg==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141"
- integrity sha512-2+ujAT2UMBzYFm7tidUsYh+ZoIutxJ3pN9IYrF1/H6dCKtECfhmB8UkHVpyxDwkj0CYbQG35ykoz925TUnBc3A==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-block-scoping@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f"
- integrity sha512-YiN6sFAQ5lML8JjCmr7uerS5Yc/EMbgg9G8ZNmk2E3nYX4ckHR01wrkeeMijEf5WHNK5TW0Sl0Uu3pv3EdOJWw==
- dependencies:
- babel-runtime "^6.26.0"
- babel-template "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- lodash "^4.17.4"
-
-babel-plugin-transform-es2015-classes@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db"
- integrity sha512-5Dy7ZbRinGrNtmWpquZKZ3EGY8sDgIVB4CU8Om8q8tnMLrD/m94cKglVcHps0BCTdZ0TJeeAWOq2TK9MIY6cag==
- dependencies:
- babel-helper-define-map "^6.24.1"
- babel-helper-function-name "^6.24.1"
- babel-helper-optimise-call-expression "^6.24.1"
- babel-helper-replace-supers "^6.24.1"
- babel-messages "^6.23.0"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-computed-properties@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"
- integrity sha512-C/uAv4ktFP/Hmh01gMTvYvICrKze0XVX9f2PdIXuriCSvUmV9j+u+BB9f5fJK3+878yMK6dkdcq+Ymr9mrcLzw==
- dependencies:
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-destructuring@^6.22.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
- integrity sha512-aNv/GDAW0j/f4Uy1OEPZn1mqD+Nfy9viFGBfQ5bZyT35YqOiqx7/tXdyfZkJ1sC21NyEsBdfDY6PYmLHF4r5iA==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e"
- integrity sha512-ossocTuPOssfxO2h+Z3/Ea1Vo1wWx31Uqy9vIiJusOP4TbF7tPs9U0sJ9pX9OJPf4lXRGj5+6Gkl/HHKiAP5ug==
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-for-of@^6.22.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
- integrity sha512-DLuRwoygCoXx+YfxHLkVx5/NpeSbVwfoTeBykpJK7JhYWlL/O8hgAK/reforUnZDlxasOrVPPJVI/guE3dCwkw==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-function-name@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b"
- integrity sha512-iFp5KIcorf11iBqu/y/a7DK3MN5di3pNCzto61FqCNnUX4qeBwcV1SLqe10oXNnCaxBUImX3SckX2/o1nsrTcg==
- dependencies:
- babel-helper-function-name "^6.24.1"
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-literals@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e"
- integrity sha512-tjFl0cwMPpDYyoqYA9li1/7mGFit39XiNX5DKC/uCNjBctMxyL1/PT/l4rSlbvBG1pOKI88STRdUsWXB3/Q9hQ==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-modules-amd@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154"
- integrity sha512-LnIIdGWIKdw7zwckqx+eGjcS8/cl8D74A3BpJbGjKTFFNJSMrjN4bIh22HY1AlkUbeLG6X6OZj56BDvWD+OeFA==
- dependencies:
- babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
- version "6.26.2"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3"
- integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==
- dependencies:
- babel-plugin-transform-strict-mode "^6.24.1"
- babel-runtime "^6.26.0"
- babel-template "^6.26.0"
- babel-types "^6.26.0"
-
-babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23"
- integrity sha512-ONFIPsq8y4bls5PPsAWYXH/21Hqv64TBxdje0FvU3MhIV6QM2j5YS7KvAzg/nTIVLot2D2fmFQrFWCbgHlFEjg==
- dependencies:
- babel-helper-hoist-variables "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-modules-umd@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468"
- integrity sha512-LpVbiT9CLsuAIp3IG0tfbVo81QIhn6pE8xBJ7XSeCtFlMltuar5VuBV6y6Q45tpui9QWcy5i0vLQfCfrnF7Kiw==
- dependencies:
- babel-plugin-transform-es2015-modules-amd "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
-
-babel-plugin-transform-es2015-object-super@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d"
- integrity sha512-8G5hpZMecb53vpD3mjs64NhI1au24TAmokQ4B+TBFBjN9cVoGoOvotdrMMRmHvVZUEvqGUPWL514woru1ChZMA==
- dependencies:
- babel-helper-replace-supers "^6.24.1"
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-parameters@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"
- integrity sha512-8HxlW+BB5HqniD+nLkQ4xSAVq3bR/pcYW9IigY+2y0dI+Y7INFeTbfAQr+63T3E4UDsZGjyb+l9txUnABWxlOQ==
- dependencies:
- babel-helper-call-delegate "^6.24.1"
- babel-helper-get-function-arity "^6.24.1"
- babel-runtime "^6.22.0"
- babel-template "^6.24.1"
- babel-traverse "^6.24.1"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"
- integrity sha512-mDdocSfUVm1/7Jw/FIRNw9vPrBQNePy6wZJlR8HAUBLybNp1w/6lr6zZ2pjMShee65t/ybR5pT8ulkLzD1xwiw==
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-spread@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1"
- integrity sha512-3Ghhi26r4l3d0Js933E5+IhHwk0A1yiutj9gwvzmFbVV0sPMYk2lekhOufHBswX7NCoSeF4Xrl3sCIuSIa+zOg==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-sticky-regex@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc"
- integrity sha512-CYP359ADryTo3pCsH0oxRo/0yn6UsEZLqYohHmvLQdfS9xkf+MbCzE3/Kolw9OYIY4ZMilH25z/5CbQbwDD+lQ==
- dependencies:
- babel-helper-regex "^6.24.1"
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-plugin-transform-es2015-template-literals@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d"
- integrity sha512-x8b9W0ngnKzDMHimVtTfn5ryimars1ByTqsfBDwAqLibmuuQY6pgBQi5z1ErIsUOWBdw1bW9FSz5RZUojM4apg==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-typeof-symbol@^6.22.0:
- version "6.23.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
- integrity sha512-fz6J2Sf4gYN6gWgRZaoFXmq93X+Li/8vf+fb0sGDVtdeWvxC9y5/bTD7bvfWMEq6zetGEHpWjtzRGSugt5kNqw==
- dependencies:
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-es2015-unicode-regex@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9"
- integrity sha512-v61Dbbihf5XxnYjtBN04B/JBvsScY37R1cZT5r9permN1cp+b70DY3Ib3fIkgn1DI9U3tGgBJZVD8p/mE/4JbQ==
- dependencies:
- babel-helper-regex "^6.24.1"
- babel-runtime "^6.22.0"
- regexpu-core "^2.0.0"
-
-babel-plugin-transform-exponentiation-operator@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
- integrity sha512-LzXDmbMkklvNhprr20//RStKVcT8Cu+SQtX18eMHLhjHf2yFzwtQ0S2f0jQ+89rokoNdmwoSqYzAhq86FxlLSQ==
- dependencies:
- babel-helper-builder-binary-assignment-operator-visitor "^6.24.1"
- babel-plugin-syntax-exponentiation-operator "^6.8.0"
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-flow-strip-types@^6.22.0:
- version "6.22.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf"
- integrity sha512-TxIM0ZWNw9oYsoTthL3lvAK3+eTujzktoXJg4ubGvICGbVuXVYv5hHv0XXpz8fbqlJaGYY4q5SVzaSmsg3t4Fg==
- dependencies:
- babel-plugin-syntax-flow "^6.18.0"
- babel-runtime "^6.22.0"
-
-babel-plugin-transform-object-rest-spread@^6.22.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06"
- integrity sha512-ocgA9VJvyxwt+qJB0ncxV8kb/CjfTcECUY4tQ5VT7nP6Aohzobm8CDFaQ5FHdvZQzLmf0sgDxB8iRXZXxwZcyA==
- dependencies:
- babel-plugin-syntax-object-rest-spread "^6.8.0"
- babel-runtime "^6.26.0"
-
-babel-plugin-transform-regenerator@^6.24.1:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"
- integrity sha512-LS+dBkUGlNR15/5WHKe/8Neawx663qttS6AGqoOUhICc9d1KciBvtrQSuc0PI+CxQ2Q/S1aKuJ+u64GtLdcEZg==
- dependencies:
- regenerator-transform "^0.10.0"
-
-babel-plugin-transform-strict-mode@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"
- integrity sha512-j3KtSpjyLSJxNoCDrhwiJad8kw0gJ9REGj8/CqL0HeRyLnvUNYV9zcqluL6QJSXh3nfsLEmSLvwRfGzrgR96Pw==
- dependencies:
- babel-runtime "^6.22.0"
- babel-types "^6.24.1"
-
-babel-polyfill@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153"
- integrity sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ==
- dependencies:
- babel-runtime "^6.26.0"
- core-js "^2.5.0"
- regenerator-runtime "^0.10.5"
-
-babel-preset-es2015@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"
- integrity sha512-XfwUqG1Ry6R43m4Wfob+vHbIVBIqTg/TJY4Snku1iIzeH7mUnwHA8Vagmv+ZQbPwhS8HgsdQvy28Py3k5zpoFQ==
- dependencies:
- babel-plugin-check-es2015-constants "^6.22.0"
- babel-plugin-transform-es2015-arrow-functions "^6.22.0"
- babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"
- babel-plugin-transform-es2015-block-scoping "^6.24.1"
- babel-plugin-transform-es2015-classes "^6.24.1"
- babel-plugin-transform-es2015-computed-properties "^6.24.1"
- babel-plugin-transform-es2015-destructuring "^6.22.0"
- babel-plugin-transform-es2015-duplicate-keys "^6.24.1"
- babel-plugin-transform-es2015-for-of "^6.22.0"
- babel-plugin-transform-es2015-function-name "^6.24.1"
- babel-plugin-transform-es2015-literals "^6.22.0"
- babel-plugin-transform-es2015-modules-amd "^6.24.1"
- babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
- babel-plugin-transform-es2015-modules-systemjs "^6.24.1"
- babel-plugin-transform-es2015-modules-umd "^6.24.1"
- babel-plugin-transform-es2015-object-super "^6.24.1"
- babel-plugin-transform-es2015-parameters "^6.24.1"
- babel-plugin-transform-es2015-shorthand-properties "^6.24.1"
- babel-plugin-transform-es2015-spread "^6.22.0"
- babel-plugin-transform-es2015-sticky-regex "^6.24.1"
- babel-plugin-transform-es2015-template-literals "^6.22.0"
- babel-plugin-transform-es2015-typeof-symbol "^6.22.0"
- babel-plugin-transform-es2015-unicode-regex "^6.24.1"
- babel-plugin-transform-regenerator "^6.24.1"
-
-babel-preset-stage-3@^6.24.1:
- version "6.24.1"
- resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395"
- integrity sha512-eCbEOF8uN0KypFXJmZXn2sTk7bPV9uM5xov7G/7BM08TbQEObsVs0cEWfy6NQySlfk7JBi/t+XJP1JkruYfthA==
- dependencies:
- babel-plugin-syntax-trailing-function-commas "^6.22.0"
- babel-plugin-transform-async-generator-functions "^6.24.1"
- babel-plugin-transform-async-to-generator "^6.24.1"
- babel-plugin-transform-exponentiation-operator "^6.24.1"
- babel-plugin-transform-object-rest-spread "^6.22.0"
-
-babel-register@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"
- integrity sha512-veliHlHX06wjaeY8xNITbveXSiI+ASFnOqvne/LaIJIqOWi2Ogmj91KOugEz/hoh/fwMhXNBJPCv8Xaz5CyM4A==
- dependencies:
- babel-core "^6.26.0"
- babel-runtime "^6.26.0"
- core-js "^2.5.0"
- home-or-tmp "^2.0.0"
- lodash "^4.17.4"
- mkdirp "^0.5.1"
- source-map-support "^0.4.15"
-
-babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
- integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==
- dependencies:
- core-js "^2.4.0"
- regenerator-runtime "^0.11.0"
-
-babel-template@^6.24.1, babel-template@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
- integrity sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg==
- dependencies:
- babel-runtime "^6.26.0"
- babel-traverse "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- lodash "^4.17.4"
-
-babel-traverse@^6.24.1, babel-traverse@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
- integrity sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA==
- dependencies:
- babel-code-frame "^6.26.0"
- babel-messages "^6.23.0"
- babel-runtime "^6.26.0"
- babel-types "^6.26.0"
- babylon "^6.18.0"
- debug "^2.6.8"
- globals "^9.18.0"
- invariant "^2.2.2"
- lodash "^4.17.4"
-
-babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0:
- version "6.26.0"
- resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
- integrity sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==
- dependencies:
- babel-runtime "^6.26.0"
- esutils "^2.0.2"
- lodash "^4.17.4"
- to-fast-properties "^1.0.3"
-
-babylon@^6.14.1, babylon@^6.18.0:
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
- integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==
+ async-done "^2.0.0"
+ async-settle "^2.0.0"
+ now-and-later "^3.0.0"
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
-base@^0.11.1:
- version "0.11.2"
- resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
- integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==
- dependencies:
- cache-base "^1.0.1"
- class-utils "^0.3.5"
- component-emitter "^1.2.1"
- define-property "^1.0.0"
- isobject "^3.0.1"
- mixin-deep "^1.2.0"
- pascalcase "^0.1.1"
-
-bcrypt-pbkdf@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
- integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==
- dependencies:
- tweetnacl "^0.14.3"
-
-binary-extensions@^1.0.0:
- version "1.13.1"
- resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65"
- integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==
-
binary-extensions@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
-bindings@^1.5.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
- integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
- dependencies:
- file-uri-to-path "1.0.0"
-
-block-stream@*:
- version "0.0.9"
- resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
- integrity sha512-OorbnJVPII4DuUKbjARAe8u8EfqOmkEEaSFIyoQ7OjTHn6kafxWl0wLgoZ2rXaYd7MyLcDaU4TmhfxtwgcccMQ==
- dependencies:
- inherits "~2.0.0"
-
-bluebird@^3.4.0:
- version "3.7.2"
- resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
- integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
-
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
@@ -807,96 +1759,93 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
-braces@^1.8.2:
- version "1.8.5"
- resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7"
- integrity sha512-xU7bpz2ytJl1bH9cgIurjpg/n8Gohy9GTw81heDYLJQ4RU60dlyJsa+atVF2pI0yMMvKxI9HkKwjePCj5XI1hw==
+brace-expansion@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
+ integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
dependencies:
- expand-range "^1.8.1"
- preserve "^0.2.0"
- repeat-element "^1.1.2"
+ balanced-match "^1.0.0"
-braces@^2.3.1:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
- integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==
- dependencies:
- arr-flatten "^1.1.0"
- array-unique "^0.3.2"
- extend-shallow "^2.0.1"
- fill-range "^4.0.0"
- isobject "^3.0.1"
- repeat-element "^1.1.2"
- snapdragon "^0.8.1"
- snapdragon-node "^2.0.1"
- split-string "^3.0.2"
- to-regex "^3.0.1"
-
-braces@~3.0.2:
+braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
dependencies:
fill-range "^7.0.1"
-browser-stdout@1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f"
- integrity sha512-7Rfk377tpSM9TWBEeHs0FlDZGoAIei2V/4MdZJoFMBFAK6BqLpxAIUepGRHGdPFgGsLb02PXovC4qddyHvQqTg==
-
-cache-base@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
- integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==
+browserslist@^4.21.3, browserslist@^4.21.4:
+ version "4.21.4"
+ resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987"
+ integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==
dependencies:
- collection-visit "^1.0.0"
- component-emitter "^1.2.1"
- get-value "^2.0.6"
- has-value "^1.0.0"
- isobject "^3.0.1"
- set-value "^2.0.0"
- to-object-path "^0.3.0"
- union-value "^1.0.0"
- unset-value "^1.0.0"
+ caniuse-lite "^1.0.30001400"
+ electron-to-chromium "^1.4.251"
+ node-releases "^2.0.6"
+ update-browserslist-db "^1.0.9"
-camelcase@^5.0.0:
+bser@2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05"
+ integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==
+ dependencies:
+ node-int64 "^0.4.0"
+
+buffer-from@^1.0.0:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
+ integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
+
+callsites@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
+ integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
+
+camelcase@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
-caseless@~0.12.0:
- version "0.12.0"
- resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
- integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==
+camelcase@^6.2.0:
+ version "6.3.0"
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
+ integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
-chalk@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
- integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==
+caniuse-lite@^1.0.30001400:
+ version "1.0.30001441"
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e"
+ integrity sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg==
+
+cardinal@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-2.1.1.tgz#7cc1055d822d212954d07b085dea251cc7bc5505"
+ integrity sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==
dependencies:
- ansi-styles "^2.2.1"
- escape-string-regexp "^1.0.2"
- has-ansi "^2.0.0"
- strip-ansi "^3.0.0"
- supports-color "^2.0.0"
+ ansicolors "~0.3.2"
+ redeyed "~2.1.0"
-chokidar@^1.6.1:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
- integrity sha512-mk8fAWcRUOxY7btlLtitj3A45jOwSAxH4tOFOoEGbVsl6cL6pPMWUy7dwZ/canfj3QEdP6FHSnf/l1c6/WkzVg==
+chalk@^2.0.0:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
+ integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
dependencies:
- anymatch "^1.3.0"
- async-each "^1.0.0"
- glob-parent "^2.0.0"
- inherits "^2.0.1"
- is-binary-path "^1.0.0"
- is-glob "^2.0.0"
- path-is-absolute "^1.0.0"
- readdirp "^2.0.0"
- optionalDependencies:
- fsevents "^1.0.0"
+ ansi-styles "^3.2.1"
+ escape-string-regexp "^1.0.5"
+ supports-color "^5.3.0"
-chokidar@^3.0.0:
+chalk@^4.0.0, chalk@^4.1.0:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
+ integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
+ dependencies:
+ ansi-styles "^4.1.0"
+ supports-color "^7.1.0"
+
+char-regex@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf"
+ integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==
+
+chokidar@^3.4.0, chokidar@^3.5.2:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
@@ -911,37 +1860,91 @@ chokidar@^3.0.0:
optionalDependencies:
fsevents "~2.3.2"
-class-utils@^0.3.5:
- version "0.3.6"
- resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
- integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==
- dependencies:
- arr-union "^3.1.0"
- define-property "^0.2.5"
- isobject "^3.0.0"
- static-extend "^0.1.1"
+chownr@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
+ integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==
-cliui@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1"
- integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==
+ci-info@^3.2.0:
+ version "3.7.0"
+ resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.0.tgz#6d01b3696c59915b6ce057e4aa4adfc2fa25f5ef"
+ integrity sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==
+
+cjs-module-lexer@^1.0.0:
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40"
+ integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==
+
+clang-format@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/clang-format/-/clang-format-1.8.0.tgz#7779df1c5ce1bc8aac1b0b02b4e479191ef21d46"
+ integrity sha512-pK8gzfu55/lHzIpQ1givIbWfn3eXnU7SfxqIwVgnn5jEM6j4ZJYjpFqFs4iSBPNedzRMmfjYjuQhu657WAXHXw==
+ dependencies:
+ async "^3.2.3"
+ glob "^7.0.0"
+ resolve "^1.1.6"
+
+cli-table3@^0.6.0:
+ version "0.6.3"
+ resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2"
+ integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==
+ dependencies:
+ string-width "^4.2.0"
+ optionalDependencies:
+ "@colors/colors" "1.5.0"
+
+cliui@^7.0.2:
+ version "7.0.4"
+ resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
+ integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
- wrap-ansi "^6.2.0"
+ wrap-ansi "^7.0.0"
-code-point-at@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
- integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==
-
-collection-visit@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
- integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==
+cliui@^8.0.1:
+ version "8.0.1"
+ resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
+ integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==
dependencies:
- map-visit "^1.0.0"
- object-visit "^1.0.0"
+ string-width "^4.2.0"
+ strip-ansi "^6.0.1"
+ wrap-ansi "^7.0.0"
+
+clone-deep@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387"
+ integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==
+ dependencies:
+ is-plain-object "^2.0.4"
+ kind-of "^6.0.2"
+ shallow-clone "^3.0.0"
+
+co@^4.6.0:
+ version "4.6.0"
+ resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
+ integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==
+
+collect-v8-coverage@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59"
+ integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==
+
+collection-map@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c"
+ integrity sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==
+ dependencies:
+ arr-map "^2.0.2"
+ for-own "^1.0.0"
+ make-iterator "^1.0.0"
+
+color-convert@^1.9.0:
+ version "1.9.3"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
+ integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
+ dependencies:
+ color-name "1.1.3"
color-convert@^2.0.1:
version "2.0.1"
@@ -950,310 +1953,445 @@ color-convert@^2.0.1:
dependencies:
color-name "~1.1.4"
+color-name@1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
+ integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
+
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
-combined-stream@^1.0.6, combined-stream@~1.0.6:
- version "1.0.8"
- resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
- integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
- dependencies:
- delayed-stream "~1.0.0"
+colors@~1.2.1:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.5.tgz#89c7ad9a374bc030df8013241f68136ed8835afc"
+ integrity sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==
-commander@2.9.0, commander@~2.9.0:
- version "2.9.0"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
- integrity sha512-bmkUukX8wAOjHdN26xj5c4ctEV22TQ7dQYhSmuckKhToXrkUn0iIaolHdIxYYqD55nhpSPA9zPQ1yP57GdXP2A==
- dependencies:
- graceful-readlink ">= 1.0.0"
+commander@^4.0.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
+ integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
-commander@^2.11.0:
- version "2.20.3"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
- integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
-
-component-emitter@^1.2.1:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
- integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==
+commander@^9.4.1:
+ version "9.4.1"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd"
+ integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
-console-control-strings@^1.0.0, console-control-strings@~1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
- integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==
+convert-source-map@^1.1.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
+ version "1.9.0"
+ resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"
+ integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==
-convert-source-map@^1.5.0, convert-source-map@^1.5.1:
- version "1.8.0"
- resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369"
- integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==
+convert-source-map@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
+ integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
+
+core-js-compat@^3.25.1:
+ version "3.26.1"
+ resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.1.tgz#0e710b09ebf689d719545ac36e49041850f943df"
+ integrity sha512-622/KzTudvXCDLRw70iHW4KKs1aGpcRcowGWyYJr2DEBfRrd6hNJybxSWJFuZYD4ma86xhrwDDHxmDaIq4EA8A==
dependencies:
- safe-buffer "~5.1.1"
+ browserslist "^4.21.4"
-copy-descriptor@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
- integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==
-
-core-js@^2.4.0, core-js@^2.5.0:
- version "2.6.12"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
- integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==
-
-core-util-is@1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
- integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==
-
-core-util-is@~1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
- integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
-
-cross-env@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-4.0.0.tgz#16083862d08275a4628b0b243b121bedaa55dd80"
- integrity sha512-dofkcyPqOy/AR14nbYSpk+TZ4IJZqg2as+/mQNkzh+7Xba2I1I1eyg/1G2dtSpD2LHjcEWwnGquiH2OP5LoeOw==
+cross-spawn@^7.0.2, cross-spawn@^7.0.3:
+ version "7.0.3"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
+ integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
dependencies:
- cross-spawn "^5.1.0"
- is-windows "^1.0.0"
+ path-key "^3.1.0"
+ shebang-command "^2.0.0"
+ which "^2.0.1"
-cross-spawn@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
- integrity sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==
+d@1, d@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a"
+ integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==
dependencies:
- lru-cache "^4.0.1"
- shebang-command "^1.2.0"
- which "^1.2.9"
+ es5-ext "^0.10.50"
+ type "^1.0.1"
-dashdash@^1.12.0:
- version "1.14.1"
- resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
- integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==
+debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
+ integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
- assert-plus "^1.0.0"
+ ms "2.1.2"
-debug@2.6.8:
- version "2.6.8"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
- integrity sha512-E22fsyWPt/lr4/UgQLt/pXqerGMDsanhbnmqIS3VAXuDi1v3IpiwXe2oncEIondHSBuPDWRoK/pMjlvi8FuOXQ==
+dedent@^0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
+ integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==
+
+deep-is@^0.1.3:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
+ integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
+
+deepmerge@^4.2.2:
+ version "4.2.2"
+ resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
+ integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
+
+default-resolution@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684"
+ integrity sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==
+
+detect-newline@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
+ integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==
+
+diff-match-patch@1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.5.tgz#abb584d5f10cd1196dfc55aa03701592ae3f7b37"
+ integrity sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==
+
+diff-sequences@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e"
+ integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ==
+
+dir-glob@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
+ integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
dependencies:
- ms "2.0.0"
+ path-type "^4.0.0"
-debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9:
- version "2.6.9"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
- integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
+doctrine@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
+ integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==
dependencies:
- ms "2.0.0"
+ esutils "^2.0.2"
-decamelize@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
- integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==
+electron-to-chromium@^1.4.251:
+ version "1.4.284"
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592"
+ integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==
-decode-uri-component@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
- integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==
-
-define-property@^0.2.5:
- version "0.2.5"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
- integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==
- dependencies:
- is-descriptor "^0.1.0"
-
-define-property@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6"
- integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==
- dependencies:
- is-descriptor "^1.0.0"
-
-define-property@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d"
- integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==
- dependencies:
- is-descriptor "^1.0.2"
- isobject "^3.0.1"
-
-delayed-stream@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
- integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
-
-delegates@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
- integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==
-
-detect-indent@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208"
- integrity sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A==
- dependencies:
- repeating "^2.0.0"
-
-diff@3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9"
- integrity sha512-597ykPFhtJYaXqPq6fF7Vl1fXTKgPdLOntyxpmdzUOKiYGqK7zcnbplj5088+8qJnWdzXhyeau5iVr8HVo9dgg==
-
-ecc-jsbn@~0.1.1:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
- integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==
- dependencies:
- jsbn "~0.1.0"
- safer-buffer "^2.1.0"
+emittery@^0.13.1:
+ version "0.13.1"
+ resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad"
+ integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
-emscripten-library-decorator@~0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/emscripten-library-decorator/-/emscripten-library-decorator-0.2.2.tgz#d035f023e2a84c68305cc842cdeea38e67683c40"
- integrity sha512-kDmAu7dLbBisaCGrWSNmoZPWeRyHcaJ2k5+z7IgStgZfCNYQmtADRvSic/qHvN+rf6US3HHTfrQ0/D8UdfF1CQ==
+end-of-stream@^1.1.0, end-of-stream@^1.4.4:
+ version "1.4.4"
+ resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
+ integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
+ dependencies:
+ once "^1.4.0"
-escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2:
+error-ex@^1.3.1:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
+ integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
+ dependencies:
+ is-arrayish "^0.2.1"
+
+es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50:
+ version "0.10.62"
+ resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5"
+ integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==
+ dependencies:
+ es6-iterator "^2.0.3"
+ es6-symbol "^3.1.3"
+ next-tick "^1.1.0"
+
+es6-iterator@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7"
+ integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==
+ dependencies:
+ d "1"
+ es5-ext "^0.10.35"
+ es6-symbol "^3.1.1"
+
+es6-symbol@^3.1.1, es6-symbol@^3.1.3:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18"
+ integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==
+ dependencies:
+ d "^1.0.1"
+ ext "^1.1.2"
+
+es6-weak-map@^2.0.1:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53"
+ integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==
+ dependencies:
+ d "1"
+ es5-ext "^0.10.46"
+ es6-iterator "^2.0.3"
+ es6-symbol "^3.1.1"
+
+escalade@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
+ integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
+
+escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
+escape-string-regexp@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
+ integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
+
+escape-string-regexp@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
+ integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
+
+eslint-config-prettier@^8.5.0:
+ version "8.5.0"
+ resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
+ integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
+
+eslint-plugin-jest@^27.1.7:
+ version "27.1.7"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.1.7.tgz#0351e904afb8d66b7f70452929556dfdc8daba0d"
+ integrity sha512-0QVzf+og4YI1Qr3UoprkqqhezAZjFffdi62b0IurkCXMqPtRW84/UT4CKsYT80h/D82LA9avjO/80Ou1LdgbaQ==
+ dependencies:
+ "@typescript-eslint/utils" "^5.10.0"
+
+eslint-plugin-prettier@^4.2.1:
+ version "4.2.1"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b"
+ integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==
+ dependencies:
+ prettier-linter-helpers "^1.0.0"
+
+eslint-scope@5.1.1, eslint-scope@^5.1.1:
+ version "5.1.1"
+ resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
+ integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
+ dependencies:
+ esrecurse "^4.3.0"
+ estraverse "^4.1.1"
+
+eslint-scope@^7.1.1:
+ version "7.1.1"
+ resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642"
+ integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==
+ dependencies:
+ esrecurse "^4.3.0"
+ estraverse "^5.2.0"
+
+eslint-utils@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672"
+ integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==
+ dependencies:
+ eslint-visitor-keys "^2.0.0"
+
+eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
+ integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
+
+eslint-visitor-keys@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826"
+ integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==
+
+eslint@^8.30.0:
+ version "8.30.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.30.0.tgz#83a506125d089eef7c5b5910eeea824273a33f50"
+ integrity sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==
+ dependencies:
+ "@eslint/eslintrc" "^1.4.0"
+ "@humanwhocodes/config-array" "^0.11.8"
+ "@humanwhocodes/module-importer" "^1.0.1"
+ "@nodelib/fs.walk" "^1.2.8"
+ ajv "^6.10.0"
+ chalk "^4.0.0"
+ cross-spawn "^7.0.2"
+ debug "^4.3.2"
+ doctrine "^3.0.0"
+ escape-string-regexp "^4.0.0"
+ eslint-scope "^7.1.1"
+ eslint-utils "^3.0.0"
+ eslint-visitor-keys "^3.3.0"
+ espree "^9.4.0"
+ esquery "^1.4.0"
+ esutils "^2.0.2"
+ fast-deep-equal "^3.1.3"
+ file-entry-cache "^6.0.1"
+ find-up "^5.0.0"
+ glob-parent "^6.0.2"
+ globals "^13.19.0"
+ grapheme-splitter "^1.0.4"
+ ignore "^5.2.0"
+ import-fresh "^3.0.0"
+ imurmurhash "^0.1.4"
+ is-glob "^4.0.0"
+ is-path-inside "^3.0.3"
+ js-sdsl "^4.1.4"
+ js-yaml "^4.1.0"
+ json-stable-stringify-without-jsonify "^1.0.1"
+ levn "^0.4.1"
+ lodash.merge "^4.6.2"
+ minimatch "^3.1.2"
+ natural-compare "^1.4.0"
+ optionator "^0.9.1"
+ regexpp "^3.2.0"
+ strip-ansi "^6.0.1"
+ strip-json-comments "^3.1.0"
+ text-table "^0.2.0"
+
+espree@^9.4.0:
+ version "9.4.1"
+ resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd"
+ integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==
+ dependencies:
+ acorn "^8.8.0"
+ acorn-jsx "^5.3.2"
+ eslint-visitor-keys "^3.3.0"
+
+esprima@^4.0.0, esprima@~4.0.0:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
+ integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
+
+esquery@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5"
+ integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==
+ dependencies:
+ estraverse "^5.1.0"
+
+esrecurse@^4.3.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
+ integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
+ dependencies:
+ estraverse "^5.2.0"
+
+estraverse@^4.1.1:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
+ integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
+
+estraverse@^5.1.0, estraverse@^5.2.0:
+ version "5.3.0"
+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
+ integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
+
esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
-expand-brackets@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
- integrity sha512-hxx03P2dJxss6ceIeri9cmYOT4SRs3Zk3afZwWpOsRqLqprhTR8u++SlC+sFGsQr7WGFPdMF7Gjc1njDLDK6UA==
+execa@^5.0.0:
+ version "5.1.1"
+ resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"
+ integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==
dependencies:
- is-posix-bracket "^0.1.0"
+ cross-spawn "^7.0.3"
+ get-stream "^6.0.0"
+ human-signals "^2.1.0"
+ is-stream "^2.0.0"
+ merge-stream "^2.0.0"
+ npm-run-path "^4.0.1"
+ onetime "^5.1.2"
+ signal-exit "^3.0.3"
+ strip-final-newline "^2.0.0"
-expand-brackets@^2.1.4:
- version "2.1.4"
- resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
- integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==
+exit@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
+ integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==
+
+expect@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6"
+ integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA==
dependencies:
- debug "^2.3.3"
- define-property "^0.2.5"
- extend-shallow "^2.0.1"
- posix-character-classes "^0.1.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
+ "@jest/expect-utils" "^29.3.1"
+ jest-get-type "^29.2.0"
+ jest-matcher-utils "^29.3.1"
+ jest-message-util "^29.3.1"
+ jest-util "^29.3.1"
-expand-range@^1.8.1:
- version "1.8.2"
- resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337"
- integrity sha512-AFASGfIlnIbkKPQwX1yHaDjFvh/1gyKJODme52V6IORh69uEYgZp0o9C+qsIGNVEiuuhQU0CSSl++Rlegg1qvA==
+ext@^1.1.2:
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f"
+ integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==
dependencies:
- fill-range "^2.1.0"
+ type "^2.7.2"
-extend-shallow@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
- integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==
- dependencies:
- is-extendable "^0.1.0"
-
-extend-shallow@^3.0.0, extend-shallow@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8"
- integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==
- dependencies:
- assign-symbols "^1.0.0"
- is-extendable "^1.0.1"
-
-extend@~3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
- integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
-
-extglob@^0.3.1:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
- integrity sha512-1FOj1LOwn42TMrruOHGt18HemVnbwAmAak7krWk+wa93KXxGbK+2jpezm+ytJYDaBX0/SPLZFHKM7m+tKobWGg==
- dependencies:
- is-extglob "^1.0.0"
-
-extglob@^2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
- integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==
- dependencies:
- array-unique "^0.3.2"
- define-property "^1.0.0"
- expand-brackets "^2.1.4"
- extend-shallow "^2.0.1"
- fragment-cache "^0.2.1"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
-
-extsprintf@1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
- integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==
-
-extsprintf@^1.2.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07"
- integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==
-
-fast-deep-equal@^3.1.1:
+fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
-fast-json-stable-stringify@^2.0.0:
+fast-diff@^1.1.2:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
+ integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
+
+fast-glob@^3.2.9:
+ version "3.2.12"
+ resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80"
+ integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==
+ dependencies:
+ "@nodelib/fs.stat" "^2.0.2"
+ "@nodelib/fs.walk" "^1.2.3"
+ glob-parent "^5.1.2"
+ merge2 "^1.3.0"
+ micromatch "^4.0.4"
+
+fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
-file-uri-to-path@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
- integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
+fast-levenshtein@^1.0.0:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9"
+ integrity sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==
-filename-regex@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
- integrity sha512-BTCqyBaWBTsauvnHiE8i562+EdJj+oUpkqWp2R1iCoR8f6oo8STRu3of7WJJ0TqWtxN50a5YFpzYK4Jj9esYfQ==
+fast-levenshtein@^2.0.6:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
+ integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
-fill-range@^2.1.0:
- version "2.2.4"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565"
- integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==
+fastq@^1.6.0:
+ version "1.14.0"
+ resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.14.0.tgz#107f69d7295b11e0fccc264e1fc6389f623731ce"
+ integrity sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==
dependencies:
- is-number "^2.1.0"
- isobject "^2.0.0"
- randomatic "^3.0.0"
- repeat-element "^1.1.2"
- repeat-string "^1.5.2"
+ reusify "^1.0.4"
-fill-range@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
- integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==
+fb-watchman@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c"
+ integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==
dependencies:
- extend-shallow "^2.0.1"
- is-number "^3.0.0"
- repeat-string "^1.6.1"
- to-regex-range "^2.1.0"
+ bser "2.1.1"
+
+file-entry-cache@^6.0.1:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
+ integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==
+ dependencies:
+ flat-cache "^3.0.4"
fill-range@^7.0.1:
version "7.0.1"
@@ -1262,7 +2400,7 @@ fill-range@^7.0.1:
dependencies:
to-regex-range "^5.0.1"
-find-up@^4.1.0:
+find-up@^4.0.0, find-up@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"
integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
@@ -1270,60 +2408,65 @@ find-up@^4.1.0:
locate-path "^5.0.0"
path-exists "^4.0.0"
-flow-copy-source@^2.0.7:
- version "2.0.9"
- resolved "https://registry.yarnpkg.com/flow-copy-source/-/flow-copy-source-2.0.9.tgz#0c94ad842f2ae544d5a6b8ae720cee0b8678d742"
- integrity sha512-7zX/oHSIHe8YRGiA9QIcC4SW6KF667ikdmiDfbST15up1Ona8dn7Xy0PmSrfw6ceBWDww8sRKlCLKsztStpYkQ==
+find-up@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
+ integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
dependencies:
- chokidar "^3.0.0"
- fs-extra "^8.1.0"
- glob "^7.0.0"
- kefir "^3.7.3"
- yargs "^15.0.1"
+ locate-path "^6.0.0"
+ path-exists "^4.0.0"
-for-in@^1.0.1, for-in@^1.0.2:
+flat-cache@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
+ integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==
+ dependencies:
+ flatted "^3.1.0"
+ rimraf "^3.0.2"
+
+flatted@^3.1.0:
+ version "3.2.7"
+ resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
+ integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
+
+for-in@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==
-for-own@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce"
- integrity sha512-SKmowqGTJoPzLO1T0BBJpkfp3EMacCMOuH40hOUbrbzElVktk4DioXVM99QkLCyKoiuOmyjgcWMpVz2xjE7LZw==
+for-own@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b"
+ integrity sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==
dependencies:
for-in "^1.0.1"
-forever-agent@~0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
- integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==
-
-form-data@~2.3.2:
- version "2.3.3"
- resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
- integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
- dependencies:
- asynckit "^0.4.0"
- combined-stream "^1.0.6"
- mime-types "^2.1.12"
-
-fragment-cache@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
- integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==
- dependencies:
- map-cache "^0.2.2"
-
-fs-extra@^8.1.0:
- version "8.1.0"
- resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
- integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
+fs-extra@^10.0.0:
+ version "10.1.0"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
+ integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
dependencies:
graceful-fs "^4.2.0"
+ jsonfile "^6.0.1"
+ universalify "^2.0.0"
+
+fs-extra@~7.0.1:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
+ integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
+ dependencies:
+ graceful-fs "^4.1.2"
jsonfile "^4.0.0"
universalify "^0.1.0"
-fs-readdir-recursive@^1.0.0:
+fs-minipass@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb"
+ integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==
+ dependencies:
+ minipass "^3.0.0"
+
+fs-readdir-recursive@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27"
integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==
@@ -1333,95 +2476,51 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
-fsevents@^1.0.0:
- version "1.2.13"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38"
- integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==
- dependencies:
- bindings "^1.5.0"
- nan "^2.12.1"
-
-fsevents@~2.3.2:
+fsevents@^2.3.2, fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
-fstream@^1.0.0, fstream@^1.0.12:
- version "1.0.12"
- resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045"
- integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==
- dependencies:
- graceful-fs "^4.1.2"
- inherits "~2.0.0"
- mkdirp ">=0.5 0"
- rimraf "2"
+function-bind@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
-gauge@~2.7.3:
- version "2.7.4"
- resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
- integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==
- dependencies:
- aproba "^1.0.3"
- console-control-strings "^1.0.0"
- has-unicode "^2.0.0"
- object-assign "^4.1.0"
- signal-exit "^3.0.0"
- string-width "^1.0.1"
- strip-ansi "^3.0.1"
- wide-align "^1.1.0"
+gensync@^1.0.0-beta.2:
+ version "1.0.0-beta.2"
+ resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
+ integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
-get-caller-file@^2.0.1:
+get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
-get-value@^2.0.3, get-value@^2.0.6:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
- integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==
+get-package-type@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a"
+ integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==
-getpass@^0.1.1:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
- integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==
- dependencies:
- assert-plus "^1.0.0"
+get-stream@^6.0.0:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
+ integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
-glob-base@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
- integrity sha512-ab1S1g1EbO7YzauaJLkgLp7DZVAqj9M/dvKlTt8DkXA2tiOIcSMrlVI2J1RZyB5iJVccEscjGn+kpOG9788MHA==
- dependencies:
- glob-parent "^2.0.0"
- is-glob "^2.0.0"
-
-glob-parent@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28"
- integrity sha512-JDYOvfxio/t42HKdxkAYaCiBN7oYiuxykOxKxdaUW5Qn0zaYN3gRQWolrwdnf0shM9/EP0ebuuTmyoXNr1cC5w==
- dependencies:
- is-glob "^2.0.0"
-
-glob-parent@~5.1.2:
+glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
dependencies:
is-glob "^4.0.1"
-glob@7.1.1:
- version "7.1.1"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
- integrity sha512-mRyN/EsN2SyNhKWykF3eEGhDpeNplMWaW18Bmh76tnOqk5TbELAVwFAYOCmKVssOYFrYvvLMguiA+NXO3ZTuVA==
+glob-parent@^6.0.2:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3"
+ integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==
dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.2"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
+ is-glob "^4.0.3"
-glob@^7.0.0, glob@^7.0.3, glob@^7.1.2, glob@^7.1.3:
+glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.2.0:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
@@ -1433,108 +2532,108 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.1.2, glob@^7.1.3:
once "^1.3.0"
path-is-absolute "^1.0.0"
-globals@^9.18.0:
- version "9.18.0"
- resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
- integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==
+glob@^8.0.3:
+ version "8.0.3"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e"
+ integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^5.0.1"
+ once "^1.3.0"
-graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.2.0:
+globals@^11.1.0:
+ version "11.12.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
+ integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
+
+globals@^13.19.0:
+ version "13.19.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8"
+ integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==
+ dependencies:
+ type-fest "^0.20.2"
+
+globby@^11.1.0:
+ version "11.1.0"
+ resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
+ integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
+ dependencies:
+ array-union "^2.1.0"
+ dir-glob "^3.0.1"
+ fast-glob "^3.2.9"
+ ignore "^5.2.0"
+ merge2 "^1.4.1"
+ slash "^3.0.0"
+
+graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
-"graceful-readlink@>= 1.0.0":
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
- integrity sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w==
+grapheme-splitter@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
+ integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==
-growl@1.9.2:
- version "1.9.2"
- resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
- integrity sha512-RTBwDHhNuOx4F0hqzItc/siXCasGfC4DeWcBamclWd+6jWtBaeB/SGbMkGf0eiQoW7ib8JpvOgnUsmgMHI3Mfw==
+has-flag@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
+ integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==
-har-schema@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
- integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==
+has-flag@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
+ integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
-har-validator@~5.1.3:
- version "5.1.5"
- resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd"
- integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==
+has@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
dependencies:
- ajv "^6.12.3"
- har-schema "^2.0.0"
+ function-bind "^1.1.1"
-has-ansi@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
- integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==
+html-escaper@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
+ integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
+
+human-signals@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
+ integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
+
+ignore@^5.2.0:
+ version "5.2.4"
+ resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
+ integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==
+
+import-fresh@^3.0.0, import-fresh@^3.2.1:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
+ integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==
dependencies:
- ansi-regex "^2.0.0"
+ parent-module "^1.0.0"
+ resolve-from "^4.0.0"
-has-flag@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
- integrity sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==
+import-lazy@~4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153"
+ integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==
-has-unicode@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
- integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==
-
-has-value@^0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
- integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==
+import-local@^3.0.2:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4"
+ integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==
dependencies:
- get-value "^2.0.3"
- has-values "^0.1.4"
- isobject "^2.0.0"
+ pkg-dir "^4.2.0"
+ resolve-cwd "^3.0.0"
-has-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177"
- integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==
- dependencies:
- get-value "^2.0.6"
- has-values "^1.0.0"
- isobject "^3.0.0"
-
-has-values@^0.1.4:
+imurmurhash@^0.1.4:
version "0.1.4"
- resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
- integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==
-
-has-values@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f"
- integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==
- dependencies:
- is-number "^3.0.0"
- kind-of "^4.0.0"
-
-he@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
- integrity sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA==
-
-home-or-tmp@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
- integrity sha512-ycURW7oUxE2sNiPVw1HVEFsW+ecOpJ5zaj7eC0RlwhibhRBod20muUN8qu/gzx956YrLolVvs1MTXwKgC2rVEg==
- dependencies:
- os-homedir "^1.0.0"
- os-tmpdir "^1.0.1"
-
-http-signature@~1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
- integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==
- dependencies:
- assert-plus "^1.0.0"
- jsprim "^1.2.2"
- sshpk "^1.7.0"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+ integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==
inflight@^1.0.4:
version "1.0.6"
@@ -1544,38 +2643,15 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
-inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.3:
+inherits@2:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
-invariant@^2.2.2:
- version "2.2.4"
- resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
- integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
- dependencies:
- loose-envify "^1.0.0"
-
-is-accessor-descriptor@^0.1.6:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
- integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==
- dependencies:
- kind-of "^3.0.2"
-
-is-accessor-descriptor@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656"
- integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==
- dependencies:
- kind-of "^6.0.0"
-
-is-binary-path@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898"
- integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==
- dependencies:
- binary-extensions "^1.0.0"
+is-arrayish@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
+ integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==
is-binary-path@~2.1.0:
version "2.1.0"
@@ -1584,122 +2660,35 @@ is-binary-path@~2.1.0:
dependencies:
binary-extensions "^2.0.0"
-is-buffer@^1.1.5:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
- integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
-
-is-data-descriptor@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
- integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==
+is-core-module@^2.9.0:
+ version "2.11.0"
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144"
+ integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==
dependencies:
- kind-of "^3.0.2"
-
-is-data-descriptor@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7"
- integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==
- dependencies:
- kind-of "^6.0.0"
-
-is-descriptor@^0.1.0:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca"
- integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==
- dependencies:
- is-accessor-descriptor "^0.1.6"
- is-data-descriptor "^0.1.4"
- kind-of "^5.0.0"
-
-is-descriptor@^1.0.0, is-descriptor@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec"
- integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==
- dependencies:
- is-accessor-descriptor "^1.0.0"
- is-data-descriptor "^1.0.0"
- kind-of "^6.0.2"
-
-is-dotfile@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1"
- integrity sha512-9YclgOGtN/f8zx0Pr4FQYMdibBiTaH3sn52vjYip4ZSf6C4/6RfTEZ+MR4GvKhCxdPh21Bg42/WL55f6KSnKpg==
-
-is-equal-shallow@^0.1.3:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534"
- integrity sha512-0EygVC5qPvIyb+gSz7zdD5/AAoS6Qrx1e//6N4yv4oNm30kqvdmG66oZFWVlQHUWe5OjP08FuTw2IdT0EOTcYA==
- dependencies:
- is-primitive "^2.0.0"
-
-is-extendable@^0.1.0, is-extendable@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
- integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==
-
-is-extendable@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
- integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==
- dependencies:
- is-plain-object "^2.0.4"
-
-is-extglob@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0"
- integrity sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==
+ has "^1.0.3"
is-extglob@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
-is-finite@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3"
- integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==
-
-is-fullwidth-code-point@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
- integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==
- dependencies:
- number-is-nan "^1.0.0"
-
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
-is-glob@^2.0.0, is-glob@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863"
- integrity sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==
- dependencies:
- is-extglob "^1.0.0"
+is-generator-fn@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118"
+ integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==
-is-glob@^4.0.1, is-glob@~4.0.1:
+is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1:
version "4.0.3"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
dependencies:
is-extglob "^2.1.1"
-is-number@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
- integrity sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==
- dependencies:
- kind-of "^3.0.2"
-
-is-number@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
- integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==
- dependencies:
- kind-of "^3.0.2"
-
is-number@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff"
@@ -1710,109 +2699,495 @@ is-number@^7.0.0:
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
-is-plain-object@^2.0.3, is-plain-object@^2.0.4:
+is-path-inside@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
+ integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
+
+is-plain-object@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==
dependencies:
isobject "^3.0.1"
-is-posix-bracket@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4"
- integrity sha512-Yu68oeXJ7LeWNmZ3Zov/xg/oDBnBK2RNxwYY1ilNJX+tKKZqgPK+qOn/Gs9jEu66KDY9Netf5XLKNGzas/vPfQ==
-
-is-primitive@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
- integrity sha512-N3w1tFaRfk3UrPfqeRyD+GYDASU3W5VinKhlORy8EWVf/sIdDL9GAcew85XmktCfH+ngG7SRXEVDoO18WMdB/Q==
-
-is-typedarray@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
- integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==
-
-is-windows@^1.0.0, is-windows@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
- integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
-
-isarray@1.0.0, isarray@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
- integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==
+is-stream@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"
+ integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
-isobject@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
- integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==
- dependencies:
- isarray "1.0.0"
-
isobject@^3.0.0, isobject@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==
-isstream@~0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
- integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==
+istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3"
+ integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==
-"js-tokens@^3.0.0 || ^4.0.0":
+istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0:
+ version "5.2.1"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d"
+ integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==
+ dependencies:
+ "@babel/core" "^7.12.3"
+ "@babel/parser" "^7.14.7"
+ "@istanbuljs/schema" "^0.1.2"
+ istanbul-lib-coverage "^3.2.0"
+ semver "^6.3.0"
+
+istanbul-lib-report@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6"
+ integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==
+ dependencies:
+ istanbul-lib-coverage "^3.0.0"
+ make-dir "^3.0.0"
+ supports-color "^7.1.0"
+
+istanbul-lib-source-maps@^4.0.0:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551"
+ integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==
+ dependencies:
+ debug "^4.1.1"
+ istanbul-lib-coverage "^3.0.0"
+ source-map "^0.6.1"
+
+istanbul-reports@^3.1.3:
+ version "3.1.5"
+ resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae"
+ integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==
+ dependencies:
+ html-escaper "^2.0.0"
+ istanbul-lib-report "^3.0.0"
+
+jest-changed-files@^29.2.0:
+ version "29.2.0"
+ resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.2.0.tgz#b6598daa9803ea6a4dce7968e20ab380ddbee289"
+ integrity sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA==
+ dependencies:
+ execa "^5.0.0"
+ p-limit "^3.1.0"
+
+jest-circus@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.1.tgz#177d07c5c0beae8ef2937a67de68f1e17bbf1b4a"
+ integrity sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg==
+ dependencies:
+ "@jest/environment" "^29.3.1"
+ "@jest/expect" "^29.3.1"
+ "@jest/test-result" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ chalk "^4.0.0"
+ co "^4.6.0"
+ dedent "^0.7.0"
+ is-generator-fn "^2.0.0"
+ jest-each "^29.3.1"
+ jest-matcher-utils "^29.3.1"
+ jest-message-util "^29.3.1"
+ jest-runtime "^29.3.1"
+ jest-snapshot "^29.3.1"
+ jest-util "^29.3.1"
+ p-limit "^3.1.0"
+ pretty-format "^29.3.1"
+ slash "^3.0.0"
+ stack-utils "^2.0.3"
+
+jest-cli@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.1.tgz#e89dff427db3b1df50cea9a393ebd8640790416d"
+ integrity sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ==
+ dependencies:
+ "@jest/core" "^29.3.1"
+ "@jest/test-result" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ chalk "^4.0.0"
+ exit "^0.1.2"
+ graceful-fs "^4.2.9"
+ import-local "^3.0.2"
+ jest-config "^29.3.1"
+ jest-util "^29.3.1"
+ jest-validate "^29.3.1"
+ prompts "^2.0.1"
+ yargs "^17.3.1"
+
+jest-config@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.1.tgz#0bc3dcb0959ff8662957f1259947aedaefb7f3c6"
+ integrity sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg==
+ dependencies:
+ "@babel/core" "^7.11.6"
+ "@jest/test-sequencer" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ babel-jest "^29.3.1"
+ chalk "^4.0.0"
+ ci-info "^3.2.0"
+ deepmerge "^4.2.2"
+ glob "^7.1.3"
+ graceful-fs "^4.2.9"
+ jest-circus "^29.3.1"
+ jest-environment-node "^29.3.1"
+ jest-get-type "^29.2.0"
+ jest-regex-util "^29.2.0"
+ jest-resolve "^29.3.1"
+ jest-runner "^29.3.1"
+ jest-util "^29.3.1"
+ jest-validate "^29.3.1"
+ micromatch "^4.0.4"
+ parse-json "^5.2.0"
+ pretty-format "^29.3.1"
+ slash "^3.0.0"
+ strip-json-comments "^3.1.1"
+
+jest-diff@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527"
+ integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw==
+ dependencies:
+ chalk "^4.0.0"
+ diff-sequences "^29.3.1"
+ jest-get-type "^29.2.0"
+ pretty-format "^29.3.1"
+
+jest-docblock@^29.2.0:
+ version "29.2.0"
+ resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.2.0.tgz#307203e20b637d97cee04809efc1d43afc641e82"
+ integrity sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A==
+ dependencies:
+ detect-newline "^3.0.0"
+
+jest-each@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.3.1.tgz#bc375c8734f1bb96625d83d1ca03ef508379e132"
+ integrity sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA==
+ dependencies:
+ "@jest/types" "^29.3.1"
+ chalk "^4.0.0"
+ jest-get-type "^29.2.0"
+ jest-util "^29.3.1"
+ pretty-format "^29.3.1"
+
+jest-environment-node@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.1.tgz#5023b32472b3fba91db5c799a0d5624ad4803e74"
+ integrity sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag==
+ dependencies:
+ "@jest/environment" "^29.3.1"
+ "@jest/fake-timers" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ jest-mock "^29.3.1"
+ jest-util "^29.3.1"
+
+jest-get-type@^29.2.0:
+ version "29.2.0"
+ resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408"
+ integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA==
+
+jest-haste-map@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.1.tgz#af83b4347f1dae5ee8c2fb57368dc0bb3e5af843"
+ integrity sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A==
+ dependencies:
+ "@jest/types" "^29.3.1"
+ "@types/graceful-fs" "^4.1.3"
+ "@types/node" "*"
+ anymatch "^3.0.3"
+ fb-watchman "^2.0.0"
+ graceful-fs "^4.2.9"
+ jest-regex-util "^29.2.0"
+ jest-util "^29.3.1"
+ jest-worker "^29.3.1"
+ micromatch "^4.0.4"
+ walker "^1.0.8"
+ optionalDependencies:
+ fsevents "^2.3.2"
+
+jest-leak-detector@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.3.1.tgz#95336d020170671db0ee166b75cd8ef647265518"
+ integrity sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA==
+ dependencies:
+ jest-get-type "^29.2.0"
+ pretty-format "^29.3.1"
+
+jest-matcher-utils@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572"
+ integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ==
+ dependencies:
+ chalk "^4.0.0"
+ jest-diff "^29.3.1"
+ jest-get-type "^29.2.0"
+ pretty-format "^29.3.1"
+
+jest-message-util@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb"
+ integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA==
+ dependencies:
+ "@babel/code-frame" "^7.12.13"
+ "@jest/types" "^29.3.1"
+ "@types/stack-utils" "^2.0.0"
+ chalk "^4.0.0"
+ graceful-fs "^4.2.9"
+ micromatch "^4.0.4"
+ pretty-format "^29.3.1"
+ slash "^3.0.0"
+ stack-utils "^2.0.3"
+
+jest-mock@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.1.tgz#60287d92e5010979d01f218c6b215b688e0f313e"
+ integrity sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA==
+ dependencies:
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ jest-util "^29.3.1"
+
+jest-pnp-resolver@^1.2.2:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e"
+ integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==
+
+jest-regex-util@^29.2.0:
+ version "29.2.0"
+ resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b"
+ integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA==
+
+jest-resolve-dependencies@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.1.tgz#a6a329708a128e68d67c49f38678a4a4a914c3bf"
+ integrity sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA==
+ dependencies:
+ jest-regex-util "^29.2.0"
+ jest-snapshot "^29.3.1"
+
+jest-resolve@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.1.tgz#9a4b6b65387a3141e4a40815535c7f196f1a68a7"
+ integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw==
+ dependencies:
+ chalk "^4.0.0"
+ graceful-fs "^4.2.9"
+ jest-haste-map "^29.3.1"
+ jest-pnp-resolver "^1.2.2"
+ jest-util "^29.3.1"
+ jest-validate "^29.3.1"
+ resolve "^1.20.0"
+ resolve.exports "^1.1.0"
+ slash "^3.0.0"
+
+jest-runner@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.1.tgz#a92a879a47dd096fea46bb1517b0a99418ee9e2d"
+ integrity sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA==
+ dependencies:
+ "@jest/console" "^29.3.1"
+ "@jest/environment" "^29.3.1"
+ "@jest/test-result" "^29.3.1"
+ "@jest/transform" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ chalk "^4.0.0"
+ emittery "^0.13.1"
+ graceful-fs "^4.2.9"
+ jest-docblock "^29.2.0"
+ jest-environment-node "^29.3.1"
+ jest-haste-map "^29.3.1"
+ jest-leak-detector "^29.3.1"
+ jest-message-util "^29.3.1"
+ jest-resolve "^29.3.1"
+ jest-runtime "^29.3.1"
+ jest-util "^29.3.1"
+ jest-watcher "^29.3.1"
+ jest-worker "^29.3.1"
+ p-limit "^3.1.0"
+ source-map-support "0.5.13"
+
+jest-runtime@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.1.tgz#21efccb1a66911d6d8591276a6182f520b86737a"
+ integrity sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A==
+ dependencies:
+ "@jest/environment" "^29.3.1"
+ "@jest/fake-timers" "^29.3.1"
+ "@jest/globals" "^29.3.1"
+ "@jest/source-map" "^29.2.0"
+ "@jest/test-result" "^29.3.1"
+ "@jest/transform" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ chalk "^4.0.0"
+ cjs-module-lexer "^1.0.0"
+ collect-v8-coverage "^1.0.0"
+ glob "^7.1.3"
+ graceful-fs "^4.2.9"
+ jest-haste-map "^29.3.1"
+ jest-message-util "^29.3.1"
+ jest-mock "^29.3.1"
+ jest-regex-util "^29.2.0"
+ jest-resolve "^29.3.1"
+ jest-snapshot "^29.3.1"
+ jest-util "^29.3.1"
+ slash "^3.0.0"
+ strip-bom "^4.0.0"
+
+jest-snapshot@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.1.tgz#17bcef71a453adc059a18a32ccbd594b8cc4e45e"
+ integrity sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA==
+ dependencies:
+ "@babel/core" "^7.11.6"
+ "@babel/generator" "^7.7.2"
+ "@babel/plugin-syntax-jsx" "^7.7.2"
+ "@babel/plugin-syntax-typescript" "^7.7.2"
+ "@babel/traverse" "^7.7.2"
+ "@babel/types" "^7.3.3"
+ "@jest/expect-utils" "^29.3.1"
+ "@jest/transform" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/babel__traverse" "^7.0.6"
+ "@types/prettier" "^2.1.5"
+ babel-preset-current-node-syntax "^1.0.0"
+ chalk "^4.0.0"
+ expect "^29.3.1"
+ graceful-fs "^4.2.9"
+ jest-diff "^29.3.1"
+ jest-get-type "^29.2.0"
+ jest-haste-map "^29.3.1"
+ jest-matcher-utils "^29.3.1"
+ jest-message-util "^29.3.1"
+ jest-util "^29.3.1"
+ natural-compare "^1.4.0"
+ pretty-format "^29.3.1"
+ semver "^7.3.5"
+
+jest-util@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1"
+ integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ==
+ dependencies:
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ chalk "^4.0.0"
+ ci-info "^3.2.0"
+ graceful-fs "^4.2.9"
+ picomatch "^2.2.3"
+
+jest-validate@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.3.1.tgz#d56fefaa2e7d1fde3ecdc973c7f7f8f25eea704a"
+ integrity sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g==
+ dependencies:
+ "@jest/types" "^29.3.1"
+ camelcase "^6.2.0"
+ chalk "^4.0.0"
+ jest-get-type "^29.2.0"
+ leven "^3.1.0"
+ pretty-format "^29.3.1"
+
+jest-watcher@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.3.1.tgz#3341547e14fe3c0f79f9c3a4c62dbc3fc977fd4a"
+ integrity sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg==
+ dependencies:
+ "@jest/test-result" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ "@types/node" "*"
+ ansi-escapes "^4.2.1"
+ chalk "^4.0.0"
+ emittery "^0.13.1"
+ jest-util "^29.3.1"
+ string-length "^4.0.1"
+
+jest-worker@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.1.tgz#e9462161017a9bb176380d721cab022661da3d6b"
+ integrity sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw==
+ dependencies:
+ "@types/node" "*"
+ jest-util "^29.3.1"
+ merge-stream "^2.0.0"
+ supports-color "^8.0.0"
+
+jest@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.1.tgz#c130c0d551ae6b5459b8963747fed392ddbde122"
+ integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA==
+ dependencies:
+ "@jest/core" "^29.3.1"
+ "@jest/types" "^29.3.1"
+ import-local "^3.0.2"
+ jest-cli "^29.3.1"
+
+jju@^1.4.0, jju@~1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a"
+ integrity sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==
+
+js-sdsl@^4.1.4:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0"
+ integrity sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==
+
+js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
-js-tokens@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
- integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==
+js-yaml@^3.13.1:
+ version "3.14.1"
+ resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
+ integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
+ dependencies:
+ argparse "^1.0.7"
+ esprima "^4.0.0"
-jsbn@~0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
- integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==
+js-yaml@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
+ integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
+ dependencies:
+ argparse "^2.0.1"
-jsesc@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"
- integrity sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA==
+jsesc@^2.5.1:
+ version "2.5.2"
+ resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
+ integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
jsesc@~0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==
+json-parse-even-better-errors@^2.3.0:
+ version "2.3.1"
+ resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d"
+ integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==
+
json-schema-traverse@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
-json-schema@0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5"
- integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==
+json-stable-stringify-without-jsonify@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
+ integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
-json-stringify-safe@~5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
- integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==
-
-json3@3.3.2:
- version "3.3.2"
- resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
- integrity sha512-I5YLeauH3rIaE99EE++UeH2M2gSYo8/2TqDac7oZEH6D/DSQ4Woa628Qrfj1X9/OY5Mk5VvIDQaKCDchXaKrmA==
-
-json5@^0.5.1:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
- integrity sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==
+json5@^2.2.1:
+ version "2.2.2"
+ resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab"
+ integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ==
jsonfile@^4.0.0:
version "4.0.0"
@@ -1821,45 +3196,107 @@ jsonfile@^4.0.0:
optionalDependencies:
graceful-fs "^4.1.6"
-jsprim@^1.2.2:
- version "1.4.2"
- resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb"
- integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==
+jsonfile@^6.0.1:
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
+ integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
dependencies:
- assert-plus "1.0.0"
- extsprintf "1.3.0"
- json-schema "0.4.0"
- verror "1.10.0"
+ universalify "^2.0.0"
+ optionalDependencies:
+ graceful-fs "^4.1.6"
-kefir@^3.7.3:
- version "3.8.8"
- resolved "https://registry.yarnpkg.com/kefir/-/kefir-3.8.8.tgz#235932ddfbed422acebf5d7cba503035e9ea05c5"
- integrity sha512-xWga7QCZsR2Wjy2vNL3Kq/irT+IwxwItEWycRRlT5yhqHZK2fmEhziP+LzcJBWSTAMranGKtGTQ6lFpyJS3+jA==
-
-kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
- integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==
+"just-scripts-utils@>=1.2.0 <2.0.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/just-scripts-utils/-/just-scripts-utils-1.2.0.tgz#232a768a1083626e47c29c749e33d964ee027d56"
+ integrity sha512-rJMNtMz4V6uyMyfx+a2CqdMh1X/C9cVJTOPegvEzSonYMOKsiZEw2L9VzKVIFwNteKGZT6D2hFjSMAle41MAgA==
dependencies:
- is-buffer "^1.1.5"
+ fs-extra "^10.0.0"
+ glob "^7.1.3"
+ jju "^1.4.0"
+ just-task-logger ">=1.2.0 <2.0.0"
+ marked "^4.0.12"
+ marked-terminal "^4.1.0"
+ semver "^7.0.0"
+ tar "^6.1.9"
+ yargs "^16.2.0"
-kind-of@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
- integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==
+just-scripts@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/just-scripts/-/just-scripts-2.1.0.tgz#af60d3412f71b8fba4092c9a7596bd496e385d77"
+ integrity sha512-uaLUc92l1YeE8OiKT2RWU666KzJWWkoY6Gg4p1m5ctqgG51gjz9AsLeuoqCUaj5+n7/BIjD8PhtMoYi+F4nrKw==
dependencies:
- is-buffer "^1.1.5"
+ chalk "^4.0.0"
+ diff-match-patch "1.0.5"
+ fs-extra "^10.0.0"
+ glob "^7.1.3"
+ just-scripts-utils ">=1.2.0 <2.0.0"
+ just-task ">=1.7.0 <2.0.0"
+ prompts "^2.4.0"
+ run-parallel-limit "^1.0.6"
+ semver "^7.0.0"
+ supports-color "^8.1.0"
+ webpack-merge "^5.7.3"
-kind-of@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
- integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==
+"just-task-logger@>=1.2.0 <2.0.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/just-task-logger/-/just-task-logger-1.2.0.tgz#7467a6d24cce054e76fcfb7ebe2e44bdb629d05e"
+ integrity sha512-pa5FfJMiJ11KgCXDSfnbu/Enoiwm3ReOrSO9tP0CK69/yYtfsDhE8g6S0v6cCdDYGa4zpVkX7E4G1u3L7lAPTw==
+ dependencies:
+ chalk "^4.0.0"
+ yargs "^16.2.0"
-kind-of@^6.0.0, kind-of@^6.0.2:
+"just-task@>=1.7.0 <2.0.0":
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/just-task/-/just-task-1.7.0.tgz#ff646352e92c80b45c1e0a7133103337136d512c"
+ integrity sha512-1+meiNd3HEwvzRro+P4jtgS2rz1lAHe4hbGMAfrjEtXjCoK6n6VCQnLccfyuMRTj/f0DA61wMH51MQwjujYjoQ==
+ dependencies:
+ "@rushstack/package-deps-hash" "^3.2.5"
+ bach "^2.0.0"
+ chalk "^4.0.0"
+ chokidar "^3.5.2"
+ fs-extra "^10.0.0"
+ just-task-logger ">=1.2.0 <2.0.0"
+ resolve "^1.19.0"
+ undertaker "^1.3.0"
+ undertaker-registry "^2.0.0"
+ yargs-parser "^20.2.3"
+
+kind-of@^6.0.2:
version "6.0.3"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
+kleur@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
+ integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
+
+last-run@^1.1.0:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b"
+ integrity sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==
+ dependencies:
+ default-resolution "^2.0.0"
+ es6-weak-map "^2.0.1"
+
+leven@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
+ integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==
+
+levn@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
+ integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
+ dependencies:
+ prelude-ls "^1.2.1"
+ type-check "~0.4.0"
+
+lines-and-columns@^1.1.6:
+ version "1.2.4"
+ resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
+ integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
+
locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
@@ -1867,368 +3304,263 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"
-lodash._baseassign@^3.0.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
- integrity sha512-t3N26QR2IdSN+gqSy9Ds9pBu/J1EAFEshKlUHpJG3rvyJOYgcELIxcIeKKfZk7sjOz11cFfzJRsyFry/JyabJQ==
+locate-path@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
+ integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
dependencies:
- lodash._basecopy "^3.0.0"
- lodash.keys "^3.0.0"
+ p-locate "^5.0.0"
-lodash._basecopy@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
- integrity sha512-rFR6Vpm4HeCK1WPGvjZSJ+7yik8d8PVUdCJx5rT2pogG4Ve/2ZS7kfmO5l5T2o5V2mqlNIfSF5MZlr1+xOoYQQ==
+lodash.debounce@^4.0.8:
+ version "4.0.8"
+ resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
+ integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
-lodash._basecreate@^3.0.0:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821"
- integrity sha512-EDem6C9iQpn7fxnGdmhXmqYGjCkStmDXT4AeyB2Ph8WKbglg4aJZczNkQglj+zWXcOEEkViK8THuV2JvugW47g==
+lodash.get@^4.4.2:
+ version "4.4.2"
+ resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
+ integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==
-lodash._getnative@^3.0.0:
- version "3.9.1"
- resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
- integrity sha512-RrL9VxMEPyDMHOd9uFbvMe8X55X16/cGM5IgOKgRElQZutpX89iS6vwl64duTV1/16w5JY7tuFNXqoekmh1EmA==
+lodash.isequal@^4.5.0:
+ version "4.5.0"
+ resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
+ integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==
-lodash._isiterateecall@^3.0.0:
- version "3.0.9"
- resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c"
- integrity sha512-De+ZbrMu6eThFti/CSzhRvTKMgQToLxbij58LMfM8JnYDNSOjkjTCIaa8ixglOeGh2nyPlakbt5bJWJ7gvpYlQ==
+lodash.merge@^4.6.2:
+ version "4.6.2"
+ resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
+ integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
-lodash.create@3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7"
- integrity sha512-IUfOYwDEbI8JbhW6psW+Ig01BOVK67dTSCUAbS58M0HBkPcAv/jHuxD+oJVP2tUCo3H9L6f/8GM6rxwY+oc7/w==
- dependencies:
- lodash._baseassign "^3.0.0"
- lodash._basecreate "^3.0.0"
- lodash._isiterateecall "^3.0.0"
-
-lodash.isarguments@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
- integrity sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==
-
-lodash.isarray@^3.0.0:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
- integrity sha512-JwObCrNJuT0Nnbuecmqr5DgtuBppuCvGD9lxjFpAzwnVtdGoDQ1zig+5W8k5/6Gcn0gZ3936HDAlGd28i7sOGQ==
-
-lodash.keys@^3.0.0:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
- integrity sha512-CuBsapFjcubOGMn3VD+24HOAPxM79tH+V6ivJL3CHYjtrawauDJHUk//Yew9Hvc6e9rbCrURGk8z6PC+8WJBfQ==
- dependencies:
- lodash._getnative "^3.0.0"
- lodash.isarguments "^3.0.0"
- lodash.isarray "^3.0.0"
-
-lodash@^4.17.4:
+lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
-loose-envify@^1.0.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
- integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
+lru-cache@^5.1.1:
+ version "5.1.1"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
+ integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==
dependencies:
- js-tokens "^3.0.0 || ^4.0.0"
+ yallist "^3.0.2"
-lru-cache@^4.0.1:
- version "4.1.5"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
- integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
+lru-cache@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
+ integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
- pseudomap "^1.0.2"
- yallist "^2.1.2"
+ yallist "^4.0.0"
-map-cache@^0.2.2:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
- integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==
-
-map-visit@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f"
- integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==
+make-dir@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
+ integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==
dependencies:
- object-visit "^1.0.0"
+ pify "^4.0.1"
+ semver "^5.6.0"
-math-random@^1.0.1:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c"
- integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==
-
-micromatch@^2.1.5:
- version "2.3.11"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
- integrity sha512-LnU2XFEk9xxSJ6rfgAry/ty5qwUTyHYOBU0g4R6tIw5ljwgGIBmiKhRWLw5NpMOnrgUNcDJ4WMp8rl3sYVHLNA==
+make-dir@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
+ integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
dependencies:
- arr-diff "^2.0.0"
- array-unique "^0.2.1"
- braces "^1.8.2"
- expand-brackets "^0.1.4"
- extglob "^0.3.1"
- filename-regex "^2.0.0"
- is-extglob "^1.0.0"
- is-glob "^2.0.1"
- kind-of "^3.0.2"
- normalize-path "^2.0.1"
- object.omit "^2.0.0"
- parse-glob "^3.0.4"
- regex-cache "^0.4.2"
+ semver "^6.0.0"
-micromatch@^3.1.10:
- version "3.1.10"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
- integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==
+make-iterator@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6"
+ integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==
dependencies:
- arr-diff "^4.0.0"
- array-unique "^0.3.2"
- braces "^2.3.1"
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- extglob "^2.0.4"
- fragment-cache "^0.2.1"
kind-of "^6.0.2"
- nanomatch "^1.2.9"
- object.pick "^1.3.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.2"
-mime-db@1.52.0:
- version "1.52.0"
- resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
- integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
-
-mime-types@^2.1.12, mime-types@~2.1.19:
- version "2.1.35"
- resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
- integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
+makeerror@1.0.12:
+ version "1.0.12"
+ resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a"
+ integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==
dependencies:
- mime-db "1.52.0"
+ tmpl "1.0.5"
-minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1:
+marked-terminal@^4.1.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-4.2.0.tgz#593734a53cf9a4bb01ea961aa579bd21889ce502"
+ integrity sha512-DQfNRV9svZf0Dm9Cf5x5xaVJ1+XjxQW6XjFJ5HFkVyK52SDpj5PCBzS5X5r2w9nHr3mlB0T5201UMLue9fmhUw==
+ dependencies:
+ ansi-escapes "^4.3.1"
+ cardinal "^2.1.1"
+ chalk "^4.1.0"
+ cli-table3 "^0.6.0"
+ node-emoji "^1.10.0"
+ supports-hyperlinks "^2.1.0"
+
+marked@^4.0.12:
+ version "4.2.5"
+ resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.5.tgz#979813dfc1252cc123a79b71b095759a32f42a5d"
+ integrity sha512-jPueVhumq7idETHkb203WDD4fMA3yV9emQ5vLwop58lu8bTclMghBWcYAavlDqIEMaisADinV1TooIFCfqOsYQ==
+
+merge-stream@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
+ integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==
+
+merge2@^1.3.0, merge2@^1.4.1:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
+ integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
+
+micromatch@^4.0.4:
+ version "4.0.5"
+ resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
+ integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
+ dependencies:
+ braces "^3.0.2"
+ picomatch "^2.3.1"
+
+mimic-fn@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
+ integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
+
+minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"
-minimist@0.0.8:
- version "0.0.8"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
- integrity sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==
-
-minimist@^1.2.6:
- version "1.2.6"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
- integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
-
-mixin-deep@^1.2.0:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
- integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==
+minimatch@^5.0.1:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff"
+ integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==
dependencies:
- for-in "^1.0.2"
- is-extendable "^1.0.1"
+ brace-expansion "^2.0.1"
-mkdirp@0.5.1:
- version "0.5.1"
- resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
- integrity sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==
+minipass@^3.0.0:
+ version "3.3.6"
+ resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a"
+ integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==
dependencies:
- minimist "0.0.8"
+ yallist "^4.0.0"
-"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
- version "0.5.6"
- resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6"
- integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==
+minipass@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.0.0.tgz#7cebb0f9fa7d56f0c5b17853cbe28838a8dbbd3b"
+ integrity sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==
dependencies:
- minimist "^1.2.6"
+ yallist "^4.0.0"
-mocha@^3.2.0:
- version "3.5.3"
- resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d"
- integrity sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==
+minizlib@^2.1.1:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
+ integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==
dependencies:
- browser-stdout "1.3.0"
- commander "2.9.0"
- debug "2.6.8"
- diff "3.2.0"
- escape-string-regexp "1.0.5"
- glob "7.1.1"
- growl "1.9.2"
- he "1.1.1"
- json3 "3.3.2"
- lodash.create "3.1.1"
- mkdirp "0.5.1"
- supports-color "3.1.2"
+ minipass "^3.0.0"
+ yallist "^4.0.0"
-ms@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
- integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==
+mkdirp@^1.0.3:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
+ integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
-nan@^2.12.1, nan@^2.9.2:
- version "2.16.0"
- resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916"
- integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==
+ms@2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
+ integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
-nanomatch@^1.2.9:
- version "1.2.13"
- resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
- integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==
+natural-compare@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
+ integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
+
+next-tick@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb"
+ integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==
+
+node-emoji@^1.10.0:
+ version "1.11.0"
+ resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c"
+ integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==
dependencies:
- arr-diff "^4.0.0"
- array-unique "^0.3.2"
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- fragment-cache "^0.2.1"
- is-windows "^1.0.2"
- kind-of "^6.0.2"
- object.pick "^1.3.0"
- regex-not "^1.0.0"
- snapdragon "^0.8.1"
- to-regex "^3.0.1"
+ lodash "^4.17.21"
-nbind@^0.3.14:
- version "0.3.15"
- resolved "https://registry.yarnpkg.com/nbind/-/nbind-0.3.15.tgz#20c74d77d54e28627ab8268c2767f7e40aef8c53"
- integrity sha512-TrKLNRj5D8wZRJb7XmUNbA1W3iTigAEpm3qaGig5bEWY/iCT2IQBgBc2EUGO59FbRIGhx5hB/McVwqxlSGScVw==
- dependencies:
- emscripten-library-decorator "~0.2.2"
- mkdirp "~0.5.1"
- nan "^2.9.2"
+node-int64@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
+ integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==
-node-gyp@^3.6.2:
- version "3.8.0"
- resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c"
- integrity sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==
- dependencies:
- fstream "^1.0.0"
- glob "^7.0.3"
- graceful-fs "^4.1.2"
- mkdirp "^0.5.0"
- nopt "2 || 3"
- npmlog "0 || 1 || 2 || 3 || 4"
- osenv "0"
- request "^2.87.0"
- rimraf "2"
- semver "~5.3.0"
- tar "^2.0.0"
- which "1"
-
-"nopt@2 || 3":
- version "3.0.6"
- resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
- integrity sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==
- dependencies:
- abbrev "1"
-
-normalize-path@^2.0.0, normalize-path@^2.0.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
- integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==
- dependencies:
- remove-trailing-separator "^1.0.1"
+node-releases@^2.0.6:
+ version "2.0.8"
+ resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae"
+ integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
-"npmlog@0 || 1 || 2 || 3 || 4":
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
- integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
+now-and-later@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c"
+ integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==
dependencies:
- are-we-there-yet "~1.1.2"
- console-control-strings "~1.1.0"
- gauge "~2.7.3"
- set-blocking "~2.0.0"
+ once "^1.3.2"
-number-is-nan@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
- integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==
-
-oauth-sign@~0.9.0:
- version "0.9.0"
- resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
- integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
-
-object-assign@^4.1.0:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
- integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
-
-object-copy@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
- integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==
+now-and-later@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-3.0.0.tgz#cdc045dc5b894b35793cf276cc3206077bb7302d"
+ integrity sha512-pGO4pzSdaxhWTGkfSfHx3hVzJVslFPwBp2Myq9MYN/ChfJZF87ochMAXnvz6/58RJSf5ik2q9tXprBBrk2cpcg==
dependencies:
- copy-descriptor "^0.1.0"
- define-property "^0.2.5"
- kind-of "^3.0.3"
+ once "^1.4.0"
-object-visit@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
- integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==
+npm-run-path@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea"
+ integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==
dependencies:
+ path-key "^3.0.0"
+
+object.defaults@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf"
+ integrity sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==
+ dependencies:
+ array-each "^1.0.1"
+ array-slice "^1.0.0"
+ for-own "^1.0.0"
isobject "^3.0.0"
-object.omit@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
- integrity sha512-UiAM5mhmIuKLsOvrL+B0U2d1hXHF3bFYWIuH1LMpuV2EJEHG1Ntz06PgLEHjm6VFd87NpH8rastvPoyv6UW2fA==
+object.reduce@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad"
+ integrity sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==
dependencies:
- for-own "^0.1.4"
- is-extendable "^0.1.1"
+ for-own "^1.0.0"
+ make-iterator "^1.0.0"
-object.pick@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
- integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==
- dependencies:
- isobject "^3.0.1"
-
-once@^1.3.0:
+once@^1.3.0, once@^1.3.2, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
dependencies:
wrappy "1"
-os-homedir@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
- integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==
-
-os-tmpdir@^1.0.0, os-tmpdir@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
- integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==
-
-osenv@0:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
- integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
+onetime@^5.1.2:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e"
+ integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==
dependencies:
- os-homedir "^1.0.0"
- os-tmpdir "^1.0.0"
+ mimic-fn "^2.1.0"
-output-file-sync@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76"
- integrity sha512-uQLlclru4xpCi+tfs80l3QF24KL81X57ELNMy7W/dox+JTtxUf1bLyQ8968fFCmSqqbokjW0kn+WBIlO+rSkNg==
+optionator@^0.9.1:
+ version "0.9.1"
+ resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499"
+ integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==
dependencies:
- graceful-fs "^4.1.4"
- mkdirp "^0.5.1"
- object-assign "^4.1.0"
+ deep-is "^0.1.3"
+ fast-levenshtein "^2.0.6"
+ levn "^0.4.1"
+ prelude-ls "^1.2.1"
+ type-check "^0.4.0"
+ word-wrap "^1.2.3"
p-limit@^2.2.0:
version "2.3.0"
@@ -2237,6 +3569,13 @@ p-limit@^2.2.0:
dependencies:
p-try "^2.0.0"
+p-limit@^3.0.2, p-limit@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
+ integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
+ dependencies:
+ yocto-queue "^0.1.0"
+
p-locate@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07"
@@ -2244,116 +3583,140 @@ p-locate@^4.1.0:
dependencies:
p-limit "^2.2.0"
+p-locate@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
+ integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
+ dependencies:
+ p-limit "^3.0.2"
+
p-try@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
-parse-glob@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
- integrity sha512-FC5TeK0AwXzq3tUBFtH74naWkPQCEWs4K+xMxWZBlKDWu0bVHXGZa+KKqxKidd7xwhdZ19ZNuF2uO1M/r196HA==
+parent-module@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
+ integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
dependencies:
- glob-base "^0.3.0"
- is-dotfile "^1.0.0"
- is-extglob "^1.0.0"
- is-glob "^2.0.0"
+ callsites "^3.0.0"
-pascalcase@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
- integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==
+parse-json@^5.2.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd"
+ integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ error-ex "^1.3.1"
+ json-parse-even-better-errors "^2.3.0"
+ lines-and-columns "^1.1.6"
path-exists@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
-path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
+path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
-performance-now@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
- integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==
+path-key@^3.0.0, path-key@^3.1.0:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
+ integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
-picomatch@^2.0.4, picomatch@^2.2.1:
+path-parse@^1.0.6, path-parse@^1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
+ integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
+
+path-type@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
+ integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
+
+picocolors@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
+ integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
+
+picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
-posix-character-classes@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
- integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==
+pify@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
+ integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==
-preserve@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
- integrity sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ==
+pirates@^4.0.4:
+ version "4.0.5"
+ resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b"
+ integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==
-private@^0.1.6, private@^0.1.8:
- version "0.1.8"
- resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
- integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==
+pkg-dir@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
+ integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==
+ dependencies:
+ find-up "^4.0.0"
-process-nextick-args@~2.0.0:
+prelude-ls@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
+ integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
+
+prettier-linter-helpers@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
+ integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
+ dependencies:
+ fast-diff "^1.1.2"
+
+prettier@^2.4.1:
+ version "2.8.1"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc"
+ integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==
+
+pretty-format@^29.3.1:
+ version "29.3.1"
+ resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da"
+ integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==
+ dependencies:
+ "@jest/schemas" "^29.0.0"
+ ansi-styles "^5.0.0"
+ react-is "^18.0.0"
+
+process-nextick-args@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
-pseudomap@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
- integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==
+prompts@^2.0.1, prompts@^2.4.0:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069"
+ integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==
+ dependencies:
+ kleur "^3.0.3"
+ sisteransi "^1.0.5"
-psl@^1.1.28:
- version "1.9.0"
- resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
- integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==
-
-punycode@^2.1.0, punycode@^2.1.1:
+punycode@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
-qs@~6.5.2:
- version "6.5.3"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
- integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==
+queue-microtask@^1.2.2:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
+ integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
-randomatic@^3.0.0:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed"
- integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==
- dependencies:
- is-number "^4.0.0"
- kind-of "^6.0.0"
- math-random "^1.0.1"
-
-readable-stream@^2.0.2, readable-stream@^2.0.6:
- version "2.3.7"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
- integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.3"
- isarray "~1.0.0"
- process-nextick-args "~2.0.0"
- safe-buffer "~5.1.1"
- string_decoder "~1.1.1"
- util-deprecate "~1.0.1"
-
-readdirp@^2.0.0:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525"
- integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==
- dependencies:
- graceful-fs "^4.1.11"
- micromatch "^3.1.10"
- readable-stream "^2.0.2"
+react-is@^18.0.0:
+ version "18.2.0"
+ resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
+ integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
readdirp@~3.6.0:
version "3.6.0"
@@ -2362,308 +3725,230 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"
-regenerate@^1.2.1:
+redeyed@~2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-2.1.1.tgz#8984b5815d99cb220469c99eeeffe38913e6cc0b"
+ integrity sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==
+ dependencies:
+ esprima "~4.0.0"
+
+regenerate-unicode-properties@^10.1.0:
+ version "10.1.0"
+ resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c"
+ integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==
+ dependencies:
+ regenerate "^1.4.2"
+
+regenerate@^1.4.2:
version "1.4.2"
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==
-regenerator-runtime@^0.10.5:
- version "0.10.5"
- resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
- integrity sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==
+regenerator-runtime@^0.13.11:
+ version "0.13.11"
+ resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
+ integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
-regenerator-runtime@^0.11.0:
- version "0.11.1"
- resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
- integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==
-
-regenerator-transform@^0.10.0:
- version "0.10.1"
- resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd"
- integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==
+regenerator-transform@^0.15.1:
+ version "0.15.1"
+ resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56"
+ integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==
dependencies:
- babel-runtime "^6.18.0"
- babel-types "^6.19.0"
- private "^0.1.6"
+ "@babel/runtime" "^7.8.4"
-regex-cache@^0.4.2:
- version "0.4.4"
- resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd"
- integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==
+regexpp@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
+ integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
+
+regexpu-core@^5.2.1:
+ version "5.2.2"
+ resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc"
+ integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw==
dependencies:
- is-equal-shallow "^0.1.3"
+ regenerate "^1.4.2"
+ regenerate-unicode-properties "^10.1.0"
+ regjsgen "^0.7.1"
+ regjsparser "^0.9.1"
+ unicode-match-property-ecmascript "^2.0.0"
+ unicode-match-property-value-ecmascript "^2.1.0"
-regex-not@^1.0.0, regex-not@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"
- integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==
- dependencies:
- extend-shallow "^3.0.2"
- safe-regex "^1.1.0"
+regjsgen@^0.7.1:
+ version "0.7.1"
+ resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.7.1.tgz#ee5ef30e18d3f09b7c369b76e7c2373ed25546f6"
+ integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA==
-regexpu-core@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240"
- integrity sha512-tJ9+S4oKjxY8IZ9jmjnp/mtytu1u3iyIQAfmI51IKWH6bFf7XR1ybtaO6j7INhZKXOTYADk7V5qxaqLkmNxiZQ==
- dependencies:
- regenerate "^1.2.1"
- regjsgen "^0.2.0"
- regjsparser "^0.1.4"
-
-regjsgen@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7"
- integrity sha512-x+Y3yA24uF68m5GA+tBjbGYo64xXVJpbToBaWCoSNSc1hdk6dfctaRWrNFTVJZIIhL5GxW8zwjoixbnifnK59g==
-
-regjsparser@^0.1.4:
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c"
- integrity sha512-jlQ9gYLfk2p3V5Ag5fYhA7fv7OHzd1KUH0PRP46xc3TgwjwgROIW572AfYg/X9kaNq/LJnu6oJcFRXlIrGoTRw==
+regjsparser@^0.9.1:
+ version "0.9.1"
+ resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709"
+ integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==
dependencies:
jsesc "~0.5.0"
-remove-trailing-separator@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
- integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==
-
-repeat-element@^1.1.2:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9"
- integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==
-
-repeat-string@^1.5.2, repeat-string@^1.6.1:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
- integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==
-
-repeating@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
- integrity sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==
- dependencies:
- is-finite "^1.0.0"
-
-request@^2.87.0:
- version "2.88.2"
- resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
- integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==
- dependencies:
- aws-sign2 "~0.7.0"
- aws4 "^1.8.0"
- caseless "~0.12.0"
- combined-stream "~1.0.6"
- extend "~3.0.2"
- forever-agent "~0.6.1"
- form-data "~2.3.2"
- har-validator "~5.1.3"
- http-signature "~1.2.0"
- is-typedarray "~1.0.0"
- isstream "~0.1.2"
- json-stringify-safe "~5.0.1"
- mime-types "~2.1.19"
- oauth-sign "~0.9.0"
- performance-now "^2.1.0"
- qs "~6.5.2"
- safe-buffer "^5.1.2"
- tough-cookie "~2.5.0"
- tunnel-agent "^0.6.0"
- uuid "^3.3.2"
-
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
-require-main-filename@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
- integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
+resolve-cwd@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"
+ integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==
+ dependencies:
+ resolve-from "^5.0.0"
-resolve-url@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
- integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==
+resolve-from@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
+ integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
-resolve@~1.1.7:
- version "1.1.7"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
- integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==
+resolve-from@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
+ integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
-ret@~0.1.10:
- version "0.1.15"
- resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
- integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
+resolve.exports@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9"
+ integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==
-rimraf@2:
- version "2.7.1"
- resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
- integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
+resolve@^1.1.6, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0:
+ version "1.22.1"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"
+ integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==
+ dependencies:
+ is-core-module "^2.9.0"
+ path-parse "^1.0.7"
+ supports-preserve-symlinks-flag "^1.0.0"
+
+resolve@~1.17.0:
+ version "1.17.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
+ integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
+ dependencies:
+ path-parse "^1.0.6"
+
+reusify@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
+ integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
+
+rimraf@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
+ integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
dependencies:
glob "^7.1.3"
-safe-buffer@^5.0.1, safe-buffer@^5.1.2:
- version "5.2.1"
- resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
- integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
-
-safe-buffer@~5.1.0, safe-buffer@~5.1.1:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
- integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
-
-safe-regex@^1.1.0:
+run-parallel-limit@^1.0.6:
version "1.1.0"
- resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
- integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==
+ resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba"
+ integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==
dependencies:
- ret "~0.1.10"
+ queue-microtask "^1.2.2"
-safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
- integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
-
-semver@~5.3.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
- integrity sha512-mfmm3/H9+67MCVix1h+IXTpDwL6710LyHuk7+cWC9T1mE0qz4iHhh6r4hU2wrIT9iTsAAC2XQRvfblL028cpLw==
-
-set-blocking@^2.0.0, set-blocking@~2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
- integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==
-
-set-value@^2.0.0, set-value@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
- integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==
- dependencies:
- extend-shallow "^2.0.1"
- is-extendable "^0.1.1"
- is-plain-object "^2.0.3"
- split-string "^3.0.1"
-
-shebang-command@^1.2.0:
+run-parallel@^1.1.9:
version "1.2.0"
- resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
- integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==
+ resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
+ integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
dependencies:
- shebang-regex "^1.0.0"
+ queue-microtask "^1.2.2"
-shebang-regex@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
- integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==
+semver@^5.6.0:
+ version "5.7.1"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
+ integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
-signal-exit@^3.0.0:
+semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
+ version "6.3.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
+ integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
+
+semver@^7.0.0, semver@^7.3.5, semver@^7.3.7, semver@~7.3.0:
+ version "7.3.8"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
+ integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
+ dependencies:
+ lru-cache "^6.0.0"
+
+shallow-clone@^3.0.0:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"
+ integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==
+ dependencies:
+ kind-of "^6.0.2"
+
+shebang-command@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
+ integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
+ dependencies:
+ shebang-regex "^3.0.0"
+
+shebang-regex@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
+ integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
+
+signal-exit@^3.0.3, signal-exit@^3.0.7:
version "3.0.7"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
-slash@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
- integrity sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==
+sisteransi@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
+ integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
-snapdragon-node@^2.0.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
- integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==
+slash@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
+ integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
+
+slash@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
+ integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
+
+source-map-support@0.5.13:
+ version "0.5.13"
+ resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932"
+ integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==
dependencies:
- define-property "^1.0.0"
- isobject "^3.0.0"
- snapdragon-util "^3.0.1"
+ buffer-from "^1.0.0"
+ source-map "^0.6.0"
-snapdragon-util@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2"
- integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==
+source-map@^0.6.0, source-map@^0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
+ integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
+
+sprintf-js@~1.0.2:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
+ integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==
+
+stack-utils@^2.0.3:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f"
+ integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==
dependencies:
- kind-of "^3.2.0"
+ escape-string-regexp "^2.0.0"
-snapdragon@^0.8.1:
- version "0.8.2"
- resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d"
- integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==
- dependencies:
- base "^0.11.1"
- debug "^2.2.0"
- define-property "^0.2.5"
- extend-shallow "^2.0.1"
- map-cache "^0.2.2"
- source-map "^0.5.6"
- source-map-resolve "^0.5.0"
- use "^3.1.0"
-
-source-map-resolve@^0.5.0:
- version "0.5.3"
- resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"
- integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==
- dependencies:
- atob "^2.1.2"
- decode-uri-component "^0.2.0"
- resolve-url "^0.2.1"
- source-map-url "^0.4.0"
- urix "^0.1.0"
-
-source-map-support@^0.4.15:
- version "0.4.18"
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
- integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==
- dependencies:
- source-map "^0.5.6"
-
-source-map-url@^0.4.0:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56"
- integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==
-
-source-map@^0.5.6, source-map@^0.5.7:
- version "0.5.7"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
- integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==
-
-split-string@^3.0.1, split-string@^3.0.2:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
- integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==
- dependencies:
- extend-shallow "^3.0.0"
-
-sshpk@^1.7.0:
- version "1.17.0"
- resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5"
- integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==
- dependencies:
- asn1 "~0.2.3"
- assert-plus "^1.0.0"
- bcrypt-pbkdf "^1.0.0"
- dashdash "^1.12.0"
- ecc-jsbn "~0.1.1"
- getpass "^0.1.1"
- jsbn "~0.1.0"
- safer-buffer "^2.0.2"
- tweetnacl "~0.14.0"
-
-static-extend@^0.1.1:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
- integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==
- dependencies:
- define-property "^0.2.5"
- object-copy "^0.1.0"
-
-string-width@^1.0.1:
+stream-exhaust@^1.0.1, stream-exhaust@^1.0.2:
version "1.0.2"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
- integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==
- dependencies:
- code-point-at "^1.0.0"
- is-fullwidth-code-point "^1.0.0"
- strip-ansi "^3.0.0"
+ resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d"
+ integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==
-"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0:
+string-length@^4.0.1:
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a"
+ integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==
+ dependencies:
+ char-regex "^1.0.2"
+ strip-ansi "^6.0.0"
+
+string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -2672,20 +3957,6 @@ string-width@^1.0.1:
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
-string_decoder@~1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
- integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
- dependencies:
- safe-buffer "~5.1.0"
-
-strip-ansi@^3.0.0, strip-ansi@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
- integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==
- dependencies:
- ansi-regex "^2.0.0"
-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
@@ -2693,46 +3964,90 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1:
dependencies:
ansi-regex "^5.0.1"
-supports-color@3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
- integrity sha512-F8dvPrZJtNzvDRX26eNXT4a7AecAvTGljmmnI39xEgSpbHKhQ7N0dO/NTxUExd0wuLHp4zbwYY7lvHq0aKpwrA==
- dependencies:
- has-flag "^1.0.0"
+strip-bom@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878"
+ integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==
-supports-color@^2.0.0:
+strip-final-newline@^2.0.0:
version "2.0.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
- integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==
+ resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
+ integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
-tar@^2.0.0:
- version "2.2.2"
- resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40"
- integrity sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==
+strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
+ integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
+
+supports-color@^5.3.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
+ integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
dependencies:
- block-stream "*"
- fstream "^1.0.12"
- inherits "2"
+ has-flag "^3.0.0"
-to-fast-properties@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
- integrity sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==
-
-to-object-path@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
- integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==
+supports-color@^7.0.0, supports-color@^7.1.0:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
+ integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
dependencies:
- kind-of "^3.0.2"
+ has-flag "^4.0.0"
-to-regex-range@^2.1.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38"
- integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==
+supports-color@^8.0.0, supports-color@^8.1.0:
+ version "8.1.1"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
+ integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
dependencies:
- is-number "^3.0.0"
- repeat-string "^1.6.1"
+ has-flag "^4.0.0"
+
+supports-hyperlinks@^2.1.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624"
+ integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==
+ dependencies:
+ has-flag "^4.0.0"
+ supports-color "^7.0.0"
+
+supports-preserve-symlinks-flag@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
+ integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+
+tar@^6.1.9:
+ version "6.1.13"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b"
+ integrity sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==
+ dependencies:
+ chownr "^2.0.0"
+ fs-minipass "^2.0.0"
+ minipass "^4.0.0"
+ minizlib "^2.1.1"
+ mkdirp "^1.0.3"
+ yallist "^4.0.0"
+
+test-exclude@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"
+ integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==
+ dependencies:
+ "@istanbuljs/schema" "^0.1.2"
+ glob "^7.1.4"
+ minimatch "^3.0.4"
+
+text-table@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
+ integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
+
+tmpl@1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
+ integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==
+
+to-fast-properties@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
+ integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==
to-regex-range@^5.0.1:
version "5.0.1"
@@ -2741,63 +4056,116 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"
-to-regex@^3.0.1, to-regex@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
- integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==
- dependencies:
- define-property "^2.0.2"
- extend-shallow "^3.0.2"
- regex-not "^1.0.2"
- safe-regex "^1.1.0"
+tslib@^1.8.1:
+ version "1.14.1"
+ resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
+ integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
-tough-cookie@~2.5.0:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
- integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
+tsutils@^3.21.0:
+ version "3.21.0"
+ resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
+ integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
dependencies:
- psl "^1.1.28"
- punycode "^2.1.1"
+ tslib "^1.8.1"
-trim-right@^1.0.1:
+type-check@^0.4.0, type-check@~0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
+ integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
+ dependencies:
+ prelude-ls "^1.2.1"
+
+type-detect@4.0.8:
+ version "4.0.8"
+ resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
+ integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==
+
+type-fest@^0.20.2:
+ version "0.20.2"
+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
+ integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
+
+type-fest@^0.21.3:
+ version "0.21.3"
+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
+ integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
+
+type@^1.0.1:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0"
+ integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==
+
+type@^2.7.2:
+ version "2.7.2"
+ resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0"
+ integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==
+
+undertaker-registry@^1.0.0:
version "1.0.1"
- resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
- integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==
+ resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50"
+ integrity sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==
-tunnel-agent@^0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
- integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==
+undertaker-registry@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-2.0.0.tgz#d434246e398444740dd7fe4c9543e402ad99e4ca"
+ integrity sha512-+hhVICbnp+rlzZMgxXenpvTxpuvA67Bfgtt+O9WOE5jo7w/dyiF1VmoZVIHvP2EkUjsyKyTwYKlLhA+j47m1Ew==
+
+undertaker@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18"
+ integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==
dependencies:
- safe-buffer "^5.0.1"
+ arr-flatten "^1.0.1"
+ arr-map "^2.0.0"
+ bach "^1.0.0"
+ collection-map "^1.0.0"
+ es6-weak-map "^2.0.1"
+ fast-levenshtein "^1.0.0"
+ last-run "^1.1.0"
+ object.defaults "^1.0.0"
+ object.reduce "^1.0.0"
+ undertaker-registry "^1.0.0"
-tweetnacl@^0.14.3, tweetnacl@~0.14.0:
- version "0.14.5"
- resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
- integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==
+unicode-canonical-property-names-ecmascript@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
+ integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==
-union-value@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847"
- integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==
+unicode-match-property-ecmascript@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3"
+ integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==
dependencies:
- arr-union "^3.1.0"
- get-value "^2.0.6"
- is-extendable "^0.1.1"
- set-value "^2.0.1"
+ unicode-canonical-property-names-ecmascript "^2.0.0"
+ unicode-property-aliases-ecmascript "^2.0.0"
+
+unicode-match-property-value-ecmascript@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0"
+ integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==
+
+unicode-property-aliases-ecmascript@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd"
+ integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
-unset-value@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
- integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==
+universalify@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
+ integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==
+
+update-browserslist-db@^1.0.9:
+ version "1.0.10"
+ resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3"
+ integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==
dependencies:
- has-value "^0.3.1"
- isobject "^3.0.0"
+ escalade "^3.1.1"
+ picocolors "^1.0.0"
uri-js@^4.2.2:
version "4.4.1"
@@ -2806,70 +4174,63 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"
-urix@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
- integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==
-
-use@^3.1.0:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
- integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==
-
-user-home@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190"
- integrity sha512-aggiKfEEubv3UwRNqTzLInZpAOmKzwdHqEBmW/hBA/mt99eg+b4VrX6i+IRLxU8+WJYfa33rGwRseg4eElUgsQ==
-
-util-deprecate@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
- integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
-
-uuid@^3.3.2:
- version "3.4.0"
- resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
- integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
-
-v8flags@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4"
- integrity sha512-SKfhk/LlaXzvtowJabLZwD4K6SGRYeoxA7KJeISlUMAB/NT4CBkZjMq3WceX2Ckm4llwqYVo8TICgsDYCBU2tA==
+v8-to-istanbul@^9.0.1:
+ version "9.0.1"
+ resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4"
+ integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==
dependencies:
- user-home "^1.1.1"
+ "@jridgewell/trace-mapping" "^0.3.12"
+ "@types/istanbul-lib-coverage" "^2.0.1"
+ convert-source-map "^1.6.0"
-verror@1.10.0:
- version "1.10.0"
- resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
- integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==
+validator@^13.7.0:
+ version "13.7.0"
+ resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857"
+ integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==
+
+walker@^1.0.8:
+ version "1.0.8"
+ resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f"
+ integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==
dependencies:
- assert-plus "^1.0.0"
- core-util-is "1.0.2"
- extsprintf "^1.2.0"
+ makeerror "1.0.12"
-which-module@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
- integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==
+webpack-merge@^5.7.3:
+ version "5.8.0"
+ resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61"
+ integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==
+ dependencies:
+ clone-deep "^4.0.1"
+ wildcard "^2.0.0"
-which@1, which@^1.2.9:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
- integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
+which@^2.0.1:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
+ integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
dependencies:
isexe "^2.0.0"
-wide-align@^1.1.0:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3"
- integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==
+which@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/which/-/which-3.0.0.tgz#a9efd016db59728758a390d23f1687b6e8f59f8e"
+ integrity sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==
dependencies:
- string-width "^1.0.2 || 2 || 3 || 4"
+ isexe "^2.0.0"
-wrap-ansi@^6.2.0:
- version "6.2.0"
- resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53"
- integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
+wildcard@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec"
+ integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==
+
+word-wrap@^1.2.3:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
+ integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
+
+wrap-ansi@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
+ integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
@@ -2880,37 +4241,77 @@ wrappy@1:
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
-y18n@^4.0.0:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf"
- integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==
-
-yallist@^2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
- integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==
-
-yargs-parser@^18.1.2:
- version "18.1.3"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"
- integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
+write-file-atomic@^4.0.1:
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd"
+ integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==
dependencies:
- camelcase "^5.0.0"
- decamelize "^1.2.0"
+ imurmurhash "^0.1.4"
+ signal-exit "^3.0.7"
-yargs@^15.0.1:
- version "15.4.1"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
- integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
+y18n@^5.0.5:
+ version "5.0.8"
+ resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
+ integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
+
+yallist@^3.0.2:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
+ integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
+
+yallist@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
+ integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
+
+yargs-parser@^20.2.2, yargs-parser@^20.2.3:
+ version "20.2.9"
+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
+ integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
+
+yargs-parser@^21.1.1:
+ version "21.1.1"
+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
+ integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
+
+yargs@^16.2.0:
+ version "16.2.0"
+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
+ integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
dependencies:
- cliui "^6.0.0"
- decamelize "^1.2.0"
- find-up "^4.1.0"
- get-caller-file "^2.0.1"
+ cliui "^7.0.2"
+ escalade "^3.1.1"
+ get-caller-file "^2.0.5"
require-directory "^2.1.1"
- require-main-filename "^2.0.0"
- set-blocking "^2.0.0"
string-width "^4.2.0"
- which-module "^2.0.0"
- y18n "^4.0.0"
- yargs-parser "^18.1.2"
+ y18n "^5.0.5"
+ yargs-parser "^20.2.2"
+
+yargs@^17.3.1:
+ version "17.6.2"
+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541"
+ integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==
+ dependencies:
+ cliui "^8.0.1"
+ escalade "^3.1.1"
+ get-caller-file "^2.0.5"
+ require-directory "^2.1.1"
+ string-width "^4.2.3"
+ y18n "^5.0.5"
+ yargs-parser "^21.1.1"
+
+yocto-queue@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
+ integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
+
+z-schema@~5.0.2:
+ version "5.0.5"
+ resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.5.tgz#6805a48c5366a6125cae0e58752babfd503daf32"
+ integrity sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==
+ dependencies:
+ lodash.get "^4.4.2"
+ lodash.isequal "^4.5.0"
+ validator "^13.7.0"
+ optionalDependencies:
+ commander "^9.4.1"
diff --git a/lib/fb/BUCK b/lib/fb/BUCK
deleted file mode 100644
index f283dca1..00000000
--- a/lib/fb/BUCK
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-#
-# This source code is licensed under the MIT license found in the
-# LICENSE file in the root directory of this source tree.
-load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "APPLE", "CXX", "FBCODE", "WINDOWS")
-load("//tools/build_defs/oss:yoga_defs.bzl", "JNI_TARGET", "YOGA_ROOTS", "subdir_glob", "yoga_cxx_library", "yoga_prebuilt_cxx_library")
-
-yoga_prebuilt_cxx_library(
- name = "ndklog",
- exported_platform_linker_flags = [
- (
- "^android.*",
- ["-llog"],
- ),
- ],
- header_only = True,
- platforms = (ANDROID, APPLE, CXX, FBCODE, WINDOWS),
- visibility = YOGA_ROOTS,
-)
-
-yoga_cxx_library(
- name = "fbjni",
- srcs = glob(["src/main/cpp/**/*.cpp"]),
- header_namespace = "",
- exported_headers = subdir_glob([("src/main/cpp/include", "**/*.h")]),
- compiler_flags = [
- "-DLOG_TAG=\"libfb\"",
- "-DDISABLE_CPUCAP",
- "-DDISABLE_XPLAT",
- "-DHAVE_POSIX_CLOCKS",
- "-fno-omit-frame-pointer",
- "-fexceptions",
- "-frtti",
- "-Wall",
- "-Werror",
- "-Wno-unused-parameter",
- "-Wno-unused-variable",
- "-std=c++11",
- ],
- platforms = (CXX, ANDROID),
- soname = "libfbjni.$(ext)",
- visibility = ["PUBLIC"],
- deps = [
- ":ndklog",
- JNI_TARGET,
- ],
-)
diff --git a/lib/fb/build.gradle b/lib/fb/build.gradle
deleted file mode 100644
index 8194a2b6..00000000
--- a/lib/fb/build.gradle
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-apply plugin: 'com.android.library'
-
-android {
- compileSdkVersion rootProject.compileSdkVersion
- buildToolsVersion rootProject.buildToolsVersion
-
- defaultConfig {
- minSdkVersion rootProject.minSdkVersion
- targetSdkVersion rootProject.targetSdkVersion
-
- ndk {
- abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
- }
-
- externalNativeBuild {
- cmake {
- arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static'
- }
- }
- }
-
- externalNativeBuild {
- cmake {
- path 'src/main/cpp/CMakeLists.txt'
- }
- }
-
- dependencies {
- implementation 'com.facebook.soloader:soloader:0.10.4'
- implementation 'com.google.code.findbugs:jsr305:3.0.2'
- implementation project(':yoga:proguard-annotations')
- }
-}
diff --git a/lib/fb/src/main/AndroidManifest.xml b/lib/fb/src/main/AndroidManifest.xml
deleted file mode 100644
index 6d0fd184..00000000
--- a/lib/fb/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/lib/fb/src/main/cpp/CMakeLists.txt b/lib/fb/src/main/cpp/CMakeLists.txt
deleted file mode 100644
index 8a6a045c..00000000
--- a/lib/fb/src/main/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (c) Facebook, Inc. and its affiliates.
-#
-# This source code is licensed under the MIT license found in the
-# LICENSE file in the root directory of this source tree.
-#
-
-cmake_minimum_required(VERSION 3.4.1)
-
-set(CMAKE_VERBOSE_MAKEFILE on)
-
-add_compile_options(
- -fno-omit-frame-pointer
- -fexceptions
- -Wall
- -std=c++11
- -DDISABLE_CPUCAP
- -DDISABLE_XPLAT)
-
-file(GLOB fb_SRC
- *.cpp
- jni/*.cpp
- jni/detail/*.cpp
- lyra/*.cpp)
-
-add_library(fb SHARED
- ${fb_SRC})
-
-target_include_directories(fb PRIVATE
- include)
-
-target_link_libraries(fb android log)
diff --git a/lib/fb/src/main/cpp/Doxyfile b/lib/fb/src/main/cpp/Doxyfile
deleted file mode 100644
index b44118dd..00000000
--- a/lib/fb/src/main/cpp/Doxyfile
+++ /dev/null
@@ -1,15 +0,0 @@
-PROJECT_NAME = "Facebook Android Support"
-JAVADOC_AUTOBRIEF = YES
-EXTRACT_ALL = YES
-RECURSIVE = YES
-EXCLUDE = tests
-EXCLUDE_PATTERNS = *.cpp
-GENERATE_HTML = YES
-GENERATE_LATEX = NO
-ENABLE_PREPROCESSING = YES
-HIDE_UNDOC_MEMBERS = YES
-HIDE_SCOPE_NAMES = YES
-HIDE_FRIEND_COMPOUNDS = YES
-HIDE_UNDOC_CLASSES = YES
-SHOW_INCLUDE_FILES = NO
-#ENABLED_SECTIONS = INTERNAL
diff --git a/lib/fb/src/main/cpp/include/fb/Doxyfile b/lib/fb/src/main/cpp/include/fb/Doxyfile
deleted file mode 100644
index 8b4df6a7..00000000
--- a/lib/fb/src/main/cpp/include/fb/Doxyfile
+++ /dev/null
@@ -1,18 +0,0 @@
-PROJECT_NAME = "Facebook JNI"
-PROJECT_BRIEF = "Helper library to provide safe and convenient access to JNI with very low overhead"
-JAVADOC_AUTOBRIEF = YES
-EXTRACT_ALL = YES
-RECURSIVE = YES
-EXCLUDE = tests Asserts.h Countable.h GlobalReference.h LocalReference.h LocalString.h Registration.h WeakReference.h jni_helpers.h Environment.h
-EXCLUDE_PATTERNS = *-inl.h *.cpp
-GENERATE_HTML = YES
-GENERATE_LATEX = NO
-ENABLE_PREPROCESSING = YES
-HIDE_UNDOC_MEMBERS = YES
-HIDE_SCOPE_NAMES = YES
-HIDE_FRIEND_COMPOUNDS = YES
-HIDE_UNDOC_CLASSES = YES
-SHOW_INCLUDE_FILES = NO
-PREDEFINED = LOG_TAG=fbjni
-EXAMPLE_PATH = samples
-#ENABLED_SECTIONS = INTERNAL
diff --git a/lib/fb/src/main/cpp/include/fbjni/ByteBuffer.h b/lib/fb/src/main/cpp/include/fbjni/ByteBuffer.h
deleted file mode 100644
index 55223e46..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/ByteBuffer.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include
-
-namespace facebook {
-namespace jni {
-
-class JBuffer : public JavaClass {
-public:
- static constexpr const char* kJavaDescriptor = "Ljava/nio/Buffer;";
-
- void rewind() const;
- bool isDirect() const;
- void* getDirectAddress() const;
- size_t getDirectCapacity() const;
-};
-
-// JNI's NIO support has some awkward preconditions and error reporting. This
-// class provides much more user-friendly access.
-class JByteBuffer : public JavaClass {
- public:
- static constexpr const char* kJavaDescriptor = "Ljava/nio/ByteBuffer;";
-
- static local_ref wrapBytes(uint8_t* data, size_t size);
- static local_ref allocateDirect(jint size);
-
- uint8_t* getDirectBytes() const {
- return static_cast(getDirectAddress());
- }
-
- size_t getDirectSize() const {
- return getDirectCapacity();
- }
-};
-
-}}
diff --git a/lib/fb/src/main/cpp/include/fbjni/Context.h b/lib/fb/src/main/cpp/include/fbjni/Context.h
deleted file mode 100644
index 331de691..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/Context.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include
-#include
-
-namespace facebook {
-namespace jni {
-
-class AContext : public JavaClass {
- public:
- static constexpr const char* kJavaDescriptor = "Landroid/content/Context;";
-
- // Define a method that calls into the represented Java class
- local_ref getCacheDir() {
- static const auto method = getClass()->getMethod("getCacheDir");
- return method(self());
- }
-
- local_ref getFilesDir() {
- static const auto method = getClass()->getMethod("getFilesDir");
- return method(self());
- }
-};
-
-}
-}
diff --git a/lib/fb/src/main/cpp/include/fbjni/File.h b/lib/fb/src/main/cpp/include/fbjni/File.h
deleted file mode 100644
index 852202ba..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/File.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include
-
-namespace facebook {
-namespace jni {
-
-class JFile : public JavaClass {
- public:
- static constexpr const char* kJavaDescriptor = "Ljava/io/File;";
-
- // Define a method that calls into the represented Java class
- std::string getAbsolutePath() {
- static const auto method = getClass()->getMethod("getAbsolutePath");
- return method(self())->toStdString();
- }
-
-};
-
-}
-}
diff --git a/lib/fb/src/main/cpp/include/fbjni/JThread.h b/lib/fb/src/main/cpp/include/fbjni/JThread.h
deleted file mode 100644
index a343e022..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/JThread.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include
-#include
-
-namespace facebook {
-namespace jni {
-
-class JThread : public JavaClass {
- public:
- static constexpr const char* kJavaDescriptor = "Ljava/lang/Thread;";
-
- void start() {
- static const auto method = javaClassStatic()->getMethod("start");
- method(self());
- }
-
- void join() {
- static const auto method = javaClassStatic()->getMethod("join");
- method(self());
- }
-
- static local_ref create(std::function&& runnable) {
- auto jrunnable = JNativeRunnable::newObjectCxxArgs(std::move(runnable));
- return newInstance(static_ref_cast(jrunnable));
- }
-
- static local_ref create(std::function&& runnable, std::string&& name) {
- auto jrunnable = JNativeRunnable::newObjectCxxArgs(std::move(runnable));
- return newInstance(static_ref_cast(jrunnable), make_jstring(std::move(name)));
- }
-
- static local_ref getCurrent() {
- static const auto method = javaClassStatic()->getStaticMethod()>("currentThread");
- return method(javaClassStatic());
- }
-
- int getPriority() {
- static const auto method = getClass()->getMethod("getPriority");
- return method(self());
- }
-
- void setPriority(int priority) {
- static const auto method = getClass()->getMethod("setPriority");
- method(self(), priority);
- }
-};
-
-}
-}
diff --git a/lib/fb/src/main/cpp/include/fbjni/NativeRunnable.h b/lib/fb/src/main/cpp/include/fbjni/NativeRunnable.h
deleted file mode 100644
index 7bb915f4..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/NativeRunnable.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include
-
-#include
-
-namespace facebook {
-namespace jni {
-
-struct JRunnable : public JavaClass {
- static auto constexpr kJavaDescriptor = "Ljava/lang/Runnable;";
-};
-
-struct JNativeRunnable : public HybridClass {
- public:
- static auto constexpr kJavaDescriptor = "Lcom/facebook/jni/NativeRunnable;";
-
- JNativeRunnable(std::function&& runnable) : runnable_(std::move(runnable)) {}
-
- static void OnLoad() {
- registerHybrid({
- makeNativeMethod("run", JNativeRunnable::run),
- });
- }
-
- void run() {
- runnable_();
- }
-
- private:
- std::function runnable_;
-};
-
-
-} // namespace jni
-} // namespace facebook
diff --git a/lib/fb/src/main/cpp/include/fbjni/ReadableByteChannel.h b/lib/fb/src/main/cpp/include/fbjni/ReadableByteChannel.h
deleted file mode 100644
index f524d26c..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/ReadableByteChannel.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include
-#include
-
-namespace facebook {
-namespace jni {
-
-class JReadableByteChannel : public JavaClass {
-public:
- static constexpr const char* kJavaDescriptor = "Ljava/nio/channels/ReadableByteChannel;";
-
- int read(alias_ref dest) const;
-};
-
-}}
diff --git a/lib/fb/src/main/cpp/include/fbjni/detail/Boxed.h b/lib/fb/src/main/cpp/include/fbjni/detail/Boxed.h
deleted file mode 100644
index e231b958..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/detail/Boxed.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include "CoreClasses.h"
-
-namespace facebook {
-namespace jni {
-
-namespace detail {
-template
-struct JPrimitive : JavaClass {
- using typename JavaClass::javaobject;
- using JavaClass::javaClassStatic;
- static local_ref valueOf(jprim val) {
- static const auto cls = javaClassStatic();
- static const auto method =
- cls->template getStaticMethod("valueOf");
- return method(cls, val);
- }
- jprim value() const {
- static const auto method =
- javaClassStatic()->template getMethod(T::kValueMethod);
- return method(this->self());
- }
-};
-
-} // namespace detail
-
-
-#define DEFINE_BOXED_PRIMITIVE(LITTLE, BIG) \
- struct J ## BIG : detail::JPrimitive { \
- static auto constexpr kJavaDescriptor = "Ljava/lang/" #BIG ";"; \
- static auto constexpr kValueMethod = #LITTLE "Value"; \
- j ## LITTLE LITTLE ## Value() const { \
- return value(); \
- } \
- }; \
- inline local_ref autobox(j ## LITTLE val) { \
- return J ## BIG::valueOf(val); \
- }
-
-DEFINE_BOXED_PRIMITIVE(boolean, Boolean)
-DEFINE_BOXED_PRIMITIVE(byte, Byte)
-DEFINE_BOXED_PRIMITIVE(char, Character)
-DEFINE_BOXED_PRIMITIVE(short, Short)
-DEFINE_BOXED_PRIMITIVE(int, Integer)
-DEFINE_BOXED_PRIMITIVE(long, Long)
-DEFINE_BOXED_PRIMITIVE(float, Float)
-DEFINE_BOXED_PRIMITIVE(double, Double)
-
-#undef DEFINE_BOXED_PRIMITIVE
-
-template
-inline typename std::enable_if<
- (std::is_same::value || std::is_same::value) && !std::is_same::value,
- local_ref
->::type autobox(T val) {
- return JLong::valueOf(val);
-}
-
-struct JVoid : public jni::JavaClass {
- static auto constexpr kJavaDescriptor = "Ljava/lang/Void;";
-};
-
-inline local_ref autobox(alias_ref val) {
- return make_local(val);
-}
-
-}}
diff --git a/lib/fb/src/main/cpp/include/fbjni/detail/Common.h b/lib/fb/src/main/cpp/include/fbjni/detail/Common.h
deleted file mode 100644
index 573fcc75..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/detail/Common.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-/** @file Common.h
- *
- * Defining the stuff that don't deserve headers of their own...
- */
-
-#pragma once
-
-#include
-
-#include
-
-#ifdef FBJNI_DEBUG_REFS
-# ifdef __ANDROID__
-# include
-# else
-# include
-# endif
-#endif
-
-// If a pending JNI Java exception is found, wraps it in a JniException object and throws it as
-// a C++ exception.
-#define FACEBOOK_JNI_THROW_PENDING_EXCEPTION() \
- ::facebook::jni::throwPendingJniExceptionAsCppException()
-
-// If the condition is true, throws a JniException object, which wraps the pending JNI Java
-// exception if any. If no pending exception is found, throws a JniException object that wraps a
-// RuntimeException throwable.Â
-#define FACEBOOK_JNI_THROW_EXCEPTION_IF(CONDITION) \
- ::facebook::jni::throwCppExceptionIf(CONDITION)
-
-/// @cond INTERNAL
-
-namespace facebook {
-namespace jni {
-
-void throwPendingJniExceptionAsCppException();
-void throwCppExceptionIf(bool condition);
-
-[[noreturn]] void throwNewJavaException(jthrowable);
-[[noreturn]] void throwNewJavaException(const char* throwableName, const char* msg);
-template
-[[noreturn]] void throwNewJavaException(const char* throwableName, const char* fmt, Args... args);
-
-
-/**
- * This needs to be called at library load time, typically in your JNI_OnLoad method.
- *
- * The intended use is to return the result of initialize() directly
- * from JNI_OnLoad and to do nothing else there. Library specific
- * initialization code should go in the function passed to initialize
- * (which can be, and probably should be, a C++ lambda). This approach
- * provides correct error handling and translation errors during
- * initialization into Java exceptions when appropriate.
- *
- * Failure to call this will cause your code to crash in a remarkably
- * unhelpful way (typically a segfault) while trying to handle an exception
- * which occurs later.
- */
-jint initialize(JavaVM*, std::function&&) noexcept;
-
-namespace internal {
-
-// Define to get extremely verbose logging of references and to enable reference stats
-#ifdef FBJNI_DEBUG_REFS
-template
-inline void dbglog(const char* msg, Args... args) {
-# ifdef __ANDROID__
- __android_log_print(ANDROID_LOG_VERBOSE, "fbjni_dbg", msg, args...);
-# else
- std::fprintf(stderr, msg, args...);
-# endif
-}
-
-#else
-
-template
-inline void dbglog(const char*, Args...) {
-}
-
-#endif
-
-}}}
-
-/// @endcond
diff --git a/lib/fb/src/main/cpp/include/fbjni/detail/CoreClasses-inl.h b/lib/fb/src/main/cpp/include/fbjni/detail/CoreClasses-inl.h
deleted file mode 100644
index d8214fde..00000000
--- a/lib/fb/src/main/cpp/include/fbjni/detail/CoreClasses-inl.h
+++ /dev/null
@@ -1,677 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the LICENSE
- * file in the root directory of this source tree.
- */
-#pragma once
-
-#include
-#include
-#include
-
-#include "Common.h"
-#include "Exceptions.h"
-#include "Meta.h"
-#include "MetaConvert.h"
-
-namespace facebook {
-namespace jni {
-
-// jobject /////////////////////////////////////////////////////////////////////////////////////////
-
-inline bool isSameObject(alias_ref lhs, alias_ref rhs) noexcept {
- return Environment::current()->IsSameObject(lhs.get(), rhs.get()) != JNI_FALSE;
-}
-
-inline local_ref JObject::getClass() const noexcept {
- return adopt_local(Environment::current()->GetObjectClass(self()));
-}
-
-inline bool JObject::isInstanceOf(alias_ref cls) const noexcept {
- return Environment::current()->IsInstanceOf(self(), cls.get()) != JNI_FALSE;
-}
-
-template
-inline T JObject::getFieldValue(JField field) const noexcept {
- return field.get(self());
-}
-
-template
-inline local_ref JObject::getFieldValue(JField field) const noexcept {
- return adopt_local(field.get(self()));
-}
-
-template
-inline void JObject::setFieldValue(JField field, T value) noexcept {
- field.set(self(), value);
-}
-
-template
-inline void JObject::setFieldValue(JField field, alias_ref value) noexcept {
- setFieldValue(field, value.get());
-}
-
-inline std::string JObject::toString() const {
- static const auto method = findClassLocal("java/lang/Object")->getMethod("toString");
-
- return method(self())->toStdString();
-}
-
-
-// Class is here instead of CoreClasses.h because we need
-// alias_ref to be complete.
-class MonitorLock {
- public:
- inline MonitorLock() noexcept;
- inline MonitorLock(alias_ref object) noexcept;
- inline ~MonitorLock() noexcept;
-
- inline MonitorLock(MonitorLock&& other) noexcept;
- inline MonitorLock& operator=(MonitorLock&& other) noexcept;
-
- inline MonitorLock(const MonitorLock&) = delete;
- inline MonitorLock& operator=(const MonitorLock&) = delete;
-
- private:
- inline void reset() noexcept;
- alias_ref owned_;
-};
-
-MonitorLock::MonitorLock() noexcept : owned_(nullptr) {}
-
-MonitorLock::MonitorLock(alias_ref object) noexcept
- : owned_(object) {
- Environment::current()->MonitorEnter(object.get());
-}
-
-void MonitorLock::reset() noexcept {
- if (owned_) {
- Environment::current()->MonitorExit(owned_.get());
- if (Environment::current()->ExceptionCheck()) {
- abort(); // Lock mismatch
- }
- owned_ = nullptr;
- }
-}
-
-MonitorLock::~MonitorLock() noexcept {
- reset();
-}
-
-MonitorLock::MonitorLock(MonitorLock&& other) noexcept
- : owned_(other.owned_)
-{
- other.owned_ = nullptr;
-}
-
-MonitorLock& MonitorLock::operator=(MonitorLock&& other) noexcept {
- reset();
- owned_ = other.owned_;
- other.owned_ = nullptr;
- return *this;
-}
-
-inline MonitorLock JObject::lock() const noexcept {
- return MonitorLock(this_);
-}
-
-inline jobject JObject::self() const noexcept {
- return this_;
-}
-
-inline void swap(JObject& a, JObject& b) noexcept {
- using std::swap;
- swap(a.this_, b.this_);
-}
-
-// JavaClass ///////////////////////////////////////////////////////////////////////////////////////
-
-namespace detail {
-template
-static local_ref newInstance(Args... args) {
- static auto cls = JC::javaClassStatic();
- static const auto constructor = cls->template getConstructor();
- return cls->newObject(constructor, args...);
-}
-}
-
-
-template
-auto JavaClass::self() const noexcept -> javaobject {
- return static_cast(JObject::self());
-}
-
-// jclass //////////////////////////////////////////////////////////////////////////////////////////
-
-namespace detail {
-
-// This is not a real type. It is used so people won't accidentally
-// use a void* to initialize a NativeMethod.
-struct NativeMethodWrapper;
-
-}
-
-struct NativeMethod {
- const char* name;
- std::string descriptor;
- detail::NativeMethodWrapper* wrapper;
-};
-
-inline local_ref JClass::getSuperclass() const noexcept {
- return adopt_local(Environment::current()->GetSuperclass(self()));
-}
-
-inline void JClass::registerNatives(std::initializer_list methods) {
- const auto env = Environment::current();
-
- JNINativeMethod jnimethods[methods.size()];
- size_t i = 0;
- for (auto it = methods.begin(); it < methods.end(); ++it, ++i) {
- // The JNI struct members are unnecessarily non-const.
- jnimethods[i].name = const_cast(it->name);
- jnimethods[i].signature = const_cast(it->descriptor.c_str());
- jnimethods[i].fnPtr = reinterpret_cast(it->wrapper);
- }
-
- auto result = env->RegisterNatives(self(), jnimethods, methods.size());
- FACEBOOK_JNI_THROW_EXCEPTION_IF(result != JNI_OK);
-}
-
-inline bool JClass::isAssignableFrom(alias_ref other) const noexcept {
- const auto env = Environment::current();
- // Ths method has behavior compatible with the
- // java.lang.Class#isAssignableFrom method. The order of the
- // arguments to the JNI IsAssignableFrom C function is "opposite"
- // from what some might expect, which makes this code look a little
- // odd, but it is correct.
- const auto result = env->IsAssignableFrom(other.get(), self());
- return result;
-}
-
-template
-inline JConstructor JClass::getConstructor() const {
- return getConstructor(jmethod_traits_from_cxx::constructor_descriptor().c_str());
-}
-
-template
-inline JConstructor JClass::getConstructor(const char* descriptor) const {
- constexpr auto constructor_method_name = "";
- return getMethod(constructor_method_name, descriptor);
-}
-
-template
-inline JMethod JClass::getMethod(const char* name) const {
- return getMethod(name, jmethod_traits_from_cxx::descriptor().c_str());
-}
-
-template
-inline JMethod JClass::getMethod(
- const char* name,
- const char* descriptor) const {
- const auto env = Environment::current();
- const auto method = env->GetMethodID(self(), name, descriptor);
- FACEBOOK_JNI_THROW_EXCEPTION_IF(!method);
- return JMethod{method};
-}
-
-template
-inline JStaticMethod JClass::getStaticMethod(const char* name) const {
- return getStaticMethod(name, jmethod_traits_from_cxx::descriptor().c_str());
-}
-
-template
-inline JStaticMethod JClass::getStaticMethod(
- const char* name,
- const char* descriptor) const {
- const auto env = Environment::current();
- const auto method = env->GetStaticMethodID(self(), name, descriptor);
- FACEBOOK_JNI_THROW_EXCEPTION_IF(!method);
- return JStaticMethod{method};
-}
-
-template
-inline JNonvirtualMethod JClass::getNonvirtualMethod(const char* name) const {
- return getNonvirtualMethod(name, jmethod_traits_from_cxx::descriptor().c_str());
-}
-
-template
-inline JNonvirtualMethod JClass::getNonvirtualMethod(
- const char* name,
- const char* descriptor) const {
- const auto env = Environment::current();
- const auto method = env->GetMethodID(self(), name, descriptor);
- FACEBOOK_JNI_THROW_EXCEPTION_IF(!method);
- return JNonvirtualMethod{method};
-}
-
-template
-inline JField(), T>>
-JClass::getField(const char* name) const {
- return getField(name, jtype_traits::descriptor().c_str());
-}
-
-template
-inline JField(), T>> JClass::getField(
- const char* name,
- const char* descriptor) const {
- const auto env = Environment::current();
- auto field = env->GetFieldID(self(), name, descriptor);
- FACEBOOK_JNI_THROW_EXCEPTION_IF(!field);
- return JField{field};
-}
-
-template
-inline JStaticField(), T>> JClass::getStaticField(
- const char* name) const {
- return getStaticField(name, jtype_traits::descriptor().c_str());
-}
-
-template
-inline JStaticField(), T>> JClass::getStaticField(
- const char* name,
- const char* descriptor) const {
- const auto env = Environment::current();
- auto field = env->GetStaticFieldID(self(), name, descriptor);
- FACEBOOK_JNI_THROW_EXCEPTION_IF(!field);
- return JStaticField{field};
-}
-
-template
-inline T JClass::getStaticFieldValue(JStaticField field) const noexcept {
- return field.get(self());
-}
-
-template
-inline local_ref JClass::getStaticFieldValue(JStaticField field) noexcept {
- return adopt_local(field.get(self()));
-}
-
-template
-inline void JClass::setStaticFieldValue(JStaticField field, T value) noexcept {
- field.set(self(), value);
-}
-
-template
-inline void JClass::setStaticFieldValue(JStaticField field, alias_ref value) noexcept {
- setStaticFieldValue(field, value.get());
-}
-
-template
-inline local_ref JClass::newObject(
- JConstructor constructor,
- Args... args) const {
- const auto env = Environment::current();
- auto object = env->NewObject(self(), constructor.getId(),
- detail::callToJni(
- detail::Convert::type>::toCall(args))...);
- FACEBOOK_JNI_THROW_EXCEPTION_IF(!object);
- return adopt_local(static_cast(object));
-}
-
-inline jclass JClass::self() const noexcept {
- return static_cast(JObject::self());
-}
-
-inline void registerNatives(const char* name, std::initializer_list methods) {
- findClassLocal(name)->registerNatives(methods);
-}
-
-
-// jstring /////////////////////////////////////////////////////////////////////////////////////////
-
-inline local_ref make_jstring(const std::string& modifiedUtf8) {
- return make_jstring(modifiedUtf8.c_str());
-}
-
-namespace detail {
-// convert to std::string from jstring
-template <>
-struct Convert {
- typedef jstring jniType;
- static std::string fromJni(jniType t) {
- return wrap_alias(t)->toStdString();
- }
- static jniType toJniRet(const std::string& t) {
- return make_jstring(t).release();
- }
- static local_ref toCall(const std::string& t) {
- return make_jstring(t);
- }
-};
-
-// convert return from const char*
-template <>
-struct Convert {
- typedef jstring jniType;
- // no automatic synthesis of const char*. (It can't be freed.)
- static jniType toJniRet(const char* t) {
- return make_jstring(t).release();
- }
- static local_ref toCall(const char* t) {
- return make_jstring(t);
- }
-};
-}
-
-// jtypeArray //////////////////////////////////////////////////////////////////////////////////////
-
-namespace detail {
-inline size_t JArray::size() const noexcept {
- const auto env = Environment::current();
- return env->GetArrayLength(self());
-}
-}
-
-namespace detail {
-template
-inline ElementProxy::ElementProxy(
- Target* target,
- size_t idx)
- : target_{target}, idx_{idx} {}
-
-template
-inline ElementProxy& ElementProxy::operator=(const T& o) {
- target_->setElement(idx_, o);
- return *this;
-}
-
-template
-inline ElementProxy& ElementProxy::operator=(alias_ref& o) {
- target_->setElement(idx_, o.get());
- return *this;
-}
-
-template
-inline ElementProxy& ElementProxy::operator=(alias_ref&& o) {
- target_->setElement(idx_, o.get());
- return *this;
-}
-
-template
-inline ElementProxy& ElementProxy::operator=(const ElementProxy& o) {
- auto src = o.target_->getElement(o.idx_);
- target_->setElement(idx_, src.get());
- return *this;
-}
-
-template
-inline ElementProxy::ElementProxy::operator const local_ref () const {
- return target_->getElement(idx_);
-}
-
-template
-inline ElementProxy::ElementProxy::operator local_ref () {
- return target_->getElement(idx_);
-}
-}
-
-template
-std::string JArrayClass::get_instantiated_java_descriptor() {
- return "[" + jtype_traits::descriptor();
-};
-
-template
-std::string JArrayClass::get_instantiated_base_name() {
- return get_instantiated_java_descriptor();
-};
-
-template
-auto JArrayClass::newArray(size_t size) -> local_ref {
- static const auto elementClass = findClassStatic(jtype_traits::base_name().c_str());
- const auto env = Environment::current();
- auto rawArray = env->NewObjectArray(size, elementClass.get(), nullptr);
- FACEBOOK_JNI_THROW_EXCEPTION_IF(!rawArray);
- return adopt_local(static_cast(rawArray));
-}
-
-template
-inline void JArrayClass::setElement(size_t idx, const T& value) {
- const auto env = Environment::current();
- env->SetObjectArrayElement(this->self(), idx, value);
-}
-
-template
-inline local_ref JArrayClass::getElement(size_t idx) {
- const auto env = Environment::current();
- auto rawElement = env->GetObjectArrayElement(this->self(), idx);
- return adopt_local(static_cast(rawElement));
-}
-
-template
-inline detail::ElementProxy> JArrayClass