Summary: Wrote some tests to make sure the associated objects we use for layout live and die with the objects. This was worthwhile because it made me realize UIView+CSSLayout wasn't enabled to ARC. As a result, my tests were failing because they weren't explicitly deallocing nodes.
Reviewed By: rnystrom
Differential Revision: D4023324
fbshipit-source-id: 5356cf4f0522582d75f83b5eb2193d9bc8d63aee
Summary: `sizeThatFits:` can be expensive, this optimizes our measuring function so that we do not call it if we know that we are going to use the exact height and width that were passed-in.
Reviewed By: rnystrom
Differential Revision: D4023715
fbshipit-source-id: dc02703b50bafd168ffab62ed98a7f6342100cc9
Summary: If views are hidden on screen, we don't want to bother including them in layout calculations.
Reviewed By: rnystrom
Differential Revision: D4022992
fbshipit-source-id: 2e93eb911f26223f305ef7ce788f86d050b83e4a
Summary: I'm going to make some changes, but first, I want to get testing setup.
Reviewed By: rnystrom
Differential Revision: D4022585
fbshipit-source-id: a48516faad0bcb1a9cf5610ab21da5ee099c6f16
Summary: Don't assume a node with a measure function is a leaf node
Reviewed By: gkassabli
Differential Revision: D4021096
fbshipit-source-id: 7e039239b1697a0ac42dce9f4b7e252a931bad7e
Summary: Rename C test target to match pattern of other test targets
Reviewed By: gkassabli
Differential Revision: D4014931
fbshipit-source-id: 2b4b831d6073214e8162a1d27b7478f3665a795f
Summary: This diff adds compatibility with Apple TVOS Buck build for CSSLayout library. Warning fixes are needed to ensure correct build
Reviewed By: emilsjolander
Differential Revision: D4001901
fbshipit-source-id: f095b4ac0ba91addb28d877b411ec27ecff4aad6
Summary: Update readme adding UIKit and fixing things that have changed
Differential Revision: D4015068
fbshipit-source-id: 213a60bea6f16ca01a4e613c8e3563f7c354ca8e
Summary:
The changed functions tripped -Wmissing-prototypes. (e.g.,
`void Foo();` doesn't count as a prototype in C. you need `void
Foo(void);`)
Reviewed By: mzlee
Differential Revision: D4012611
fbshipit-source-id: f56949d464e0ce602138b60f4abfd45b211be3b2
Summary: Add flexbox support to UIViews via a category
Reviewed By: dshahidehpour
Differential Revision: D4002873
fbshipit-source-id: f89de3acdf8fd89c7801918dcad34ba9011dd025
Summary: Move java buck rules out of the root buck file and into the java subfolder. This matches how buck should be used. Having one huge buck file is not best practice.
Reviewed By: lucasr
Differential Revision: D4008408
fbshipit-source-id: 5895c62cc8806d6a849e1b2cc6ea95c36b9d99b6
Summary: Remove tests for CSSNodeDEPRECATED. Java tests will be replaced by jni binding tests in upcoming diff.
Reviewed By: lucasr
Differential Revision: D3992821
fbshipit-source-id: d4877674c96f667f5acf92aab58af02aa27da4c2
Summary: Rename init() -> reinit() to be more in line with what it now does as the initiall init is done when constructing the object.
Reviewed By: lucasr
Differential Revision: D3992811
fbshipit-source-id: 61a10acc873ec028b2789007a400d89e62cf31d6
Summary: Rename reset() -> free() to be more in line with what it now does as the default implementation is JNI
Reviewed By: lucasr
Differential Revision: D3992808
fbshipit-source-id: 8428ae33268d1417ce8642b741e47150a17bf077
Summary: Don't require calling init() to used an allocated object. This makes more sense and is more in line with how jni in java is generally managed.
Reviewed By: lucasr
Differential Revision: D3992802
fbshipit-source-id: 06d65821f1802ed8f2b2db651cef69f6851803f2
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