Summary:
Move configuration to new ```YGConfig``` and pass them down to CalculateLayout. See #418 .
Adds ```YGConfigNew()``` + ```YGConfigFree```, and changed ```YGSetExperimentalFeatureEnabled``` to use the config.
New function for calculation is ```YGNodeCalculateLayoutWithConfig```.
Closes https://github.com/facebook/yoga/pull/432
Reviewed By: astreet
Differential Revision: D4611359
Pulled By: emilsjolander
fbshipit-source-id: a1332f0e1b21cec02129dd021ee57408449e10b0
Summary:
Changed the flex getters to return the values they were actually set. See #421 .
Closes https://github.com/facebook/yoga/pull/431
Reviewed By: astreet
Differential Revision: D4604744
Pulled By: emilsjolander
fbshipit-source-id: 02d79100ef22be866db1c3bd9d53e4447186811f
Summary:
Fix for #413. This was a hangover from a previous attept to fix other align-content problems.
Closes https://github.com/facebook/yoga/pull/417
Reviewed By: astreet
Differential Revision: D4604727
Pulled By: emilsjolander
fbshipit-source-id: 92fd31a385d8182c6b201c891d5ae478372d525d
Summary:
Since we are reading from a file, we should make sure this struct is packed, just in case we change it down the line and the compiler decides it might want to introduce padding, we're now protected against that.
There was also a discussion about the fact that people might use `ptr += sizeof(BundleHeader)` as an idiom in their code, which would currently be incorrect, if padding was introduced at the end of the file. Actually, it remains incorrect to do that now, because a RAM bundle header is a different size to a BC Bundle header. If people are properly testing their code, they should spot this pretty quickly, because it will always be an incorrect thing to do with a RAM bundle, so this isn't as bad as previously thought: where the code only succeeds when the compiler deigns to not pad the struct at the end.
This diff also cleans up how headers are initialised. `BundleHeader` has a constructor that explicitly zero-initialises it so we can rely on the default initializer to do the right thing now.
Reviewed By: mhorowitz
Differential Revision: D4572032
fbshipit-source-id: 7dc50cfa9438dfdfb9f842dc39d8f15334813c63
Summary: I broke Circle CI builds by moving a file, so I am updating the OSS build setup with details of the move. Whilst I was testing the change, I noticed that the UI Explorer build was also already broken, so this diff also changes some of its configuration to make it build again.
Reviewed By: javache
Differential Revision: D4579137
fbshipit-source-id: 4cbb1ef148075280b991cbc5bb47bf96ec3d543a
Summary:
This PR removes some duplicate code by calculating with ```mainSize```/```crossSize``` and converting that to ```width``` or ```height``` at the end. See #395 .
Closes https://github.com/facebook/yoga/pull/396
Reviewed By: astreet
Differential Revision: D4564713
Pulled By: emilsjolander
fbshipit-source-id: 0b24e69cc9dc75cdf93deeb6c076dcacf134c6d8
Summary:
I couldn't resist to do this 😄#394
This adds ```flex-wrap: wrap-reverse```
I think we hit a edge case here:
https://stackoverflow.com/questions/33891709/when-flexbox-items-wrap-in-column-mode-container-does-not-grow-its-width
as is differs here from chrome, but I think that yoga is here more correct.
So I haven't added this test yet as this would fail against chrome, as chrome outputs a width of 30 for root, whereas yoga gets a width of 60 here, which I think is correct. Strangely the output of ```flex-wrap:wrap``` is in jsfiddle also only with a (visual) width of 30 on chrome, while the tests gets generated with 60.
```html
<div id="wrap_reverse_column" style="height: 100px; flex-wrap: wrap-reverse">
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
</div>
```
Looking forward what you think here emilsjolander
Closes https://github.com/facebook/yoga/pull/398
Reviewed By: astreet
Differential Revision: D4564711
Pulled By: emilsjolander
fbshipit-source-id: 33dc055abd8444b2aa7796ef90bd7ec99e961bb8
Summary:
In order for `CxxModule` modules to be able to do things like emit events, we need to expose the bridge instance.
To allow classes derived from `CxxModule` in other projects to include `<cxxreact/Instance.h> I also needed to convert all the header includes to non-relative ones.
Reviewed By: javache
Differential Revision: D4564145
fbshipit-source-id: a5bc28dd9b40e2b141af9e867105c56083fbdcdc
Summary:
...to reflect the modern world we live in with dynamic DPI platforms :)
Closes https://github.com/facebook/yoga/pull/375
Reviewed By: dshahidehpour
Differential Revision: D4528518
Pulled By: emilsjolander
fbshipit-source-id: e422bd4ae148e02c598a7b484a6adfa8c0e1e0c9
Summary:
Even so I know there are some opinions against ```margin: 0 auto``` it's still part of the spec: https://www.w3.org/TR/css-flexbox-1/#auto-margins and pretty usefull if you have to position via ```justify-content```.
This PR adds an implementation for that.
It adds an additonal ```YGUnitAuto``` and margins got ```YGNodeStyleSetMarginAuto``` functions as well.
Closes https://github.com/facebook/yoga/pull/357
Reviewed By: astreet
Differential Revision: D4501142
Pulled By: emilsjolander
fbshipit-source-id: 86519f8632496f46e78a7c9dbc5b21e212e3e0c7
Summary:
Fixes ```align-content:strech``` on nodes without specified cross dimension, if there are multiple lines. Currently it uses the full height of the parent, but it has to use the line height. As we don't know the number of lines until here, we need to realign the relevant children.
Closes https://github.com/facebook/yoga/pull/368
Reviewed By: gkassabli
Differential Revision: D4528559
Pulled By: emilsjolander
fbshipit-source-id: 019e6f85fa452d0c3412f711e3886f0c4452da47
Summary:
Due to the changes in 46817a38. We have a bug if the layout changes.
This PR fixes this bug and adds a test for it.
Additionally it correctly marks negative percentage values as undefined dim.
It also changes the ```resolvedDimensions``` to use a reference instead of the full value in order to minimize the memory requirement of a ```YGNode``` and reduces the copying of the ```YGValue```.
Closes https://github.com/facebook/yoga/pull/379
Reviewed By: gkassabli
Differential Revision: D4528552
Pulled By: emilsjolander
fbshipit-source-id: c024fe3a009c3788af319b689858ea3374c46477
Summary:
Adds the two missing alignments ```space-between``` and ```space-around``` for ```align-content``` . Those values are a noop on ```align-items``` in order to prevent a breaking changes for an additional enum.
Fix#229
Closes https://github.com/facebook/yoga/pull/364
Reviewed By: gkassabli
Differential Revision: D4528561
Pulled By: emilsjolander
fbshipit-source-id: ea6291b6dd22cef05d9eec03893250d50371236e
Summary:
Fixes#11272Fixes#11572Fixes#11781
The main changes here are:
* This depends on the latest CocoaPods (1.2.0). It’s currently in RC, but if I’m not mistaken a proper release is expected soon. /cc dantoml
* Adds required header search paths for the jschelpers and cxxreact subspecs.
* Makes the jschelpers and cxxreact headers private to building React Native, not visible to the user’s project.
* It uses the canonical upstream Yoga v1.0.0 podspec: https://github.com/facebook/yoga/blob/master/Yoga.podspec
* Consistent styling.
I have been able to get our app to build again using this https://github.com/artsy/emission/pull/437. The spec has some warnings, but otherwise fully passes lint.
rh389 sjmueller Could you please test with your projects?
Closes https://github.com/facebook/react-native/pull/12089
Differential Revision: D4518605
fbshipit-source-id: ecf86232d8b1af52d139eadd1acc10f5c1d42c29
Summary:
Fix#241 and successor for #302
Added new property ```display``` with ```YGDisplayFlex``` and ```YGDisplayNone```. Allows to hide nodes from the layout without the need to remove it from the DOM.
Closes https://github.com/facebook/yoga/pull/369
Reviewed By: astreet
Differential Revision: D4501141
Pulled By: emilsjolander
fbshipit-source-id: 0dfeee381f6d1e4bbba81926126b83dd7abab9d6
Summary:
This PR forces the order of the generated enums in alphabetically order. This is needed to have a predictable order of the enums across different python versions. Which reduces the pain for merging multiple enum additions.
Closes https://github.com/facebook/yoga/pull/370
Reviewed By: gkassabli
Differential Revision: D4501140
Pulled By: emilsjolander
fbshipit-source-id: 66c0ed9e4ea7a5990578b53b0a7e400c13dd53a9