Commit Graph

132 Commits

Author SHA1 Message Date
Lukas Woehrl 1c69b61c26 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:43:26 -08:00
Michał Gregorczyk 2ca507bf9e Remove supported platforms from JSC and all the things that depends on it
Reviewed By: bnham

Differential Revision: D4213580

fbshipit-source-id: 3830c15b0097030a4e4611aac814b12e1d6ae696
2016-11-21 16:43:31 -08:00
Emil Sjolander 6526548b50 Move measure code for known dimensions out of main layout function
Reviewed By: gkassabli

Differential Revision: D4213339

fbshipit-source-id: 5ca35ca307594f3419fd0dee81321d3c2e06710f
2016-11-21 11:13:40 -08:00
Emil Sjolander 85d0dab9bf Move measure code for empty containers out of main layout function
Reviewed By: gkassabli

Differential Revision: D4213313

fbshipit-source-id: 2061a809202f7f948bff1b3ee8dc4c230692a223
2016-11-21 11:13:40 -08:00
Emil Sjolander cf796248ec Move custom measure code out of main layout function
Reviewed By: gkassabli

Differential Revision: D4213302

fbshipit-source-id: df4bc43848325e99ad338a2fa6d5c9404315b0e6
2016-11-21 11:13:39 -08:00
Emil Sjolander e1df3c8782 Add aspectRatio style property
Reviewed By: gkassabli

Differential Revision: D4211458

fbshipit-source-id: f8d0d318369c7b529ee29e61a52b17d0cf3b396d
2016-11-21 10:13:34 -08:00
Andy Street d63ba47b59 BREAKING [react_native] Move to new C-based implementation of css-layout in RN Android
Summary:
Moves from CSSNodeDEPRECATED to CSSNode. This has shown to be a huge performance win for layout time within FB.

This is BREAKING because CSSNode contains bug fixes that were not migrated to CSSNodeDEPRECATED which may change the way your layout appears. The most common of these by far involves `flex: 1`.

Previously, developers had to put `flex: 1` in many places it didn't belong in order to work around a bug in css-layout. Now `flex: 1` is treated properly and, unfortunately, this means that your layout may no longer look correct. Specifically, you may see that your layout looks collapsed, or children don't render. The fix is to simply remove `flex: 1` from those containers.

Reviewed By: emilsjolander

Differential Revision: D3992787

fbshipit-source-id: 7a3a2a34a8941c0524e6ba3c5379e434d3e03247
2016-11-21 06:28:30 -08:00
Pieter De Baets 0c03b788d7 Create JSCWrapper in C++ bridge
Reviewed By: bnham

Differential Revision: D4082204

fbshipit-source-id: 03bff2ac53e6df931063fcd6ba6ad28dc5ae9562
2016-11-21 04:43:42 -08:00
Emil Sjolander 15f848e8d8 Only skip updating computed flex basis within the same generation
Reviewed By: dshahidehpour

Differential Revision: D4207106

fbshipit-source-id: fc1063ca79ecf75f6101aadded53bca96cb0585d
2016-11-20 05:13:28 -08:00
Pieter De Baets 2a04569926 Fix usage of old String constructor
Reviewed By: amnn

Differential Revision: D4204575

fbshipit-source-id: ea0309ec9bf2c8a4c480188efb00408fcc399e2e
2016-11-18 07:28:24 -08:00
Pieter De Baets 20514e3482 Add JSContextRef param to String constructor
Reviewed By: bnham

Differential Revision: D4197300

fbshipit-source-id: 306ffc85e3ced24047b68499f7cdf5e2d31fc052
2016-11-18 06:28:48 -08:00
Pieter De Baets b1c91606ff Implement Value.is* using getType
Reviewed By: mhorowitz

Differential Revision: D4197286

fbshipit-source-id: 893077a661bbf39b46ef9b10aa9ee552788882a6
2016-11-18 06:28:48 -08:00
Pieter De Baets 674d86cdcb Add some more helper methods to Value
Reviewed By: mhorowitz

Differential Revision: D4197278

fbshipit-source-id: 9a538ff2747d32a54d42627a9f78e4a348dce639
2016-11-18 06:28:48 -08:00
Ashok Menon 9e00a42fd7 Experimental App Bundle API
Reviewed By: michalgr

Differential Revision: D4198629

fbshipit-source-id: b96a4b3ad3e5ab6b4cb8892442c6077edf7058a3
2016-11-18 05:13:31 -08:00
Lukas Wöhrl 687ae48cc7 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:43:44 -08:00
Lukas Wöhrl ee285876d2 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:43:44 -08:00
Lukas Wöhrl fb4d9f204a 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:43:44 -08:00
Lukas Wöhrl 1430458906 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:43:43 -08:00
Kazuki Sakamoto 39a59caac1 Introduce CSSNodeCopyStyle
Reviewed By: emilsjolander

Differential Revision: D4188514

fbshipit-source-id: af8d7fb5e8688c64aea05ce7ad23fff9233fb441
2016-11-17 09:13:31 -08:00
Kazuki Sakamoto c5f6e864f9 Workaround fix for Visual Studio
Reviewed By: emilsjolander

Differential Revision: D4191268

fbshipit-source-id: 53fdcc388292e76c2b97ad071f0d7c27d0613ecf
2016-11-17 08:58:55 -08:00
Kazuki Sakamoto 0d0f44439c Fix memory func test
Reviewed By: emilsjolander

Differential Revision: D4193712

fbshipit-source-id: a4aba84d054d98a7baf438e213a90bd7ef34e979
2016-11-17 07:43:27 -08:00
Ashok Menon 2de1c3507a Introducing `JSBigFileString`
Reviewed By: michalgr

Differential Revision: D4189896

fbshipit-source-id: 0f3cebcd7e76d5c763c29ebc1119ae24b643e5ad
2016-11-16 15:13:39 -08:00
Ashok Menon 79fa6d41a1 Rename JSBigMmapString -> JSBigOptimizedBundleString
Summary:
`JSBigMmapString` needs to know too much about the details of the "optimized bundle" format. In honour of this fact, I'm renaming it to `JSBigOptimizedBundleString`. In a following diff, I will introduce a new class just for File-backed Strings, whose only responsibility is dealing with an mmaped region.

This diff already pulls in some fixes for formatting reference and pointer declarations from the linter.

Reviewed By: michalgr

Differential Revision: D4189391

fbshipit-source-id: b376c2a8d9ae5b83575da8457e607bbbfc648ebd
2016-11-16 15:13:39 -08:00
Ashok Menon 89d81b34db Use folly for error checking
Summary: Small refactor, making error checking clearer.

Reviewed By: lexs

Differential Revision: D4189090

fbshipit-source-id: f3a24eacfe6dd154d29662f510ce19dbe55f89a6
2016-11-16 15:13:39 -08:00
Ashok Menon f22dfa3efb Make Bytecode Header errors non-fatal
Reviewed By: michalgr

Differential Revision: D4182575

fbshipit-source-id: 1e7c229bb6d0bdbfdfc01e93af53441ba2cba9f9
2016-11-16 15:13:39 -08:00
Kazuki Sakamoto e864c40be8 Introduce CSSLayoutSetMemoryFuncs
Reviewed By: emilsjolander

Differential Revision: D4178386

fbshipit-source-id: a79dbdaf82a512f42cc43f99dbc49faba296903b
2016-11-15 20:28:30 -08:00
Emil Sjolander ffcdf25281 Autogenerate enum defenitions for all languages
Reviewed By: gkassabli

Differential Revision: D4174263

fbshipit-source-id: 478961a8f683e196704d3c6ea1505a05c85fcb10
2016-11-15 08:44:30 -08:00
Andy Street c04ab92192 Use -O3 to compile CSSLayout in open source
Summary: This is how we compile internally

Reviewed By: emilsjolander

Differential Revision: D4182691

fbshipit-source-id: 314b1a1ead7d299677ce7f71549c986e1b796b3b
2016-11-15 08:28:56 -08:00
Andy Street 3b20a39f7b Move ReactCommon/CSSLayout to ReactCommon/CSSLayout/CSSLayout
Reviewed By: emilsjolander

