Commit Graph

224 Commits

Author SHA1 Message Date
Emil Sjolander 0ea47424ff Fix align-content strech with multiple lines
Reviewed By: astreet

Differential Revision: D4551234

fbshipit-source-id: 2964f19cf415991dc55dfa2caa4868cb00c56bd0
2017-02-14 09:17:53 -08:00
Michael Bolin f294f61eeb Replace top-level `elif` with `if` in BUCK files.
Reviewed By: mzlee

Differential Revision: D4550165

fbshipit-source-id: 65d636c2e9e273bf45e093fe2c07aec18659e733
2017-02-13 22:32:37 -08:00
Emil Sjolander 4ea355a362 Revert D4528559: [yoga][PR] Fix align-content strech with multiple lines
Differential Revision: D4528559

fbshipit-source-id: 4bd82b399cb36acb348f2c6fedcae6b360513424
2017-02-13 01:16:47 -08:00
Lukas Wöhrl f288368cef Fix align-content strech with multiple lines
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
2017-02-11 08:48:24 -08:00
Lukas Wöhrl 8d695e1147 Fix resolving bug on changing layout and optimized memory usage
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
2017-02-11 08:48:24 -08:00
Lukas Wöhrl 17604ec6fe Add support for space-between and space-around on align-content
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
2017-02-11 08:48:24 -08:00
Emil Sjolander aac7b19a7c Fix min/max not overriding width/height
Differential Revision: D4537576

fbshipit-source-id: c003f723f424afbca63170d41e54fd5ff837926d
2017-02-11 05:32:26 -08:00
Georgiy Kassabli 016969df49 Revert D4456312: Fix for Yoga test failure for flexing with min stack dimension
Differential Revision: D4456312

fbshipit-source-id: 6b396f0a8b67619308456599377238b75d0c1ab3
2017-02-07 05:15:25 -08:00
Eloy Durán 031cb2045d Make podspec great again.
Summary:
Fixes #11272
Fixes #11572
Fixes #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
2017-02-06 16:30:00 -08:00
Antonio Corrado 4c3f03e4c5 Setting min=max dimension is treated as setting dimension
Reviewed By: emilsjolander

Differential Revision: D4492395

fbshipit-source-id: 3f4293548399e006aa808b9586d24e77c7df1f21
2017-02-06 14:45:43 -08:00
Georgiy Kassabli d963e3dd7f Fix for Yoga test failure for flexing with min stack dimension
Reviewed By: emilsjolander

Differential Revision: D4456312

fbshipit-source-id: 82a39bc93cf3bf2374b968e9f7403397e752908e
2017-02-06 13:01:44 -08:00
Lukas Wöhrl ccc56bba8f Added property display: flex and none
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
2017-02-06 09:43:27 -08:00
Emil Sjolander 00efe02c5b Return raw edge style value now that we have layout outputs for them
Reviewed By: astreet

Differential Revision: D4500892

fbshipit-source-id: e7c26bdda9ecbfc76b6cf1f384f8cf9f38284120
2017-02-03 11:28:48 -08:00
Emil Sjolander 61848ea2f3 Fix percentage calculation when parent size is undefined
Reviewed By: gkassabli

Differential Revision: D4494265

fbshipit-source-id: 9efef9e39a1b66af2d0f144575a96c919d60dbf7
2017-02-03 05:43:41 -08:00
Emil Sjolander eb54290a3a Take parent size into account when determining if style dim is defined
Reviewed By: gkassabli

Differential Revision: D4494258

fbshipit-source-id: 36c31444cbd113a820b067fe9e7b9560ae1d4df7
2017-02-03 05:43:41 -08:00
Lukas Wöhrl 95420152a6 Generate enums in sorted order
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
2017-02-03 04:28:42 -08:00
Pieter De Baets 4d2512aef9 Replace MethodCallResult with folly::Optional
Reviewed By: AaaChiuuu

Differential Revision: D4481987

fbshipit-source-id: 945dd671eb2482f3c6b626192aa2181c5bfd906f
2017-02-02 05:13:33 -08:00
Marc Horowitz 5bc7e3934b make JSCExecutor compile on iOS without android hacks
Reviewed By: javache

Differential Revision: D4434041

