react-native/Libraries/Components
Ramanpreet Nara a5ce1ad767 Ensure WebViews render about:blank correctly
Summary:
@public

This diff fixes two bugs:
1. When you load a `<WebView/>` with an HTML source string, HTML source doesn't render in the `<WebView/>`. Instead, we get this warning: https://pxl.cl/grz3. Here's what the above page should look like when correctly rendered: https://pxl.cl/grzt

2. Furthermore, you render a blank `<WebView/>` (i.e: with no source prop), it should display a blank page. Instead, we get this warning: https://pxl.cl/grz3

**Bugfix:**
One solution I found was to ensure that `about:blank` is always whitelisted. That way, we don't ever abort navigations to blank pages, which occur when we do:

```ObjectiveC
/** Line 134 in RCTWebView.m */
[_webView loadHTMLString:@"" baseURL:nil];
```

and

```ObjectiveC
/** Line 115 in RCTWebView.m */
if (html) {
  NSURL *baseURL = [RCTConvert NSURL:source[@"baseUrl"]];
  if (!baseURL) {
    baseURL = [NSURL URLWithString:@"about:blank"];
  }
  [_webView loadHTMLString:html baseURL:baseURL];
  return;
}
```

Reviewed By: yungsters, mmmulani

Differential Revision: D9259852

fbshipit-source-id: e1b9673fcd8c3d0df77308df8c4a632a2b596bfb
2018-08-13 10:18:17 -07:00
..
AccessibilityInfo Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ActivityIndicator Fix more forwardRef displayNames 2018-06-19 14:17:19 -07:00
AppleTV Spread TVViewProps into ViewProps instead of intersection 2018-05-12 10:35:26 -07:00
CheckBox Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
Clipboard Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
DatePicker RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
DatePickerAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
DrawerAndroid Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
Keyboard Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
MaskedView Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
Navigation Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Picker Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ProgressBarAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ProgressViewIOS RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
RefreshControl Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
SafeAreaView Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ScrollView Flow v0.76.0 2018-07-09 08:17:51 -07:00
SegmentedControlIOS RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
Slider Fix more forwardRef displayNames 2018-06-19 14:17:19 -07:00
StatusBar Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
Switch Move Switch native require call to new file 2018-08-08 15:03:01 -07:00
TabBarIOS Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
TextInput Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
TimePickerAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ToastAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ToolbarAndroid Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
Touchable accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3 2018-07-25 23:48:26 -07:00
UnimplementedViews Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
View Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
ViewPager Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
WebView Ensure WebViews render about:blank correctly 2018-08-13 10:18:17 -07:00
Button.js accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3 2018-07-25 23:48:26 -07:00
ScrollResponder.js Fix keyboard handling with keyboardShouldPersistTaps: never 2018-05-14 23:46:50 -07:00
StaticContainer.react.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
StaticRenderer.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Subscribable.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00