Commit Graph

388 Commits

Author SHA1 Message Date
Pieter De Baets f98518c5f9 Add setPropertyAtIndex
Reviewed By: mhorowitz

Differential Revision: D5069708

fbshipit-source-id: f81542f9d752ff53acf3fb9d96bf71e60acecac3
2017-05-19 07:15:42 -07:00
Ashok Menon 056d075ef2 Fixing up header namespaces in ReactCommon
Reviewed By: mzlee

Differential Revision: D5079295

fbshipit-source-id: 03b848dedb41da900bb6ac69112bbb973a8a2595
2017-05-17 14:21:59 -07:00
Georgiy Kassabli c785763773 Fixing using flex in root node
Reviewed By: emilsjolander

Differential Revision: D5071164

fbshipit-source-id: b8afef42477d0ed87d0c9fcfd26349e0a0babd6e
2017-05-17 07:32:40 -07:00
Dmitry Zakharov f8b683b3ee Copy-free Source loading implementation
Reviewed By: amnn

Differential Revision: D4914165

fbshipit-source-id: 38851679cb696c41f59edfd0d2005faf37813b23
2017-05-15 09:15:29 -07:00
Georgiy Kassabli c4fb32fa40 Correct YGNodeCanUseCachedMeasurement to account for non-existent scale factor
Reviewed By: emilsjolander

Differential Revision: D5061016

fbshipit-source-id: 907ef987bd0ead29cf02f6945a3f03d4ffb58a2e
2017-05-15 08:49:38 -07:00
Georgiy Kassabli baf93e46d0 Adding ability to account for rounding in YGNodeCanUseCachedMeasurement
Reviewed By: emilsjolander

Differential Revision: D5059560

fbshipit-source-id: d729e991758a8c668a4b373105b71337961875cd
2017-05-15 06:23:45 -07:00
Pieter De Baets 6221053179 Improve systrace markers
Reviewed By: mhorowitz

Differential Revision: D4860135

fbshipit-source-id: ce963010883e6b9cc8e34f7ff01b4018cd195eba
2017-05-12 18:07:49 -07:00
Michael Lee fb99f55939 Fix compilation due to missing flag
Reviewed By: mhorowitz

Differential Revision: D5053975

fbshipit-source-id: cfb5e71d7c9c318fa1942ce9d4dc72b4f7c1e054
2017-05-12 13:31:24 -07:00
Emil Sjolander 0a4ce80868 Fix typo causing wrapped children to be sized by wrong axis margin
Reviewed By: passy

Differential Revision: D5044470

fbshipit-source-id: 7d203dd48b258a5fe5c4b3c493099092a1d334db
2017-05-12 09:18:56 -07:00
Emil Sjolander 67b96fc0ce Include margin when calculating if children overflow
Reviewed By: passy

Differential Revision: D5044471

fbshipit-source-id: e7c1eb694445ffb898bcf375d9deefc558c49f11
2017-05-12 09:18:56 -07:00
Emil Sjolander 54548894d0 Fix flex basis not accounting for max size constraint
Reviewed By: gkassabli

Differential Revision: D5044314

fbshipit-source-id: d9f9db832e4943a57a89c9d162ff6077b709795a
2017-05-12 09:18:56 -07:00
Pieter De Baets 6e2c07534e Fix Circle CI builds
Summary: Closes https://github.com/facebook/react-native/pull/13945

Differential Revision: D5052083

Pulled By: javache

fbshipit-source-id: eeda8253d26c2dfd0d20b93b238377fe92e3ca3c
2017-05-12 08:35:30 -07:00
Pieter De Baets afbab66a44 Define rn_xplat_cxx_library for OSS builds
Reviewed By: bestander

Differential Revision: D5044673

fbshipit-source-id: 41c9fe4b2ae128eed6f299dd8ea9dbfc4ca75917
2017-05-12 02:45:19 -07:00
Pieter De Baets 103f4ee01f Move JSBigString its own cxxreact target
Reviewed By: amnn

Differential Revision: D5020584

fbshipit-source-id: 9ba21c0231c3bb77973620669727205231a0b7a8
2017-05-11 09:01:30 -07:00
Georgiy Kassabli 70b7488f97 Adding node type and moving rounding dependency to rely on that type
Reviewed By: emilsjolander

Differential Revision: D5025107

fbshipit-source-id: a8d66e2f9c5d02ab080784cc474be583a09b92e2
2017-05-11 08:17:58 -07:00
Pieter De Baets 01460873da Move jschelpers to fb_xplat_cxx_library
Reviewed By: bestander