fbshipit-source-id: 88439384b1471ea5bd96d7cc39e681ddd3959243
2017-02-01 14:14:32 -08:00
Marc Horowitz ad549c067a small fixes to ReactCommon
Summary: unneeded or overly generic header files, stuff like that.

Reviewed By: javache

Differential Revision: D4434029

fbshipit-source-id: f25c702e7fc8d8debbd865cf3822696bf9b61c81
2017-02-01 14:14:32 -08:00
Pieter De Baets f8c72f5441 Support invoking and returning arbitrary types from Java sync hooks
Reviewed By: mhorowitz

Differential Revision: D4409900

fbshipit-source-id: 347e33c442b32f64355d343308c218c15cf5a70f
2017-01-31 05:28:35 -08:00
Pieter De Baets 919e49a8b8 Pass expanded folly::dynamic as argument to sync nativeHook
Reviewed By: mhorowitz

Differential Revision: D4409865

fbshipit-source-id: f99e02e36bf691fa5b4a5affce1fa4fd4cf321a6
2017-01-30 06:43:48 -08:00
Emil Sjolander 81fe1a3618 Fix aspectratio with margins
Reviewed By: astreet

Differential Revision: D4473024

fbshipit-source-id: 5a747e2f267b077203bb3b63e4c152847dc30774
2017-01-27 09:58:29 -08:00
Emil Sjolander 3d1c8694d0 Format and run codegen
Reviewed By: dshahidehpour

Differential Revision: D4459455

fbshipit-source-id: fc1eca58fe897c8f4a2571638b4f7035d023b479
2017-01-26 13:43:35 -08:00
Maël Nison 3a476a8321 Add YGLayoutGetBorder, counterpart of YGLayoutGetPadding
Summary:
Followup of #335, fix #326. This commit add the `YGLayoutGetBorder(node, edge)` function, which correctly takes RTL/LTR into account when resolving `EDGE_START` & `EDGE_END`.
Closes https://github.com/facebook/yoga/pull/344

Reviewed By: dshahidehpour

Differential Revision: D4459950

Pulled By: emilsjolander

fbshipit-source-id: b57eb7a5b1c181a364913c3200a3794a2b7b31a6
2017-01-26 13:43:35 -08:00
Lukas Wöhrl 48e346193a Fix absolute position if align-item or justify-content is center or flex-end
Summary:
Fix #310 (```center```)

additionally fixes if ```flex-end``` is set.
Closes https://github.com/facebook/yoga/pull/349

Reviewed By: dshahidehpour

Differential Revision: D4458528

Pulled By: emilsjolander

fbshipit-source-id: f073c80bfc3ea6675cb95b00283074d10e91a042
2017-01-26 13:43:35 -08:00
Pieter De Baets a407ff94ee Add option to start sampling profiler on app launch
Reviewed By: mhorowitz

Differential Revision: D4415989

fbshipit-source-id: 30704c2b618656cb7cc0ccdf87dec315b30b62f3
2017-01-25 14:43:30 -08:00
Pieter De Baets e97ffc469c Use NoAutomaticPrototype everywhere
Reviewed By: michalgr

Differential Revision: D4462794

fbshipit-source-id: 53585741c1d35ca31e3429f2de56455ea5dea902
2017-01-25 11:43:30 -08:00
Emil Sjolander 018b853b9b Dont constrain absolute children to zero sized parents
Reviewed By: gkassabli

Differential Revision: D4453612

fbshipit-source-id: e8269521560d2f42b2d6f0f0ff264a1605a57d79
2017-01-24 17:13:42 -08:00
Ashok Menon 4aac5cd02e RN] Removing `ReactAndroid/CONSTANTS`
Reviewed By: javache

Differential Revision: D4446455

fbshipit-source-id: d9d3eb7127bbb88227ebd2a963ce508040183974
2017-01-23 09:43:25 -08:00
Ashok Menon 76c4faee5e CatalystInstanceImpl.setSourceURL
Reviewed By: javache

Differential Revision: D4422416

fbshipit-source-id: bc49485ac64064909f32375b6b8360a0a505975b
2017-01-18 08:58:41 -08:00
Lukas Woehrl e93ccfd57a Fix wraping calculation if min-size constraint exists
Summary:
Fixes #261
Closes https://github.com/facebook/css-layout/pull/262

