WebView in NSTabView and setHostWindow: causing vertically flipped Plugins

Originator:felix
Number:rdar://19701304 Date Originated:03-Feb-2015
Status:Open Resolved:
Product:OS X SDK Product Version:OS X Version 10.10.2 (14C109), Xcode Version 6.1.1 (6A2008a)
Classification:Serious Bug Reproducible:Always
 
Summary:
When using WebViews hosted within an NSTabView your documentation recommends to use the setHostWindow: API of the WebView class. This works work around the issue that "Plug-ins and JavaScript depend on a window to function properly even if the web view is not in an actual window".

However, when using this API and switching back and forth between the tabs, the Plugin's contents suddenly flip vertically and horizontally.

Steps to Reproduce:
- Start the x64 based sample of the attached project.
- Switch from the 'No Plugin' tab to the 'Quick Time' tab (or 'Flash' if installed and configured properly).
- At this stage everything is working as expected.
- Now switch back to the 'No Plugin' tab and once again back to the 'Quick Time' tab.
- Now the Quick Time logo on the right is flipped vertically and horizontally. (see screenshots)

Expected Results:
No flipping of a Plugin contained in a WebView.

Actual Results:
Plugins appear flipped in the WebView.

Version:
Xcode Version 6.1.1 (6A2008a)
OS X Version 10.10.2 (14C109)

Notes:
The sample for this issue is also hosted on Github: https://github.com/lemonmojo/WebViewPluginTest

Configuration:
For me, this is reproducible with the following systems/configurations:
OS X 10.10.2 with Safari 8.0.3 (10600.3.18)
OS X 10.9.5 with Safari 7.1.3 (9537.85.12.18)
OS X 10.9.5 with Safari 7.1.2 (9537.85.11.5)

I can NOT reproduce it with the following systems/configurations:
OS X 10.8.5 with Safari 6.2.3 (8537.85.12.18)

Furthermore, it's only reproducible if the application is targeting the 64 bit architecture. For this reason there are two targets included in the sample project, one targeting 32 bit (WebViewPluginTest x86) and one targeting 64 bit (WebViewPluginTest x64).

Attachments:
'WebViewPluginTest.zip' was successfully uploaded.

Comments

Issue still exists on OS X 10.10.3 (14D131) with Safari 8.0.6 (10600.6.3)

Issue still exists on OS X 10.10.3 (14D131) with Safari 8.0.5 (10600.5.17).

Sample Code

https://github.com/lemonmojo/WebViewPluginTest


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!