Differential Revision: D5035858

fbshipit-source-id: 110fc5140ee4930634ef2ac3453d0a84124516f9
2017-05-11 06:35:36 -07:00
Pieter De Baets 19e6557d2e Cleanup cxxreact BUCK file
Reviewed By: mzlee

Differential Revision: D5020563

fbshipit-source-id: 286a2d1c44623b5b9fd923ef8684d263500791b3
2017-05-11 05:04:02 -07:00
Ben Nham 65f22a5190 log script name with bundle loading perf event
Reviewed By: javache

Differential Revision: D5010638

fbshipit-source-id: 2e139201a8374245fa1dedc4f11a716dcf700fd7
2017-05-10 04:09:19 -07:00
Hoa Dinh 3dfed2e865 Explicitely export some symbols since they can be referenced from outside that library.
Differential Revision: D5024612

fbshipit-source-id: 6d75ebce9422c879bfc0acdb1159be72756a2f15
2017-05-08 19:48:47 -07:00
Maël Nison 7876ffec5e Fixes Travis error reporting
Summary:
Just cherry-picked my commit from #508
Closes https://github.com/facebook/yoga/pull/542

Differential Revision: D5002335

Pulled By: emilsjolander

fbshipit-source-id: 3f61a235c41627e9cfb90dce150323f11892e65f
2017-05-04 07:43:24 -07:00
Lukas Wöhrl 5f2edfcca5 Move YGLogger into YGConfig and associate YGNodeRef with log events
Summary:
Moves the `YGLogger` into `YGConfig` and pass the `YGNodeRef` into the logger to be able to associate the log messages and assertions with the specific node.

Tackles facebook/yoga#530 and facebook/yoga#446
Closes https://github.com/facebook/yoga/pull/531

Reviewed By: astreet

Differential Revision: D4970149

Pulled By: emilsjolander

fbshipit-source-id: b7fcdaa273143ea2fa35861620b2e4d79f04f0af
2017-05-03 09:30:55 -07:00
Theo Yaung ac74d2a38b Refactor interfaces
Reviewed By: johnislarry

Differential Revision: D4844786

fbshipit-source-id: f348b8d5078643636343f6ea099b200f519fbc40
2017-05-02 21:31:41 -07:00
Emil Sjolander d199d1d65a Fix useLegacyStretchBehaviour flag by simplifying its usage
Reviewed By: gkassabli

Differential Revision: D4977923

fbshipit-source-id: cb488e63c7c2e15e4c0f0133a16df36580c646fd
2017-05-01 04:45:20 -07:00
Emil Sjolander 1c0e3b8b5b Treat measured nodes size as a minimun contraint when rounding
Reviewed By: shergin

Differential Revision: D4972290

fbshipit-source-id: 0a7bcc7f47b3e5acb8745da5286abcb9c4e44a38
2017-04-30 03:16:37 -07:00
Lukas Wöhrl 992e37c8bc Fix sizing of non strech items
Summary:
Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking.

See facebook/yoga#505
Closes https://github.com/facebook/yoga/pull/506

Reviewed By: astreet

Differential Revision: D4954016

Pulled By: emilsjolander

fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7
2017-04-28 06:18:30 -07:00
Emil Sjolander 00a0343a6d Revert D4957570: [yoga] Consolidate measure cache for layout nodes and leaf nodes
Differential Revision: D4957570

fbshipit-source-id: 4d30de37c6911aac2dc1243a54914515aabfb229
2017-04-28 04:04:14 -07:00
Emil Sjolander 6272ef87bc Consolidate measure cache for layout nodes and leaf nodes
Reviewed By: astreet

Differential Revision: D4957570

fbshipit-source-id: 5c5f39b67bd3f72d92b939ecee2d9a46c80b583f
2017-04-27 13:15:56 -07:00
Emil Sjolander 1a72d91cb2 Remove rounding from experimental features
Reviewed By: gkassabli

Differential Revision: D4953838

fbshipit-source-id: 3ee5f27d92f95b3ed4a01c98bc35e9157f2e91c5
2017-04-27 07:27:26 -07:00
Lukas Wöhrl 925ec01e01 Let measure behave more like on the web
Summary:
Nodes with a measure function needs to be measured even so it seems there is no available space. So it behaves more like on the web. Fix facebook/yoga#488
Closes https://github.com/facebook/yoga/pull/499

Reviewed By: astreet