Reviewed By: splhack

Differential Revision: D4245200

Pulled By: emilsjolander

fbshipit-source-id: 77d802d71010ed426511d6a01e6de1e7c9194179
2017-01-16 16:13:34 -08:00
Emil Sjolander 8d2a034f9c BREAKING - Fix sizing of container with child overflowing parent
Reviewed By: mmmulani

Differential Revision: D4182141

fbshipit-source-id: c73fd15d2577ab846fc8a202d529d0e6e1207b75
2017-01-16 11:13:29 -08:00
Maël Nison ae4fa4b012 Add YGLayoutGetMargin
Summary:
Fix #326. I'll open another PR once this one gets accepted to add support for `YGLayoutGetBorder` 👌
Closes https://github.com/facebook/yoga/pull/335

Reviewed By: gkassabli

Differential Revision: D4409399

Pulled By: emilsjolander

fbshipit-source-id: 8153f6701cab60b55a485f6d2e0b9f7767481090
2017-01-15 15:28:34 -08:00
Ashok Menon 154e183344 Fixing RN Debugger
Reviewed By: cwdick, javache

Differential Revision: D4409257

fbshipit-source-id: 062c798d1a1c9ad90884599ed262412c1dd51359
2017-01-12 16:28:36 -08:00
Dan Caspi ad0493c6c2 Fixing a crash caused by D4393955
Reviewed By: javache

Differential Revision: D4403858

fbshipit-source-id: c930aa108d27c1bd1b36364530d2953bcd4664ad
2017-01-11 09:43:34 -08:00
Stephen Girdlestone a0dd54b4d7 Adding method for JSCreateSourceCodeFromFile.
Reviewed By: amnn

Differential Revision: D4365790

fbshipit-source-id: b62ee9c7d3fa3f89c22a10a6fde21cd9c30fceb2
2017-01-11 06:13:28 -08:00
Emil Sjolander 3f49e743be Add percentage support to react native
Summary:
Adds support for percentage value in react native.

syntax: property: 100 | property | '100%'

supported properties:
padding
margin
width
height
minWidth
minHeight
maxWidth
maxHeight
flexBasis

```
class Playground extends React.Component {
  render() {
    return (
      <View style={{backgroundColor: 'white', padding: 10, paddingTop: 30, height: '100%'}}>
        <Text>
          If you want to quickly test out something,
          open the Playground.js file and start coding.
        </Text>
        <View style={{backgroundColor: 'red', height: 50, width: 50}}/>
        <View style={{backgroundColor: 'blue', height: '50%', width: '50%'}}/>
      </View>
    );
  }
}
```

Reviewed By: astreet

Differential Revision: D4376549

fbshipit-source-id: c41d68a7555396f95d063a7527ee081773ac56dc
2017-01-11 03:58:37 -08:00
Dan Caspi b50f55026a Adding support in the new RN bridge on iOS
Differential Revision: D4393955

fbshipit-source-id: e5f3fb6773908678773a5dd4fdea568bcc200336
2017-01-10 11:28:44 -08:00
Emil Sjolander 7c2f8a9e14 Allow aspect ratio to expand beyond bounds of parent
Reviewed By: passy

Differential Revision: D4397547

fbshipit-source-id: d2b1ca7b096f2f17b3efbd8f47a50678bfe7bb5f
2017-01-10 08:28:26 -08:00
Ashok Menon da428d6c3d Exposing Recoverable Errors
Differential Revision: D4383792

fbshipit-source-id: e6d0f57fcaacf242e95bfcf589a4fa840c317fe5
2017-01-10 07:13:40 -08:00
Ashok Menon 24f3add010 Use JSExecutor's file-based Loading API in NativeToJsBridge and Instance
Reviewed By: javache

Differential Revision: D4320773

fbshipit-source-id: fa46728ba0d45818737b32952efbfae7bc8ef9f1
2017-01-10 07:13:40 -08:00
Ashok Menon 8819bef56b Getting rid of File descriptor based loading APIs
Reviewed By: javache

Differential Revision: D4333725

fbshipit-source-id: ba8591c7380e8eb90660a912f6fc86fc3d2d4774
2017-01-10 07:13:40 -08:00
Emil Sjolander 618a14b228 Use int instead of NSInteger for ABI compatibility
Summary: Cannot use NSInteger as NSInteger has a different size than int (which is the default type of a enum). Therefor when linking the Yoga C library into obj-c the header is a missmatch for the Yoga ABI.

