Commit Graph

773 Commits

Author SHA1 Message Date
Emil Sjolander
7d74e1cb66 Add test case covering padding on child
Summary: Add coverage exposed by https://github.com/facebook/css-layout/pull/262

Reviewed By: splhack

Differential Revision: D4247282

fbshipit-source-id: 25500bcfced58a8095665b73eeebca8d1c266a17
2016-11-29 16:22:32 -08:00
Emil Sjolander
b32b6029de Remove deprecated java code
Summary: Remove deprecated java code and make use of CSSEdge instead of the now removed Spacing class.

Reviewed By: AaaChiuuu

Differential Revision: D4233198

fbshipit-source-id: 736d79be266e1b9f2d62e5fe6d901de47123cdc1
2016-11-29 12:37:47 -08:00
Emil Sjolander
5fa42cd1b0 Remove Style prefix in java and cs apis
Summary: The Style prefix does not make sense in the java and c# api and only a few methods had it. This diff removes the last of those.

Reviewed By: splhack

Differential Revision: D4232920

fbshipit-source-id: 6e2ff21bbb7e0e441892023c14df579d1bc7aa49
2016-11-29 09:07:34 -08:00
Emil Sjolander
6318801470 Always use soloader. Catching exception and re-trying hides errors
Summary: Soloader is safer than System load library, retrying with System load library just hides errors

Reviewed By: lexs

Differential Revision: D4243906

fbshipit-source-id: e4d691c9c49f3b9316f67e39b9f277657d78fb3c
2016-11-29 04:37:32 -08:00
Emil Sjolander
97d524fa96 Add notice in readme about ongoing API changes
Summary: Add notice in readme to prepare open source for large renaming diffs.

Reviewed By: splhack

Differential Revision: D4240761

fbshipit-source-id: 4c8070a06c3ac009b67eb7bef5de11ce3ab3e4d8
2016-11-28 15:52:33 -08:00
Emil Sjolander
c31df519e0 Dont strip class names referenced from native
Summary: Ensure we don't strip classes used from native

Reviewed By: lexs

Differential Revision: D4237790

fbshipit-source-id: 1bd0780d965efbb8334917011ffd65896670ece1
2016-11-28 09:22:41 -08:00
Pascal Hartig
0240d09949 Enable -fPIC for C library
Summary:
At least or x86_64 linux, it appears that you need position-independent
code is required in order to link against it. Otherwise you see errors
like this:

```
/usr/bin/ld: lib_sys.rlib(CSSLayout.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib_sys.rlib(CSSNodeList.c.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
```

If I understand it correctly, you don't strictly need PIC for static libraries, but as soon as you want to link *other* dynamically linked library into it, it is required - which makes logical sense to me. Let me know if you want to enable this by default or leave it up to the developers to enable this if needed.
Closes https://github.com/facebook/css-layout/pull/263

Reviewed By: passy

Differential Revision: D4237009

Pulled By: emilsjolander

fbshipit-source-id: e73ea0ea22520758ec958a031d6e2ca62fdcda15
2016-11-28 09:22:41 -08:00
Emil Sjolander
22b0fdb3e6 Add experiment support to gentest
Summary:
This diff does two things
- Clean up some of the generated code making the files smaller.
- Add experiment support to generated tests allowing us to use gentest for things still being experimented with such as more compliant flex-basis behavior.

Reviewed By: gkassabli

Differential Revision: D4226734

fbshipit-source-id: 2cc1471c21883e8e326f16e7a8bb1a3657acd84b
v2016.11.28.00
2016-11-23 11:22:36 -08:00
Emil Sjolander
a0d560a24b Fixup recent fix to flex basis and put it behind an experimental flag
Summary: D4207106 previously fixed an issue where the computed flex basis was cached in between layout calculations, potentially caching wrong values. After landing we noticed that some product were implicitly relying on this behavior so this diff instead puts that behind a feature flag.

Reviewed By: gkassabli

Differential Revision: D4222910

fbshipit-source-id: d693482441fcc4d37a288e2e3529057a04f60541
2016-11-23 05:37:32 -08:00
Dustin Shahidehpour
dc10fdd958 Fix bug where swapping views in hierarchy throws an assert.
Summary: I found that if you move a subview to a different index, it would cause a crash in subsequent layout passes because the `CSSNodeRef` representing it was being re-inserted into the list. I spent a lot of time figuring out the best way to "diff" the view hierarchy from before and after, and I found the easiest implementation is also the most reliable. We can continue to optimize, but this is a great start.