Differential Revision: D4954008

Pulled By: emilsjolander

fbshipit-source-id: 5b6d9afae0cdebe33f8b82b67620b3b4527d1efc
2017-04-27 07:27:26 -07:00
Cheng Zhao f71e3b80b9 Add YGConfigCopy
Summary: Closes https://github.com/facebook/yoga/pull/525

Differential Revision: D4953723

Pulled By: emilsjolander

fbshipit-source-id: 1c54f40dfae5054822a440edf9d0aafb22a465d9
2017-04-26 12:00:49 -07:00
Lukas Wöhrl c660d0c836 Fix flex-wrap with max constraint
Summary:
Fixes `flex-wrap` with a max constraint and `justify-content`. Fixes facebook/yoga#514.
Closes https://github.com/facebook/yoga/pull/519

Differential Revision: D4953727

Pulled By: emilsjolander

fbshipit-source-id: 32dec48220be1392ea8dac5f34871d407eb8d49b
2017-04-26 11:31:56 -07:00
Valentin Shergin a8fa904179 New round-to-pixel-grid algorithm that fixes possible subpixel gaps between sibling nodes
Reviewed By: emilsjolander

Differential Revision: D4941266

fbshipit-source-id: 07500f5cc93c628219500e9e07291438e9d5d36c
2017-04-25 17:30:40 -07:00
Pieter De Baets 34bc6bd2ae Drop support for webworkers
Reviewed By: AaaChiuuu

Differential Revision: D4916449

fbshipit-source-id: a447233d3b7cfee98db2ce00f1c0505d513e2429
2017-04-25 05:37:54 -07:00
Alexey Lang 1bc9d448f5 Port perf metrics used in RCTBatchedBridge
Reviewed By: javache

Differential Revision: D4938279

fbshipit-source-id: c927261ff96c2eb07b7303ae96aae7600f2947f1
2017-04-25 02:32:25 -07:00
Georgiy Kassabli 6b0c72fa82 Correcting Flex fix within Experimental feature
Reviewed By: emilsjolander

Differential Revision: D4915189

fbshipit-source-id: efccee2fe39ed0f474a41dc3250d24c546f3f5d9
2017-04-19 13:29:59 -07:00
George Xu c29449d573 Revert D4875343: Correct fix for flexing grandchildren
Differential Revision: D4875343

fbshipit-source-id: 2949762bf47e151c8c0ff923d501859b3e0a567a
2017-04-13 18:09:30 -07:00
Emil Sjolander 569525d6e4 Revert D4850458: [yoga][PR] Let measure behave more like on the web
Differential Revision: D4850458

fbshipit-source-id: 2ecb6c8627a84b52ade968fd18331a7473369ebe
2017-04-13 15:45:37 -07:00
Emil Sjolander c3dc6a0f0e Revert D4878875: [yoga][PR] Fix sizing of non strech items
Differential Revision: D4878875

fbshipit-source-id: 8927438e7a1969deb617434369af53f71f625638
2017-04-13 10:01:55 -07:00
Lukas Wöhrl 62360e8981 Let measure behave more like on the web
Summary:
Nodes with a measure function needs to be measured even so it seems there is no available space. So it behaves more like on the web. Fix facebook/yoga#488
Closes https://github.com/facebook/yoga/pull/499

Differential Revision: D4850458

Pulled By: emilsjolander

fbshipit-source-id: be5e35a670ddcbf3cd426fc3c2a0c9b60a874cdc
2017-04-13 08:49:43 -07:00
Georgiy Kassabli 831ad4adc6 Correct fix for flexing grandchildren
Reviewed By: emilsjolander

Differential Revision: D4875343

fbshipit-source-id: 634e961f9798dff43eae2c6564b28c6629b816e0
2017-04-13 08:49:43 -07:00
Lukas Wöhrl a82de9509f Fix sizing of non strech items
Summary:
Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. See facebook/yoga#505
Closes https://github.com/facebook/yoga/pull/506

Differential Revision: D4878875

Pulled By: emilsjolander

fbshipit-source-id: ab1174ac7a76dcf20aae7b29a3bc396e11077c4d
2017-04-13 07:57:21 -07:00
Lukas Wöhrl f26a99764a Fix min constraint incorrectly reducing available space
Summary:
If a min constraint exists. It incorrectly reduces the available space by that amount. This adds a test and fix for this.
Closes https://github.com/facebook/yoga/pull/501

Differential Revision: D4867146

Pulled By: emilsjolander