Differential Revision: D4182345

fbshipit-source-id: 05cb4f0b0e7971d4f66e656ea89d876264a61bd4
2016-11-15 06:28:45 -08:00
Fred Liu 1f125e3d41 Revert D4157971: [csslayout] BREAKING - Fix sizing of container with child overflowing parent
Differential Revision: D4157971

fbshipit-source-id: be055cf018fd39b3cee9af0bc777831fcf757190
2016-11-14 12:28:40 -08:00
Andy Street 07ef5a8fe9 Build C-version of CSSLayout in open source
Summary: Builds and ships libcsslayout.so with Android builds. This is not used yet, but a follow up diff will shortly move us from CSSNodeDEPRECATED to CSSNode (which uses libcsslayout)

Reviewed By: emilsjolander

Differential Revision: D4168140

fbshipit-source-id: d72bded88df81e4d54df31a08e4b101834770a73
2016-11-14 06:13:48 -08:00
Emil Sjolander 307871e854 Implement standard interface for toggling experimental features
Reviewed By: gkassabli

Differential Revision: D4174260

fbshipit-source-id: ad3667183810c02833fba9a1276f89286e848fcd
2016-11-14 03:28:39 -08:00
Emil Sjolander a2cafb062e rename CSSWrapType to shorter CSSWrap matching java and csharp
Reviewed By: gkassabli

Differential Revision: D4174257

fbshipit-source-id: ba0bfab996ba158b07863d8c72cf2a41262c9592
2016-11-14 03:28:38 -08:00
Emil Sjolander e2e3a27571 BREAKING - Fix sizing of container with child overflowing parent
Reviewed By: gkassabli

Differential Revision: D4157971

fbshipit-source-id: 3cfae15ac8b65b70f01789444099ee684e1b099a
2016-11-14 02:13:51 -08:00
Andy Street 974eec8264 Add CSSLayout to ReactCommon
Summary: First step to sharing CSSLayout code between iOS and Android.

Reviewed By: emilsjolander

Differential Revision: D4160286

fbshipit-source-id: 976f5820b19a7011e0a14317c858465f932e1f59
2016-11-11 10:58:55 -08:00
Pieter De Baets 96cf9bb0c0 Support null messageQueueThread in JSCExecutor
Reviewed By: michalgr

Differential Revision: D4119253

fbshipit-source-id: 2956434451bf4e649cfe4c0ee0a9b7339a5422a3
2016-11-02 14:28:36 -07:00
Alexander Blom fbc8410d86 Add some documentation
Summary: Adds documentation about the Inspector.

Reviewed By: passy, foghina

Differential Revision: D4114673

fbshipit-source-id: fb1182c89c94f10a74d4589b6a24a06b376db92e
2016-11-02 12:29:15 -07:00
Alexander Blom 6a1783210b Add JS agent support
Summary:
Adds the possibility to define agents in Javascript. Javascript agents are simple classes that extend `InspectorAgent` and pass down the
given `EventSender` to the super constructor. The library will then call methods on the object for each received method call over the protocol.

Reviewed By: davidaurelio

Differential Revision: D4021508

fbshipit-source-id: bbe609e92ea726cbbbec833df81705ebd3346c77
2016-11-02 12:29:15 -07:00
Alexander Blom 27f504e9e3 Add Console agent
Summary: Adds the Console agent which we hook from our console polyfill. It captures the stack and strips the frames of the polyfill.

Reviewed By: davidaurelio

Differential Revision: D4021502

fbshipit-source-id: 49cb700a139270485b7595e85e52d50c9a620db6
2016-11-02 12:29:15 -07:00
Alexander Blom 0ac7bf29af Add Page, Runtime, Debugger agents
Summary: Runtime and Debugger agents are shipped with JSC so we reuse them. Messages are routed to them through the `LegacyDispatcher` which also handles translating their events. The Page agent emits the `Page.getResourceTree` method that the Chrome inspector expects.

Reviewed By: michalgr

Differential Revision: D4021499