Reviewed By: emilsjolander

Differential Revision: D4218623

fbshipit-source-id: 06253089492ac37ae4b94b7c30140ce6ed680ed2
2016-11-22 08:37:38 -08:00
Lukas Woehrl
b90f6e21bd Added feature to use rounded values
Summary:
Added an experimental feature to allow to use only rounded values. See #184. It's not a perfect solution and definitely  can be further improved. I'm looking forward to your ideas.
Closes https://github.com/facebook/css-layout/pull/256

Reviewed By: splhack

Differential Revision: D4214168

Pulled By: emilsjolander

fbshipit-source-id: 6293352d479b7b4dad258eb3f9e0afaa11cf7236
2016-11-22 05:37:34 -08:00
Lukas Woehrl
d54f09e32b Use ASSERT_FLOAT_EQ instead of ASSERT_EQ
Summary:
Changes the unit test comparsion to use ```ASSERT_FLOAT_EQ``` instead of ```ASSERT_EQ``` as they check float values.
Closes https://github.com/facebook/css-layout/pull/257

Reviewed By: splhack

Differential Revision: D4213809

Pulled By: emilsjolander

fbshipit-source-id: a79d310840814f26a122e1a0f6db47383b17d7e2
2016-11-22 02:52:30 -08:00
Dustin Shahidehpour
49a21e657b Fix bug where we insert nodes at wrong index in view hierarchy.
Summary:
We currently have a bug in `UIView+CSSLayout.m` that you can repro in a scenario like this:

```
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
  [container css_setUsesFlexbox:YES];
  [container css_setFlexDirection:CSSFlexDirectionRow];

  UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
  [subview1 css_setUsesFlexbox:YES];
  [subview1 css_setIncludeInLayout:NO];
  [container addSubview:subview1];

  UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
  [subview2 css_setUsesFlexbox:YES];
  [subview2 css_setIncludeInLayout:NO];
  [container addSubview:subview2];

  UIView *subview3 = [[UIView alloc] initWithFrame:CGRectZero];
  [subview3 css_setUsesFlexbox:YES];
  [subview3 css_setIncludeInLayout:YES];
  [container addSubview:subview3];

  [container css_applyLayout];
```

`subview3` (which is the only view whose is going to be included in layout calculation) is inserted at child index 2, instead of 0. This eventually can cause crash in CSSLayout.c because it will attempt access a child in the list which is null.

Reviewed By: emilsjolander

Differential Revision: D4215659

fbshipit-source-id: a615f50e51f85b15d3bdb437e55958865898b183
2016-11-21 18:07:36 -08:00
Emil Sjolander
2d58a36619 Move measure code for known dimensions out of main layout function
Summary: Try to move more code out of the main measure function

Reviewed By: gkassabli

Differential Revision: D4213339

fbshipit-source-id: 5ca35ca307594f3419fd0dee81321d3c2e06710f
2016-11-21 11:07:45 -08:00
Emil Sjolander
f56e8a5163 Move measure code for empty containers out of main layout function
Summary: Try to move more code out of the main measure function

Reviewed By: gkassabli

Differential Revision: D4213313

fbshipit-source-id: 2061a809202f7f948bff1b3ee8dc4c230692a223
2016-11-21 11:07:45 -08:00
Emil Sjolander
e78cf02a30 Move custom measure code out of main layout function
Summary: Try to move more code out of the main measure function

Reviewed By: gkassabli

Differential Revision: D4213302

fbshipit-source-id: df4bc43848325e99ad338a2fa6d5c9404315b0e6
2016-11-21 11:07:45 -08:00
Emil Sjolander
55fc795686 Add aspectRatio style property
Summary: Implement aspect ratio as part of Yoga. Aspect ratio allows users of the library to specify the size of the undefined dimension in terms of an aspect ratio. See test cases for examples.

Reviewed By: gkassabli

Differential Revision: D4211458

fbshipit-source-id: f8d0d318369c7b529ee29e61a52b17d0cf3b396d
2016-11-21 10:22:32 -08:00
Emil Sjolander
b16c22a8f3 Only skip updating computed flex basis within the same generation
Summary:
computed flex basis was incorrectly being reused in some circumstances between calls to caluclateLayout

also run format script.

Reviewed By: dshahidehpour

Differential Revision: D4207106

fbshipit-source-id: fc1063ca79ecf75f6101aadded53bca96cb0585d
v2016.11.21.00
2016-11-20 05:07:33 -08:00
Lukas Wöhrl
56ec33a463 Fix CS0675 warning in c#
Summary:
Fix CS0675 warning in c#.
Closes https://github.com/facebook/css-layout/pull/255

Reviewed By: emilsjolander

Differential Revision: D4204765

Pulled By: splhack

fbshipit-source-id: bcf71796e1bf585a94b3549905cb6d6bc78a34b8
2016-11-18 09:37:33 -08:00
Lukas Wöhrl
367c3a28be use fmaxf to prevent casting from and to double
Summary:
Use ```fmaxf``` to prevent double casting.
Closes https://github.com/facebook/css-layout/pull/251

Reviewed By: emilsjolander

Differential Revision: D4199342

Pulled By: splhack

fbshipit-source-id: c04bc68a3c9c97b92e910e885457cf2fe00da28b
2016-11-17 20:52:54 -08:00
Lukas Wöhrl
653150a7c4 Change more method arguments to const
Summary:
Change more method arguments to ```const```
Closes https://github.com/facebook/css-layout/pull/252

Reviewed By: emilsjolander

Differential Revision: D4199335

Pulled By: splhack

fbshipit-source-id: f54fccaea8051a49c6cdf0fcaf1a68c025ba26da
2016-11-17 20:52:54 -08:00
Lukas Wöhrl
542fc50409 do not redefine isnan if already defined via math.h
Summary:
```isnan``` is already defined in ```math.h``` (at least when using VS13) so there is no need to redefine it. it also is a nan for float and not for double opposed to ```_isnan```
Closes https://github.com/facebook/css-layout/pull/253

Reviewed By: emilsjolander

Differential Revision: D4199331

Pulled By: splhack

fbshipit-source-id: 139fb0efd68dd5df79bbaef863a8e8b9246c795d
2016-11-17 20:52:54 -08:00
Lukas Wöhrl
4f192481ee use size_t instead of unsigned long
Summary:
Use ```size_t```instead of ```unsinged long``` as this is the "offical" return type of ```strlen```. Is VS13 ```size_t``` is defined as ```unsigned long long``` which leads to a compiler warning.
Closes https://github.com/facebook/css-layout/pull/254

Reviewed By: emilsjolander

Differential Revision: D4199327

Pulled By: splhack

fbshipit-source-id: 5e1a91f282bf776e4d9f5806e6467dfe36c7a633
2016-11-17 20:52:54 -08:00
Kazuki Sakamoto
0bb2955c5c CSSNodeCopyStyle API for Java and C#
Summary: Add CopyStyle API for Java and C#

Reviewed By: emilsjolander

Differential Revision: D4189954

fbshipit-source-id: 10759fdb27bf67350d3151614f7815aa09bf7e04
2016-11-17 09:22:37 -08:00
Kazuki Sakamoto
191ac98b89 Introduce CSSNodeCopyStyle
Summary:
- Add a convenience function to copy all style from one node to another.
- CSSNodeIsDirty will return true after this function if any style was changed in the destination node.

Reviewed By: emilsjolander

Differential Revision: D4188514

fbshipit-source-id: af8d7fb5e8688c64aea05ce7ad23fff9233fb441
2016-11-17 09:22:37 -08:00
Kazuki Sakamoto
32c175ac55 Workaround fix for Visual Studio
Summary:
- Problem: Build error in Visual Studio since an array cannot have zero size.
  -  e6702e1168 (commitcomment-19839659)
-  Solution: Add 1 until we'll have actual CSSExperimentalFeature value.

Reviewed By: emilsjolander

Differential Revision: D4191268

fbshipit-source-id: 53fdcc388292e76c2b97ad071f0d7c27d0613ecf
2016-11-17 09:07:28 -08:00
Dustin Shahidehpour
4b61cdccea Add flag to not include view in layout.
Summary:
When dealing with manual sizing in UIView's (or UIKit in general) we see a common pattern like so:

Below we have an example implementation of a view with two Labels that want to be stacked horizontally. If we don't pass a second string, we hide the second label and give up the available space to the first label. See below:

```
interface TitleSubtitleView : UIView

- (void)configureWithTitle:(NSString *)title subtitle:(NSString *)subtitle;

end

implementation {
  UILabel *_titleLabel;
  UILabel *_subtitleLabel;
}

....

- (void)configureWithTitle:(NSString *)title subtitle:(NSString *)subtitle {
  _titleLabel.text = title;
  if (subtitle.length > 0) {
    _subtitleLabel.hidden = NO;
    _subtitleLabel.text = subtitle;
  } else {
    _subtitleLabel.hidden = YES;
  }
}

- (CGSize)sizeThatFits:(CGSize)size {
  const CGSize titleSize = [_titleLabel sizeThatFits:size];
  CGSize subtitleSize = CGSizeZero;
  if (!_subtitleLabel.isHidden) {
    subtitleSize = [_subtitleSize sizeThatFits:CGSizeMake(size.width - titleSize.width, size.height - titleSize.height)];
  }
}

- (void)layoutSubviews {
  [super layoutSubviews];

  const CGSize titleSize = [_titleLabel sizeThatFits:size];
  _titleLabel.frame = CGRectMake(0, 0, titleSize.width, titleSize.height);
  if (!_subtitleLabel.isHidden) {
    subtitleSize = [_subtitleSize sizeThatFits:CGSizeMake(size.width - titleSize.width, size.height - titleSize.height)];
    _subtitleLabel.frame = CGRectMake(CGRectGetMaxX(_titleLabel.frame), 0, subtitleSize.width, subtitleSize.height);
  }

}
```

The problem is with the CSSLayout framework, as long as your view is in hierarchy, it's going to be allocated space during layout calculation. The only way to fix the view above would be to completely remove it from view hierarchy if it isn't being used. The problem is that adding/removing views from hierarchy is much less performant than hiding.

As a result, we need a way to tell the CSSLayoutKit library that even though a view is in hierarchy, we don't want to include it in layout. With this diff, we could change the class to look like this:

```
interface TitleSubtitleView : UIView

- (void)configureWithTitle:(NSString *)title subtitle:(NSString *)subtitle;

end

implementation {
  UILabel *_titleLabel;
  UILabel *_subtitleLabel;
}

....

- (void)configureWithTitle:(NSString *)title subtitle:(NSString *)subtitle {
  _titleLabel.text = title;
  _subtitleLabel.text = subtitle;

  const BOOL subtitleHasText = subtitle.length > 0;
  _subtitleLabel.hidden = !subtitleHasText;
  [_subtitleLabel css_includeInLayout:!subtitleHasText];
}

- (CGSize)sizeThatFits:(CGSize)size {
  const intrinsicSize = [self css_intrinsicSize];
  return CGSizeMake(MIN(size.width, intrinsicSize.width), MIN(size.height, intrinsicSize.height)));
}

- (void)layoutSubviews {
  [super layoutSubviews];

  [self css_applyLayout];
}
```

Reviewed By: emilsjolander

Differential Revision: D4189897

fbshipit-source-id: 403d11d84d47691e3ce0b5ac18a180b0e4c104c4
2016-11-17 08:37:34 -08:00
Kazuki Sakamoto
b9c4c403a9 Fix memory func test
Summary: Reset gNodeInstanceCount before memory func test.

Reviewed By: emilsjolander

Differential Revision: D4193712

fbshipit-source-id: a4aba84d054d98a7baf438e213a90bd7ef34e979
2016-11-17 07:52:34 -08:00
Dustin Shahidehpour
56aa279fef BREAKING: remove css_sizeThatFits:, replace with new API.
Summary: When I try to use this in practice, I have come to realize that css_sizeThatFits will 99% return to you the constrainedSize that you pass it, thus making it useless. Instead, we replace it with a new API that will tell you the optimal size of the resolved layout. From this we can choose to use that size, or scale it down.

Reviewed By: emilsjolander

Differential Revision: D4191873

fbshipit-source-id: d36a2850448d9d82f97e5ef4c7397778c2a14094
2016-11-17 07:37:32 -08:00
Kazuki Sakamoto
7e4bb732ff Introduce CSSNode.Create API
Summary:
Add a convenience construction method for CSSNode.

    CSSNode node = CSSNode.Create(
        positionType: CSSPositionType.Absolute,
        wrap: CSSWrap.Wrap,
        position: new Spacing(top:6, right:4),
        margin: new Spacing(bottom:5, left:3));