fbshipit-source-id: ceafe070bfe7f501929d316656ac44c4e1753059
2017-04-11 13:09:38 -07:00
Lukas Wöhrl f7fe9a6219 Fix position on root node with RTL direction
Summary:
If the root node has a position and we have a RTL layout, that position must be like LTR direction. See #477.
Closes https://github.com/facebook/yoga/pull/502

Differential Revision: D4867144

Pulled By: emilsjolander

fbshipit-source-id: b5ad3d87e7054090da12d7665a3d1abe8496a548
2017-04-11 13:09:38 -07:00
Kazuki Sakamoto ecd0df01af Add YGConfigGetInstanceCount
Summary:
- depends on #496
- For memory leak unit test
- Expose the API for C#
Closes https://github.com/facebook/yoga/pull/497

Reviewed By: emilsjolander

Differential Revision: D4796190

Pulled By: splhack

fbshipit-source-id: 99e4e78e8dfb3d459cf6cd7103ab252c3748e5a6
2017-04-10 14:24:25 -07:00
Pieter De Baets f3dfd616f4 Allow lazy Cxx modules to not initialize
Reviewed By: mhorowitz

Differential Revision: D4851596

fbshipit-source-id: cf5f5c51b9aaa0da96f7ab6fba1277b72c988400
2017-04-08 15:18:08 -07:00
Pieter De Baets b2647ea335 Allow ModuleRegistry initialization to complete lazily
Reviewed By: mhorowitz

Differential Revision: D4794794

fbshipit-source-id: f3b7a5d02587b4cd4e214aa6b0368a0d214fb63f
2017-04-07 09:30:33 -07:00
Martin Kralik 5f37483466 Revert D4840716: Refactor interfaces
Differential Revision: D4840716

fbshipit-source-id: 1b6a6050d78ccbbd3c817621df1c1c989594fdb1
2017-04-06 06:03:10 -07:00
Theo Yaung fd99330b6c Refactor interfaces
Reviewed By: johnislarry

Differential Revision: D4840716

fbshipit-source-id: 1a82437c81ce5b767efd39ab0716998bab4f5363
2017-04-06 00:04:06 -07:00
Eric Vicenti 67e54f8bdb Add YGEnums to fix gradle build
Summary:
Attempt to fix CircleCI build by adding YGEnums to the yoga gradle file
Closes https://github.com/facebook/react-native/pull/13296

Differential Revision: D4827856

Pulled By: ericvicenti

fbshipit-source-id: cb03af77919c811d06352fbe0b77084e97d2e6c1
2017-04-04 12:01:43 -07:00
Pieter De Baets c128612c5c A proxy so a singleton CxxModule can be shared by multiple ModuleRegistry instances.
Reviewed By: mhorowitz

Differential Revision: D4814438

fbshipit-source-id: db6cdd9e948643bb24a443bd45b7b0843a0a86c2
2017-04-04 10:36:19 -07:00
Lukas Wöhrl 0ec984e69a Optimize log print by using html format
Summary:
See facebook/yoga#453. Optimizes the node log print by generating some enum text via ```enum.py``` and moving printing to new functions to reduce boilerplate code.

Changes the log output to format the nodes in html to be able to copy paste it  into browsers for quick debugging.

Hides all default values.
Closes https://github.com/facebook/yoga/pull/479

Reviewed By: gkassabli

Differential Revision: D4802184

Pulled By: emilsjolander

fbshipit-source-id: 143bd63cbc31fb0755d711062cb4e6a448049ba3
2017-04-03 09:45:47 -07:00
Emil Sjolander 673093eed0 Set web defaults when resetting
Reviewed By: astreet

Differential Revision: D4779742

fbshipit-source-id: 5b8c5d7bd432a12984e4ebfd3187da3d680272cd
2017-03-29 03:17:28 -07:00
Emil Sjolander 4bf2d8cb7d Set hasNewLayout on children when changing their layout due to display none parent
Reviewed By: astreet

Differential Revision: D4786615

fbshipit-source-id: 2f3a16661d37bc37939e8e7a551445886a06524e
2017-03-28 12:47:51 -07:00
Pieter De Baets ff7fb6efda Allow overrides of NativeModules
Reviewed By: mhorowitz

Differential Revision: D4764126

fbshipit-source-id: 036f848f8b3debbb3cc4a34fc99044304615760e
2017-03-24 05:04:05 -07:00
Michael Lee dcf3cbeb31 Clean up some of the ReactNative Buck rules
Reviewed By: yangchi

Differential Revision: D4739284

fbshipit-source-id: 0ee335df0d114631e5fc60d5d6e51547e5312d39
2017-03-23 12:02:25 -07:00
Pieter De Baets 9d377e98a0 Fix warnings in React.xcodeproj
Summary:
Various fixes of xcode projects and cleaning up some warnings
Closes https://github.com/facebook/react-native/pull/13109

Differential Revision: D4762652

Pulled By: lacker

fbshipit-source-id: b452976a58962439de4adecc8e703264af40cb38
2017-03-23 11:36:17 -07:00
Pieter De Baets 314ec87269 Remove unused CxxMessageQueue
Differential Revision: D4713064

fbshipit-source-id: 511b782279b89076228f00290e78ed155e2e723e
2017-03-21 12:46:27 -07:00
Marc Horowitz 6dc3a83e88 Don't load native module support as part of the initial CS bundle
Reviewed By: javache

Differential Revision: D4720386

fbshipit-source-id: cd8b6137aaff2d907adf089060bf7d356cd2f437
2017-03-20 13:25:33 -07:00
Adam Ernst 47d2cfeac5 Whitelist some stuff in React
Reviewed By: mzlee

Differential Revision: D4731968

fbshipit-source-id: 1d1ae12a50beef4cd024a467427ec3b6cd446f4c
2017-03-19 14:01:09 -07:00
Eloy Durán 09b8ef41e1 Fix issue with whitespace in path to source and stabilise CI.
Summary:
* Fixes issue where headers could not be found due to whitespace in an unquoted header search path. https://github.com/facebook/react-native/issues/11781#issuecomment-287176373
* Stabilises CI but not needing to download the source for Yoga, but use the existing cloned repo instead.

/cc mkonicek
Closes https://github.com/facebook/react-native/pull/13007

Differential Revision: D4735347

fbshipit-source-id: 933aefcb0e65537d2e759d25f4e3b81cdf4b8cb5
2017-03-18 12:31:37 -07:00
Emil Sjolander b956c111d8 Revert D4716024: [yoga] Avoid transfering cached layout information to java
Differential Revision: D4716024

fbshipit-source-id: 7276b4bbf072aa444c5ae9fd1a3d62ea87a0cec1
2017-03-17 13:30:26 -07:00
Emil Sjolander f0240e004a Avoid transfering cached layout information to java
Reviewed By: astreet

Differential Revision: D4716024

fbshipit-source-id: c30763a6fc7426d653c7a6ca129615cddb4140e9
2017-03-17 09:20:52 -07:00
Emil Sjolander e854775527 Invalidate layout when node is removed from tree
Reviewed By: astreet

Differential Revision: D4716022

fbshipit-source-id: 399cc64a4b3f5fd3fc469ea37bdd31abe474dc6c
2017-03-17 09:20:51 -07:00
Pieter De Baets 99d73c8927 Move FBReactJSExecutor to Instance
Reviewed By: mhorowitz

Differential Revision: D4589940

fbshipit-source-id: e3f0c374e78f77e54cede5c617414e41844f0f4d
2017-03-17 07:08:14 -07:00
Pieter De Baets 73e81b87d3 Remove unused onNativeException delegate method
Reviewed By: mhorowitz

Differential Revision: D4597914

fbshipit-source-id: 82a109d1e6d8b0c93380840c22ec74dc75ab1a45
2017-03-17 07:08:14 -07:00
Pieter De Baets d7b37c4050 Remove JsToNativeBridge's nativeQueue
Reviewed By: mhorowitz

Differential Revision: D4589737

fbshipit-source-id: 3b2730417d99c4f98cfaad386bc50328f2551592
2017-03-17 07:08:14 -07:00
Andy Street c8d922b467 BREAKING: Only call batchDidComplete when there were actually native calls dispatched
Summary: This is breaking because it affects the contract for onBatchComplete, but modules really shouldn't (and probably aren't) depending on it being called without any actual native module method calls having happened.

Reviewed By: javache

Differential Revision: D4715656

fbshipit-source-id: 53ddd4a26c9949de86f5111d214b3e5002ca2e94
2017-03-16 07:45:38 -07:00
Adam Ernst ca6043292a @build-break codemod ios_library to fb_apple_library
Reviewed By: swolchok

