diff --git a/.buckconfig b/.buckconfig deleted file mode 100644 index 4147e394..00000000 --- a/.buckconfig +++ /dev/null @@ -1,10 +0,0 @@ -[cxx] - gtest_dep = //lib/gtest:gtest -[android] - target = android-25 - build_tools_version = 26.0.2 -[ndk] - ndk_version = 15.2.4203891 - compiler = clang - app_platform = android-21 - cpu_abis = arm64, armv7, x86, x86_64 diff --git a/.github/actions/install-ninja/action.yml b/.github/actions/install-ninja/action.yml new file mode 100644 index 00000000..897a1e77 --- /dev/null +++ b/.github/actions/install-ninja/action.yml @@ -0,0 +1,14 @@ +name: Install Ninja + +runs: + using: "composite" + steps: + - 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 diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml index 39bbbcee..967009ed 100644 --- a/.github/actions/setup-android/action.yml +++ b/.github/actions/setup-android/action.yml @@ -7,4 +7,4 @@ runs: uses: actions/setup-java@v2 with: distribution: temurin - java-version: 8 + java-version: 11 diff --git a/.github/actions/setup-cpp/action.yml b/.github/actions/setup-cpp/action.yml new file mode 100644 index 00000000..8947b695 --- /dev/null +++ b/.github/actions/setup-cpp/action.yml @@ -0,0 +1,12 @@ +name: Setup C++ envirionment + +runs: + using: "composite" + steps: + - name: Install Ninja + if: ${{ runner.os != 'Windows' }} + uses: ./.github/actions/install-ninja + + - name: Setup VS Developer Command Prompt + if: ${{ runner.os == 'Windows' }} + uses: ilammy/msvc-dev-cmd@v1 diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml index 3694fb17..5deb01f9 100644 --- a/.github/actions/setup-js/action.yml +++ b/.github/actions/setup-js/action.yml @@ -11,15 +11,8 @@ runs: - 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: Install Ninja + uses: ./.github/actions/install-ninja - name: yarn install shell: bash diff --git a/.github/workflows/validate-cpp.yml b/.github/workflows/validate-cpp.yml index 3f4b4e7a..2db9991a 100644 --- a/.github/workflows/validate-cpp.yml +++ b/.github/workflows/validate-cpp.yml @@ -8,6 +8,46 @@ on: workflow_dispatch: jobs: + test: + name: Build and Test [${{ matrix.os }}][${{ matrix.mode }}] + runs-on: ${{ matrix.os }} + strategy: + matrix: + mode: [Debug, Release] + os: [ubuntu-latest] # TODO: fix issues building GTest Binary with MSVC in GitHub Actions + + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-cpp + + - name: Unit tests + run: ./unit_tests ${{ matrix.mode }} + + 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-cpp + + - name: Build benchmark + run: | + cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release + cmake --build build + working-directory: benchmark + + - name: Run benchmark + run: ./build/benchmark + working-directory: benchmark + clang-format: name: Format runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index c4bc30bd..e7f6522e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,8 @@ /_site/ # Visual studio code -.vscode +!.vscode + *.pdb *.tlog *.obj diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 16b40a6e..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/gtest/googletest"] - path = lib/gtest/googletest - url = https://github.com/google/googletest.git diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..cce314cd --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "ms-vscode.cpptools", + "EditorConfig.EditorConfig", + "dbaeumer.vscode-eslint", + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..db839dd5 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug C++ Unit tests (lldb)", + "type": "cppdbg", + "MIMode": "lldb", + "request": "launch", + "program": "${workspaceFolder}/tests/build/yogatests", + "cwd": "${workspaceFolder}", + "preLaunchTask": "Build Unit Tests" + }, + { + "name": "Debug C++ Unit tests (vsdbg)", + "type": "cppvsdbg", + "request": "launch", + "program": "${workspaceFolder}/tests/build/yogatests", + "cwd": "${workspaceFolder}", + "preLaunchTask": "Build Unit Tests" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..93391564 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,20 @@ +{ + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "eslint.format.enable": true, + "eslint.packageManager": "yarn", + "eslint.enable": true, + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact" + ], + "eslint.workingDirectories": [ + { + "mode": "auto" + } + ], +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..93797fb3 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build Unit Tests", + "type": "shell", + "command": "(which ninja && cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug -G Ninja || cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug) && cmake --build build", + "windows": { + "command": "(where ninja && cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug -G Ninja || cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug) && cmake --build build", + }, + "group": "build", + "options": { + "cwd": "tests" + }, + "presentation": { + "reveal": "always", + "panel": "new" + } + } + ] +} diff --git a/CMakeLists.txt b/CMakeLists.txt index f357c83d..e4f8535c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,32 +3,14 @@ # 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) - +cmake_minimum_required(VERSION 3.13) +project(yoga-all) set(CMAKE_VERBOSE_MAKEFILE on) -add_compile_options( - -fno-omit-frame-pointer - -fexceptions - -fvisibility=hidden - -ffunction-sections - -fdata-sections - -Wall - -std=c++11) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/project-defaults.cmake) -file(GLOB_RECURSE yogacore_SRC yoga/*.cpp) -add_library(yogacore STATIC ${yogacore_SRC}) - -target_include_directories(yogacore - PUBLIC - $ - $) - -if (ANDROID) - target_link_libraries(yogacore android log) -endif() - -set_target_properties(yogacore PROPERTIES CXX_STANDARD 11) +add_subdirectory(yoga) +add_subdirectory(tests) # cmake install config include(GNUInstallDirs) @@ -58,7 +40,7 @@ install(EXPORT yoga-targets # generate config file configure_package_config_file( - ${CMAKE_CURRENT_SOURCE_DIR}/scripts/yoga-config.cmake.in + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/yoga-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/yogaConfig.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/yoga ) diff --git a/README.md b/README.md index dcb76a27..085a62ec 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,24 @@ -# Yoga [![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB)](https://opensource.fb.com/support-ukraine) [![CocoaPods](https://img.shields.io/cocoapods/v/YogaKit.svg)](http://cocoapods.org/pods/YogaKit) [![npm](https://img.shields.io/npm/v/yoga-layout.svg)](https://www.npmjs.com/package/yoga-layout) [![bintray](https://img.shields.io/bintray/v/facebook/maven/com.facebook.yoga:yoga.svg)](https://bintray.com/facebook/maven/com.facebook.yoga%3Ayoga/_latestVersion) [![NuGet](https://img.shields.io/nuget/v/Facebook.Yoga.svg)](https://www.nuget.org/packages/Facebook.Yoga) +# Yoga [![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB)](https://opensource.fb.com/support-ukraine) [![CocoaPods](https://img.shields.io/cocoapods/v/YogaKit.svg)](http://cocoapods.org/pods/YogaKit) [![npm](https://img.shields.io/npm/v/yoga-layout.svg)](https://www.npmjs.com/package/yoga-layout) [![Maven Central](https://img.shields.io/maven-central/v/com.facebook.yoga/yoga)](https://search.maven.org/artifact/com.facebook.yoga/yoga) + +Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages. + ## Building -Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable. - -Alternatively, you can build and install Yoga using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: +Yoga's main implementation targets C++ 14 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests. ```sh -git clone https://github.com/Microsoft/vcpkg.git -cd vcpkg -./bootstrap-vcpkg.sh -./vcpkg integrate install -./vcpkg install yoga +./unit_tests ``` -The Yoga port in vcpkg is kept up to date by Microsoft team members and community contributors. +While not required, this script will use [ninja](https://ninja-build.org/) if it is installed for faster builds. -If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. +Yoga is additionally part of the [vcpkg](https://github.com/Microsoft/vcpkg/) collection of ports maintained by Microsoft and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. -## Testing -For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`. -For any changes you make you should ensure that all the tests are passing. In case you make any fixes or additions to the library please also add tests for that change to ensure we don't break anything in the future. Tests are located in the `tests` directory. Run the tests by executing `buck test //:yoga`. -Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run `gentest/gentest.rb` to generate a test for you. You can write html which you want to verify in Yoga, in `gentest/fixtures` folder, such as the following. +## Adding Tests + +Many of Yoga's tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to `gentest/fixtures`. ```html
@@ -30,41 +26,11 @@ Instead of manually writing a test which ensures parity with web implementations
``` -Run `gentest/gentest.rb` to generate test code and re-run `buck test //:yoga` to validate the behavior. One test case will be generated for every root `div` in the input html. +To generate new tests from added fixtures: +1. Run `bundle install` in the `gentest` directory to install dependencies of the test generator. +2. Run `ruby gentest.rb` in the `gentest` directory. -You should run `bundle install` in the `gentest` directory to install dependencies for the `gentest/gentest.rb` Ruby script. -### .NET -.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`. +## Debugging -## Benchmarks -Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI. - -### JavaScript -Installing through NPM -```sh -npm install yoga-layout -``` -By default this will install the library and try to build for all platforms (node, browser asm, and standalone webpack). You may receive errors if you do not have the required platform development tools already installed. To preset the platform you'd like to build for you can set a .npmrc property first. -```sh -npm config set yoga-layout:platform standalone -``` -This will now only run the standalone webpack build upon install. - -## Build Platforms - -| name | description | -|----------------|-------------------------------------------------| -| all (default) | Builds all of these platforms. | -| browser | Builds asm js browser version. | -| node | Builds node js version. | -| standalone | Runs webpack. | -| none | Does nothing. You can use the prepackaged libs. | - -## Maintainer Release Guide - -Release artifacts are published automatically when a new GitHub release is -created. The publishing workflows may also be executed manually, given a Git -Tag, to re-attempt publish. - -NPM and NuGet packages are not currently published. +Yoga provides a VSCode "launch.json" configuration which allows debugging unit tests. Simply add your breakpoints, and run "Debug C++ Unit tests (lldb)" (or "Debug C++ Unit tests (vsdbg)" on Windows). diff --git a/Yoga.podspec b/Yoga.podspec index 077f6ccd..bbe0aabe 100644 --- a/Yoga.podspec +++ b/Yoga.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |spec| '-fexceptions', '-Wall', '-Werror', - '-std=c++1y', + '-std=c++14', '-fPIC' ] spec.source_files = 'yoga/**/*.{c,h,cpp}' diff --git a/android/build.gradle b/android/build.gradle index 845dabfa..c971188f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,6 +8,8 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.yoga.android' + compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index a47e1e0d..50b6ecd4 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -9,7 +9,6 @@ --> @@ -17,11 +16,6 @@ - - - - - + diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt new file mode 100644 index 00000000..deb4b7a2 --- /dev/null +++ b/benchmark/CMakeLists.txt @@ -0,0 +1,19 @@ +# 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) +project(benchmark) +set(CMAKE_VERBOSE_MAKEFILE on) + +set(YOGA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) +include(${YOGA_ROOT}/cmake/project-defaults.cmake) + +add_subdirectory(${YOGA_ROOT}/yoga ${CMAKE_CURRENT_BINARY_DIR}/yoga) + +file(GLOB SOURCES CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/*.c) +add_executable(benchmark ${SOURCES}) +target_link_libraries(benchmark yogacore) diff --git a/build.gradle b/build.gradle index ff43f4a7..193a6749 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' + classpath 'com.android.tools.build:gradle:7.3.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -28,11 +28,12 @@ allprojects { } ext { - minSdkVersion = 14 - targetSdkVersion = 29 - compileSdkVersion = 29 - buildToolsVersion = '30.0.2' - ndkVersion = '21.3.6528147' + buildToolsVersion = "33.0.0" + ndkVersion = "23.1.7779620" // Corresponds to AGP 7.3 + cmakeVersion = "3.18.1+" + minSdkVersion = 21 + compileSdkVersion = 33 + targetSdkVersion = 33 sourceCompatibilityVersion = JavaVersion.VERSION_1_7 targetCompatibilityVersion = JavaVersion.VERSION_1_7 } diff --git a/cmake/project-defaults.cmake b/cmake/project-defaults.cmake new file mode 100644 index 00000000..87f0e6b7 --- /dev/null +++ b/cmake/project-defaults.cmake @@ -0,0 +1,50 @@ +# 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. + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +add_compile_definitions($<$:DEBUG>) + +if(MSVC) + +add_compile_options( + # Don't omit frame pointers (e.g. for crash dumps) + /Oy- + # "Standard C++ exception handling" (C++ stack unwinding including extern c) + /EHsc + # Enable warnings and warnings as errors + /W3 + /WX + # Disable RTTI + $<$:/GR-> + # Use /O2 (Maximize Speed) + $<$:/O2>) + +else() + +add_compile_options( + # Don't omit frame pointers (e.g. for crash dumps) + -fno-omit-frame-pointer + # Enable exception handling + -fexceptions + # Enable warnings and warnings as errors + -Wall + -Werror + # Disable RTTI + $<$:-fno-rtti> + # Use -O2 (prioritize speed) + $<$:-O2> + # Enable separate sections per function/data item + $<$:-ffunction-sections> + $<$:-fdata-sections>) + +add_link_options( + # Discard unused sections + $<$:$<$:-Wl,--gc-sections>> + $<$:$<$:-Wl,-dead_strip>>) + +endif() diff --git a/scripts/yoga-config.cmake.in b/cmake/yoga-config.cmake.in similarity index 100% rename from scripts/yoga-config.cmake.in rename to cmake/yoga-config.cmake.in diff --git a/csharp/Facebook.Yoga/YogaExperimentalFeature.cs b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs index c78a77ba..748101c4 100644 --- a/csharp/Facebook.Yoga/YogaExperimentalFeature.cs +++ b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs @@ -12,5 +12,7 @@ namespace Facebook.Yoga public enum YogaExperimentalFeature { WebFlexBasis, + AbsolutePercentageAgainstPaddingEdge, + FixAbsoluteTrailingColumnMargin, } } diff --git a/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs b/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs index 7ff003a2..3470ef53 100644 --- a/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_start_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -62,6 +64,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_end_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -105,6 +109,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_start_top_end_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -148,6 +154,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_start_top_end_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -193,6 +201,8 @@ namespace Facebook.Yoga public void Test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -251,6 +261,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_within_border() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MarginLeft = 10; @@ -368,6 +380,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -412,6 +426,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; @@ -456,6 +472,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_justify_content_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -499,6 +517,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -542,6 +562,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_center_on_child_only() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexGrow = 1; @@ -585,6 +607,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_top_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -630,6 +654,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_bottom_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -675,6 +701,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_left_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -720,6 +748,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_right_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -765,6 +795,8 @@ namespace Facebook.Yoga public void Test_position_root_with_rtl_should_position_withoutdirection() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Left = 72; @@ -791,6 +823,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_percentage_bottom_based_on_parent_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -867,6 +901,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_column_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.WrapReverse; @@ -909,6 +945,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_row_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -952,6 +990,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_column_container_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.WrapReverse; @@ -995,6 +1035,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_row_container_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1035,5 +1077,155 @@ namespace Facebook.Yoga Assert.AreEqual(20f, root_child0.LayoutHeight); } + [Test] + public void Test_percent_absolute_position_infinite_height() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.Width = 300; + + YogaNode root_child0 = new YogaNode(config); + root_child0.Width = 300; + root.Insert(0, root_child0); + + YogaNode root_child1 = new YogaNode(config); + root_child1.PositionType = YogaPositionType.Absolute; + root_child1.Left = 20.Percent(); + root_child1.Top = 20.Percent(); + root_child1.Width = 20.Percent(); + root_child1.Height = 20.Percent(); + root.Insert(1, root_child1); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(300f, root.LayoutWidth); + Assert.AreEqual(0f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(300f, root_child0.LayoutWidth); + Assert.AreEqual(0f, root_child0.LayoutHeight); + + Assert.AreEqual(60f, root_child1.LayoutX); + Assert.AreEqual(0f, root_child1.LayoutY); + Assert.AreEqual(60f, root_child1.LayoutWidth); + Assert.AreEqual(0f, root_child1.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(300f, root.LayoutWidth); + Assert.AreEqual(0f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(300f, root_child0.LayoutWidth); + Assert.AreEqual(0f, root_child0.LayoutHeight); + + Assert.AreEqual(60f, root_child1.LayoutX); + Assert.AreEqual(0f, root_child1.LayoutY); + Assert.AreEqual(60f, root_child1.LayoutWidth); + Assert.AreEqual(0f, root_child1.LayoutHeight); + } + + [Test] + public void Test_absolute_layout_percentage_height_based_on_padded_parent() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.PaddingTop = 10; + root.BorderTopWidth = 10; + root.Width = 100; + root.Height = 100; + + YogaNode root_child0 = new YogaNode(config); + root_child0.PositionType = YogaPositionType.Absolute; + root_child0.Width = 100; + root_child0.Height = 50.Percent(); + root.Insert(0, root_child0); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(10f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(10f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + } + + [Test] + public void Test_absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.JustifyContent = YogaJustify.Center; + root.AlignItems = YogaAlign.Center; + root.PaddingTop = 20; + root.PaddingBottom = 20; + root.Width = 100; + root.Height = 100; + + YogaNode root_child0 = new YogaNode(config); + root_child0.PositionType = YogaPositionType.Absolute; + root_child0.Width = 100; + root_child0.Height = 50.Percent(); + root.Insert(0, root_child0); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(25f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(25f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + } + } } diff --git a/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs b/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs index 81969c99..56c88a43 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -121,6 +123,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_start_without_height_on_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.Wrap; @@ -219,6 +223,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_start_with_flex() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.Wrap; @@ -323,6 +329,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.FlexEnd; @@ -425,6 +433,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; @@ -522,6 +532,8 @@ namespace Facebook.Yoga public void Test_align_content_spacebetween() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -625,6 +637,8 @@ namespace Facebook.Yoga public void Test_align_content_spacearound() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -728,6 +742,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -826,6 +842,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -940,6 +958,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_flex() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1044,6 +1064,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_flex_no_shrink() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1147,6 +1169,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1253,6 +1277,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_padding() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1359,6 +1385,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_single_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1415,6 +1443,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_fixed_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1514,6 +1544,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1613,6 +1645,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_min_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1712,6 +1746,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; @@ -1828,6 +1864,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_is_not_overriding_align_items() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; diff --git a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs index 9a660aad..8e879acd 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_align_items_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -58,6 +60,8 @@ namespace Facebook.Yoga public void Test_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -99,6 +103,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; @@ -140,6 +146,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexEnd; @@ -181,6 +189,8 @@ namespace Facebook.Yoga public void Test_align_baseline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -238,6 +248,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -310,6 +322,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_multiline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -429,6 +443,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_multiline_override() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -550,6 +566,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_multiline_no_override_on_secondline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -670,6 +688,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -743,6 +763,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_top2() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -816,6 +838,8 @@ namespace Facebook.Yoga public void Test_align_baseline_double_nested_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -903,6 +927,8 @@ namespace Facebook.Yoga public void Test_align_baseline_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Baseline; @@ -959,6 +985,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1039,6 +1067,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_padding() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1119,6 +1149,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1237,6 +1269,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Baseline; @@ -1354,6 +1388,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline_column2() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Baseline; @@ -1471,6 +1507,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline_row_and_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1589,6 +1627,8 @@ namespace Facebook.Yoga public void Test_align_items_center_child_with_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1647,6 +1687,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_end_child_with_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1705,6 +1747,8 @@ namespace Facebook.Yoga public void Test_align_items_center_child_without_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1761,6 +1805,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_end_child_without_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1817,6 +1863,8 @@ namespace Facebook.Yoga public void Test_align_center_should_size_based_on_content() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1889,6 +1937,8 @@ namespace Facebook.Yoga public void Test_align_stretch_should_size_based_on_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MarginTop = 20; @@ -1960,6 +2010,8 @@ namespace Facebook.Yoga public void Test_align_flex_start_with_shrinking_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; @@ -2029,6 +2081,8 @@ namespace Facebook.Yoga public void Test_align_flex_start_with_stretching_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; @@ -2097,6 +2151,8 @@ namespace Facebook.Yoga public void Test_align_flex_start_with_shrinking_children_with_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; diff --git a/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs b/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs index 2477fd2b..998d7208 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_align_self_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -60,6 +62,8 @@ namespace Facebook.Yoga public void Test_align_self_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -101,6 +105,8 @@ namespace Facebook.Yoga public void Test_align_self_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -142,6 +148,8 @@ namespace Facebook.Yoga public void Test_align_self_flex_end_override_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; @@ -184,6 +192,8 @@ namespace Facebook.Yoga public void Test_align_self_baseline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; diff --git a/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs b/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs index 5c8249cd..e524cc49 100644 --- a/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs +++ b/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_android_news_feed() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; diff --git a/csharp/tests/Facebook.Yoga/YGBorderTest.cs b/csharp/tests/Facebook.Yoga/YGBorderTest.cs index 854bb59b..084d00a7 100644 --- a/csharp/tests/Facebook.Yoga/YGBorderTest.cs +++ b/csharp/tests/Facebook.Yoga/YGBorderTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_border_no_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -46,6 +48,8 @@ namespace Facebook.Yoga public void Test_border_container_match_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -88,6 +92,8 @@ namespace Facebook.Yoga public void Test_border_flex_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -132,6 +138,8 @@ namespace Facebook.Yoga public void Test_border_stretch_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -175,6 +183,8 @@ namespace Facebook.Yoga public void Test_border_center_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; diff --git a/csharp/tests/Facebook.Yoga/YGDimensionTest.cs b/csharp/tests/Facebook.Yoga/YGDimensionTest.cs index 53a84dfe..8263bcd9 100644 --- a/csharp/tests/Facebook.Yoga/YGDimensionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGDimensionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_wrap_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); @@ -57,6 +59,8 @@ namespace Facebook.Yoga public void Test_wrap_grandchild() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); diff --git a/csharp/tests/Facebook.Yoga/YGDisplayTest.cs b/csharp/tests/Facebook.Yoga/YGDisplayTest.cs index 4b0da55c..ba6e17ee 100644 --- a/csharp/tests/Facebook.Yoga/YGDisplayTest.cs +++ b/csharp/tests/Facebook.Yoga/YGDisplayTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_display_none() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -74,6 +76,8 @@ namespace Facebook.Yoga public void Test_display_none_fixed_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -130,6 +134,8 @@ namespace Facebook.Yoga public void Test_display_none_with_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -190,6 +196,8 @@ namespace Facebook.Yoga public void Test_display_none_with_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -282,6 +290,8 @@ namespace Facebook.Yoga public void Test_display_none_with_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -338,6 +348,8 @@ namespace Facebook.Yoga public void Test_display_none_with_position_absolute() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; diff --git a/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs b/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs index 09b41dc0..99c352ea 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_flex_direction_column_no_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -85,6 +87,8 @@ namespace Facebook.Yoga public void Test_flex_direction_row_no_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -152,6 +156,8 @@ namespace Facebook.Yoga public void Test_flex_direction_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -219,6 +225,8 @@ namespace Facebook.Yoga public void Test_flex_direction_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -287,6 +295,8 @@ namespace Facebook.Yoga public void Test_flex_direction_column_reverse() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.ColumnReverse; @@ -355,6 +365,8 @@ namespace Facebook.Yoga public void Test_flex_direction_row_reverse() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.RowReverse; diff --git a/csharp/tests/Facebook.Yoga/YGFlexTest.cs b/csharp/tests/Facebook.Yoga/YGFlexTest.cs index a8d3a0a6..54345ed4 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_grow_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -73,6 +75,8 @@ namespace Facebook.Yoga public void Test_flex_shrink_flex_grow_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -131,6 +135,8 @@ namespace Facebook.Yoga public void Test_flex_shrink_flex_grow_child_flex_shrink_other_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -190,6 +196,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_grow_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -245,6 +253,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_shrink_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -299,6 +309,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_shrink_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -354,6 +366,8 @@ namespace Facebook.Yoga public void Test_flex_shrink_to_zero() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 75; @@ -424,6 +438,8 @@ namespace Facebook.Yoga public void Test_flex_basis_overrides_main_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -495,6 +511,8 @@ namespace Facebook.Yoga public void Test_flex_grow_shrink_at_most() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -548,6 +566,8 @@ namespace Facebook.Yoga public void Test_flex_grow_less_than_factor_one() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; diff --git a/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs b/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs index 879fadc5..8812dc57 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_wrap_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.Wrap; @@ -104,6 +106,8 @@ namespace Facebook.Yoga public void Test_wrap_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -190,6 +194,8 @@ namespace Facebook.Yoga public void Test_wrap_row_align_items_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -277,6 +283,8 @@ namespace Facebook.Yoga public void Test_wrap_row_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -364,6 +372,8 @@ namespace Facebook.Yoga public void Test_flex_wrap_children_with_min_main_overriding_flex_basis() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -422,6 +432,8 @@ namespace Facebook.Yoga public void Test_flex_wrap_wrap_to_child_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); @@ -505,6 +517,8 @@ namespace Facebook.Yoga public void Test_flex_wrap_align_stretch_fits_one_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -560,6 +574,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -661,6 +677,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -763,6 +781,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_single_line_different_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -864,6 +884,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -966,6 +988,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1068,6 +1092,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_column_fixed_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1170,6 +1196,8 @@ namespace Facebook.Yoga public void Test_wrapped_row_within_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1241,6 +1269,8 @@ namespace Facebook.Yoga public void Test_wrapped_row_within_align_items_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; @@ -1312,6 +1342,8 @@ namespace Facebook.Yoga public void Test_wrapped_row_within_align_items_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexEnd; @@ -1383,6 +1415,8 @@ namespace Facebook.Yoga public void Test_wrapped_column_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1462,6 +1496,8 @@ namespace Facebook.Yoga public void Test_wrapped_column_max_height_flex() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1547,6 +1583,8 @@ namespace Facebook.Yoga public void Test_wrap_nodes_with_content_sizing_overflowing_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; @@ -1645,6 +1683,8 @@ namespace Facebook.Yoga public void Test_wrap_nodes_with_content_sizing_margin_cross() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; diff --git a/csharp/tests/Facebook.Yoga/YGGapTest.cs b/csharp/tests/Facebook.Yoga/YGGapTest.cs index 173e10f0..fb258ae1 100644 --- a/csharp/tests/Facebook.Yoga/YGGapTest.cs +++ b/csharp/tests/Facebook.Yoga/YGGapTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_column_gap_flexible() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -95,6 +97,8 @@ namespace Facebook.Yoga public void Test_column_gap_inflexible() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -164,6 +168,8 @@ namespace Facebook.Yoga public void Test_column_gap_mixed_flexible() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -235,6 +241,8 @@ namespace Facebook.Yoga public void Test_column_gap_child_margins() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -316,6 +324,8 @@ namespace Facebook.Yoga public void Test_column_row_gap_wrapping() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -479,6 +489,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -548,6 +560,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -618,6 +632,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -688,6 +704,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -758,6 +776,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -828,6 +848,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_space_evenly() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -898,6 +920,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1017,6 +1041,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1137,6 +1163,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1257,6 +1285,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1377,6 +1407,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1497,6 +1529,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1601,6 +1635,8 @@ namespace Facebook.Yoga public void Test_column_gap_determines_parent_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1669,6 +1705,8 @@ namespace Facebook.Yoga public void Test_row_gap_align_items_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1783,6 +1821,8 @@ namespace Facebook.Yoga public void Test_row_gap_align_items_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1897,6 +1937,8 @@ namespace Facebook.Yoga public void Test_row_gap_column_child_margins() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -1977,6 +2019,8 @@ namespace Facebook.Yoga public void Test_row_gap_row_wrap_child_margins() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -2053,6 +2097,8 @@ namespace Facebook.Yoga public void Test_row_gap_determines_parent_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; diff --git a/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs b/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs index bc5fba40..5e3c516d 100644 --- a/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs +++ b/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -87,6 +89,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -156,6 +160,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -225,6 +231,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -294,6 +302,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -363,6 +373,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 102; @@ -430,6 +442,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; @@ -498,6 +512,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -566,6 +582,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.SpaceBetween; @@ -634,6 +652,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.SpaceAround; @@ -702,6 +722,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_min_width_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -744,6 +766,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_max_width_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -787,6 +811,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_min_height_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -828,6 +854,8 @@ namespace Facebook.Yoga public void Test_justify_content_colunn_max_height_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -870,6 +898,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_space_evenly() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.SpaceEvenly; @@ -938,6 +968,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_space_evenly() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1007,6 +1039,8 @@ namespace Facebook.Yoga public void Test_justify_content_min_width_with_padding_child_width_greater_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; @@ -1084,6 +1118,8 @@ namespace Facebook.Yoga public void Test_justify_content_min_width_with_padding_child_width_lower_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; diff --git a/csharp/tests/Facebook.Yoga/YGMarginTest.cs b/csharp/tests/Facebook.Yoga/YGMarginTest.cs index 4316af3b..5d9991be 100644 --- a/csharp/tests/Facebook.Yoga/YGMarginTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMarginTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_margin_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -60,6 +62,8 @@ namespace Facebook.Yoga public void Test_margin_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -100,6 +104,8 @@ namespace Facebook.Yoga public void Test_margin_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -142,6 +148,8 @@ namespace Facebook.Yoga public void Test_margin_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; @@ -183,6 +191,8 @@ namespace Facebook.Yoga public void Test_margin_and_flex_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -225,6 +235,8 @@ namespace Facebook.Yoga public void Test_margin_and_flex_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -266,6 +278,8 @@ namespace Facebook.Yoga public void Test_margin_and_stretch_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -308,6 +322,8 @@ namespace Facebook.Yoga public void Test_margin_and_stretch_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -349,6 +365,8 @@ namespace Facebook.Yoga public void Test_margin_with_sibling_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -404,6 +422,8 @@ namespace Facebook.Yoga public void Test_margin_with_sibling_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -458,6 +478,8 @@ namespace Facebook.Yoga public void Test_margin_auto_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -515,6 +537,8 @@ namespace Facebook.Yoga public void Test_margin_auto_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -572,6 +596,8 @@ namespace Facebook.Yoga public void Test_margin_auto_bottom_and_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -630,6 +656,8 @@ namespace Facebook.Yoga public void Test_margin_auto_bottom_and_top_justify_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -688,6 +716,8 @@ namespace Facebook.Yoga public void Test_margin_auto_mutiple_children_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -761,6 +791,8 @@ namespace Facebook.Yoga public void Test_margin_auto_mutiple_children_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -835,6 +867,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -894,6 +928,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -951,6 +987,8 @@ namespace Facebook.Yoga public void Test_margin_auto_start_and_end_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1010,6 +1048,8 @@ namespace Facebook.Yoga public void Test_margin_auto_start_and_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -1067,6 +1107,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right_column_and_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1125,6 +1167,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1182,6 +1226,8 @@ namespace Facebook.Yoga public void Test_margin_auto_right() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1239,6 +1285,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1297,6 +1345,8 @@ namespace Facebook.Yoga public void Test_margin_auto_top_and_bottom_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -1354,6 +1404,8 @@ namespace Facebook.Yoga public void Test_margin_should_not_be_part_of_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 250; @@ -1396,6 +1448,8 @@ namespace Facebook.Yoga public void Test_margin_should_not_be_part_of_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 250; @@ -1438,6 +1492,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_right_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1481,6 +1537,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1523,6 +1581,8 @@ namespace Facebook.Yoga public void Test_margin_fix_left_auto_right_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1566,6 +1626,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_fix_right_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1609,6 +1671,8 @@ namespace Facebook.Yoga public void Test_margin_auto_top_stretching_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1667,6 +1731,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_stretching_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; diff --git a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs index a12bfdcb..af6f15e5 100644 --- a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -59,6 +61,8 @@ namespace Facebook.Yoga public void Test_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -100,6 +104,8 @@ namespace Facebook.Yoga public void Test_justify_content_min_max() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -142,6 +148,8 @@ namespace Facebook.Yoga public void Test_align_items_min_max() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -184,6 +192,8 @@ namespace Facebook.Yoga public void Test_justify_content_overflow_min_max() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -255,6 +265,8 @@ namespace Facebook.Yoga public void Test_flex_grow_to_min() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -310,6 +322,8 @@ namespace Facebook.Yoga public void Test_flex_grow_in_at_most_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -366,6 +380,8 @@ namespace Facebook.Yoga public void Test_flex_grow_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -406,6 +422,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_min_max_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MinHeight = 100; @@ -459,6 +477,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -514,6 +534,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -569,6 +591,8 @@ namespace Facebook.Yoga public void Test_flex_root_ignored() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexGrow = 1; @@ -625,6 +649,8 @@ namespace Facebook.Yoga public void Test_flex_grow_root_minimized() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -696,6 +722,8 @@ namespace Facebook.Yoga public void Test_flex_grow_height_maximized() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -766,6 +794,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_min_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -820,6 +850,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_min_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MinHeight = 100; @@ -872,6 +904,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -941,6 +975,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -995,6 +1031,8 @@ namespace Facebook.Yoga public void Test_child_min_max_width_flexing() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1053,6 +1091,8 @@ namespace Facebook.Yoga public void Test_min_width_overrides_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 50; @@ -1078,6 +1118,8 @@ namespace Facebook.Yoga public void Test_max_width_overrides_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -1103,6 +1145,8 @@ namespace Facebook.Yoga public void Test_min_height_overrides_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 50; @@ -1128,6 +1172,8 @@ namespace Facebook.Yoga public void Test_max_height_overrides_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 200; @@ -1153,6 +1199,8 @@ namespace Facebook.Yoga public void Test_min_max_percent_no_width_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; diff --git a/csharp/tests/Facebook.Yoga/YGPaddingTest.cs b/csharp/tests/Facebook.Yoga/YGPaddingTest.cs index 145cf0db..8f44c6a3 100644 --- a/csharp/tests/Facebook.Yoga/YGPaddingTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPaddingTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_padding_no_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -46,6 +48,8 @@ namespace Facebook.Yoga public void Test_padding_container_match_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -88,6 +92,8 @@ namespace Facebook.Yoga public void Test_padding_flex_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -132,6 +138,8 @@ namespace Facebook.Yoga public void Test_padding_stretch_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -175,6 +183,8 @@ namespace Facebook.Yoga public void Test_padding_center_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -220,6 +230,8 @@ namespace Facebook.Yoga public void Test_child_with_padding_align_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; diff --git a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs index 8dc2fae3..7d0cad6b 100644 --- a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_percentage_width_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -60,6 +62,8 @@ namespace Facebook.Yoga public void Test_percentage_position_left_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -103,6 +107,8 @@ namespace Facebook.Yoga public void Test_percentage_position_bottom_right() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -146,6 +152,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -202,6 +210,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -257,6 +267,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -315,6 +327,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -372,6 +386,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -430,6 +446,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -487,6 +505,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_min_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -545,6 +565,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_min_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -602,6 +624,8 @@ namespace Facebook.Yoga public void Test_percentage_multiple_nested_with_padding_margin_and_percentage_values() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -711,6 +735,8 @@ namespace Facebook.Yoga public void Test_percentage_margin_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -769,6 +795,8 @@ namespace Facebook.Yoga public void Test_percentage_padding_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -827,6 +855,8 @@ namespace Facebook.Yoga public void Test_percentage_absolute_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -870,6 +900,8 @@ namespace Facebook.Yoga public void Test_percentage_width_height_undefined_parent_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); @@ -908,6 +940,8 @@ namespace Facebook.Yoga public void Test_percent_within_flex_grow() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -990,6 +1024,8 @@ namespace Facebook.Yoga public void Test_percentage_container_in_wrapping_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1076,6 +1112,8 @@ namespace Facebook.Yoga public void Test_percent_absolute_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 60; diff --git a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs index 72a22501..78cf068f 100644 --- a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs +++ b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_grow_row_width_of_100() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -87,6 +89,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_grow_row_prime_number_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -183,6 +187,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_shrink_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -252,6 +258,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_overrides_main_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -323,6 +331,8 @@ namespace Facebook.Yoga public void Test_rounding_total_fractial() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 87.4f; @@ -394,6 +404,8 @@ namespace Facebook.Yoga public void Test_rounding_total_fractial_nested() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 87.4f; @@ -499,6 +511,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_1() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -570,6 +584,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_2() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -641,6 +657,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_3() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Top = 0.3f; @@ -713,6 +731,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_4() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Top = 0.7f; @@ -785,6 +805,8 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_horizontal() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -870,6 +892,8 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_vertical() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 320; @@ -954,6 +978,8 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_combined() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; diff --git a/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs b/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs index 52b29fbf..f4f7459d 100644 --- a/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs +++ b/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_nested_overflowing_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -72,6 +74,8 @@ namespace Facebook.Yoga public void Test_nested_overflowing_child_in_constraint_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -127,6 +131,8 @@ namespace Facebook.Yoga public void Test_parent_wrap_child_size_overflowing_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; diff --git a/enums.py b/enums.py index d39bddba..69dfd7ad 100644 --- a/enums.py +++ b/enums.py @@ -50,8 +50,12 @@ ENUMS = { "NodeType": ["Default", "Text"], "LogLevel": ["Error", "Warn", "Info", "Debug", "Verbose", "Fatal"], "ExperimentalFeature": [ - # Mimic web flex-basis behavior. - "WebFlexBasis" + # Mimic web flex-basis behavior (experiment may be broken) + "WebFlexBasis", + # Conformance fix: https://github.com/facebook/yoga/pull/1028 + "AbsolutePercentageAgainstPaddingEdge", + # Conformance fix: https://github.com/facebook/yoga/pull/1028 + "FixAbsoluteTrailingColumnMargin", ], "PrintOptions": [("Layout", 1), ("Style", 2), ("Children", 4)], "Gutter": ["Column", "Row", "All"], diff --git a/gentest/fixtures/YGAbsolutePositionTest.html b/gentest/fixtures/YGAbsolutePositionTest.html index 39f8e980..d0f5e9ee 100644 --- a/gentest/fixtures/YGAbsolutePositionTest.html +++ b/gentest/fixtures/YGAbsolutePositionTest.html @@ -88,3 +88,15 @@
+
+
+
+
+ +
+
+
+ +
+
+
diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index 2b005aad..8e596dfb 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -18,7 +18,8 @@ function toValueJavascript(value) { function toJavascriptUpper(symbol) { let out = ''; - for (const c of symbol) { + for (let i = 0; i < symbol.length; i++) { + const c = symbol.charAt(i); if (c == c.toUpperCase() && i != 0 && symbol[i - 1] != symbol[i - 1].toUpperCase()) { out += '_'; } @@ -40,8 +41,8 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { this.push(''); if (experiments.length > 0) { - for (const i in experiments) { - this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiments[i]) + ', true);'); + for (const experiment of experiments) { + this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiment) + ', true);'); } this.push(''); } diff --git a/gentest/gentest.js b/gentest/gentest.js index 4071829d..f4426bf1 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -5,6 +5,11 @@ * LICENSE file in the root directory of this source tree. */ +const DEFAULT_EXPERIMENTS = [ + 'AbsolutePercentageAgainstPaddingEdge', + 'FixAbsoluteTrailingColumnMargin', +]; + window.onload = function() { checkDefaultValues(); @@ -472,7 +477,7 @@ function calculateTree(root, roundToPixelGrid) { rawStyle: child.getAttribute('style'), experiments: child.getAttribute('experiments') ? child.getAttribute('experiments').split(' ') - : [], + : DEFAULT_EXPERIMENTS, }; var size = getRoundedSize(child); diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 37624208..943f0cbf 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7ff90540..f398c33c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Apr 18 14:49:25 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/gradlew b/gradlew index 4453ccea..65dcd68d 100755 --- a/gradlew +++ b/gradlew @@ -1,78 +1,129 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum -warn ( ) { +warn () { echo "$*" -} +} >&2 -die ( ) { +die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -89,84 +140,105 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save ( ) { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done fi +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 946ee396..6689b85b 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,92 @@ -@REM Copyright (c) Meta Platforms, Inc. and affiliates. -@REM -@REM This source code is licensed under the MIT license found in the -@REM LICENSE file in the root directory of this source tree. - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index d2788cb5..6746ea36 100644 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 50b08cb9..f1eac87e 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -3,38 +3,20 @@ # 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) - +cmake_minimum_required(VERSION 3.13) +project(yogajni) set(CMAKE_VERBOSE_MAKEFILE on) -# configure import libs -set(yogacore_DIR ${CMAKE_SOURCE_DIR}/..) -set(build_DIR ${CMAKE_SOURCE_DIR}/build) +set(YOGA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) +include(${YOGA_ROOT}/cmake/project-defaults.cmake) -set(yogacore_build_DIR ${build_DIR}/yogacore/${ANDROID_ABI}) +add_subdirectory(${YOGA_ROOT}/yoga ${CMAKE_CURRENT_BINARY_DIR}/yoga) -file(MAKE_DIRECTORY ${build_DIR}) +file(GLOB SOURCES CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/jni/*.cpp) +file(GLOB VERSION_SCRIPT CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/yogajni.version) -add_subdirectory(${yogacore_DIR} ${yogacore_build_DIR}) - -add_compile_options( - -fno-omit-frame-pointer - -fexceptions - -fvisibility=hidden - -ffunction-sections - -fdata-sections - -Wall - -std=c++11) - -file(GLOB jni_SRC - jni/*.cpp) - -file(GLOB yogajni_version_script - yogajni.version) - -add_library(yoga SHARED ${jni_SRC}) - -target_include_directories(yoga PRIVATE - ${yogacore_DIR}) - -target_link_libraries(yoga -Wl,--gc-sections,--version-script=${yogajni_version_script} yogacore) +add_library(yoga SHARED ${SOURCES}) +target_link_libraries(yoga yogacore) +target_link_options(yoga PRIVATE -Wl,--version-script=${VERSION_SCRIPT}) diff --git a/java/build.gradle b/java/build.gradle index 0b990b8a..20584cf4 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -9,6 +9,8 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.yoga' + compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion @@ -20,16 +22,11 @@ android { ndk { abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' } - - externalNativeBuild { - cmake { - arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static' - } - } } externalNativeBuild { cmake { + version rootProject.cmakeVersion path 'CMakeLists.txt' } } diff --git a/java/com/facebook/yoga/YogaExperimentalFeature.java b/java/com/facebook/yoga/YogaExperimentalFeature.java index 3fabbb91..3532e45e 100644 --- a/java/com/facebook/yoga/YogaExperimentalFeature.java +++ b/java/com/facebook/yoga/YogaExperimentalFeature.java @@ -10,7 +10,9 @@ package com.facebook.yoga; public enum YogaExperimentalFeature { - WEB_FLEX_BASIS(0); + WEB_FLEX_BASIS(0), + ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE(1), + FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN(2); private final int mIntValue; @@ -25,6 +27,8 @@ public enum YogaExperimentalFeature { public static YogaExperimentalFeature fromInt(int value) { switch (value) { case 0: return WEB_FLEX_BASIS; + case 1: return ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE; + case 2: return FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; default: throw new IllegalArgumentException("Unknown enum value: " + value); } } diff --git a/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java b/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java index c1d4eda4..5220217a 100644 --- a/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java +++ b/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java @@ -27,6 +27,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_width_height_start_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -69,6 +71,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_width_height_end_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -111,6 +115,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_start_top_end_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -153,6 +159,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_width_height_start_top_end_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -197,6 +205,8 @@ public class YGAbsolutePositionTest { @Test public void test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -254,6 +264,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_within_border() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMargin(YogaEdge.LEFT, 10f); @@ -370,6 +382,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_and_justify_content_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -413,6 +427,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_and_justify_content_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); @@ -456,6 +472,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_justify_content_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -498,6 +516,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -540,6 +560,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_center_on_child_only() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexGrow(1f); @@ -582,6 +604,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_and_justify_content_center_and_top_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -626,6 +650,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_and_justify_content_center_and_bottom_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -670,6 +696,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_and_justify_content_center_and_left_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -714,6 +742,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_and_justify_content_center_and_right_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -758,6 +788,8 @@ public class YGAbsolutePositionTest { @Test public void test_position_root_with_rtl_should_position_withoutdirection() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPosition(YogaEdge.LEFT, 72f); @@ -783,6 +815,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_percentage_bottom_based_on_parent_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -858,6 +892,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_in_wrap_reverse_column_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP_REVERSE); @@ -899,6 +935,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_in_wrap_reverse_row_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -941,6 +979,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_in_wrap_reverse_column_container_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP_REVERSE); @@ -983,6 +1023,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_in_wrap_reverse_row_container_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1023,6 +1065,153 @@ public class YGAbsolutePositionTest { assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); } + @Test + public void test_percent_absolute_position_infinite_height() { + YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setWidth(300f); + + final YogaNode root_child0 = createNode(config); + root_child0.setWidth(300f); + root.addChildAt(root_child0, 0); + + final YogaNode root_child1 = createNode(config); + root_child1.setPositionType(YogaPositionType.ABSOLUTE); + root_child1.setPositionPercent(YogaEdge.LEFT, 20f); + root_child1.setPositionPercent(YogaEdge.TOP, 20f); + root_child1.setWidthPercent(20f); + root_child1.setHeightPercent(20f); + root.addChildAt(root_child1, 1); + root.setDirection(YogaDirection.LTR); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(300f, root.getLayoutWidth(), 0.0f); + assertEquals(0f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(300f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(0f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(60f, root_child1.getLayoutX(), 0.0f); + assertEquals(0f, root_child1.getLayoutY(), 0.0f); + assertEquals(60f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(0f, root_child1.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(300f, root.getLayoutWidth(), 0.0f); + assertEquals(0f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(300f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(0f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(60f, root_child1.getLayoutX(), 0.0f); + assertEquals(0f, root_child1.getLayoutY(), 0.0f); + assertEquals(60f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(0f, root_child1.getLayoutHeight(), 0.0f); + } + + @Test + public void test_absolute_layout_percentage_height_based_on_padded_parent() { + YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setPadding(YogaEdge.TOP, 10); + root.setBorder(YogaEdge.TOP, 10f); + root.setWidth(100f); + root.setHeight(100f); + + final YogaNode root_child0 = createNode(config); + root_child0.setPositionType(YogaPositionType.ABSOLUTE); + root_child0.setWidth(100f); + root_child0.setHeightPercent(50f); + root.addChildAt(root_child0, 0); + 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(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(10f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.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(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(10f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.getLayoutHeight(), 0.0f); + } + + @Test + public void test_absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center() { + YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setJustifyContent(YogaJustify.CENTER); + root.setAlignItems(YogaAlign.CENTER); + root.setPadding(YogaEdge.TOP, 20); + root.setPadding(YogaEdge.BOTTOM, 20); + root.setWidth(100f); + root.setHeight(100f); + + final YogaNode root_child0 = createNode(config); + root_child0.setPositionType(YogaPositionType.ABSOLUTE); + root_child0.setWidth(100f); + root_child0.setHeightPercent(50f); + root.addChildAt(root_child0, 0); + 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(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(25f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.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(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(25f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.getLayoutHeight(), 0.0f); + } + private YogaNode createNode(YogaConfig config) { return mNodeFactory.create(config); } diff --git a/java/tests/com/facebook/yoga/YGAlignContentTest.java b/java/tests/com/facebook/yoga/YGAlignContentTest.java index 61451c32..a3bdce56 100644 --- a/java/tests/com/facebook/yoga/YGAlignContentTest.java +++ b/java/tests/com/facebook/yoga/YGAlignContentTest.java @@ -27,6 +27,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -128,6 +130,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_start_without_height_on_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP); @@ -225,6 +229,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_start_with_flex() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP); @@ -328,6 +334,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.FLEX_END); @@ -429,6 +437,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); @@ -525,6 +535,8 @@ public class YGAlignContentTest { @Test public void test_align_content_spacebetween() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -627,6 +639,8 @@ public class YGAlignContentTest { @Test public void test_align_content_spacearound() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -729,6 +743,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -826,6 +842,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -939,6 +957,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_flex() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1042,6 +1062,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_flex_no_shrink() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1144,6 +1166,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1249,6 +1273,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_padding() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1354,6 +1380,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_single_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1409,6 +1437,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_fixed_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1507,6 +1537,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1605,6 +1637,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_min_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1703,6 +1737,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); @@ -1818,6 +1854,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_is_not_overriding_align_items() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); diff --git a/java/tests/com/facebook/yoga/YGAlignItemsTest.java b/java/tests/com/facebook/yoga/YGAlignItemsTest.java index 20544ed4..3b13e585 100644 --- a/java/tests/com/facebook/yoga/YGAlignItemsTest.java +++ b/java/tests/com/facebook/yoga/YGAlignItemsTest.java @@ -27,6 +27,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -65,6 +67,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -105,6 +109,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); @@ -145,6 +151,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_END); @@ -185,6 +193,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -241,6 +251,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -312,6 +324,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_multiline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -430,6 +444,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_multiline_override() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -550,6 +566,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_multiline_no_override_on_secondline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -669,6 +687,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -741,6 +761,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_top2() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -813,6 +835,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_double_nested_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -899,6 +923,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.BASELINE); @@ -954,6 +980,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1033,6 +1061,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_padding() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1112,6 +1142,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1229,6 +1261,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.BASELINE); @@ -1345,6 +1379,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline_column2() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.BASELINE); @@ -1461,6 +1497,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline_row_and_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1578,6 +1616,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_center_child_with_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1635,6 +1675,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_end_child_with_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1692,6 +1734,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_center_child_without_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1747,6 +1791,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_end_child_without_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1802,6 +1848,8 @@ public class YGAlignItemsTest { @Test public void test_align_center_should_size_based_on_content() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1873,6 +1921,8 @@ public class YGAlignItemsTest { @Test public void test_align_stretch_should_size_based_on_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMargin(YogaEdge.TOP, 20f); @@ -1943,6 +1993,8 @@ public class YGAlignItemsTest { @Test public void test_align_flex_start_with_shrinking_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); @@ -2011,6 +2063,8 @@ public class YGAlignItemsTest { @Test public void test_align_flex_start_with_stretching_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); @@ -2078,6 +2132,8 @@ public class YGAlignItemsTest { @Test public void test_align_flex_start_with_shrinking_children_with_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); diff --git a/java/tests/com/facebook/yoga/YGAlignSelfTest.java b/java/tests/com/facebook/yoga/YGAlignSelfTest.java index e5ebc9e8..8a47fddc 100644 --- a/java/tests/com/facebook/yoga/YGAlignSelfTest.java +++ b/java/tests/com/facebook/yoga/YGAlignSelfTest.java @@ -27,6 +27,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -67,6 +69,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -107,6 +111,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -147,6 +153,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_flex_end_override_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); @@ -188,6 +196,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_baseline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); diff --git a/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java b/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java index 5a2cc190..8747ec96 100644 --- a/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java +++ b/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java @@ -27,6 +27,8 @@ public class YGAndroidNewsFeed { @Test public void test_android_news_feed() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); diff --git a/java/tests/com/facebook/yoga/YGBorderTest.java b/java/tests/com/facebook/yoga/YGBorderTest.java index 35d7c782..ac72b09f 100644 --- a/java/tests/com/facebook/yoga/YGBorderTest.java +++ b/java/tests/com/facebook/yoga/YGBorderTest.java @@ -27,6 +27,8 @@ public class YGBorderTest { @Test public void test_border_no_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -53,6 +55,8 @@ public class YGBorderTest { @Test public void test_border_container_match_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -94,6 +98,8 @@ public class YGBorderTest { @Test public void test_border_flex_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -137,6 +143,8 @@ public class YGBorderTest { @Test public void test_border_stretch_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -179,6 +187,8 @@ public class YGBorderTest { @Test public void test_border_center_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); diff --git a/java/tests/com/facebook/yoga/YGDimensionTest.java b/java/tests/com/facebook/yoga/YGDimensionTest.java index 3ab10187..915726e8 100644 --- a/java/tests/com/facebook/yoga/YGDimensionTest.java +++ b/java/tests/com/facebook/yoga/YGDimensionTest.java @@ -27,6 +27,8 @@ public class YGDimensionTest { @Test public void test_wrap_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); @@ -64,6 +66,8 @@ public class YGDimensionTest { @Test public void test_wrap_grandchild() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); diff --git a/java/tests/com/facebook/yoga/YGDisplayTest.java b/java/tests/com/facebook/yoga/YGDisplayTest.java index 57928a8d..95ae45ba 100644 --- a/java/tests/com/facebook/yoga/YGDisplayTest.java +++ b/java/tests/com/facebook/yoga/YGDisplayTest.java @@ -27,6 +27,8 @@ public class YGDisplayTest { @Test public void test_display_none() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -81,6 +83,8 @@ public class YGDisplayTest { @Test public void test_display_none_fixed_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -136,6 +140,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -195,6 +201,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -286,6 +294,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -341,6 +351,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_position_absolute() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); diff --git a/java/tests/com/facebook/yoga/YGFlexDirectionTest.java b/java/tests/com/facebook/yoga/YGFlexDirectionTest.java index d6b40a02..0574338c 100644 --- a/java/tests/com/facebook/yoga/YGFlexDirectionTest.java +++ b/java/tests/com/facebook/yoga/YGFlexDirectionTest.java @@ -27,6 +27,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_column_no_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -92,6 +94,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_row_no_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -158,6 +162,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -224,6 +230,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -291,6 +299,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_column_reverse() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.COLUMN_REVERSE); @@ -358,6 +368,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_row_reverse() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW_REVERSE); diff --git a/java/tests/com/facebook/yoga/YGFlexTest.java b/java/tests/com/facebook/yoga/YGFlexTest.java index 5315c2d2..2dcc68fe 100644 --- a/java/tests/com/facebook/yoga/YGFlexTest.java +++ b/java/tests/com/facebook/yoga/YGFlexTest.java @@ -27,6 +27,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_grow_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -80,6 +82,8 @@ public class YGFlexTest { @Test public void test_flex_shrink_flex_grow_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -137,6 +141,8 @@ public class YGFlexTest { @Test public void test_flex_shrink_flex_grow_child_flex_shrink_other_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -195,6 +201,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_grow_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -249,6 +257,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_shrink_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -302,6 +312,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_shrink_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -356,6 +368,8 @@ public class YGFlexTest { @Test public void test_flex_shrink_to_zero() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(75f); @@ -425,6 +439,8 @@ public class YGFlexTest { @Test public void test_flex_basis_overrides_main_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -495,6 +511,8 @@ public class YGFlexTest { @Test public void test_flex_grow_shrink_at_most() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -547,6 +565,8 @@ public class YGFlexTest { @Test public void test_flex_grow_less_than_factor_one() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); diff --git a/java/tests/com/facebook/yoga/YGFlexWrapTest.java b/java/tests/com/facebook/yoga/YGFlexWrapTest.java index 7c2f2e2b..4121650c 100644 --- a/java/tests/com/facebook/yoga/YGFlexWrapTest.java +++ b/java/tests/com/facebook/yoga/YGFlexWrapTest.java @@ -27,6 +27,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP); @@ -111,6 +113,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -196,6 +200,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_row_align_items_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -282,6 +288,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_row_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -368,6 +376,8 @@ public class YGFlexWrapTest { @Test public void test_flex_wrap_children_with_min_main_overriding_flex_basis() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -425,6 +435,8 @@ public class YGFlexWrapTest { @Test public void test_flex_wrap_wrap_to_child_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); @@ -507,6 +519,8 @@ public class YGFlexWrapTest { @Test public void test_flex_wrap_align_stretch_fits_one_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -561,6 +575,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -661,6 +677,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -762,6 +780,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_single_line_different_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -862,6 +882,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -963,6 +985,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1064,6 +1088,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_column_fixed_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1165,6 +1191,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_row_within_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1235,6 +1263,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_row_within_align_items_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); @@ -1305,6 +1335,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_row_within_align_items_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_END); @@ -1375,6 +1407,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_column_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1453,6 +1487,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_column_max_height_flex() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1537,6 +1573,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_nodes_with_content_sizing_overflowing_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); @@ -1634,6 +1672,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_nodes_with_content_sizing_margin_cross() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); diff --git a/java/tests/com/facebook/yoga/YGGapTest.java b/java/tests/com/facebook/yoga/YGGapTest.java index 29d08d8f..f8ac88a0 100644 --- a/java/tests/com/facebook/yoga/YGGapTest.java +++ b/java/tests/com/facebook/yoga/YGGapTest.java @@ -27,6 +27,8 @@ public class YGGapTest { @Test public void test_column_gap_flexible() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -102,6 +104,8 @@ public class YGGapTest { @Test public void test_column_gap_inflexible() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -170,6 +174,8 @@ public class YGGapTest { @Test public void test_column_gap_mixed_flexible() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -240,6 +246,8 @@ public class YGGapTest { @Test public void test_column_gap_child_margins() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -320,6 +328,8 @@ public class YGGapTest { @Test public void test_column_row_gap_wrapping() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -482,6 +492,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -550,6 +562,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -619,6 +633,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -688,6 +704,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -757,6 +775,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -826,6 +846,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_space_evenly() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -895,6 +917,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1013,6 +1037,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1132,6 +1158,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1251,6 +1279,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1370,6 +1400,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1489,6 +1521,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1592,6 +1626,8 @@ public class YGGapTest { @Test public void test_column_gap_determines_parent_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1659,6 +1695,8 @@ public class YGGapTest { @Test public void test_row_gap_align_items_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1772,6 +1810,8 @@ public class YGGapTest { @Test public void test_row_gap_align_items_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1885,6 +1925,8 @@ public class YGGapTest { @Test public void test_row_gap_column_child_margins() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -1964,6 +2006,8 @@ public class YGGapTest { @Test public void test_row_gap_row_wrap_child_margins() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -2039,6 +2083,8 @@ public class YGGapTest { @Test public void test_row_gap_determines_parent_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); diff --git a/java/tests/com/facebook/yoga/YGJustifyContentTest.java b/java/tests/com/facebook/yoga/YGJustifyContentTest.java index f82270c1..9d53d3ab 100644 --- a/java/tests/com/facebook/yoga/YGJustifyContentTest.java +++ b/java/tests/com/facebook/yoga/YGJustifyContentTest.java @@ -27,6 +27,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -94,6 +96,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -162,6 +166,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -230,6 +236,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -298,6 +306,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -366,6 +376,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(102f); @@ -432,6 +444,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); @@ -499,6 +513,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -566,6 +582,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.SPACE_BETWEEN); @@ -633,6 +651,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.SPACE_AROUND); @@ -700,6 +720,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_min_width_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -741,6 +763,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_max_width_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -783,6 +807,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_min_height_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -823,6 +849,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_colunn_max_height_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -864,6 +892,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_space_evenly() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.SPACE_EVENLY); @@ -931,6 +961,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_space_evenly() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -999,6 +1031,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_min_width_with_padding_child_width_greater_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); @@ -1075,6 +1109,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_min_width_with_padding_child_width_lower_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); diff --git a/java/tests/com/facebook/yoga/YGMarginTest.java b/java/tests/com/facebook/yoga/YGMarginTest.java index 36645dd3..af01cc61 100644 --- a/java/tests/com/facebook/yoga/YGMarginTest.java +++ b/java/tests/com/facebook/yoga/YGMarginTest.java @@ -27,6 +27,8 @@ public class YGMarginTest { @Test public void test_margin_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -67,6 +69,8 @@ public class YGMarginTest { @Test public void test_margin_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -106,6 +110,8 @@ public class YGMarginTest { @Test public void test_margin_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -147,6 +153,8 @@ public class YGMarginTest { @Test public void test_margin_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); @@ -187,6 +195,8 @@ public class YGMarginTest { @Test public void test_margin_and_flex_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -228,6 +238,8 @@ public class YGMarginTest { @Test public void test_margin_and_flex_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -268,6 +280,8 @@ public class YGMarginTest { @Test public void test_margin_and_stretch_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -309,6 +323,8 @@ public class YGMarginTest { @Test public void test_margin_and_stretch_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -349,6 +365,8 @@ public class YGMarginTest { @Test public void test_margin_with_sibling_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -403,6 +421,8 @@ public class YGMarginTest { @Test public void test_margin_with_sibling_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -456,6 +476,8 @@ public class YGMarginTest { @Test public void test_margin_auto_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -512,6 +534,8 @@ public class YGMarginTest { @Test public void test_margin_auto_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -568,6 +592,8 @@ public class YGMarginTest { @Test public void test_margin_auto_bottom_and_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -625,6 +651,8 @@ public class YGMarginTest { @Test public void test_margin_auto_bottom_and_top_justify_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -682,6 +710,8 @@ public class YGMarginTest { @Test public void test_margin_auto_mutiple_children_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -754,6 +784,8 @@ public class YGMarginTest { @Test public void test_margin_auto_mutiple_children_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -827,6 +859,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -885,6 +919,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -941,6 +977,8 @@ public class YGMarginTest { @Test public void test_margin_auto_start_and_end_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -999,6 +1037,8 @@ public class YGMarginTest { @Test public void test_margin_auto_start_and_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -1055,6 +1095,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right_column_and_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1112,6 +1154,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1168,6 +1212,8 @@ public class YGMarginTest { @Test public void test_margin_auto_right() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1224,6 +1270,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1281,6 +1329,8 @@ public class YGMarginTest { @Test public void test_margin_auto_top_and_bottom_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -1337,6 +1387,8 @@ public class YGMarginTest { @Test public void test_margin_should_not_be_part_of_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(250f); @@ -1378,6 +1430,8 @@ public class YGMarginTest { @Test public void test_margin_should_not_be_part_of_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(250f); @@ -1419,6 +1473,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_right_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1461,6 +1517,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1502,6 +1560,8 @@ public class YGMarginTest { @Test public void test_margin_fix_left_auto_right_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1544,6 +1604,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_fix_right_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1586,6 +1648,8 @@ public class YGMarginTest { @Test public void test_margin_auto_top_stretching_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1643,6 +1707,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_stretching_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); diff --git a/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java b/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java index 0550e894..4b778e63 100644 --- a/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java +++ b/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java @@ -27,6 +27,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -66,6 +68,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -106,6 +110,8 @@ public class YGMinMaxDimensionTest { @Test public void test_justify_content_min_max() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -147,6 +153,8 @@ public class YGMinMaxDimensionTest { @Test public void test_align_items_min_max() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -188,6 +196,8 @@ public class YGMinMaxDimensionTest { @Test public void test_justify_content_overflow_min_max() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -258,6 +268,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_to_min() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -312,6 +324,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_in_at_most_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -367,6 +381,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -406,6 +422,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_min_max_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMinHeight(100f); @@ -458,6 +476,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -512,6 +532,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -566,6 +588,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_root_ignored() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexGrow(1f); @@ -621,6 +645,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_root_minimized() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -691,6 +717,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_height_maximized() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -760,6 +788,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_min_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -813,6 +843,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_min_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMinHeight(100f); @@ -864,6 +896,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_max_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -932,6 +966,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_max_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -985,6 +1021,8 @@ public class YGMinMaxDimensionTest { @Test public void test_child_min_max_width_flexing() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1042,6 +1080,8 @@ public class YGMinMaxDimensionTest { @Test public void test_min_width_overrides_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(50f); @@ -1066,6 +1106,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_width_overrides_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -1090,6 +1132,8 @@ public class YGMinMaxDimensionTest { @Test public void test_min_height_overrides_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(50f); @@ -1114,6 +1158,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_height_overrides_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(200f); @@ -1138,6 +1184,8 @@ public class YGMinMaxDimensionTest { @Test public void test_min_max_percent_no_width_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); diff --git a/java/tests/com/facebook/yoga/YGPaddingTest.java b/java/tests/com/facebook/yoga/YGPaddingTest.java index 2279cf15..cd73de36 100644 --- a/java/tests/com/facebook/yoga/YGPaddingTest.java +++ b/java/tests/com/facebook/yoga/YGPaddingTest.java @@ -27,6 +27,8 @@ public class YGPaddingTest { @Test public void test_padding_no_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -53,6 +55,8 @@ public class YGPaddingTest { @Test public void test_padding_container_match_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -94,6 +98,8 @@ public class YGPaddingTest { @Test public void test_padding_flex_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -137,6 +143,8 @@ public class YGPaddingTest { @Test public void test_padding_stretch_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -179,6 +187,8 @@ public class YGPaddingTest { @Test public void test_padding_center_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -223,6 +233,8 @@ public class YGPaddingTest { @Test public void test_child_with_padding_align_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); diff --git a/java/tests/com/facebook/yoga/YGPercentageTest.java b/java/tests/com/facebook/yoga/YGPercentageTest.java index f843bbac..5395d973 100644 --- a/java/tests/com/facebook/yoga/YGPercentageTest.java +++ b/java/tests/com/facebook/yoga/YGPercentageTest.java @@ -27,6 +27,8 @@ public class YGPercentageTest { @Test public void test_percentage_width_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -67,6 +69,8 @@ public class YGPercentageTest { @Test public void test_percentage_position_left_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -109,6 +113,8 @@ public class YGPercentageTest { @Test public void test_percentage_position_bottom_right() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -151,6 +157,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -206,6 +214,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -260,6 +270,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -317,6 +329,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -373,6 +387,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -430,6 +446,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -486,6 +504,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_min_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -543,6 +563,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_min_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -599,6 +621,8 @@ public class YGPercentageTest { @Test public void test_percentage_multiple_nested_with_padding_margin_and_percentage_values() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -707,6 +731,8 @@ public class YGPercentageTest { @Test public void test_percentage_margin_should_calculate_based_only_on_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -764,6 +790,8 @@ public class YGPercentageTest { @Test public void test_percentage_padding_should_calculate_based_only_on_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -821,6 +849,8 @@ public class YGPercentageTest { @Test public void test_percentage_absolute_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -863,6 +893,8 @@ public class YGPercentageTest { @Test public void test_percentage_width_height_undefined_parent_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); @@ -900,6 +932,8 @@ public class YGPercentageTest { @Test public void test_percent_within_flex_grow() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -981,6 +1015,8 @@ public class YGPercentageTest { @Test public void test_percentage_container_in_wrapping_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1066,6 +1102,8 @@ public class YGPercentageTest { @Test public void test_percent_absolute_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(60f); diff --git a/java/tests/com/facebook/yoga/YGRoundingTest.java b/java/tests/com/facebook/yoga/YGRoundingTest.java index 7493ec7b..0340b779 100644 --- a/java/tests/com/facebook/yoga/YGRoundingTest.java +++ b/java/tests/com/facebook/yoga/YGRoundingTest.java @@ -27,6 +27,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_grow_row_width_of_100() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -94,6 +96,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_grow_row_prime_number_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -189,6 +193,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_shrink_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -257,6 +263,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_overrides_main_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -327,6 +335,8 @@ public class YGRoundingTest { @Test public void test_rounding_total_fractial() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(87.4f); @@ -397,6 +407,8 @@ public class YGRoundingTest { @Test public void test_rounding_total_fractial_nested() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(87.4f); @@ -501,6 +513,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_1() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -571,6 +585,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_2() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -641,6 +657,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_3() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPosition(YogaEdge.TOP, 0.3f); @@ -712,6 +730,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_4() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPosition(YogaEdge.TOP, 0.7f); @@ -783,6 +803,8 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_horizontal() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -867,6 +889,8 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_vertical() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(320f); @@ -950,6 +974,8 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_combined() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); diff --git a/java/tests/com/facebook/yoga/YGSizeOverflowTest.java b/java/tests/com/facebook/yoga/YGSizeOverflowTest.java index 63b3db6a..1bdb5190 100644 --- a/java/tests/com/facebook/yoga/YGSizeOverflowTest.java +++ b/java/tests/com/facebook/yoga/YGSizeOverflowTest.java @@ -27,6 +27,8 @@ public class YGSizeOverflowTest { @Test public void test_nested_overflowing_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -79,6 +81,8 @@ public class YGSizeOverflowTest { @Test public void test_nested_overflowing_child_in_constraint_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -133,6 +137,8 @@ public class YGSizeOverflowTest { @Test public void test_parent_wrap_child_size_overflowing_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js index 6cedc194..4f7f120a 100644 --- a/javascript/.eslintrc.js +++ b/javascript/.eslintrc.js @@ -8,6 +8,7 @@ */ module.exports = { + root: true, ignorePatterns: ["dist/**", "**/*.d.ts"], parser: "@babel/eslint-parser", extends: [ diff --git a/javascript/.prettierrc.js b/javascript/.prettierrc.js new file mode 100644 index 00000000..ae47ee6e --- /dev/null +++ b/javascript/.prettierrc.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 + */ + +module.exports = { + trailingComma: "es5", + tabWidth: 2, + semi: true, + singleQuote: false, +}; diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index 1068ec89..1306dace 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -7,14 +7,14 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) project(yoga) -file(GLOB SOURCES +file(GLOB SOURCES CONFIGURE_DEPENDS ${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) +set(CMAKE_CXX_STANDARD 14) add_compile_definitions( EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0) diff --git a/javascript/just.config.js b/javascript/just.config.js index b221a090..cabc413a 100644 --- a/javascript/just.config.js +++ b/javascript/just.config.js @@ -9,6 +9,7 @@ const { argv, + cleanTask, copyTask, eslintTask, logger, @@ -27,6 +28,8 @@ const node = process.execPath; option("fix"); +task("clean", cleanTask({ paths: ["build", "dist"] })); + task( "prepare-for-build", parallel( @@ -37,7 +40,7 @@ task( ); function defineFlavor(flavor, env) { - task(`cmake-build:${flavor}`, cmakeBuildTask([flavor])); + task(`cmake-build:${flavor}`, cmakeBuildTask({ targets: [flavor] })); task(`jest:${flavor}`, jestTask({ env })); task( `test:${flavor}`, @@ -51,8 +54,14 @@ 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( + "cmake-build:async", + cmakeBuildTask({ targets: ["asmjs-async", "wasm-async"] }) +); +task( + "cmake-build:sync", + cmakeBuildTask({ targets: ["asmjs-sync", "wasm-sync"] }) +); task("build", series("prepare-for-build", "cmake-build:all")); @@ -108,19 +117,19 @@ function emcmakeGenerateTask() { "build", ...(ninja ? ["-G", "Ninja"] : []), ]; - logger.info(["encmake", ...args].join(" ")); + logger.info(["emcmake", ...args].join(" ")); return spawn(emcmake, args); }; } -function cmakeBuildTask(targets) { +function cmakeBuildTask(opts) { return () => { const cmake = which.sync("cmake"); const args = [ "--build", "build", - ...(targets ? ["--target", ...targets] : []), + ...(opts?.targets ? ["--target", ...opts.targets] : []), ]; logger.info(["cmake", ...args].join(" ")); diff --git a/javascript/package.json b/javascript/package.json index 201542f2..11c2f932 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -28,6 +28,7 @@ "scripts": { "benchmark": "just benchmark", "build": "just build", + "clean": "just clean", "lint": "just lint", "lint:fix": "just lint --fix", "test": "just test", diff --git a/javascript/src_js/generated/YGEnums.d.ts b/javascript/src_js/generated/YGEnums.d.ts index 26272de5..323a6b05 100644 --- a/javascript/src_js/generated/YGEnums.d.ts +++ b/javascript/src_js/generated/YGEnums.d.ts @@ -87,6 +87,12 @@ 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 EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE = 1 & ['EXPERIMENTAL_FEATURE'] +export const EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE: EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE; + +type EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN = 2 & ['EXPERIMENTAL_FEATURE'] +export const EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN: EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; + type FLEX_DIRECTION_COLUMN = 0 & ['FLEX_DIRECTION'] export const FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN; @@ -254,7 +260,9 @@ export type Edge = | typeof EDGE_ALL; export type ExperimentalFeature = - | typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; + | typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS + | typeof EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE + | typeof EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; export type FlexDirection = | typeof FLEX_DIRECTION_COLUMN diff --git a/javascript/src_js/generated/YGEnums.js b/javascript/src_js/generated/YGEnums.js index b9a4cbde..ac93434e 100644 --- a/javascript/src_js/generated/YGEnums.js +++ b/javascript/src_js/generated/YGEnums.js @@ -38,6 +38,8 @@ module.exports = { EDGE_ALL: 8, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0, + EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE: 1, + EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN: 2, FLEX_DIRECTION_COLUMN: 0, FLEX_DIRECTION_COLUMN_REVERSE: 1, diff --git a/javascript/src_js/wrapAsm.d.ts b/javascript/src_js/wrapAsm.d.ts index cca5026e..5c434cf5 100644 --- a/javascript/src_js/wrapAsm.d.ts +++ b/javascript/src_js/wrapAsm.d.ts @@ -8,17 +8,19 @@ */ import type { - Edge, - Wrap, Align, + Direction, + Display, + Edge, + ExperimentalFeature, FlexDirection, Gutter, - Direction, - PositionType, - Overflow, Justify, - Display, - ExperimentalFeature, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, } from './generated/YGEnums'; import type * as YGEnums from './generated/YGEnums'; @@ -38,7 +40,7 @@ type Size = { } type Value = { - unit: number; + unit: Unit; value: number; } @@ -53,14 +55,14 @@ export type Config = { useLegacyStretchBehaviour(): boolean, setUseLegacyStretchBehaviour(useLegacyStretchBehaviour: boolean): void, useWebDefaults(): boolean, - setUseWebDefaults(useWebDefaults): void, + setUseWebDefaults(useWebDefaults: boolean): void, }; export type MeasureFunction = ( width: number, - widthMode: number, + widthMode: MeasureMode, height: number, - heightMode: number + heightMode: MeasureMode ) => Size; export type Node = { diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js index 7cd75cc1..6b89d8d9 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js @@ -11,6 +11,9 @@ test("absolute_layout_width_height_start_top", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -58,6 +61,9 @@ test("absolute_layout_width_height_end_bottom", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -105,6 +111,9 @@ test("absolute_layout_start_top_end_bottom", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -152,6 +161,9 @@ test("absolute_layout_width_height_start_top_end_bottom", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -201,6 +213,9 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -263,6 +278,9 @@ test("absolute_layout_within_border", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setMargin(Yoga.EDGE_LEFT, 10); @@ -384,6 +402,9 @@ test("absolute_layout_align_items_and_justify_content_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -432,6 +453,9 @@ test("absolute_layout_align_items_and_justify_content_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); @@ -480,6 +504,9 @@ test("absolute_layout_justify_content_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -527,6 +554,9 @@ test("absolute_layout_align_items_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -574,6 +604,9 @@ test("absolute_layout_align_items_center_on_child_only", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexGrow(1); @@ -621,6 +654,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -670,6 +706,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -719,6 +758,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -768,6 +810,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -817,6 +862,9 @@ test("position_root_with_rtl_should_position_withoutdirection", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_LEFT, 72); @@ -847,6 +895,9 @@ test("absolute_layout_percentage_bottom_based_on_parent_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -927,6 +978,9 @@ test("absolute_layout_in_wrap_reverse_column_container", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); @@ -973,6 +1027,9 @@ test("absolute_layout_in_wrap_reverse_row_container", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1020,6 +1077,9 @@ test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); @@ -1067,6 +1127,9 @@ test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1111,3 +1174,168 @@ test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { config.free(); } }); +test("percent_absolute_position_infinite_height", () => { + const config = Yoga.Config.create(); + let root; + + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + try { + root = Yoga.Node.create(config); + root.setWidth(300); + + const root_child0 = Yoga.Node.create(config); + root_child0.setWidth(300); + root.insertChild(root_child0, 0); + + const root_child1 = Yoga.Node.create(config); + root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child1.setPosition(Yoga.EDGE_LEFT, "20%"); + root_child1.setPosition(Yoga.EDGE_TOP, "20%"); + root_child1.setWidth("20%"); + 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(300); + expect(root.getComputedHeight()).toBe(0); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(300); + expect(root_child0.getComputedHeight()).toBe(0); + + expect(root_child1.getComputedLeft()).toBe(60); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(60); + 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(300); + expect(root.getComputedHeight()).toBe(0); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(300); + expect(root_child0.getComputedHeight()).toBe(0); + + expect(root_child1.getComputedLeft()).toBe(60); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(60); + expect(root_child1.getComputedHeight()).toBe(0); + } finally { + if (typeof root !== "undefined") { + root.freeRecursive(); + } + + config.free(); + } +}); +test("absolute_layout_percentage_height_based_on_padded_parent", () => { + const config = Yoga.Config.create(); + let root; + + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + try { + root = Yoga.Node.create(config); + root.setPadding(Yoga.EDGE_TOP, 10); + root.setBorder(Yoga.EDGE_TOP, 10); + 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("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(10); + expect(root_child0.getComputedWidth()).toBe(100); + 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(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); + } finally { + if (typeof root !== "undefined") { + root.freeRecursive(); + } + + config.free(); + } +}); +test("absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center", () => { + const config = Yoga.Config.create(); + let root; + + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + try { + root = Yoga.Node.create(config); + root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setAlignItems(Yoga.ALIGN_CENTER); + root.setPadding(Yoga.EDGE_TOP, 20); + root.setPadding(Yoga.EDGE_BOTTOM, 20); + 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("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(25); + expect(root_child0.getComputedWidth()).toBe(100); + 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(0); + expect(root_child0.getComputedTop()).toBe(25); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); + } 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 index bd3ec73e..f6706a9a 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.js @@ -11,6 +11,9 @@ test("align_content_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -117,6 +120,9 @@ test("align_content_flex_start_without_height_on_children", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -219,6 +225,9 @@ test("align_content_flex_start_with_flex", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -327,6 +336,9 @@ test("align_content_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_FLEX_END); @@ -433,6 +445,9 @@ test("align_content_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); @@ -534,6 +549,9 @@ test("align_content_spacebetween", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -641,6 +659,9 @@ test("align_content_spacearound", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -748,6 +769,9 @@ test("align_content_stretch_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -850,6 +874,9 @@ test("align_content_stretch_row_with_children", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -968,6 +995,9 @@ test("align_content_stretch_row_with_flex", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1076,6 +1106,9 @@ test("align_content_stretch_row_with_flex_no_shrink", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1183,6 +1216,9 @@ test("align_content_stretch_row_with_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1293,6 +1329,9 @@ test("align_content_stretch_row_with_padding", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1403,6 +1442,9 @@ test("align_content_stretch_row_with_single_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1463,6 +1505,9 @@ test("align_content_stretch_row_with_fixed_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1566,6 +1611,9 @@ test("align_content_stretch_row_with_max_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1669,6 +1717,9 @@ test("align_content_stretch_row_with_min_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1772,6 +1823,9 @@ test("align_content_stretch_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); @@ -1892,6 +1946,9 @@ test("align_content_stretch_is_not_overriding_align_items", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js index 4f27c016..d6fea434 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -11,6 +11,9 @@ test("align_items_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -54,6 +57,9 @@ test("align_items_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -99,6 +105,9 @@ test("align_items_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); @@ -144,6 +153,9 @@ test("align_items_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_END); @@ -189,6 +201,9 @@ test("align_baseline", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -250,6 +265,9 @@ test("align_baseline_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -326,6 +344,9 @@ test("align_baseline_child_multiline", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -449,6 +470,9 @@ test("align_baseline_child_multiline_override", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -574,6 +598,9 @@ test("align_baseline_child_multiline_no_override_on_secondline", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -698,6 +725,9 @@ test("align_baseline_child_top", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -775,6 +805,9 @@ test("align_baseline_child_top2", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -852,6 +885,9 @@ test("align_baseline_double_nested_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -943,6 +979,9 @@ test("align_baseline_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); @@ -1003,6 +1042,9 @@ test("align_baseline_child_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1087,6 +1129,9 @@ test("align_baseline_child_padding", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1171,6 +1216,9 @@ test("align_baseline_multiline", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1293,6 +1341,9 @@ test("align_baseline_multiline_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); @@ -1414,6 +1465,9 @@ test("align_baseline_multiline_column2", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); @@ -1535,6 +1589,9 @@ test("align_baseline_multiline_row_and_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1657,6 +1714,9 @@ test("align_items_center_child_with_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1719,6 +1779,9 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1781,6 +1844,9 @@ test("align_items_center_child_without_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1841,6 +1907,9 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1901,6 +1970,9 @@ test("align_center_should_size_based_on_content", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1977,6 +2049,9 @@ test("align_stretch_should_size_based_on_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setMargin(Yoga.EDGE_TOP, 20); @@ -2052,6 +2127,9 @@ test("align_flex_start_with_shrinking_children", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(500); @@ -2125,6 +2203,9 @@ test("align_flex_start_with_stretching_children", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(500); @@ -2197,6 +2278,9 @@ test("align_flex_start_with_shrinking_children_with_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(500); diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js index b8f1db3f..928a7d62 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.js @@ -11,6 +11,9 @@ test("align_self_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -56,6 +59,9 @@ test("align_self_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -101,6 +107,9 @@ test("align_self_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -146,6 +155,9 @@ test("align_self_flex_end_override_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); @@ -192,6 +204,9 @@ test("align_self_baseline", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js index c198cae1..2ab527fe 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js @@ -11,6 +11,9 @@ test("android_news_feed", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js index edd8aab8..d4d22fd8 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.js @@ -11,6 +11,9 @@ test("border_no_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); @@ -42,6 +45,9 @@ test("border_container_match_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); @@ -88,6 +94,9 @@ test("border_flex_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); @@ -136,6 +145,9 @@ test("border_stretch_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); @@ -183,6 +195,9 @@ test("border_center_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js index 582b4e61..21b7421c 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.js @@ -11,6 +11,9 @@ test("wrap_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); @@ -53,6 +56,9 @@ test("wrap_grandchild", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js index 004ff905..b9fd8eac 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.js @@ -11,6 +11,9 @@ test("display_none", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -70,6 +73,9 @@ test("display_none_fixed_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -130,6 +136,9 @@ test("display_none_with_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -194,6 +203,9 @@ test("display_none_with_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -290,6 +302,9 @@ test("display_none_with_position", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -350,6 +365,9 @@ test("display_none_with_position_absolute", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js index d7c5e0d7..f977af0e 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.js @@ -11,6 +11,9 @@ test("flex_direction_column_no_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -81,6 +84,9 @@ test("flex_direction_row_no_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -152,6 +158,9 @@ test("flex_direction_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -223,6 +232,9 @@ test("flex_direction_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -295,6 +307,9 @@ test("flex_direction_column_reverse", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE); @@ -367,6 +382,9 @@ test("flex_direction_row_reverse", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE); diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js index 141ad7cf..789ea167 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.js @@ -11,6 +11,9 @@ test("flex_basis_flex_grow_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -69,6 +72,9 @@ test("flex_shrink_flex_grow_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -131,6 +137,9 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -194,6 +203,9 @@ test("flex_basis_flex_grow_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -253,6 +265,9 @@ test("flex_basis_flex_shrink_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -311,6 +326,9 @@ test("flex_basis_flex_shrink_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -370,6 +388,9 @@ test("flex_shrink_to_zero", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setHeight(75); @@ -444,6 +465,9 @@ test("flex_basis_overrides_main_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -519,6 +543,9 @@ test("flex_grow_shrink_at_most", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -576,6 +603,9 @@ test("flex_grow_less_than_factor_one", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js index cd0388dd..f1cf1f41 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.js @@ -11,6 +11,9 @@ test("wrap_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -100,6 +103,9 @@ test("wrap_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -190,6 +196,9 @@ test("wrap_row_align_items_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -281,6 +290,9 @@ test("wrap_row_align_items_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -372,6 +384,9 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -434,6 +449,9 @@ test("flex_wrap_wrap_to_child_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); @@ -521,6 +539,9 @@ test("flex_wrap_align_stretch_fits_one_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -580,6 +601,9 @@ test("wrap_reverse_row_align_content_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -685,6 +709,9 @@ test("wrap_reverse_row_align_content_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -791,6 +818,9 @@ test("wrap_reverse_row_single_line_different_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -896,6 +926,9 @@ test("wrap_reverse_row_align_content_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1002,6 +1035,9 @@ test("wrap_reverse_row_align_content_space_around", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1108,6 +1144,9 @@ test("wrap_reverse_column_fixed_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1214,6 +1253,9 @@ test("wrapped_row_within_align_items_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1289,6 +1331,9 @@ test("wrapped_row_within_align_items_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); @@ -1364,6 +1409,9 @@ test("wrapped_row_within_align_items_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_END); @@ -1439,6 +1487,9 @@ test("wrapped_column_max_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1522,6 +1573,9 @@ test("wrapped_column_max_height_flex", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1611,6 +1665,9 @@ test("wrap_nodes_with_content_sizing_overflowing_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(500); @@ -1713,6 +1770,9 @@ test("wrap_nodes_with_content_sizing_margin_cross", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(500); diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js index 11ffa6d6..765eeea5 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.js @@ -11,6 +11,9 @@ test("column_gap_flexible", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -91,6 +94,9 @@ test("column_gap_inflexible", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -164,6 +170,9 @@ test("column_gap_mixed_flexible", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -239,6 +248,9 @@ test("column_gap_child_margins", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -324,6 +336,9 @@ test("column_row_gap_wrapping", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -491,6 +506,9 @@ test("column_gap_justify_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -564,6 +582,9 @@ test("column_gap_justify_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -638,6 +659,9 @@ test("column_gap_justify_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -712,6 +736,9 @@ test("column_gap_justify_space_between", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -786,6 +813,9 @@ test("column_gap_justify_space_around", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -860,6 +890,9 @@ test("column_gap_justify_space_evenly", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -934,6 +967,9 @@ test("column_gap_wrap_align_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1057,6 +1093,9 @@ test("column_gap_wrap_align_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1181,6 +1220,9 @@ test("column_gap_wrap_align_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1305,6 +1347,9 @@ test("column_gap_wrap_align_space_between", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1429,6 +1474,9 @@ test("column_gap_wrap_align_space_around", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1553,6 +1601,9 @@ test("column_gap_wrap_align_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1661,6 +1712,9 @@ test("column_gap_determines_parent_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1733,6 +1787,9 @@ test("row_gap_align_items_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1851,6 +1908,9 @@ test("row_gap_align_items_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1969,6 +2029,9 @@ test("row_gap_column_child_margins", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -2053,6 +2116,9 @@ test("row_gap_row_wrap_child_margins", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -2133,6 +2199,9 @@ test("row_gap_determines_parent_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js index 145eb54a..5066cfb1 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.js @@ -11,6 +11,9 @@ test("justify_content_row_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -83,6 +86,9 @@ test("justify_content_row_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -156,6 +162,9 @@ test("justify_content_row_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -229,6 +238,9 @@ test("justify_content_row_space_between", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -302,6 +314,9 @@ test("justify_content_row_space_around", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -375,6 +390,9 @@ test("justify_content_column_flex_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(102); @@ -446,6 +464,9 @@ test("justify_content_column_flex_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); @@ -518,6 +539,9 @@ test("justify_content_column_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -590,6 +614,9 @@ test("justify_content_column_space_between", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); @@ -662,6 +689,9 @@ test("justify_content_column_space_around", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); @@ -734,6 +764,9 @@ test("justify_content_row_min_width_and_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -780,6 +813,9 @@ test("justify_content_row_max_width_and_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -827,6 +863,9 @@ test("justify_content_column_min_height_and_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -872,6 +911,9 @@ test("justify_content_colunn_max_height_and_margin", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -918,6 +960,9 @@ test("justify_content_column_space_evenly", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); @@ -990,6 +1035,9 @@ test("justify_content_row_space_evenly", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1063,6 +1111,9 @@ test("justify_content_min_width_with_padding_child_width_greater_than_parent", ( const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); @@ -1144,6 +1195,9 @@ test("justify_content_min_width_with_padding_child_width_lower_than_parent", () const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js index 888b189a..65ee1a17 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.js @@ -11,6 +11,9 @@ test("margin_start", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -56,6 +59,9 @@ test("margin_top", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -100,6 +106,9 @@ test("margin_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -146,6 +155,9 @@ test("margin_bottom", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); @@ -191,6 +203,9 @@ test("margin_and_flex_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -237,6 +252,9 @@ test("margin_and_flex_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -282,6 +300,9 @@ test("margin_and_stretch_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -328,6 +349,9 @@ test("margin_and_stretch_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -373,6 +397,9 @@ test("margin_with_sibling_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -432,6 +459,9 @@ test("margin_with_sibling_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -490,6 +520,9 @@ test("margin_auto_bottom", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -551,6 +584,9 @@ test("margin_auto_top", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -612,6 +648,9 @@ test("margin_auto_bottom_and_top", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -674,6 +713,9 @@ test("margin_auto_bottom_and_top_justify_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -736,6 +778,9 @@ test("margin_auto_mutiple_children_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -813,6 +858,9 @@ test("margin_auto_mutiple_children_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -891,6 +939,9 @@ test("margin_auto_left_and_right_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -954,6 +1005,9 @@ test("margin_auto_left_and_right", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -1015,6 +1069,9 @@ test("margin_auto_start_and_end_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1078,6 +1135,9 @@ test("margin_auto_start_and_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -1139,6 +1199,9 @@ test("margin_auto_left_and_right_column_and_center", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1201,6 +1264,9 @@ test("margin_auto_left", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1262,6 +1328,9 @@ test("margin_auto_right", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1323,6 +1392,9 @@ test("margin_auto_left_and_right_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1385,6 +1457,9 @@ test("margin_auto_top_and_bottom_stretch", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -1446,6 +1521,9 @@ test("margin_should_not_be_part_of_max_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(250); @@ -1492,6 +1570,9 @@ test("margin_should_not_be_part_of_max_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(250); @@ -1538,6 +1619,9 @@ test("margin_auto_left_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1585,6 +1669,9 @@ test("margin_auto_left_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1631,6 +1718,9 @@ test("margin_fix_left_auto_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1678,6 +1768,9 @@ test("margin_auto_left_fix_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1725,6 +1818,9 @@ test("margin_auto_top_stretching_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1787,6 +1883,9 @@ test("margin_auto_left_stretching_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js index 0642e299..55fac642 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js @@ -11,6 +11,9 @@ test("max_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -55,6 +58,9 @@ test("max_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -100,6 +106,9 @@ test("justify_content_min_max", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -146,6 +155,9 @@ test("align_items_min_max", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -192,6 +204,9 @@ test("justify_content_overflow_min_max", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -267,6 +282,9 @@ test("flex_grow_to_min", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -326,6 +344,9 @@ test("flex_grow_in_at_most_container", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -386,6 +407,9 @@ test("flex_grow_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -430,6 +454,9 @@ test("flex_grow_within_constrained_min_max_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setMinHeight(100); @@ -487,6 +514,9 @@ test("flex_grow_within_max_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -546,6 +576,9 @@ test("flex_grow_within_constrained_max_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -605,6 +638,9 @@ test("flex_root_ignored", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexGrow(1); @@ -665,6 +701,9 @@ test("flex_grow_root_minimized", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -740,6 +779,9 @@ test("flex_grow_height_maximized", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -814,6 +856,9 @@ test("flex_grow_within_constrained_min_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -872,6 +917,9 @@ test("flex_grow_within_constrained_min_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setMinHeight(100); @@ -928,6 +976,9 @@ test("flex_grow_within_constrained_max_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -1001,6 +1052,9 @@ test("flex_grow_within_constrained_max_column", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -1059,6 +1113,9 @@ test("child_min_max_width_flexing", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1121,6 +1178,9 @@ test("min_width_overrides_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(50); @@ -1150,6 +1210,9 @@ test("max_width_overrides_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -1179,6 +1242,9 @@ test("min_height_overrides_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setHeight(50); @@ -1208,6 +1274,9 @@ test("max_height_overrides_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setHeight(200); @@ -1237,6 +1306,9 @@ test("min_max_percent_no_width_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js index 1f9498c3..5d03d3d4 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.js @@ -11,6 +11,9 @@ test("padding_no_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); @@ -42,6 +45,9 @@ test("padding_container_match_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); @@ -88,6 +94,9 @@ test("padding_flex_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); @@ -136,6 +145,9 @@ test("padding_stretch_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); @@ -183,6 +195,9 @@ test("padding_center_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -232,6 +247,9 @@ test("child_with_padding_align_end", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js index 2c34df61..6682442a 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.js @@ -11,6 +11,9 @@ test("percentage_width_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -56,6 +59,9 @@ test("percentage_position_left_top", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -103,6 +109,9 @@ test("percentage_position_bottom_right", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -150,6 +159,9 @@ test("percentage_flex_basis", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -210,6 +222,9 @@ test("percentage_flex_basis_cross", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -269,6 +284,9 @@ test("percentage_flex_basis_main_max_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -331,6 +349,9 @@ test("percentage_flex_basis_cross_max_height", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -392,6 +413,9 @@ test("percentage_flex_basis_main_max_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -454,6 +478,9 @@ test("percentage_flex_basis_cross_max_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -515,6 +542,9 @@ test("percentage_flex_basis_main_min_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -577,6 +607,9 @@ test("percentage_flex_basis_cross_min_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -638,6 +671,9 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -751,6 +787,9 @@ test("percentage_margin_should_calculate_based_only_on_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -813,6 +852,9 @@ test("percentage_padding_should_calculate_based_only_on_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -875,6 +917,9 @@ test("percentage_absolute_position", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(200); @@ -922,6 +967,9 @@ test("percentage_width_height_undefined_parent_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); @@ -964,6 +1012,9 @@ test("percent_within_flex_grow", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1050,6 +1101,9 @@ test("percentage_container_in_wrapping_container", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1140,6 +1194,9 @@ test("percent_absolute_position", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(60); diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js index c1cac6e4..33a1a2d2 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.js @@ -11,6 +11,9 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -83,6 +86,9 @@ test("rounding_flex_basis_flex_grow_row_prime_number_width", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -183,6 +189,9 @@ test("rounding_flex_basis_flex_shrink_row", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -256,6 +265,9 @@ test("rounding_flex_basis_overrides_main_size", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -331,6 +343,9 @@ test("rounding_total_fractial", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(87.4); @@ -406,6 +421,9 @@ test("rounding_total_fractial_nested", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(87.4); @@ -515,6 +533,9 @@ test("rounding_fractial_input_1", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -590,6 +611,9 @@ test("rounding_fractial_input_2", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -665,6 +689,9 @@ test("rounding_fractial_input_3", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.3); @@ -741,6 +768,9 @@ test("rounding_fractial_input_4", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.7); @@ -817,6 +847,9 @@ test("rounding_inner_node_controversy_horizontal", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -906,6 +939,9 @@ test("rounding_inner_node_controversy_vertical", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setHeight(320); @@ -994,6 +1030,9 @@ test("rounding_inner_node_controversy_combined", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js index 6fa2c119..c8d4e802 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.js @@ -11,6 +11,9 @@ test("nested_overflowing_child", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -68,6 +71,9 @@ test("nested_overflowing_child_in_constraint_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); @@ -127,6 +133,9 @@ test("parent_wrap_child_size_overflowing_parent", () => { const config = Yoga.Config.create(); let root; + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + try { root = Yoga.Node.create(config); root.setWidth(100); diff --git a/lib/android-support/android-support-v4.jar b/lib/android-support/android-support-v4.jar deleted file mode 100644 index aa0b1a5c..00000000 Binary files a/lib/android-support/android-support-v4.jar and /dev/null differ diff --git a/lib/appcompat/appcompat-v7-24.2.1.aar b/lib/appcompat/appcompat-v7-24.2.1.aar deleted file mode 100644 index 55121105..00000000 Binary files a/lib/appcompat/appcompat-v7-24.2.1.aar and /dev/null differ diff --git a/lib/gtest/googletest b/lib/gtest/googletest deleted file mode 160000 index a2b8a8e0..00000000 --- a/lib/gtest/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a2b8a8e07628e5fd60644b6dd99c1b5e7d7f1f47 diff --git a/lib/hamcrest/hamcrest-2.1.jar b/lib/hamcrest/hamcrest-2.1.jar deleted file mode 100644 index e323d5e8..00000000 Binary files a/lib/hamcrest/hamcrest-2.1.jar and /dev/null differ diff --git a/mode/opt b/mode/opt deleted file mode 100644 index 6db2b79c..00000000 --- a/mode/opt +++ /dev/null @@ -1,4 +0,0 @@ ---config -cxx.cxxflags=-O3 -DNDEBUG ---config -cxx.cflags=-O3 -DNDEBUG diff --git a/settings.gradle b/settings.gradle index a2b419da..cc035683 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -include ':yoga', ':yogacore', ':yoga-layout', ':yoga:proguard-annotations' +include ':yoga', ':yoga-layout', ':yoga:proguard-annotations' project(':yoga').projectDir = file('java') project(':yoga:proguard-annotations').projectDir = file('java/proguard-annotations') project(':yoga-layout').projectDir = file('android') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..2b25ddb0 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,36 @@ +# 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) +project(tests) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(FetchContent) +include(GoogleTest) + +set(YOGA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) +include(${YOGA_ROOT}/cmake/project-defaults.cmake) + +# Fetch GTest +cmake_policy(SET CMP0135 NEW) +FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip +) +FetchContent_MakeAvailable(googletest) + +add_subdirectory(${YOGA_ROOT}/yoga ${CMAKE_CURRENT_BINARY_DIR}/yoga) + +file(GLOB SOURCES CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp) + +enable_testing() + +add_executable(yogatests ${SOURCES}) +target_link_libraries(yogatests yogacore GTest::gtest_main) + +gtest_discover_tests(yogatests) diff --git a/tests/EventsTest.cpp b/tests/EventsTest.cpp index aa371041..810fe53e 100644 --- a/tests/EventsTest.cpp +++ b/tests/EventsTest.cpp @@ -234,7 +234,7 @@ TEST_F(EventTest, layout_events_has_max_measure_cache) { YGNodeInsertChild(root, b, 1); YGNodeStyleSetFlexBasis(a, 10.0f); - for (auto s : {20, 30, 40}) { + for (auto s : {20.0f, 30.0f, 40.0f}) { YGNodeCalculateLayout(root, s, s, YGDirectionLTR); } diff --git a/tests/YGAlignBaselineTest.cpp b/tests/YGAlignBaselineTest.cpp index 9ef3b0b4..40d03fe7 100644 --- a/tests/YGAlignBaselineTest.cpp +++ b/tests/YGAlignBaselineTest.cpp @@ -22,10 +22,7 @@ static YGSize _measure1( YGMeasureMode widthMode, float height, YGMeasureMode heightMode) { - return YGSize{ - .width = 42, - .height = 50, - }; + return YGSize{42, 50}; } static YGSize _measure2( @@ -34,10 +31,7 @@ static YGSize _measure2( YGMeasureMode widthMode, float height, YGMeasureMode heightMode) { - return YGSize{ - .width = 279, - .height = 126, - }; + return YGSize{279, 126}; } static YGNodeRef createYGNode( @@ -51,8 +45,8 @@ static YGNodeRef createYGNode( if (alignBaseline) { YGNodeStyleSetAlignItems(node, YGAlignBaseline); } - YGNodeStyleSetWidth(node, width); - YGNodeStyleSetHeight(node, height); + YGNodeStyleSetWidth(node, (float) width); + YGNodeStyleSetHeight(node, (float) height); return node; } diff --git a/tests/YGAspectRatioTest.cpp b/tests/YGAspectRatioTest.cpp index 0d61dfd8..2dce80c9 100644 --- a/tests/YGAspectRatioTest.cpp +++ b/tests/YGAspectRatioTest.cpp @@ -16,8 +16,8 @@ static YGSize _measure( float height, YGMeasureMode heightMode) { return YGSize{ - .width = widthMode == YGMeasureModeExactly ? width : 50, - .height = heightMode == YGMeasureModeExactly ? height : 50, + widthMode == YGMeasureModeExactly ? width : 50, + heightMode == YGMeasureModeExactly ? height : 50, }; } diff --git a/tests/YGInfiniteHeightTest.cpp b/tests/YGInfiniteHeightTest.cpp deleted file mode 100644 index 42012a4f..00000000 --- a/tests/YGInfiniteHeightTest.cpp +++ /dev/null @@ -1,54 +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 - -// This test isn't correct from the Flexbox standard standpoint, -// because percentages are calculated with parent constraints. -// However, we need to make sure we fail gracefully in this case, not returning -// NaN -TEST(YogaTest, percent_absolute_position_infinite_height) { - const YGConfigRef config = YGConfigNew(); - - const YGNodeRef root = YGNodeNewWithConfig(config); - YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); - YGNodeStyleSetWidth(root, 300); - - const YGNodeRef root_child0 = YGNodeNewWithConfig(config); - YGNodeStyleSetWidth(root_child0, 300); - YGNodeStyleSetHeight(root_child0, 300); - YGNodeInsertChild(root, root_child0, 0); - - const YGNodeRef root_child1 = YGNodeNewWithConfig(config); - YGNodeStyleSetPositionType(root_child1, YGPositionTypeAbsolute); - YGNodeStyleSetPositionPercent(root_child1, YGEdgeLeft, 20); - YGNodeStyleSetPositionPercent(root_child1, YGEdgeTop, 20); - YGNodeStyleSetWidthPercent(root_child1, 20); - YGNodeStyleSetHeightPercent(root_child1, 20); - YGNodeInsertChild(root, root_child1, 1); - YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); - - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetHeight(root)); - - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetHeight(root_child0)); - - ASSERT_FLOAT_EQ(60, YGNodeLayoutGetLeft(root_child1)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); - ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child1)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child1)); - - YGNodeFreeRecursive(root); - - YGConfigFree(config); -} diff --git a/tests/YGLoggerTest.cpp b/tests/YGLoggerTest.cpp index c46104f9..7c67b40b 100644 --- a/tests/YGLoggerTest.cpp +++ b/tests/YGLoggerTest.cpp @@ -9,6 +9,8 @@ #include #include +#if DEBUG + namespace { char writeBuffer[4096]; int _unmanagedLogger( @@ -131,3 +133,5 @@ TEST(YogaTest, logger_node_with_children_should_print_indented) { "style=\"\" >\n"; ASSERT_STREQ(expected, writeBuffer); } + +#endif diff --git a/tests/YGMeasureCacheTest.cpp b/tests/YGMeasureCacheTest.cpp index e1b6fbe6..1d39c7ee 100644 --- a/tests/YGMeasureCacheTest.cpp +++ b/tests/YGMeasureCacheTest.cpp @@ -19,8 +19,8 @@ static YGSize _measureMax( (*measureCount)++; return YGSize{ - .width = widthMode == YGMeasureModeUndefined ? 10 : width, - .height = heightMode == YGMeasureModeUndefined ? 10 : height, + widthMode == YGMeasureModeUndefined ? 10 : width, + heightMode == YGMeasureModeUndefined ? 10 : height, }; } @@ -33,11 +33,11 @@ static YGSize _measureMin( int* measureCount = (int*) node->getContext(); *measureCount = *measureCount + 1; return YGSize{ - .width = widthMode == YGMeasureModeUndefined || + widthMode == YGMeasureModeUndefined || (widthMode == YGMeasureModeAtMost && width > 10) ? 10 : width, - .height = heightMode == YGMeasureModeUndefined || + heightMode == YGMeasureModeUndefined || (heightMode == YGMeasureModeAtMost && height > 10) ? 10 : height, @@ -55,10 +55,7 @@ static YGSize _measure_84_49( (*measureCount)++; } - return YGSize{ - .width = 84.f, - .height = 49.f, - }; + return YGSize{84.f, 49.f}; } static YGSize _real_text_measurement_example( diff --git a/tests/YGMeasureModeTest.cpp b/tests/YGMeasureModeTest.cpp index 31004ebb..6547ed66 100644 --- a/tests/YGMeasureModeTest.cpp +++ b/tests/YGMeasureModeTest.cpp @@ -38,15 +38,15 @@ static YGSize _measure( constraintList->length = currentIndex + 1; return YGSize{ - .width = widthMode == YGMeasureModeUndefined ? 10 : width, - .height = heightMode == YGMeasureModeUndefined ? 10 : width, + widthMode == YGMeasureModeUndefined ? 10 : width, + heightMode == YGMeasureModeUndefined ? 10 : width, }; } TEST(YogaTest, exactly_measure_stretched_child_column) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -74,8 +74,8 @@ TEST(YogaTest, exactly_measure_stretched_child_column) { TEST(YogaTest, exactly_measure_stretched_child_row) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -103,8 +103,8 @@ TEST(YogaTest, exactly_measure_stretched_child_row) { TEST(YogaTest, at_most_main_axis_column) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -130,8 +130,8 @@ TEST(YogaTest, at_most_main_axis_column) { TEST(YogaTest, at_most_cross_axis_column) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -158,8 +158,8 @@ TEST(YogaTest, at_most_cross_axis_column) { TEST(YogaTest, at_most_main_axis_row) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -186,8 +186,8 @@ TEST(YogaTest, at_most_main_axis_row) { TEST(YogaTest, at_most_cross_axis_row) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -215,8 +215,8 @@ TEST(YogaTest, at_most_cross_axis_row) { TEST(YogaTest, flex_child) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -245,8 +245,8 @@ TEST(YogaTest, flex_child) { TEST(YogaTest, flex_child_with_flex_basis) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -273,8 +273,8 @@ TEST(YogaTest, flex_child_with_flex_basis) { TEST(YogaTest, overflow_scroll_column) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; @@ -305,8 +305,8 @@ TEST(YogaTest, overflow_scroll_column) { TEST(YogaTest, overflow_scroll_row) { struct _MeasureConstraintList constraintList = _MeasureConstraintList{ - .length = 0, - .constraints = (struct _MeasureConstraint*) malloc( + 0, + (struct _MeasureConstraint*) malloc( 10 * sizeof(struct _MeasureConstraint)), }; diff --git a/tests/YGMeasureTest.cpp b/tests/YGMeasureTest.cpp index 646a8941..11d4fd4d 100644 --- a/tests/YGMeasureTest.cpp +++ b/tests/YGMeasureTest.cpp @@ -20,10 +20,7 @@ static YGSize _measure( (*measureCount)++; } - return YGSize{ - .width = 10, - .height = 10, - }; + return YGSize{10, 10}; } static YGSize _simulate_wrapping_text( @@ -33,13 +30,10 @@ static YGSize _simulate_wrapping_text( float height, YGMeasureMode heightMode) { if (widthMode == YGMeasureModeUndefined || width >= 68) { - return YGSize{.width = 68, .height = 16}; + return YGSize{68, 16}; } - return YGSize{ - .width = 50, - .height = 32, - }; + return YGSize{50, 32}; } static YGSize _measure_assert_negative( @@ -51,10 +45,7 @@ static YGSize _measure_assert_negative( EXPECT_GE(width, 0); EXPECT_GE(height, 0); - return YGSize{ - .width = 0, - .height = 0, - }; + return YGSize{0, 0}; } TEST(YogaTest, dont_measure_single_grow_shrink_child) { @@ -656,10 +647,7 @@ static YGSize _measure_90_10( float height, YGMeasureMode heightMode) { - return YGSize{ - .width = 90, - .height = 10, - }; + return YGSize{90, 10}; } static YGSize _measure_100_100( @@ -669,10 +657,7 @@ static YGSize _measure_100_100( float height, YGMeasureMode heightMode) { - return YGSize{ - .width = 100, - .height = 100, - }; + return YGSize{100, 100}; } TEST(YogaTest, percent_with_text_node) { diff --git a/tests/YGNodeCallbackTest.cpp b/tests/YGNodeCallbackTest.cpp index b50f416f..8c438414 100644 --- a/tests/YGNodeCallbackTest.cpp +++ b/tests/YGNodeCallbackTest.cpp @@ -48,7 +48,7 @@ TEST(YGNode, measure_with_context_measure_fn) { return *(YGSize*) ctx; }); - auto result = YGSize{123.4, -56.7}; + auto result = YGSize{123.4f, -56.7f}; ASSERT_EQ( n.measure(0, YGMeasureModeUndefined, 0, YGMeasureModeUndefined, &result), result); diff --git a/tests/YGRoundingFunctionTest.cpp b/tests/YGRoundingFunctionTest.cpp index 60de9326..e99ced89 100644 --- a/tests/YGRoundingFunctionTest.cpp +++ b/tests/YGRoundingFunctionTest.cpp @@ -48,7 +48,7 @@ static YGSize measureText( YGMeasureMode widthMode, float height, YGMeasureMode heightMode) { - return (YGSize){.width = 10, .height = 10}; + return YGSize{10, 10}; } // Regression test for https://github.com/facebook/yoga/issues/824 @@ -57,7 +57,7 @@ TEST(YogaTest, consistent_rounding_during_repeated_layouts) { YGConfigSetPointScaleFactor(config, 2); const YGNodeRef root = YGNodeNewWithConfig(config); - YGNodeStyleSetMargin(root, YGEdgeTop, -1.49); + YGNodeStyleSetMargin(root, YGEdgeTop, -1.49f); YGNodeStyleSetWidth(root, 500); YGNodeStyleSetHeight(root, 500); @@ -70,7 +70,7 @@ TEST(YogaTest, consistent_rounding_during_repeated_layouts) { for (int i = 0; i < 5; i++) { // Dirty the tree so YGRoundToPixelGrid runs again - YGNodeStyleSetMargin(root, YGEdgeLeft, i + 1); + YGNodeStyleSetMargin(root, YGEdgeLeft, (float) (i + 1)); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); ASSERT_FLOAT_EQ(10, YGNodeLayoutGetHeight(node1)); diff --git a/tests/YGRoundingMeasureFuncTest.cpp b/tests/YGRoundingMeasureFuncTest.cpp index 86935b2f..166be5db 100644 --- a/tests/YGRoundingMeasureFuncTest.cpp +++ b/tests/YGRoundingMeasureFuncTest.cpp @@ -57,8 +57,8 @@ TEST(YogaTest, rounding_feature_with_custom_measure_func_floor) { YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); - ASSERT_FLOAT_EQ(10.2, YGNodeLayoutGetWidth(root_child0)); - ASSERT_FLOAT_EQ(10.2, YGNodeLayoutGetHeight(root_child0)); + ASSERT_FLOAT_EQ(10.2f, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(10.2f, YGNodeLayoutGetHeight(root_child0)); YGConfigSetPointScaleFactor(config, 1.0f); diff --git a/tests/YGStyleAccessorsTest.cpp b/tests/YGStyleAccessorsTest.cpp index d792d644..2801536f 100644 --- a/tests/YGStyleAccessorsTest.cpp +++ b/tests/YGStyleAccessorsTest.cpp @@ -81,6 +81,9 @@ namespace yoga { using CompactValue = detail::CompactValue; +// TODO: MSVC doesn't like the macros +#ifndef _MSC_VER + ACCESSOR_TEST( direction, YGDirectionInherit, @@ -250,5 +253,7 @@ ACCESSOR_TEST( YGFloatOptional{0.0f}, YGFloatOptional{}); +#endif + } // namespace yoga } // namespace facebook diff --git a/tests/generated/YGAbsolutePositionTest.cpp b/tests/generated/YGAbsolutePositionTest.cpp index 0ad6d75c..4b96c2d5 100644 --- a/tests/generated/YGAbsolutePositionTest.cpp +++ b/tests/generated/YGAbsolutePositionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, absolute_layout_width_height_start_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -56,6 +58,8 @@ TEST(YogaTest, absolute_layout_width_height_start_top) { TEST(YogaTest, absolute_layout_width_height_end_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -99,6 +103,8 @@ TEST(YogaTest, absolute_layout_width_height_end_bottom) { TEST(YogaTest, absolute_layout_start_top_end_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -142,6 +148,8 @@ TEST(YogaTest, absolute_layout_start_top_end_bottom) { TEST(YogaTest, absolute_layout_width_height_start_top_end_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -187,6 +195,8 @@ TEST(YogaTest, absolute_layout_width_height_start_top_end_bottom) { TEST(YogaTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -245,6 +255,8 @@ TEST(YogaTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hi TEST(YogaTest, absolute_layout_within_border) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMargin(root, YGEdgeLeft, 10); @@ -362,6 +374,8 @@ TEST(YogaTest, absolute_layout_within_border) { TEST(YogaTest, absolute_layout_align_items_and_justify_content_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -406,6 +420,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center) { TEST(YogaTest, absolute_layout_align_items_and_justify_content_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); @@ -450,6 +466,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_flex_end) { TEST(YogaTest, absolute_layout_justify_content_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -493,6 +511,8 @@ TEST(YogaTest, absolute_layout_justify_content_center) { TEST(YogaTest, absolute_layout_align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -536,6 +556,8 @@ TEST(YogaTest, absolute_layout_align_items_center) { TEST(YogaTest, absolute_layout_align_items_center_on_child_only) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexGrow(root, 1); @@ -579,6 +601,8 @@ TEST(YogaTest, absolute_layout_align_items_center_on_child_only) { TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_top_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -624,6 +648,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_top_po TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_bottom_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -669,6 +695,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_bottom TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_left_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -714,6 +742,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_left_p TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_right_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -759,6 +789,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_right_ TEST(YogaTest, position_root_with_rtl_should_position_withoutdirection) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeLeft, 72); @@ -785,6 +817,8 @@ TEST(YogaTest, position_root_with_rtl_should_position_withoutdirection) { TEST(YogaTest, absolute_layout_percentage_bottom_based_on_parent_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -861,6 +895,8 @@ TEST(YogaTest, absolute_layout_percentage_bottom_based_on_parent_height) { TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrapReverse); @@ -903,6 +939,8 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container) { TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -946,6 +984,8 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container) { TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrapReverse); @@ -989,6 +1029,8 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container_flex_end) { TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1030,3 +1072,153 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container_flex_end) { YGConfigFree(config); } + +TEST(YogaTest, percent_absolute_position_infinite_height) { + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetWidth(root, 300); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetWidth(root_child0, 300); + YGNodeInsertChild(root, root_child0, 0); + + const YGNodeRef root_child1 = YGNodeNewWithConfig(config); + YGNodeStyleSetPositionType(root_child1, YGPositionTypeAbsolute); + YGNodeStyleSetPositionPercent(root_child1, YGEdgeLeft, 20); + YGNodeStyleSetPositionPercent(root_child1, YGEdgeTop, 20); + YGNodeStyleSetWidthPercent(root_child1, 20); + YGNodeStyleSetHeightPercent(root_child1, 20); + YGNodeInsertChild(root, root_child1, 1); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child1)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child1)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} + +TEST(YogaTest, absolute_layout_percentage_height_based_on_padded_parent) { + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetPadding(root, YGEdgeTop, 10); + YGNodeStyleSetBorder(root, YGEdgeTop, 10); + YGNodeStyleSetWidth(root, 100); + YGNodeStyleSetHeight(root, 100); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); + YGNodeStyleSetWidth(root_child0, 100); + YGNodeStyleSetHeightPercent(root_child0, 50); + YGNodeInsertChild(root, root_child0, 0); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(10, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(10, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} + +TEST(YogaTest, absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center) { + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetJustifyContent(root, YGJustifyCenter); + YGNodeStyleSetAlignItems(root, YGAlignCenter); + YGNodeStyleSetPadding(root, YGEdgeTop, 20); + YGNodeStyleSetPadding(root, YGEdgeBottom, 20); + YGNodeStyleSetWidth(root, 100); + YGNodeStyleSetHeight(root, 100); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); + YGNodeStyleSetWidth(root_child0, 100); + YGNodeStyleSetHeightPercent(root_child0, 50); + YGNodeInsertChild(root, root_child0, 0); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(25, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(25, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} diff --git a/tests/generated/YGAlignContentTest.cpp b/tests/generated/YGAlignContentTest.cpp index 0421c59b..32efb6f4 100644 --- a/tests/generated/YGAlignContentTest.cpp +++ b/tests/generated/YGAlignContentTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, align_content_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -115,6 +117,8 @@ TEST(YogaTest, align_content_flex_start) { TEST(YogaTest, align_content_flex_start_without_height_on_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrap); @@ -213,6 +217,8 @@ TEST(YogaTest, align_content_flex_start_without_height_on_children) { TEST(YogaTest, align_content_flex_start_with_flex) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrap); @@ -317,6 +323,8 @@ TEST(YogaTest, align_content_flex_start_with_flex) { TEST(YogaTest, align_content_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignFlexEnd); @@ -419,6 +427,8 @@ TEST(YogaTest, align_content_flex_end) { TEST(YogaTest, align_content_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); @@ -516,6 +526,8 @@ TEST(YogaTest, align_content_stretch) { TEST(YogaTest, align_content_spacebetween) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -619,6 +631,8 @@ TEST(YogaTest, align_content_spacebetween) { TEST(YogaTest, align_content_spacearound) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -722,6 +736,8 @@ TEST(YogaTest, align_content_spacearound) { TEST(YogaTest, align_content_stretch_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -820,6 +836,8 @@ TEST(YogaTest, align_content_stretch_row) { TEST(YogaTest, align_content_stretch_row_with_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -934,6 +952,8 @@ TEST(YogaTest, align_content_stretch_row_with_children) { TEST(YogaTest, align_content_stretch_row_with_flex) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1038,6 +1058,8 @@ TEST(YogaTest, align_content_stretch_row_with_flex) { TEST(YogaTest, align_content_stretch_row_with_flex_no_shrink) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1141,6 +1163,8 @@ TEST(YogaTest, align_content_stretch_row_with_flex_no_shrink) { TEST(YogaTest, align_content_stretch_row_with_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1247,6 +1271,8 @@ TEST(YogaTest, align_content_stretch_row_with_margin) { TEST(YogaTest, align_content_stretch_row_with_padding) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1353,6 +1379,8 @@ TEST(YogaTest, align_content_stretch_row_with_padding) { TEST(YogaTest, align_content_stretch_row_with_single_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1409,6 +1437,8 @@ TEST(YogaTest, align_content_stretch_row_with_single_row) { TEST(YogaTest, align_content_stretch_row_with_fixed_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1508,6 +1538,8 @@ TEST(YogaTest, align_content_stretch_row_with_fixed_height) { TEST(YogaTest, align_content_stretch_row_with_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1607,6 +1639,8 @@ TEST(YogaTest, align_content_stretch_row_with_max_height) { TEST(YogaTest, align_content_stretch_row_with_min_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1706,6 +1740,8 @@ TEST(YogaTest, align_content_stretch_row_with_min_height) { TEST(YogaTest, align_content_stretch_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); @@ -1822,6 +1858,8 @@ TEST(YogaTest, align_content_stretch_column) { TEST(YogaTest, align_content_stretch_is_not_overriding_align_items) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); diff --git a/tests/generated/YGAlignItemsTest.cpp b/tests/generated/YGAlignItemsTest.cpp index 254e325d..611e303f 100644 --- a/tests/generated/YGAlignItemsTest.cpp +++ b/tests/generated/YGAlignItemsTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, align_items_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -52,6 +54,8 @@ TEST(YogaTest, align_items_stretch) { TEST(YogaTest, align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -93,6 +97,8 @@ TEST(YogaTest, align_items_center) { TEST(YogaTest, align_items_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); @@ -134,6 +140,8 @@ TEST(YogaTest, align_items_flex_start) { TEST(YogaTest, align_items_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexEnd); @@ -175,6 +183,8 @@ TEST(YogaTest, align_items_flex_end) { TEST(YogaTest, align_baseline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -232,6 +242,8 @@ TEST(YogaTest, align_baseline) { TEST(YogaTest, align_baseline_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -304,6 +316,8 @@ TEST(YogaTest, align_baseline_child) { TEST(YogaTest, align_baseline_child_multiline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -423,6 +437,8 @@ TEST(YogaTest, align_baseline_child_multiline) { TEST(YogaTest, align_baseline_child_multiline_override) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -544,6 +560,8 @@ TEST(YogaTest, align_baseline_child_multiline_override) { TEST(YogaTest, align_baseline_child_multiline_no_override_on_secondline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -664,6 +682,8 @@ TEST(YogaTest, align_baseline_child_multiline_no_override_on_secondline) { TEST(YogaTest, align_baseline_child_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -737,6 +757,8 @@ TEST(YogaTest, align_baseline_child_top) { TEST(YogaTest, align_baseline_child_top2) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -810,6 +832,8 @@ TEST(YogaTest, align_baseline_child_top2) { TEST(YogaTest, align_baseline_double_nested_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -897,6 +921,8 @@ TEST(YogaTest, align_baseline_double_nested_child) { TEST(YogaTest, align_baseline_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignBaseline); @@ -953,6 +979,8 @@ TEST(YogaTest, align_baseline_column) { TEST(YogaTest, align_baseline_child_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1033,6 +1061,8 @@ TEST(YogaTest, align_baseline_child_margin) { TEST(YogaTest, align_baseline_child_padding) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1113,6 +1143,8 @@ TEST(YogaTest, align_baseline_child_padding) { TEST(YogaTest, align_baseline_multiline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1231,6 +1263,8 @@ TEST(YogaTest, align_baseline_multiline) { TEST(YogaTest, align_baseline_multiline_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignBaseline); @@ -1348,6 +1382,8 @@ TEST(YogaTest, align_baseline_multiline_column) { TEST(YogaTest, align_baseline_multiline_column2) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignBaseline); @@ -1465,6 +1501,8 @@ TEST(YogaTest, align_baseline_multiline_column2) { TEST(YogaTest, align_baseline_multiline_row_and_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1583,6 +1621,8 @@ TEST(YogaTest, align_baseline_multiline_row_and_column) { TEST(YogaTest, align_items_center_child_with_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1641,6 +1681,8 @@ TEST(YogaTest, align_items_center_child_with_margin_bigger_than_parent) { TEST(YogaTest, align_items_flex_end_child_with_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1699,6 +1741,8 @@ TEST(YogaTest, align_items_flex_end_child_with_margin_bigger_than_parent) { TEST(YogaTest, align_items_center_child_without_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1755,6 +1799,8 @@ TEST(YogaTest, align_items_center_child_without_margin_bigger_than_parent) { TEST(YogaTest, align_items_flex_end_child_without_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1811,6 +1857,8 @@ TEST(YogaTest, align_items_flex_end_child_without_margin_bigger_than_parent) { TEST(YogaTest, align_center_should_size_based_on_content) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1883,6 +1931,8 @@ TEST(YogaTest, align_center_should_size_based_on_content) { TEST(YogaTest, align_stretch_should_size_based_on_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMargin(root, YGEdgeTop, 20); @@ -1954,6 +2004,8 @@ TEST(YogaTest, align_stretch_should_size_based_on_parent) { TEST(YogaTest, align_flex_start_with_shrinking_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); @@ -2023,6 +2075,8 @@ TEST(YogaTest, align_flex_start_with_shrinking_children) { TEST(YogaTest, align_flex_start_with_stretching_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); @@ -2091,6 +2145,8 @@ TEST(YogaTest, align_flex_start_with_stretching_children) { TEST(YogaTest, align_flex_start_with_shrinking_children_with_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); diff --git a/tests/generated/YGAlignSelfTest.cpp b/tests/generated/YGAlignSelfTest.cpp index 2eaf5c12..83cb8b80 100644 --- a/tests/generated/YGAlignSelfTest.cpp +++ b/tests/generated/YGAlignSelfTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, align_self_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -54,6 +56,8 @@ TEST(YogaTest, align_self_center) { TEST(YogaTest, align_self_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -95,6 +99,8 @@ TEST(YogaTest, align_self_flex_end) { TEST(YogaTest, align_self_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -136,6 +142,8 @@ TEST(YogaTest, align_self_flex_start) { TEST(YogaTest, align_self_flex_end_override_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); @@ -178,6 +186,8 @@ TEST(YogaTest, align_self_flex_end_override_flex_start) { TEST(YogaTest, align_self_baseline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); diff --git a/tests/generated/YGAndroidNewsFeed.cpp b/tests/generated/YGAndroidNewsFeed.cpp index afa4d1ad..f05b11a0 100644 --- a/tests/generated/YGAndroidNewsFeed.cpp +++ b/tests/generated/YGAndroidNewsFeed.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, android_news_feed) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); diff --git a/tests/generated/YGBorderTest.cpp b/tests/generated/YGBorderTest.cpp index 71f45e6f..87607c12 100644 --- a/tests/generated/YGBorderTest.cpp +++ b/tests/generated/YGBorderTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, border_no_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -40,6 +42,8 @@ TEST(YogaTest, border_no_size) { TEST(YogaTest, border_container_match_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -82,6 +86,8 @@ TEST(YogaTest, border_container_match_child) { TEST(YogaTest, border_flex_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -126,6 +132,8 @@ TEST(YogaTest, border_flex_child) { TEST(YogaTest, border_stretch_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -169,6 +177,8 @@ TEST(YogaTest, border_stretch_child) { TEST(YogaTest, border_center_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); diff --git a/tests/generated/YGDimensionTest.cpp b/tests/generated/YGDimensionTest.cpp index aaa058e0..24878cd6 100644 --- a/tests/generated/YGDimensionTest.cpp +++ b/tests/generated/YGDimensionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, wrap_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); @@ -51,6 +53,8 @@ TEST(YogaTest, wrap_child) { TEST(YogaTest, wrap_grandchild) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); diff --git a/tests/generated/YGDisplayTest.cpp b/tests/generated/YGDisplayTest.cpp index fd132342..cce7a367 100644 --- a/tests/generated/YGDisplayTest.cpp +++ b/tests/generated/YGDisplayTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, display_none) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -68,6 +70,8 @@ TEST(YogaTest, display_none) { TEST(YogaTest, display_none_fixed_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -124,6 +128,8 @@ TEST(YogaTest, display_none_fixed_size) { TEST(YogaTest, display_none_with_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -184,6 +190,8 @@ TEST(YogaTest, display_none_with_margin) { TEST(YogaTest, display_none_with_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -276,6 +284,8 @@ TEST(YogaTest, display_none_with_child) { TEST(YogaTest, display_none_with_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -332,6 +342,8 @@ TEST(YogaTest, display_none_with_position) { TEST(YogaTest, display_none_with_position_absolute) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); diff --git a/tests/generated/YGFlexDirectionTest.cpp b/tests/generated/YGFlexDirectionTest.cpp index 6d0cafbf..c7e4c78f 100644 --- a/tests/generated/YGFlexDirectionTest.cpp +++ b/tests/generated/YGFlexDirectionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, flex_direction_column_no_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -79,6 +81,8 @@ TEST(YogaTest, flex_direction_column_no_height) { TEST(YogaTest, flex_direction_row_no_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -146,6 +150,8 @@ TEST(YogaTest, flex_direction_row_no_width) { TEST(YogaTest, flex_direction_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -213,6 +219,8 @@ TEST(YogaTest, flex_direction_column) { TEST(YogaTest, flex_direction_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -281,6 +289,8 @@ TEST(YogaTest, flex_direction_row) { TEST(YogaTest, flex_direction_column_reverse) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumnReverse); @@ -349,6 +359,8 @@ TEST(YogaTest, flex_direction_column_reverse) { TEST(YogaTest, flex_direction_row_reverse) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRowReverse); diff --git a/tests/generated/YGFlexTest.cpp b/tests/generated/YGFlexTest.cpp index db8a16b2..514feafe 100644 --- a/tests/generated/YGFlexTest.cpp +++ b/tests/generated/YGFlexTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, flex_basis_flex_grow_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -67,6 +69,8 @@ TEST(YogaTest, flex_basis_flex_grow_column) { TEST(YogaTest, flex_shrink_flex_grow_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -125,6 +129,8 @@ TEST(YogaTest, flex_shrink_flex_grow_row) { TEST(YogaTest, flex_shrink_flex_grow_child_flex_shrink_other_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -184,6 +190,8 @@ TEST(YogaTest, flex_shrink_flex_grow_child_flex_shrink_other_child) { TEST(YogaTest, flex_basis_flex_grow_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -239,6 +247,8 @@ TEST(YogaTest, flex_basis_flex_grow_row) { TEST(YogaTest, flex_basis_flex_shrink_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -293,6 +303,8 @@ TEST(YogaTest, flex_basis_flex_shrink_column) { TEST(YogaTest, flex_basis_flex_shrink_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -348,6 +360,8 @@ TEST(YogaTest, flex_basis_flex_shrink_row) { TEST(YogaTest, flex_shrink_to_zero) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 75); @@ -418,6 +432,8 @@ TEST(YogaTest, flex_shrink_to_zero) { TEST(YogaTest, flex_basis_overrides_main_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -489,6 +505,8 @@ TEST(YogaTest, flex_basis_overrides_main_size) { TEST(YogaTest, flex_grow_shrink_at_most) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -542,6 +560,8 @@ TEST(YogaTest, flex_grow_shrink_at_most) { TEST(YogaTest, flex_grow_less_than_factor_one) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); diff --git a/tests/generated/YGFlexWrapTest.cpp b/tests/generated/YGFlexWrapTest.cpp index 86981aa8..1fa1224a 100644 --- a/tests/generated/YGFlexWrapTest.cpp +++ b/tests/generated/YGFlexWrapTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, wrap_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrap); @@ -98,6 +100,8 @@ TEST(YogaTest, wrap_column) { TEST(YogaTest, wrap_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -184,6 +188,8 @@ TEST(YogaTest, wrap_row) { TEST(YogaTest, wrap_row_align_items_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -271,6 +277,8 @@ TEST(YogaTest, wrap_row_align_items_flex_end) { TEST(YogaTest, wrap_row_align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -358,6 +366,8 @@ TEST(YogaTest, wrap_row_align_items_center) { TEST(YogaTest, flex_wrap_children_with_min_main_overriding_flex_basis) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -416,6 +426,8 @@ TEST(YogaTest, flex_wrap_children_with_min_main_overriding_flex_basis) { TEST(YogaTest, flex_wrap_wrap_to_child_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); @@ -499,6 +511,8 @@ TEST(YogaTest, flex_wrap_wrap_to_child_height) { TEST(YogaTest, flex_wrap_align_stretch_fits_one_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -554,6 +568,8 @@ TEST(YogaTest, flex_wrap_align_stretch_fits_one_row) { TEST(YogaTest, wrap_reverse_row_align_content_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -655,6 +671,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_flex_start) { TEST(YogaTest, wrap_reverse_row_align_content_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -757,6 +775,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_center) { TEST(YogaTest, wrap_reverse_row_single_line_different_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -858,6 +878,8 @@ TEST(YogaTest, wrap_reverse_row_single_line_different_size) { TEST(YogaTest, wrap_reverse_row_align_content_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -960,6 +982,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_stretch) { TEST(YogaTest, wrap_reverse_row_align_content_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1062,6 +1086,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_space_around) { TEST(YogaTest, wrap_reverse_column_fixed_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1164,6 +1190,8 @@ TEST(YogaTest, wrap_reverse_column_fixed_size) { TEST(YogaTest, wrapped_row_within_align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1235,6 +1263,8 @@ TEST(YogaTest, wrapped_row_within_align_items_center) { TEST(YogaTest, wrapped_row_within_align_items_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); @@ -1306,6 +1336,8 @@ TEST(YogaTest, wrapped_row_within_align_items_flex_start) { TEST(YogaTest, wrapped_row_within_align_items_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexEnd); @@ -1377,6 +1409,8 @@ TEST(YogaTest, wrapped_row_within_align_items_flex_end) { TEST(YogaTest, wrapped_column_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1456,6 +1490,8 @@ TEST(YogaTest, wrapped_column_max_height) { TEST(YogaTest, wrapped_column_max_height_flex) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1541,6 +1577,8 @@ TEST(YogaTest, wrapped_column_max_height_flex) { TEST(YogaTest, wrap_nodes_with_content_sizing_overflowing_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); @@ -1639,6 +1677,8 @@ TEST(YogaTest, wrap_nodes_with_content_sizing_overflowing_margin) { TEST(YogaTest, wrap_nodes_with_content_sizing_margin_cross) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); diff --git a/tests/generated/YGGapTest.cpp b/tests/generated/YGGapTest.cpp index 2fd0c70a..8f05158d 100644 --- a/tests/generated/YGGapTest.cpp +++ b/tests/generated/YGGapTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, column_gap_flexible) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -89,6 +91,8 @@ TEST(YogaTest, column_gap_flexible) { TEST(YogaTest, column_gap_inflexible) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -158,6 +162,8 @@ TEST(YogaTest, column_gap_inflexible) { TEST(YogaTest, column_gap_mixed_flexible) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -229,6 +235,8 @@ TEST(YogaTest, column_gap_mixed_flexible) { TEST(YogaTest, column_gap_child_margins) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -310,6 +318,8 @@ TEST(YogaTest, column_gap_child_margins) { TEST(YogaTest, column_row_gap_wrapping) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -473,6 +483,8 @@ TEST(YogaTest, column_row_gap_wrapping) { TEST(YogaTest, column_gap_justify_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -542,6 +554,8 @@ TEST(YogaTest, column_gap_justify_flex_start) { TEST(YogaTest, column_gap_justify_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -612,6 +626,8 @@ TEST(YogaTest, column_gap_justify_center) { TEST(YogaTest, column_gap_justify_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -682,6 +698,8 @@ TEST(YogaTest, column_gap_justify_flex_end) { TEST(YogaTest, column_gap_justify_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -752,6 +770,8 @@ TEST(YogaTest, column_gap_justify_space_between) { TEST(YogaTest, column_gap_justify_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -822,6 +842,8 @@ TEST(YogaTest, column_gap_justify_space_around) { TEST(YogaTest, column_gap_justify_space_evenly) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -892,6 +914,8 @@ TEST(YogaTest, column_gap_justify_space_evenly) { TEST(YogaTest, column_gap_wrap_align_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1011,6 +1035,8 @@ TEST(YogaTest, column_gap_wrap_align_flex_start) { TEST(YogaTest, column_gap_wrap_align_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1131,6 +1157,8 @@ TEST(YogaTest, column_gap_wrap_align_center) { TEST(YogaTest, column_gap_wrap_align_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1251,6 +1279,8 @@ TEST(YogaTest, column_gap_wrap_align_flex_end) { TEST(YogaTest, column_gap_wrap_align_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1371,6 +1401,8 @@ TEST(YogaTest, column_gap_wrap_align_space_between) { TEST(YogaTest, column_gap_wrap_align_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1491,6 +1523,8 @@ TEST(YogaTest, column_gap_wrap_align_space_around) { TEST(YogaTest, column_gap_wrap_align_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1595,6 +1629,8 @@ TEST(YogaTest, column_gap_wrap_align_stretch) { TEST(YogaTest, column_gap_determines_parent_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1663,6 +1699,8 @@ TEST(YogaTest, column_gap_determines_parent_width) { TEST(YogaTest, row_gap_align_items_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1777,6 +1815,8 @@ TEST(YogaTest, row_gap_align_items_stretch) { TEST(YogaTest, row_gap_align_items_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1891,6 +1931,8 @@ TEST(YogaTest, row_gap_align_items_end) { TEST(YogaTest, row_gap_column_child_margins) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -1971,6 +2013,8 @@ TEST(YogaTest, row_gap_column_child_margins) { TEST(YogaTest, row_gap_row_wrap_child_margins) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -2047,6 +2091,8 @@ TEST(YogaTest, row_gap_row_wrap_child_margins) { TEST(YogaTest, row_gap_determines_parent_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); diff --git a/tests/generated/YGJustifyContentTest.cpp b/tests/generated/YGJustifyContentTest.cpp index 67d8ebd6..17064063 100644 --- a/tests/generated/YGJustifyContentTest.cpp +++ b/tests/generated/YGJustifyContentTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, justify_content_row_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -81,6 +83,8 @@ TEST(YogaTest, justify_content_row_flex_start) { TEST(YogaTest, justify_content_row_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -150,6 +154,8 @@ TEST(YogaTest, justify_content_row_flex_end) { TEST(YogaTest, justify_content_row_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -219,6 +225,8 @@ TEST(YogaTest, justify_content_row_center) { TEST(YogaTest, justify_content_row_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -288,6 +296,8 @@ TEST(YogaTest, justify_content_row_space_between) { TEST(YogaTest, justify_content_row_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -357,6 +367,8 @@ TEST(YogaTest, justify_content_row_space_around) { TEST(YogaTest, justify_content_column_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 102); @@ -424,6 +436,8 @@ TEST(YogaTest, justify_content_column_flex_start) { TEST(YogaTest, justify_content_column_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); @@ -492,6 +506,8 @@ TEST(YogaTest, justify_content_column_flex_end) { TEST(YogaTest, justify_content_column_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -560,6 +576,8 @@ TEST(YogaTest, justify_content_column_center) { TEST(YogaTest, justify_content_column_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifySpaceBetween); @@ -628,6 +646,8 @@ TEST(YogaTest, justify_content_column_space_between) { TEST(YogaTest, justify_content_column_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifySpaceAround); @@ -696,6 +716,8 @@ TEST(YogaTest, justify_content_column_space_around) { TEST(YogaTest, justify_content_row_min_width_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -738,6 +760,8 @@ TEST(YogaTest, justify_content_row_min_width_and_margin) { TEST(YogaTest, justify_content_row_max_width_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -781,6 +805,8 @@ TEST(YogaTest, justify_content_row_max_width_and_margin) { TEST(YogaTest, justify_content_column_min_height_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -822,6 +848,8 @@ TEST(YogaTest, justify_content_column_min_height_and_margin) { TEST(YogaTest, justify_content_colunn_max_height_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -864,6 +892,8 @@ TEST(YogaTest, justify_content_colunn_max_height_and_margin) { TEST(YogaTest, justify_content_column_space_evenly) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifySpaceEvenly); @@ -932,6 +962,8 @@ TEST(YogaTest, justify_content_column_space_evenly) { TEST(YogaTest, justify_content_row_space_evenly) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1001,6 +1033,8 @@ TEST(YogaTest, justify_content_row_space_evenly) { TEST(YogaTest, justify_content_min_width_with_padding_child_width_greater_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); @@ -1078,6 +1112,8 @@ TEST(YogaTest, justify_content_min_width_with_padding_child_width_greater_than_p TEST(YogaTest, justify_content_min_width_with_padding_child_width_lower_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); diff --git a/tests/generated/YGMarginTest.cpp b/tests/generated/YGMarginTest.cpp index 515baa13..e16dcd0d 100644 --- a/tests/generated/YGMarginTest.cpp +++ b/tests/generated/YGMarginTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, margin_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -54,6 +56,8 @@ TEST(YogaTest, margin_start) { TEST(YogaTest, margin_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -94,6 +98,8 @@ TEST(YogaTest, margin_top) { TEST(YogaTest, margin_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -136,6 +142,8 @@ TEST(YogaTest, margin_end) { TEST(YogaTest, margin_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); @@ -177,6 +185,8 @@ TEST(YogaTest, margin_bottom) { TEST(YogaTest, margin_and_flex_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -219,6 +229,8 @@ TEST(YogaTest, margin_and_flex_row) { TEST(YogaTest, margin_and_flex_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -260,6 +272,8 @@ TEST(YogaTest, margin_and_flex_column) { TEST(YogaTest, margin_and_stretch_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -302,6 +316,8 @@ TEST(YogaTest, margin_and_stretch_row) { TEST(YogaTest, margin_and_stretch_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -343,6 +359,8 @@ TEST(YogaTest, margin_and_stretch_column) { TEST(YogaTest, margin_with_sibling_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -398,6 +416,8 @@ TEST(YogaTest, margin_with_sibling_row) { TEST(YogaTest, margin_with_sibling_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -452,6 +472,8 @@ TEST(YogaTest, margin_with_sibling_column) { TEST(YogaTest, margin_auto_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -509,6 +531,8 @@ TEST(YogaTest, margin_auto_bottom) { TEST(YogaTest, margin_auto_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -566,6 +590,8 @@ TEST(YogaTest, margin_auto_top) { TEST(YogaTest, margin_auto_bottom_and_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -624,6 +650,8 @@ TEST(YogaTest, margin_auto_bottom_and_top) { TEST(YogaTest, margin_auto_bottom_and_top_justify_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -682,6 +710,8 @@ TEST(YogaTest, margin_auto_bottom_and_top_justify_center) { TEST(YogaTest, margin_auto_mutiple_children_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -755,6 +785,8 @@ TEST(YogaTest, margin_auto_mutiple_children_column) { TEST(YogaTest, margin_auto_mutiple_children_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -829,6 +861,8 @@ TEST(YogaTest, margin_auto_mutiple_children_row) { TEST(YogaTest, margin_auto_left_and_right_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -888,6 +922,8 @@ TEST(YogaTest, margin_auto_left_and_right_column) { TEST(YogaTest, margin_auto_left_and_right) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -945,6 +981,8 @@ TEST(YogaTest, margin_auto_left_and_right) { TEST(YogaTest, margin_auto_start_and_end_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1004,6 +1042,8 @@ TEST(YogaTest, margin_auto_start_and_end_column) { TEST(YogaTest, margin_auto_start_and_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -1061,6 +1101,8 @@ TEST(YogaTest, margin_auto_start_and_end) { TEST(YogaTest, margin_auto_left_and_right_column_and_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1119,6 +1161,8 @@ TEST(YogaTest, margin_auto_left_and_right_column_and_center) { TEST(YogaTest, margin_auto_left) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1176,6 +1220,8 @@ TEST(YogaTest, margin_auto_left) { TEST(YogaTest, margin_auto_right) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1233,6 +1279,8 @@ TEST(YogaTest, margin_auto_right) { TEST(YogaTest, margin_auto_left_and_right_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1291,6 +1339,8 @@ TEST(YogaTest, margin_auto_left_and_right_stretch) { TEST(YogaTest, margin_auto_top_and_bottom_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -1348,6 +1398,8 @@ TEST(YogaTest, margin_auto_top_and_bottom_stretch) { TEST(YogaTest, margin_should_not_be_part_of_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 250); @@ -1390,6 +1442,8 @@ TEST(YogaTest, margin_should_not_be_part_of_max_height) { TEST(YogaTest, margin_should_not_be_part_of_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 250); @@ -1432,6 +1486,8 @@ TEST(YogaTest, margin_should_not_be_part_of_max_width) { TEST(YogaTest, margin_auto_left_right_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1475,6 +1531,8 @@ TEST(YogaTest, margin_auto_left_right_child_bigger_than_parent) { TEST(YogaTest, margin_auto_left_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1517,6 +1575,8 @@ TEST(YogaTest, margin_auto_left_child_bigger_than_parent) { TEST(YogaTest, margin_fix_left_auto_right_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1560,6 +1620,8 @@ TEST(YogaTest, margin_fix_left_auto_right_child_bigger_than_parent) { TEST(YogaTest, margin_auto_left_fix_right_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1603,6 +1665,8 @@ TEST(YogaTest, margin_auto_left_fix_right_child_bigger_than_parent) { TEST(YogaTest, margin_auto_top_stretching_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1661,6 +1725,8 @@ TEST(YogaTest, margin_auto_top_stretching_child) { TEST(YogaTest, margin_auto_left_stretching_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); diff --git a/tests/generated/YGMinMaxDimensionTest.cpp b/tests/generated/YGMinMaxDimensionTest.cpp index f6ac495e..6c5652a4 100644 --- a/tests/generated/YGMinMaxDimensionTest.cpp +++ b/tests/generated/YGMinMaxDimensionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -53,6 +55,8 @@ TEST(YogaTest, max_width) { TEST(YogaTest, max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -94,6 +98,8 @@ TEST(YogaTest, max_height) { TEST(YogaTest, justify_content_min_max) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -136,6 +142,8 @@ TEST(YogaTest, justify_content_min_max) { TEST(YogaTest, align_items_min_max) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -178,6 +186,8 @@ TEST(YogaTest, align_items_min_max) { TEST(YogaTest, justify_content_overflow_min_max) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -249,6 +259,8 @@ TEST(YogaTest, justify_content_overflow_min_max) { TEST(YogaTest, flex_grow_to_min) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -304,6 +316,8 @@ TEST(YogaTest, flex_grow_to_min) { TEST(YogaTest, flex_grow_in_at_most_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -360,6 +374,8 @@ TEST(YogaTest, flex_grow_in_at_most_container) { TEST(YogaTest, flex_grow_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -400,6 +416,8 @@ TEST(YogaTest, flex_grow_child) { TEST(YogaTest, flex_grow_within_constrained_min_max_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMinHeight(root, 100); @@ -453,6 +471,8 @@ TEST(YogaTest, flex_grow_within_constrained_min_max_column) { TEST(YogaTest, flex_grow_within_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -508,6 +528,8 @@ TEST(YogaTest, flex_grow_within_max_width) { TEST(YogaTest, flex_grow_within_constrained_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -563,6 +585,8 @@ TEST(YogaTest, flex_grow_within_constrained_max_width) { TEST(YogaTest, flex_root_ignored) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexGrow(root, 1); @@ -619,6 +643,8 @@ TEST(YogaTest, flex_root_ignored) { TEST(YogaTest, flex_grow_root_minimized) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -690,6 +716,8 @@ TEST(YogaTest, flex_grow_root_minimized) { TEST(YogaTest, flex_grow_height_maximized) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -760,6 +788,8 @@ TEST(YogaTest, flex_grow_height_maximized) { TEST(YogaTest, flex_grow_within_constrained_min_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -814,6 +844,8 @@ TEST(YogaTest, flex_grow_within_constrained_min_row) { TEST(YogaTest, flex_grow_within_constrained_min_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMinHeight(root, 100); @@ -866,6 +898,8 @@ TEST(YogaTest, flex_grow_within_constrained_min_column) { TEST(YogaTest, flex_grow_within_constrained_max_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -935,6 +969,8 @@ TEST(YogaTest, flex_grow_within_constrained_max_row) { TEST(YogaTest, flex_grow_within_constrained_max_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -989,6 +1025,8 @@ TEST(YogaTest, flex_grow_within_constrained_max_column) { TEST(YogaTest, child_min_max_width_flexing) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1047,6 +1085,8 @@ TEST(YogaTest, child_min_max_width_flexing) { TEST(YogaTest, min_width_overrides_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 50); @@ -1072,6 +1112,8 @@ TEST(YogaTest, min_width_overrides_width) { TEST(YogaTest, max_width_overrides_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -1097,6 +1139,8 @@ TEST(YogaTest, max_width_overrides_width) { TEST(YogaTest, min_height_overrides_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 50); @@ -1122,6 +1166,8 @@ TEST(YogaTest, min_height_overrides_height) { TEST(YogaTest, max_height_overrides_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 200); @@ -1147,6 +1193,8 @@ TEST(YogaTest, max_height_overrides_height) { TEST(YogaTest, min_max_percent_no_width_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); diff --git a/tests/generated/YGPaddingTest.cpp b/tests/generated/YGPaddingTest.cpp index a955cf46..bf8d7f15 100644 --- a/tests/generated/YGPaddingTest.cpp +++ b/tests/generated/YGPaddingTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, padding_no_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -40,6 +42,8 @@ TEST(YogaTest, padding_no_size) { TEST(YogaTest, padding_container_match_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -82,6 +86,8 @@ TEST(YogaTest, padding_container_match_child) { TEST(YogaTest, padding_flex_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -126,6 +132,8 @@ TEST(YogaTest, padding_flex_child) { TEST(YogaTest, padding_stretch_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -169,6 +177,8 @@ TEST(YogaTest, padding_stretch_child) { TEST(YogaTest, padding_center_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -214,6 +224,8 @@ TEST(YogaTest, padding_center_child) { TEST(YogaTest, child_with_padding_align_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); diff --git a/tests/generated/YGPercentageTest.cpp b/tests/generated/YGPercentageTest.cpp index 5bca4eb4..9e4a7af3 100644 --- a/tests/generated/YGPercentageTest.cpp +++ b/tests/generated/YGPercentageTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, percentage_width_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -54,6 +56,8 @@ TEST(YogaTest, percentage_width_height) { TEST(YogaTest, percentage_position_left_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -97,6 +101,8 @@ TEST(YogaTest, percentage_position_left_top) { TEST(YogaTest, percentage_position_bottom_right) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -140,6 +146,8 @@ TEST(YogaTest, percentage_position_bottom_right) { TEST(YogaTest, percentage_flex_basis) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -196,6 +204,8 @@ TEST(YogaTest, percentage_flex_basis) { TEST(YogaTest, percentage_flex_basis_cross) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -251,6 +261,8 @@ TEST(YogaTest, percentage_flex_basis_cross) { TEST(YogaTest, percentage_flex_basis_main_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -309,6 +321,8 @@ TEST(YogaTest, percentage_flex_basis_main_max_height) { TEST(YogaTest, percentage_flex_basis_cross_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -366,6 +380,8 @@ TEST(YogaTest, percentage_flex_basis_cross_max_height) { TEST(YogaTest, percentage_flex_basis_main_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -424,6 +440,8 @@ TEST(YogaTest, percentage_flex_basis_main_max_width) { TEST(YogaTest, percentage_flex_basis_cross_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -481,6 +499,8 @@ TEST(YogaTest, percentage_flex_basis_cross_max_width) { TEST(YogaTest, percentage_flex_basis_main_min_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -539,6 +559,8 @@ TEST(YogaTest, percentage_flex_basis_main_min_width) { TEST(YogaTest, percentage_flex_basis_cross_min_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -596,6 +618,8 @@ TEST(YogaTest, percentage_flex_basis_cross_min_width) { TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_values) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -705,6 +729,8 @@ TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_val TEST(YogaTest, percentage_margin_should_calculate_based_only_on_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -763,6 +789,8 @@ TEST(YogaTest, percentage_margin_should_calculate_based_only_on_width) { TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -821,6 +849,8 @@ TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) { TEST(YogaTest, percentage_absolute_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -864,6 +894,8 @@ TEST(YogaTest, percentage_absolute_position) { TEST(YogaTest, percentage_width_height_undefined_parent_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); @@ -902,6 +934,8 @@ TEST(YogaTest, percentage_width_height_undefined_parent_size) { TEST(YogaTest, percent_within_flex_grow) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -984,6 +1018,8 @@ TEST(YogaTest, percent_within_flex_grow) { TEST(YogaTest, percentage_container_in_wrapping_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1070,6 +1106,8 @@ TEST(YogaTest, percentage_container_in_wrapping_container) { TEST(YogaTest, percent_absolute_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 60); diff --git a/tests/generated/YGRoundingTest.cpp b/tests/generated/YGRoundingTest.cpp index 70968202..3df23f72 100644 --- a/tests/generated/YGRoundingTest.cpp +++ b/tests/generated/YGRoundingTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_width_of_100) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -81,6 +83,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_width_of_100) { TEST(YogaTest, rounding_flex_basis_flex_grow_row_prime_number_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -177,6 +181,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_prime_number_width) { TEST(YogaTest, rounding_flex_basis_flex_shrink_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -246,6 +252,8 @@ TEST(YogaTest, rounding_flex_basis_flex_shrink_row) { TEST(YogaTest, rounding_flex_basis_overrides_main_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -317,6 +325,8 @@ TEST(YogaTest, rounding_flex_basis_overrides_main_size) { TEST(YogaTest, rounding_total_fractial) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 87.4f); @@ -388,6 +398,8 @@ TEST(YogaTest, rounding_total_fractial) { TEST(YogaTest, rounding_total_fractial_nested) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 87.4f); @@ -493,6 +505,8 @@ TEST(YogaTest, rounding_total_fractial_nested) { TEST(YogaTest, rounding_fractial_input_1) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -564,6 +578,8 @@ TEST(YogaTest, rounding_fractial_input_1) { TEST(YogaTest, rounding_fractial_input_2) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -635,6 +651,8 @@ TEST(YogaTest, rounding_fractial_input_2) { TEST(YogaTest, rounding_fractial_input_3) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeTop, 0.3f); @@ -707,6 +725,8 @@ TEST(YogaTest, rounding_fractial_input_3) { TEST(YogaTest, rounding_fractial_input_4) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeTop, 0.7f); @@ -779,6 +799,8 @@ TEST(YogaTest, rounding_fractial_input_4) { TEST(YogaTest, rounding_inner_node_controversy_horizontal) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -864,6 +886,8 @@ TEST(YogaTest, rounding_inner_node_controversy_horizontal) { TEST(YogaTest, rounding_inner_node_controversy_vertical) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 320); @@ -948,6 +972,8 @@ TEST(YogaTest, rounding_inner_node_controversy_vertical) { TEST(YogaTest, rounding_inner_node_controversy_combined) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); diff --git a/tests/generated/YGSizeOverflowTest.cpp b/tests/generated/YGSizeOverflowTest.cpp index 30d9fc0e..d365539f 100644 --- a/tests/generated/YGSizeOverflowTest.cpp +++ b/tests/generated/YGSizeOverflowTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, nested_overflowing_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -66,6 +68,8 @@ TEST(YogaTest, nested_overflowing_child) { TEST(YogaTest, nested_overflowing_child_in_constraint_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -121,6 +125,8 @@ TEST(YogaTest, nested_overflowing_child_in_constraint_parent) { TEST(YogaTest, parent_wrap_child_size_overflowing_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); diff --git a/unit_tests b/unit_tests new file mode 100755 index 00000000..5cb14a9d --- /dev/null +++ b/unit_tests @@ -0,0 +1,25 @@ +#!/bin/sh +# 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. + +cd "$(dirname "$0")/tests" + +if [ "$#" -eq 0 ]; then + build_type="Debug" +else + build_type="$1" +fi + +if which ninja; then + set -e + cmake -B build -S . -D CMAKE_BUILD_TYPE="$build_type" -G Ninja +else + set -e + cmake -B build -S . -D CMAKE_BUILD_TYPE="$build_type" +fi + +cmake --build build + +./build/yogatests diff --git a/unit_tests.bat b/unit_tests.bat new file mode 100755 index 00000000..e20a3e48 --- /dev/null +++ b/unit_tests.bat @@ -0,0 +1,28 @@ +@REM Copyright (c) Meta Platforms, Inc. and affiliates. +@REM +@REM This source code is licensed under the MIT license found in the +@REM LICENSE file in the root directory of this source tree. + +@echo off +SETLOCAL + +cd "%0\..\tests" + +if "%1" == "" ( + set build_type="Debug" +) else ( + set build_type="%1" +) + +where ninja +if errorlevel 1 ( + cmake -B build -S . -D CMAKE_BUILD_TYPE="%build_type%" +) else ( + cmake -B build -S . -D CMAKE_BUILD_TYPE="%build_type%" -G Ninja +) +if %errorlevel% neq 0 exit /b %errorlevel% + +cmake --build build +if %errorlevel% neq 0 exit /b %errorlevel% + +.\build\yogatests.exe diff --git a/website/contents/contributing/opening-a-pull-request.md b/website/contents/contributing/opening-a-pull-request.md index faa5b8d5..4b1d2840 100644 --- a/website/contents/contributing/opening-a-pull-request.md +++ b/website/contents/contributing/opening-a-pull-request.md @@ -47,7 +47,6 @@ made your change see the [testing documentation](/contributing/testing) for more |-- java | |-- com/facebook/yoga # Java binding code | |-- jni # JNI binding code -|-- yogacore # Android bindings without View support |-- android # Android View bindings |-- YogaKit # iOS UIView bindings |-- javascript # emscripten / javascript bindings diff --git a/yoga/CMakeLists.txt b/yoga/CMakeLists.txt new file mode 100644 index 00000000..e51f3679 --- /dev/null +++ b/yoga/CMakeLists.txt @@ -0,0 +1,41 @@ +# 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) +project(yogacore) +set(CMAKE_VERBOSE_MAKEFILE on) + +if(TARGET yogacore) + return() +endif() + +include(CheckIPOSupported) + +set(YOGA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) +include(${YOGA_ROOT}/cmake/project-defaults.cmake) + + +file(GLOB SOURCES CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp) + +add_library(yogacore STATIC ${SOURCES}) + +# Yoga conditionally uses when building for Android +if (ANDROID) + target_link_libraries(yogacore log) +endif() + +check_ipo_supported(RESULT result) +if(result) + set_target_properties(yogacore PROPERTIES + CMAKE_INTERPROCEDURAL_OPTIMIZATION true) +endif() + +target_include_directories(yogacore + PUBLIC + $ + $) diff --git a/yoga/YGEnums.cpp b/yoga/YGEnums.cpp index 3c3c0929..acb1bd07 100644 --- a/yoga/YGEnums.cpp +++ b/yoga/YGEnums.cpp @@ -91,6 +91,10 @@ const char* YGExperimentalFeatureToString(const YGExperimentalFeature value) { switch (value) { case YGExperimentalFeatureWebFlexBasis: return "web-flex-basis"; + case YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge: + return "absolute-percentage-against-padding-edge"; + case YGExperimentalFeatureFixAbsoluteTrailingColumnMargin: + return "fix-absolute-trailing-column-margin"; } return "unknown"; } diff --git a/yoga/YGEnums.h b/yoga/YGEnums.h index 8e4bb4ef..834e5f66 100644 --- a/yoga/YGEnums.h +++ b/yoga/YGEnums.h @@ -56,7 +56,9 @@ YG_ENUM_SEQ_DECL( YG_ENUM_SEQ_DECL( YGExperimentalFeature, - YGExperimentalFeatureWebFlexBasis) + YGExperimentalFeatureWebFlexBasis, + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, + YGExperimentalFeatureFixAbsoluteTrailingColumnMargin) YG_ENUM_SEQ_DECL( YGFlexDirection, diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index a66adec1..dc04b72f 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -1595,13 +1595,21 @@ static void YGNodeAbsoluteLayoutChild( depth, generationCount); + auto trailingMarginOuterSize = + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureFixAbsoluteTrailingColumnMargin) + ? isMainAxisRow ? height : width + : width; + if (child->isTrailingPosDefined(mainAxis) && !child->isLeadingPositionDefined(mainAxis)) { child->setLayoutPosition( node->getLayout().measuredDimensions[dim[mainAxis]] - child->getLayout().measuredDimensions[dim[mainAxis]] - node->getTrailingBorder(mainAxis) - - child->getTrailingMargin(mainAxis, width).unwrap() - + child->getTrailingMargin(mainAxis, trailingMarginOuterSize) + .unwrap() - child->getTrailingPosition(mainAxis, isMainAxisRow ? width : height) .unwrap(), leading[mainAxis]); @@ -1620,6 +1628,22 @@ static void YGNodeAbsoluteLayoutChild( (node->getLayout().measuredDimensions[dim[mainAxis]] - child->getLayout().measuredDimensions[dim[mainAxis]]), leading[mainAxis]); + } else if ( + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) && + child->isLeadingPositionDefined(mainAxis)) { + child->setLayoutPosition( + child->getLeadingPosition( + mainAxis, node->getLayout().measuredDimensions[dim[mainAxis]]) + .unwrap() + + node->getLeadingBorder(mainAxis) + + child + ->getLeadingMargin( + mainAxis, + node->getLayout().measuredDimensions[dim[mainAxis]]) + .unwrap(), + leading[mainAxis]); } if (child->isTrailingPosDefined(crossAxis) && @@ -1628,7 +1652,8 @@ static void YGNodeAbsoluteLayoutChild( node->getLayout().measuredDimensions[dim[crossAxis]] - child->getLayout().measuredDimensions[dim[crossAxis]] - node->getTrailingBorder(crossAxis) - - child->getTrailingMargin(crossAxis, width).unwrap() - + child->getTrailingMargin(crossAxis, trailingMarginOuterSize) + .unwrap() - child ->getTrailingPosition(crossAxis, isMainAxisRow ? height : width) .unwrap(), @@ -1650,6 +1675,23 @@ static void YGNodeAbsoluteLayoutChild( (node->getLayout().measuredDimensions[dim[crossAxis]] - child->getLayout().measuredDimensions[dim[crossAxis]]), leading[crossAxis]); + } else if ( + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) && + child->isLeadingPositionDefined(crossAxis)) { + child->setLayoutPosition( + child->getLeadingPosition( + crossAxis, + node->getLayout().measuredDimensions[dim[crossAxis]]) + .unwrap() + + node->getLeadingBorder(crossAxis) + + child + ->getLeadingMargin( + crossAxis, + node->getLayout().measuredDimensions[dim[crossAxis]]) + .unwrap(), + leading[crossAxis]); } } @@ -3569,9 +3611,17 @@ static void YGNodelayoutImpl( YGNodeAbsoluteLayoutChild( node, child, - availableInnerWidth, + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) + ? node->getLayout().measuredDimensions[YGDimensionWidth] + : availableInnerWidth, isMainAxisRow ? measureModeMainDim : measureModeCrossDim, - availableInnerHeight, + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) + ? node->getLayout().measuredDimensions[YGDimensionHeight] + : availableInnerHeight, direction, config, layoutMarkerData, diff --git a/yoga/event/event.h b/yoga/event/event.h index a50f8e43..fb81b8fa 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -89,12 +89,7 @@ struct YOGA_EXPORT Event { template static void publish(const YGNode& node, const TypedData& eventData = {}) { -#ifdef YG_ENABLE_EVENTS publish(node, E, Data{eventData}); -#else - (void) node; - (void) eventData; -#endif } template diff --git a/yogacore/build.gradle b/yogacore/build.gradle deleted file mode 100644 index e7ae988f..00000000 --- a/yogacore/build.gradle +++ /dev/null @@ -1,24 +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. - */ - -apply plugin: 'com.android.library' - -android { - compileSdkVersion rootProject.compileSdkVersion - buildToolsVersion rootProject.buildToolsVersion - - defaultConfig { - minSdkVersion rootProject.minSdkVersion - targetSdkVersion rootProject.targetSdkVersion - } - - externalNativeBuild { - cmake { - path '../CMakeLists.txt' - } - } -} diff --git a/yogacore/src/main/AndroidManifest.xml b/yogacore/src/main/AndroidManifest.xml deleted file mode 100644 index 5c16a3c3..00000000 --- a/yogacore/src/main/AndroidManifest.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -