Commit Graph

850 Commits

Author SHA1 Message Date
Lukas Woehrl
ca4481258c regen unittests and small fixes after merge 2016-12-21 22:22:21 +01:00
Lukas Woehrl
d517a89c1e Merge branch 'facebook/master' into percentage-feature 2016-12-21 22:17:29 +01:00
Lukas Woehrl
78f32f9aa6 Merge remote-tracking branch 'refs/remotes/facebook/master' into percentage-feature 2016-12-21 22:03:43 +01:00
Georgiy Kassabli
85b8386ba1 Test for minHeight with flexing
Summary: This test creates a repro case for Yoga to emulate UFI layout failure

Reviewed By: emilsjolander

Differential Revision: D4313632

fbshipit-source-id: 35be7d86b50a9ae08c81891a889a74e4b61f2d27
2016-12-21 11:39:34 -08:00
Dustin Shahidehpour
7ec3607446 Fix diffing algorithm for reattaching views.
Summary:
There is a bug currently where we don't traverse the entire tree to detect view hierarchy changes.

Currently, if you had a hierachy like this:
```
container = UIView
container.subviews = @[subview1, subview2];

subview1.subviews = @[sub11, sub12, sub13];
subview2.subviews = @[sub21, sub22, sub23];
```

and then modified via:
```
subview2.subviews = @[newView1, newView2, newView3];
```

our algorithm wouldn't identify that we had new views that needed their layout calculated, and would cause a crash later on.

Reviewed By: emilsjolander

Differential Revision: D4357662

fbshipit-source-id: 2f61f213c5f1a62948a653f3b1fa3d874c5075f7
2016-12-21 11:09:38 -08:00
Lukas Woehrl
34c97b03f6 dedup code 2016-12-21 07:25:23 +01:00
Lukas Woehrl
7e4a6f0e64 minor tweaks 2016-12-20 20:45:44 +01:00
Dustin Shahidehpour
835bb1cd9c Add isLeaf flag to Views.
Summary: While building some views with YogaKit, I found an interesting problem. If you are apply `yg_` properties to a view which is constructed of subclassed views (that don't use Yoga.) we still treat view (and it's subviews) like they are using YogaKit. This fixes that behavior.

Reviewed By: emilsjolander

Differential Revision: D4348344

fbshipit-source-id: 37b8648918529f55afea1d1883a03af398aac849
2016-12-20 11:39:36 -08:00
Lukas Woehrl
a6dcd54070 no need to compute edge value on get 2016-12-20 20:24:02 +01:00
Lukas Woehrl
6778572642 highly improved performance by reducing copying of structs 2016-12-20 20:14:22 +01:00
yiminghe
9d35dce63e explicit default justifyContent value
Summary:
make default justifyContent value explicit like alignItems

https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content

https://developer.mozilla.org/en-US/docs/Web/CSS/align-items

https://developer.mozilla.org/en-US/docs/Web/CSS/align-content
Closes https://github.com/facebook/yoga/pull/293

Differential Revision: D4351597

Pulled By: emilsjolander

fbshipit-source-id: b65ff2284ede4d75f1cc5e22d4106042ab0b0d02
2016-12-20 03:24:40 -08:00
Lukas Wöhrl
dd63f7961e fix typo 2016-12-20 09:52:43 +01:00
Lukas Wöhrl
abf97d6613 fix benchmarks 2016-12-20 09:31:31 +01:00
Lukas Wöhrl
306e16fbb8 fix duplicate comma 2016-12-20 09:29:48 +01:00
Lukas Woehrl
2424fc2b12 fixed some cpp tests compilation issues, improved c# value struct 2016-12-20 07:32:47 +01:00
Lukas Woehrl
08eb9ff8f7 fix access violation on vprintf 2016-12-19 23:47:56 +01:00
Lukas Woehrl
d1d0618d4c delete *orig 2016-12-19 23:17:27 +01:00
Lukas Woehrl
1cb7ca431d Merge remote-tracking branch 'refs/remotes/facebook/master' into percentage-feature
# Conflicts:
#	csharp/Facebook.Yoga/YogaNode.Create.cs
2016-12-19 23:04:15 +01:00
Lukas Woehrl
e2c586490a update c# interop to use percentage 2016-12-19 23:01:31 +01:00
Lukas Woehrl
cac8d3715b code review 2016-12-19 21:11:02 +01:00
Lukas Woehrl
fae6b6352f update styletest 2016-12-19 19:41:50 +01:00
Lukas Woehrl
a6bdf6abf1 fix more tests calls 2016-12-19 19:35:29 +01:00
Lukas Woehrl
9ea8e73dd5 use struct initializer 2016-12-19 19:28:01 +01:00
Lukas Woehrl
26ad37af79 use YGValueUndefined also here 2016-12-19 19:20:30 +01:00
Lukas Woehrl
1af3a76321 rename enum count 2016-12-19 19:18:28 +01:00
Lukas Woehrl
a7003b6821 code review changes 2016-12-19 19:15:48 +01:00
Emil Sjolander
74fb205083 Rename test files to match other test file names
Summary: Rename test files to match other test file names

Differential Revision: D4335198

fbshipit-source-id: b8f38162c3094231476059eb1f54326d8ba84848
v2016.12.19.00
2016-12-16 09:09:37 -08:00
Kazuki Sakamoto
ba0bb10366 Build iOS fat static library for Unity and Xamarin
Summary:
$ buck build //csharp:yoganet-ios
    $ buck targets --show-output //csharp:yoganet-ios
    //csharp:yoganet-ios buck-out/gen/csharp/yoganet-ios/libyoga.a

    $ lipo -info buck-out/gen/csharp/yoganet-ios/libyoga.a
    Architectures in the fat file: buck-out/gen/csharp/yoganet-ios/libyoga.a are: armv7 x86_64 arm64

    $ nm buck-out/gen/csharp/yoganet-ios/libyoga.a|grep -e 'T _YGNodeNew' -e 'ygNode' -e 'T _YGInteropSetLogger'
    0000000000000000 T _YGNodeNew
    0000000000001070 t -[UIView(Yoga) ygNode]
    0000000000000000 T _YGInteropSetLogger
Closes https://github.com/facebook/yoga/pull/286

Reviewed By: emilsjolander

Differential Revision: D4338919

Pulled By: splhack

fbshipit-source-id: 7acfdfa0dc4d152d7bfe92161efdeb9f161f70e6
2016-12-16 06:54:35 -08:00
Emil Sjolander
0296511f2c YGNodeChildCount -> YGNodeGetChildCount for consistency
Summary: I kept wrongly typing this function which is a good sign that the name is inconsistent.

Reviewed By: gkassabli

Differential Revision: D4333480

fbshipit-source-id: 17058f18fa9e26b3e02f7a1651f7295cae59acad
2016-12-16 04:39:41 -08:00
Lukas Woehrl
e258d9867d use correct undefined function 2016-12-16 11:42:36 +01:00
Lukas Woehrl
f84583c002 renamed some function and removed unused/duplicate variables 2016-12-16 11:29:35 +01:00
Lukas Woehrl
9cce30c91f update indentation 2016-12-16 11:15:28 +01:00
Lukas Woehrl
8b6079cdf7 revert unrelated changes 2016-12-16 11:02:29 +01:00
Lukas Woehrl
7b71daa929 added explicit tests for padding, margin and absolute 2016-12-16 10:59:28 +01:00
Kazuki Sakamoto
04fe81f88f YGNodeInit is no longer exported
Summary:
- Problem: Can't link yoga static libraries with Unity and Xamarin.iOS since YGNodeInit is undefined in the libraries.
- Solution: Remove the reference in Native.cs

Reviewed By: emilsjolander

Differential Revision: D4338485

fbshipit-source-id: 9dc95aec8f1fd50f3f9d66e1623afe2fb1992210
2016-12-16 00:09:40 -08:00
Kazuki Sakamoto
98bbc15435 Support Xamarin.iOS
Summary:
- `__Internal`

https://developer.xamarin.com/guides/ios/advanced_topics/native_interop/#Static_Libraries

 > Since you can only use static libraries on iOS, there is no external shared library to link with, so the path parameter in the DllImport attribute needs to use the special name __Internal (note the double underscore characters at the start of the name) as opposed to the path name.

- `__IOS__`

https://developer.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/part_4_-_platform_divergence_abstraction_divergent_implementation/#iOS

 > Xamarin.iOS defines __IOS__ which you can use to detect iOS devices.
