[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/unity/WebKit/WebCore/platform/qt
From:       Nikolas Zimmermann <wildfox () kde ! org>
Date:       2006-07-31 15:15:30
Message-ID: 1154358930.198742.13248.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 568235 by wildfox:

* Enable JavaScript, add alert() handling.
* Fix some important stubs & implement formSubmit()

Happy googling! It works :-)

http://ktown.kde.org/~wildfox/ktown/unity4.png


 M  +32 -10    FrameQt.cpp  
 M  +1 -0      FrameQt.h  


--- branches/work/unity/WebKit/WebCore/platform/qt/FrameQt.cpp #568234:568235
@@ -41,6 +41,7 @@
 #include "Document.h"
 #include "KWQKHTMLSettings.h"
 #include "Plugin.h"
+#include "HelperQt.h"
 #include "FramePrivate.h"
 #include "GraphicsContext.h"
 #include "HTMLDocument.h"
@@ -53,14 +54,12 @@
 #include "TypingCommand.h"
 #include "KWQKSSLKeyGen.h"
 
-#include <QPaintEvent>
 #include <QScrollArea>
+#include <QMessageBox>
 
 DeprecatedStringList KSSLKeyGen::supportedKeySizes(){return \
DeprecatedStringList();};  DeprecatedString \
KSSLKeyGen::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const \
DeprecatedString &challengeString, const KURL &url){return DeprecatedString();};  
-#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", \
                __FILE__, __LINE__); } while(0)
-
 namespace WebCore {
 
 
@@ -122,7 +121,8 @@
     settings->setMinFontSize(5);
     settings->setMinLogicalFontSize(5);
     settings->setShouldPrintBackgrounds(true);
-
+    settings->setIsJavaScriptEnabled(true);
+ 
     settings->setMediumFixedFontSize(14);
     settings->setMediumFontSize(14);
     settings->setSerifFontName("Times New Roman");
@@ -154,9 +154,27 @@
     return true;
 }
 
-void FrameQt::submitForm(const ResourceRequest&)
+void FrameQt::submitForm(const ResourceRequest& request)
 {
-    notImplemented();
+    qDebug("FrameQt::submitForm()");
+
+    // FIXME: this is a hack inherited from FrameMac, and should be pushed into \
Frame +    if (d->m_submittedFormURL == request.url())
+        return;
+
+    d->m_submittedFormURL = request.url();
+
+    /* TODO: Once we have a KPart - named "FramePartQt" - we can let that inherit \
from FrameQtClient and implement the functions...) +    if (m_client)
+        m_client->submitForm(request.doPost() ? "POST" : "GET", request.url(), \
&request.postData); +    */
+
+    begin(request.url());
+
+    TransferJob* job = new TransferJob(this, request.doPost() ? "POST" : "GET", \
request.url(), request.postData); +    job->start(document()->docLoader());
+    
+    clearRecordedFormValues();
 }
 
 void FrameQt::urlSelected(const ResourceRequest& request)
@@ -177,7 +195,7 @@
 
 void FrameQt::runJavaScriptAlert(String const& message)
 {
-    notImplemented();
+    QMessageBox::information(view()->qwidget(), "JavaScript", toQString(message));
 }
 
 bool FrameQt::runJavaScriptConfirm(String const& message)
@@ -208,9 +226,11 @@
     return false;
 }
 
-bool FrameQt::passSubframeEventToSubframe(MouseEventWithHitTestResults &, Frame* \
subframe) +bool FrameQt::passSubframeEventToSubframe(MouseEventWithHitTestResults& \
mev, Frame*)  {
-    notImplemented();
+    if (mev.targetNode() == 0)
+        return true;
+ 
     return false;
 }
 
@@ -262,7 +282,7 @@
 
 Range* FrameQt::markedTextRange() const
 {
-    notImplemented();
+    // notImplemented();
     return 0;
 }
 
@@ -291,6 +311,7 @@
 bool FrameQt::lastEventIsMouseUp() const
 {
     notImplemented();
+    return false;
 }
 
 void FrameQt::saveDocumentState()
@@ -421,6 +442,7 @@
 bool FrameQt::shouldChangeSelection(const SelectionController& oldSelection, const \
SelectionController& newSelection, EAffinity affinity, bool stillSelecting) const  {
     notImplemented();
+    return true;
 }
 
 void FrameQt::partClearedInBegin()
--- branches/work/unity/WebKit/WebCore/platform/qt/FrameQt.h #568234:568235
@@ -45,6 +45,7 @@
     virtual ~FrameQtClient();
 
     virtual void openURL(const DeprecatedString&) = 0;
+    virtual void submitForm(const String& method, const KURL&, const FormData*) = 0;
 };
 
 class FrameQt : public Frame, public TransferJobClient {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic