127 lines
5.0 KiB
Diff
127 lines
5.0 KiB
Diff
Index: khtml/html/html_objectimpl.cpp
|
|
===================================================================
|
|
--- khtml/html/html_objectimpl.cpp (Revision 769141)
|
|
+++ khtml/html/html_objectimpl.cpp (Revision 769142)
|
|
@@ -340,6 +340,13 @@
|
|
// if the URL isn't there
|
|
QString effectiveServiceType = serviceType;
|
|
|
|
+ // We need to wait until everything has parsed, since we need the <param>s,
|
|
+ // and the embedded <embed>
|
|
+ if (!closed()) {
|
|
+ setNeedComputeContent();
|
|
+ return;
|
|
+ }
|
|
+
|
|
// Collect information from <param> children for ...
|
|
// It also sometimes supplements or replaces some of the element's attributes
|
|
for (NodeImpl* child = firstChild(); child; child = child->nextSibling()) {
|
|
@@ -485,13 +492,6 @@
|
|
if (m_renderAlternative)
|
|
return;
|
|
|
|
- // Finally, we want to try requesting the KPart. However, params matter here,
|
|
- // so we want to defer until closed.
|
|
- if (!closed()) {
|
|
- setNeedComputeContent();
|
|
- return;
|
|
- }
|
|
-
|
|
KHTMLPart* part = getDocument()->part();
|
|
clearChildWidget();
|
|
|
|
@@ -719,6 +719,12 @@
|
|
HTMLObjectBaseElementImpl::attach();
|
|
}
|
|
|
|
+void HTMLEmbedElementImpl::computeContent()
|
|
+{
|
|
+ if (parentNode()->id() != ID_OBJECT)
|
|
+ HTMLObjectBaseElementImpl::computeContent();
|
|
+}
|
|
+
|
|
// -------------------------------------------------------------------------
|
|
|
|
HTMLObjectElementImpl::HTMLObjectElementImpl(DocumentImpl *doc)
|
|
Index: khtml/html/html_objectimpl.h
|
|
===================================================================
|
|
--- khtml/html/html_objectimpl.h (Revision 769141)
|
|
+++ khtml/html/html_objectimpl.h (Revision 769142)
|
|
@@ -41,7 +41,7 @@
|
|
class HTMLEmbedElementImpl;
|
|
|
|
// Base class of all objects that are displayed as KParts:
|
|
-// frames, objects, applets, etc.
|
|
+// frames, objects, applets, etc.
|
|
class HTMLPartContainerElementImpl : public QObject, public HTMLElementImpl
|
|
{
|
|
public:
|
|
@@ -54,22 +54,22 @@
|
|
virtual void recalcStyle(StyleChange ch);
|
|
virtual void close();
|
|
|
|
- // These methods will be called to notify the element of
|
|
- // any progress in loading of the document: setWidgetNotify if the
|
|
- // KPart was created, and partLoadingErrorNotify when
|
|
+ // These methods will be called to notify the element of
|
|
+ // any progress in loading of the document: setWidgetNotify if the
|
|
+ // KPart was created, and partLoadingErrorNotify when
|
|
// there was a problem with creating the part or loading the data
|
|
// (hence setWidgetNotify may be followed by partLoadingErrorNotify).
|
|
- // This class take care of all the memory management, and during
|
|
+ // This class take care of all the memory management, and during
|
|
// the setWidgetNotify call, both old (if any) and new widget are alive
|
|
// Note: setWidgetNotify may be called with 0...
|
|
- virtual void setWidgetNotify(QWidget *widget) = 0;
|
|
+ virtual void setWidgetNotify(QWidget *widget) = 0;
|
|
virtual void partLoadingErrorNotify();
|
|
-
|
|
- // This is called when a mimetype is discovered, and should return true
|
|
+
|
|
+ // This is called when a mimetype is discovered, and should return true
|
|
// if KHTMLPart should not make a kpart for it, but rather let it be handled directly.
|
|
virtual bool mimetypeHandledInternally(const QString& mime);
|
|
|
|
- // IMPORTANT: you should call this when requesting a URL, to make sure
|
|
+ // IMPORTANT: you should call this when requesting a URL, to make sure
|
|
// that we don't get stale references to iframes or such.
|
|
void clearChildWidget();
|
|
QWidget* childWidget() const { return m_childWidget; }
|
|
@@ -80,8 +80,8 @@
|
|
void setWidget(QWidget* widget);
|
|
private:
|
|
virtual void computeContent() = 0;
|
|
- bool m_needToComputeContent; // This flag is set to true when
|
|
- // we may have to load a new KPart, due to
|
|
+ bool m_needToComputeContent; // This flag is set to true when
|
|
+ // we may have to load a new KPart, due to
|
|
// source changing, etc.
|
|
QPointer<QWidget> m_childWidget; // may be deleted by global child widget cleanup on us..
|
|
};
|
|
@@ -102,7 +102,7 @@
|
|
QString classId;
|
|
QString serviceType;
|
|
|
|
- bool m_rerender; // This is set to true if a reattach is pending,
|
|
+ bool m_rerender; // This is set to true if a reattach is pending,
|
|
// due to a change in how we need to display this...
|
|
|
|
bool m_renderAlternative;
|
|
@@ -119,7 +119,7 @@
|
|
virtual void partLoadingErrorNotify();
|
|
virtual bool mimetypeHandledInternally(const QString& mime);
|
|
|
|
- // This method figures out what to render -- perhaps KPart, perhaps an image, perhaps
|
|
+ // This method figures out what to render -- perhaps KPart, perhaps an image, perhaps
|
|
// alternative content, and forces a reattach if need be.
|
|
virtual void computeContent();
|
|
|
|
@@ -164,6 +164,7 @@
|
|
|
|
virtual void parseAttribute(AttributeImpl *attr);
|
|
virtual void attach();
|
|
+ virtual void computeContent();
|
|
|
|
virtual HTMLEmbedElementImpl* relevantEmbed();
|
|
|