Commit Graph

1849 Commits

Author SHA1 Message Date
David Aurelio
0908d3a173 Data structure for exclusive writing
Summary:
Adds a data structure that holds a series of values that can be *borrowed* for exclusive writing.
That means, that only a single consumer can write to any value owned by the data structure.

In addition, the data structure exposes read access via iteration over all contained values.

A typical use case would be a counter with thread-local values that are accumulated by readers in other parts of a programm. The design carefully avoids the use of atomics or locks for reading and writing. This approach avoids cache flushes and bus sync between cores.

Borrowing and returning a value go through a central lock to guarantee the consistency of the underlying data structure.

Values are allocated in a `std::forward_list`, which typically should avoid two values in the same cache line -- in that case, writing to one value would still cause cache flushing on other cores. An alternative approach would be to allocate values continuously on cache line boundaries (with padding between them). We can still change the code if the current approach turns out to be too naive (non-deterministic).

Reviewed By: SidharthGuglani

Differential Revision: D15535018

fbshipit-source-id: 212ac88bba9682a4c9d4326b46de0ee2fb5d9a7e
2019-05-31 09:43:43 -07:00
David Aurelio
f304990656 Use atomic list for event subscribers
Summary:
Replace the *copy on write* vector with an atomic pointer to a linked list.

This allows to publish without locking a mutex, at the cost of the slower traversal of a linked list (a vector has better locality).

At the moment, the typical use case is to have one subscriber, meaning that the afforementioned slower traversal is not a problem.

Adding subscribers is implemented as atomic *compare and swap.*

Reviewed By: SidharthGuglani

Differential Revision: D15546964

fbshipit-source-id: 41bfa41f1ac6be5c9b6bf4288ea3271ee995877e
2019-05-31 01:26:42 -07:00
David Aurelio
cea3865c74 Deprecate YGNode::setConfig
Summary:
We want to phase out usage of config pointers on nodes. Setting configs is no longer needed, as a config is unly used during construction.

Here we deprecate the setter, as it is no longer working as it used to (e.g. changing `useWebDefaults` after a node is constructed).

Reviewed By: SidharthGuglani

Differential Revision: D15416474

fbshipit-source-id: a2cc06cad0c5148cecce056ece5f141b3defe9a9
2019-05-29 07:50:11 -07:00
David Aurelio
b74c0d4766 Remove comparison to YGUndefined *and* 0.0f
Summary: Removes a check introduced in D6969537, comparing `totalFlexGrowFactors` and `resolveFlexGrow` to both `0.0` *and* undefined.

Reviewed By: SidharthGuglani

Differential Revision: D15431425

fbshipit-source-id: 13c8f24e1bc8c49496097a6aa78e20ee5d3964a7
2019-05-22 09:44:36 -07:00
David Aurelio
54e863cef2 Remove YGNode::setAndPropogateUseLegacyFlag
Summary:
`YGNode::setAndPropogateUseLegacyFlag` was only used for debugging purposes.
Here, we replace it with a free function in `Yoga.cpp`.

Now that we have events, the diffing functionality should go into a separate debugging package and be implemented in terms of an event listener. Let's do that as soon as we can support multiple listeners.

Reviewed By: SidharthGuglani

Differential Revision: D15316863

fbshipit-source-id: db929eba7c2de8aa1550e362dd2c175929c0070e
2019-05-21 06:06:37 -07:00
David Aurelio
1938792517 YGNode: Field for web defaults
Summary:
In order to remove the config pointer from nodes, we have to keep track of whether the node is using web defaults.
This information fits into one bit that we can place in padding (i.e. no extra memory needed).

This allows us to get rid of config usage withing `YGNode` with some exceptions:

- `iterChildrenAfterCloningIfNeeded` -- this function will simply receive the configuration, or the cloning callback.
- `setAndPropogateUseLegacyFlag` -- will be removed in D15316863
- in `YGNode::reset` -- will go away utomatically once we remove the config pointer

