Граф коммитов

1337 Коммитов

Автор SHA1 Сообщение Дата
Pieter De Baets c3448236da Include RCTSamplingProfiler in React-tvOS
Reviewed By: ericvicenti

Differential Revision: D4190591

fbshipit-source-id: f8c81c644ba801c27d4c9776b1e8ccaf22df6822
2016-11-16 11:58:33 -08:00
Dan Caspi 42d14bef04 Enforcing semi-colon consistency between dev and release modes when calling RCTLog*
Summary:
The various RCTLog macros (`RCTLogWarn`, `RCTLogError`, etc..) are based on the `_RCTLog` macro, which, in its expanded form, has a semi-colon in DEV mode (i.e., when `RCTLOG_ENABLED` is set to 1), and doesn't have one when `RCTLOG_ENABLED` is set to 0.
This could lead to a situation where code will compile in DEV but will fail to compile for prod.
Fixing this by removing the semicolon from the DEV version (as should).

Reviewed By: javache

Differential Revision: D4189133

fbshipit-source-id: 54cb4e2c96d1e48d9df88464aa58b13af432c2bd
2016-11-16 07:28:32 -08:00
Dan Caspi 3b4ac79583 Exposing RCTDevMenuItem when not in DEV mode and adding a missing header
Reviewed By: javache

Differential Revision: D4189179

fbshipit-source-id: c9ad45b20bab884e5d0fcd17efc494fc37ab7d92
2016-11-16 07:28:32 -08:00
Andy Street ca69ea435a Update objc build to use CSSLayout in ReactCommon
Summary: Updates objc version to use the same CSSLayout files as the android version

Reviewed By: emilsjolander

Differential Revision: D4182821

fbshipit-source-id: 81f18184b539fe0ef76ea868bc067b8283c2cccb
2016-11-16 04:43:27 -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
Martin Kralik 26e373c903 fix view clipping to operate on ui hierachy
Summary:
There was a bug in the view clipping logic.
Clipping works on uiview hierarchy, but I've been using `reactSuperview` to get clipping rect for my parent.
This is incorrect in a case where these two hierarchies don't match and there are some views between a view and its `reactSuperview`.

So we should really use normal `superview`. A minor complication is that `superview` is `nil` if we are clipped.
We could remember what our last `superview` was, but that's extra data we have to manage. Instead I use one clever trick to avoid doing so.
(Let me know if it makes sense based on my inline documentation.)

Reviewed By: mmmulani

Differential Revision: D4182647

fbshipit-source-id: 779cbcec0bd08eb270c3727c9c5cb9c080c4a2a4
2016-11-15 17:13:48 -08:00
Dan Caspi b123cc279e Another fix
Reviewed By: benhiller

Differential Revision: D4185166

fbshipit-source-id: 940dbfbd65c94455979c7e88375784a5c68647a5
2016-11-15 14:58:36 -08:00
Dan Caspi 851aed262d Fixing a missing colon
Reviewed By: javache

Differential Revision: D4183368

fbshipit-source-id: b7a8bdfa40bf13d3fd5caae8a0985492f1e8b901
2016-11-15 11:17:49 -08:00
Dan Caspi 9fc6204efc Add support for JSC's sampling profiler on iOS for RN
Reviewed By: javache

Differential Revision: D4107919

fbshipit-source-id: ecfe2cacdb78b857e461f7006b29e4d1fe1a1862
2016-11-15 09:29:06 -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 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
Martin Konicek 7991d1206b Revert import from D4133936 (13aba8)
Summary:
This broke the open source build: http://imgur.com/a/1Btd1

javache tells me reverting this line should fix it.

Reviewed By: javache, ericvicenti

Differential Revision: D4178951

fbshipit-source-id: c680de6b3b48bf137294dfe053afaff7b0613caf
2016-11-14 16:28:55 -08:00
Pieter De Baets 6fe977d5cc Fix missing reference to RCTLog
Reviewed By: bestander

Differential Revision: D4176714