Closes https://github.com/facebook/yoga/pull/277

Reviewed By: emilsjolander

Differential Revision: D4338420

Pulled By: splhack

fbshipit-source-id: 375efecbaf88fffbba544073c6d6b30fb1f4c8ba
2016-12-16 00:09:40 -08:00
Kazuki Sakamoto
25b206ac53 Build native library with BUCK for .NET (Mono, Xamarin)
Summary:
Examples:

- macOS on macOS (Mono, Xamarin.Mac, Unity)
  - `buck build //csharp:yoganet#shared,default` -> `libyoga.dylib`
- Android (Xamarin.Android, Unity)
  - `buck build //csharp:yoganet#shared,android-armv7` -> `libyoga.so`
- iOS (Xamarin.iOS, Unity)
  - `buck build //:yoga#static,iphoneos-arm64` -> `libyoga.a`
  - `buck build //csharp:yoganet#static,iphoneos-arm64` -> `libyoganet.a`
Closes https://github.com/facebook/yoga/pull/282

Reviewed By: emilsjolander

Differential Revision: D4333811

Pulled By: splhack

fbshipit-source-id: 54f4364d93b2419d7504392eb558296a5d06772f
2016-12-15 13:54:34 -08:00
Emil Sjolander
88a4e44fd4 Add YGNodeGetParent api
Summary: Fixes https://github.com/facebook/css-layout/issues/248

Reviewed By: gkassabli

Differential Revision: D4333456

fbshipit-source-id: 388afd0a01c19a6db73c175bf24c566278832cb9
2016-12-15 09:54:35 -08:00
Lukas Woehrl
54e943d452 corrected last wrong usage of height 2016-12-15 17:05:06 +01:00
Lukas Woehrl
fc98df63d8 use only width for calculating margin/padding, border has no percentage support 2016-12-15 16:50:37 +01:00
Kazuki Sakamoto
642ea07d6f Update unmanaged dll name
Summary: - Update unmanaged dll name from `Yoga.dll` to `yoga.dll` since Native.cs `DllName` referes lowercase `yoga`

Reviewed By: emilsjolander

Differential Revision: D4295954

fbshipit-source-id: 16b91c407506685b84902102cf4380cb149b5b2c
2016-12-15 07:24:46 -08:00
Kazuki Sakamoto
e85c5ce39d lowercase argument
Summary: - Fix arguments of YogaNode.Create

Reviewed By: emilsjolander

Differential Revision: D4296488

fbshipit-source-id: f6eb5074b1b1462f2251d330929f7b8082ad72eb
2016-12-15 07:24:46 -08:00
Jatin Pandey
cf753af247 Make documentation clearer
Summary:
Fixing a typo :)
Closes https://github.com/facebook/yoga/pull/270

Reviewed By: dshahidehpour

Differential Revision: D4333129

Pulled By: emilsjolander

fbshipit-source-id: 28215de8fcd571fb889fe145ff303f231a50c598
2016-12-15 07:24:46 -08:00
Emil Sjolander
12efe604bb Fix YogaKit tests on travis
Summary: Fix include path

Reviewed By: dshahidehpour

Differential Revision: D4333185

fbshipit-source-id: 27638324e093260aa1b23134fab5140a0c703bc9
2016-12-15 07:24:46 -08:00
Lukas Woehrl
a84d55e3c5 use correct parent sizes for percentage calculation 2016-12-15 15:33:55 +01:00
Lukas Woehrl
687cbb8632 added tests for percentage 2016-12-11 16:49:01 +01:00
Lukas Woehrl
8fbf1ddecb changed unittests to use units 2016-12-11 16:43:46 +01:00
Lukas Woehrl
d950cf3d10 adjusted gentests 2016-12-11 16:39:27 +01:00
Lukas Woehrl
435f1f6a12 added percentage feature 2016-12-11 15:58:30 +01:00
Emil Sjolander
f36f545d75 Add an anchor to the android platform regex
Summary: This prevents android from matching in the middle of a platform.

Reviewed By: gkassabli

Differential Revision: D4306164

fbshipit-source-id: 7f62a6a017724f8f6741d3e53b5fbe0650c8c88e
v2016.12.12.00
2016-12-10 17:37:12 -08:00