Reviewed By: emilsjolander

Differential Revision: D4193380

fbshipit-source-id: 30b917f64e92997355a76e3b11799883b86fb9de
2016-11-17 07:07:32 -08:00
Emil Sjolander
32ba5ae647 Make gtest a submodule in open source
Summary: Remove infra for dynamically downloading gtest as this fails like 50% of the time on travis. I'll manually push gtest as a submodule instead.

Reviewed By: gkassabli

Differential Revision: D4183033

fbshipit-source-id: 09a121b8ede7a5974a29b6692edc63bff79aece7
2016-11-17 04:52:31 -08:00
Emil Sjolander
2fa6f5087d Disable UIKit memory tests on travis
Summary: For some reason these tests don't pass when running in travis. They are still running internally so we should catch any regressions. We can remove this if we figure out what is causing travis to fail here but until now I would rather get travis to pass.

Reviewed By: dshahidehpour

Differential Revision: D4189251

fbshipit-source-id: a27d3390f6b6fdcac6a3312d02581bb64969fd4b
2016-11-17 04:37:34 -08:00
Emil Sjolander
c2aac9f46e Add googletest submodule 2016-11-16 16:36:36 +01:00
Kazuki Sakamoto
ef81d4b0c7 Introduce CSSLayoutSetMemoryFuncs
Summary:
- Add CSSLayoutSetMemoryFuncs function which allows application to replace malloc, calloc, realloc and free with application's functions, like zalloc and zfree of zlib.
- Fixed memory leaks in tests.
- Close #247

For example, to use dlmalloc with USE_DL_PREFIX

    CSSLayoutSetMemoryFuncs(&dlmalloc, &dlcalloc, &dlrealloc, &dlfree);

Reviewed By: emilsjolander

Differential Revision: D4178386

fbshipit-source-id: a79dbdaf82a512f42cc43f99dbc49faba296903b
2016-11-15 20:22:51 -08:00
Kazuki Sakamoto
667858990c Fix build
Summary: Fix C# build

Reviewed By: emilsjolander

Differential Revision: D4183287

fbshipit-source-id: 7dda449a940589de1d37f4024964a6512ab123e3
2016-11-15 17:37:34 -08:00
Kazuki Sakamoto
d80bac4234 Use LTR and RTL instead obsolete enums
Summary: Use LTR and RTL instead obsolete LeftToRight and RightToLeft enums

Reviewed By: emilsjolander

Differential Revision: D4175897

fbshipit-source-id: d22af46d3292f9ad1754f571e95cb64b11722f7b
2016-11-15 09:22:45 -08:00
Emil Sjolander
d1c555fede Autogenerate enum defenitions for all languages
Summary: Keeping enums in sync between all the different bindings is tedious and error prone. Getting one of the values in the incorrect order could lead to many hours of debugging as they are passed as ints to C. This diff adds a simple python script to generate these enums for all languages. This also makes it much easier to add support for more languages in the future

Reviewed By: gkassabli

Differential Revision: D4174263

fbshipit-source-id: 478961a8f683e196704d3c6ea1505a05c85fcb10
2016-11-15 08:52:59 -08:00
Emil Sjolander
ac4d0ab2a1 Count allocations relative to start of test
Summary: If some test previous to this test fails to de-allocate a node we don't want this test to fail.

Reviewed By: dshahidehpour

Differential Revision: D4182179

fbshipit-source-id: 229dd5736d6d7b9c1b22b181e022c788584b9c17
2016-11-15 07:22:34 -08:00
Emil Sjolander
603321e1ab Install and use java 8 on travis
Summary: Java tests need to run with java 8, ensure travis runs java 8

Reviewed By: gkassabli

Differential Revision: D4182384

fbshipit-source-id: 61ba77d3e0f008f50912d088d3e504cb96e46bdc
2016-11-15 06:40:51 -08:00
Dustin Shahidehpour
129437f49e Change CLK prefix on static functions to CSS.
Summary: Talked with emilsjolander offline, and we want to keep the prefixes standardized in this lib. Changing CLK prefixes to CSS.

Reviewed By: emilsjolander

Differential Revision: D4175634

fbshipit-source-id: 7152268b9312df3fdb8eaee7ce3f6baabc5de937
2016-11-14 13:22:52 -08:00
Fred Liu
204aba80b9 Revert D4157971: [csslayout] BREAKING - Fix sizing of container with child overflowing parent
Summary: This reverts commit 3cfae15ac8b65b70f01789444099ee684e1b099a