fbshipit-source-id: cdbb5195b3c279121c79e237cc2c7275447aa625
2017-03-15 07:38:02 -07:00
Lukas Wöhrl 18c239ee22 Fix align-content: center, flex-end alignment with margin
Summary:
This fixes ```align-content: center``` and ```align-content: flex-end``` when the child exceeds the parents size. See #476. It also fixes those layouts if the child has ```margin: auto``` set.
Closes https://github.com/facebook/yoga/pull/477

Differential Revision: D4697833

Pulled By: emilsjolander

fbshipit-source-id: d081ec7ea559a5f2bd3271c3a4dc272960beddfa
2017-03-15 05:29:00 -07:00
Marc Horowitz e622d51e20 Support ModuleHolder-based lazy init of C++ modules with C++ bridge on android
Reviewed By: AaaChiuuu

Differential Revision: D4614479

fbshipit-source-id: 109ac34b8688f0113675e4a4479d1ddcc6169ed4
2017-03-14 15:35:01 -07:00
Marc Horowitz 7e4b8ff000 Support passing native modules to JSContext
Reviewed By: amnn

Differential Revision: D4561036

fbshipit-source-id: b096a222103e895b14cba1ec5b2bb6e72dd72c37
2017-03-14 15:35:01 -07:00
Theo Yaung 3e528b1014 Remove Inspector Logic (cannot work on iOS / System JSC)
Reviewed By: javache

Differential Revision: D4620530

fbshipit-source-id: 52abc6178b1ad1b52ba1b1825702c9c254a04520
2017-03-14 11:45:38 -07:00
Theo Yaung acb9fa8f66 Refactor dependencies
Reviewed By: mkonicek

Differential Revision: D4689351

fbshipit-source-id: 35e6939379dcb6723e7749883ad9613459f9787b
2017-03-10 09:15:50 -08:00
Lukas Wöhrl 75e783d913 Align resolve function names to have similiar namings
Summary:
We have some resolve functions with ```YG**Resolve``` and others named ```YGResolve**```. This changes both to be named like the later one, as I think this is the grammatically better readable one.
Closes https://github.com/facebook/yoga/pull/471

Differential Revision: D4688997

Pulled By: emilsjolander

fbshipit-source-id: 38b5f84d4d39ed3effedf08188085b9efd96b4ce
2017-03-10 06:21:48 -08:00
Martin Konicek f0394ce38b Revert D4588356: Refactor dependencies
Differential Revision: D4588356

fbshipit-source-id: 88cd348ed10cbf51e8ea4cde7503f6e0f9e6c572
2017-03-10 05:45:28 -08:00
Theo Yaung b47000a051 Refactor dependencies
Reviewed By: javache

Differential Revision: D4588356

fbshipit-source-id: ac13bbef8252ce87cdccc2f2d32890e94ff022fb
2017-03-09 16:22:58 -08:00
Lukas Wöhrl 9c6da277bc Move pointscalefactor to config
Summary:
This adds some improvements to the new ```YGConfig```, it tackles #452 and moves the scalefactor into the config.
Closes https://github.com/facebook/yoga/pull/457

Differential Revision: D4675088

Pulled By: emilsjolander

fbshipit-source-id: 99b2c734d6c5139fe1dc8bdeb014bb038f0e337d
2017-03-09 07:25:54 -08:00
Lukas Wöhrl 751addcb73 Take margin into account on max dimension
Summary:
We need to take the margin into account if we clip on max dimension. Fixes #466.
Closes https://github.com/facebook/yoga/pull/467

Differential Revision: D4681342

Pulled By: emilsjolander

fbshipit-source-id: 56311df9864a284d553c31f1c6db382f337f1fad
2017-03-09 04:00:32 -08:00
Eric Rozell dd5798b57b Workaround for P/Invoke AccessViolationException
Summary:
The issue is on ARM builds for Windows UWP. For the C# P/Invoke API wrapper, any native method that returns the YogaValue struct throws the AccessViolationException. The issue is not with structs in general, as returning the YogaSize / YGSize struct works fine. The issue seems to be limited to structs that have an enum member.

I tried a number of things to resolve the issue without changing the underlying native API for Windows. I read the ARM documentation and saw reference to variable enum sizes based on the number of enum members, so I tried to use a number of different UnmanagedType values in a [MarsalAs()] attribute on the enum member of the C# struct declaration.

What ultimately worked was to return a pointer to the location of the struct, and use the System.Runtime.InteropServices.PtrToStructure API to read the struct data from that pointer. I added a few new macros that will return the struct address on Windows only, other builds are not affected.

Note, I have not tested the impact of this ch
Closes https://github.com/facebook/yoga/pull/459

