+2005-05-30 Darin Adler <darin@apple.com>
+
+ Reviewed by John.
+ Could not figure out how to make an <object> fallback, so for now, no layout test.
+
+ - fixed <rdar://problem/4134124> REGRESSION (tip of tree): crash in QWidget::getView handling onunload event (yahoo.com)
+
+ * khtml/html/html_objectimpl.cpp: (DOM::HTMLObjectElementImpl::getObjectInstance):
+ Check type of RenderObject to be sure it is a RenderWidget before calling widget() on it.
+
2005-05-27 Adele Peterson <adele@apple.com>
Change by Darin, reviewed by me.
if (objectInstance)
return objectInstance;
-
- RenderPartObject *r = static_cast<RenderPartObject*>(m_render);
- if (r) {
- if (r->widget()){
- // Call into the part (and over the bridge) to pull the Bindings::Instance
- // from the guts of the plugin.
- void *_view = r->widget()->getView();
- objectInstance = KWQ(part)->getObjectInstanceForView((NSView *)_view);
- // Applet may specified with <object> tag.
- if (!objectInstance)
- objectInstance = KWQ(part)->getAppletInstanceForView((NSView *)_view);
+
+ if (RenderObject *r = m_render) {
+ if (r->isWidget()) {
+ if (QWidget *widget = static_cast<RenderWidget *>(r)->widget()) {
+ if (NSView *view = widget->getView()) {
+ // Call into the part (and over the bridge) to pull the Bindings::Instance
+ // from the guts of the plugin.
+ objectInstance = KWQ(part)->getObjectInstanceForView(view);
+ // Applet may specified with <object> tag.
+ if (!objectInstance)
+ objectInstance = KWQ(part)->getAppletInstanceForView(view);
+ }
+ }
}
}
+
return objectInstance;
}
#endif