LayoutTests:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2007 22:12:56 +0000 (22:12 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2007 22:12:56 +0000 (22:12 +0000)
commit0fb174a8e533025fb74e49cb3e3fde754837bd06
treec5d73910da425fc46ef2b481214067653aed3f1c
parent02666a263b07750bb42661302ac8ca4a5488a6db
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: https://svn.webkit.org/repository/webkit/trunk@25128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/plugins/netscape-plugin-setwindow-size-expected.txt [new file with mode: 0644]
LayoutTests/plugins/netscape-plugin-setwindow-size.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/html/HTMLEmbedElement.cpp
WebCore/html/HTMLIFrameElement.cpp
WebCore/html/HTMLObjectElement.cpp
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoaderClient.h
WebCore/page/mac/WebCoreFrameBridge.h
WebCore/platform/graphics/svg/SVGImageEmptyClients.h
WebCore/rendering/RenderPart.cpp
WebCore/rendering/RenderPartObject.cpp
WebCore/rendering/RenderPartObject.h
WebKit/ChangeLog
WebKit/WebCoreSupport/WebFrameBridge.mm
WebKit/WebCoreSupport/WebFrameLoaderClient.h
WebKit/WebCoreSupport/WebFrameLoaderClient.mm
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c
WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.c