fbshipit-source-id: 92c7ef86c9c51b828fb564606bc5de16bfe4f54f
2016-11-14 14:14:06 -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
Indragie Karunaratne 13aba82a2b Add more functions to RCTJSCWrapper + make it a public header
Reviewed By: javache

Differential Revision: D4133936

fbshipit-source-id: 04951965099598f7058cb0005267712c276582b9
2016-11-14 09:13:40 -08:00
Ashok Menon e7c85cea36 Bytecode Exposure Logging
Reviewed By: javache

Differential Revision: D4160438

fbshipit-source-id: 3554ec68da5fcae8baef8bb49c76b75a7e45c55f
2016-11-14 07:58:31 -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
Pieter De Baets 33deaad196 Cleanup display of C++ stack frames in redbox
Reviewed By: mmmulani

Differential Revision: D4159921

fbshipit-source-id: 1924a701db4af30800064a648dfa5c0d5906de19
2016-11-14 04:59:13 -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
Emil Sjolander bd1f22c4bd Fix flex within max size if max size is not constraint to
Reviewed By: gkassabli

Differential Revision: D4162104

fbshipit-source-id: 08feba6cb4e789c9aa12179e2cdeadc66b011841
2016-11-11 08:13:34 -08:00
Martin Kralik d5e067f244 don't clip if ui and react view hierarchies are different
Reviewed By: mmmulani

Differential Revision: D4088498

fbshipit-source-id: ec08e4e68d327fc770c944c274bb9f367daba6d2
2016-11-11 05:29:31 -08:00
Martin Kralik 625c8cb83c new `removeClippedSubviews` implementation (take 2 - recursive)
Reviewed By: mmmulani

Differential Revision: D4081700

fbshipit-source-id: d4079138dc070565e475831e82651c9b2d5b8d59
2016-11-11 05:29:30 -08:00
Martin Kralik a3ad34c34f remove outdated code in RCTNavigator
Reviewed By: mmmulani

Differential Revision: D4095285

fbshipit-source-id: 1e2111b6647e14562675e4474cd56acb91d22ec2
2016-11-11 05:29:30 -08:00
Martin Kralik 47839307f3 proper `reactSuperview` implementation
Summary:
React view hierarchy doesn't have to always match uiview hierarchy. Plus if we clip view we loose knowledge about view's react superview if we just use `self.superview` as react superview.
This diff fixes it by storing a strong ref to reactSuperview in an associated object.

This is needed for new view clipping implementation (see the dependent diff).

Reviewed By: mmmulani

Differential Revision: D4081844

fbshipit-source-id: 9317d9db46fbd474382c5469b7922f88e5ee7568
2016-11-11 05:29:30 -08:00
Ashok Menon 58aa9afaed BC Kill-switch
Reviewed By: javache

Differential Revision: D4159923

fbshipit-source-id: 9814c76d04f7230fda7693efac3f6623cc882ccf
2016-11-11 05:29:30 -08:00
Ashok Menon 8288bc2006 BC Soft Errors
Reviewed By: javache

Differential Revision: D4131340

fbshipit-source-id: b0827fc99d94985fbbb2a1b03ddc4d6feab10bff
2016-11-11 05:29:25 -08:00
Emil Sjolander 454c33884a Revert D4133643: [react-native] Fix incorrect pixel-rounding in RCTShadowView.
Differential Revision: D4133643

fbshipit-source-id: bb17e0c84ba9d85c5d03129c602d1d432ee0aa56
2016-11-10 15:13:43 -08:00
Pieter De Baets 5aad13b691 Remove useless store in CSSLayout.c
Reviewed By: emilsjolander

Differential Revision: D4159938

fbshipit-source-id: 8b9ff3896c0e222e8e89546881129214bc6ba566
2016-11-10 08:58:41 -08:00
Kazuki Sakamoto 1d9d8e93fb Remove CSSAssertSetFailFunc
Reviewed By: emilsjolander

Differential Revision: D4155452

