Compare commits
162 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
dc2581f229 | ||
|
f16fee8c2e | ||
|
89fc160151 | ||
|
d1246f6f0d | ||
|
93bea17635 | ||
|
c582f7caa6 | ||
|
bf1cbd29c0 | ||
|
499a825836 | ||
|
8087edaafe | ||
|
c90aecbdfe | ||
|
c54215fd77 | ||
|
cf50bc9adf | ||
|
d1037226c0 | ||
|
714d4b2ebe | ||
|
d4b5220e6c | ||
|
da5ba7f7c6 | ||
|
8bf7a34d02 | ||
|
82671c0132 | ||
|
9f2a9476e5 | ||
|
c7c85621fc | ||
|
73980a3cf8 | ||
|
4b5ca50117 | ||
|
30291398f3 | ||
|
27d632c697 | ||
|
117fa494f7 | ||
|
073c136117 | ||
|
1232761571 | ||
|
c935fd5e10 | ||
|
624325302c | ||
|
37a94a86de | ||
|
4abc1a7d5f | ||
|
51e6095005 | ||
|
79cef614ce | ||
|
6455a848a7 | ||
|
1b7d2c8d48 | ||
|
3aa594c1f9 | ||
|
c2ae39167e | ||
|
49ee855f99 | ||
|
b12e0a2a15 | ||
|
9591210a7a | ||
|
91997d6cd3 | ||
|
909e4bea6e | ||
|
13f4adbbcd | ||
|
ae2d06d0f5 | ||
|
5478812db3 | ||
|
050ac8a413 | ||
|
733ba24064 | ||
|
e177477144 | ||
|
76ffdbc25d | ||
|
f99e657acd | ||
|
a9246bc7db | ||
|
be72b8e8aa | ||
|
b876f596d9 | ||
|
be00354b71 | ||
|
0c995496c8 | ||
|
c12e732fab | ||
|
0b25796676 | ||
|
262f868ce0 | ||
|
77c9987012 | ||
|
26b21ae23c | ||
|
5b962c0801 | ||
|
8f69ac776e | ||
|
867bfae3a3 | ||
|
488288e291 | ||
|
f52ec78584 | ||
|
6fed4dfe30 | ||
|
8dc2fa52c1 | ||
|
e696b8c456 | ||
|
68bb2343d2 | ||
|
568718242d | ||
|
43be5888c4 | ||
|
2437d26ca5 | ||
|
820a4d5bf6 | ||
|
ef9ae63268 | ||
|
e69fcb26bb | ||
|
990ec920ad | ||
|
3351e8eb45 | ||
|
84312c54a4 | ||
|
dc1f0a68f9 | ||
|
bc236947d0 | ||
|
671ae61a39 | ||
|
bc5098fc80 | ||
|
b02caa8e06 | ||
|
22b018c957 | ||
|
c722caa6b2 | ||
|
8277df7e1f | ||
|
43d920eab0 | ||
|
6212e561ad | ||
|
a112a07e6a | ||
|
dc4ab5ad57 | ||
|
6d6f69bee7 | ||
|
596f8dff3c | ||
|
ae8ede9b53 | ||
|
5009f5c1ac | ||
|
e4fe14ab3e | ||
|
a1e9abb9b3 | ||
|
b9e335ebfd | ||
|
1a3bc6bfbc | ||
|
0888b20098 | ||
|
53e4421178 | ||
|
db383714d3 | ||
|
7970b972e5 | ||
|
1f7faf4c61 | ||
|
baf670e261 | ||
|
289b62732b | ||
|
72b7e5b5cf | ||
|
fb53cb7443 | ||
|
24f0c56cce | ||
|
eb1ca8ec7a | ||
|
dc23284cf7 | ||
|
932361cdbf | ||
|
c0239e338f | ||
|
cd4a1b8cf6 | ||
|
d4247d65c0 | ||
|
617fd3a6b7 | ||
|
70de2da05f | ||
|
bbdd1afe59 | ||
|
194f83dea5 | ||
|
6f10656868 | ||
|
f12d436314 | ||
|
5cbc7b4f1c | ||
|
9dcd8ba9dc | ||
|
6ef7be293a | ||
|
c54e0e7fed | ||
|
3c7ac064ad | ||
|
522a2bfbef | ||
|
4d3f323fa5 | ||
|
206b95aba5 | ||
|
108c2f30a2 | ||
|
d7faf2c101 | ||
|
dfedfacd27 | ||
|
cafffebbe3 | ||
|
281563501f | ||
|
20e05881a8 | ||
|
609a9a7a30 | ||
|
1db7a3ff61 | ||
|
f4facf8990 | ||
|
d1c6b9af78 | ||
|
066e366246 | ||
|
a0a09b4570 | ||
|
25f94f8bfb | ||
|
389e715257 | ||
|
35fb3b2c49 | ||
|
bb9d080d04 | ||
|
be59f394c4 | ||
|
6205338c34 | ||
|
b4b6d3a43d | ||
|
bd3e3edc75 | ||
|
aed6f015bf | ||
|
654a7753df | ||
|
7d537eff41 | ||
|
8a6c092693 | ||
|
543f36d5b4 | ||
|
d591885e29 | ||
|
0d23e07202 | ||
|
cc2a87d4f9 | ||
|
367643faa5 | ||
|
a5c49ebd7b | ||
|
363016eb5c | ||
|
b959c79a2a | ||
|
47a56db5f6 | ||
|
c278713eb5 |
217
.clang-tidy
Normal file
217
.clang-tidy
Normal file
@@ -0,0 +1,217 @@
|
||||
---
|
||||
InheritParentConfig: true
|
||||
Checks: '>
|
||||
bugprone-argument-comment,
|
||||
bugprone-assert-side-effect,
|
||||
bugprone-bool-pointer-implicit-conversion,
|
||||
bugprone-copy-constructor-init,
|
||||
bugprone-dangling-handle,
|
||||
bugprone-exception-escape,
|
||||
bugprone-fold-init-type,
|
||||
bugprone-forward-declaration-namespace,
|
||||
bugprone-forwarding-reference-overload,
|
||||
bugprone-incorrect-enable-if,
|
||||
bugprone-inaccurate-erase,
|
||||
bugprone-incorrect-roundings,
|
||||
bugprone-infinite-loop,
|
||||
bugprone-integer-division,
|
||||
bugprone-macro-parentheses,
|
||||
bugprone-macro-repeated-side-effects,
|
||||
bugprone-misplaced-operator-in-strlen-in-alloc,
|
||||
bugprone-misplaced-widening-cast,
|
||||
bugprone-move-forwarding-reference,
|
||||
bugprone-multiple-statement-macro,
|
||||
bugprone-optional-value-conversion,
|
||||
bugprone-parent-virtual-call,
|
||||
bugprone-redundant-branch-condition,
|
||||
bugprone-shared-ptr-array-mismatch,
|
||||
bugprone-signed-char-misuse,
|
||||
bugprone-sizeof-container,
|
||||
bugprone-sizeof-expression,
|
||||
bugprone-string-constructor,
|
||||
bugprone-string-integer-assignment,
|
||||
bugprone-string-literal-with-embedded-nul,
|
||||
bugprone-suspicious-enum-usage,
|
||||
bugprone-suspicious-memset-usage,
|
||||
bugprone-suspicious-missing-comma,
|
||||
bugprone-suspicious-semicolon,
|
||||
bugprone-suspicious-string-compare,
|
||||
bugprone-swapped-arguments,
|
||||
bugprone-terminating-continue,
|
||||
bugprone-throw-keyword-missing,
|
||||
bugprone-too-small-loop-variable,
|
||||
bugprone-undefined-memory-manipulation,
|
||||
bugprone-undelegated-constructor,
|
||||
bugprone-unique-ptr-array-mismatch,
|
||||
bugprone-unsafe-functions,
|
||||
bugprone-unused-raii,
|
||||
bugprone-unused-return-value,
|
||||
bugprone-use-after-move,
|
||||
bugprone-virtual-near-miss,
|
||||
clang-analyzer-apiModeling.google.GTest,
|
||||
clang-analyzer-apiModeling.StdCLibraryFunctions,
|
||||
clang-analyzer-apiModeling.TrustNonnull,
|
||||
clang-analyzer-core.builtin.BuiltinFunctions,
|
||||
clang-analyzer-core.builtin.NoReturnFunctions,
|
||||
clang-analyzer-core.CallAndMessage,
|
||||
clang-analyzer-core.DivideZero,
|
||||
clang-analyzer-core.DynamicTypePropagation,
|
||||
clang-analyzer-core.NonnilStringConstants,
|
||||
clang-analyzer-core.NonNullParamChecker,
|
||||
clang-analyzer-core.NullDereference,
|
||||
clang-analyzer-core.StackAddressEscape,
|
||||
clang-analyzer-core.UndefinedBinaryOperatorResult,
|
||||
clang-analyzer-core.uninitialized.ArraySubscript,
|
||||
clang-analyzer-core.uninitialized.Assign,
|
||||
clang-analyzer-core.uninitialized.Branch,
|
||||
clang-analyzer-core.uninitialized.CapturedBlockVariable,
|
||||
clang-analyzer-core.uninitialized.UndefReturn,
|
||||
clang-analyzer-core.VLASize,
|
||||
clang-analyzer-cplusplus.InnerPointer,
|
||||
clang-analyzer-cplusplus.Move,
|
||||
clang-analyzer-cplusplus.NewDelete,
|
||||
clang-analyzer-cplusplus.NewDeleteLeaks,
|
||||
clang-analyzer-cplusplus.SelfAssignment,
|
||||
clang-analyzer-deadcode.DeadStores,
|
||||
clang-analyzer-nullability.NullableDereferenced,
|
||||
clang-analyzer-nullability.NullablePassedToNonnull,
|
||||
clang-analyzer-nullability.NullableReturnedFromNonnull,
|
||||
clang-analyzer-nullability.NullPassedToNonnull,
|
||||
clang-analyzer-nullability.NullReturnedFromNonnull,
|
||||
clang-analyzer-optin.cplusplus.VirtualCall,
|
||||
clang-analyzer-optin.mpi.MPI-Checker,
|
||||
clang-analyzer-optin.performance.GCDAntipattern,
|
||||
clang-analyzer-optin.performance.Padding,
|
||||
clang-analyzer-optin.portability.UnixAPI,
|
||||
clang-analyzer-security.FloatLoopCounter,
|
||||
clang-analyzer-security.insecureAPI.bcmp,
|
||||
clang-analyzer-security.insecureAPI.bcopy,
|
||||
clang-analyzer-security.insecureAPI.bzero,
|
||||
clang-analyzer-security.insecureAPI.getpw,
|
||||
clang-analyzer-security.insecureAPI.gets,
|
||||
clang-analyzer-security.insecureAPI.mkstemp,
|
||||
clang-analyzer-security.insecureAPI.mktemp,
|
||||
clang-analyzer-security.insecureAPI.rand,
|
||||
clang-analyzer-security.insecureAPI.strcpy,
|
||||
clang-analyzer-security.insecureAPI.UncheckedReturn,
|
||||
clang-analyzer-security.insecureAPI.vfork,
|
||||
clang-analyzer-unix.API,
|
||||
clang-analyzer-unix.cstring.BadSizeArg,
|
||||
clang-analyzer-unix.cstring.NullArg,
|
||||
clang-analyzer-unix.Malloc,
|
||||
clang-analyzer-unix.MallocSizeof,
|
||||
clang-analyzer-unix.MismatchedDeallocator,
|
||||
clang-analyzer-unix.Vfork,
|
||||
clang-analyzer-valist.CopyToSelf,
|
||||
clang-analyzer-valist.Uninitialized,
|
||||
clang-analyzer-valist.Unterminated,
|
||||
clang-diagnostic-*,
|
||||
cppcoreguidelines-avoid-const-or-ref-data-members,
|
||||
cppcoreguidelines-avoid-non-const-global-variables,
|
||||
cppcoreguidelines-init-variables,
|
||||
cppcoreguidelines-interfaces-global-init,
|
||||
cppcoreguidelines-macro-usage,
|
||||
cppcoreguidelines-missing-std-forward,
|
||||
cppcoreguidelines-narrowing-conversions,
|
||||
cppcoreguidelines-no-malloc,
|
||||
cppcoreguidelines-prefer-member-initializer,
|
||||
cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||
cppcoreguidelines-pro-type-const-cast,
|
||||
cppcoreguidelines-pro-type-cstyle-cast,
|
||||
cppcoreguidelines-pro-type-member-init,
|
||||
cppcoreguidelines-pro-type-reinterpret-cast,
|
||||
cppcoreguidelines-pro-type-union-access,
|
||||
cppcoreguidelines-pro-type-vararg,
|
||||
cppcoreguidelines-slicing,
|
||||
cppcoreguidelines-special-member-functions,
|
||||
facebook-hte-BadEnum,
|
||||
facebook-hte-MissingStatic,
|
||||
google-build-using-namespace,
|
||||
misc-definitions-in-headers,
|
||||
misc-header-include-cycle,
|
||||
misc-misplaced-const,
|
||||
misc-new-delete-overloads,
|
||||
misc-non-copyable-objects,
|
||||
misc-static-assert,
|
||||
misc-throw-by-value-catch-by-reference,
|
||||
misc-unconventional-assign-operator,
|
||||
misc-uniqueptr-reset-release,
|
||||
misc-unused-alias-decls,
|
||||
misc-unused-parameters,
|
||||
misc-unused-using-decls,
|
||||
modernize-avoid-bind,
|
||||
modernize-avoid-c-arrays,
|
||||
modernize-concat-nested-namespaces,
|
||||
modernize-deprecated-headers,
|
||||
modernize-deprecated-ios-base-aliases,
|
||||
modernize-loop-convert,
|
||||
modernize-make-shared,
|
||||
modernize-make-unique,
|
||||
modernize-pass-by-value,
|
||||
modernize-raw-string-literal,
|
||||
modernize-redundant-void-arg,
|
||||
modernize-replace-auto-ptr,
|
||||
modernize-replace-random-shuffle,
|
||||
modernize-return-braced-init-list,
|
||||
modernize-shrink-to-fit,
|
||||
modernize-unary-static-assert,
|
||||
modernize-use-auto,
|
||||
modernize-use-bool-literals,
|
||||
modernize-use-constraints,
|
||||
modernize-use-default-member-init,
|
||||
modernize-use-designated-initializers,
|
||||
modernize-use-emplace,
|
||||
modernize-use-equals-default,
|
||||
modernize-use-equals-delete,
|
||||
modernize-use-noexcept,
|
||||
modernize-use-nullptr,
|
||||
modernize-use-override,
|
||||
modernize-use-starts-ends-with,
|
||||
modernize-use-transparent-functors,
|
||||
modernize-use-using,
|
||||
performance-faster-string-find,
|
||||
performance-for-range-copy,
|
||||
performance-implicit-conversion-in-loop,
|
||||
performance-inefficient-algorithm,
|
||||
performance-inefficient-string-concatenation,
|
||||
performance-inefficient-vector-operation,
|
||||
performance-move-const-arg,
|
||||
performance-move-constructor-init,
|
||||
performance-noexcept-move-constructor,
|
||||
performance-type-promotion-in-math-fn,
|
||||
performance-unnecessary-copy-initialization,
|
||||
performance-unnecessary-value-param,
|
||||
readability-avoid-const-params-in-decls,
|
||||
readability-braces-around-statements,
|
||||
readability-const-return-type,
|
||||
readability-container-size-empty,
|
||||
readability-delete-null-pointer,
|
||||
readability-deleted-default,
|
||||
readability-implicit-bool-conversion,
|
||||
readability-inconsistent-declaration-parameter-name,
|
||||
readability-isolate-declaration,
|
||||
readability-misplaced-array-index,
|
||||
readability-named-parameter,
|
||||
readability-non-const-parameter,
|
||||
readability-redundant-control-flow,
|
||||
readability-redundant-declaration,
|
||||
readability-redundant-function-ptr-dereference,
|
||||
readability-redundant-preprocessor,
|
||||
readability-redundant-smartptr-get,
|
||||
readability-redundant-string-cstr,
|
||||
readability-redundant-string-init,
|
||||
readability-simplify-boolean-expr,
|
||||
readability-simplify-subscript-expr,
|
||||
readability-static-accessed-through-instance,
|
||||
readability-static-definition-in-anonymous-namespace,
|
||||
readability-string-compare,
|
||||
readability-uniqueptr-delete-release,
|
||||
'
|
||||
|
||||
CheckOptions:
|
||||
- key: performance-unnecessary-value-param.AllowedTypes
|
||||
value: '[Pp]ointer$;[Pp]tr$;[Rr]ef(erence)?$;'
|
||||
- key: performance-unnecessary-copy-initialization.AllowedTypes
|
||||
value: '[Pp]ointer$;[Pp]tr$;[Rr]ef(erence)?$'
|
||||
|
||||
...
|
@@ -9,12 +9,7 @@
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
ignorePatterns: [
|
||||
'/website',
|
||||
'**/binaries/**',
|
||||
'**/build/**',
|
||||
'**/generated/**',
|
||||
],
|
||||
ignorePatterns: ['**/binaries/**', '**/build/**', '**/generated/**'],
|
||||
overrides: [
|
||||
// Catch-all
|
||||
{
|
||||
|
23
.github/actions/clang-format/action.yml
vendored
23
.github/actions/clang-format/action.yml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Clang Format
|
||||
inputs:
|
||||
directory:
|
||||
description: Directory to Lint
|
||||
required: true
|
||||
version:
|
||||
description: LLVM version to use # Should be kept roughly in sync with arcanist
|
||||
required: false
|
||||
default: 12
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install
|
||||
shell: bash
|
||||
run: sudo apt-get install -y clang-format-${{ inputs.version }}
|
||||
|
||||
- name: clang-format
|
||||
working-directory: ${{ inputs.directory }}
|
||||
shell: bash
|
||||
env:
|
||||
BASHOPTS: extglob:nullglob
|
||||
run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.{h,hh,hpp,c,cpp,cc,m,mm}
|
1
.github/actions/setup-cpp/action.yml
vendored
1
.github/actions/setup-cpp/action.yml
vendored
@@ -16,6 +16,7 @@ runs:
|
||||
if: ${{ inputs.toolchain == 'Clang' }}
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get install -y libc++-dev libc++abi-dev
|
||||
echo "CC=/usr/bin/clang" >> $GITHUB_ENV
|
||||
echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
|
||||
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
|
||||
|
2
.github/actions/setup-js/action.yml
vendored
2
.github/actions/setup-js/action.yml
vendored
@@ -6,7 +6,7 @@ runs:
|
||||
- name: Setup Node environment
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
node-version: 20.x
|
||||
cache: yarn
|
||||
cache-dependency-path: yarn.lock
|
||||
env:
|
||||
|
23
.github/actions/setup-website/action.yml
vendored
23
.github/actions/setup-website/action.yml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Setup Website envirionment
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# TODO: Update to latest when website is moved to the workspace version of
|
||||
# yoga-layout
|
||||
- name: Setup Node environment
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12.x
|
||||
cache: yarn
|
||||
cache-dependency-path: website/yarn.lock
|
||||
env:
|
||||
# https://github.com/actions/setup-node/issues/317
|
||||
FORCE_COLOR: 0
|
||||
|
||||
# TODO: the website should be in a yarn workspace with the library, but the
|
||||
# current version of gatsby is incompatible with hoisting.
|
||||
- name: yarn install
|
||||
shell: bash
|
||||
run: yarn install --frozen-lockfile --network-timeout 1000000
|
||||
working-directory: website
|
@@ -24,7 +24,7 @@ jobs:
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
|
||||
- name: Upload Build Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'snapshot-artifacts'
|
||||
path: '~/.m2/repository/'
|
||||
|
@@ -23,7 +23,7 @@ jobs:
|
||||
ORG_GRADLE_PROJECT_USE_SNAPSHOT: true
|
||||
|
||||
- name: Upload Build Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'snapshot-artifacts'
|
||||
path: '~/.m2/repository/'
|
||||
|
35
.github/workflows/publish-website.yml
vendored
35
.github/workflows/publish-website.yml
vendored
@@ -1,35 +0,0 @@
|
||||
name: Publish Website
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish to GitHub Pages
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup
|
||||
uses: ./.github/actions/setup-website
|
||||
|
||||
- name: yarn build
|
||||
run: yarn build
|
||||
working-directory: website
|
||||
|
||||
- uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages
|
||||
publish_dir: website/public
|
||||
cname: yogalayout.dev
|
||||
keep_files: true
|
||||
user_name: 'Yoga-bot'
|
||||
user_email: 'yogabot@fb.com'
|
10
.github/workflows/validate-cpp.yml
vendored
10
.github/workflows/validate-cpp.yml
vendored
@@ -97,13 +97,3 @@ jobs:
|
||||
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
|
||||
cmake --build build
|
||||
working-directory: capture
|
||||
|
||||
clang-format:
|
||||
name: Format
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: clang-format
|
||||
uses: ./.github/actions/clang-format
|
||||
|
2
.github/workflows/validate-js.yml
vendored
2
.github/workflows/validate-js.yml
vendored
@@ -110,7 +110,7 @@ jobs:
|
||||
run: yarn pack --filename yoga-layout.tar.gz
|
||||
working-directory: javascript
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: npm-package
|
||||
path: javascript/yoga-layout.tar.gz
|
||||
|
1
.github/workflows/validate-tests.yml
vendored
1
.github/workflows/validate-tests.yml
vendored
@@ -5,7 +5,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'release-*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
20
.github/workflows/validate-website.yml
vendored
20
.github/workflows/validate-website.yml
vendored
@@ -10,22 +10,8 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build [Gatsby]
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup
|
||||
uses: ./.github/actions/setup-website
|
||||
|
||||
- name: yarn build
|
||||
run: yarn build
|
||||
working-directory: website
|
||||
|
||||
build_next:
|
||||
name: Build [Docusaurus]
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -39,7 +25,7 @@ jobs:
|
||||
|
||||
- name: Build Website
|
||||
run: yarn build
|
||||
working-directory: website-next
|
||||
working-directory: website
|
||||
|
||||
typecheck:
|
||||
name: Typecheck [Docusaurus]
|
||||
@@ -53,4 +39,4 @@ jobs:
|
||||
|
||||
- name: yarn tsc
|
||||
run: yarn tsc
|
||||
working-directory: website-next
|
||||
working-directory: website
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -73,3 +73,6 @@ local.properties
|
||||
|
||||
# Docusarus build
|
||||
.docusaurus
|
||||
|
||||
# Android Studio
|
||||
.idea
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Yoga [](https://opensource.fb.com/support-ukraine) [](http://cocoapods.org/pods/Yoga) [](https://www.npmjs.com/package/yoga-layout) [](https://search.maven.org/artifact/com.facebook.yoga/yoga)
|
||||
# Yoga [](http://cocoapods.org/pods/Yoga) [](https://www.npmjs.com/package/yoga-layout) [](https://search.maven.org/artifact/com.facebook.yoga/yoga) 
|
||||
|
||||
Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages.
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'Yoga'
|
||||
spec.version = '3.0.1'
|
||||
spec.version = '0.0.0'
|
||||
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
||||
spec.homepage = 'https://yogalayout.dev/'
|
||||
spec.documentation_url = 'https://yogalayout.dev/docs'
|
||||
|
@@ -21,9 +21,9 @@ namespace facebook::yoga {
|
||||
using namespace nlohmann;
|
||||
using namespace std::chrono;
|
||||
|
||||
constexpr uint32_t kNumRepititions = 100;
|
||||
constexpr uint32_t kNumRepetitions = 100;
|
||||
using SteadyClockDurations =
|
||||
std::array<steady_clock::duration, kNumRepititions>;
|
||||
std::array<steady_clock::duration, kNumRepetitions>;
|
||||
|
||||
static bool inputsMatch(
|
||||
float actualWidth,
|
||||
@@ -46,6 +46,11 @@ static bool inputsMatch(
|
||||
actualHeightMode == expectedHeightMode;
|
||||
}
|
||||
|
||||
YGSize defaultMeasureFunctionResult() {
|
||||
std::cout << "Trying to measure a node that wasn't serialized" << std::endl;
|
||||
return {10.0, 10.0};
|
||||
}
|
||||
|
||||
YGSize mockMeasureFunc(
|
||||
YGNodeConstRef node,
|
||||
float availableWidth,
|
||||
@@ -53,42 +58,34 @@ YGSize mockMeasureFunc(
|
||||
float availableHeight,
|
||||
YGMeasureMode heightMode) {
|
||||
(void)node;
|
||||
MeasureFuncVecWithIndex* fns =
|
||||
static_cast<MeasureFuncVecWithIndex*>(YGNodeGetContext(node));
|
||||
auto fnsPtr = static_cast<SerializedMeasureFuncMap*>(YGNodeGetContext(node));
|
||||
|
||||
if (fns->index >= fns->vec.size()) {
|
||||
std::cout << "Extra measure function call made" << std::endl;
|
||||
return {10.0, 10.0};
|
||||
if (fnsPtr == nullptr) {
|
||||
return defaultMeasureFunctionResult();
|
||||
}
|
||||
|
||||
auto values = fns->vec.at(fns->index);
|
||||
|
||||
if (!inputsMatch(
|
||||
availableWidth,
|
||||
values.inputWidth,
|
||||
availableHeight,
|
||||
values.inputHeight,
|
||||
widthMode,
|
||||
values.widthMode,
|
||||
heightMode,
|
||||
values.heightMode)) {
|
||||
std::cout << "Measure function input mismatch." << std::endl
|
||||
<< "Expected width: " << values.inputWidth
|
||||
<< ", actual width: " << availableWidth << std::endl
|
||||
<< "Expected height: " << values.inputHeight
|
||||
<< ", actual height: " << availableHeight << std::endl
|
||||
<< "Expected width mode: " << values.widthMode
|
||||
<< ", actual width mode: " << widthMode << std::endl
|
||||
<< "Expected height mode: " << values.heightMode
|
||||
<< ", actual height mode: " << heightMode << std::endl;
|
||||
return {10.0, 10.0};
|
||||
auto fnsIt = fnsPtr->find(node);
|
||||
if (fnsIt == fnsPtr->end()) {
|
||||
return defaultMeasureFunctionResult();
|
||||
}
|
||||
|
||||
fns->index++;
|
||||
for (auto measureFunc : fnsIt->second) {
|
||||
if (inputsMatch(
|
||||
availableWidth,
|
||||
measureFunc.inputWidth,
|
||||
availableHeight,
|
||||
measureFunc.inputHeight,
|
||||
widthMode,
|
||||
measureFunc.widthMode,
|
||||
heightMode,
|
||||
measureFunc.heightMode)) {
|
||||
std::this_thread::sleep_for(
|
||||
std::chrono::nanoseconds(measureFunc.durationNs));
|
||||
return {measureFunc.outputWidth, measureFunc.outputHeight};
|
||||
}
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::nanoseconds(values.durationNs));
|
||||
|
||||
return {values.outputWidth, values.outputHeight};
|
||||
return defaultMeasureFunctionResult();
|
||||
}
|
||||
|
||||
std::shared_ptr<const YGConfig> buildConfigFromJson(const json& j) {
|
||||
@@ -116,8 +113,8 @@ std::shared_ptr<const YGConfig> buildConfigFromJson(const json& j) {
|
||||
}
|
||||
|
||||
std::string edgeStringFromPropertyName(
|
||||
std::string key,
|
||||
std::string propertyName) {
|
||||
const std::string& key,
|
||||
const std::string& propertyName) {
|
||||
return key.substr(propertyName.length() + 1);
|
||||
}
|
||||
|
||||
@@ -257,7 +254,7 @@ void setStylesFromJson(const json& j, YGNodeRef node) {
|
||||
std::shared_ptr<YGNode> buildNodeFromJson(
|
||||
const json& j,
|
||||
std::shared_ptr<const YGConfig> config,
|
||||
std::shared_ptr<MeasureFuncVecWithIndex> fns) {
|
||||
std::shared_ptr<SerializedMeasureFuncMap> fns) {
|
||||
std::shared_ptr<YGNode> node(YGNodeNewWithConfig(config.get()), YGNodeFree);
|
||||
|
||||
if (!j.contains("node") || j["node"].is_null()) {
|
||||
@@ -268,8 +265,13 @@ std::shared_ptr<YGNode> buildNodeFromJson(
|
||||
for (json::iterator it = nodeState.begin(); it != nodeState.end(); it++) {
|
||||
if (it.key() == "always-forms-containing-block") {
|
||||
YGNodeSetAlwaysFormsContainingBlock(node.get(), it.value());
|
||||
} else if (it.key() == "has-custom-measure" && it.value()) {
|
||||
YGNodeSetContext(node.get(), fns.get());
|
||||
} else if (it.key() == "measure-funcs") {
|
||||
std::vector<SerializedMeasureFunc> vec{};
|
||||
for (auto measureFuncJson : it.value()) {
|
||||
vec.push_back(serializedMeasureFuncFromJson(measureFuncJson));
|
||||
}
|
||||
fns->insert(std::make_pair(node.get(), vec));
|
||||
YGNodeSetContext(node.get(), it.value().is_null() ? nullptr : fns.get());
|
||||
YGNodeSetMeasureFunc(node.get(), mockMeasureFunc);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +281,7 @@ std::shared_ptr<YGNode> buildNodeFromJson(
|
||||
|
||||
std::shared_ptr<YogaNodeAndConfig> buildTreeFromJson(
|
||||
const json& j,
|
||||
std::shared_ptr<MeasureFuncVecWithIndex> fns,
|
||||
std::shared_ptr<SerializedMeasureFuncMap> fns,
|
||||
std::shared_ptr<YogaNodeAndConfig> parent,
|
||||
size_t index) {
|
||||
auto config = buildConfigFromJson(j);
|
||||
@@ -297,7 +299,7 @@ std::shared_ptr<YogaNodeAndConfig> buildTreeFromJson(
|
||||
if (j.contains("children")) {
|
||||
json children = j["children"];
|
||||
size_t childIndex = 0;
|
||||
for (json child : children) {
|
||||
for (const json& child : children) {
|
||||
buildTreeFromJson(child, fns, wrapper, childIndex);
|
||||
childIndex++;
|
||||
}
|
||||
@@ -307,8 +309,7 @@ std::shared_ptr<YogaNodeAndConfig> buildTreeFromJson(
|
||||
}
|
||||
|
||||
BenchmarkResult generateBenchmark(json& capture) {
|
||||
auto fns = std::make_shared<MeasureFuncVecWithIndex>();
|
||||
populateMeasureFuncVec(capture["measure-funcs"], fns);
|
||||
auto fns = std::make_shared<SerializedMeasureFuncMap>();
|
||||
|
||||
auto treeCreationBegin = steady_clock::now();
|
||||
std::shared_ptr<YogaNodeAndConfig> root =
|
||||
@@ -330,25 +331,25 @@ BenchmarkResult generateBenchmark(json& capture) {
|
||||
}
|
||||
|
||||
static void printBenchmarkResult(
|
||||
std::string name,
|
||||
const std::string& name,
|
||||
SteadyClockDurations& durations) {
|
||||
std::array<double, kNumRepititions> timesInMs;
|
||||
std::array<double, kNumRepetitions> timesInMs{};
|
||||
double mean = 0;
|
||||
for (uint32_t i = 0; i < kNumRepititions; i++) {
|
||||
for (uint32_t i = 0; i < kNumRepetitions; i++) {
|
||||
auto ms = duration<double, std::milli>(durations[i]).count();
|
||||
timesInMs[i] = ms;
|
||||
mean += ms;
|
||||
}
|
||||
mean /= kNumRepititions;
|
||||
mean /= kNumRepetitions;
|
||||
|
||||
std::sort(timesInMs.begin(), timesInMs.end());
|
||||
double median = timesInMs[kNumRepititions / 2];
|
||||
double median = timesInMs[kNumRepetitions / 2];
|
||||
|
||||
double variance = 0;
|
||||
for (uint32_t i = 0; i < kNumRepititions; i++) {
|
||||
for (uint32_t i = 0; i < kNumRepetitions; i++) {
|
||||
variance += std::pow(timesInMs[i] - mean, 2);
|
||||
}
|
||||
variance /= kNumRepititions;
|
||||
variance /= kNumRepetitions;
|
||||
double stddev = std::sqrt(variance);
|
||||
|
||||
printf("%s: median: %lf ms, stddev: %lf ms\n", name.c_str(), median, stddev);
|
||||
@@ -369,7 +370,7 @@ void benchmark(std::filesystem::path& capturesDir) {
|
||||
std::string captureName = capture.path().stem().string();
|
||||
|
||||
std::cout << "Starting benchmark for " << captureName << std::endl;
|
||||
for (uint32_t i = 0; i < kNumRepititions; i++) {
|
||||
for (uint32_t i = 0; i < kNumRepetitions; i++) {
|
||||
BenchmarkResult result = generateBenchmark(j);
|
||||
treeCreationDurations[i] = result.treeCreationDuration;
|
||||
layoutDurations[i] = result.layoutDuration;
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <yoga/Yoga.h>
|
||||
@@ -21,7 +22,9 @@ struct YogaNodeAndConfig {
|
||||
std::shared_ptr<YGNode> node,
|
||||
std::shared_ptr<const YGConfig> config,
|
||||
std::vector<std::shared_ptr<YogaNodeAndConfig>> children)
|
||||
: node_(node), config_(config), children_(children) {}
|
||||
: node_(std::move(node)),
|
||||
config_(std::move(config)),
|
||||
children_(std::move(children)) {}
|
||||
|
||||
std::shared_ptr<YGNode> node_;
|
||||
std::shared_ptr<const YGConfig> config_;
|
||||
|
@@ -21,9 +21,13 @@ static inline bool isAuto(json& j) {
|
||||
return j.is_string() && j == "auto";
|
||||
}
|
||||
|
||||
static inline bool isUndefined(json& j) {
|
||||
return j.is_string() && j == "undefined";
|
||||
}
|
||||
|
||||
static inline std::string invalidArgumentMessage(
|
||||
std::string arg,
|
||||
std::string enumName) {
|
||||
const std::string& arg,
|
||||
const std::string& enumName) {
|
||||
return arg + " does not represent any " + enumName + " values";
|
||||
}
|
||||
|
||||
@@ -36,7 +40,7 @@ static inline float floatFromJson(json& j) {
|
||||
return result;
|
||||
}
|
||||
|
||||
YGFlexDirection flexDirectionFromString(std::string str) {
|
||||
YGFlexDirection flexDirectionFromString(const std::string& str) {
|
||||
if (str == "row") {
|
||||
return YGFlexDirectionRow;
|
||||
} else if (str == "row-reverse") {
|
||||
@@ -50,7 +54,7 @@ YGFlexDirection flexDirectionFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGJustify justifyContentFromString(std::string str) {
|
||||
YGJustify justifyContentFromString(const std::string& str) {
|
||||
if (str == "flex-start") {
|
||||
return YGJustifyFlexStart;
|
||||
} else if (str == "center") {
|
||||
@@ -68,7 +72,7 @@ YGJustify justifyContentFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGAlign alignFromString(std::string str) {
|
||||
YGAlign alignFromString(const std::string& str) {
|
||||
if (str == "auto") {
|
||||
return YGAlignAuto;
|
||||
} else if (str == "flex-start") {
|
||||
@@ -92,7 +96,7 @@ YGAlign alignFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGWrap wrapFromString(std::string str) {
|
||||
YGWrap wrapFromString(const std::string& str) {
|
||||
if (str == "no-wrap") {
|
||||
return YGWrapNoWrap;
|
||||
} else if (str == "wrap") {
|
||||
@@ -104,7 +108,7 @@ YGWrap wrapFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGOverflow overflowFromString(std::string str) {
|
||||
YGOverflow overflowFromString(const std::string& str) {
|
||||
if (str == "visible") {
|
||||
return YGOverflowVisible;
|
||||
} else if (str == "hidden") {
|
||||
@@ -116,7 +120,7 @@ YGOverflow overflowFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGDisplay displayFromString(std::string str) {
|
||||
YGDisplay displayFromString(const std::string& str) {
|
||||
if (str == "flex") {
|
||||
return YGDisplayFlex;
|
||||
} else if (str == "none") {
|
||||
@@ -126,7 +130,7 @@ YGDisplay displayFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGPositionType positionTypeFromString(std::string str) {
|
||||
YGPositionType positionTypeFromString(const std::string& str) {
|
||||
if (str == "static") {
|
||||
return YGPositionTypeStatic;
|
||||
} else if (str == "relative") {
|
||||
@@ -142,6 +146,9 @@ YGUnit unitFromJson(json& j) {
|
||||
if (isAuto(j)) {
|
||||
return YGUnitAuto;
|
||||
}
|
||||
if (isUndefined(j)) {
|
||||
return YGUnitUndefined;
|
||||
}
|
||||
|
||||
std::string unit = j["unit"];
|
||||
if (unit == "px") {
|
||||
@@ -153,7 +160,7 @@ YGUnit unitFromJson(json& j) {
|
||||
}
|
||||
}
|
||||
|
||||
YGEdge edgeFromString(std::string str) {
|
||||
YGEdge edgeFromString(const std::string& str) {
|
||||
if (str == "left") {
|
||||
return YGEdgeLeft;
|
||||
} else if (str == "top") {
|
||||
@@ -177,7 +184,7 @@ YGEdge edgeFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGErrata errataFromString(std::string str) {
|
||||
YGErrata errataFromString(const std::string& str) {
|
||||
if (str == "none") {
|
||||
return YGErrataNone;
|
||||
} else if (str == "all") {
|
||||
@@ -189,7 +196,7 @@ YGErrata errataFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGExperimentalFeature experimentalFeatureFromString(std::string str) {
|
||||
YGExperimentalFeature experimentalFeatureFromString(const std::string& str) {
|
||||
if (str == "web-flex-basis") {
|
||||
return YGExperimentalFeatureWebFlexBasis;
|
||||
} else {
|
||||
@@ -199,12 +206,12 @@ YGExperimentalFeature experimentalFeatureFromString(std::string str) {
|
||||
}
|
||||
|
||||
std::string edgeStringFromPropertyName(
|
||||
json::iterator it,
|
||||
std::string propertyName) {
|
||||
const json::iterator& it,
|
||||
const std::string& propertyName) {
|
||||
return it.key().substr(propertyName.length() + 1);
|
||||
}
|
||||
|
||||
YGDirection directionFromString(std::string str) {
|
||||
YGDirection directionFromString(const std::string& str) {
|
||||
if (str == "ltr") {
|
||||
return YGDirectionLTR;
|
||||
} else if (str == "rtl") {
|
||||
@@ -216,7 +223,7 @@ YGDirection directionFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
YGMeasureMode measureModeFromString(std::string str) {
|
||||
YGMeasureMode measureModeFromString(const std::string& str) {
|
||||
if (str == "at-most") {
|
||||
return YGMeasureModeAtMost;
|
||||
} else if (str == "exactly") {
|
||||
@@ -228,18 +235,14 @@ YGMeasureMode measureModeFromString(std::string str) {
|
||||
}
|
||||
}
|
||||
|
||||
void populateMeasureFuncVec(
|
||||
json& j,
|
||||
std::shared_ptr<MeasureFuncVecWithIndex> fns) {
|
||||
for (auto measureFuncJson : j) {
|
||||
fns->vec.push_back(SerializedMeasureFunc{
|
||||
floatFromJson(measureFuncJson["width"]),
|
||||
measureModeFromString(measureFuncJson["width-mode"]),
|
||||
floatFromJson(measureFuncJson["height"]),
|
||||
measureModeFromString(measureFuncJson["height-mode"]),
|
||||
floatFromJson(measureFuncJson["output-width"]),
|
||||
floatFromJson(measureFuncJson["output-height"]),
|
||||
measureFuncJson["duration-ns"]});
|
||||
}
|
||||
SerializedMeasureFunc serializedMeasureFuncFromJson(json& j) {
|
||||
return SerializedMeasureFunc{
|
||||
floatFromJson(j["width"]),
|
||||
measureModeFromString(j["width-mode"]),
|
||||
floatFromJson(j["height"]),
|
||||
measureModeFromString(j["height-mode"]),
|
||||
floatFromJson(j["output-width"]),
|
||||
floatFromJson(j["output-height"]),
|
||||
j["duration-ns"]};
|
||||
}
|
||||
} // namespace facebook::yoga
|
||||
|
@@ -18,42 +18,35 @@ namespace facebook::yoga {
|
||||
|
||||
using namespace nlohmann;
|
||||
|
||||
struct MeasureFuncVecWithIndex {
|
||||
std::vector<SerializedMeasureFunc> vec;
|
||||
size_t index;
|
||||
};
|
||||
YGFlexDirection flexDirectionFromString(const std::string& str);
|
||||
|
||||
YGFlexDirection flexDirectionFromString(std::string str);
|
||||
YGJustify justifyContentFromString(const std::string& str);
|
||||
|
||||
YGJustify justifyContentFromString(std::string str);
|
||||
YGAlign alignFromString(const std::string& str);
|
||||
|
||||
YGAlign alignFromString(std::string str);
|
||||
YGWrap wrapFromString(const std::string& str);
|
||||
|
||||
YGWrap wrapFromString(std::string str);
|
||||
YGOverflow overflowFromString(const std::string& str);
|
||||
|
||||
YGOverflow overflowFromString(std::string str);
|
||||
YGDisplay displayFromString(const std::string& str);
|
||||
|
||||
YGDisplay displayFromString(std::string str);
|
||||
|
||||
YGPositionType positionTypeFromString(std::string str);
|
||||
YGPositionType positionTypeFromString(const std::string& str);
|
||||
|
||||
YGUnit unitFromJson(json& j);
|
||||
|
||||
YGEdge edgeFromString(std::string str);
|
||||
YGEdge edgeFromString(const std::string& str);
|
||||
|
||||
YGErrata errataFromString(std::string str);
|
||||
YGErrata errataFromString(const std::string& str);
|
||||
|
||||
YGExperimentalFeature experimentalFeatureFromString(std::string str);
|
||||
YGExperimentalFeature experimentalFeatureFromString(const std::string& str);
|
||||
|
||||
std::string edgeStringFromPropertyName(
|
||||
json::iterator it,
|
||||
std::string propertyName);
|
||||
const json::iterator& it,
|
||||
const std::string& propertyName);
|
||||
|
||||
YGDirection directionFromString(std::string str);
|
||||
YGDirection directionFromString(const std::string& str);
|
||||
|
||||
YGMeasureMode measureModeFromString(std::string str);
|
||||
YGMeasureMode measureModeFromString(const std::string& str);
|
||||
|
||||
void populateMeasureFuncVec(
|
||||
json& j,
|
||||
std::shared_ptr<MeasureFuncVecWithIndex> fns);
|
||||
SerializedMeasureFunc serializedMeasureFuncFromJson(json& j);
|
||||
} // namespace facebook::yoga
|
||||
|
@@ -7,7 +7,7 @@ cd "$(dirname "$0")" || exit
|
||||
CAPTURES_PATH="$(dirname "$(realpath "$0")")""/captures"
|
||||
|
||||
if [ "$1" = "buck" ]; then
|
||||
buck run @fbcode/mode/opt :benchmarkCXX "${CAPTURES_PATH}"
|
||||
buck run @//fbcode/mode/opt :benchmarkCXX "${CAPTURES_PATH}"
|
||||
else
|
||||
cmake -B build -S . -D CMAKE_BUILD_TYPE=Release
|
||||
cmake --build build
|
||||
|
File diff suppressed because it is too large
Load Diff
10335
benchmark/captures/feed-android.json
Normal file
10335
benchmark/captures/feed-android.json
Normal file
File diff suppressed because it is too large
Load Diff
1955
benchmark/captures/profile-ios.json
Normal file
1955
benchmark/captures/profile-ios.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,224 +4,6 @@
|
||||
"available-width": 1080.0,
|
||||
"owner-direction": "ltr"
|
||||
},
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 23667,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 330.0,
|
||||
"output-width": 408.0,
|
||||
"width": 647.3333129882813,
|
||||
"width-mode": "at-most"
|
||||
},
|
||||
{
|
||||
"duration-ns": 9083,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 448.0,
|
||||
"output-width": 562.5,
|
||||
"width": 647.3333129882813,
|
||||
"width-mode": "at-most"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7667,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 100.0,
|
||||
"output-width": 294.0,
|
||||
"width": 647.3333129882813,
|
||||
"width-mode": "at-most"
|
||||
},
|
||||
{
|
||||
"duration-ns": 8333,
|
||||
"height": 676.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 94.0,
|
||||
"output-width": 328.6666564941406,
|
||||
"width": 328.6666564941406,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7791,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 8041,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 8000,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7709,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7666,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 6916,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7167,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 9333,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7125,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7125,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7209,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7083,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7333,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7375,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 8917,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7667,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
},
|
||||
{
|
||||
"duration-ns": 8583,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 295.0,
|
||||
"output-width": 816.0,
|
||||
"width": null,
|
||||
"width-mode": "undefined"
|
||||
},
|
||||
{
|
||||
"duration-ns": 7667,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 7.0,
|
||||
"output-width": 70.5,
|
||||
"width": 1076.0,
|
||||
"width-mode": "at-most"
|
||||
},
|
||||
{
|
||||
"duration-ns": 494291,
|
||||
"height": 44.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 18.0,
|
||||
"output-width": 5.0,
|
||||
"width": 1016.0,
|
||||
"width-mode": "at-most"
|
||||
},
|
||||
{
|
||||
"duration-ns": 58250,
|
||||
"height": 44.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 18.0,
|
||||
"output-width": 10.0,
|
||||
"width": 10.0,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
],
|
||||
"tree": {
|
||||
"children": [
|
||||
{
|
||||
@@ -237,7 +19,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 8167,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 295.0,
|
||||
"output-width": 816.0,
|
||||
"width": null,
|
||||
"width-mode": "undefined"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -720,7 +512,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 24625,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 330.0,
|
||||
"output-width": 408.0,
|
||||
"width": 647.3333129882813,
|
||||
"width-mode": "at-most"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -747,7 +549,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 9625,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 448.0,
|
||||
"output-width": 562.5,
|
||||
"width": 647.3333129882813,
|
||||
"width-mode": "at-most"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -774,7 +586,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 8417,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 100.0,
|
||||
"output-width": 294.0,
|
||||
"width": 647.3333129882813,
|
||||
"width-mode": "at-most"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -815,7 +637,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 9166,
|
||||
"height": 676.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 94.0,
|
||||
"output-width": 328.6666564941406,
|
||||
"width": 328.6666564941406,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"padding-all": {
|
||||
@@ -837,7 +669,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 8250,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -880,7 +722,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 8625,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -923,7 +775,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 7250,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -966,7 +828,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6833,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1009,7 +881,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 7042,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1052,7 +934,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6208,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1095,7 +987,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6834,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1138,7 +1040,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 8500,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1181,7 +1093,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6750,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1224,7 +1146,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6667,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1267,7 +1199,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 8958,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1310,7 +1252,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 8125,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1353,7 +1305,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6541,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1396,7 +1358,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6541,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1439,7 +1411,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 6333,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1482,7 +1464,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 7875,
|
||||
"height": 566.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 21.0,
|
||||
"output-width": 158.33331298828125,
|
||||
"width": 158.33331298828125,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"margin-all": {
|
||||
@@ -1619,7 +1611,17 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 7583,
|
||||
"height": null,
|
||||
"height-mode": "undefined",
|
||||
"output-height": 7.0,
|
||||
"output-width": 70.5,
|
||||
"width": 1076.0,
|
||||
"width-mode": "at-most"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": null
|
||||
}
|
||||
@@ -1664,7 +1666,26 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": [
|
||||
{
|
||||
"duration-ns": 478791,
|
||||
"height": 44.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 18.0,
|
||||
"output-width": 5.0,
|
||||
"width": 1016.0,
|
||||
"width-mode": "at-most"
|
||||
},
|
||||
{
|
||||
"duration-ns": 61250,
|
||||
"height": 44.0,
|
||||
"height-mode": "at-most",
|
||||
"output-height": 18.0,
|
||||
"output-width": 10.0,
|
||||
"width": 10.0,
|
||||
"width-mode": "exactly"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": null
|
||||
}
|
||||
@@ -1709,7 +1730,7 @@
|
||||
"errata": "all"
|
||||
},
|
||||
"node": {
|
||||
"has-custom-measure": true
|
||||
"measure-funcs": null
|
||||
},
|
||||
"style": {
|
||||
"flex": 1.0
|
||||
|
@@ -6,9 +6,10 @@
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.library") version "8.2.1" apply false
|
||||
id("com.android.application") version "8.2.1" apply false
|
||||
id("com.android.library") version "8.7.1" apply false
|
||||
id("com.android.application") version "8.7.1" apply false
|
||||
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
|
||||
id 'org.jetbrains.kotlin.android' version '2.1.20' apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -34,6 +35,8 @@ nexusPublishing {
|
||||
sonatype {
|
||||
username.set(sonatypeUsername)
|
||||
password.set(sonatypePassword)
|
||||
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
|
||||
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -5,8 +5,8 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include <capture/CaptureTree.h>
|
||||
#include <capture/NodeToString.h>
|
||||
@@ -23,10 +23,9 @@ static void captureTree(
|
||||
file << serializedTree;
|
||||
}
|
||||
|
||||
static std::vector<SerializedMeasureFunc>& currentSerializedMeasureFuncVec() {
|
||||
static thread_local std::vector<SerializedMeasureFunc>
|
||||
currentSerializedMeasureFuncVec;
|
||||
return currentSerializedMeasureFuncVec;
|
||||
static SerializedMeasureFuncMap& currentSerializedMeasureFuncMap() {
|
||||
static thread_local SerializedMeasureFuncMap map{};
|
||||
return map;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -57,38 +56,45 @@ void YGNodeCalculateLayoutWithCapture(
|
||||
YGDirection ownerDirection,
|
||||
const std::filesystem::path& path) {
|
||||
dirtyTree(node);
|
||||
YGNodeCalculateLayout(node, availableWidth, availableHeight, ownerDirection);
|
||||
|
||||
json j;
|
||||
serializeLayoutInputs(j, availableWidth, availableHeight, ownerDirection);
|
||||
serializeTree(
|
||||
j,
|
||||
currentSerializedMeasureFuncMap(),
|
||||
node,
|
||||
PrintOptions::Style | PrintOptions::Children | PrintOptions::Config |
|
||||
PrintOptions::Node);
|
||||
|
||||
YGNodeCalculateLayout(node, availableWidth, availableHeight, ownerDirection);
|
||||
|
||||
serializeMeasureFuncResults(j, currentSerializedMeasureFuncVec());
|
||||
// TODO: It is possible to have a measure function call layout again if, e.g.,
|
||||
// views are nested in text. Need to be able to resolve this special case.
|
||||
currentSerializedMeasureFuncVec().clear();
|
||||
currentSerializedMeasureFuncMap().clear();
|
||||
captureTree(j.dump(2), path);
|
||||
}
|
||||
|
||||
void captureMeasureFunc(
|
||||
YGNodeConstRef node,
|
||||
float width,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
YGMeasureMode heightMode,
|
||||
YGSize output,
|
||||
std::chrono::steady_clock::duration durationNs) {
|
||||
currentSerializedMeasureFuncVec().push_back(SerializedMeasureFunc{
|
||||
width,
|
||||
widthMode,
|
||||
height,
|
||||
heightMode,
|
||||
output.width,
|
||||
output.height,
|
||||
durationNs.count()});
|
||||
auto measureFuncIt = currentSerializedMeasureFuncMap().find(node);
|
||||
if (measureFuncIt == currentSerializedMeasureFuncMap().end()) {
|
||||
std::vector<SerializedMeasureFunc> vec{};
|
||||
currentSerializedMeasureFuncMap().insert(std::make_pair(node, vec));
|
||||
}
|
||||
measureFuncIt = currentSerializedMeasureFuncMap().find(node);
|
||||
assert(measureFuncIt != currentSerializedMeasureFuncMap().end());
|
||||
measureFuncIt->second.push_back(
|
||||
{width,
|
||||
widthMode,
|
||||
height,
|
||||
heightMode,
|
||||
output.width,
|
||||
output.height,
|
||||
durationNs.count()});
|
||||
}
|
||||
|
||||
} // namespace facebook::yoga
|
||||
|
@@ -8,6 +8,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
@@ -20,9 +22,12 @@ struct SerializedMeasureFunc {
|
||||
YGMeasureMode heightMode{YGMeasureModeUndefined};
|
||||
float outputWidth{0.0f};
|
||||
float outputHeight{0.0f};
|
||||
std::chrono::steady_clock::duration::rep durationNs;
|
||||
std::chrono::steady_clock::duration::rep durationNs{};
|
||||
};
|
||||
|
||||
using SerializedMeasureFuncMap =
|
||||
std::unordered_map<YGNodeConstRef, std::vector<SerializedMeasureFunc>>;
|
||||
|
||||
void YGNodeCalculateLayoutWithCapture(
|
||||
YGNodeRef node,
|
||||
float availableWidth,
|
||||
@@ -31,6 +36,7 @@ void YGNodeCalculateLayoutWithCapture(
|
||||
const std::filesystem::path& path);
|
||||
|
||||
void captureMeasureFunc(
|
||||
YGNodeConstRef node,
|
||||
float width,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
|
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <capture/NodeToString.h>
|
||||
|
||||
@@ -120,7 +121,26 @@ static YGValue borderFloatToYGValue(YGNodeRef node, YGEdge edge) {
|
||||
return YGValue{val, unit};
|
||||
}
|
||||
|
||||
static void serializeTreeImpl(json& j, YGNodeRef node, PrintOptions options) {
|
||||
static void serializeMeasureFuncResults(
|
||||
json& j,
|
||||
std::vector<SerializedMeasureFunc>& measureFuncs) {
|
||||
for (auto measureFunc : measureFuncs) {
|
||||
j["measure-funcs"].push_back(
|
||||
{{"width", measureFunc.inputWidth},
|
||||
{"width-mode", YGMeasureModeToString(measureFunc.widthMode)},
|
||||
{"height", measureFunc.inputHeight},
|
||||
{"height-mode", YGMeasureModeToString(measureFunc.heightMode)},
|
||||
{"output-width", measureFunc.outputWidth},
|
||||
{"output-height", measureFunc.outputHeight},
|
||||
{"duration-ns", measureFunc.durationNs}});
|
||||
}
|
||||
}
|
||||
|
||||
static void serializeTreeImpl(
|
||||
json& j,
|
||||
SerializedMeasureFuncMap& nodesToMeasureFuncs,
|
||||
YGNodeRef node,
|
||||
PrintOptions options) {
|
||||
if ((options & PrintOptions::Layout) == PrintOptions::Layout) {
|
||||
j["layout"]["width"] = YGNodeStyleGetWidth(node).value;
|
||||
j["layout"]["height"] = YGNodeStyleGetHeight(node).value;
|
||||
@@ -205,17 +225,17 @@ static void serializeTreeImpl(json& j, YGNodeRef node, PrintOptions options) {
|
||||
appendEdges<&YGNodeStyleGetPosition>(
|
||||
j, "position", node, defaultNode.get());
|
||||
|
||||
appendFloatIfNotDefault(
|
||||
appendYGValueIfNotDefault(
|
||||
j["style"],
|
||||
"gap",
|
||||
YGNodeStyleGetGap(node, YGGutterAll),
|
||||
YGNodeStyleGetGap(defaultNode.get(), YGGutterAll));
|
||||
appendFloatIfNotDefault(
|
||||
appendYGValueIfNotDefault(
|
||||
j["style"],
|
||||
"column-gap",
|
||||
YGNodeStyleGetGap(node, YGGutterColumn),
|
||||
YGNodeStyleGetGap(defaultNode.get(), YGGutterColumn));
|
||||
appendFloatIfNotDefault(
|
||||
appendYGValueIfNotDefault(
|
||||
j["style"],
|
||||
"row-gap",
|
||||
YGNodeStyleGetGap(node, YGGutterRow),
|
||||
@@ -293,7 +313,12 @@ static void serializeTreeImpl(json& j, YGNodeRef node, PrintOptions options) {
|
||||
YGNodeGetAlwaysFormsContainingBlock(node),
|
||||
YGNodeGetAlwaysFormsContainingBlock(defaultNode.get()));
|
||||
if (YGNodeHasMeasureFunc(node)) {
|
||||
j["node"]["has-custom-measure"] = true;
|
||||
auto measureFuncIt = nodesToMeasureFuncs.find(node);
|
||||
if (measureFuncIt == nodesToMeasureFuncs.end()) {
|
||||
j["node"]["measure-funcs"];
|
||||
} else {
|
||||
serializeMeasureFuncResults(j["node"], measureFuncIt->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,13 +327,21 @@ static void serializeTreeImpl(json& j, YGNodeRef node, PrintOptions options) {
|
||||
childCount > 0) {
|
||||
for (size_t i = 0; i < childCount; i++) {
|
||||
j["children"].push_back({});
|
||||
serializeTreeImpl(j["children"][i], YGNodeGetChild(node, i), options);
|
||||
serializeTreeImpl(
|
||||
j["children"][i],
|
||||
nodesToMeasureFuncs,
|
||||
YGNodeGetChild(node, i),
|
||||
options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void serializeTree(json& j, YGNodeRef node, PrintOptions options) {
|
||||
serializeTreeImpl(j["tree"], node, options);
|
||||
void serializeTree(
|
||||
json& j,
|
||||
SerializedMeasureFuncMap& nodesToMeasureFuncs,
|
||||
YGNodeRef node,
|
||||
PrintOptions options) {
|
||||
serializeTreeImpl(j["tree"], nodesToMeasureFuncs, node, options);
|
||||
}
|
||||
|
||||
void serializeLayoutInputs(
|
||||
@@ -323,19 +356,4 @@ void serializeLayoutInputs(
|
||||
};
|
||||
}
|
||||
|
||||
void serializeMeasureFuncResults(
|
||||
json& j,
|
||||
std::vector<SerializedMeasureFunc>& measureFuncs) {
|
||||
for (auto measureFunc : measureFuncs) {
|
||||
j["measure-funcs"].push_back(
|
||||
{{"width", measureFunc.inputWidth},
|
||||
{"width-mode", YGMeasureModeToString(measureFunc.widthMode)},
|
||||
{"height", measureFunc.inputHeight},
|
||||
{"height-mode", YGMeasureModeToString(measureFunc.heightMode)},
|
||||
{"output-width", measureFunc.outputWidth},
|
||||
{"output-height", measureFunc.outputHeight},
|
||||
{"duration-ns", measureFunc.durationNs}});
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace facebook::yoga
|
||||
|
@@ -25,7 +25,11 @@ enum class PrintOptions : uint8_t {
|
||||
};
|
||||
YG_DEFINE_ENUM_FLAG_OPERATORS(PrintOptions);
|
||||
|
||||
void serializeTree(nlohmann::json& j, YGNodeRef root, PrintOptions options);
|
||||
void serializeTree(
|
||||
nlohmann::json& j,
|
||||
SerializedMeasureFuncMap& nodesToMeasureFuncs,
|
||||
YGNodeRef node,
|
||||
PrintOptions options);
|
||||
|
||||
void serializeLayoutInputs(
|
||||
nlohmann::json& j,
|
||||
@@ -33,8 +37,4 @@ void serializeLayoutInputs(
|
||||
float availableHeight,
|
||||
YGDirection ownerDirection);
|
||||
|
||||
void serializeMeasureFuncResults(
|
||||
nlohmann::json& j,
|
||||
std::vector<SerializedMeasureFunc>& measureFuncs);
|
||||
|
||||
} // namespace facebook::yoga
|
||||
|
@@ -19,8 +19,8 @@ add_compile_options(
|
||||
# Enable warnings and warnings as errors
|
||||
/W4
|
||||
/WX
|
||||
# Disable RTTI
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/GR->
|
||||
# Enable RTTI
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/GR>
|
||||
# Use /O2 (Maximize Speed)
|
||||
$<$<CONFIG:RELEASE>:/O2>)
|
||||
|
||||
@@ -34,8 +34,8 @@ add_compile_options(
|
||||
# Enable warnings and warnings as errors
|
||||
-Wall
|
||||
-Werror
|
||||
# Disable RTTI
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
|
||||
# Enable RTTI
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-frtti>
|
||||
# Use -O2 (prioritize speed)
|
||||
$<$<CONFIG:RELEASE>:-O2>
|
||||
# Enable separate sections per function/data item
|
||||
|
21
enums.py
21
enums.py
@@ -4,12 +4,19 @@
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import math
|
||||
import os
|
||||
|
||||
ENUMS = {
|
||||
"Direction": ["Inherit", "LTR", "RTL"],
|
||||
"Unit": ["Undefined", "Point", "Percent", "Auto"],
|
||||
"Unit": [
|
||||
"Undefined",
|
||||
"Point",
|
||||
"Percent",
|
||||
"Auto",
|
||||
"MaxContent",
|
||||
"FitContent",
|
||||
"Stretch",
|
||||
],
|
||||
"FlexDirection": ["Column", "ColumnReverse", "Row", "RowReverse"],
|
||||
"Justify": [
|
||||
"FlexStart",
|
||||
@@ -32,8 +39,9 @@ ENUMS = {
|
||||
"SpaceEvenly",
|
||||
],
|
||||
"PositionType": ["Static", "Relative", "Absolute"],
|
||||
"Display": ["Flex", "None"],
|
||||
"Display": ["Flex", "None", "Contents"],
|
||||
"Wrap": ["NoWrap", "Wrap", "WrapReverse"],
|
||||
"BoxSizing": ["BorderBox", "ContentBox"],
|
||||
"MeasureMode": ["Undefined", "Exactly", "AtMost"],
|
||||
"Dimension": ["Width", "Height"],
|
||||
"Edge": [
|
||||
@@ -61,9 +69,10 @@ ENUMS = {
|
||||
# Allows main-axis flex basis to be stretched without flexGrow being
|
||||
# set (previously referred to as "UseLegacyStretchBehaviour")
|
||||
("StretchFlexBasis", 1 << 0),
|
||||
# Positioning of absolute nodes will have various bugs related to
|
||||
# justification, alignment, and insets
|
||||
("AbsolutePositioningIncorrect", 1 << 1),
|
||||
# Absolute position in a given axis will be relative to the padding
|
||||
# edge of the parent container instead of the content edge when a
|
||||
# specific inset (top/bottom/left/right) is not set.
|
||||
("AbsolutePositionWithoutInsetsExcludesPadding", 1 << 1),
|
||||
# Absolute nodes will resolve percentages against the inner size of
|
||||
# their containing node, not the padding box
|
||||
("AbsolutePercentAgainstInnerSize", 1 << 2),
|
||||
|
@@ -2,6 +2,18 @@
|
||||
<div style="width:10px; height: 10px; position: absolute; start: 10px; top: 10px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_width_height_left_auto_right" style="width: 100px; height: 100px">
|
||||
<div style="width: 10px; height: 10px; position: absolute; left: auto; right: 10px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_width_height_left_right_auto" style="width: 100px; height: 100px">
|
||||
<div style="width: 10px; height: 10px; position: absolute; left: 10px; right: auto;"></div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_width_height_left_auto_right_auto" style="width: 100px; height: 100px">
|
||||
<div style="width: 10px; height: 10px; position: absolute; left: auto; right: auto;"></div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_width_height_end_bottom" style="width: 100px; height: 100px;">
|
||||
<div style="width:10px; height: 10px; position: absolute; end: 10px; bottom: 10px;"></div>
|
||||
</div>
|
||||
@@ -132,6 +144,22 @@
|
||||
<div style="position:absolute; width:50px; height:50px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_padding">
|
||||
<div style="width:200px; height:200px; margin:10px; position: relative">
|
||||
<div style="position:static; width:200px; height:200px; padding: 50px;">
|
||||
<div style="position:absolute; width:50px; height:50px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_border">
|
||||
<div style="width:200px; height:200px; margin:10px; position: relative">
|
||||
<div style="position:static; width:200px; height:200px; border: 10px solid black;">
|
||||
<div style="position:absolute; width:50px; height:50px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_column_reverse_margin_border"
|
||||
style="width:200px; height:200px; flex-direction: column-reverse;">
|
||||
<div
|
||||
|
@@ -155,6 +155,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="align_content_space_between_wrapped_negative_space_row_reverse" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
|
||||
<div style="display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-content: space-between; justify-content: center; height: 10px;">
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="align_content_space_between_wrapped_negative_space_gap" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
|
||||
<div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-between; justify-content: center; height: 10px; gap: 10px;">
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
@@ -192,6 +200,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="align_content_space_around_wrapped_negative_space_row_reverse" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
|
||||
<div style="display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-content: space-around; justify-content: center; height: 10px;">
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="align_content_space_around_wrapped_negative_space_gap" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
|
||||
<div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-around; justify-content: center; height: 10px; gap: 10px;">
|
||||
<div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
|
||||
@@ -432,3 +448,32 @@
|
||||
</div>
|
||||
<div style="height: 50px; width: 50px; margin-left: 20px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="align_content_stretch_and_align_items_flex_end_with_flex_wrap"
|
||||
style="width: 300px; height: 300px; flex-direction: row; flex-wrap: wrap; align-content: stretch;align-items: flex-end;">
|
||||
<div style="height: 50px; width: 150px; align-self: flex-start;"></div>
|
||||
<div style="height: 100px; width: 120px;"></div>
|
||||
<div style="height: 50px; width: 120px;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="align_content_stretch_and_align_items_flex_start_with_flex_wrap"
|
||||
style="width: 300px; height: 300px; flex-direction: row; flex-wrap: wrap; align-content: stretch;align-items: flex-start;">
|
||||
<div style="height: 50px; width: 150px; align-self: flex-end;"></div>
|
||||
<div style="height: 100px; width: 120px;"></div>
|
||||
<div style="height: 50px; width: 120px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="align_content_stretch_and_align_items_center_with_flex_wrap"
|
||||
style="width: 300px; height: 300px; flex-direction: row; flex-wrap: wrap; align-content: stretch;align-items: center;">
|
||||
<div style="height: 50px; width: 150px; align-self: flex-end;"></div>
|
||||
<div style="height: 100px; width: 120px;"></div>
|
||||
<div style="height: 50px; width: 120px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="align_content_stretch_and_align_items_stretch_with_flex_wrap"
|
||||
style="width: 300px; height: 300px; flex-direction: row; flex-wrap: wrap; align-content: stretch;align-items: stretch;">
|
||||
<div style="height: 50px; width: 150px; align-self: flex-end;"></div>
|
||||
<div style="height: 100px; width: 120px;"></div>
|
||||
<div style="height: 50px; width: 120px;"></div>
|
||||
</div>
|
||||
|
@@ -240,3 +240,14 @@
|
||||
<div style="position:relative; width:50px; height:50px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="align_items_non_stretch_s526008"
|
||||
style="flex-direction: column; width: 400px; height: 400px;">
|
||||
<div style="flex-direction: row;">
|
||||
<div style="flex-direction: column; align-items: flex-start;">
|
||||
<div>
|
||||
<div style="width: 0; height: 10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -2,10 +2,10 @@
|
||||
<div id="aspect_ratio_does_not_stretch_cross_axis_dim" data-disabled="true" style="width: 300px; height: 300px;">
|
||||
<div style="flex: 1; overflow: scroll;">
|
||||
<div style="flex-direction: row;">
|
||||
<div style="flex: 2; aspect-ratio: 1;"></div>
|
||||
<div style="width: 5px"></div>
|
||||
<div style="flex: 1">
|
||||
<div style="flex: 1; aspect-ratio: 1;">
|
||||
<div style="flex: 2; aspect-ratio: 1;"></div>
|
||||
<div style="width: 5px"></div>
|
||||
<div style="flex: 1">
|
||||
<div style="flex: 1; aspect-ratio: 1;">
|
||||
<div style="width: 5px"></div>
|
||||
<div style="flex: 1; aspect-ratio: 1;"></div>
|
||||
</div>
|
||||
@@ -13,3 +13,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="zero_aspect_ratio_behaves_like_auto" style="width: 300px; height: 300px;">
|
||||
<div style="aspect-ratio: 0; width: 50px"></div>
|
||||
</div>
|
||||
|
25
gentest/fixtures/YGAutoTest.html
Normal file
25
gentest/fixtures/YGAutoTest.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<div id="auto_width" style="width: auto; height: 50px; flex-direction: row;">
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
</div>
|
||||
|
||||
<div id="auto_height" style="width: 50px; height: auto;">
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
</div>
|
||||
|
||||
<div id="auto_flex_basis" style="width: 50px; flex-basis: auto;">
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
<div style="width: 50px; height: 50px"></div>
|
||||
</div>
|
||||
|
||||
<div id="auto_position" style="width: 50px; height: 50px;">
|
||||
<div style="width: 25px; height: 25px; right: auto"></div>
|
||||
</div>
|
||||
|
||||
<div id="auto_margin" style="width: 50px; height: 50px;">
|
||||
<div style="width: 25px; height: 25px; margin-left: auto"></div>
|
||||
</div>
|
252
gentest/fixtures/YGBoxSizingTest.html
Normal file
252
gentest/fixtures/YGBoxSizingTest.html
Normal file
@@ -0,0 +1,252 @@
|
||||
<div id="box_sizing_content_box_simple"
|
||||
style="width: 100px; height: 100px; padding: 5px; border-width: 10px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_simple"
|
||||
style="width: 100px; height: 100px; padding: 5px; border-width: 10px; box-sizing: border-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_percent" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50%; height: 25%; padding: 4px; border-width: 16px; box-sizing: content-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_percent" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50%; height: 25%; padding: 4px; border-width: 16px; box-sizing: border-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_absolute" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50; height: 25%; padding: 12px; border-width: 8px; box-sizing: content-box; position: absolute;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_absolute" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50; height: 25%; padding: 12px; border-width: 8px; box-sizing: border-box; position: absolute;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_comtaining_block"
|
||||
style="width: 100px; height: 100px; padding: 12px; border-width: 8px; box-sizing: content-box; ">
|
||||
<div style="width: 75; height: 75; position: static;">
|
||||
<div style="width: 50px; height: 25%; position: absolute;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_comtaining_block"
|
||||
style="width: 100px; height: 100px; padding: 12px; border-width: 8px; box-sizing: border-box; ">
|
||||
<div style="width: 75; height: 75; position: static;">
|
||||
<div style="width: 50px; height: 25%; position: absolute;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_padding_only"
|
||||
style="width: 100px; height: 100px; padding: 5px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_padding_only_percent" style="width: 100px; height: 150px;">
|
||||
<div style="width: 50px; height: 75px; padding: 10%; box-sizing: content-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_padding_only" style="width: 100px; height: 100px; padding: 5px; box-sizing: border-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_padding_only_percent" style="width: 100px; height: 150px;">
|
||||
<div style="width: 50px; height: 75px; padding: 10%; box-sizing: border-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_border_only"
|
||||
style="width: 100px; height: 100px; border-width: 10px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_border_only_percent" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50%; height: 75; border-width: 10%; box-sizing: content-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_border_only"
|
||||
style="width: 100px; height: 100px; border-width: 10px; box-sizing: border-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_border_only_percent" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50%; height: 75; border-width: 10%; box-sizing: border-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_no_padding_no_border" style="width: 100px; height: 100px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_no_padding_no_border" style="width: 100px; height: 100px; box-sizing: border-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_children"
|
||||
style="width: 100px; height: 100px; padding: 5px; border-width: 10px; box-sizing: content-box">
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_children"
|
||||
style="width: 100px; height: 100px; padding: 5px; border-width: 10px; box-sizing: border-box">
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_siblings" style="width: 100px; height: 100px;">
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px; box-sizing: content-box; padding: 10px; border-width: 10px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_siblings" style="width: 100px; height: 100px;">
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px; box-sizing: border-box; padding: 10px; border-width: 10px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_max_width" style="width: 100px; height: 100px;">
|
||||
<div style="max-width: 50px; height: 25px; box-sizing: content-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_max_width" style="width: 100px; height: 100px;">
|
||||
<div style="max-width: 50px; height: 25px; box-sizing: border-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_max_height" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50px; max-height: 50px; box-sizing: content-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_max_height" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50px; max-height: 50px; box-sizing: border-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_min_width" style="width: 100px; height: 100px;">
|
||||
<div style="min-width: 50px; height: 25px; box-sizing: content-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_min_width" style="width: 100px; height: 100px;">
|
||||
<div style="min-width: 50px; height: 25px; box-sizing: border-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_min_height" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50px; min-height: 50px; box-sizing: content-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_min_height" style="width: 100px; height: 100px;">
|
||||
<div style="width: 50px; min-height: 50px; box-sizing: border-box; padding: 5px; border-width: 15px"></div>
|
||||
<div style="width: 25px; height: 25px"></div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_no_height_no_width" style="width: 100px; height: 100px;">
|
||||
<div style="box-sizing: content-box; padding: 2px; border-width: 7px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_no_height_no_width" style="width: 100px; height: 100px;">
|
||||
<div style="box-sizing: border-box; padding: 2px; border-width: 7px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_nested"
|
||||
style="width: 100px; height: 100px; box-sizing: content-box; padding: 15px; border-width: 3px;">
|
||||
<div style="width: 20px; height: 20px; box-sizing: content-box; padding: 2px; border-width: 7px">
|
||||
<div style="width: 10px; height: 5px; box-sizing: content-box; padding: 1px; border-width: 2px"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_nested"
|
||||
style="width: 100px; height: 100px; box-sizing: border-box; padding: 15px; border-width: 3px;">
|
||||
<div style="width: 20px; height: 20px; box-sizing: border-box; padding: 2px; border-width: 7px">
|
||||
<div style="width: 10px; height: 5px; box-sizing: border-box; padding: 1px; border-width: 2px"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_nested_alternating"
|
||||
style="width: 100px; height: 100px; box-sizing: content-box; padding: 3px; border-width: 2px;">
|
||||
<div style="width: 40px; height: 40px; box-sizing: border-box; padding: 8px; border-width: 2px">
|
||||
<div style="width: 20px; height: 25px; box-sizing: content-box; padding: 3px; border-width: 6px">
|
||||
<div style="width: 10px; height: 5px; box-sizing: border-box; padding: 1px; border-width: 1px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_nested_alternating"
|
||||
style="width: 100px; height: 100px; box-sizing: border-box; padding: 3px; border-width: 2px;">
|
||||
<div style="width: 40px; height: 40px; box-sizing: content-box; padding: 8px; border-width: 2px">
|
||||
<div style="width: 20px; height: 25px; box-sizing: border-box; padding: 3px; border-width: 6px">
|
||||
<div style="width: 10px; height: 5px; box-sizing: content-box; padding: 1px; border-width: 1px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="box_sizing_content_box_flex_basis_row"
|
||||
style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="flex-basis: 50px; height: 25px; padding: 5px; border-width: 10px; box-sizing: content-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_flex_basis_row" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="flex-basis: 50px; height: 25px; padding: 5px; border-width: 10px; box-sizing: border-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="box_sizing_content_box_flex_basis_column"
|
||||
style="width: 100px; height: 100px; flex-direction: column;">
|
||||
<div style="flex-basis: 50px; height: 25px; padding: 5px; border-width: 10px; box-sizing: content-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_flex_basis_column" style="width: 100px; height: 100px; flex-direction: column;">
|
||||
<div style="flex-basis: 50px; height: 25px; padding: 5px; border-width: 10px; box-sizing: border-box">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_padding_start"
|
||||
style="width: 100px; height: 100px; padding-start: 5px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_padding_start"
|
||||
style="width: 100px; height: 100px; padding-start: 5px; box-sizing: border-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_padding_end"
|
||||
style="width: 100px; height: 100px; padding-end: 5px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_padding_end"
|
||||
style="width: 100px; height: 100px; padding-end: 5px; box-sizing: border-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_border_start"
|
||||
style="width: 100px; height: 100px; border-start-width: 5px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_border_start"
|
||||
style="width: 100px; height: 100px; border-start-width: 5px; box-sizing: border-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_content_box_border_end"
|
||||
style="width: 100px; height: 100px; border-end-width: 5px; box-sizing: content-box">
|
||||
</div>
|
||||
|
||||
<div id="box_sizing_border_box_border_end"
|
||||
style="width: 100px; height: 100px; border-end-width: 5px; box-sizing: border-box">
|
||||
</div>
|
@@ -29,3 +29,61 @@
|
||||
<div id="display_none_with_position_absolute" style="width: 100px; height: 100px;">
|
||||
<div style="display:none; position: absolute; width: 100px; height: 100px"></div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="display: contents;">
|
||||
<div style="flex: 1; height: 10px;"></div>
|
||||
<div style="flex: 1; height: 20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents_fixed_size" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="display: contents; width: 50px; height: 50px;">
|
||||
<div style="flex: 1; height: 10px;"></div>
|
||||
<div style="flex: 1; height: 20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents_with_margin" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="width: 20px; height: 20px; display: contents; margin: 10px;"></div>
|
||||
<div style="flex-grow: 1;"></div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents_with_padding" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="display: contents; padding: 10px;">
|
||||
<div style="flex: 1; height: 10px;"></div>
|
||||
<div style="flex: 1; height: 20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents_with_position" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="display: contents; top: 10px;">
|
||||
<div style="flex: 1; height: 10px;"></div>
|
||||
<div style="flex: 1; height: 20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents_with_position_absolute" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="display: contents; position: absolute; width: 50px; height: 50px;">
|
||||
<div style="flex: 1; height: 10px;"></div>
|
||||
<div style="flex: 1; height: 20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents_nested" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="display: contents;">
|
||||
<div style="display: contents;">
|
||||
<div style="flex: 1; height: 10px;"></div>
|
||||
<div style="flex: 1; height: 20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="display_contents_with_siblings" style="width: 100px; height: 100px; flex-direction: row;">
|
||||
<div style="flex: 1; height: 30px;"></div>
|
||||
<div style="display: contents;">
|
||||
<div style="flex: 1; height: 10px;"></div>
|
||||
<div style="flex: 1; height: 20px;"></div>
|
||||
</div>
|
||||
<div style="flex: 1; height: 30px;"></div>
|
||||
</div>
|
@@ -400,3 +400,8 @@
|
||||
<div style="width: 10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="flex_direction_alternating_with_percent" style="height: 300px; width: 200px; flex-direction: column;">
|
||||
<div style="height: 50%; width: 50%; left: 10%; top: 10%; flex-direction: row;">
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -171,3 +171,72 @@
|
||||
<div style="height: 20px"></div>
|
||||
<div style="height: 30px"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_wrapping" style="flex-direction: row; width: 300px; height: 700px; padding: 10px; gap: 10%; flex-wrap: wrap;">
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_determines_parent_height" style="flex-direction: row; width: 300px; gap: 10%; flex-wrap: wrap;">
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_wrapping_with_both_content_padding_and_item_padding" style="flex-direction: row; width: 300px; height: 700px; padding: 10px; gap: 10%; flex-wrap: wrap;">
|
||||
<div style="width: 100px; height: 100px; padding: 10px;"></div>
|
||||
<div style="width: 100px; height: 100px; padding: 10px;"></div>
|
||||
<div style="width: 100px; height: 100px; padding: 10px;"></div>
|
||||
<div style="width: 100px; height: 100px; padding: 10px;"></div>
|
||||
<div style="width: 100px; height: 100px; padding: 10px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_wrapping_with_both_content_padding" style="flex-direction: row; width: 300px; height: 700px; padding: 10px; gap: 10%; flex-wrap: wrap;">
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_wrapping_with_content_margin" style="flex-direction: row; width: 300px; height: 700px; margin: 10px; gap: 10%; flex-wrap: wrap;">
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_wrapping_with_content_margin_and_padding" style="flex-direction: row; width: 300px; height: 700px; margin: 10px; padding: 10px; gap: 10%; flex-wrap: wrap;">
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_wrapping_with_flexible_content" style="flex-direction: row; width: 300px; height: 300px; gap: 10%;">
|
||||
<div style="flex: 1;"></div>
|
||||
<div style="flex: 1;"></div>
|
||||
<div style="flex: 1;"></div>
|
||||
</div>
|
||||
|
||||
<div id="row_gap_percent_wrapping_with_mixed_flexible_content" style="flex-direction: row; width: 300px; height: 300px; gap: 10%;">
|
||||
<div style="width: 10px;"></div>
|
||||
<div style="flex: 1;"></div>
|
||||
<div style="width: 10%;"></div>
|
||||
</div>
|
||||
|
||||
<!-- TODO: Existing bug that Yoga is not inline with Chromium for calculation with min-width -->
|
||||
<div id="row_gap_percent_wrapping_with_min_width" data-disabled="true" style="flex-direction: row; min-width: 300px; gap: 10%; flex-wrap: wrap;">
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
</div>
|
||||
|
568
gentest/fixtures/YGIntrinsicSizeTest.html
Normal file
568
gentest/fixtures/YGIntrinsicSizeTest.html
Normal file
@@ -0,0 +1,568 @@
|
||||
<div id="contains_inner_text_long_word" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;">
|
||||
LoremipsumdolorsitametconsecteturadipiscingelitSedeleifasdfettortoracauctorFuscerhoncusipsumtemporerosaliquamconsequatPraesentsoda
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_no_width_no_height" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_no_width_no_height_long_word_in_paragraph"
|
||||
style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus
|
||||
loremipsumloremipsumloremipsumloremipsumloremipsumloremipsumloremipsumloremipsumloremipsumloremipsumloremipsumloremipsumloremipsumlorem
|
||||
Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_fixed_width" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;width:100px">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_no_width_fixed_height" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;height:20px">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_fixed_width_fixed_height" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;width: 50px; height:20px">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_max_width_max_height" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;max-width: 50px; max-height:20px">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_max_width_max_height_column" style="width:2000px; align-items: flex-start;">
|
||||
<div style="max-width: 50px;">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="contains_inner_text_max_width" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;max-width:100px">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_fixed_width_shorter_text" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;width:100px">
|
||||
Lorem ipsum
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_fixed_height_shorter_text" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;height:100px">
|
||||
Lorem ipsum
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contains_inner_text_max_height" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||
<div style="flex-direction:row;max-height:20px">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
||||
volutpat
|
||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
||||
vitae
|
||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
||||
tincidunt
|
||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
||||
vulputate eleifasd lectus vel varius.
|
||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
||||
in
|
||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
||||
venenatis
|
||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
||||
nunc
|
||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
||||
lobortis.
|
||||
Sed at consectetur ipsum.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="max_content_width" style="flex-direction: row; width:max-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_width" style="width: 90px;">
|
||||
<div style="flex-direction: row; width: fit-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="stretch_width" style="width: 500px;">
|
||||
<div style="flex-direction: row; width: -webkit-fill-available; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="max_content_height" style="height:max-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_height" style="height: 90px; ">
|
||||
<div style="height: fit-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="stretch_height" style="height: 500px;">
|
||||
<div style="height: -webkit-fill-available; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="max_content_flex_basis_column" style="flex-basis: max-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_flex_basis_column" style="height: 90px;">
|
||||
<div style="flex-basis: fit-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="stretch_flex_basis_column" style="height: 500px;">
|
||||
<div style="flex-basis: -webkit-fill-available; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="max_content_flex_basis_row" style="flex-direction: row; flex-basis: max-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 500px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_flex_basis_row" style="width: 90px;">
|
||||
<div style="flex-direction: row; flex-basis: fit-content; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="stretch_flex_basis_row" style="width: 500px;">
|
||||
<div style="flex-direction: row; flex-basis: -webkit-fill-available; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="max_content_max_width"
|
||||
style="flex-direction: row; max-width:max-content; width: 200px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_max_width" style="width: 90px;">
|
||||
<div style="flex-direction: row; max-width: fit-content; width: 110px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="stretch_max_width" style="width: 500px;">
|
||||
<div style="flex-direction: row; max-width: -webkit-fill-available; width: 600px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="max_content_min_width"
|
||||
style="flex-direction: row; min-width:max-content; width: 100px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_min_width" style="width: 90px;">
|
||||
<div style="flex-direction: row; min-width: fit-content; width: 90px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="stretch_min_width" style="width: 500px;">
|
||||
<div style="flex-direction: row; min-width: -webkit-fill-available; width: 400px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 100px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 25px; height: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="max_content_max_height" style="max-height:max-content; height: 200px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_max_height" style="height: 90px;">
|
||||
<div style="max-height: fit-content; height: 110px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="stretch_max_height" style="height: 500px;">
|
||||
<div style="max-height: -webkit-fill-available; flex-wrap: wrap; height: 600px;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="max_content_min_height" style="min-height:max-content; height: 100px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="fit_content_min_height" style="height: 90px;">
|
||||
<div style="min-height: fit-content; height: 90px; flex-wrap: wrap;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="stretch_min_height" style="height: 500px;">
|
||||
<div style="min-height: -webkit-fill-available; flex-wrap: wrap; height: 400px;">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 100px;">
|
||||
</div>
|
||||
<div style="width: 50px; height: 25px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_max_content_width" style="width: 200px">
|
||||
<div style="width: max-content;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_stretch_width" style="width: 200px">
|
||||
<div style="width: -webkit-fill-available;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_fit_content_width" style="width: 200px">
|
||||
<div style="width: fit-content;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_max_content_min_width" style="width: 200px">
|
||||
<div style="min-width: max-content; width: 200px;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_stretch_min_width" style="width: 200px">
|
||||
<div style="min-width: -webkit-fill-available; width: 100px;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" data-disabled="true" id="text_fit_content_min_width" style="width: 200px">
|
||||
<div style="min-width: fit-content; width: 300px">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_max_content_max_width" style="width: 200px">
|
||||
<div style="max-width: max-content; width: 2000px;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_stretch_max_width" style="width: 200px">
|
||||
<div style="max-width: -webkit-fill-available; width: 300px;">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-disabled="true" id="text_fit_content_max_width" style="width: 200px">
|
||||
<div style="max-width: fit-content; width: 1000px">
|
||||
<div style="flex-direction:row;">
|
||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -70,7 +70,7 @@
|
||||
<div style="height: 20px; width: 20px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_colunn_max_height_and_margin" style="height: 100px; max-height: 80px; margin-top: 100px; justify-content: center; flex-direction: column;">
|
||||
<div id="justify_content_column_max_height_and_margin" style="height: 100px; max-height: 80px; margin-top: 100px; justify-content: center; flex-direction: column;">
|
||||
<div style="height: 20px; width: 20px;"></div>
|
||||
</div>
|
||||
|
||||
@@ -120,3 +120,59 @@
|
||||
<div style="width: 20px;"></div>
|
||||
<div style="width: 20px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_overflow_row_flex_start" style="width: 102px; height: 102px; flex-direction: row; justify-content: flex-start;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_overflow_row_flex_end" style="width: 102px; height: 102px; flex-direction: row; justify-content: flex-end;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_overflow_row_center" style="width: 102px; height: 102px; flex-direction: row; justify-content: center;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_overflow_row_space_between" style="width: 102px; height: 102px; flex-direction: row; justify-content: space-between;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_overflow_row_space_around" style="width: 102px; height: 102px; flex-direction: row; justify-content: space-around;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_overflow_row_space_evenly" style="width: 102px; height: 102px; flex-direction: row; justify-content: space-evenly;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<!-- TODO T208209388: fallback to start vs flexstart in overflowed cases -->
|
||||
<div data-disabled="true" id="justify_content_overflow_row_reverse_space_around" style="width: 102px; height: 102px; flex-direction: row-reverse; justify-content: space-around;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<!-- TODO T208209388: fallback to start vs flexstart in overflowed cases -->
|
||||
<div data-disabled="true" id="justify_content_overflow_row_reverse_space_evenly" style="width: 102px; height: 102px; flex-direction: row-reverse; justify-content: space-evenly;">
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="justify_content_overflow_row_space_evenly_auto_margin" style="width: 102px; height: 102px; flex-direction: row; justify-content: space-evenly;">
|
||||
<div style="width: 40px; margin-right: auto;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
<div style="width: 40px;"></div>
|
||||
</div>
|
||||
|
@@ -60,13 +60,13 @@
|
||||
<div style="width: 50px; height: 50px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="margin_auto_mutiple_children_column" style="width: 200px; height: 200px; flex-direction: column; align-items: center;">
|
||||
<div id="margin_auto_multiple_children_column" style="width: 200px; height: 200px; flex-direction: column; align-items: center;">
|
||||
<div style="width: 50px; height: 50px; margin-top:auto;"></div>
|
||||
<div style="width: 50px; height: 50px; margin-top:auto;"></div>
|
||||
<div style="width: 50px; height: 50px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="margin_auto_mutiple_children_row" style="width: 200px; height: 200px; flex-direction:row; align-items: center;">
|
||||
<div id="margin_auto_multiple_children_row" style="width: 200px; height: 200px; flex-direction:row; align-items: center;">
|
||||
<div style="width: 50px; height: 50px; margin-right:auto;"></div>
|
||||
<div style="width: 50px; height: 50px; margin-right:auto;"></div>
|
||||
<div style="width: 50px; height: 50px;"></div>
|
||||
@@ -150,3 +150,8 @@
|
||||
<div style="flex: 1; margin-left:auto;"></div>
|
||||
<div style="width: 50px; height: 50px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="margin_auto_overflowing_container" style="width: 200px; height: 200px; align-items: center;">
|
||||
<div style="width: 50px; height: 150px; margin-bottom: auto;"></div>
|
||||
<div style="width: 50px; height: 150px;"></div>
|
||||
</div>
|
||||
|
@@ -13,10 +13,17 @@
|
||||
<div style="height: 10px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="padding_center_child" style="width: 100px; height: 100px; padding-start: 10px; padding-top: 10; padding-end: 20px; padding-bottom: 20px; align-items: center; justify-content: center;">
|
||||
<div id="padding_center_child"
|
||||
style="width: 100px; height: 100px; padding-start: 10px; padding-top: 10; padding-end: 20px; padding-bottom: 20px; align-items: center; justify-content: center;">
|
||||
<div style="height: 10px; width: 10px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="child_with_padding_align_end" style="width: 200px; height: 200px; justify-content: flex-end; align-items: flex-end;">
|
||||
<div id="child_with_padding_align_end"
|
||||
style="width: 200px; height: 200px; justify-content: flex-end; align-items: flex-end;">
|
||||
<div style="width: 100px; height: 100px; padding: 20px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="physical_and_relative_edge_defined"
|
||||
style="width: 200px; height: 200px; padding-left: 20px; padding-end: 50px;">
|
||||
<div style="width: 100%; height: 50px;"></div>
|
||||
</div>
|
||||
|
@@ -693,3 +693,20 @@
|
||||
style="height: 50%; width: 50%; position: absolute; border-width: 3px 2px 1px 4px; padding: 7px 5px 4px 3px; margin: 11px 15px 1px 12px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="static_position_absolute_child_multiple">
|
||||
<div style="width: 400px; height: 400px; padding: 100px; position: relative">
|
||||
<div style="height:100px; width: 100px; position: static">
|
||||
<div style="height: 50px; width: 10%; position: absolute">
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:100px; width: 100px; position: static">
|
||||
<div style="height: 50px; width: 50%; position: absolute">
|
||||
</div>
|
||||
<div style="height: 50px; width: 50%; position: absolute">
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 50px; width: 25px; position: absolute">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
BIN
gentest/fonts/Ahem.ttf
Normal file
BIN
gentest/fonts/Ahem.ttf
Normal file
Binary file not shown.
@@ -12,15 +12,44 @@ function toValueCpp(value) {
|
||||
return n + (Number(n) == n && n % 1 !== 0 ? 'f' : '');
|
||||
}
|
||||
|
||||
function toFunctionName(value) {
|
||||
function toFunctionNameCpp(value) {
|
||||
if (value.indexOf('%') >= 0) {
|
||||
return 'Percent';
|
||||
} else if (value.indexOf('Auto') >= 0) {
|
||||
return 'Auto';
|
||||
} else if (value.indexOf('MaxContent') >= 0) {
|
||||
return 'MaxContent';
|
||||
} else if (value.indexOf('FitContent') >= 0) {
|
||||
return 'FitContent';
|
||||
} else if (value.indexOf('Stretch') >= 0) {
|
||||
return 'Stretch';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function keywordFunctionCpp(functionPrefix, nodeName, value) {
|
||||
const functionSuffix = toFunctionNameCpp(value);
|
||||
if (
|
||||
functionSuffix == 'Auto' ||
|
||||
functionSuffix == 'MaxContent' ||
|
||||
functionSuffix == 'FitContent' ||
|
||||
functionSuffix == 'Stretch'
|
||||
) {
|
||||
return functionPrefix + functionSuffix + '(' + nodeName + ');';
|
||||
} else {
|
||||
return (
|
||||
functionPrefix +
|
||||
functionSuffix +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const CPPEmitter = function () {
|
||||
Emitter.call(this, 'cpp', ' ');
|
||||
};
|
||||
@@ -30,7 +59,12 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
emitPrologue: {
|
||||
value: function () {
|
||||
this.push(['#include <gtest/gtest.h>', '#include <yoga/Yoga.h>', '']);
|
||||
this.push([
|
||||
'#include <gtest/gtest.h>',
|
||||
'#include <yoga/Yoga.h>',
|
||||
'#include "../util/TestUtil.h"',
|
||||
'',
|
||||
]);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -44,7 +78,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
this.push('');
|
||||
}
|
||||
|
||||
this.push('const YGConfigRef config = YGConfigNew();');
|
||||
this.push('YGConfigRef config = YGConfigNew();');
|
||||
for (const i in experiments) {
|
||||
this.push(
|
||||
'YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeature' +
|
||||
@@ -58,9 +92,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
emitTestTreePrologue: {
|
||||
value: function (nodeName) {
|
||||
this.push(
|
||||
'const YGNodeRef ' + nodeName + ' = YGNodeNewWithConfig(config);',
|
||||
);
|
||||
this.push('YGNodeRef ' + nodeName + ' = YGNodeNewWithConfig(config);');
|
||||
},
|
||||
},
|
||||
|
||||
@@ -133,12 +165,20 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
YGWrapWrap: {value: 'YGWrapWrap'},
|
||||
YGWrapWrapReverse: {value: 'YGWrapWrapReverse'},
|
||||
|
||||
YGBoxSizingBorderBox: {value: 'YGBoxSizingBorderBox'},
|
||||
YGBoxSizingContentBox: {value: 'YGBoxSizingContentBox'},
|
||||
|
||||
YGUndefined: {value: 'YGUndefined'},
|
||||
|
||||
YGDisplayFlex: {value: 'YGDisplayFlex'},
|
||||
YGDisplayNone: {value: 'YGDisplayNone'},
|
||||
YGDisplayContents: {value: 'YGDisplayContents'},
|
||||
YGAuto: {value: 'YGAuto'},
|
||||
|
||||
YGMaxContent: {value: 'MaxContent'},
|
||||
YGFitContent: {value: 'FitContent'},
|
||||
YGStretch: {value: 'Stretch'},
|
||||
|
||||
YGNodeCalculateLayout: {
|
||||
value: function (node, dir, _experiments) {
|
||||
this.push(
|
||||
@@ -225,7 +265,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetAspectRatio' +
|
||||
toFunctionName(value) +
|
||||
toFunctionNameCpp(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
@@ -267,15 +307,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
YGNodeStyleSetFlexBasis: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetFlexBasis' +
|
||||
toFunctionName(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');',
|
||||
);
|
||||
this.push(keywordFunctionCpp('YGNodeStyleSetFlexBasis', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
@@ -319,20 +351,6 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetHeight' +
|
||||
toFunctionName(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');',
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetJustifyContent: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
@@ -355,7 +373,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
}
|
||||
this.push(
|
||||
'YGNodeStyleSetMargin' +
|
||||
toFunctionName(value) +
|
||||
toFunctionNameCpp(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
@@ -366,59 +384,39 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(keywordFunctionCpp('YGNodeStyleSetHeight', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(keywordFunctionCpp('YGNodeStyleSetWidth', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMaxHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetMaxHeight' +
|
||||
toFunctionName(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');',
|
||||
);
|
||||
this.push(keywordFunctionCpp('YGNodeStyleSetMaxHeight', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMaxWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetMaxWidth' +
|
||||
toFunctionName(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');',
|
||||
);
|
||||
this.push(keywordFunctionCpp('YGNodeStyleSetMaxWidth', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMinHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetMinHeight' +
|
||||
toFunctionName(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');',
|
||||
);
|
||||
this.push(keywordFunctionCpp('YGNodeStyleSetMinHeight', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMinWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetMinWidth' +
|
||||
toFunctionName(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');',
|
||||
);
|
||||
this.push(keywordFunctionCpp('YGNodeStyleSetMinWidth', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
@@ -434,7 +432,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
value: function (nodeName, edge, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetPadding' +
|
||||
toFunctionName(value) +
|
||||
toFunctionNameCpp(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
@@ -448,15 +446,20 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
YGNodeStyleSetPosition: {
|
||||
value: function (nodeName, edge, value) {
|
||||
let valueStr = toValueCpp(value);
|
||||
if (valueStr != 'YGAuto') {
|
||||
valueStr = ', ' + valueStr;
|
||||
} else {
|
||||
valueStr = '';
|
||||
}
|
||||
this.push(
|
||||
'YGNodeStyleSetPosition' +
|
||||
toFunctionName(value) +
|
||||
toFunctionNameCpp(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
edge +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
valueStr +
|
||||
');',
|
||||
);
|
||||
},
|
||||
@@ -474,25 +477,11 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetWidth' +
|
||||
toFunctionName(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
toValueCpp(value) +
|
||||
');',
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetGap: {
|
||||
value: function (nodeName, gap, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetGap' +
|
||||
toFunctionName(value) +
|
||||
toFunctionNameCpp(value) +
|
||||
'(' +
|
||||
nodeName +
|
||||
', ' +
|
||||
@@ -503,4 +492,21 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetBoxSizing: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
'YGNodeStyleSetBoxSizing(' + nodeName + ', ' + toValueCpp(value) + ');',
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeSetMeasureFunc: {
|
||||
value: function (nodeName, innerText, _) {
|
||||
this.push(`YGNodeSetContext(${nodeName}, (void*)"${innerText}");`);
|
||||
this.push(
|
||||
`YGNodeSetMeasureFunc(${nodeName}, &facebook::yoga::test::IntrinsicSizeMeasure);`,
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@@ -100,15 +100,21 @@ for (const fileName of fixtures) {
|
||||
await driver.get('file://' + process.cwd() + '/test.html');
|
||||
const logs = await driver.manage().logs().get(logging.Type.BROWSER);
|
||||
|
||||
await fs.writeFile(
|
||||
`${yogaDir}/tests/generated/${fileNameNoExtension}.cpp`,
|
||||
addSignatureToSourceCode(JSON.parse(logs[0].message.replace(/^[^"]*/, ''))),
|
||||
const testLogs = logs.filter(
|
||||
log => !log.message.replace(/^[^"]*/, '').startsWith('"gentest-log:'),
|
||||
);
|
||||
|
||||
await fs.writeFile(
|
||||
`${yogaDir}/java/tests/com/facebook/yoga/${fileNameNoExtension}.java`,
|
||||
`${yogaDir}/tests/generated/${fileNameNoExtension}.cpp`,
|
||||
addSignatureToSourceCode(
|
||||
JSON.parse(logs[1].message.replace(/^[^"]*/, '')).replace(
|
||||
JSON.parse(testLogs[0].message.replace(/^[^"]*/, '')),
|
||||
),
|
||||
);
|
||||
|
||||
await fs.writeFile(
|
||||
`${yogaDir}/java/tests/generated/com/facebook/yoga/${fileNameNoExtension}.java`,
|
||||
addSignatureToSourceCode(
|
||||
JSON.parse(testLogs[1].message.replace(/^[^"]*/, '')).replace(
|
||||
'YogaTest',
|
||||
fileNameNoExtension,
|
||||
),
|
||||
@@ -118,7 +124,7 @@ for (const fileName of fixtures) {
|
||||
await fs.writeFile(
|
||||
`${yogaDir}/javascript/tests/generated/${fileNameNoExtension}.test.ts`,
|
||||
addSignatureToSourceCode(
|
||||
JSON.parse(logs[2].message.replace(/^[^"]*/, '')).replace(
|
||||
JSON.parse(testLogs[2].message.replace(/^[^"]*/, '')).replace(
|
||||
'YogaTest',
|
||||
fileNameNoExtension,
|
||||
),
|
||||
|
@@ -17,10 +17,38 @@ function toMethodName(value) {
|
||||
return 'Percent';
|
||||
} else if (value.indexOf('AUTO') >= 0) {
|
||||
return 'Auto';
|
||||
} else if (value.indexOf('MAX_CONTENT') >= 0) {
|
||||
return 'MaxContent';
|
||||
} else if (value.indexOf('FIT_CONTENT') >= 0) {
|
||||
return 'FitContent';
|
||||
} else if (value.indexOf('STRETCH') >= 0) {
|
||||
return 'Stretch';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function keywordMethod(methodPrefix, nodeName, value) {
|
||||
const methodSuffix = toMethodName(value);
|
||||
if (
|
||||
methodSuffix == 'Auto' ||
|
||||
methodSuffix == 'MaxContent' ||
|
||||
methodSuffix == 'FitContent' ||
|
||||
methodSuffix == 'Stretch'
|
||||
) {
|
||||
return nodeName + '.' + methodPrefix + methodSuffix + '();';
|
||||
} else {
|
||||
return (
|
||||
nodeName +
|
||||
'.' +
|
||||
methodPrefix +
|
||||
methodSuffix +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const JavaEmitter = function () {
|
||||
Emitter.call(this, 'java', ' ');
|
||||
};
|
||||
@@ -55,6 +83,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
'import org.junit.Test;',
|
||||
'import org.junit.runner.RunWith;',
|
||||
'import org.junit.runners.Parameterized;',
|
||||
'import com.facebook.yoga.utils.TestUtils;',
|
||||
'',
|
||||
'@RunWith(Parameterized.class)',
|
||||
'public class YogaTest {',
|
||||
@@ -177,12 +206,20 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
YGDisplayFlex: {value: 'YogaDisplay.FLEX'},
|
||||
YGDisplayNone: {value: 'YogaDisplay.NONE'},
|
||||
YGDisplayContents: {value: 'YogaDisplay.CONTENTS'},
|
||||
YGAuto: {value: 'YogaConstants.AUTO'},
|
||||
|
||||
YGWrapNoWrap: {value: 'YogaWrap.NO_WRAP'},
|
||||
YGWrapWrap: {value: 'YogaWrap.WRAP'},
|
||||
YGWrapWrapReverse: {value: 'YogaWrap.WRAP_REVERSE'},
|
||||
|
||||
YGBoxSizingBorderBox: {value: 'YogaBoxSizing.BORDER_BOX'},
|
||||
YGBoxSizingContentBox: {value: 'YogaBoxSizing.CONTENT_BOX'},
|
||||
|
||||
YGMaxContent: {value: 'MAX_CONTENT'},
|
||||
YGFitContent: {value: 'FIT_CONTENT'},
|
||||
YGStretch: {value: 'STRETCH'},
|
||||
|
||||
YGNodeCalculateLayout: {
|
||||
value: function (node, dir, _experiments) {
|
||||
this.push(node + '.setDirection(' + dir + ');');
|
||||
@@ -269,14 +306,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
YGNodeStyleSetFlexBasis: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setFlexBasis' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
);
|
||||
this.push(keywordMethod('setFlexBasis', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
@@ -304,19 +334,6 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setHeight' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetJustifyContent: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(nodeName + '.setJustifyContent(' + toValueJava(value) + ');');
|
||||
@@ -344,55 +361,39 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(keywordMethod('setHeight', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(keywordMethod('setWidth', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMaxHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setMaxHeight' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
);
|
||||
this.push(keywordMethod('setMaxHeight', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMaxWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setMaxWidth' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
);
|
||||
this.push(keywordMethod('setMaxWidth', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMinHeight: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setMinHeight' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
);
|
||||
this.push(keywordMethod('setMinHeight', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetMinWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setMinWidth' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
);
|
||||
this.push(keywordMethod('setMinWidth', nodeName, value));
|
||||
},
|
||||
},
|
||||
|
||||
@@ -419,15 +420,21 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
YGNodeStyleSetPosition: {
|
||||
value: function (nodeName, edge, value) {
|
||||
let valueStr = toValueJava(value);
|
||||
|
||||
if (valueStr == 'YogaConstants.AUTO') {
|
||||
valueStr = '';
|
||||
} else {
|
||||
valueStr = ', ' + valueStr + 'f';
|
||||
}
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setPosition' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
edge +
|
||||
', ' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
valueStr +
|
||||
');',
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -438,19 +445,6 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetWidth: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setWidth' +
|
||||
toMethodName(value) +
|
||||
'(' +
|
||||
toValueJava(value) +
|
||||
'f);',
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetGap: {
|
||||
value: function (nodeName, gap, value) {
|
||||
this.push(
|
||||
@@ -465,4 +459,19 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetBoxSizing: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(nodeName + '.setBoxSizing(' + toValueJava(value) + ');');
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeSetMeasureFunc: {
|
||||
value: function (nodeName, innerText, _) {
|
||||
this.push(`${nodeName}.setData("${innerText}");`);
|
||||
this.push(
|
||||
`${nodeName}.setMeasureFunction(new TestUtils.intrinsicMeasureFunction());`,
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@@ -15,6 +15,9 @@ function toValueJavascript(value) {
|
||||
if (value.match(/^[0-9.e+-]+px$/i)) return parseFloat(value);
|
||||
if (value.match(/^[0-9.e+-]+%/i)) return JSON.stringify(value);
|
||||
if (value == 'Yoga.AUTO') return '"auto"';
|
||||
if (value == 'max-content') return '"max-content"';
|
||||
if (value == 'fit-content') return '"fit-content"';
|
||||
if (value == 'stretch') return '"stretch"';
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -23,10 +26,14 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
emitPrologue: {
|
||||
value: function () {
|
||||
this.push(
|
||||
"import { instrinsicSizeMeasureFunc } from '../tools/utils.ts'",
|
||||
);
|
||||
this.push("import Yoga from 'yoga-layout';");
|
||||
this.push('import {');
|
||||
this.pushIndent();
|
||||
this.push('Align,');
|
||||
this.push('BoxSizing,');
|
||||
this.push('Direction,');
|
||||
this.push('Display,');
|
||||
this.push('Edge,');
|
||||
@@ -167,6 +174,14 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
YGDisplayFlex: {value: 'Display.Flex'},
|
||||
YGDisplayNone: {value: 'Display.None'},
|
||||
YGDisplayContents: {value: 'Display.Contents'},
|
||||
|
||||
YGBoxSizingBorderBox: {value: 'BoxSizing.BorderBox'},
|
||||
YGBoxSizingContentBox: {value: 'BoxSizing.ContentBox'},
|
||||
|
||||
YGMaxContent: {value: 'max-content'},
|
||||
YGFitContent: {value: 'fit-content'},
|
||||
YGStretch: {value: 'stretch'},
|
||||
|
||||
YGNodeCalculateLayout: {
|
||||
value: function (node, dir, _experiments) {
|
||||
@@ -361,14 +376,22 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
|
||||
YGNodeStyleSetPosition: {
|
||||
value: function (nodeName, edge, value) {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setPosition(' +
|
||||
toValueJavascript(edge) +
|
||||
', ' +
|
||||
toValueJavascript(value) +
|
||||
');',
|
||||
);
|
||||
const valueStr = toValueJavascript(value);
|
||||
|
||||
if (valueStr == "'auto'") {
|
||||
this.push(
|
||||
nodeName + '.setPositionAuto(' + toValueJavascript(edge) + ');',
|
||||
);
|
||||
} else {
|
||||
this.push(
|
||||
nodeName +
|
||||
'.setPosition(' +
|
||||
toValueJavascript(edge) +
|
||||
', ' +
|
||||
valueStr +
|
||||
');',
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -398,4 +421,20 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeStyleSetBoxSizing: {
|
||||
value: function (nodeName, value) {
|
||||
this.push(nodeName + '.setBoxSizing(' + toValueJavascript(value) + ');');
|
||||
},
|
||||
},
|
||||
|
||||
YGNodeSetMeasureFunc: {
|
||||
value: function (nodeName, innerText, flexDirection) {
|
||||
this.push(
|
||||
`${nodeName}.setMeasureFunc(instrinsicSizeMeasureFunc.bind({text: "${innerText}", flexDirection: ${toValueJavascript(
|
||||
flexDirection,
|
||||
)}}));`,
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@@ -5,12 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
.PositionGuide {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 10px;
|
||||
user-select: none;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function gentestLog(message) {
|
||||
console.log('gentest-log: ', message);
|
||||
}
|
@@ -11,30 +11,33 @@ import * as fs from 'node:fs/promises';
|
||||
import {dirname} from 'path';
|
||||
import {fileURLToPath} from 'url';
|
||||
import signedsource from 'signedsource';
|
||||
import {glob} from 'glob';
|
||||
|
||||
const yogaDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
||||
const cppTestDir = `${yogaDir}/tests/generated`;
|
||||
const jsTestDir = `${yogaDir}/javascript/tests/generated`;
|
||||
const javaTestDir = `${yogaDir}/java/tests/com/facebook/yoga`;
|
||||
const testDirs = [cppTestDir, jsTestDir, javaTestDir];
|
||||
const yogaRootDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
||||
|
||||
for (const testDir of testDirs) {
|
||||
const tests = await fs.readdir(testDir);
|
||||
const filesToValidate = await glob(
|
||||
[
|
||||
'tests/generated/**/*.{h,cpp}',
|
||||
'javascript/tests/generated/**/*.test.ts',
|
||||
'java/tests/generated/com/facebook/yoga/**/*.java',
|
||||
],
|
||||
{
|
||||
cwd: yogaRootDir,
|
||||
},
|
||||
);
|
||||
|
||||
for (const test of tests) {
|
||||
const testData = await fs.readFile(`${testDir}/${test}`, 'utf8');
|
||||
try {
|
||||
const validSignature = signedsource.verifySignature(testData);
|
||||
if (!validSignature) {
|
||||
console.error(`Invalid signature for ${test}`);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
} catch (e) {
|
||||
// Java test dir does not separate generated tests from non-generated ones
|
||||
if (testDir != javaTestDir) {
|
||||
console.error(`${test}: ${e}`);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
console.log(`Found ${filesToValidate.length} files to validate`);
|
||||
|
||||
for (const file of filesToValidate) {
|
||||
const content = await fs.readFile(`${yogaRootDir}/${file}`, 'utf8');
|
||||
if (signedsource.isSigned(content)) {
|
||||
console.log(`Checking ${file}`);
|
||||
const validSignature = signedsource.verifySignature(content);
|
||||
if (!validSignature) {
|
||||
console.error(`Invalid signature "${file}"`);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
} else {
|
||||
console.log(`Skipped ${file}`);
|
||||
}
|
||||
}
|
||||
|
@@ -175,6 +175,7 @@ function checkDefaultValues() {
|
||||
{style: 'right', value: 'undefined'},
|
||||
{style: 'bottom', value: 'undefined'},
|
||||
{style: 'display', value: 'flex'},
|
||||
{style: 'box-sizing', value: 'border-box'},
|
||||
].forEach(item => {
|
||||
assert(
|
||||
isDefaultStyleValue(item.style, item.value),
|
||||
@@ -193,7 +194,6 @@ function setupTestTree(
|
||||
index,
|
||||
) {
|
||||
e.emitTestTreePrologue(nodeName);
|
||||
|
||||
for (const style in node.style) {
|
||||
// Skip position info for root as it messes up tests
|
||||
if (
|
||||
@@ -207,7 +207,6 @@ function setupTestTree(
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isDefaultStyleValue(style, node.style[style])) {
|
||||
switch (style) {
|
||||
case 'aspect-ratio':
|
||||
@@ -520,6 +519,11 @@ function setupTestTree(
|
||||
case 'display':
|
||||
e.YGNodeStyleSetDisplay(nodeName, displayValue(e, node.style[style]));
|
||||
break;
|
||||
case 'box-sizing':
|
||||
e.YGNodeStyleSetBoxSizing(
|
||||
nodeName,
|
||||
boxSizingValue(e, node.style[style]),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -528,6 +532,14 @@ function setupTestTree(
|
||||
e.YGNodeInsertChild(parentName, nodeName, index);
|
||||
}
|
||||
|
||||
if (node.innerText && node.children.length === 0) {
|
||||
e.YGNodeSetMeasureFunc(
|
||||
nodeName,
|
||||
node.innerText,
|
||||
flexDirectionValue(e, node.style['flex-direction']),
|
||||
);
|
||||
}
|
||||
|
||||
for (let i = 0; i < node.children.length; i++) {
|
||||
e.push('');
|
||||
const childName = nodeName + '_child' + i;
|
||||
@@ -646,6 +658,13 @@ function pointValue(e, value) {
|
||||
return e.YGAuto;
|
||||
case 'undefined':
|
||||
return e.YGUndefined;
|
||||
case 'max-content':
|
||||
return e.YGMaxContent;
|
||||
case 'fit-content':
|
||||
return e.YGFitContent;
|
||||
case 'stretch':
|
||||
case '-webkit-fill-available':
|
||||
return e.YGStretch;
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
@@ -657,6 +676,17 @@ function displayValue(e, value) {
|
||||
return e.YGDisplayFlex;
|
||||
case 'none':
|
||||
return e.YGDisplayNone;
|
||||
case 'contents':
|
||||
return e.YGDisplayContents;
|
||||
}
|
||||
}
|
||||
|
||||
function boxSizingValue(e, value) {
|
||||
switch (value) {
|
||||
case 'border-box':
|
||||
return e.YGBoxSizingBorderBox;
|
||||
case 'content-box':
|
||||
return e.YGBoxSizingContentBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -723,6 +753,7 @@ function calculateTree(root, parentOffsetLeft, parentOffsetTop) {
|
||||
? child.dataset.experiments.split(' ')
|
||||
: [],
|
||||
disabled: child.dataset.disabled === 'true',
|
||||
innerText: child.innerText,
|
||||
};
|
||||
|
||||
const size = getRoundedSize(child);
|
||||
@@ -777,6 +808,7 @@ function getYogaStyle(node) {
|
||||
'row-gap',
|
||||
'display',
|
||||
'aspect-ratio',
|
||||
'box-sizing',
|
||||
].reduce((map, key) => {
|
||||
map[key] =
|
||||
node.style[key] || getComputedStyle(node, null).getPropertyValue(key);
|
||||
|
@@ -3,8 +3,8 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"gentest": "node --loader=babel-register-esm ./gentest-driver.ts",
|
||||
"gentest-validate": "node --loader=babel-register-esm ./gentest-validate.ts"
|
||||
"gentest": "node --disable-warning=ExperimentalWarning --loader=babel-register-esm ./gentest-driver.ts",
|
||||
"gentest-validate": "node --disable-warning=ExperimentalWarning --loader=babel-register-esm ./gentest-validate.ts"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
@@ -19,6 +19,7 @@
|
||||
"@types/minimist": "^1.2.5",
|
||||
"@types/node": "^20.10.3",
|
||||
"@types/selenium-webdriver": "^4.1.21",
|
||||
"babel-register-esm": "^1.2.5"
|
||||
"babel-register-esm": "^1.2.5",
|
||||
"glob": "^10.4.2"
|
||||
}
|
||||
}
|
||||
|
@@ -1,70 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>%s</title>
|
||||
<script src="gentest.js"></script>
|
||||
<script src="gentest-cpp.js"></script>
|
||||
<script src="gentest-java.js"></script>
|
||||
<script src="gentest-javascript.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: Helvetica;
|
||||
font-size: 14px;
|
||||
font-weight: 100;
|
||||
}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>%s</title>
|
||||
<script src="gentest.js"></script>
|
||||
<script src="gentest-cpp.js"></script>
|
||||
<script src="gentest-java.js"></script>
|
||||
<script src="gentest-javascript.js"></script>
|
||||
<script src="gentest-log.js"></script>
|
||||
|
||||
div, span {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border: 0 solid black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Ahem';
|
||||
src: url('./fonts/Ahem.ttf') format('truetype');
|
||||
}
|
||||
|
||||
body > * {
|
||||
position: absolute;
|
||||
}
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font: 10px/1 Ahem;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
#ltr-container > * {
|
||||
position: absolute;
|
||||
direction: ltr;
|
||||
}
|
||||
div,
|
||||
span {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border: 0 solid black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#rtl-container > * {
|
||||
position: absolute;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
body>* {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
<body>
|
||||
<div id='ltr-container'>
|
||||
#ltr-container>* {
|
||||
position: absolute;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
%s
|
||||
#rtl-container>* {
|
||||
position: absolute;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
<div id='rtl-container'>
|
||||
</style>
|
||||
</head>
|
||||
|
||||
%s
|
||||
<body>
|
||||
<div id='ltr-container'>
|
||||
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
%s
|
||||
|
||||
<div>
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
<div id='rtl-container'>
|
||||
|
||||
%s
|
||||
%s
|
||||
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
%s
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -11,4 +11,4 @@ android.useAndroidX=true
|
||||
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
|
||||
VERSION_NAME=3.0.1
|
||||
VERSION_NAME=0.0.0
|
||||
|
@@ -1,17 +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.
|
||||
*/
|
||||
|
||||
// You can use this script to configure the gradleEnterprise{} block in your build.
|
||||
// You need to rename this file to ./gradle/gradle-enterprise.gradle.kts in order for
|
||||
// this to be processed.
|
||||
extensions.getByName("gradleEnterprise").withGroovyBuilder {
|
||||
setProperty("server", "https://your-gradle-enterprise-instance.example.com")
|
||||
getProperty("buildScan").withGroovyBuilder {
|
||||
"publishAlways"()
|
||||
"tag"(if(System.getenv("CI") != null) "CI" else "Local")
|
||||
}
|
||||
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
26
gradlew
vendored
26
gradlew
vendored
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# 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
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -83,7 +85,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -130,10 +133,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
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.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
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
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -141,7 +147,7 @@ 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
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -149,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -198,11 +204,11 @@ fi
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# 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.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
22
gradlew.bat
vendored
22
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,11 @@ 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.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,11 +59,11 @@ 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.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
@@ -1,4 +1,17 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.facebook.yoga"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
>
|
||||
|
||||
<application/>
|
||||
|
||||
|
@@ -9,6 +9,7 @@ plugins {
|
||||
id("com.android.library")
|
||||
id("maven-publish")
|
||||
id("signing")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
}
|
||||
|
||||
group = "com.facebook.yoga"
|
||||
@@ -21,15 +22,16 @@ val ndkVersionProperty: String by rootProject.extra
|
||||
|
||||
android {
|
||||
namespace = "com.facebook.yoga"
|
||||
compileSdk = 34
|
||||
buildToolsVersion = "34.0.0"
|
||||
ndkVersion = "26.0.10792818"
|
||||
compileSdk = 35
|
||||
buildToolsVersion = "35.0.0"
|
||||
ndkVersion = "27.1.12297006"
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 21
|
||||
consumerProguardFiles("proguard-rules.pro")
|
||||
|
||||
ndk { abiFilters.addAll(setOf("x86", "x86_64", "armeabi-v7a", "arm64-v8a")) }
|
||||
externalNativeBuild { cmake { arguments("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON") } }
|
||||
}
|
||||
|
||||
externalNativeBuild { cmake { path("CMakeLists.txt") } }
|
||||
@@ -47,6 +49,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kotlinOptions { jvmTarget = "1.8" }
|
||||
|
||||
publishing {
|
||||
multipleVariants {
|
||||
withSourcesJar()
|
||||
@@ -59,6 +63,7 @@ android {
|
||||
dependencies {
|
||||
implementation("com.google.code.findbugs:jsr305:3.0.2")
|
||||
implementation("com.facebook.soloader:soloader:0.10.5")
|
||||
implementation("androidx.core:core-ktx:1.16.0")
|
||||
testImplementation("junit:junit:4.12")
|
||||
}
|
||||
|
||||
@@ -78,7 +83,8 @@ publishing {
|
||||
afterEvaluate { from(components["default"]) }
|
||||
pom {
|
||||
description.set(
|
||||
"An embeddable and performant flexbox layout engine with bindings for multiple languages")
|
||||
"An embeddable and performant flexbox layout engine with bindings for multiple languages"
|
||||
)
|
||||
name.set(project.name)
|
||||
url.set("https://github.com/facebook/yoga.git")
|
||||
licenses {
|
||||
|
@@ -1,43 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public enum LayoutPassReason {
|
||||
INITIAL(0),
|
||||
ABS_LAYOUT(1),
|
||||
STRETCH(2),
|
||||
MULTILINE_STRETCH(3),
|
||||
FLEX_LAYOUT(4),
|
||||
MEASURE(5),
|
||||
ABS_MEASURE(6),
|
||||
FLEX_MEASURE(7);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
LayoutPassReason(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
public int intValue() {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static LayoutPassReason fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return INITIAL;
|
||||
case 1: return ABS_LAYOUT;
|
||||
case 2: return STRETCH;
|
||||
case 3: return MULTILINE_STRETCH;
|
||||
case 4: return FLEX_LAYOUT;
|
||||
case 5: return MEASURE;
|
||||
case 6: return ABS_MEASURE;
|
||||
case 7: return FLEX_MEASURE;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
||||
}
|
35
java/com/facebook/yoga/LayoutPassReason.kt
Normal file
35
java/com/facebook/yoga/LayoutPassReason.kt
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public enum class LayoutPassReason(public val intValue: Int) {
|
||||
INITIAL(0),
|
||||
ABS_LAYOUT(1),
|
||||
STRETCH(2),
|
||||
MULTILINE_STRETCH(3),
|
||||
FLEX_LAYOUT(4),
|
||||
MEASURE(5),
|
||||
ABS_MEASURE(6),
|
||||
FLEX_MEASURE(7);
|
||||
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
public fun fromInt(value: Int): LayoutPassReason =
|
||||
when (value) {
|
||||
0 -> INITIAL
|
||||
1 -> ABS_LAYOUT
|
||||
2 -> STRETCH
|
||||
3 -> MULTILINE_STRETCH
|
||||
4 -> FLEX_LAYOUT
|
||||
5 -> MEASURE
|
||||
6 -> ABS_MEASURE
|
||||
7 -> FLEX_MEASURE
|
||||
else -> throw IllegalArgumentException("Unknown enum value: $value")
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,12 +5,12 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
package com.facebook.yoga
|
||||
|
||||
public interface YogaBaselineFunction {
|
||||
public fun interface YogaBaselineFunction {
|
||||
/**
|
||||
* Return the baseline of the node in points. When no baseline function is set the baseline
|
||||
* default to the computed height of the node.
|
||||
*/
|
||||
float baseline(YogaNode node, float width, float height);
|
||||
public fun baseline(node: YogaNode, width: Float, height: Float): Float
|
||||
}
|
@@ -5,17 +5,17 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @generated by enums.py
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public enum YogaLayoutType {
|
||||
LAYOUT(0),
|
||||
MEASURE(1),
|
||||
CACHED_LAYOUT(2),
|
||||
CACHED_MEASURE(3);
|
||||
public enum YogaBoxSizing {
|
||||
BORDER_BOX(0),
|
||||
CONTENT_BOX(1);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
YogaLayoutType(int intValue) {
|
||||
YogaBoxSizing(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -23,12 +23,10 @@ public enum YogaLayoutType {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static YogaLayoutType fromInt(int value) {
|
||||
public static YogaBoxSizing fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return LAYOUT;
|
||||
case 1: return MEASURE;
|
||||
case 2: return CACHED_LAYOUT;
|
||||
case 3: return CACHED_MEASURE;
|
||||
case 0: return BORDER_BOX;
|
||||
case 1: return CONTENT_BOX;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
@@ -1,29 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public abstract class YogaConfig {
|
||||
|
||||
public static int SPACING_TYPE = 1;
|
||||
|
||||
public abstract void setExperimentalFeatureEnabled(YogaExperimentalFeature feature, boolean enabled);
|
||||
|
||||
public abstract void setUseWebDefaults(boolean useWebDefaults);
|
||||
|
||||
public abstract void setPointScaleFactor(float pixelsInPoint);
|
||||
|
||||
public abstract void setErrata(YogaErrata errata);
|
||||
|
||||
public abstract YogaErrata getErrata();
|
||||
|
||||
public abstract void setLogger(YogaLogger logger);
|
||||
|
||||
public abstract YogaLogger getLogger();
|
||||
|
||||
protected abstract long getNativePointer();
|
||||
}
|
33
java/com/facebook/yoga/YogaConfig.kt
Normal file
33
java/com/facebook/yoga/YogaConfig.kt
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public abstract class YogaConfig {
|
||||
public abstract fun setExperimentalFeatureEnabled(
|
||||
feature: YogaExperimentalFeature,
|
||||
enabled: Boolean,
|
||||
)
|
||||
|
||||
public abstract fun setUseWebDefaults(useWebDefaults: Boolean)
|
||||
|
||||
public abstract fun setPointScaleFactor(pixelsInPoint: Float)
|
||||
|
||||
public abstract fun setErrata(errata: YogaErrata)
|
||||
|
||||
public abstract fun getErrata(): YogaErrata
|
||||
|
||||
public abstract fun setLogger(logger: YogaLogger)
|
||||
|
||||
public abstract fun getLogger(): YogaLogger
|
||||
|
||||
protected abstract fun getNativePointer(): Long
|
||||
|
||||
public companion object {
|
||||
public var SPACING_TYPE: Int = 1
|
||||
}
|
||||
}
|
@@ -5,10 +5,8 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
package com.facebook.yoga
|
||||
|
||||
public abstract class YogaConfigFactory {
|
||||
public static YogaConfig create() {
|
||||
return new YogaConfigJNIFinalizer();
|
||||
}
|
||||
public object YogaConfigFactory {
|
||||
@JvmStatic public fun create(): YogaConfig = YogaConfigJNIFinalizer()
|
||||
}
|
@@ -1,25 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public class YogaConstants {
|
||||
|
||||
public static final float UNDEFINED = Float.NaN;
|
||||
|
||||
public static boolean isUndefined(float value) {
|
||||
return Float.compare(value, UNDEFINED) == 0;
|
||||
}
|
||||
|
||||
public static boolean isUndefined(YogaValue value) {
|
||||
return value.unit == YogaUnit.UNDEFINED;
|
||||
}
|
||||
|
||||
public static float getUndefined() {
|
||||
return UNDEFINED;
|
||||
}
|
||||
}
|
18
java/com/facebook/yoga/YogaConstants.kt
Normal file
18
java/com/facebook/yoga/YogaConstants.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public object YogaConstants {
|
||||
@JvmField public val UNDEFINED: Float = Float.NaN
|
||||
|
||||
@JvmStatic public fun isUndefined(value: Float): Boolean = value.compareTo(UNDEFINED) == 0
|
||||
|
||||
@JvmStatic public fun isUndefined(value: YogaValue): Boolean = value.unit == YogaUnit.UNDEFINED
|
||||
|
||||
@JvmStatic public fun getUndefined(): Float = UNDEFINED
|
||||
}
|
@@ -11,7 +11,8 @@ package com.facebook.yoga;
|
||||
|
||||
public enum YogaDisplay {
|
||||
FLEX(0),
|
||||
NONE(1);
|
||||
NONE(1),
|
||||
CONTENTS(2);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
@@ -27,6 +28,7 @@ public enum YogaDisplay {
|
||||
switch (value) {
|
||||
case 0: return FLEX;
|
||||
case 1: return NONE;
|
||||
case 2: return CONTENTS;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ package com.facebook.yoga;
|
||||
public enum YogaErrata {
|
||||
NONE(0),
|
||||
STRETCH_FLEX_BASIS(1),
|
||||
ABSOLUTE_POSITIONING_INCORRECT(2),
|
||||
ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING(2),
|
||||
ABSOLUTE_PERCENT_AGAINST_INNER_SIZE(4),
|
||||
ALL(2147483647),
|
||||
CLASSIC(2147483646);
|
||||
@@ -31,7 +31,7 @@ public enum YogaErrata {
|
||||
switch (value) {
|
||||
case 0: return NONE;
|
||||
case 1: return STRETCH_FLEX_BASIS;
|
||||
case 2: return ABSOLUTE_POSITIONING_INCORRECT;
|
||||
case 2: return ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING;
|
||||
case 4: return ABSOLUTE_PERCENT_AGAINST_INNER_SIZE;
|
||||
case 2147483647: return ALL;
|
||||
case 2147483646: return CLASSIC;
|
||||
|
27
java/com/facebook/yoga/YogaLayoutType.kt
Normal file
27
java/com/facebook/yoga/YogaLayoutType.kt
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public enum class YogaLayoutType(public val intValue: Int) {
|
||||
LAYOUT(0),
|
||||
MEASURE(1),
|
||||
CACHED_LAYOUT(2),
|
||||
CACHED_MEASURE(3);
|
||||
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
public fun fromInt(value: Int): YogaLayoutType =
|
||||
when (value) {
|
||||
0 -> LAYOUT
|
||||
1 -> MEASURE
|
||||
2 -> CACHED_LAYOUT
|
||||
3 -> CACHED_MEASURE
|
||||
else -> throw IllegalArgumentException("Unknown enum value: $value")
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,16 +5,15 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
package com.facebook.yoga
|
||||
|
||||
import com.facebook.yoga.annotations.DoNotStrip;
|
||||
import com.facebook.yoga.annotations.DoNotStrip
|
||||
|
||||
/**
|
||||
* Interface for receiving logs from native layer. Use by setting YogaNode.setLogger(myLogger);
|
||||
* See YogaLogLevel for the different log levels.
|
||||
* Interface for receiving logs from native layer. Use by setting YogaNode.setLogger(myLogger); See
|
||||
* YogaLogLevel for the different log levels.
|
||||
*/
|
||||
@DoNotStrip
|
||||
public interface YogaLogger {
|
||||
@DoNotStrip
|
||||
void log(YogaLogLevel level, String message);
|
||||
public fun interface YogaLogger {
|
||||
@DoNotStrip public fun log(level: YogaLogLevel, message: String)
|
||||
}
|
@@ -1,20 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public interface YogaMeasureFunction {
|
||||
/**
|
||||
* Return a value created by YogaMeasureOutput.make(width, height);
|
||||
*/
|
||||
long measure(
|
||||
YogaNode node,
|
||||
float width,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
YogaMeasureMode heightMode);
|
||||
}
|
19
java/com/facebook/yoga/YogaMeasureFunction.kt
Normal file
19
java/com/facebook/yoga/YogaMeasureFunction.kt
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public fun interface YogaMeasureFunction {
|
||||
/** Return a value created by YogaMeasureOutput.make(width, height); */
|
||||
public fun measure(
|
||||
node: YogaNode,
|
||||
width: Float,
|
||||
widthMode: YogaMeasureMode,
|
||||
height: Float,
|
||||
heightMode: YogaMeasureMode,
|
||||
): Long
|
||||
}
|
@@ -1,32 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
/**
|
||||
* Helpers for building measure output value.
|
||||
*/
|
||||
public class YogaMeasureOutput {
|
||||
|
||||
public static long make(float width, float height) {
|
||||
final int wBits = Float.floatToRawIntBits(width);
|
||||
final int hBits = Float.floatToRawIntBits(height);
|
||||
return ((long) wBits) << 32 | ((long) hBits);
|
||||
}
|
||||
|
||||
public static long make(int width, int height) {
|
||||
return make((float) width, (float) height);
|
||||
}
|
||||
|
||||
public static float getWidth(long measureOutput) {
|
||||
return Float.intBitsToFloat((int) (0xFFFFFFFF & (measureOutput >> 32)));
|
||||
}
|
||||
|
||||
public static float getHeight(long measureOutput) {
|
||||
return Float.intBitsToFloat((int) (0xFFFFFFFF & measureOutput));
|
||||
}
|
||||
}
|
29
java/com/facebook/yoga/YogaMeasureOutput.kt
Normal file
29
java/com/facebook/yoga/YogaMeasureOutput.kt
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
/** Helpers for building measure output value. */
|
||||
public object YogaMeasureOutput {
|
||||
@JvmStatic
|
||||
public fun make(width: Float, height: Float): Long {
|
||||
val wBits = java.lang.Float.floatToRawIntBits(width)
|
||||
val hBits = java.lang.Float.floatToRawIntBits(height)
|
||||
return (wBits.toLong()) shl 32 or (hBits.toLong())
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun make(width: Int, height: Int): Long = make(width.toFloat(), height.toFloat())
|
||||
|
||||
@JvmStatic
|
||||
public fun getWidth(measureOutput: Long): Float =
|
||||
java.lang.Float.intBitsToFloat((0xFFFFFFFFL and (measureOutput shr 32)).toInt())
|
||||
|
||||
@JvmStatic
|
||||
public fun getHeight(measureOutput: Long): Float =
|
||||
java.lang.Float.intBitsToFloat((0xFFFFFFFFL and measureOutput).toInt())
|
||||
}
|
@@ -1,116 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
import com.facebook.yoga.annotations.DoNotStrip;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
@DoNotStrip
|
||||
public class YogaNative {
|
||||
static {
|
||||
SoLoader.loadLibrary("yoga");
|
||||
}
|
||||
|
||||
// JNI methods that use Vanilla JNI
|
||||
// YGConfig related
|
||||
static native long jni_YGConfigNewJNI();
|
||||
static native void jni_YGConfigFreeJNI(long nativePointer);
|
||||
static native void jni_YGConfigSetExperimentalFeatureEnabledJNI(long nativePointer, int feature, boolean enabled);
|
||||
static native void jni_YGConfigSetUseWebDefaultsJNI(long nativePointer, boolean useWebDefaults);
|
||||
static native void jni_YGConfigSetPointScaleFactorJNI(long nativePointer, float pixelsInPoint);
|
||||
static native void jni_YGConfigSetErrataJNI(long nativePointer, int errata);
|
||||
static native int jni_YGConfigGetErrataJNI(long nativePointer);
|
||||
static native void jni_YGConfigSetLoggerJNI(long nativePointer, YogaLogger logger);
|
||||
|
||||
// YGNode related
|
||||
static native long jni_YGNodeNewJNI();
|
||||
static native long jni_YGNodeNewWithConfigJNI(long configPointer);
|
||||
static native void jni_YGNodeFinalizeJNI(long nativePointer);
|
||||
static native void jni_YGNodeResetJNI(long nativePointer);
|
||||
static native void jni_YGNodeInsertChildJNI(long nativePointer, long childPointer, int index);
|
||||
static native void jni_YGNodeSwapChildJNI(long nativePointer, long childPointer, int index);
|
||||
static native void jni_YGNodeSetIsReferenceBaselineJNI(long nativePointer, boolean isReferenceBaseline);
|
||||
static native boolean jni_YGNodeIsReferenceBaselineJNI(long nativePointer);
|
||||
static native void jni_YGNodeRemoveAllChildrenJNI(long nativePointer);
|
||||
static native void jni_YGNodeRemoveChildJNI(long nativePointer, long childPointer);
|
||||
static native void jni_YGNodeCalculateLayoutJNI(long nativePointer, float width, float height, long[] nativePointers, YogaNodeJNIBase[] nodes);
|
||||
static native void jni_YGNodeMarkDirtyJNI(long nativePointer);
|
||||
static native boolean jni_YGNodeIsDirtyJNI(long nativePointer);
|
||||
static native void jni_YGNodeCopyStyleJNI(long dstNativePointer, long srcNativePointer);
|
||||
static native int jni_YGNodeStyleGetDirectionJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetDirectionJNI(long nativePointer, int direction);
|
||||
static native int jni_YGNodeStyleGetFlexDirectionJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetFlexDirectionJNI(long nativePointer, int flexDirection);
|
||||
static native int jni_YGNodeStyleGetJustifyContentJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetJustifyContentJNI(long nativePointer, int justifyContent);
|
||||
static native int jni_YGNodeStyleGetAlignItemsJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetAlignItemsJNI(long nativePointer, int alignItems);
|
||||
static native int jni_YGNodeStyleGetAlignSelfJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetAlignSelfJNI(long nativePointer, int alignSelf);
|
||||
static native int jni_YGNodeStyleGetAlignContentJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetAlignContentJNI(long nativePointer, int alignContent);
|
||||
static native int jni_YGNodeStyleGetPositionTypeJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetPositionTypeJNI(long nativePointer, int positionType);
|
||||
static native int jni_YGNodeStyleGetFlexWrapJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetFlexWrapJNI(long nativePointer, int wrapType);
|
||||
static native int jni_YGNodeStyleGetOverflowJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetOverflowJNI(long nativePointer, int overflow);
|
||||
static native int jni_YGNodeStyleGetDisplayJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetDisplayJNI(long nativePointer, int display);
|
||||
static native float jni_YGNodeStyleGetFlexJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetFlexJNI(long nativePointer, float flex);
|
||||
static native float jni_YGNodeStyleGetFlexGrowJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetFlexGrowJNI(long nativePointer, float flexGrow);
|
||||
static native float jni_YGNodeStyleGetFlexShrinkJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetFlexShrinkJNI(long nativePointer, float flexShrink);
|
||||
static native long jni_YGNodeStyleGetFlexBasisJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetFlexBasisJNI(long nativePointer, float flexBasis);
|
||||
static native void jni_YGNodeStyleSetFlexBasisPercentJNI(long nativePointer, float percent);
|
||||
static native void jni_YGNodeStyleSetFlexBasisAutoJNI(long nativePointer);
|
||||
static native long jni_YGNodeStyleGetMarginJNI(long nativePointer, int edge);
|
||||
static native void jni_YGNodeStyleSetMarginJNI(long nativePointer, int edge, float margin);
|
||||
static native void jni_YGNodeStyleSetMarginPercentJNI(long nativePointer, int edge, float percent);
|
||||
static native void jni_YGNodeStyleSetMarginAutoJNI(long nativePointer, int edge);
|
||||
static native long jni_YGNodeStyleGetPaddingJNI(long nativePointer, int edge);
|
||||
static native void jni_YGNodeStyleSetPaddingJNI(long nativePointer, int edge, float padding);
|
||||
static native void jni_YGNodeStyleSetPaddingPercentJNI(long nativePointer, int edge, float percent);
|
||||
static native float jni_YGNodeStyleGetBorderJNI(long nativePointer, int edge);
|
||||
static native void jni_YGNodeStyleSetBorderJNI(long nativePointer, int edge, float border);
|
||||
static native long jni_YGNodeStyleGetPositionJNI(long nativePointer, int edge);
|
||||
static native void jni_YGNodeStyleSetPositionJNI(long nativePointer, int edge, float position);
|
||||
static native void jni_YGNodeStyleSetPositionPercentJNI(long nativePointer, int edge, float percent);
|
||||
static native long jni_YGNodeStyleGetWidthJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetWidthJNI(long nativePointer, float width);
|
||||
static native void jni_YGNodeStyleSetWidthPercentJNI(long nativePointer, float percent);
|
||||
static native void jni_YGNodeStyleSetWidthAutoJNI(long nativePointer);
|
||||
static native long jni_YGNodeStyleGetHeightJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetHeightJNI(long nativePointer, float height);
|
||||
static native void jni_YGNodeStyleSetHeightPercentJNI(long nativePointer, float percent);
|
||||
static native void jni_YGNodeStyleSetHeightAutoJNI(long nativePointer);
|
||||
static native long jni_YGNodeStyleGetMinWidthJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetMinWidthJNI(long nativePointer, float minWidth);
|
||||
static native void jni_YGNodeStyleSetMinWidthPercentJNI(long nativePointer, float percent);
|
||||
static native long jni_YGNodeStyleGetMinHeightJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetMinHeightJNI(long nativePointer, float minHeight);
|
||||
static native void jni_YGNodeStyleSetMinHeightPercentJNI(long nativePointer, float percent);
|
||||
static native long jni_YGNodeStyleGetMaxWidthJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetMaxWidthJNI(long nativePointer, float maxWidth);
|
||||
static native void jni_YGNodeStyleSetMaxWidthPercentJNI(long nativePointer, float percent);
|
||||
static native long jni_YGNodeStyleGetMaxHeightJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetMaxHeightJNI(long nativePointer, float maxheight);
|
||||
static native void jni_YGNodeStyleSetMaxHeightPercentJNI(long nativePointer, float percent);
|
||||
static native float jni_YGNodeStyleGetAspectRatioJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetAspectRatioJNI(long nativePointer, float aspectRatio);
|
||||
static native float jni_YGNodeStyleGetGapJNI(long nativePointer, int gutter);
|
||||
static native void jni_YGNodeStyleSetGapJNI(long nativePointer, int gutter, float gapLength);
|
||||
static native void jni_YGNodeSetHasMeasureFuncJNI(long nativePointer, boolean hasMeasureFunc);
|
||||
static native void jni_YGNodeSetHasBaselineFuncJNI(long nativePointer, boolean hasMeasureFunc);
|
||||
static native void jni_YGNodeSetStyleInputsJNI(long nativePointer, float[] styleInputsArray, int size);
|
||||
static native long jni_YGNodeCloneJNI(long nativePointer);
|
||||
static native void jni_YGNodeSetAlwaysFormsContainingBlockJNI(long nativePointer, boolean alwaysFormContainingBlock);
|
||||
}
|
331
java/com/facebook/yoga/YogaNative.kt
Normal file
331
java/com/facebook/yoga/YogaNative.kt
Normal file
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
import com.facebook.soloader.SoLoader
|
||||
import com.facebook.yoga.annotations.DoNotStrip
|
||||
|
||||
@DoNotStrip
|
||||
public object YogaNative {
|
||||
init {
|
||||
SoLoader.loadLibrary("yoga")
|
||||
}
|
||||
|
||||
// JNI methods that use Vanilla JNI
|
||||
// YGConfig related
|
||||
@JvmStatic public external fun jni_YGConfigNewJNI(): Long
|
||||
|
||||
@JvmStatic public external fun jni_YGConfigFreeJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGConfigSetExperimentalFeatureEnabledJNI(
|
||||
nativePointer: Long,
|
||||
feature: Int,
|
||||
enabled: Boolean,
|
||||
)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGConfigSetUseWebDefaultsJNI(nativePointer: Long, useWebDefaults: Boolean)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGConfigSetPointScaleFactorJNI(nativePointer: Long, pixelsInPoint: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGConfigSetErrataJNI(nativePointer: Long, errata: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGConfigGetErrataJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic public external fun jni_YGConfigSetLoggerJNI(nativePointer: Long, logger: YogaLogger)
|
||||
|
||||
// YGNode related
|
||||
@JvmStatic public external fun jni_YGNodeNewJNI(): Long
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeNewWithConfigJNI(configPointer: Long): Long
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeFinalizeJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeResetJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeInsertChildJNI(nativePointer: Long, childPointer: Long, index: Int)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSwapChildJNI(nativePointer: Long, childPointer: Long, index: Int)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSetIsReferenceBaselineJNI(
|
||||
nativePointer: Long,
|
||||
isReferenceBaseline: Boolean,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeIsReferenceBaselineJNI(nativePointer: Long): Boolean
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeRemoveAllChildrenJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeRemoveChildJNI(nativePointer: Long, childPointer: Long)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeCalculateLayoutJNI(
|
||||
nativePointer: Long,
|
||||
width: Float,
|
||||
height: Float,
|
||||
nativePointers: LongArray,
|
||||
nodes: Array<YogaNodeJNIBase>,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeMarkDirtyJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeIsDirtyJNI(nativePointer: Long): Boolean
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeCopyStyleJNI(dstNativePointer: Long, srcNativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetDirectionJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetDirectionJNI(nativePointer: Long, direction: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetFlexDirectionJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetFlexDirectionJNI(nativePointer: Long, flexDirection: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetJustifyContentJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetJustifyContentJNI(nativePointer: Long, justifyContent: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetAlignItemsJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetAlignItemsJNI(nativePointer: Long, alignItems: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetAlignSelfJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetAlignSelfJNI(nativePointer: Long, alignSelf: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetAlignContentJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetAlignContentJNI(nativePointer: Long, alignContent: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetPositionTypeJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetPositionTypeJNI(nativePointer: Long, positionType: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetBoxSizingJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetBoxSizingJNI(nativePointer: Long, boxSizing: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetFlexWrapJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetFlexWrapJNI(nativePointer: Long, wrapType: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetOverflowJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetOverflowJNI(nativePointer: Long, overflow: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetDisplayJNI(nativePointer: Long): Int
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetDisplayJNI(nativePointer: Long, display: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetFlexJNI(nativePointer: Long): Float
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetFlexJNI(nativePointer: Long, flex: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetFlexGrowJNI(nativePointer: Long): Float
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetFlexGrowJNI(nativePointer: Long, flexGrow: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetFlexShrinkJNI(nativePointer: Long): Float
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetFlexShrinkJNI(nativePointer: Long, flexShrink: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetFlexBasisJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetFlexBasisJNI(nativePointer: Long, flexBasis: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetFlexBasisPercentJNI(nativePointer: Long, percent: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetFlexBasisAutoJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetFlexBasisMaxContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetFlexBasisFitContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetFlexBasisStretchJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetMarginJNI(nativePointer: Long, edge: Int): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMarginJNI(nativePointer: Long, edge: Int, margin: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMarginPercentJNI(
|
||||
nativePointer: Long,
|
||||
edge: Int,
|
||||
percent: Float,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMarginAutoJNI(nativePointer: Long, edge: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetPaddingJNI(nativePointer: Long, edge: Int): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetPaddingJNI(nativePointer: Long, edge: Int, padding: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetPaddingPercentJNI(
|
||||
nativePointer: Long,
|
||||
edge: Int,
|
||||
percent: Float,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetBorderJNI(nativePointer: Long, edge: Int): Float
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetBorderJNI(nativePointer: Long, edge: Int, border: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetPositionJNI(nativePointer: Long, edge: Int): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetPositionJNI(nativePointer: Long, edge: Int, position: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetPositionPercentJNI(
|
||||
nativePointer: Long,
|
||||
edge: Int,
|
||||
percent: Float,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetPositionAutoJNI(nativePointer: Long, edge: Int)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetWidthJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetWidthJNI(nativePointer: Long, width: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetWidthPercentJNI(nativePointer: Long, percent: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetWidthAutoJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetWidthMaxContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetWidthFitContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetWidthStretchJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetHeightJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetHeightJNI(nativePointer: Long, height: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetHeightPercentJNI(nativePointer: Long, percent: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetHeightAutoJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetHeightMaxContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetHeightFitContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetHeightStretchJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetMinWidthJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMinWidthJNI(nativePointer: Long, minWidth: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMinWidthPercentJNI(nativePointer: Long, percent: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMinWidthMaxContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMinWidthFitContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMinWidthStretchJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetMinHeightJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMinHeightJNI(nativePointer: Long, minHeight: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMinHeightPercentJNI(nativePointer: Long, percent: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMinHeightMaxContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMinHeightFitContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMinHeightStretchJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetMaxWidthJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMaxWidthJNI(nativePointer: Long, maxWidth: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMaxWidthPercentJNI(nativePointer: Long, percent: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMaxWidthMaxContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMaxWidthFitContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMaxWidthStretchJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetMaxHeightJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMaxHeightJNI(nativePointer: Long, maxheight: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetMaxHeightPercentJNI(nativePointer: Long, percent: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMaxHeightMaxContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMaxHeightFitContentJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleSetMaxHeightStretchJNI(nativePointer: Long)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetAspectRatioJNI(nativePointer: Long): Float
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetAspectRatioJNI(nativePointer: Long, aspectRatio: Float)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeStyleGetGapJNI(nativePointer: Long, gutter: Int): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetGapJNI(nativePointer: Long, gutter: Int, gapLength: Float)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeStyleSetGapPercentJNI(
|
||||
nativePointer: Long,
|
||||
gutter: Int,
|
||||
gapLength: Float,
|
||||
)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSetHasMeasureFuncJNI(nativePointer: Long, hasMeasureFunc: Boolean)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSetHasBaselineFuncJNI(nativePointer: Long, hasMeasureFunc: Boolean)
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSetStyleInputsJNI(
|
||||
nativePointer: Long,
|
||||
styleInputsArray: FloatArray,
|
||||
size: Int,
|
||||
)
|
||||
|
||||
@JvmStatic public external fun jni_YGNodeCloneJNI(nativePointer: Long): Long
|
||||
|
||||
@JvmStatic
|
||||
public external fun jni_YGNodeSetAlwaysFormsContainingBlockJNI(
|
||||
nativePointer: Long,
|
||||
alwaysFormContainingBlock: Boolean,
|
||||
)
|
||||
}
|
@@ -88,6 +88,10 @@ public abstract class YogaNode implements YogaProps {
|
||||
|
||||
public abstract void setPositionType(YogaPositionType positionType);
|
||||
|
||||
public abstract YogaBoxSizing getBoxSizing();
|
||||
|
||||
public abstract void setBoxSizing(YogaBoxSizing boxSizing);
|
||||
|
||||
public abstract YogaWrap getWrap();
|
||||
|
||||
public abstract void setWrap(YogaWrap flexWrap);
|
||||
@@ -120,6 +124,12 @@ public abstract class YogaNode implements YogaProps {
|
||||
|
||||
public abstract void setFlexBasisAuto();
|
||||
|
||||
public abstract void setFlexBasisMaxContent();
|
||||
|
||||
public abstract void setFlexBasisFitContent();
|
||||
|
||||
public abstract void setFlexBasisStretch();
|
||||
|
||||
public abstract YogaValue getMargin(YogaEdge edge);
|
||||
|
||||
public abstract void setMargin(YogaEdge edge, float margin);
|
||||
@@ -144,6 +154,8 @@ public abstract class YogaNode implements YogaProps {
|
||||
|
||||
public abstract void setPositionPercent(YogaEdge edge, float percent);
|
||||
|
||||
public abstract void setPositionAuto(YogaEdge edge);
|
||||
|
||||
public abstract YogaValue getWidth();
|
||||
|
||||
public abstract void setWidth(float width);
|
||||
@@ -152,6 +164,12 @@ public abstract class YogaNode implements YogaProps {
|
||||
|
||||
public abstract void setWidthAuto();
|
||||
|
||||
public abstract void setWidthMaxContent();
|
||||
|
||||
public abstract void setWidthFitContent();
|
||||
|
||||
public abstract void setWidthStretch();
|
||||
|
||||
public abstract YogaValue getHeight();
|
||||
|
||||
public abstract void setHeight(float height);
|
||||
@@ -160,38 +178,70 @@ public abstract class YogaNode implements YogaProps {
|
||||
|
||||
public abstract void setHeightAuto();
|
||||
|
||||
public abstract void setHeightMaxContent();
|
||||
|
||||
public abstract void setHeightFitContent();
|
||||
|
||||
public abstract void setHeightStretch();
|
||||
|
||||
public abstract YogaValue getMinWidth();
|
||||
|
||||
public abstract void setMinWidth(float minWidth);
|
||||
|
||||
public abstract void setMinWidthPercent(float percent);
|
||||
|
||||
public abstract void setMinWidthMaxContent();
|
||||
|
||||
public abstract void setMinWidthFitContent();
|
||||
|
||||
public abstract void setMinWidthStretch();
|
||||
|
||||
public abstract YogaValue getMinHeight();
|
||||
|
||||
public abstract void setMinHeight(float minHeight);
|
||||
|
||||
public abstract void setMinHeightPercent(float percent);
|
||||
|
||||
public abstract void setMinHeightMaxContent();
|
||||
|
||||
public abstract void setMinHeightFitContent();
|
||||
|
||||
public abstract void setMinHeightStretch();
|
||||
|
||||
public abstract YogaValue getMaxWidth();
|
||||
|
||||
public abstract void setMaxWidth(float maxWidth);
|
||||
|
||||
public abstract void setMaxWidthPercent(float percent);
|
||||
|
||||
public abstract void setMaxWidthMaxContent();
|
||||
|
||||
public abstract void setMaxWidthFitContent();
|
||||
|
||||
public abstract void setMaxWidthStretch();
|
||||
|
||||
public abstract YogaValue getMaxHeight();
|
||||
|
||||
public abstract void setMaxHeight(float maxheight);
|
||||
|
||||
public abstract void setMaxHeightPercent(float percent);
|
||||
|
||||
public abstract void setMaxHeightMaxContent();
|
||||
|
||||
public abstract void setMaxHeightFitContent();
|
||||
|
||||
public abstract void setMaxHeightStretch();
|
||||
|
||||
public abstract float getAspectRatio();
|
||||
|
||||
public abstract void setAspectRatio(float aspectRatio);
|
||||
|
||||
public abstract float getGap(YogaGutter gutter);
|
||||
public abstract YogaValue getGap(YogaGutter gutter);
|
||||
|
||||
public abstract void setGap(YogaGutter gutter, float gapLength);
|
||||
|
||||
public abstract void setGapPercent(YogaGutter gutter, float gapLength);
|
||||
|
||||
public abstract float getLayoutX();
|
||||
|
||||
public abstract float getLayoutY();
|
||||
|
@@ -1,18 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public abstract class YogaNodeFactory {
|
||||
public static YogaNode create() {
|
||||
return new YogaNodeJNIFinalizer();
|
||||
}
|
||||
|
||||
public static YogaNode create(YogaConfig config) {
|
||||
return new YogaNodeJNIFinalizer(config);
|
||||
}
|
||||
}
|
14
java/com/facebook/yoga/YogaNodeFactory.kt
Normal file
14
java/com/facebook/yoga/YogaNodeFactory.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public object YogaNodeFactory {
|
||||
@JvmStatic public fun create(): YogaNode = YogaNodeJNIFinalizer()
|
||||
|
||||
@JvmStatic public fun create(config: YogaConfig): YogaNode = YogaNodeJNIFinalizer(config)
|
||||
}
|
@@ -32,6 +32,7 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
private static final byte LAYOUT_BORDER_START_INDEX = 14;
|
||||
|
||||
@Nullable private YogaNodeJNIBase mOwner;
|
||||
@Nullable private YogaConfig mConfig;
|
||||
@Nullable private List<YogaNodeJNIBase> mChildren;
|
||||
@Nullable private YogaMeasureFunction mMeasureFunction;
|
||||
@Nullable private YogaBaselineFunction mBaselineFunction;
|
||||
@@ -57,6 +58,7 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
|
||||
YogaNodeJNIBase(YogaConfig config) {
|
||||
this(YogaNative.jni_YGNodeNewWithConfigJNI(((YogaConfigJNIBase) config).mNativePointer));
|
||||
mConfig = config; // makes sure the YogaConfig is not garbage collected
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
@@ -299,6 +301,14 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetPositionTypeJNI(mNativePointer, positionType.intValue());
|
||||
}
|
||||
|
||||
public YogaBoxSizing getBoxSizing() {
|
||||
return YogaBoxSizing.fromInt(YogaNative.jni_YGNodeStyleGetBoxSizingJNI(mNativePointer));
|
||||
}
|
||||
|
||||
public void setBoxSizing(YogaBoxSizing boxSizing) {
|
||||
YogaNative.jni_YGNodeStyleSetBoxSizingJNI(mNativePointer, boxSizing.intValue());
|
||||
}
|
||||
|
||||
public YogaWrap getWrap() {
|
||||
return YogaWrap.fromInt(YogaNative.jni_YGNodeStyleGetFlexWrapJNI(mNativePointer));
|
||||
}
|
||||
@@ -363,6 +373,18 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetFlexBasisAutoJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setFlexBasisMaxContent() {
|
||||
YogaNative.jni_YGNodeStyleSetFlexBasisMaxContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setFlexBasisFitContent() {
|
||||
YogaNative.jni_YGNodeStyleSetFlexBasisFitContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setFlexBasisStretch() {
|
||||
YogaNative.jni_YGNodeStyleSetFlexBasisStretchJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public YogaValue getMargin(YogaEdge edge) {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetMarginJNI(mNativePointer, edge.intValue()));
|
||||
}
|
||||
@@ -411,6 +433,10 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetPositionPercentJNI(mNativePointer, edge.intValue(), percent);
|
||||
}
|
||||
|
||||
public void setPositionAuto(YogaEdge edge) {
|
||||
YogaNative.jni_YGNodeStyleSetPositionAutoJNI(mNativePointer, edge.intValue());
|
||||
}
|
||||
|
||||
public YogaValue getWidth() {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetWidthJNI(mNativePointer));
|
||||
}
|
||||
@@ -427,6 +453,18 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetWidthAutoJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setWidthMaxContent() {
|
||||
YogaNative.jni_YGNodeStyleSetWidthMaxContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setWidthFitContent() {
|
||||
YogaNative.jni_YGNodeStyleSetWidthFitContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setWidthStretch() {
|
||||
YogaNative.jni_YGNodeStyleSetWidthStretchJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public YogaValue getHeight() {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetHeightJNI(mNativePointer));
|
||||
}
|
||||
@@ -443,6 +481,18 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetHeightAutoJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setHeightMaxContent() {
|
||||
YogaNative.jni_YGNodeStyleSetHeightMaxContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setHeightFitContent() {
|
||||
YogaNative.jni_YGNodeStyleSetHeightFitContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setHeightStretch() {
|
||||
YogaNative.jni_YGNodeStyleSetHeightStretchJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public YogaValue getMinWidth() {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetMinWidthJNI(mNativePointer));
|
||||
}
|
||||
@@ -455,6 +505,18 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetMinWidthPercentJNI(mNativePointer, percent);
|
||||
}
|
||||
|
||||
public void setMinWidthMaxContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMinWidthMaxContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMinWidthFitContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMinWidthFitContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMinWidthStretch() {
|
||||
YogaNative.jni_YGNodeStyleSetMinWidthStretchJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public YogaValue getMinHeight() {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetMinHeightJNI(mNativePointer));
|
||||
}
|
||||
@@ -467,6 +529,18 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetMinHeightPercentJNI(mNativePointer, percent);
|
||||
}
|
||||
|
||||
public void setMinHeightMaxContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMinHeightMaxContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMinHeightFitContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMinHeightFitContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMinHeightStretch() {
|
||||
YogaNative.jni_YGNodeStyleSetMinHeightStretchJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public YogaValue getMaxWidth() {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetMaxWidthJNI(mNativePointer));
|
||||
}
|
||||
@@ -479,6 +553,18 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetMaxWidthPercentJNI(mNativePointer, percent);
|
||||
}
|
||||
|
||||
public void setMaxWidthMaxContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMaxWidthMaxContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMaxWidthFitContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMaxWidthFitContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMaxWidthStretch() {
|
||||
YogaNative.jni_YGNodeStyleSetMaxWidthStretchJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public YogaValue getMaxHeight() {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetMaxHeightJNI(mNativePointer));
|
||||
}
|
||||
@@ -491,6 +577,18 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
YogaNative.jni_YGNodeStyleSetMaxHeightPercentJNI(mNativePointer, percent);
|
||||
}
|
||||
|
||||
public void setMaxHeightMaxContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMaxHeightMaxContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMaxHeightFitContent() {
|
||||
YogaNative.jni_YGNodeStyleSetMaxHeightFitContentJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public void setMaxHeightStretch() {
|
||||
YogaNative.jni_YGNodeStyleSetMaxHeightStretchJNI(mNativePointer);
|
||||
}
|
||||
|
||||
public float getAspectRatio() {
|
||||
return YogaNative.jni_YGNodeStyleGetAspectRatioJNI(mNativePointer);
|
||||
}
|
||||
@@ -713,12 +811,17 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGap(YogaGutter gutter) {
|
||||
return YogaNative.jni_YGNodeStyleGetGapJNI(mNativePointer, gutter.intValue());
|
||||
public YogaValue getGap(YogaGutter gutter) {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetGapJNI(mNativePointer, gutter.intValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGap(YogaGutter gutter, float gapLength) {
|
||||
YogaNative.jni_YGNodeStyleSetGapJNI(mNativePointer, gutter.intValue(), gapLength);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGapPercent(YogaGutter gutter, float gapLength) {
|
||||
YogaNative.jni_YGNodeStyleSetGapPercentJNI(mNativePointer, gutter.intValue(), gapLength);
|
||||
}
|
||||
}
|
||||
|
@@ -15,15 +15,33 @@ public interface YogaProps {
|
||||
|
||||
void setWidthPercent(float percent);
|
||||
|
||||
void setWidthAuto();
|
||||
|
||||
void setWidthMaxContent();
|
||||
|
||||
void setWidthFitContent();
|
||||
|
||||
void setWidthStretch();
|
||||
|
||||
void setMinWidth(float minWidth);
|
||||
|
||||
void setMinWidthPercent(float percent);
|
||||
|
||||
void setMinWidthMaxContent();
|
||||
|
||||
void setMinWidthFitContent();
|
||||
|
||||
void setMinWidthStretch();
|
||||
|
||||
void setMaxWidth(float maxWidth);
|
||||
|
||||
void setMaxWidthPercent(float percent);
|
||||
|
||||
void setWidthAuto();
|
||||
void setMaxWidthMaxContent();
|
||||
|
||||
void setMaxWidthFitContent();
|
||||
|
||||
void setMaxWidthStretch();
|
||||
|
||||
/* Height properties */
|
||||
|
||||
@@ -31,15 +49,33 @@ public interface YogaProps {
|
||||
|
||||
void setHeightPercent(float percent);
|
||||
|
||||
void setHeightAuto();
|
||||
|
||||
void setHeightMaxContent();
|
||||
|
||||
void setHeightFitContent();
|
||||
|
||||
void setHeightStretch();
|
||||
|
||||
void setMinHeight(float minHeight);
|
||||
|
||||
void setMinHeightPercent(float percent);
|
||||
|
||||
void setMinHeightMaxContent();
|
||||
|
||||
void setMinHeightFitContent();
|
||||
|
||||
void setMinHeightStretch();
|
||||
|
||||
void setMaxHeight(float maxHeight);
|
||||
|
||||
void setMaxHeightPercent(float percent);
|
||||
|
||||
void setHeightAuto();
|
||||
void setMaxHeightMaxContent();
|
||||
|
||||
void setMaxHeightFitContent();
|
||||
|
||||
void setMaxHeightStretch();
|
||||
|
||||
/* Margin properties */
|
||||
|
||||
@@ -81,6 +117,12 @@ public interface YogaProps {
|
||||
|
||||
void setFlexBasis(float flexBasis);
|
||||
|
||||
void setFlexBasisMaxContent();
|
||||
|
||||
void setFlexBasisFitContent();
|
||||
|
||||
void setFlexBasisStretch();
|
||||
|
||||
void setFlexDirection(YogaFlexDirection direction);
|
||||
|
||||
void setFlexGrow(float flexGrow);
|
||||
@@ -105,6 +147,8 @@ public interface YogaProps {
|
||||
|
||||
void setBaselineFunction(YogaBaselineFunction yogaBaselineFunction);
|
||||
|
||||
void setBoxSizing(YogaBoxSizing boxSizing);
|
||||
|
||||
/* Getters */
|
||||
|
||||
YogaValue getWidth();
|
||||
@@ -148,4 +192,6 @@ public interface YogaProps {
|
||||
YogaValue getPosition(YogaEdge edge);
|
||||
|
||||
float getBorder(YogaEdge edge);
|
||||
|
||||
YogaBoxSizing getBoxSizing();
|
||||
}
|
||||
|
@@ -1,51 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public class YogaStyleInputs {
|
||||
public static final short LAYOUT_DIRECTION = 0;
|
||||
public static final short FLEX_DIRECTION = 1;
|
||||
public static final short FLEX = 2;
|
||||
public static final short FLEX_GROW = 3;
|
||||
public static final short FLEX_SHRINK = 4;
|
||||
public static final short FLEX_BASIS = 5;
|
||||
public static final short FLEX_BASIS_PERCENT = 6;
|
||||
public static final short FLEX_BASIS_AUTO = 7;
|
||||
public static final short FLEX_WRAP = 8;
|
||||
public static final short WIDTH = 9;
|
||||
public static final short WIDTH_PERCENT = 10;
|
||||
public static final short WIDTH_AUTO = 11;
|
||||
public static final short MIN_WIDTH = 12;
|
||||
public static final short MIN_WIDTH_PERCENT = 13;
|
||||
public static final short MAX_WIDTH = 14;
|
||||
public static final short MAX_WIDTH_PERCENT = 15;
|
||||
public static final short HEIGHT = 16;
|
||||
public static final short HEIGHT_PERCENT = 17;
|
||||
public static final short HEIGHT_AUTO = 18;
|
||||
public static final short MIN_HEIGHT = 19;
|
||||
public static final short MIN_HEIGHT_PERCENT = 20;
|
||||
public static final short MAX_HEIGHT = 21;
|
||||
public static final short MAX_HEIGHT_PERCENT = 22;
|
||||
public static final short JUSTIFY_CONTENT = 23;
|
||||
public static final short ALIGN_ITEMS = 24;
|
||||
public static final short ALIGN_SELF = 25;
|
||||
public static final short ALIGN_CONTENT = 26;
|
||||
public static final short POSITION_TYPE = 27;
|
||||
public static final short ASPECT_RATIO = 28;
|
||||
public static final short OVERFLOW = 29;
|
||||
public static final short DISPLAY = 30;
|
||||
public static final short MARGIN = 31;
|
||||
public static final short MARGIN_PERCENT = 32;
|
||||
public static final short MARGIN_AUTO = 33;
|
||||
public static final short PADDING = 34;
|
||||
public static final short PADDING_PERCENT = 35;
|
||||
public static final short BORDER = 36;
|
||||
public static final short POSITION = 37;
|
||||
public static final short POSITION_PERCENT = 38;
|
||||
public static final short IS_REFERENCE_BASELINE = 39;
|
||||
}
|
51
java/com/facebook/yoga/YogaStyleInputs.kt
Normal file
51
java/com/facebook/yoga/YogaStyleInputs.kt
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public object YogaStyleInputs {
|
||||
public const val LAYOUT_DIRECTION: Short = 0
|
||||
public const val FLEX_DIRECTION: Short = 1
|
||||
public const val FLEX: Short = 2
|
||||
public const val FLEX_GROW: Short = 3
|
||||
public const val FLEX_SHRINK: Short = 4
|
||||
public const val FLEX_BASIS: Short = 5
|
||||
public const val FLEX_BASIS_PERCENT: Short = 6
|
||||
public const val FLEX_BASIS_AUTO: Short = 7
|
||||
public const val FLEX_WRAP: Short = 8
|
||||
public const val WIDTH: Short = 9
|
||||
public const val WIDTH_PERCENT: Short = 10
|
||||
public const val WIDTH_AUTO: Short = 11
|
||||
public const val MIN_WIDTH: Short = 12
|
||||
public const val MIN_WIDTH_PERCENT: Short = 13
|
||||
public const val MAX_WIDTH: Short = 14
|
||||
public const val MAX_WIDTH_PERCENT: Short = 15
|
||||
public const val HEIGHT: Short = 16
|
||||
public const val HEIGHT_PERCENT: Short = 17
|
||||
public const val HEIGHT_AUTO: Short = 18
|
||||
public const val MIN_HEIGHT: Short = 19
|
||||
public const val MIN_HEIGHT_PERCENT: Short = 20
|
||||
public const val MAX_HEIGHT: Short = 21
|
||||
public const val MAX_HEIGHT_PERCENT: Short = 22
|
||||
public const val JUSTIFY_CONTENT: Short = 23
|
||||
public const val ALIGN_ITEMS: Short = 24
|
||||
public const val ALIGN_SELF: Short = 25
|
||||
public const val ALIGN_CONTENT: Short = 26
|
||||
public const val POSITION_TYPE: Short = 27
|
||||
public const val ASPECT_RATIO: Short = 28
|
||||
public const val OVERFLOW: Short = 29
|
||||
public const val DISPLAY: Short = 30
|
||||
public const val MARGIN: Short = 31
|
||||
public const val MARGIN_PERCENT: Short = 32
|
||||
public const val MARGIN_AUTO: Short = 33
|
||||
public const val PADDING: Short = 34
|
||||
public const val PADDING_PERCENT: Short = 35
|
||||
public const val BORDER: Short = 36
|
||||
public const val POSITION: Short = 37
|
||||
public const val POSITION_PERCENT: Short = 38
|
||||
public const val IS_REFERENCE_BASELINE: Short = 39
|
||||
}
|
@@ -13,7 +13,10 @@ public enum YogaUnit {
|
||||
UNDEFINED(0),
|
||||
POINT(1),
|
||||
PERCENT(2),
|
||||
AUTO(3);
|
||||
AUTO(3),
|
||||
MAX_CONTENT(4),
|
||||
FIT_CONTENT(5),
|
||||
STRETCH(6);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
@@ -31,6 +34,9 @@ public enum YogaUnit {
|
||||
case 1: return POINT;
|
||||
case 2: return PERCENT;
|
||||
case 3: return AUTO;
|
||||
case 4: return MAX_CONTENT;
|
||||
case 5: return FIT_CONTENT;
|
||||
case 6: return STRETCH;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
||||
|
@@ -1,80 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public class YogaValue {
|
||||
static final YogaValue UNDEFINED = new YogaValue(YogaConstants.UNDEFINED, YogaUnit.UNDEFINED);
|
||||
static final YogaValue ZERO = new YogaValue(0, YogaUnit.POINT);
|
||||
static final YogaValue AUTO = new YogaValue(YogaConstants.UNDEFINED, YogaUnit.AUTO);
|
||||
|
||||
public final float value;
|
||||
public final YogaUnit unit;
|
||||
|
||||
public YogaValue(float value, YogaUnit unit) {
|
||||
this.value = value;
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
YogaValue(float value, int unit) {
|
||||
this(value, YogaUnit.fromInt(unit));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other instanceof YogaValue) {
|
||||
final YogaValue otherValue = (YogaValue) other;
|
||||
if (unit == otherValue.unit) {
|
||||
return unit == YogaUnit.UNDEFINED
|
||||
|| unit == YogaUnit.AUTO
|
||||
|| Float.compare(value, otherValue.value) == 0;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Float.floatToIntBits(value) + unit.intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (unit) {
|
||||
case UNDEFINED:
|
||||
return "undefined";
|
||||
case POINT:
|
||||
return Float.toString(value);
|
||||
case PERCENT:
|
||||
return value + "%";
|
||||
case AUTO:
|
||||
return "auto";
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
|
||||
public static YogaValue parse(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ("undefined".equals(s)) {
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
if ("auto".equals(s)) {
|
||||
return AUTO;
|
||||
}
|
||||
|
||||
if (s.endsWith("%")) {
|
||||
return new YogaValue(Float.parseFloat(s.substring(0, s.length() - 1)), YogaUnit.PERCENT);
|
||||
}
|
||||
|
||||
return new YogaValue(Float.parseFloat(s), YogaUnit.POINT);
|
||||
}
|
||||
}
|
66
java/com/facebook/yoga/YogaValue.kt
Normal file
66
java/com/facebook/yoga/YogaValue.kt
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public class YogaValue
|
||||
public constructor(@JvmField public val value: Float, @JvmField public val unit: YogaUnit) {
|
||||
internal constructor(value: Float, unit: Int) : this(value, YogaUnit.fromInt(unit))
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other is YogaValue) {
|
||||
val otherValue = other
|
||||
if (unit == otherValue.unit) {
|
||||
return unit == YogaUnit.UNDEFINED ||
|
||||
unit == YogaUnit.AUTO ||
|
||||
value.compareTo(otherValue.value) == 0
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun hashCode(): Int = java.lang.Float.floatToIntBits(value) + unit.intValue()
|
||||
|
||||
override fun toString(): String =
|
||||
when (unit) {
|
||||
YogaUnit.UNDEFINED -> "undefined"
|
||||
YogaUnit.POINT -> value.toString()
|
||||
YogaUnit.PERCENT -> "$value%"
|
||||
YogaUnit.AUTO -> "auto"
|
||||
else -> throw IllegalStateException()
|
||||
}
|
||||
|
||||
public companion object {
|
||||
@JvmField
|
||||
public val UNDEFINED: YogaValue = YogaValue(YogaConstants.UNDEFINED, YogaUnit.UNDEFINED)
|
||||
|
||||
@JvmField public val ZERO: YogaValue = YogaValue(0f, YogaUnit.POINT)
|
||||
|
||||
@JvmField public val AUTO: YogaValue = YogaValue(YogaConstants.UNDEFINED, YogaUnit.AUTO)
|
||||
|
||||
@JvmStatic
|
||||
public fun parse(s: String?): YogaValue? {
|
||||
if (s == null) {
|
||||
return null
|
||||
}
|
||||
|
||||
if ("undefined" == s) {
|
||||
return UNDEFINED
|
||||
}
|
||||
|
||||
if ("auto" == s) {
|
||||
return AUTO
|
||||
}
|
||||
|
||||
if (s.endsWith("%")) {
|
||||
return YogaValue(s.substring(0, s.length - 1).toFloat(), YogaUnit.PERCENT)
|
||||
}
|
||||
|
||||
return YogaValue(s.toFloat(), YogaUnit.POINT)
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,18 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.CLASS;
|
||||
|
||||
@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR })
|
||||
@Retention(CLASS)
|
||||
public @interface DoNotStrip { }
|
19
java/com/facebook/yoga/annotations/DoNotStrip.kt
Normal file
19
java/com/facebook/yoga/annotations/DoNotStrip.kt
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
package com.facebook.yoga.annotations
|
||||
|
||||
@Target(
|
||||
AnnotationTarget.CLASS,
|
||||
AnnotationTarget.FIELD,
|
||||
AnnotationTarget.FUNCTION,
|
||||
AnnotationTarget.PROPERTY_GETTER,
|
||||
AnnotationTarget.PROPERTY_SETTER,
|
||||
AnnotationTarget.CONSTRUCTOR,
|
||||
)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
public annotation class DoNotStrip
|
@@ -33,9 +33,10 @@ namespace facebook::yoga::vanillajni {
|
||||
*
|
||||
* This class is very explicit in its behavior, and it does not allow to perform
|
||||
* unexpected conversions or unexpected ownership transfer. In practice, this
|
||||
* class acts as a unique pointer where the underying JNI reference can have one
|
||||
* and just one owner. Transferring ownership is allowed but it is an explicit
|
||||
* operation (implemented via move semantics and also via explicitly API calls).
|
||||
* class acts as a unique pointer where the underlying JNI reference can have
|
||||
* one and just one owner. Transferring ownership is allowed but it is an
|
||||
* explicit operation (implemented via move semantics and also via explicitly
|
||||
* API calls).
|
||||
*
|
||||
* Note that this class doesn't receive an explicit JNIEnv at construction time.
|
||||
* At destruction time it uses vanillajni::getCurrentEnv() to retrieve the
|
||||
@@ -62,7 +63,7 @@ class ScopedGlobalRef {
|
||||
*
|
||||
* @param globalRef the global reference to wrap. Can be NULL.
|
||||
*/
|
||||
ScopedGlobalRef(T globalRef) : mGlobalRef(globalRef) {}
|
||||
explicit ScopedGlobalRef(T globalRef) : mGlobalRef(globalRef) {}
|
||||
|
||||
/**
|
||||
* Equivalent to ScopedGlobalRef(NULL)
|
||||
@@ -72,12 +73,12 @@ class ScopedGlobalRef {
|
||||
/**
|
||||
* Move construction is allowed.
|
||||
*/
|
||||
ScopedGlobalRef(ScopedGlobalRef&& s) : mGlobalRef(s.release()) {}
|
||||
ScopedGlobalRef(ScopedGlobalRef&& s) noexcept : mGlobalRef(s.release()) {}
|
||||
|
||||
/**
|
||||
* Move assignment is allowed.
|
||||
*/
|
||||
ScopedGlobalRef& operator=(ScopedGlobalRef&& s) {
|
||||
ScopedGlobalRef& operator=(ScopedGlobalRef&& s) noexcept {
|
||||
reset(s.release());
|
||||
return *this;
|
||||
}
|
||||
|
@@ -35,9 +35,10 @@ namespace facebook::yoga::vanillajni {
|
||||
*
|
||||
* This class is very explicit in its behavior, and it does not allow to perform
|
||||
* unexpected conversions or unexpected ownership transfer. In practice, this
|
||||
* class acts as a unique pointer where the underying JNI reference can have one
|
||||
* and just one owner. Transferring ownership is allowed but it is an explicit
|
||||
* operation (implemented via move semantics and also via explicitly API calls).
|
||||
* class acts as a unique pointer where the underlying JNI reference can have
|
||||
* one and just one owner. Transferring ownership is allowed but it is an
|
||||
* explicit operation (implemented via move semantics and also via explicitly
|
||||
* API calls).
|
||||
*
|
||||
* As with standard JNI local references it is not a valid operation to keep a
|
||||
* reference around between different native method calls.
|
||||
@@ -70,12 +71,13 @@ class ScopedLocalRef {
|
||||
/**
|
||||
* Move construction is allowed.
|
||||
*/
|
||||
ScopedLocalRef(ScopedLocalRef&& s) : mEnv(s.mEnv), mLocalRef(s.release()) {}
|
||||
ScopedLocalRef(ScopedLocalRef&& s) noexcept
|
||||
: mEnv(s.mEnv), mLocalRef(s.release()) {}
|
||||
|
||||
/**
|
||||
* Move assignment is allowed.
|
||||
*/
|
||||
ScopedLocalRef& operator=(ScopedLocalRef&& s) {
|
||||
ScopedLocalRef& operator=(ScopedLocalRef&& s) noexcept {
|
||||
reset(s.release());
|
||||
mEnv = s.mEnv;
|
||||
return *this;
|
||||
|
@@ -36,7 +36,7 @@ class YGNodeEdges {
|
||||
BORDER = 4,
|
||||
};
|
||||
|
||||
YGNodeEdges(YGNodeRef node) {
|
||||
explicit YGNodeEdges(YGNodeRef node) {
|
||||
auto context = YGNodeContext{};
|
||||
context.asVoidPtr = YGNodeGetContext(node);
|
||||
edges_ = context.edgesSet;
|
||||
|
@@ -54,7 +54,9 @@ static void jni_YGConfigSetExperimentalFeatureEnabledJNI(
|
||||
jboolean enabled) {
|
||||
const YGConfigRef config = _jlong2YGConfigRef(nativePointer);
|
||||
YGConfigSetExperimentalFeatureEnabled(
|
||||
config, static_cast<YGExperimentalFeature>(feature), enabled);
|
||||
config,
|
||||
static_cast<YGExperimentalFeature>(feature),
|
||||
static_cast<bool>(enabled));
|
||||
}
|
||||
|
||||
static void jni_YGConfigSetUseWebDefaultsJNI(
|
||||
@@ -63,7 +65,7 @@ static void jni_YGConfigSetUseWebDefaultsJNI(
|
||||
jlong nativePointer,
|
||||
jboolean useWebDefaults) {
|
||||
const YGConfigRef config = _jlong2YGConfigRef(nativePointer);
|
||||
YGConfigSetUseWebDefaults(config, useWebDefaults);
|
||||
YGConfigSetUseWebDefaults(config, static_cast<bool>(useWebDefaults));
|
||||
}
|
||||
|
||||
static void jni_YGConfigSetPointScaleFactorJNI(
|
||||
@@ -161,7 +163,7 @@ static void jni_YGConfigSetLoggerJNI(
|
||||
auto context =
|
||||
reinterpret_cast<ScopedGlobalRef<jobject>*>(YGConfigGetContext(config));
|
||||
|
||||
if (logger) {
|
||||
if (logger != nullptr) {
|
||||
if (context == nullptr) {
|
||||
context = new ScopedGlobalRef<jobject>();
|
||||
YGConfigSetContext(config, context);
|
||||
@@ -225,14 +227,15 @@ static void jni_YGNodeSetIsReferenceBaselineJNI(
|
||||
jlong nativePointer,
|
||||
jboolean isReferenceBaseline) {
|
||||
YGNodeSetIsReferenceBaseline(
|
||||
_jlong2YGNodeRef(nativePointer), isReferenceBaseline);
|
||||
_jlong2YGNodeRef(nativePointer), static_cast<bool>(isReferenceBaseline));
|
||||
}
|
||||
|
||||
static jboolean jni_YGNodeIsReferenceBaselineJNI(
|
||||
JNIEnv* /*env*/,
|
||||
jobject /*obj*/,
|
||||
jlong nativePointer) {
|
||||
return YGNodeIsReferenceBaseline(_jlong2YGNodeRef(nativePointer));
|
||||
return static_cast<jboolean>(
|
||||
YGNodeIsReferenceBaseline(_jlong2YGNodeRef(nativePointer)));
|
||||
}
|
||||
|
||||
static void jni_YGNodeRemoveAllChildrenJNI(
|
||||
@@ -340,7 +343,7 @@ static void jni_YGNodeCalculateLayoutJNI(
|
||||
try {
|
||||
PtrJNodeMapVanilla* layoutContext = nullptr;
|
||||
auto map = PtrJNodeMapVanilla{};
|
||||
if (nativePointers) {
|
||||
if (nativePointers != nullptr) {
|
||||
map = PtrJNodeMapVanilla{nativePointers, javaNodes};
|
||||
layoutContext = ↦
|
||||
}
|
||||
@@ -356,7 +359,7 @@ static void jni_YGNodeCalculateLayoutJNI(
|
||||
YGTransferLayoutOutputsRecursive(env, obj, root);
|
||||
} catch (const YogaJniException& jniException) {
|
||||
ScopedLocalRef<jthrowable> throwable = jniException.getThrowable();
|
||||
if (throwable.get()) {
|
||||
if (throwable.get() != nullptr) {
|
||||
env->Throw(throwable.get());
|
||||
}
|
||||
} catch (const std::logic_error& ex) {
|
||||
@@ -426,6 +429,28 @@ static void jni_YGNodeCopyStyleJNI(
|
||||
YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer)); \
|
||||
}
|
||||
|
||||
#define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO_INTRINSIC(name) \
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name) \
|
||||
YG_NODE_JNI_STYLE_UNIT_INTRINSIC(name)
|
||||
|
||||
#define YG_NODE_JNI_STYLE_UNIT_PROP_INTRINSIC(name) \
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP(name) \
|
||||
YG_NODE_JNI_STYLE_UNIT_INTRINSIC(name)
|
||||
|
||||
#define YG_NODE_JNI_STYLE_UNIT_INTRINSIC(name) \
|
||||
static void jni_YGNodeStyleSet##name##MaxContentJNI( \
|
||||
JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) { \
|
||||
YGNodeStyleSet##name##MaxContent(_jlong2YGNodeRef(nativePointer)); \
|
||||
} \
|
||||
static void jni_YGNodeStyleSet##name##FitContentJNI( \
|
||||
JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) { \
|
||||
YGNodeStyleSet##name##FitContent(_jlong2YGNodeRef(nativePointer)); \
|
||||
} \
|
||||
static void jni_YGNodeStyleSet##name##StretchJNI( \
|
||||
JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) { \
|
||||
YGNodeStyleSet##name##Stretch(_jlong2YGNodeRef(nativePointer)); \
|
||||
}
|
||||
|
||||
#define YG_NODE_JNI_STYLE_EDGE_UNIT_PROP(name) \
|
||||
static jlong jni_YGNodeStyleGet##name##JNI( \
|
||||
JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer, jint edge) { \
|
||||
@@ -457,6 +482,14 @@ static void jni_YGNodeCopyStyleJNI(
|
||||
static_cast<float>(value)); \
|
||||
}
|
||||
|
||||
#define YG_NODE_JNI_STYLE_EDGE_UNIT_PROP_AUTO(name) \
|
||||
YG_NODE_JNI_STYLE_EDGE_UNIT_PROP(name) \
|
||||
static void jni_YGNodeStyleSet##name##AutoJNI( \
|
||||
JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer, jint edge) { \
|
||||
YGNodeStyleSet##name##Auto( \
|
||||
_jlong2YGNodeRef(nativePointer), static_cast<YGEdge>(edge)); \
|
||||
}
|
||||
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGDirection, Direction);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGFlexDirection, FlexDirection);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGJustify, JustifyContent);
|
||||
@@ -464,6 +497,7 @@ YG_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignItems);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignSelf);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignContent);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGPositionType, PositionType);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGBoxSizing, BoxSizing);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGWrap, FlexWrap);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGOverflow, Overflow);
|
||||
YG_NODE_JNI_STYLE_PROP(jint, YGDisplay, Display);
|
||||
@@ -471,15 +505,15 @@ YG_NODE_JNI_STYLE_PROP(jfloat, float, Flex);
|
||||
YG_NODE_JNI_STYLE_PROP(jfloat, float, FlexGrow);
|
||||
YG_NODE_JNI_STYLE_PROP(jfloat, float, FlexShrink);
|
||||
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(FlexBasis);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(Width);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP(MinWidth);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP(MaxWidth);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(Height);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP(MinHeight);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP(MaxHeight);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_AUTO_INTRINSIC(FlexBasis);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_AUTO_INTRINSIC(Width);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_INTRINSIC(MinWidth);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_INTRINSIC(MaxWidth);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_AUTO_INTRINSIC(Height);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_INTRINSIC(MinHeight);
|
||||
YG_NODE_JNI_STYLE_UNIT_PROP_INTRINSIC(MaxHeight);
|
||||
|
||||
YG_NODE_JNI_STYLE_EDGE_UNIT_PROP(Position);
|
||||
YG_NODE_JNI_STYLE_EDGE_UNIT_PROP_AUTO(Position);
|
||||
|
||||
static jlong jni_YGNodeStyleGetMarginJNI(
|
||||
JNIEnv* /*env*/,
|
||||
@@ -626,8 +660,8 @@ static YGSize YGJNIMeasureFunc(
|
||||
|
||||
uint32_t wBits = 0xFFFFFFFF & (measureResult >> 32);
|
||||
uint32_t hBits = 0xFFFFFFFF & measureResult;
|
||||
float measuredWidth = std::bit_cast<float>(wBits);
|
||||
float measuredHeight = std::bit_cast<float>(hBits);
|
||||
auto measuredWidth = std::bit_cast<float>(wBits);
|
||||
auto measuredHeight = std::bit_cast<float>(hBits);
|
||||
|
||||
return YGSize{measuredWidth, measuredHeight};
|
||||
} else {
|
||||
@@ -645,7 +679,7 @@ static void jni_YGNodeSetHasMeasureFuncJNI(
|
||||
jboolean hasMeasureFunc) {
|
||||
YGNodeSetMeasureFunc(
|
||||
_jlong2YGNodeRef(nativePointer),
|
||||
hasMeasureFunc ? YGJNIMeasureFunc : nullptr);
|
||||
static_cast<bool>(hasMeasureFunc) ? YGJNIMeasureFunc : nullptr);
|
||||
}
|
||||
|
||||
static float YGJNIBaselineFunc(YGNodeConstRef node, float width, float height) {
|
||||
@@ -669,7 +703,7 @@ static void jni_YGNodeSetHasBaselineFuncJNI(
|
||||
jboolean hasBaselineFunc) {
|
||||
YGNodeSetBaselineFunc(
|
||||
_jlong2YGNodeRef(nativePointer),
|
||||
hasBaselineFunc ? YGJNIBaselineFunc : nullptr);
|
||||
static_cast<bool>(hasBaselineFunc) ? YGJNIBaselineFunc : nullptr);
|
||||
}
|
||||
|
||||
static void jni_YGNodeSetAlwaysFormsContainingBlockJNI(
|
||||
@@ -678,7 +712,8 @@ static void jni_YGNodeSetAlwaysFormsContainingBlockJNI(
|
||||
jlong nativePointer,
|
||||
jboolean alwaysFormsContainingBlock) {
|
||||
YGNodeSetAlwaysFormsContainingBlock(
|
||||
_jlong2YGNodeRef(nativePointer), alwaysFormsContainingBlock);
|
||||
_jlong2YGNodeRef(nativePointer),
|
||||
static_cast<bool>(alwaysFormsContainingBlock));
|
||||
}
|
||||
|
||||
static jlong
|
||||
@@ -690,13 +725,13 @@ jni_YGNodeCloneJNI(JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) {
|
||||
return reinterpret_cast<jlong>(clonedYogaNode);
|
||||
}
|
||||
|
||||
static jfloat jni_YGNodeStyleGetGapJNI(
|
||||
static jlong jni_YGNodeStyleGetGapJNI(
|
||||
JNIEnv* /*env*/,
|
||||
jobject /*obj*/,
|
||||
jlong nativePointer,
|
||||
jint gutter) {
|
||||
return (jfloat)YGNodeStyleGetGap(
|
||||
_jlong2YGNodeRef(nativePointer), static_cast<YGGutter>(gutter));
|
||||
return YogaValue::asJavaLong(YGNodeStyleGetGap(
|
||||
_jlong2YGNodeRef(nativePointer), static_cast<YGGutter>(gutter)));
|
||||
}
|
||||
|
||||
static void jni_YGNodeStyleSetGapJNI(
|
||||
@@ -711,6 +746,18 @@ static void jni_YGNodeStyleSetGapJNI(
|
||||
static_cast<float>(gapLength));
|
||||
}
|
||||
|
||||
static void jni_YGNodeStyleSetGapPercentJNI(
|
||||
JNIEnv* /*env*/,
|
||||
jobject /*obj*/,
|
||||
jlong nativePointer,
|
||||
jint gutter,
|
||||
jfloat gapLength) {
|
||||
YGNodeStyleSetGapPercent(
|
||||
_jlong2YGNodeRef(nativePointer),
|
||||
static_cast<YGGutter>(gutter),
|
||||
static_cast<float>(gapLength));
|
||||
}
|
||||
|
||||
// Yoga specific properties, not compatible with flexbox specification
|
||||
YG_NODE_JNI_STYLE_PROP(jfloat, float, AspectRatio);
|
||||
|
||||
@@ -795,6 +842,12 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetPositionTypeJNI",
|
||||
"(JI)V",
|
||||
(void*)jni_YGNodeStyleSetPositionTypeJNI},
|
||||
{"jni_YGNodeStyleGetBoxSizingJNI",
|
||||
"(J)I",
|
||||
(void*)jni_YGNodeStyleGetBoxSizingJNI},
|
||||
{"jni_YGNodeStyleSetBoxSizingJNI",
|
||||
"(JI)V",
|
||||
(void*)jni_YGNodeStyleSetBoxSizingJNI},
|
||||
{"jni_YGNodeStyleGetFlexWrapJNI",
|
||||
"(J)I",
|
||||
(void*)jni_YGNodeStyleGetFlexWrapJNI},
|
||||
@@ -839,6 +892,15 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetFlexBasisAutoJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetFlexBasisAutoJNI},
|
||||
{"jni_YGNodeStyleSetFlexBasisMaxContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetFlexBasisMaxContentJNI},
|
||||
{"jni_YGNodeStyleSetFlexBasisFitContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetFlexBasisFitContentJNI},
|
||||
{"jni_YGNodeStyleSetFlexBasisStretchJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetFlexBasisStretchJNI},
|
||||
{"jni_YGNodeStyleGetMarginJNI",
|
||||
"(JI)J",
|
||||
(void*)jni_YGNodeStyleGetMarginJNI},
|
||||
@@ -875,6 +937,9 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetPositionPercentJNI",
|
||||
"(JIF)V",
|
||||
(void*)jni_YGNodeStyleSetPositionPercentJNI},
|
||||
{"jni_YGNodeStyleSetPositionAutoJNI",
|
||||
"(JI)V",
|
||||
(void*)jni_YGNodeStyleSetPositionAutoJNI},
|
||||
{"jni_YGNodeStyleGetWidthJNI", "(J)J", (void*)jni_YGNodeStyleGetWidthJNI},
|
||||
{"jni_YGNodeStyleSetWidthJNI", "(JF)V", (void*)jni_YGNodeStyleSetWidthJNI},
|
||||
{"jni_YGNodeStyleSetWidthPercentJNI",
|
||||
@@ -883,6 +948,15 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetWidthAutoJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetWidthAutoJNI},
|
||||
{"jni_YGNodeStyleSetWidthMaxContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetWidthMaxContentJNI},
|
||||
{"jni_YGNodeStyleSetWidthFitContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetWidthFitContentJNI},
|
||||
{"jni_YGNodeStyleSetWidthStretchJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetWidthStretchJNI},
|
||||
{"jni_YGNodeStyleGetHeightJNI", "(J)J", (void*)jni_YGNodeStyleGetHeightJNI},
|
||||
{"jni_YGNodeStyleSetHeightJNI",
|
||||
"(JF)V",
|
||||
@@ -893,6 +967,15 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetHeightAutoJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetHeightAutoJNI},
|
||||
{"jni_YGNodeStyleSetHeightMaxContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetHeightMaxContentJNI},
|
||||
{"jni_YGNodeStyleSetHeightFitContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetHeightFitContentJNI},
|
||||
{"jni_YGNodeStyleSetHeightStretchJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetHeightStretchJNI},
|
||||
{"jni_YGNodeStyleGetMinWidthJNI",
|
||||
"(J)J",
|
||||
(void*)jni_YGNodeStyleGetMinWidthJNI},
|
||||
@@ -902,6 +985,15 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetMinWidthPercentJNI",
|
||||
"(JF)V",
|
||||
(void*)jni_YGNodeStyleSetMinWidthPercentJNI},
|
||||
{"jni_YGNodeStyleSetMinWidthMaxContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMinWidthMaxContentJNI},
|
||||
{"jni_YGNodeStyleSetMinWidthFitContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMinWidthFitContentJNI},
|
||||
{"jni_YGNodeStyleSetMinWidthStretchJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMinWidthStretchJNI},
|
||||
{"jni_YGNodeStyleGetMinHeightJNI",
|
||||
"(J)J",
|
||||
(void*)jni_YGNodeStyleGetMinHeightJNI},
|
||||
@@ -911,6 +1003,15 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetMinHeightPercentJNI",
|
||||
"(JF)V",
|
||||
(void*)jni_YGNodeStyleSetMinHeightPercentJNI},
|
||||
{"jni_YGNodeStyleSetMinHeightMaxContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMinHeightMaxContentJNI},
|
||||
{"jni_YGNodeStyleSetMinHeightFitContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMinHeightFitContentJNI},
|
||||
{"jni_YGNodeStyleSetMinHeightStretchJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMinHeightStretchJNI},
|
||||
{"jni_YGNodeStyleGetMaxWidthJNI",
|
||||
"(J)J",
|
||||
(void*)jni_YGNodeStyleGetMaxWidthJNI},
|
||||
@@ -920,6 +1021,15 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetMaxWidthPercentJNI",
|
||||
"(JF)V",
|
||||
(void*)jni_YGNodeStyleSetMaxWidthPercentJNI},
|
||||
{"jni_YGNodeStyleSetMaxWidthMaxContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMaxWidthMaxContentJNI},
|
||||
{"jni_YGNodeStyleSetMaxWidthFitContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMaxWidthFitContentJNI},
|
||||
{"jni_YGNodeStyleSetMaxWidthStretchJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMaxWidthStretchJNI},
|
||||
{"jni_YGNodeStyleGetMaxHeightJNI",
|
||||
"(J)J",
|
||||
(void*)jni_YGNodeStyleGetMaxHeightJNI},
|
||||
@@ -929,6 +1039,15 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeStyleSetMaxHeightPercentJNI",
|
||||
"(JF)V",
|
||||
(void*)jni_YGNodeStyleSetMaxHeightPercentJNI},
|
||||
{"jni_YGNodeStyleSetMaxHeightMaxContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMaxHeightMaxContentJNI},
|
||||
{"jni_YGNodeStyleSetMaxHeightFitContentJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMaxHeightFitContentJNI},
|
||||
{"jni_YGNodeStyleSetMaxHeightStretchJNI",
|
||||
"(J)V",
|
||||
(void*)jni_YGNodeStyleSetMaxHeightStretchJNI},
|
||||
{"jni_YGNodeStyleGetAspectRatioJNI",
|
||||
"(J)F",
|
||||
(void*)jni_YGNodeStyleGetAspectRatioJNI},
|
||||
@@ -938,8 +1057,11 @@ static JNINativeMethod methods[] = {
|
||||
{"jni_YGNodeSetHasMeasureFuncJNI",
|
||||
"(JZ)V",
|
||||
(void*)jni_YGNodeSetHasMeasureFuncJNI},
|
||||
{"jni_YGNodeStyleGetGapJNI", "(JI)F", (void*)jni_YGNodeStyleGetGapJNI},
|
||||
{"jni_YGNodeStyleGetGapJNI", "(JI)J", (void*)jni_YGNodeStyleGetGapJNI},
|
||||
{"jni_YGNodeStyleSetGapJNI", "(JIF)V", (void*)jni_YGNodeStyleSetGapJNI},
|
||||
{"jni_YGNodeStyleSetGapPercentJNI",
|
||||
"(JIF)V",
|
||||
(void*)jni_YGNodeStyleSetGapPercentJNI},
|
||||
{"jni_YGNodeSetHasBaselineFuncJNI",
|
||||
"(JZ)V",
|
||||
(void*)jni_YGNodeSetHasBaselineFuncJNI},
|
||||
|
@@ -25,7 +25,7 @@ YogaJniException::YogaJniException(jthrowable throwable) {
|
||||
throwable_ = newGlobalRef(getCurrentEnv(), throwable);
|
||||
}
|
||||
|
||||
YogaJniException::YogaJniException(YogaJniException&& rhs)
|
||||
YogaJniException::YogaJniException(YogaJniException&& rhs) noexcept
|
||||
: throwable_(std::move(rhs.throwable_)) {}
|
||||
|
||||
YogaJniException::YogaJniException(const YogaJniException& rhs) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user