Changeset 25128 in webkit
- Timestamp:
- Aug 17, 2007, 3:12:56 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r25124 r25128 1 2007-08-17 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 <rdar://problem/5379040> 6 REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes 7 8 Add test. 9 10 * plugins/netscape-plugin-setwindow-size-expected.txt: Added. 11 * plugins/netscape-plugin-setwindow-size.html: Added. 12 1 13 2007-08-17 Oliver Hunt <oliver@apple.com> 2 14 -
trunk/WebCore/ChangeLog
r25125 r25128 1 2007-08-17 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 <rdar://problem/5379040> 6 REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes 7 8 Instantiate plug-ins during the first layout instead of doing so when creating the renderer. 9 This ensures that the plug-in widget will have a correct initial size. 10 11 * html/HTMLEmbedElement.cpp: 12 (WebCore::HTMLEmbedElement::getInstance): 13 Force a layout if the plug-in doesn't have an instance. 14 15 (WebCore::HTMLEmbedElement::attach): 16 Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in. 17 18 * html/HTMLIFrameElement.cpp: 19 (WebCore::HTMLIFrameElement::attach): 20 Pass false to updateWidget, this will only create subframes anyway. 21 22 * html/HTMLObjectElement.cpp: 23 (WebCore::HTMLObjectElement::getInstance): 24 Force a layout if the plug-in doesn't have an instance. 25 26 (WebCore::HTMLObjectElement::attach): 27 Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in. 28 29 * loader/FrameLoader.cpp: 30 (WebCore::FrameLoader::loadPlugin): 31 Get the size from the renderer and pass it to the client. 32 33 * loader/FrameLoaderClient.h: 34 * page/mac/WebCoreFrameBridge.h: 35 * platform/graphics/svg/SVGImageEmptyClients.h: 36 (WebCore::SVGEmptyFrameLoaderClient::createPlugin): 37 Update declarations. 38 39 * rendering/RenderPart.cpp: 40 (WebCore::RenderPart::setWidget): 41 No need to mark the renderer as dirty here. 42 43 * rendering/RenderPartObject.h: 44 * rendering/RenderPartObject.cpp: 45 (WebCore::RenderPartObject::updateWidget): 46 Add a parameter, onlyCreateNonPlugins. If this is true the widget 47 will only be created if it's not a plug-in. 48 49 (WebCore::RenderPartObject::layout): 50 Call updateWidget here if m_widget is 0, causing the plug-in to be instantiated. 51 1 52 2007-08-17 Oliver Hunt <oliver@apple.com> 2 53 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r25115 r25128 11751 11751 isa = PBXProject; 11752 11752 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 11753 compatibilityVersion = "Xcode 2.4"; 11753 11754 hasScannedForEncodings = 1; 11754 11755 knownRegions = ( -
trunk/WebCore/html/HTMLEmbedElement.cpp
r24415 r25128 66 66 return m_instance.get(); 67 67 68 document()->updateLayoutIgnorePendingStylesheets(); 69 68 70 RenderObject *r = renderer(); 69 71 if (!r) { … … 154 156 155 157 if (renderer()) 156 static_cast<RenderPartObject*>(renderer())->updateWidget( );158 static_cast<RenderPartObject*>(renderer())->updateWidget(true); 157 159 } 158 160 -
trunk/WebCore/html/HTMLIFrameElement.cpp
r20305 r25128 122 122 123 123 if (RenderPartObject* renderPartObject = static_cast<RenderPartObject*>(renderer())) 124 renderPartObject->updateWidget( );124 renderPartObject->updateWidget(false); 125 125 } 126 126 -
trunk/WebCore/html/HTMLObjectElement.cpp
r25098 r25128 82 82 return m_instance.get(); 83 83 84 document()->updateLayoutIgnorePendingStylesheets(); 84 85 RenderObject* r = renderer(); 85 86 if (r && r->isWidget()) { … … 185 186 // this method or recalcStyle (which also calls updateWidget) to be called. 186 187 m_needWidgetUpdate = false; 187 static_cast<RenderPartObject*>(renderer())->updateWidget( );188 static_cast<RenderPartObject*>(renderer())->updateWidget(true); 188 189 } else { 189 190 m_needWidgetUpdate = true; -
trunk/WebCore/loader/FrameLoader.cpp
r25064 r25128 1530 1530 } 1531 1531 1532 widget = m_client->createPlugin(pluginElement, url, paramNames, paramValues, mimeType, 1532 widget = m_client->createPlugin(IntSize(renderer->contentWidth(), renderer->contentHeight()), 1533 pluginElement, url, paramNames, paramValues, mimeType, 1533 1534 m_frame->document()->isPluginDocument()); 1534 1535 if (widget) { -
trunk/WebCore/loader/FrameLoaderClient.h
r24785 r25128 199 199 virtual Frame* createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, 200 200 const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) = 0; 201 virtual Widget* createPlugin( Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0;201 virtual Widget* createPlugin(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0; 202 202 virtual void redirectDataToPlugin(Widget* pluginWidget) = 0; 203 203 -
trunk/WebCore/page/mac/WebCoreFrameBridge.h
r25000 r25128 265 265 - (void)setNeedsReapplyStyles; 266 266 267 - (NSView *)viewForPluginWithURL:(NSURL *)URL 268 attributeNames:(NSArray *)attributeNames 269 attributeValues:(NSArray *)attributeValues 270 MIMEType:(NSString *)MIMEType 271 DOMElement:(DOMElement *)element 272 loadManually:(BOOL)loadManually; 267 - (NSView *)viewForPluginWithFrame:(NSRect)frame 268 URL:(NSURL *)URL 269 attributeNames:(NSArray *)attributeNames 270 attributeValues:(NSArray *)attributeValues 271 MIMEType:(NSString *)MIMEType 272 DOMElement:(DOMElement *)element 273 loadManually:(BOOL)loadManually; 273 274 - (NSView *)viewForJavaAppletWithFrame:(NSRect)frame 274 275 attributeNames:(NSArray *)attributeNames -
trunk/WebCore/platform/graphics/svg/SVGImageEmptyClients.h
r24780 r25128 265 265 virtual Frame* createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, 266 266 const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) { return 0; } 267 virtual Widget* createPlugin( Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; }267 virtual Widget* createPlugin(const IntSize&,Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; } 268 268 virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; } 269 269 -
trunk/WebCore/rendering/RenderPart.cpp
r21367 r25128 64 64 RenderWidget::setWidget(widget); 65 65 66 setNeedsLayoutAndPrefWidthsRecalc();67 68 66 // make sure the scrollbars are set correctly for restore 69 67 // ### find better fix -
trunk/WebCore/rendering/RenderPartObject.cpp
r24417 r25128 30 30 #include "Frame.h" 31 31 #include "FrameLoader.h" 32 #include "FrameLoaderClient.h" 32 33 #include "FrameTree.h" 33 34 #include "FrameView.h" … … 101 102 } 102 103 103 void RenderPartObject::updateWidget( )104 void RenderPartObject::updateWidget(bool onlyCreateNonPlugins) 104 105 { 105 106 String url; … … 108 109 Vector<String> paramValues; 109 110 Frame* frame = m_view->frame(); 110 111 setNeedsLayoutAndPrefWidthsRecalc(); 112 111 113 112 if (element()->hasTagName(objectTag)) { 114 113 … … 218 217 m_hasFallbackContent = true; 219 218 } 219 220 if (onlyCreateNonPlugins) { 221 KURL completedURL; 222 if (!url.isEmpty()) 223 completedURL = frame->loader()->completeURL(url); 224 225 if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentPlugin) 226 return; 227 } 228 220 229 bool success = frame->loader()->requestObject(this, url, AtomicString(o->name()), serviceType, paramNames, paramValues); 221 230 if (!success && m_hasFallbackContent) … … 240 249 } 241 250 } 251 252 if (onlyCreateNonPlugins) { 253 KURL completedURL; 254 if (!url.isEmpty()) 255 completedURL = frame->loader()->completeURL(url); 256 257 if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentPlugin) 258 return; 259 } 260 242 261 frame->loader()->requestObject(this, url, o->getAttribute(nameAttr), serviceType, paramNames, paramValues); 243 262 } … … 254 273 RenderPart::layout(); 255 274 275 if (!m_widget) 276 updateWidget(false); 277 256 278 setNeedsLayout(false); 257 279 } -
trunk/WebCore/rendering/RenderPartObject.h
r18874 r25128 37 37 38 38 virtual void layout(); 39 v irtual void updateWidget();39 void updateWidget(bool onlyCreateNonPlugins); 40 40 41 41 virtual void viewCleared(); -
trunk/WebKit/ChangeLog
r25114 r25128 1 2007-08-17 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 <rdar://problem/5379040> 6 REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes 7 8 Pass the right size when creating the views. 9 10 * WebCoreSupport/WebFrameBridge.mm: 11 (-[WebFrameBridge viewForPluginWithFrame:URL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): 12 * WebCoreSupport/WebFrameLoaderClient.h: 13 * WebCoreSupport/WebFrameLoaderClient.mm: 14 (WebFrameLoaderClient::createPlugin): 15 1 16 2007-08-13 Geoffrey Garen <ggaren@apple.com> 2 17 -
trunk/WebKit/WebCoreSupport/WebFrameBridge.mm
r24947 r25128 433 433 } 434 434 435 - (NSView *)viewForPluginWithURL:(NSURL *)URL 436 attributeNames:(NSArray *)attributeNames 437 attributeValues:(NSArray *)attributeValues 438 MIMEType:(NSString *)MIMEType 439 DOMElement:(DOMElement *)element 440 loadManually:(BOOL)loadManually 435 - (NSView *)viewForPluginWithFrame:(NSRect)frame 436 URL:(NSURL *)URL 437 attributeNames:(NSArray *)attributeNames 438 attributeValues:(NSArray *)attributeValues 439 MIMEType:(NSString *)MIMEType 440 DOMElement:(DOMElement *)element 441 loadManually:(BOOL)loadManually 441 442 { 442 443 ASSERT([attributeNames count] == [attributeValues count]); … … 492 493 #ifndef __LP64__ 493 494 else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) { 494 WebNetscapePluginEmbeddedView *embeddedView = [[[WebNetscapePluginEmbeddedView alloc] initWithFrame: NSZeroRect495 WebNetscapePluginEmbeddedView *embeddedView = [[[WebNetscapePluginEmbeddedView alloc] initWithFrame:frame 495 496 pluginPackage:(WebNetscapePluginPackage *)pluginPackage 496 497 URL:URL … … 518 519 pluginName:[pluginPackage name] 519 520 MIMEType:MIMEType]; 520 WebNullPluginView *nullView = [[[WebNullPluginView alloc] initWithFrame: NSZeroRecterror:error DOMElement:element] autorelease];521 WebNullPluginView *nullView = [[[WebNullPluginView alloc] initWithFrame:frame error:error DOMElement:element] autorelease]; 521 522 view = nullView; 522 523 [error release]; -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.h
r24785 r25128 185 185 virtual WebCore::Frame* createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*, 186 186 const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); 187 virtual WebCore::Widget* createPlugin( WebCore::Element*, const WebCore::KURL&, const Vector<WebCore::String>&,187 virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const Vector<WebCore::String>&, 188 188 const Vector<WebCore::String>&, const WebCore::String&, bool); 189 189 virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm
r24785 r25128 1216 1216 } 1217 1217 1218 Widget* WebFrameLoaderClient::createPlugin( Element* element, const KURL& url, const Vector<String>& paramNames,1218 Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, Element* element, const KURL& url, const Vector<String>& paramNames, 1219 1219 const Vector<String>& paramValues, const String& mimeType, bool loadManually) 1220 1220 { … … 1222 1222 1223 1223 BEGIN_BLOCK_OBJC_EXCEPTIONS; 1224 return new Widget([bridge viewForPluginWithURL:url.getNSURL() 1225 attributeNames:nsArray(paramNames) 1226 attributeValues:nsArray(paramValues) 1227 MIMEType:mimeType 1228 DOMElement:[DOMElement _wrapElement:element] 1229 loadManually:loadManually]); 1224 return new Widget([bridge viewForPluginWithFrame:NSMakeRect(0, 0, size.width(), size.height()) 1225 URL:url.getNSURL() 1226 attributeNames:nsArray(paramNames) 1227 attributeValues:nsArray(paramValues) 1228 MIMEType:mimeType 1229 DOMElement:[DOMElement _wrapElement:element] 1230 loadManually:loadManually]); 1230 1231 END_BLOCK_OBJC_EXCEPTIONS; 1231 1232 -
trunk/WebKitTools/ChangeLog
r25112 r25128 1 2007-08-17 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 <rdar://problem/5379040> 6 REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes 7 8 Add a way for the plug-in to dump the width and height when it gets its NPP_SetWindow call. 9 10 * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c: 11 (pluginAllocate): 12 * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: 13 * DumpRenderTree/TestNetscapePlugIn.subproj/main.c: 14 (NPP_New): 15 (NPP_SetWindow): 16 1 17 2007-08-16 Alice Liu <alice.liu@apple.com> 2 18 -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c
r24118 r25128 335 335 newInstance->eventLogging = FALSE; 336 336 newInstance->logDestroy = FALSE; 337 newInstance->logSetWindow = FALSE; 337 338 newInstance->returnErrorFromNewStream = FALSE; 338 339 newInstance->stream = 0; -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
r24118 r25128 40 40 NPP npp; 41 41 NPBool eventLogging; 42 NPBool logSetWindow; 42 43 NPBool logDestroy; 43 44 NPBool returnErrorFromNewStream; -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.c
r24118 r25128 84 84 strcasecmp(argv[i], "data:application/x-webkit-test-netscape,returnerrorfromnewstream") == 0) 85 85 obj->returnErrorFromNewStream = TRUE; 86 else if (strcasecmp(argn[i], "logfirstsetwindow") == 0) 87 obj->logSetWindow = TRUE; 86 88 } 87 89 … … 109 111 NPError NPP_SetWindow(NPP instance, NPWindow *window) 110 112 { 113 PluginObject *obj = instance->pdata; 114 115 if (obj) { 116 if (obj->logSetWindow) { 117 printf("PLUGIN: NPP_SetWindow: %d %d\n", window->width, window->height); 118 obj->logSetWindow = false; 119 } 120 } 121 111 122 return NPERR_NO_ERROR; 112 123 }
Note:
See TracChangeset
for help on using the changeset viewer.