Reviewed By: cwdick

Differential Revision: D4392272

fbshipit-source-id: 22b92ac8f3eb7114e81dbd9b0bec9044c3d43da5
2017-01-09 08:43:35 -08:00
David Hart 7d3aaddf6e Improved the objective-c and swift api
Summary:
Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.
Closes https://github.com/facebook/yoga/pull/322

Reviewed By: cosmin1123

Differential Revision: D4391434

Pulled By: emilsjolander

fbshipit-source-id: e33f6f7b2bbaad29553100b7a5bb424496372110
2017-01-08 11:43:33 -08:00
Ben Holcomb 23819dd8b5 Revert D4386906: [YogaKit] Improved the objective-c and swift api
Differential Revision: D4386906

fbshipit-source-id: adac0d8e71ce9f3442f3bfd14b5157f88367c998
2017-01-07 10:28:33 -08:00
David Hart e0cb6dff76 Improved the objective-c and swift api
Summary:
Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.
Closes https://github.com/facebook/yoga/pull/322

Reviewed By: dshahidehpour

Differential Revision: D4386906

Pulled By: emilsjolander

fbshipit-source-id: 05ac0e571ef3a8ff0be31469e449a7b23f102218
2017-01-07 08:28:30 -08:00
Lukas Woehrl 7cfb7b8d0f Baseline support
Summary:
Added baseline support (see #132)

You have the ability for a custom baseline function (```float(*YGBaselineFunc)(YGNodeRef node);```) to return whatever baseline you want.
Closes https://github.com/facebook/yoga/pull/317

Reviewed By: splhack

Differential Revision: D4385061

Pulled By: emilsjolander

fbshipit-source-id: cb8a59a09237c840fa3e21753ab68239997dab0c
2017-01-06 06:58:25 -08:00
Emil Sjolander d9c35e8952 Add api for retrieving computed padding
Differential Revision: D4376572

fbshipit-source-id: 3ffb66e77090fc1257511bec5c933f9b0c304b9f
2017-01-05 12:58:34 -08:00
Lukas Woehrl 16359ec8ee Add feature to use percentage as value unit
Summary:
Adds the feature to use percentage as a value unit.

You can use the function ```YGPx(float)``` and ```YGPercent(float)``` for convenience.

I did some benchmarks:

```
Without Percentage Feature - Release x86:

Stack with flex: median: 0.000000 ms, stddev: 0.146683 ms
Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.136525 ms
Nested flex: median: 0.000000 ms, stddev: 0.490101 ms
Huge nested layout: median: 23.000000 ms, stddev: 0.928291 ms

Stack with flex: median: 0.000000 ms, stddev: 0.170587 ms
Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.143384 ms
Nested flex: median: 0.000000 ms, stddev: 0.477791 ms
Huge nested layout: median: 22.000000 ms, stddev: 2.129779 ms

With Percentage Feature - Release x86:

Stack with flex: median: 0.000000 ms, stddev: 0.132951 ms
Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.136525 ms
Nested flex: median: 0.000000 ms, stddev: 0.489570 ms
Huge nested layout: median: 21.000000 ms, stddev: 1.390476 ms
Closes https://github.com/facebook/yoga/pull/258

Reviewed By: dshahidehpour

Differential Revision: D4361945

Pulled By: emilsjolander

fbshipit-source-id: a8f5bc63ad352eb9410d792729e56664468cd76a
2017-01-02 05:28:30 -08:00
desmondyao bc285de799 Not re-calculate value in Step1.
Summary:
Not re-calculate `paddingAndBorderAxisMain`/`paddingAndBorderAxisCross`/`paddingAndBorderAxisRow`/`paddingAndBorderAxisColumn` in Step1 of `YGNodelayoutImpl`.

They can be figure out by values calculated before.
Closes https://github.com/facebook/yoga/pull/298

Reviewed By: dshahidehpour

Differential Revision: D4365533

Pulled By: emilsjolander

fbshipit-source-id: 6caf60bc6ef3addd49915b39b48f01a8b4926e9c
2016-12-23 10:28:26 -08:00