Reviewed By: emilsjolander

Differential Revision: D4652278

Pulled By: splhack

fbshipit-source-id: bf7ada4da1781e3f813b3ba331974b7bded476d9
2017-03-06 11:33:02 -08:00
Lukas Wöhrl e596217d99 Added bool config to YGConfig to configure using web defaults
Summary:
Added bool config to YGConfig to configure using web defaults. See #445.
Closes https://github.com/facebook/yoga/pull/449

Reviewed By: astreet

Differential Revision: D4642272

Pulled By: emilsjolander

fbshipit-source-id: 4f35bd17b7f764f42295052a4a8b4ae46c192d7e
2017-03-03 11:01:00 -08:00
Lukas Wöhrl 495fb54058 Mark all children as dirty if display changes
Summary:
If we set ```display:none``` all children are set with layout sizes/values of 0. We need do mark all those children as dirty to force a relayout if we toggle the display on a higher parent node. This fixes #443
Closes https://github.com/facebook/yoga/pull/448

Reviewed By: astreet

Differential Revision: D4642273

Pulled By: emilsjolander

fbshipit-source-id: dfdb920e2049952bd6c7f48cfa53b1448e1f3e8f
2017-03-03 10:42:07 -08:00
Lukas Wöhrl a1406c4824 Explicitly set new experimental and a small other improvement
Summary:
This sets the new ```YGExperimentalFeatureMinFlexFix``` explicitly to false in the config.

It also a changes a stretch reason to reflect that it is the strech in a multiline.
Closes https://github.com/facebook/yoga/pull/447

Reviewed By: astreet

Differential Revision: D4642275

Pulled By: emilsjolander

fbshipit-source-id: 26777db7008ff6ee86da72ca9ea19e979b916cc9
2017-03-03 10:42:07 -08:00
Lukas Wöhrl 1b79e5557d Use floats to prevent double calculation + float casting on scale
Summary:
Use ```float``` for calculation, as we would calculate with ```double``` and cast to float afterwards otherwise. So this removes the warning.
Closes https://github.com/facebook/yoga/pull/450

Reviewed By: astreet

Differential Revision: D4642267

Pulled By: emilsjolander

fbshipit-source-id: 184ef24474f2b8a42654a71a8e98839296648b2b
2017-03-03 10:42:07 -08:00
Lukas Wöhrl bdd9aed909 Move configuration to new YGConfig and pass them down to CalculateLayout
Summary:
Move configuration to new ```YGConfig``` and pass them down to CalculateLayout. See #418 .

Adds ```YGConfigNew()``` + ```YGConfigFree```, and changed ```YGSetExperimentalFeatureEnabled``` to use the config.

New function for calculation is ```YGNodeCalculateLayoutWithConfig```.
Closes https://github.com/facebook/yoga/pull/432

Reviewed By: astreet

Differential Revision: D4611359

Pulled By: emilsjolander

fbshipit-source-id: a1332f0e1b21cec02129dd021ee57408449e10b0
2017-03-01 09:31:06 -08:00
Emil Sjolander d5a381f493 Fix margin auto for start and end values
Reviewed By: astreet

Differential Revision: D4627339

fbshipit-source-id: eebf64e79a34331e79cffcfa3662d4938fbd6c13
2017-03-01 09:16:05 -08:00
Emil Sjolander 23f2f5f239 default root node to size of parent contraints
Reviewed By: dshahidehpour

Differential Revision: D4634616

fbshipit-source-id: 089eb4313c5bb810a6ff56f158cd19cec71808ec
2017-03-01 07:15:23 -08:00
Georgiy Kassabli 1209b39492 Yoga test failure for flexing with min stack dimension
Reviewed By: emilsjolander

Differential Revision: D4558653

fbshipit-source-id: 06b38d7ed43aee063cc881f38b84558641f043f3
2017-02-28 16:30:40 -08:00
Marc Horowitz 6bce498bbc Tweak CxxMessageQueue to work with unique_ptr
Differential Revision: D4560164

fbshipit-source-id: 8975157f5a14d5849365a9e35922a02ac6dc185b
2017-02-28 14:15:56 -08:00
Lukas Wöhrl 80225fb9e7 Change flex getters to return the set values
Summary:
Changed the flex getters to return the values they were actually set. See #421 .
Closes https://github.com/facebook/yoga/pull/431

Reviewed By: astreet

Differential Revision: D4604744

Pulled By: emilsjolander