Reviewed By: SidharthGuglani

Differential Revision: D15391536

fbshipit-source-id: 0fa0d0805c6862bd741fe4a7d9b637ed534f56a4
2019-05-20 10:51:38 -07:00
Sidharth Guglani
aa71dbb5bd mutex lock while accessing event subscribers vector for thread safety
Summary: Using Mutex lock_guard mechanism when writing to subscribers and when accessing them in publish to make a copy

Reviewed By: davidaurelio

Differential Revision: D15391679

fbshipit-source-id: 16713ff28ce1762a5ca4c48c152897a92417e80b
2019-05-19 23:34:41 -07:00
David Aurelio
8dc46c0a87 YGNode: one byte of private storage
Summary:
Adds one byte of private storage to `YGNode`, intended to be used by Yoga itself.

This is in previously unused alignment space, and won’t cause more memory to be allocated.

Reviewed By: SidharthGuglani

Differential Revision: D15296732

fbshipit-source-id: 3caf0a3cd506e4e324e51c31869c69be5781d476
2019-05-16 11:47:30 -07:00
David Aurelio
1180afed9c Fix style property bits
Summary: Style bits had overlap, because `dimensionBit` was set with an incorrect increment.

Reviewed By: SidharthGuglani

Differential Revision: D15335134

fbshipit-source-id: 370e1a73547d76b0e26bc6ab67acb96d33ddf180
2019-05-16 11:47:30 -07:00
Sidharth Guglani
1562bce9b4 use shared_ptr for subscribers vector in event system
Summary:
using shared_ptr for vector of subscribers
Further changes in commit stack support the mutiple subscribers in event system

Reviewed By: davidaurelio

Differential Revision: D15352512

fbshipit-source-id: fac7f4268abf9ca4277734aca2f21cd711eb7d6e
2019-05-15 09:01:06 -07:00
Sidharth Guglani
a9514513a7 use vector for subscribers in event system
Summary:
Replaced global event subscriber with a vector of subscriber functions
Further changes in commit stack support the mutiple subscribers in event system

Reviewed By: davidaurelio

Differential Revision: D15352451

fbshipit-source-id: 7ca6f0943735bf1f76a906c23e15e14ae3c5f42c
2019-05-15 09:01:04 -07:00
Sidharth Guglani
cf809b8e8b added listener in flipper plugin for yoga
Summary:
Adds YogaEventListener interface and it's implementation which will be used in flipper for events coming from Yoga
After this diff , we will start getting layout calculate events in flipper listener

Reviewed By: davidaurelio

Differential Revision: D15316928

fbshipit-source-id: da3a53374a52386037b553d460038d988b0162c2
2019-05-15 01:18:11 -07:00
Yadong Wen
d7ff5c0689 Remove c++1y compiler flag
Reviewed By: meyering

Differential Revision: D15326600

fbshipit-source-id: 837f454ccf27299bc9360174bf54e48e4209bb52
2019-05-14 13:48:02 -07:00
David Aurelio
e3156279fc Travis: Fix C++ compilation
Summary:
@public

Removes the usage of C++14 features, and enforces C++11 via compiler flags.

Reviewed By: SidharthGuglani

Differential Revision: D15334938

fbshipit-source-id: 011764b5f226fef6a35e0c7c1dd170a39ae2261e
2019-05-14 07:45:31 -07:00
gengjiawen
0ce42d83e0 add missing gradle script for windows
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/885

Differential Revision: D15334309

Pulled By: davidaurelio