fbshipit-source-id: 5a19c79a212f204d13064527fd6e5843bab76e6b
2016-11-09 17:28:38 -08:00
Emil Sjolander 744965800f Absolute positioned items should apear inside padding but outside border
Reviewed By: gkassabli

Differential Revision: D4153332

fbshipit-source-id: 251e29e02018a433f60349b78c03feb121512797
2016-11-09 11:59:37 -08:00
Emil Sjolander a4a02f6b57 Dont measure single flex grow+shrink child
Reviewed By: gkassabli

Differential Revision: D4153133

fbshipit-source-id: 2333150a83857cc30078cc8d52761cbd00652830
2016-11-09 11:29:02 -08:00
Andy Street a731a23d91 Update logging to support levels, print messages in Android logcat on assertion failures
Summary: The goal of this diff is to have assertion failures show up as error logs on Android. To do this, I updated the logging API to take calls with log levels. We now have to pass around va_list unfortunately since you can't re-expand or pass along var-args to a subcall.

Reviewed By: emilsjolander

Differential Revision: D4140898

fbshipit-source-id: e0eb9a1f0b08a7d90a8233f66bb857d5b871b6ad
2016-11-09 09:58:59 -08:00
Dustin Shahidehpour 39798ae368 Allow MeasureFunc to be set to NULL no matter how many children a node has.
Reviewed By: emilsjolander

Differential Revision: D4148727

fbshipit-source-id: 79a0f3ef1bf7b1dce9a14de96f870e35c042b78b
2016-11-09 08:43:32 -08:00
Jing Chen 653e8d9b9a Reverted commit D4147298
Reviewed By: gkassabli

Differential Revision: D4147298

fbshipit-source-id: 8416508a31e8d317bf59d956abdbe5760b55bb6d
2016-11-09 00:14:02 -08:00
Emil Sjolander 4500e4d0ff Dont measure single flex grow+shrink child
Reviewed By: gkassabli

Differential Revision: D4147298

fbshipit-source-id: 51152e57eff8e322a833a6d698c30f8c5e2dcc35
2016-11-08 15:28:42 -08:00
Emil Sjolander 72d11912f4 Fix flex within max width constraint
Reviewed By: gkassabli

Differential Revision: D4147199

fbshipit-source-id: feb335eb8687a1b7939ee8cd8649e455e0c069a9
2016-11-08 09:59:03 -08:00
Ashok Menon 3ee5e97bcd Removing redundant `if`.
Reviewed By: javache

Differential Revision: D4139894

fbshipit-source-id: 457f6b2b0b448af1dd75faa1c1b350e36d7a3133
2016-11-08 09:13:43 -08:00
Emil Sjolander 81e4139edc Remove isTextNode optimization
Reviewed By: astreet

Differential Revision: D4146785

fbshipit-source-id: e20d780fbd5759b8f38b809e8cadf29cedee82a8
2016-11-08 09:13:43 -08:00
Dan Caspi 47d9cb4dac Setting runtime options for JSC on iOS
Reviewed By: michalgr

Differential Revision: D4104084

fbshipit-source-id: 517f833343948c59e5f77cede8a60574ca1e40c0
2016-11-08 08:43:38 -08:00
Roger Chapman c1458e0181 If no match return at least the first font in the family.
Summary:
Solves issue #7632 where fonts with only a single font weight/type would not render.

Example of a built-in font that would not render is `Zapfino` and other custom fonts like `Impact` would not render.
Closes https://github.com/facebook/react-native/pull/10572

Differential Revision: D4143335

Pulled By: hramos

fbshipit-source-id: 2f64aad2fb5ddc7aae2ca7a5362a89b45e550e13
2016-11-07 17:14:02 -08:00
Aleksei Androsov 3eeaffce1a RefreshControl doesn't render when initial refreshing state is true
Summary:
Example (index.ios.js):

```
'use strict';

import React from 'react';
import {ListView, RefreshControl, Text, View} from 'react-native';

class BugExample extends React.Component {

    render() {
        return (
            <ListView
                style={{backgroundColor: 'red'}}
                contentContainerStyle={{backgroundColor: 'green'}}
                refreshControl={
                    <RefreshControl
                        refreshing={true}
                        onRefresh={() => {}}
                    />
                }
                dataSource={
                    new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}).cloneWithRows(['a', 'b', 'c'])
                }
                renderRow={(item) => {
                    return (
                        <View>
                            <Text>{item}</Text>
                        </View>
                    );
                }}
            />
        );
    }
}
```

RN version: 0.34, 0.35-rc
iOS version (emulator): 9.
Closes https://github.com/facebook/react-native/pull/10321

Differential Revision: D4142774

Pulled By: mmmulani

fbshipit-source-id: 743b865a6e1c1fb09c7cfc48631ad383bd593f89
2016-11-07 15:58:43 -08:00
Dustin Shahidehpour 4d35f65eb7 Fix incorrect pixel-rounding in RCTShadowView.
Reviewed By: emilsjolander

Differential Revision: D4133643

fbshipit-source-id: 28a4408ba8da797138b9e100fa1555ddb0856ceb
2016-11-07 15:58:43 -08:00
安秋亮 7839a9fd60 Add inline definition for Microsoft Visual Studio
Summary:
The inline keyword is available only in C++. The __inline and __forceinline keywords are available in both C and C++. For compatibility with previous versions, _inline is a synonym for __inline.

https://msdn.microsoft.com/en-us/library/z8y1yy88(v=vs.120).aspx
Closes https://github.com/facebook/css-layout/pull/239

Reviewed By: astreet

Differential Revision: D4138941

Pulled By: emilsjolander

fbshipit-source-id: cb59dc91ef285e5378036c4912217fd4ec8d9f79
2016-11-07 12:58:33 -08:00
Geordie a4bb4d25f5 Only retain the previousViews that need to be validated
Summary:
Fixes #4740, where views would unnecessarily be retained after performing `navigator.pop()` - this was particularly problematic for big lists and memory-intensive custom views.

This fix causes no functional change: `_previousViews` are only used in the loop starting at line 564 to ensure that the JavaScript and Native navigation stacks are equivalent at all times. As we do in this fix, that loop limits itself to only the views expected to be on the React navigation stack. So overall this change makes the code logically 'more correct'.

Tested by checking that `_previousViews.count` is always equivalent to `previousReactCount` in the loop (which means we could remove the complex `MIN(... MIN(previousReactCount, _previousViews.count)` in the loop too, but I wanted to keep the diff as small as possible for now).
Closes https://github.com/facebook/react-native/pull/10789

Differential Revision: D4140502

Pulled By: ericvicenti

fbshipit-source-id: 4491ad3c16642914c3081295cf95c4cf36be9f94
2016-11-07 10:28:48 -08:00
Andy Street 96a581f6c2 Assert that node can have measure function <==> node is a leaf node
Summary: Instead of silently ignorning non-leaf nodes with measure functions, we should assert that we don't create those kinds of trees.

Reviewed By: emilsjolander

Differential Revision: D4130770

fbshipit-source-id: a3ef10a2e63bbc12b5aa07977e4b84c8d59e3ffe
2016-11-07 05:28:52 -08:00
Dustin Shahidehpour 07fb9040d9 Only mark Nodes dirty if an actual node is removed.
Reviewed By: gkassabli

Differential Revision: D4125453

fbshipit-source-id: 745cfc55269415fea106a80c72401eb3074f2d31
2016-11-03 13:43:57 -07:00
Ashok Menon 227f1b0ea8 Decoupling initialisation and synchronous execution.
Reviewed By: javache

Differential Revision: D4117471

fbshipit-source-id: b00de532c99f041ebba8b9d74972a36827a1a3f4
2016-11-03 10:58:43 -07:00
Georgiy Kassabli e7dc71ba84 Exposing layout cache check publicly
Reviewed By: emilsjolander

Differential Revision: D4124705

fbshipit-source-id: 23284967900585fa20dcb51c9cc1bee829b32975
2016-11-03 10:43:53 -07:00