fix a crash on exit
authorstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2007 08:10:22 +0000 (08:10 +0000)
committerstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2007 08:10:22 +0000 (08:10 +0000)
remove focusFrame
add childFrames

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19293 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitQt/Api/qwebframe.cpp
WebKitQt/Api/qwebframe.h
WebKitQt/Api/qwebpage.cpp
WebKitQt/Api/qwebpage.h
WebKitQt/ChangeLog
WebKitQt/WebCoreSupport/FrameLoaderClientQt.cpp
WebKitQt/WebCoreSupport/FrameLoaderClientQt.h

index 16be412a4117347da3c68bf7241a757c9d007be5..addd9acc0fe49e6699afb2afd7528391a9e23f94 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "FrameLoaderClientQt.h"
 #include "FrameQt.h"
+#include "FrameTree.h"
 #include "FrameView.h"
 #include "ResourceRequest.h"
 
@@ -157,10 +158,26 @@ QString QWebFrame::selectedText() const
 void QWebFrame::resizeEvent(QResizeEvent *e)
 {
     QScrollArea::resizeEvent(e);
-    RenderObject *renderer = d->frame->renderer();
-    if (renderer)
-        renderer->setNeedsLayout(true);
-    d->frameView->scheduleRelayout();
+    if (d->frame && d->frameView) {
+        RenderObject *renderer = d->frame->renderer();
+        if (renderer)
+            renderer->setNeedsLayout(true);
+        d->frameView->scheduleRelayout();
+    }
+}
+
+QList<QWebFrame*> QWebFrame::childFrames() const
+{
+    QList<QWebFrame*> rc;
+    if (d->frame) {
+        FrameTree *tree = d->frame->tree();
+        for (Frame *child = tree->firstChild(); child; child = child->tree()->nextSibling()) {
+            FrameLoaderClientQt *loader = (FrameLoaderClientQt*)child->loader();
+            rc.append(loader->webFrame());
+        }
+
+    }
+    return rc;
 }
 
 #include "qwebframe.moc"
index 0257d938f2c1b21ec5d79b681cf69ba4918661d9..47a671d3ae0d626f4ea4a4fba806280ed393ee50 100644 (file)
@@ -55,6 +55,8 @@ public:
     QString selectedText() const;
     QString title() const;
 
+    QList<QWebFrame*> childFrames() const;
+
 signals:
     void cleared();
     void loadDone(bool ok);
index 49399a70bb59a7eda7ccab4dcc9dd4d93dd11f7e..f39e1b96ba4c2f5051d39a2fbee684c70a34f2b4 100644 (file)
@@ -28,8 +28,6 @@
 #include "qwebpagehistory.h"
 #include "qwebpagehistory_p.h"
 
-#include <qurl.h>
-
 #include "FrameQt.h"
 #include "ChromeClientQt.h"
 #include "ContextMenuClientQt.h"
 #include "Page.h"
 #include "FrameLoader.h"
 #include "KURL.h"
-#include "qboxlayout.h"
 
 #include <QDebug>
+#include <QUrl>
+#include <QVBoxLayout>
 
 using namespace WebCore;
 
@@ -137,12 +136,6 @@ QWebFrame *QWebPage::mainFrame() const
     return d->mainFrame;
 }
 
-QWebFrame *QWebPage::focusFrame() const
-{
-    Q_ASSERT(false);
-    return mainFrame(); // FIXME: this is not correct
-}
-
 QSize QWebPage::sizeHint() const
 {
     return QSize(800, 600);
index 089a949a1d1118cde38aad1e94bd3c84df9f4c17..31484d790248a5bc85b7f560b9aaeac16f59f732 100644 (file)
@@ -52,8 +52,6 @@ public:
 
     QWebFrame *mainFrame() const;
 
-    QWebFrame *focusFrame() const;
-
     QWebPageHistory history() const;
 
     QSize sizeHint() const;
index c0fc12deffb178eb10d19301c4eabd97acaabb9c..76564b23003a43025cf30a91d7e1c1a151f76d48 100644 (file)
@@ -1,3 +1,20 @@
+2007-01-31  George Staikos  <staikos@kde.org>
+
+        Remove focusFrame() - misguided - and add childFrames().  Fix a crash
+        on exit.
+
+        Reviewed by Zack.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::resizeEvent):
+        (QWebFrame::childFrames):
+        * Api/qwebframe.h:
+        * Api/qwebpage.cpp:
+        * Api/qwebpage.h:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::webFrame):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
 2007-01-30  Zack Rusin  <zrusin@trolltech.com>
 
         Improve QtLauncher to make it more useful as a testing tool.
index d3c9d04fdf977676dcc1f1708c6c3fafc953bb92..1879356a8570d4d1d49faec1f6e420043336a5d7 100644 (file)
@@ -82,6 +82,11 @@ void FrameLoaderClientQt::setFrame(QWebFrame *webFrame, FrameQt *frame)
             m_webFrame, SIGNAL(titleChanged(const QString&)));
 }
 
+QWebFrame *FrameLoaderClientQt::webFrame() const
+{
+    return m_webFrame;
+}
+
 void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, PolicyAction action)
 {
     qDebug() << "FrameLoaderClientQt::callPolicyFunction";
index 4f082100466aa51872d449c9e8bd34ba10bfa873..6615ccff2c74d253f344dedde8983a9a37e9240f 100644 (file)
@@ -68,6 +68,7 @@ namespace WebCore {
         FrameLoaderClientQt();
         ~FrameLoaderClientQt();
         void setFrame(QWebFrame *webFrame, FrameQt *frame);
+        QWebFrame *webFrame() const;
 
         virtual bool hasWebView() const; // mainly for assertions
         virtual bool hasFrameView() const; // ditto