LayoutTests:
Reviewed by Dave Hyatt.
<rdar://problem/5379040>
REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes
Add test.
* plugins/netscape-plugin-setwindow-size-expected.txt: Added.
* plugins/netscape-plugin-setwindow-size.html: Added.
WebCore:
Reviewed by Dave Hyatt.
<rdar://problem/5379040>
REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes
Instantiate plug-ins during the first layout instead of doing so when creating the renderer.
This ensures that the plug-in widget will have a correct initial size.
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::getInstance):
Force a layout if the plug-in doesn't have an instance.
(WebCore::HTMLEmbedElement::attach):
Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in.
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::attach):
Pass false to updateWidget, this will only create subframes anyway.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::getInstance):
Force a layout if the plug-in doesn't have an instance.
(WebCore::HTMLObjectElement::attach):
Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadPlugin):
Get the size from the renderer and pass it to the client.
* loader/FrameLoaderClient.h:
* page/mac/WebCoreFrameBridge.h:
* platform/graphics/svg/SVGImageEmptyClients.h:
(WebCore::SVGEmptyFrameLoaderClient::createPlugin):
Update declarations.
* rendering/RenderPart.cpp:
(WebCore::RenderPart::setWidget):
No need to mark the renderer as dirty here.
* rendering/RenderPartObject.h:
* rendering/RenderPartObject.cpp:
(WebCore::RenderPartObject::updateWidget):
Add a parameter, onlyCreateNonPlugins. If this is true the widget
will only be created if it's not a plug-in.
(WebCore::RenderPartObject::layout):
Call updateWidget here if m_widget is 0, causing the plug-in to be instantiated.
WebKit:
Reviewed by Dave Hyatt.
<rdar://problem/5379040>
REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes
Pass the right size when creating the views.
* WebCoreSupport/WebFrameBridge.mm:
(-[WebFrameBridge viewForPluginWithFrame:URL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createPlugin):
WebKitTools:
Reviewed by Dave Hyatt.
<rdar://problem/5379040>
REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes
Add a way for the plug-in to dump the width and height when it gets its NPP_SetWindow call.
* DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c:
(pluginAllocate):
* DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
* DumpRenderTree/TestNetscapePlugIn.subproj/main.c:
(NPP_New):
(NPP_SetWindow):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed