Summary: JNI version is the default, its name should reflect that
Reviewed By: lucasr
Differential Revision: D3992777
fbshipit-source-id: cdd4cc58f3c15b5db1158f6f794394eb5c44a44d
Summary: Remove internal xcode_public_headers_symlinks flag from open source in hope to fix travis builds.
Reviewed By: lucasr
Differential Revision: D3992698
fbshipit-source-id: 1bd19bdd18d1bdfff595c19475bb2adc23d95335
Summary: Clearly mark java CSSNode as deprecated. It will go away very soon.
Reviewed By: lucasr
Differential Revision: D3992775
fbshipit-source-id: b3ceca277e5c7426eb51f8cbeacf5e2fe451c6ec
Summary: Move csharp tests into csharp/tests instead of tests. I feel like it makes more sense to have tests next to source. This is similar to how the C version has it as well.
Reviewed By: splhack
Differential Revision: D3993002
fbshipit-source-id: d9241f8ce7707c17a49c17fea2cce9959d52697d
Summary: buck rules are not meant to be in the root buck file but instead next to source files. This diff moves benchmark rule into benchmark folder.
Reviewed By: lucasr
Differential Revision: D3992992
fbshipit-source-id: 34782ff73bbd5b799d83d0f01b553bfab928f1df
Summary: Ensure all native memory is released once gc deallocates the java object reference.
Reviewed By: lucasr
Differential Revision: D3992759
fbshipit-source-id: f648b72ead5bdb7257a5197496b19795f71f3788
Summary: Add some dependencies to enable running the native version of csslayout within robolectric internally.
Reviewed By: lucasr
Differential Revision: D3960840
fbshipit-source-id: 08a45f7299b04f70f643b0c9b95da13f90690dd8
Summary:
- Define CSS_ASSERT_FAIL_ENABLED for P/Invoke (Visual Studio project already has it)
- Pass managed delegate pointer to unmanaged side via P/Invoke.
- CSSAssertFail will call the managed delegate when assert failed.
- The delegate will throw managed exception.
Reviewed By: emilsjolander
Differential Revision: D3982084
fbshipit-source-id: 058a87c10ca89238362be4d8759cc00dd0c9b376
Summary: - Use WeakReference for parent to avoid circular reference although GC will treat it
Reviewed By: emilsjolander
Differential Revision: D3982520
fbshipit-source-id: b0f6764aa4df3da53be51f6cb4fe2994d989afdf
Summary:
- Add CSSNodeGetInstanceCount API to get the number of native instances.
- It makes testing easy.
Reviewed By: emilsjolander
Differential Revision: D3981990
fbshipit-source-id: 98005ae1fc21d4c8802f24030fff9ffb00bd292d
Summary:
- Unused _context GCHandle prevent calling CSSNode destructor.
- CSSNode C# impl will retain children node when calling CSSNodeInsertChild, so the lifetime of C# object is the same as the lifetime of native instance.
Reviewed By: emilsjolander
Differential Revision: D3981697
fbshipit-source-id: 71f0f7be97fd694d27934d7d07deb64ee08b2840
Summary: This diff resolves some differences in behaviour between jni and java css nodes. This ensures certain test cases pass with both implementations.
Reviewed By: lucasr
Differential Revision: D3960755
fbshipit-source-id: 3e13a9435208851a96a619c07625ef2a5402f5ec
Summary: In the libraries where headers symlinks are required, we enable them.
Reviewed By: skotchvail
Differential Revision: D3943274
fbshipit-source-id: c7ec741af020a60bb7c39b10773cea58a33adc3e
Summary: Its very usefull to be able to run valgrind on the tests and benchmarks. We were previously not freeing test memory so valgrind output was very messy.
Reviewed By: javache
Differential Revision: D3937493
fbshipit-source-id: 23c6970d7769b081575d39de583ba954fc65a397
Summary:
This PR adds the C# version of the `CSSNode` API calls where it currently has only Java and C versions.
Closes https://github.com/facebook/css-layout/pull/225
Reviewed By: lucasr
Differential Revision: D3936431
Pulled By: emilsjolander
fbshipit-source-id: 689cb359c204c6c52e04e031c66615fb04c001af
Summary: I accidentally turned the logic around when cleaning up some code. This was subtle and only caught a week later by a RN product engineer. This fixes the bug without reverting the rest of the code cleanup.
Reviewed By: lucasr
Differential Revision: D3923635
fbshipit-source-id: bfeb175bb40393be63cafb6a995b22701b87ffec
Summary: Oops, when regexing start->left/right end->left/right I did not take into account flex-start and flex-end. Easiest solution is to regex back flex-left and flex-right into their correct values.
Reviewed By: lucasr
Differential Revision: D3930244
fbshipit-source-id: 20742cbc8e5f23af694e14584c7c3df89526876e
Summary:
Closes#222 for the `csharp` implementation which does not use the `CSSLayoutContext` parameter in the `CalculateLayout` method call.
Closes https://github.com/facebook/css-layout/pull/223
Reviewed By: lucasr
Differential Revision: D3918948
Pulled By: emilsjolander
fbshipit-source-id: 8708e08b226500727e33d131ed880bb7e077c08e
Summary:
@public
This fixes measuring of items in the main axis of a container. Previously items were in a lot of cases measured with UNSPECIFIED instead of AT_MOST. This was to support scrolling containers. The correct way to handle scrolling containers is to instead provide them with their own overflow value to activate this behavior. This is also similar to how the web works.
This is a breaking change. Most of your layouts will continue to function as before however some of them might not. Typically this is due to having a `flex: 1` style where it is currently a no-op due to being measured with an undefined size but after this change it may collapse your component to take zero size due to the implicit `flexBasis: 0` now being correctly treated. Removing the bad `flex: 1` style or changing it to `flexGrow: 1` should solve most if not all layout issues your see after this diff.
Reviewed By: majak
Differential Revision: D3876927
fbshipit-source-id: 81ea1c9d6574dd4564a3333f1b3617cf84b4022f
Summary:
This version of the css-layout project includes support for .NET projects. Up in the air is how many configurations of .NET projects we allow for, such as Portable Class Libraries, Universal Windows Platform, .NET Core, etc. Still needs integration with Buck.
Closes https://github.com/facebook/css-layout/pull/220
Reviewed By: lucasr
Differential Revision: D3909367
Pulled By: emilsjolander
fbshipit-source-id: aaaa9c4ff2d3452649f256c3268cf873cf33a0b9
Summary: Add tests to check that measure modes are set correctly.
Reviewed By: lucasr
Differential Revision: D3856585
fbshipit-source-id: 421b368d2d2cbca1d2ba4d58d850836cb22128ac
Summary:
@public
Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.
Reviewed By: astreet
Differential Revision: D3855801
fbshipit-source-id: 3c365f9e6ef612fd9d9caaaa8c650e9702176e77
Summary: Add tests to check that measure modes are set correctly.
Reviewed By: lucasr
Differential Revision: D3856585
fbshipit-source-id: 5fa407f149b1c081503b4ad7aa5f0203ec5b1cc0
Summary:
@public
Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.
Reviewed By: astreet
Differential Revision: D3855801
fbshipit-source-id: 6077b0bcb68fe5ddd4aa22926acab40ff4d83949
Summary: Now that gentest has been used to cover all flexbox properties as well as some internal behavior I thought it was time to remove the old CSSLayoutTest.cpp. This removes a huge amount of previously regex transpiled code in favor of the new test suite which does more fine grained assertions and uses the public api. Given that RTL support was added to gentest now I feel confident that the new test suite covers all and more cases than the old one.
Reviewed By: lucasr
Differential Revision: D3863095
fbshipit-source-id: a2c4f87cd2263b4cc1fcdec4f2a0964f0696472f
Summary: previously when copying in a test inout into an editor the user of gentest needed to remove the ` * ` prefix. This was annoying so this diff fixes that by removing that from gentest.
Reviewed By: lucasr
Differential Revision: D3862943
fbshipit-source-id: 06bd3ee3fa3f85cc44b6ea1d67cf3e91ed368791
Summary: Make input html easier to read by indenting it and adding a space between children. The code to do this could very well be improved but it works for the current set of inputs.
Reviewed By: lucasr
Differential Revision: D3798087
fbshipit-source-id: 0d50ff276000f14ed078cf5ce2e7560ace285a6a
Summary:
When an absolutely positioned node appeared inside an overflow:hidden
parent, we were limiting its height. This is inconsistent with how
layout behaves on the web.
Closes https://github.com/facebook/css-layout/pull/218
Reviewed By: lucasr
Differential Revision: D3797285
Pulled By: emilsjolander
fbshipit-source-id: 98f98e77aa26edce86b9882c1cac284799b69a27
Summary: Generate tests for border. This required modifying gentest to add the parent clientLeft and clientTop so that border width are accounted for in output.
Reviewed By: lucasr
Differential Revision: D3791286
fbshipit-source-id: 698cc2332a3f4118e1afdfbfd745ba824e8ec3f4
Summary: While adding tests for CSSEdge I found that when setting both horizontal/vertical/all + left/right then left/right were not correctly overriding the others. This is now fixed and validated through added tests
Reviewed By: lucasr
Differential Revision: D3791106
fbshipit-source-id: 3e0c943f94218848a1fbf36e5ae48dbc720ea923
Summary: Previous test for dirty propagation (last test in CSSLayoutTest.cpp) only tested one specific case. This tests much more of the bahavior to ensure that a vital optimization in css-layout is applied correctly.
Reviewed By: lucasr
Differential Revision: D3790968
fbshipit-source-id: af11a5924640cd1d497920cd97549603a9f147cc
Summary: Use fbjni for safer and easier jni bridging. This diff includes all of fbjni as it currently does not live as its own open source project. The code was copied from the react-native open source distribution.
Reviewed By: ritzau
Differential Revision: D3764065
fbshipit-source-id: 7ff566af314dcb5279460c322c476ef6f6ed8131
Summary: Measure caching is a crucial optimization to css-layout which re-uses the output of the measure function if possible. This logic was never covered by tests.
Reviewed By: lucasr
Differential Revision: D3790915
fbshipit-source-id: 7fe6d5ebb1303d3186d24d15e401901bc7c8ecdb
Summary: don't hardcode .so extension. Different platforms use different extensions such as .dll, .so, .dylib
Reviewed By: lucasr
Differential Revision: D3785675
fbshipit-source-id: c326e330741e65a7f5d3cb4e4105894c582a2a12