fbshipit-source-id: c594c0216a967c776606443a50f14e81da228d64
2019-05-14 06:24:18 -07:00
Shawn Presser
afc1108659 Fix cmake build / update CMakeLists.txt to use C++11 (#887)
Summary:
On MacOS, the following steps result in build errors:

```
mkdir build
cd build
cmake ..
make
```

The problem is that yogacore uses C++11 features (`constexpr`) but C++11 isn't specified in CMakeLists.txt.

This PR solves the poblem by adding the following code to the bottom of CMakeLists.txt:

```
set_target_properties(yogacore PROPERTIES CXX_STANDARD 11)
```

This solution was derived from https://stackoverflow.com/questions/45688522/how-to-enable-c17-in-cmake
Pull Request resolved: https://github.com/facebook/yoga/pull/887

Differential Revision: D15334282

Pulled By: davidaurelio

fbshipit-source-id: a599d8a8f555f7f9cd8dc333e12dc2387d5b2d7a
2019-05-14 05:28:19 -07:00
David Aurelio
a15bf6e701 Publish events for layout pass
Summary:
Adds `LayoutPassStart` and `LayoutPassEnd` events.

The existing `NodeLayout` event in isolation is not as useful as it could be. Having events that mark start and end of a layout pass are a useful addition.

Differential Revision: D15305467

fbshipit-source-id: 14af6f65e698fb1e3112eb2ffd87a74d31df4840
2019-05-10 19:05:07 -07:00
Sidharth Guglani
74fc37efc8 move event files to yoga/events folder
Summary: Moved events files to yoga/events for better code structure

Reviewed By: davidaurelio

Differential Revision: D15198566

fbshipit-source-id: 74d451011841d59fae5a1c637f9c33a7d2d1f87e
2019-05-09 07:46:10 -07:00
David Aurelio
5824dbda66 Publish event when visiting nodes during layout
Summary:
@public

Publish an event when visiting nodes during layouts.

Reviewed By: SidharthGuglani

Differential Revision: D15206965

fbshipit-source-id: c201f084b1d4186bc64560b8033be965f2549236
2019-05-09 04:31:25 -07:00
David Aurelio
e96a09e5ff **breaking:** remove YGNodeGetInstanceCount
Summary:
@public

`YGNodeGetInstanceCount` was only ever meant for tests, and caused data races in multi-threaded environments.

It was completely replaced with event-based counting for tests.

Here we remove public API around the counter, and the counter itself.

Reviewed By: SidharthGuglani

Differential Revision: D15174857

fbshipit-source-id: 228e85da565bac9e8485121e956a2e41910b11c8
2019-05-09 04:31:24 -07:00
David Aurelio
9e20dfeea1 Switch tests to test utility for counting nodes
Summary:
@public
replaces the global node counter with the event-based one for all tests.

Reviewed By: SidharthGuglani

Differential Revision: D15174856

fbshipit-source-id: f4401d502bdbaf3b6e4632a4d985aac260cb35a8
2019-05-09 04:31:24 -07:00
David Aurelio
6e04631862 Add test utilities for C++ and Java
Summary:
@public

Test utility on top of the new event system that maintains a counter of instantiated nodes. Meant to replace the global node counter.

Reviewed By: SidharthGuglani

Differential Revision: D15174855

fbshipit-source-id: 6998472f95a09b8da652257a26596164bdcf43d6
2019-05-09 04:31:23 -07:00
David Aurelio
88b23ebb3d Publish events for node allocation and deallocation
Summary:
@public

Publish two events, `NodeAllocation` and `NodeDeallocation`, in the same places where the global node counter is changed.

Reviewed By: SidharthGuglani

Differential Revision: D15174858

fbshipit-source-id: 6e4e9add88513b9e987189ca5035d76da2a1de55
2019-05-09 04:31:23 -07:00
David Aurelio
018916403e Reduce measure cache size to 8
Summary:
@public

Reduces measure cache size to a number that is enough for 95% of nodes, according to our (FB-internal) measurements.

Node size: 776b -> 584b

Reviewed By: SidharthGuglani

Differential Revision: D15183567

fbshipit-source-id: 9ae8cc78074271a015e7618b931ba0356de87a0c
2019-05-09 03:24:31 -07:00
Adrian Zgorzalek
af38fd31f8 Upgrade prettier to 1.17.0
Summary:
Run `js1 upgrade prettier 1.17.0` and `xplat/js/scripts/update-oss-yarn-lockfile.sh` and `hg revert -r .^ xplat/js/rome`

allow-large-files

Reviewed By: zackargyle, pvdz

Differential Revision: D15164375

fbshipit-source-id: 2fe68733dfa93ea64a67d170ba2f80c5af086917
2019-05-07 12:39:46 -07:00
David Aurelio
1e0ebdae2f Remove API to constrain measure cache size
Summary: We conducted an experiment with different measure cache sizes. This has now been deallocatedi (D15183473). Remove the necessary APIs.

Reviewed By: SidharthGuglani

Differential Revision: D15183486

fbshipit-source-id: a38fa5a3ab0321c2521265f7d1cd6b495efd76cf
2019-05-03 05:54:40 -07:00
David Aurelio
1adbafe950 Fix YGConfig constructors
Summary:
@public

`YGConfig::YGConfig(YGConfig*)` was not initializing the same fields as the default constructors.

Here, we make the default constructor delegate to the more specialized one to remove duplication.

Reviewed By: SidharthGuglani

Differential Revision: D15164599

fbshipit-source-id: 27247709091b7664386057d09ac67d481877871f
2019-05-03 05:01:32 -07:00
David Aurelio
e51ca95713 Add foundations for event system
Summary:
@public

We want to enable tooling, instrumentation, and statistics within Yoga without coupling these functionalities to our core code.

This commit introduces the foundations of a simple, global event system.
For the time being, we will only support a single subscriber. Should we require more than one, we can add support for it later.

Reviewed By: SidharthGuglani

Differential Revision: D15153678

fbshipit-source-id: 7d96f4c8def646a6a1b3908f946e7f81a6dba9c3
2019-05-01 17:08:02 -07:00
David Aurelio
a803421739 YGStyle: Make getters/setters template args of BitfieldRef
Summary:
@public

Makes bitfield getters/setters part of the bitfield ref template.
Since we introduced the tracking bit as template parameter in D14933022, every bitfield ref is an individual class anyway, and having function pointers doesn’t potentially lead to less code generation anyway.

Furthermore, this change can (in the absence of tracking bits) avoid less specialized templates dealing with refs, and to dynamic dispatch as a consequence.

Reviewed By: SidharthGuglani

Differential Revision: D15085495

fbshipit-source-id: 0dd70fa05e9d43a29e38a619cddb642c9ca3f7ab
2019-05-01 06:52:55 -07:00
David Aurelio
011c1964a0 Track which style properties have been set on YGStyle
Summary:
@public

In order to optimise property storage, we have to know how style properties are used in our apps.
Here, we add a bitmask that allows us to track which properties are set explicitely, and use that for our analysis.

Reviewed By: SidharthGuglani

Differential Revision: D14933022

fbshipit-source-id: 1ab8af562b14baba1d02057e527aa36d5c9a7823
2019-05-01 06:52:55 -07:00
David Aurelio
05d205cf89 Deduplicate updateStyle overloads
Summary:
@public

The extra overload of `updateStyle` introduced in D15078961 can also handle `BitfieldRef`.
That means that we can remove the more specific implementation previously introduced for `BitfieldRef`

Reviewed By: SidharthGuglani

Differential Revision: D15081069

fbshipit-source-id: 98f1f3478627974c5273c85d268ca07350f303d7
2019-05-01 06:52:54 -07:00
David Aurelio
0a4f7bd558 YGStyle: mutable accessors return Ref instances
Summary:
@public

Change style property accessors to return `Ref` instances instead of references to `CompactValue`.

This will allow to track assignments to properties later on, e.g. for instrumentation or dynamic property storage.

Reviewed By: SidharthGuglani

Differential Revision: D15078961

fbshipit-source-id: 259f05f7d30f093c04bf333c5bd4fb3601b8e933
2019-05-01 06:52:54 -07:00
David Aurelio
cea862a6bf Expose the value type used by YGStyle as ValueRepr
Summary:
@public

Adds `YGStyle::ValueRepr` to make code depending on the actual type easier to write.

So far, we have treated `yoga::detail::CompactValue` as an implementation detail, and that’s what it’s supposed to stay.

React Native Fabric has one value conversion overload that depends on that type, though, and used `decltype(YGStyle{}.margin()[0])` until now.
That’s problematic for two reasons:

- we want to constrain the parameter of `operator[](...)` to enum types, making the `0` unsuitable
- we want to return the non-const overload of the operator to return a custom `Ref` type, which is not the type needed by Fabric.

Making the storage type explicit allows to write more forward-compatible code.

Reviewed By: SidharthGuglani

Differential Revision: D15078960

fbshipit-source-id: 932c27ef2f2cdc6ce965b79894268170f0ccdce5
2019-04-29 09:23:18 -07:00
David Aurelio
cc02a20c9e More constness
Summary:
@public

Some `YGNode*` passed as `const YGNode*`, some const refs to sub-objects introduced.
This helps selecting the desired methods in more places, i.e. `const` overloads of accessors on `YGStyle`.

Reviewed By: SidharthGuglani

Differential Revision: D15078963

fbshipit-source-id: 5013721d6edcc68f42f4504f5c331da647a294bd
2019-04-29 09:23:17 -07:00
David Aurelio
98fda9c587 YGFloatOptional: Move binary operators to free functions
Summary:
@public

Having binary operators as member functions has disadvantages:

- the left hand side cannot be converted to `YGFloatOptional` implicitly (which we need for `YGStyle` refs)
- Operators are not necessarily commutative.

By moving these operators into free functions, and adding overloads for both variants if one operand is `float`, we get these properties.

Reviewed By: SidharthGuglani

Differential Revision: D15078962

fbshipit-source-id: 2e228a2ef90a8083c91788caa9eedfd4d140677f
2019-04-29 09:23:16 -07:00
David Aurelio
2eed95f3e4 YGNodeToString: take const ref to node style
Summary:
@public

Takes a const reference to the style of the printed node once, instead of using repeated calls to `node->getStyle()`.
Makes the code a bit shorter, and ensures that we are operating on `const YGStyle&`, which helps selecting the correct methods further up the stack.

Reviewed By: SidharthGuglani

Differential Revision: D14999094

fbshipit-source-id: 814f06b7e3179ac8cfb43d79fbec48ee4115d6e3
2019-04-26 02:15:06 -07:00
David Aurelio
e5d3baca81 Introduce YGNodeConstRef
Summary:
@public

Introduces `YGNodeConstRef` as `const YGNode*`, i.e. a pointer to a constant `YGNode`.
We also use it for all style getters, which will avoid casts to `const YGNode*` in diffs up the stack.

We should use this pointer type for all functions that do not modify the underlying node.

Reviewed By: SidharthGuglani

Differential Revision: D14999095

fbshipit-source-id: 61cc53bb35e787a12ae12e70438d84c0a4983752
2019-04-23 10:10:24 -07:00
David Aurelio
dee93017f7 YGStyle: wrap all fields into accessors
Summary:
@public

In order to encapsulate property access on `YGStyle`, as a first measure we wrap all fields with accessors.

This will e.g. enable dynamic property storage and instrumentation in the future.

All accessors have a `const` version that allows direct access via `const&`. For mutation, bit fields are wrapped with a custom reference object.

This style allows for the least amount of changes in client code. Property access simply needs appended parens, eg `style.direction` becomes `style.direction`.

Reviewed By: shergin

Differential Revision: D14999096

fbshipit-source-id: fbf29f7ddab520513d4618f5e70094c4f6330b30
2019-04-23 08:17:18 -07:00
David Aurelio
e167642672 Yoga.h: clean up const / extern
Summary:
@public

Remove unnecessary `const` and `extern` specifiers from `Yoga.h`.

- Function declarations are `extern` by default
- The removed `const` specifiers for pass-by-valye parameters are only meaningful for the *definition* of functions, not for the declaration.
In this specific case, I found `const YGNodeRef` particularly confusing, as it is a `typedef` for a pointer type. `const` does not refer to the pointed-to object, but to the parameter itself, i.e. `const YGNodeRef` is `YGNode * const`, and not `const YGNode *`.

Reviewed By: SidharthGuglani

Differential Revision: D14999097

fbshipit-source-id: 8350870cb67f4a34722f796c4f4a2fc7dde41b99
2019-04-23 08:17:16 -07:00
David Aurelio
e9bb1efb03 Code formatting: allow short inline methods on one line
Summary:
@public

This allows short methods defined in class declarations to occupy a single line.
The change makes class declarations more readable.

Reviewed By: SidharthGuglani

Differential Revision: D14950012

fbshipit-source-id: 1321949475184181c6cceb86613f730e430763e2
2019-04-16 07:12:58 -07:00
David Aurelio
3f7d03b443 Define all style getters/setters explicitely
Summary:
@public

For better grepping, we define all `YGNodeStyle...` accessors explicitely. This also replaces all macros with a set of templates that can easily be updated when we switch to style accessors on `YGNode`.

Transitioning to a consistent set of templates also allowed to end up with a single *needs update* / *do update* / *mark dirty* block.

The new template code also takes full advantage of the properties of `YGOptional` (constructor call with *not a number* creates an empty optional) and `detail::CompactValue` (conversions of *auto* and *undefined* are always well-formed) to get rid of some additional code:

Removed `NAN` check:
```
 _YGNodeStyleSetFlex:
 	pushq	%rbp
 	movq	%rsp, %rbp
 	movss	0x34(%rdi), %xmm1
 	ucomiss	%xmm0, %xmm1
 	jne	0x____
 	jnp	0x____
 	ucomiss	%xmm0, %xmm0
 	jnp	0x____
 	ucomiss	%xmm1, %xmm1
 	jnp	0x____
 	popq	%rbp
 	retq
-	ucomiss	%xmm0, %xmm0
-	movd	%xmm0, %eax
-	movl	$0x7fc00000, %ecx
-	cmovnpl	%eax, %ecx
-	movl	%ecx, 0x34(%rdi)
+	movss	%xmm0, 0x34(%rdi)
 	popq	%rbp
 	jmp	0x____
-	nopw	%cs:(%rax,%rax)
-	nop
+	nopw	(%rax,%rax)
```

Removed well-formedness check:
```
 _YGNodeStyleGetPosition:
 	pushq	%rbp
 	movq	%rsp, %rbp
 	movl	%esi, %eax
 	movl	0x68(%rdi,%rax,4), %ecx
+	xorl	%eax, %eax
 	movq	(%rip), %rcx
 	movl	(%rcx), %eax
 	movl	0x4(%rcx), %ecx
-	movq	%rcx, %rdx
-	shlq	$0x20, %rdx
+	shlq	$0x20, %rcx
 	movl	%eax, %eax
-	orq	%rdx, %rax
-	cmpl	$0x3, %ecx
-	je	0x____
-	testl	%ecx, %ecx
-	jne	0x____
-	movl	$0x7fc00000, %ecx
-	jmp	0x____
-	movq	%rax, %rcx
-	movabsq	$-0x100000000, %rdx
-	andq	%rax, %rdx
-	movl	%ecx, %eax
-	orq	%rdx, %rax
+	orq	%rcx, %rax
 	popq	%rbp
 	retq
 	nopw	(%rax,%rax)
```

Reviewed By: SidharthGuglani

Differential Revision: D14911973

fbshipit-source-id: db6eef65f8fdaf70875f7fe8799919ca88bd50ee
2019-04-15 10:51:44 -07:00
Sidharth Guglani
ffce716557 Use only 4 edges for margin, padding, border in YGLayout
Summary:
We were using four edges for margin, padding and border. This diff changes the array size in YGLayout for margin, padding, border to reduce YGNode size and corresponding changes while we are setting values in YGLayout.
Reduces the YGNode size by 24 bytes

Reviewed By: davidaurelio

Differential Revision: D14892666

fbshipit-source-id: 94013d5183ee869901267c4c9941fd94fa05d848
2019-04-15 05:41:59 -07:00
Andres Suarez
fcfb19e9cf Enable black for xplat/yoga
Summary:
This directory was excluded from Black formatting in D14888843 when Black
was turned on for all of `xplat/`. Since there aren't a lot of `.py` files in
this directory, the opt-out is being removed, and the outstanding issues fixed.

Reviewed By: d16r

Differential Revision: D14889104

fbshipit-source-id: 440077c1efcb4c653151bca1da5636212978add5
2019-04-11 05:24:34 -07:00
David Aurelio
c5f105a7b6 JNI: set language level to C++11
Summary:
@public

compiler flags were pushed to C++14, but we don’t currently have any code that requires it. Setting to `-std=c++11` in order to fix the OSS build.

Reviewed By: SidharthGuglani

Differential Revision: D14833737

fbshipit-source-id: df2cd7da8c7124e89863c90d7b77bcf86c495618
2019-04-09 03:12:32 -07:00
David Aurelio
b062d23947 Add -SNAPSHOT to gradle version
Summary:
@public

needed for snapshot releases off of master.

Reviewed By: colriot

Differential Revision: D14833415

fbshipit-source-id: f3b1fb1c41318a9b8f634cd16d37d5e2d050398f
2019-04-08 10:57:18 -07:00
David Aurelio
7fc6fcb38c v1.14.0
Summary:
@public

Push version to *1.14.0.*

This release contains some bug fixes around `align-content`.

Reviewed By: colriot

Differential Revision: D14833417

fbshipit-source-id: f653d5fbb36f307c92b14c091c3206290256f036
1.14.0
2019-04-08 10:57:17 -07:00
David Aurelio
bc7e504b29 Fix bugs around align-content
Summary:
@public

Regenerating the “golden master” tests with chrome surfaced different bugs around `align-content`:

- a misunderstanding that values in `align-content` only applied *if there is only one line.* In fact, it applies *every time* a container is set to `flex-wrap: wrap`. Chrome had this wrong, and as such our tests were generated with incorrect parameters.
- empty children growing to the cross axis size of the container, even when `align-content` is different from `stretch`. This was implemented incorrectly in Chrome as well. Here, we fix it with an extra check.

Reviewed By: SidharthGuglani

Differential Revision: D14725402

fbshipit-source-id: a45bebdadb9c694dc0eb7e27cb52b3d247f81c50
2019-04-08 03:20:27 -07:00
Daniel Büchele
3d8afa9e90 fixing playground links
Summary: Updating links to playgrounds

Reviewed By: davidaurelio

Differential Revision: D14775759

fbshipit-source-id: 8c5c30aa63f2ec2787c1a15a72d09f4e642dd672
2019-04-04 08:52:05 -07:00
Aditya Sharat
a1e47e37ae Add YogaNode.cloneWithoutChildren
Summary: Adding flat clone method back to YogaNode for reconciliation.

Reviewed By: davidaurelio

Differential Revision: D14683019

fbshipit-source-id: 08ed2ffbb16052cb11aa464f67a7ba9a64297985
2019-04-03 11:34:06 -07:00
David Aurelio
e0bc0ebe29 Move YGSetUsedCachedEntries to internal header
Summary:
@public

In order to get out of pre-releases again, we move `YGSetUsedCachedEntries` from `Yoga.h` to `Yoga-internal.h`.
This way, it’s obvious that the function is not public, and we can remove it from future versions without breaking semver contracts.

Reviewed By: SidharthGuglani

Differential Revision: D14726029

fbshipit-source-id: 8d7e747e843bf5c4b5e1d4cfbfa37ca9d240dffb
2019-04-03 08:44:14 -07:00