Differential Revision: D4157971

fbshipit-source-id: be055cf018fd39b3cee9af0bc777831fcf757190
2016-11-14 12:22:58 -08:00
Emil Sjolander
e6702e1168 Implement standard interface for toggling experimental features
Summary: We want to start experimenting with changes to the library in a more controlled and easier to measure manner. This diff adds the basics of an experiment layer to csslayout.

Reviewed By: gkassabli

Differential Revision: D4174260

fbshipit-source-id: ad3667183810c02833fba9a1276f89286e848fcd
2016-11-14 03:37:45 -08:00
Emil Sjolander
b99172d28b rename CSSWrapType to shorter CSSWrap matching java and csharp
Summary: Java and csharp already use CSSWrap and not CSSWrapType. Let's consolidate and stick with the shorter of the two.

Reviewed By: gkassabli

Differential Revision: D4174257

fbshipit-source-id: ba0bfab996ba158b07863d8c72cf2a41262c9592
2016-11-14 03:37:45 -08:00
Emil Sjolander
7a3df9999b BREAKING - Fix sizing of container with child overflowing parent
Summary:
Fixes issue brought up in https://github.com/facebook/react-native/issues/10603

The gist of the problem is that in css it is fine for a child to overflow a parent if it feels the need to, we were not respecting this.

Reviewed By: gkassabli

Differential Revision: D4157971

fbshipit-source-id: 3cfae15ac8b65b70f01789444099ee684e1b099a
2016-11-14 02:22:44 -08:00
Dustin Shahidehpour
e0e88f97b6 Cleanup documentation, add pragma marks, and rename static functions in UIView+CSSLayout
Summary: There is a little bit of tidying that was needed for this class. The documentation was inconsistent in the header, the static functions were prefixed with underscores (discouraged by apple). Cleaned it all up.

Reviewed By: rnystrom

Differential Revision: D4167936

fbshipit-source-id: 6e9a6e7fb78e3cff290b867a1ac0d5dd5cc9de5b
v2016.11.14.00
2016-11-11 16:52:47 -08:00
Dustin Shahidehpour
b4d0e1a17c Add some more compiler flags to CSSLayoutKit.
Summary: Just firming up some stuff with more compiler flags.

Reviewed By: rnystrom

Differential Revision: D4168081

fbshipit-source-id: fced407f03944081bdd70cc28c57e3dc842ff7f0
2016-11-11 15:07:35 -08:00
Kazuki Sakamoto
e40af30fa5 Update .travis.yml for C# test
Summary: Closes https://github.com/facebook/css-layout/pull/246

Reviewed By: emilsjolander

Differential Revision: D4167133

Pulled By: splhack

fbshipit-source-id: d55c0ff5155311f4da859b12b6485b120dac480b
2016-11-11 09:07:44 -08:00
Emil Sjolander
cd054ecf26 Expose CSSLayoutSetLogger to java
Summary: Expose CSSLayoutSetLogger to java

Reviewed By: astreet

Differential Revision: D4153502

fbshipit-source-id: 630909d9d0d36d94d7cd3027476ddb52668b8cc0
2016-11-11 08:23:14 -08:00
Emil Sjolander
aaa977f645 Fix flex within max size if max size is not constraint to
Summary: Previous fix for flex in max size constraint was not entirely correct and was missing a test case for the time when the max constraint is not applied. This diff addresses that.

Reviewed By: gkassabli

Differential Revision: D4162104

fbshipit-source-id: 08feba6cb4e789c9aa12179e2cdeadc66b011841
2016-11-11 08:07:42 -08:00
Dustin Shahidehpour
70e01a4476 Rename uikit/CSSLayout to CSSLayoutKit.
Summary:
When trying to integrate this into an Xcode project that already included CSSLayout.[c|h], we were getting a linker error.

Upon digging in, I found out that Xcode was becoming confused because the imports of the uikit library and the c library are both `#import <CSSLayout/CSSLayout.h>`. So, it needed a new name.

Reviewed By: emilsjolander

Differential Revision: D4162621

fbshipit-source-id: b5f7624eb29f1b9eaebbed5104ec9ea8a12ad2e5
2016-11-11 07:38:15 -08:00