The WK2 layer for iOS was missing an implementation for windowRect, causing DOMWindow::outerWidth and DOMWindow::outerHeight to always return 0, 0.
<rdar://problem/16894890>
And by windowRect I meant windowFrame.
Created attachment 231942 [details] Patch.
Comment on attachment 231942 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=231942&action=review Let's talk about it tomorrow. After reading http://www.quirksmode.org/blog/archives/2012/03/windowouterwidt.html it looks like we have an extra bug to fix on WebKit1... :( > Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm:252 > + return WebCore::enclosingIntRect(m_uiDelegate.m_webView.frame); I think you want to the bounds, not the frame. We should have an extra step here: -Try to get the UIWindow from the WebView. If there is a window, return that size. -If there is not window, return the WebView bounds. > Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm:309 > + FloatRect userRect(rect); > + userRect.scale(m_webView->_page->deviceScaleFactor()); > + return userRect; Sorry, that's my fault. When you said we need to convert the rect to user space, I thought you meant in the WebProcess to convert to ContentCoordinates. This is not right. I think you can just return the incoming rect here on iOS.
Created attachment 231988 [details] Patch
Comment on attachment 231988 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=231988&action=review > Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm:252 > + UIWindow* window = m_uiDelegate.m_webView.window; if (UIWindow* window = m_uiDelegate.m_webView.window) ... > Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm:312 > + return rect; // Nothing to do on iOS Missing period. But I think you should remove the comment.
Committed r169281: <http://trac.webkit.org/changeset/169281>