fbshipit-source-id: 02d79100ef22be866db1c3bd9d53e4447186811f
2017-02-28 09:31:47 -08:00
Emil Sjolander 702564fb60 Pass the parent size to YGNodeCalculateLayout instead of the node size
Reviewed By: astreet

Differential Revision: D4611417

fbshipit-source-id: 2fb0eedffa17f0ec89b601722a1717a72e216b9e
2017-02-28 08:14:51 -08:00
Lukas Wöhrl f52d66c311 Fix percentage in flexing parent
Summary:
If we don't measure exactly, percentage values aren't exactly either. Fix for #414.
Closes https://github.com/facebook/yoga/pull/416
Closes https://github.com/facebook/yoga/pull/414

Reviewed By: astreet

Differential Revision: D4604729

Pulled By: emilsjolander

fbshipit-source-id: 66880230073209cbe89668b838c2a82e7f9b34df
2017-02-28 07:02:32 -08:00
Ashok Menon bf429f03a9 Get rid of code gated behind `JSC_HAS_EXTERNAL_CACHE`
Reviewed By: bnham

Differential Revision: D4608754

fbshipit-source-id: 9214c4d20720e5aa1cd65381a4837ff06943376e
2017-02-27 14:04:57 -08:00
Michael Bolin 48cb932c6e Apply auto-formatter for BUCK files in fbandroid.
fbshipit-source-id: 278ce6f67f5df830b2218e3aca69be103d3c56a6
2017-02-27 14:04:56 -08:00
Georgiy Kassabli 387ec8ce37 Add rounding to the pixel grid to Yoga
Reviewed By: emilsjolander

Differential Revision: D4565980

fbshipit-source-id: 9700f6d6ed147f82b19f230fbff2e9ccbd625b25
2017-02-24 10:08:04 -08:00
Ashok Menon a0f2ca8668 Migrating over CompiledSourceCode to new SourceProvider APIs.
Reviewed By: michalgr

Differential Revision: D4598042

fbshipit-source-id: ac6460c9156cc72e7925edac675a0b6ed57196f5
2017-02-23 11:45:57 -08:00
Lukas Wöhrl 1f456365e8 Fix align-content:strech overriding align-item
Summary:
Fix for #413. This was a hangover from a previous attept to fix other align-content problems.
Closes https://github.com/facebook/yoga/pull/417

Reviewed By: astreet

Differential Revision: D4604727

Pulled By: emilsjolander

fbshipit-source-id: 92fd31a385d8182c6b201c891d5ae478372d525d
2017-02-23 08:30:54 -08:00
Charles Dick a151fce1ca refactor jscMemoryMetrics to use HeapStats
Reviewed By: amnn

Differential Revision: D4558963

fbshipit-source-id: 8b729c6ce288d30b8d069be34f9db7572d8b3ec4
2017-02-22 11:16:13 -08:00
Emil Sjolander 6ac6bf007a Fix behaviour of wrapping container within align-items: not stretch
Reviewed By: astreet

Differential Revision: D4578614

fbshipit-source-id: 5d22a3a673735587384d775189158a87bb1d457d
2017-02-20 07:32:06 -08:00
Pieter De Baets ebe3355de7 Create NSDataBigString
Reviewed By: bnham

Differential Revision: D4559734

fbshipit-source-id: 6766093524ae79ed2a41285d33eb2207993a7d0e
2017-02-20 05:00:58 -08:00
Ashok Menon 1635c02e92 Simplifying Struct definition.
Summary:
Since we are reading from a file, we should make sure this struct is packed, just in case we change it down the line and the compiler decides it might want to introduce padding, we're now protected against that.

There was also a discussion about the fact that people might use `ptr += sizeof(BundleHeader)` as an idiom in their code, which would currently be incorrect, if padding was introduced at the end of the file. Actually, it remains incorrect to do that now, because a RAM bundle header is a different size to a BC Bundle header. If people are properly testing their code, they should spot this pretty quickly, because it will always be an incorrect thing to do with a RAM bundle, so this isn't as bad as previously thought: where the code only succeeds when the compiler deigns to not pad the struct at the end.

This diff also cleans up how headers are initialised. `BundleHeader` has a constructor that explicitly zero-initialises it so we can rely on the default initializer to do the right thing now.

Reviewed By: mhorowitz

Differential Revision: D4572032

fbshipit-source-id: 7dc50cfa9438dfdfb9f842dc39d8f15334813c63
2017-02-20 04:30:19 -08:00