UIWebPaginationModeTopToBottom causes UIWebView to be fully opaque
| Originator: | cspickert | ||
| Number: | rdar://15300937 | Date Originated: | 23-Oct-2013 02:59 PM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.0 |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
When a UIWebView instance's `paginationMode` is set to `UIWebPaginationModeUnpaginated`, it is possible to make the web view completely transparent if the document loaded is also transparent. When the web view's `paginationMode` is set to `UIWebPaginationModeTopToBottom`, it is not possible to make the web view fully transparent.
Steps to Reproduce:
1. Instantiate a UIWebView instance and set its `opaque` property to `NO`, its `backgroundColor` to `[UIColor clearColor]`, and its `paginationMode` to `UIWebPaginationModeTopToBottom`.
2. Load the following HTML document into the web view, e.g. using `-[UIWebView loadHTMLString:baseURL:]`:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body, html {
background-color:transparent !important;
}
h1 {
color: black;
}
</style>
</head>
<body>
<h1>Testing</h1>
</body>
</html>
Note that the `background-color` of the `html` and `body` elements must be set to `transparent`.
3. Set the background color of the web view's superview to something other than white, e.g. `[UIColor blueColor]`.
Expected Results:
If the web view is not opaque and its background color is clear, it should be fully transparent and you should see “Testing” in black on a blue background.
Actual Results:
The web view's background color defaults to opaque white when using the new pagination API introduced in the iOS 7 SDK.
Regression:
This bug was introduced with the iOS 7.0 SDK.
Notes:
Changing the pagination mode of the web view back to `UIWebPaginationModeUnpaginated` yields the expected visual appearance.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!