fbshipit-source-id: a93d0add01cee732401f8e8db1d43205bfbd4cd4
2016-11-02 12:29:14 -07:00
Alexander Blom 156e5d9837 Add on-device JSC inspector
Summary:
Introduces the inspector library supporting the Chrome Debugging Protocol for JavaScriptCore. Eventually this will mean that it is possible to attach
the Chrome inspector directly to the JSC instance running on the device. This library doesn't define the actual transport but leaves that up to the platform
layer.

The main entry point (and the only exported header) is `Inspector.h`.

This diff only introduces the basics supporting the `Schema` and `Inspector` domains meaning it doesn't have any features yet. These will come in following
diffs.

Reviewed By: michalgr

Differential Revision: D4021490

fbshipit-source-id: 517fd9033051c11ba97d312b16382445ae85d3f3
2016-11-02 12:29:14 -07:00
Pieter De Baets 4082a54649 Don't mask exceptions generated from loadModule
Reviewed By: davidaurelio

Differential Revision: D4112447

fbshipit-source-id: e9b3a5cefb166fe00c04b6126c9878e71f1413ec
2016-11-01 16:13:33 -07:00
Alexander Blom a0c550d5c0 Allow creating JS functions from std::function
Reviewed By: mhorowitz

Differential Revision: D4043376

fbshipit-source-id: 65b4f025835dbae34e764015743c2616d9eb9379
2016-11-01 11:44:10 -07:00
Alexander Blom ddb8cb7cf0 Move JSCHelpers.h and Value.h into separate package
Reviewed By: javache

Differential Revision: D3950748

fbshipit-source-id: 6315ea07f3217b485aeb4374b5f6e36333957848
2016-11-01 11:44:10 -07:00
Ben Nham c089761f9b Use JSCExecutor to manage loading js script in JSContext
Reviewed By: jaegs

Differential Revision: D4021624

fbshipit-source-id: 8e46052ad246e842a88715d55059a233196a4a6b
2016-10-31 15:13:49 -07:00
Giuseppe Ottaviano dc02907039 Fix a folly::dynamic deprecated pattern
Reviewed By: javache

Differential Revision: D4075622

fbshipit-source-id: 4a6b6c4068d762dce2b1535bfd9630e185f5489f
2016-10-26 09:43:56 -07:00
Nikhilesh Sigatapu c67225818d Add a way to access the underlying JavaScriptCore context
Summary:
**Motivation**

I'm working on a project that uses React Native and needs to add direct synchronous bindings to native stuff through the JavaScriptCore C API. This is because it's performance-sensitive and would benefit from the quickest JS->C path. It does this using cross-platform C++ code that works on both iOS and Android. Most of the infrastructure for getting access to the JSC context is already in React Native actually, just had to add a few more things.

(lexs you mentioned to tag you in this pull request)

**Test plan**

Modify the JavaScriptCore context through the `JSContextRef` returned (eg. add an object at global scope) and verify that it exists in JavaScript.
Closes https://github.com/facebook/react-native/pull/10399

Differential Revision: D4080945

Pulled By: lexs

fbshipit-source-id: 6659b7a01e09fd84475adde183c1d3aca2d4cf09
2016-10-26 03:43:44 -07:00
Scott Wolchok 3f472e0bfa Fix cxxreact build error with -Wmissing-prototypes
Differential Revision: D4022143

fbshipit-source-id: 6afbd29a030ff51915cfb552f74737e9146b2ffd
2016-10-14 13:28:36 -07:00
Pieter De Baets 8355ef91ad Add a default context name to RCTJSCExecutor
Reviewed By: mmmulani

Differential Revision: D4015748

fbshipit-source-id: 077287b8438aa13f2a1479d68eacb0662bf295aa
2016-10-14 11:43:43 -07:00
Pieter De Baets 9ed9bca0bf Lazily instantiate native modules
Summary: Instead of sending a list of modules over to JS on startup (and actually blocking script execution) instead provide a proxy object that constructs each of these lazily.

Reviewed By: lexs

Differential Revision: D3936979

fbshipit-source-id: 71bde822f01eb17a29f56c5e60e95e98e207d74d
2016-10-11 07:28:42 -07:00