summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/headers.pri8
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp148
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h59
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h38
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp1311
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h204
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h116
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp443
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h107
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h59
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp118
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h43
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h62
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp2752
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h334
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h173
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp216
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h74
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp176
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h67
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h40
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp781
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h130
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp962
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.h159
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog11423
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp459
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h52
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp431
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h134
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp81
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h52
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp80
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.h46
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.cpp57
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.h50
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp596
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.h121
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp1172
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h220
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp206
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h80
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebKit_pch.h83
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/image.pngbin0 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp2355
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp94
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp983
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pro3
53 files changed, 27396 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
new file mode 100644
index 0000000..2b3c940
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
@@ -0,0 +1,8 @@
+WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
+ $$PWD/qwebkitglobal.h \
+ $$PWD/qwebpage.h \
+ $$PWD/qwebview.h \
+ $$PWD/qwebsettings.h \
+ $$PWD/qwebhistoryinterface.h \
+ $$PWD/qwebdatabase.h \
+ $$PWD/qwebsecurityorigin.h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
new file mode 100644
index 0000000..489ab17
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
@@ -0,0 +1,148 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebdatabase.h"
+#include "qwebdatabase_p.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
+#include "DatabaseDetails.h"
+#include "DatabaseTracker.h"
+
+using namespace WebCore;
+
+/*!
+ \class QWebDatabase
+ \since 4.5
+ \brief The QWebDatabase class provides access to HTML 5 databases created with JavaScript.
+
+ The upcoming HTML 5 standard includes support for SQL databases that web sites can create and
+ access on a local computer through JavaScript. QWebDatabase is the C++ interface to these databases.
+
+ For more information refer to the \l{http://www.w3.org/html/wg/html5/#sql}{HTML 5 Draft Standard}.
+
+ \sa QWebSecurityOrigin
+*/
+
+/*!
+ Constructs a web database from \a other.
+*/
+QWebDatabase::QWebDatabase(const QWebDatabase& other) : d(other.d)
+{
+}
+
+/*!
+ Assigns the \a other web database to this.
+*/
+QWebDatabase& QWebDatabase::operator=(const QWebDatabase& other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns the name of the database.
+*/
+QString QWebDatabase::name() const
+{
+ return d->name;
+}
+
+/*!
+ Returns the name of the database as seen by the user.
+*/
+QString QWebDatabase::displayName() const
+{
+ DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
+ return details.displayName();
+}
+
+/*!
+ Returns the expected size of the database in bytes as defined by the web author.
+*/
+qint64 QWebDatabase::expectedSize() const
+{
+ DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
+ return details.expectedUsage();
+}
+
+/*!
+ Returns the current size of the database in bytes.
+*/
+qint64 QWebDatabase::size() const
+{
+ DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
+ return details.currentUsage();
+}
+
+/*!
+ \internal
+*/
+QWebDatabase::QWebDatabase(QWebDatabasePrivate* priv)
+{
+ d = priv;
+}
+
+/*!
+ Returns the file name of the web database.
+
+ The name can be used to access the database through the QtSql database module, for example:
+ \code
+ QWebDatabase webdb = ...
+ QSqlDatabase sqldb = QSqlDatabase::addDatabase("QSQLITE", "myconnection");
+ sqldb.setDatabaseName(webdb.fileName());
+ if (sqldb.open()) {
+ QStringList tables = sqldb.tables();
+ ...
+ }
+ \endcode
+
+ \note Concurrent access to a database from multiple threads or processes
+ is not very efficient because Sqlite is used as WebKit's database backend.
+*/
+QString QWebDatabase::fileName() const
+{
+ return DatabaseTracker::tracker().fullPathForDatabase(d->origin.get(), d->name, false);
+}
+
+/*!
+ Returns the databases's security origin.
+*/
+QWebSecurityOrigin QWebDatabase::origin() const
+{
+ QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(d->origin.get());
+ QWebSecurityOrigin origin(priv);
+ return origin;
+}
+
+/*!
+ Removes the database, \a db, from its security origin. All data stored in this database
+ will be destroyed.
+*/
+void QWebDatabase::removeDatabase(const QWebDatabase &db)
+{
+ DatabaseTracker::tracker().deleteDatabase(db.d->origin.get(), db.d->name);
+}
+
+/*!
+ Destroys the web database object. The data within this database is \b not destroyed.
+*/
+QWebDatabase::~QWebDatabase()
+{
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
new file mode 100644
index 0000000..f4c368a
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef _WEBDATABASE_H_
+#define _WEBDATABASE_H_
+
+#include <QtCore/qstring.h>
+#include <QtCore/qshareddata.h>
+
+#include "qwebkitglobal.h"
+
+namespace WebCore {
+ class DatabaseDetails;
+};
+
+class QWebDatabasePrivate;
+class QWebSecurityOrigin;
+
+class QWEBKIT_EXPORT QWebDatabase
+{
+public:
+ QWebDatabase(const QWebDatabase& other);
+ QWebDatabase &operator=(const QWebDatabase& other);
+ ~QWebDatabase();
+
+ QString name() const;
+ QString displayName() const;
+ qint64 expectedSize() const;
+ qint64 size() const;
+ QString fileName() const;
+ QWebSecurityOrigin origin() const;
+
+ static void removeDatabase(const QWebDatabase &db);
+
+private:
+ QWebDatabase(QWebDatabasePrivate* priv);
+ friend class QWebSecurityOrigin;
+
+private:
+ QExplicitlySharedDataPointer<QWebDatabasePrivate> d;
+};
+
+#endif
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h
new file mode 100644
index 0000000..988fb16
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h
@@ -0,0 +1,38 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef _WEBDATABASE_P_H_
+#define _WEBDATABASE_P_H_
+
+#include <QString>
+#include <QtCore/qshareddata.h>
+
+#include "PlatformString.h"
+#include "SecurityOrigin.h"
+#include "RefPtr.h"
+
+
+class QWebDatabasePrivate : public QSharedData
+{
+public:
+ WebCore::String name;
+ WTF::RefPtr<WebCore::SecurityOrigin> origin;
+};
+
+#endif
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
new file mode 100644
index 0000000..ae71356
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -0,0 +1,1311 @@
+/*
+ Copyright (C) 2008,2009 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2007 Staikos Computing Services Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebframe.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include "qwebframe_p.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
+
+#include "DocumentLoader.h"
+#include "FocusController.h"
+#include "FrameLoaderClientQt.h"
+#include "Frame.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "IconDatabase.h"
+#include "InspectorController.h"
+#include "Page.h"
+#include "PutPropertySlot.h"
+#include "ResourceRequest.h"
+#include "RenderView.h"
+#include "SelectionController.h"
+#include "Scrollbar.h"
+#include "PrintContext.h"
+#include "SubstituteData.h"
+
+#include "markup.h"
+#include "RenderTreeAsText.h"
+#include "Element.h"
+#include "Document.h"
+#include "DragData.h"
+#include "RenderView.h"
+#include "GraphicsContext.h"
+#include "PlatformMouseEvent.h"
+#include "PlatformWheelEvent.h"
+#include "GraphicsContext.h"
+#include "HitTestResult.h"
+
+#include "CallFrame.h"
+#include "JSDOMBinding.h"
+#include "JSDOMWindow.h"
+#include "JSLock.h"
+#include "JSObject.h"
+#include "qt_instance.h"
+#include "qt_runtime.h"
+#include "runtime.h"
+#include "runtime_object.h"
+#include "runtime_root.h"
+#include "ScriptController.h"
+#include "ScriptSourceCode.h"
+#include "ScriptValue.h"
+
+#include "wtf/HashMap.h"
+
+#include <qdebug.h>
+#include <qevent.h>
+#include <qfileinfo.h>
+#include <qpainter.h>
+#include <QMultiMap>
+#if QT_VERSION >= 0x040400
+#include <qnetworkrequest.h>
+#else
+#include "qwebnetworkinterface.h"
+#endif
+#include <qregion.h>
+#include <qprinter.h>
+#include "HTMLMetaElement.h"
+#include "NodeList.h"
+
+using namespace WebCore;
+
+// from text/qfont.cpp
+QT_BEGIN_NAMESPACE
+extern Q_GUI_EXPORT int qt_defaultDpi();
+QT_END_NAMESPACE
+
+void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* qframe, bool enabled)
+{
+ Frame* frame = QWebFramePrivate::core(qframe);
+ InspectorController* controller = frame->page()->inspectorController();
+ if (!controller)
+ return;
+ if (enabled)
+ controller->enableProfiler();
+ else
+ controller->disableProfiler();
+}
+
+void QWebFramePrivate::init(QWebFrame *qframe, WebCore::Page *webcorePage, QWebFrameData *frameData)
+{
+ q = qframe;
+
+ allowsScrolling = frameData->allowsScrolling;
+ marginWidth = frameData->marginWidth;
+ marginHeight = frameData->marginHeight;
+
+ frameLoaderClient = new FrameLoaderClientQt();
+ RefPtr<Frame> newFrame = Frame::create(webcorePage, frameData->ownerElement, frameLoaderClient);
+ frame = newFrame.get();
+ frameLoaderClient->setFrame(qframe, frame);
+
+ // FIXME: All of the below should probably be moved over into WebCore
+ frame->tree()->setName(frameData->name);
+ if (QWebFrame* _parentFrame = parentFrame())
+ QWebFramePrivate::core(_parentFrame)->tree()->appendChild(frame);
+
+ // balanced by adoptRef in FrameLoaderClientQt::createFrame
+ if (frameData->ownerElement)
+ frame->ref();
+
+ frame->init();
+}
+
+WebCore::Scrollbar* QWebFramePrivate::horizontalScrollBar() const
+{
+ if (!frame->view())
+ return 0;
+ return frame->view()->horizontalScrollbar();
+}
+
+WebCore::Scrollbar* QWebFramePrivate::verticalScrollBar() const
+{
+ if (!frame->view())
+ return 0;
+ return frame->view()->verticalScrollbar();
+}
+
+/*!
+ \class QWebFrame
+ \since 4.4
+ \brief The QWebFrame class represents a frame in a web page.
+
+ QWebFrame represents a frame inside a web page. Each QWebPage
+ object contains at least one frame, the main frame, obtained using
+ QWebPage::mainFrame(). Additional frames will be created for HTML
+ \c{<frame>} or \c{<iframe>} elements.
+
+ A frame can be loaded using load() or setUrl(). Alternatively, if you have
+ the HTML content readily available, you can use setHtml() instead.
+
+ The page() function returns a pointer to the web page object. See
+ \l{Elements of QWebView} for an explanation of how web
+ frames are related to a web page and web view.
+
+ The title of an HTML frame can be accessed with the title() property.
+ Additionally, a frame may also specify an icon, which can be accessed
+ using the icon() property. If the title or the icon changes, the
+ corresponding titleChanged() and iconChanged() signals will be emitted.
+ The zoomFactor() property can be used to change the overall size
+ of the content displayed in the frame.
+
+ QWebFrame objects are created and controlled by the web page. You
+ can connect to the web page's \l{QWebPage::}{frameCreated()} signal
+ to be notified when a new frame is created.
+
+ The hitTestContent() function can be used to programmatically examine the
+ contents of a frame.
+
+ A QWebFrame can be printed onto a QPrinter using the print() function.
+ This function is marked as a slot and can be conveniently connected to
+ \l{QPrintPreviewDialog}'s \l{QPrintPreviewDialog::}{paintRequested()}
+ signal.
+
+ \sa QWebPage
+*/
+
+QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData)
+ : QObject(parent)
+ , d(new QWebFramePrivate)
+{
+ d->page = parent;
+ d->init(this, parent->d->page, frameData);
+
+ if (!frameData->url.isEmpty()) {
+ WebCore::ResourceRequest request(frameData->url, frameData->referrer);
+ d->frame->loader()->load(request, frameData->name);
+ }
+}
+
+QWebFrame::QWebFrame(QWebFrame *parent, QWebFrameData *frameData)
+ : QObject(parent)
+ , d(new QWebFramePrivate)
+{
+ d->page = parent->d->page;
+ d->init(this, parent->d->page->d->page, frameData);
+}
+
+QWebFrame::~QWebFrame()
+{
+ if (d->frame && d->frame->loader() && d->frame->loader()->client())
+ static_cast<FrameLoaderClientQt*>(d->frame->loader()->client())->m_webFrame = 0;
+
+ delete d;
+}
+
+/*!
+ Make \a object available under \a name from within the frame's JavaScript
+ context. The \a object will be inserted as a child of the frame's window
+ object.
+
+ Qt properties will be exposed as JavaScript properties and slots as
+ JavaScript methods.
+
+ If you want to ensure that your QObjects remain accessible after loading a
+ new URL, you should add them in a slot connected to the
+ javaScriptWindowObjectCleared() signal.
+
+ The \a object will never be explicitly deleted by QtWebKit.
+*/
+void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object)
+{
+ addToJavaScriptWindowObject(name, object, QScriptEngine::QtOwnership);
+}
+
+/*!
+ \fn void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership own)
+ \overload
+
+ Make \a object available under \a name from within the frame's JavaScript
+ context. The \a object will be inserted as a child of the frame's window
+ object.
+
+ Qt properties will be exposed as JavaScript properties and slots as
+ JavaScript methods.
+
+ If you want to ensure that your QObjects remain accessible after loading a
+ new URL, you should add them in a slot connected to the
+ javaScriptWindowObjectCleared() signal.
+
+ The ownership of \a object is specified using \a own.
+*/
+void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership)
+{
+ JSC::JSLock lock(false);
+ JSDOMWindow* window = toJSDOMWindow(d->frame);
+ JSC::Bindings::RootObject* root = d->frame->script()->bindingRootObject();
+ if (!window) {
+ qDebug() << "Warning: couldn't get window object";
+ return;
+ }
+
+ JSC::ExecState* exec = window->globalExec();
+
+ JSC::JSObject*runtimeObject =
+ JSC::Bindings::Instance::createRuntimeObject(exec, JSC::Bindings::QtInstance::getQtInstance(object, root, ownership));
+
+ JSC::PutPropertySlot slot;
+ window->put(exec, JSC::Identifier(exec, (const UChar *) name.constData(), name.length()), runtimeObject, slot);
+}
+
+/*!
+ Returns the frame's content, converted to HTML.
+
+ \sa setHtml(), toPlainText()
+*/
+QString QWebFrame::toHtml() const
+{
+ if (!d->frame->document())
+ return QString();
+ return createMarkup(d->frame->document());
+}
+
+/*!
+ Returns the content of this frame converted to plain text.
+
+ \sa toHtml()
+*/
+QString QWebFrame::toPlainText() const
+{
+ if (d->frame->view() && d->frame->view()->layoutPending())
+ d->frame->view()->layout();
+
+ Element *documentElement = d->frame->document()->documentElement();
+ return documentElement->innerText();
+}
+
+/*!
+ Returns a dump of the rendering tree. This is mainly useful for debugging
+ html.
+*/
+QString QWebFrame::renderTreeDump() const
+{
+ if (d->frame->view() && d->frame->view()->layoutPending())
+ d->frame->view()->layout();
+
+ return externalRepresentation(d->frame->contentRenderer());
+}
+
+/*!
+ \property QWebFrame::title
+ \brief the title of the frame as defined by the HTML &lt;title&gt; element
+
+ \sa titleChanged()
+*/
+
+QString QWebFrame::title() const
+{
+ if (d->frame->document())
+ return d->frame->loader()->documentLoader()->title();
+ else return QString();
+}
+
+/*!
+ \since 4.5
+ \brief Returns the meta data in this frame as a QMultiMap
+
+ The meta data consists of the name and content attributes of the
+ of the \c{<meta>} tags in the HTML document.
+
+ For example:
+
+ \code
+ <html>
+ <head>
+ <meta name="description" content="This document is a tutorial about Qt development">
+ <meta name="keywords" content="Qt, WebKit, Programming">
+ </head>
+ ...
+ </html>
+ \endcode
+
+ Given the above HTML code the metaData() function will return a map with two entries:
+ \table
+ \header \o Key
+ \o Value
+ \row \o "description"
+ \o "This document is a tutorial about Qt development"
+ \row \o "keywords"
+ \o "Qt, WebKit, Programming"
+ \endtable
+
+ This function returns a multi map to support multiple meta tags with the same attribute name.
+*/
+QMultiMap<QString, QString> QWebFrame::metaData() const
+{
+ if(!d->frame->document())
+ return QMap<QString,QString>();
+
+ QMultiMap<QString,QString> map;
+ Document* doc = d->frame->document();
+ RefPtr<NodeList> list = doc->getElementsByTagName("meta");
+ unsigned len = list->length();
+ for (unsigned i = 0; i < len; i++) {
+ HTMLMetaElement* meta = static_cast<HTMLMetaElement*>(list->item(i));
+ map.insert(meta->name(), meta->content());
+ }
+ return map;
+}
+
+static inline QUrl ensureAbsoluteUrl(const QUrl &url)
+{
+ if (!url.isRelative())
+ return url;
+
+ return QUrl::fromLocalFile(QFileInfo(url.toLocalFile()).absoluteFilePath());
+}
+
+/*!
+ \property QWebFrame::url
+ \brief the url of the frame currently viewed
+
+ \sa urlChanged()
+*/
+
+void QWebFrame::setUrl(const QUrl &url)
+{
+ d->frame->loader()->begin(ensureAbsoluteUrl(url));
+ d->frame->loader()->end();
+ load(ensureAbsoluteUrl(url));
+}
+
+QUrl QWebFrame::url() const
+{
+ return d->frame->loader()->url();
+}
+
+/*!
+ \property QWebFrame::icon
+ \brief the icon associated with this frame
+
+ \sa iconChanged(), QWebSettings::iconForUrl()
+*/
+
+QIcon QWebFrame::icon() const
+{
+ return QWebSettings::iconForUrl(d->frame->loader()->url());
+}
+
+/*!
+ The name of this frame as defined by the parent frame.
+*/
+QString QWebFrame::frameName() const
+{
+ return d->frame->tree()->name();
+}
+
+/*!
+ The web page that contains this frame.
+*/
+QWebPage *QWebFrame::page() const
+{
+ return d->page;
+}
+
+/*!
+ Loads \a url into this frame.
+
+ \note The view remains the same until enough data has arrived to display the new \a url.
+
+ \sa setUrl(), setHtml(), setContent()
+*/
+void QWebFrame::load(const QUrl &url)
+{
+#if QT_VERSION < 0x040400
+ load(QWebNetworkRequest(ensureAbsoluteUrl(url)));
+#else
+ load(QNetworkRequest(ensureAbsoluteUrl(url)));
+#endif
+}
+
+#if QT_VERSION < 0x040400
+/*!
+ Loads a network request, \a req, into this frame.
+
+ \note The view remains the same until enough data has arrived to display the new url.
+*/
+void QWebFrame::load(const QWebNetworkRequest &req)
+{
+ if (d->parentFrame())
+ d->page->d->insideOpenCall = true;
+
+ QUrl url = ensureAbsoluteUrl(req.url());
+ QHttpRequestHeader httpHeader = req.httpHeader();
+ QByteArray postData = req.postData();
+
+ WebCore::ResourceRequest request(url);
+
+ QString method = httpHeader.method();
+ if (!method.isEmpty())
+ request.setHTTPMethod(method);
+
+ QList<QPair<QString, QString> > values = httpHeader.values();
+ for (int i = 0; i < values.size(); ++i) {
+ const QPair<QString, QString> &val = values.at(i);
+ request.addHTTPHeaderField(val.first, val.second);
+ }
+
+ if (!postData.isEmpty())
+ request.setHTTPBody(WebCore::FormData::create(postData.constData(), postData.size()));
+
+ d->frame->loader()->load(request);
+
+ if (d->parentFrame())
+ d->page->d->insideOpenCall = false;
+}
+
+#else
+
+/*!
+ Loads a network request, \a req, into this frame, using the method specified in \a
+ operation.
+
+ \a body is optional and is only used for POST operations.
+
+ \note The view remains the same until enough data has arrived to display the new \a url.
+
+ \sa setUrl()
+*/
+void QWebFrame::load(const QNetworkRequest &req,
+ QNetworkAccessManager::Operation operation,
+ const QByteArray &body)
+{
+ if (d->parentFrame())
+ d->page->d->insideOpenCall = true;
+
+ QUrl url = ensureAbsoluteUrl(req.url());
+
+ WebCore::ResourceRequest request(url);
+
+ switch (operation) {
+ case QNetworkAccessManager::HeadOperation:
+ request.setHTTPMethod("HEAD");
+ break;
+ case QNetworkAccessManager::GetOperation:
+ request.setHTTPMethod("GET");
+ break;
+ case QNetworkAccessManager::PutOperation:
+ request.setHTTPMethod("PUT");
+ break;
+ case QNetworkAccessManager::PostOperation:
+ request.setHTTPMethod("POST");
+ break;
+ case QNetworkAccessManager::UnknownOperation:
+ // eh?
+ break;
+ }
+
+ QList<QByteArray> httpHeaders = req.rawHeaderList();
+ for (int i = 0; i < httpHeaders.size(); ++i) {
+ const QByteArray &headerName = httpHeaders.at(i);
+ request.addHTTPHeaderField(QString::fromLatin1(headerName), QString::fromLatin1(req.rawHeader(headerName)));
+ }
+
+ if (!body.isEmpty())
+ request.setHTTPBody(WebCore::FormData::create(body.constData(), body.size()));
+
+ d->frame->loader()->load(request);
+
+ if (d->parentFrame())
+ d->page->d->insideOpenCall = false;
+}
+#endif
+
+/*!
+ Sets the content of this frame to \a html. \a baseUrl is optional and used to resolve relative
+ URLs in the document, such as referenced images or stylesheets.
+
+ When using this method WebKit assumes that external resources such as JavaScript programs or style
+ sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external
+ script can be specified through the charset attribute of the HTML script tag. It is also possible
+ for the encoding to be specified by web server.
+
+ \sa toHtml()
+*/
+void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
+{
+ KURL kurl(baseUrl);
+ WebCore::ResourceRequest request(kurl);
+ const QByteArray utf8 = html.toUtf8();
+ WTF::RefPtr<WebCore::SharedBuffer> data = WebCore::SharedBuffer::create(utf8.constData(), utf8.length());
+ WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), kurl);
+ d->frame->loader()->load(request, substituteData);
+}
+
+/*!
+ Sets the content of this frame to the specified content \a data. If the \a mimeType argument
+ is empty it is currently assumed that the content is HTML but in future versions we may introduce
+ auto-detection.
+
+ External objects referenced in the content are located relative to \a baseUrl.
+
+ \sa toHtml()
+*/
+void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
+{
+ KURL kurl(baseUrl);
+ WebCore::ResourceRequest request(kurl);
+ WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(data.constData(), data.length());
+ QString actualMimeType = mimeType;
+ if (actualMimeType.isEmpty())
+ actualMimeType = QLatin1String("text/html");
+ WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), kurl);
+ d->frame->loader()->load(request, substituteData);
+}
+
+
+/*!
+ Returns the parent frame of this frame, or 0 if the frame is the web pages
+ main frame.
+
+ This is equivalent to qobject_cast<QWebFrame*>(frame->parent()).
+
+ \sa childFrames()
+*/
+QWebFrame *QWebFrame::parentFrame() const
+{
+ return d->parentFrame();
+}
+
+/*!
+ Returns a list of all frames that are direct children of this frame.
+
+ \sa parentFrame()
+*/
+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()) {
+ FrameLoader *loader = child->loader();
+ FrameLoaderClientQt *client = static_cast<FrameLoaderClientQt*>(loader->client());
+ if (client)
+ rc.append(client->webFrame());
+ }
+
+ }
+ return rc;
+}
+
+/*!
+ Returns the scrollbar policy for the scrollbar defined by \a orientation.
+*/
+Qt::ScrollBarPolicy QWebFrame::scrollBarPolicy(Qt::Orientation orientation) const
+{
+ if (orientation == Qt::Horizontal)
+ return d->horizontalScrollBarPolicy;
+ return d->verticalScrollBarPolicy;
+}
+
+/*!
+ Sets the scrollbar policy for the scrollbar defined by \a orientation to \a policy.
+*/
+void QWebFrame::setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPolicy policy)
+{
+ Q_ASSERT((int)ScrollbarAuto == (int)Qt::ScrollBarAsNeeded);
+ Q_ASSERT((int)ScrollbarAlwaysOff == (int)Qt::ScrollBarAlwaysOff);
+ Q_ASSERT((int)ScrollbarAlwaysOn == (int)Qt::ScrollBarAlwaysOn);
+
+ if (orientation == Qt::Horizontal) {
+ d->horizontalScrollBarPolicy = policy;
+ if (d->frame->view()) {
+ d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
+ d->frame->view()->updateDefaultScrollbarState();
+ }
+ } else {
+ d->verticalScrollBarPolicy = policy;
+ if (d->frame->view()) {
+ d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
+ d->frame->view()->updateDefaultScrollbarState();
+ }
+ }
+}
+
+/*!
+ Sets the current \a value for the scrollbar with orientation \a orientation.
+
+ The scrollbar forces the \a value to be within the legal range: minimum <= value <= maximum.
+
+ Changing the value also updates the thumb position.
+
+ \sa scrollBarMinimum(), scrollBarMaximum()
+*/
+void QWebFrame::setScrollBarValue(Qt::Orientation orientation, int value)
+{
+ Scrollbar *sb;
+ sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar();
+ if (sb) {
+ if (value < 0)
+ value = 0;
+ else if (value > scrollBarMaximum(orientation))
+ value = scrollBarMaximum(orientation);
+ sb->setValue(value);
+ }
+}
+
+/*!
+ Returns the current value for the scrollbar with orientation \a orientation, or 0
+ if no scrollbar is found for \a orientation.
+
+ \sa scrollBarMinimum(), scrollBarMaximum()
+*/
+int QWebFrame::scrollBarValue(Qt::Orientation orientation) const
+{
+ Scrollbar *sb;
+ sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar();
+ if (sb) {
+ return sb->value();
+ }
+ return 0;
+}
+
+/*!
+ Returns the maximum value for the scrollbar with orientation \a orientation, or 0
+ if no scrollbar is found for \a orientation.
+
+ \sa scrollBarMinimum()
+*/
+int QWebFrame::scrollBarMaximum(Qt::Orientation orientation) const
+{
+ Scrollbar *sb;
+ sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar();
+ if (sb)
+ return sb->maximum();
+ return 0;
+}
+
+/*!
+ Returns the minimum value for the scrollbar with orientation \a orientation.
+
+ The minimum value is always 0.
+
+ \sa scrollBarMaximum()
+*/
+int QWebFrame::scrollBarMinimum(Qt::Orientation orientation) const
+{
+ return 0;
+}
+
+/*!
+ \since 4.5
+ Scrolls the frame \a dx pixels to the right and \a dy pixels downward. Both
+ \a dx and \a dy may be negative.
+
+ \sa QWebFrame::scrollPosition
+*/
+
+void QWebFrame::scroll(int dx, int dy)
+{
+ if (!d->frame->view())
+ return;
+
+ d->frame->view()->scrollBy(IntSize(dx, dy));
+}
+
+/*!
+ \property QWebFrame::scrollPosition
+ \since 4.5
+ \brief the position the frame is currently scrolled to.
+*/
+
+QPoint QWebFrame::scrollPosition() const
+{
+ if (!d->frame->view())
+ return QPoint(0,0);
+
+ IntSize ofs = d->frame->view()->scrollOffset();
+ return QPoint(ofs.width(), ofs.height());
+}
+
+void QWebFrame::setScrollPosition(const QPoint &pos)
+{
+ QPoint current = scrollPosition();
+ int dx = pos.x() - current.x();
+ int dy = pos.y() - current.y();
+ scroll(dx, dy);
+}
+
+/*!
+ Render the frame into \a painter clipping to \a clip.
+
+ \sa print()
+*/
+void QWebFrame::render(QPainter *painter, const QRegion &clip)
+{
+ if (!d->frame->view() || !d->frame->contentRenderer())
+ return;
+
+ d->frame->view()->layoutIfNeededRecursive();
+
+ GraphicsContext ctx(painter);
+ QVector<QRect> vector = clip.rects();
+ WebCore::FrameView* view = d->frame->view();
+ for (int i = 0; i < vector.size(); ++i) {
+ if (i > 0) {
+ painter->save();
+ painter->setClipRect(vector.at(i), Qt::IntersectClip);
+ }
+
+ view->paint(&ctx, vector.at(i));
+
+ if (i > 0)
+ painter->restore();
+ }
+}
+
+/*!
+ Render the frame into \a painter.
+*/
+void QWebFrame::render(QPainter *painter)
+{
+ if (!d->frame->view() || !d->frame->contentRenderer())
+ return;
+
+ d->frame->view()->layoutIfNeededRecursive();
+
+ GraphicsContext ctx(painter);
+ WebCore::FrameView* view = d->frame->view();
+ view->paint(&ctx, view->frameRect());
+}
+
+/*!
+ \property QWebFrame::textSizeMultiplier
+ \brief the scaling factor for all text in the frame
+ \obsolete
+
+ Use setZoomFactor instead, in combination with the ZoomTextOnly attribute in
+ QWebSettings.
+
+ \note Setting this property also enables the ZoomTextOnly attribute in
+ QWebSettings.
+*/
+
+/*!
+ Sets the value of the multiplier used to scale the text in a Web frame to
+ the \a factor specified.
+*/
+void QWebFrame::setTextSizeMultiplier(qreal factor)
+{
+ d->frame->setZoomFactor(factor, /*isTextOnly*/true);
+}
+
+/*!
+ Returns the value of the multiplier used to scale the text in a Web frame.
+*/
+qreal QWebFrame::textSizeMultiplier() const
+{
+ return d->frame->zoomFactor();
+}
+
+/*!
+ \property QWebFrame::zoomFactor
+ \since 4.5
+ \brief the zoom factor for the frame
+*/
+
+void QWebFrame::setZoomFactor(qreal factor)
+{
+ d->frame->setZoomFactor(factor, d->frame->isZoomFactorTextOnly());
+}
+
+qreal QWebFrame::zoomFactor() const
+{
+ return d->frame->zoomFactor();
+}
+
+/*!
+ Returns the position of the frame relative to it's parent frame.
+*/
+QPoint QWebFrame::pos() const
+{
+ if (!d->frame->view())
+ return QPoint();
+
+ return d->frame->view()->frameRect().topLeft();
+}
+
+/*!
+ Return the geometry of the frame relative to it's parent frame.
+*/
+QRect QWebFrame::geometry() const
+{
+ if (!d->frame->view())
+ return QRect();
+ return d->frame->view()->frameRect();
+}
+
+/*!
+ \property QWebFrame::contentsSize
+ \brief the size of the contents in this frame
+*/
+QSize QWebFrame::contentsSize() const
+{
+ FrameView *view = d->frame->view();
+ if (!view)
+ return QSize();
+ return QSize(view->contentsWidth(), view->contentsHeight());
+}
+
+/*!
+ Performs a hit test on the frame contents at the given position \a pos and returns the hit test result.
+*/
+QWebHitTestResult QWebFrame::hitTestContent(const QPoint &pos) const
+{
+ if (!d->frame->view() || !d->frame->contentRenderer())
+ return QWebHitTestResult();
+
+ HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false);
+ return QWebHitTestResult(new QWebHitTestResultPrivate(result));
+}
+
+/*! \reimp
+*/
+bool QWebFrame::event(QEvent *e)
+{
+ return QObject::event(e);
+}
+
+#ifndef QT_NO_PRINTER
+/*!
+ Prints the frame to the given \a printer.
+
+ \sa render()
+*/
+void QWebFrame::print(QPrinter *printer) const
+{
+ QPainter painter;
+ if (!painter.begin(printer))
+ return;
+
+ const qreal zoomFactorX = printer->logicalDpiX() / qt_defaultDpi();
+ const qreal zoomFactorY = printer->logicalDpiY() / qt_defaultDpi();
+
+ PrintContext printContext(d->frame);
+ float pageHeight = 0;
+
+ QRect qprinterRect = printer->pageRect();
+
+ IntRect pageRect(0, 0,
+ int(qprinterRect.width() / zoomFactorX),
+ int(qprinterRect.height() / zoomFactorY));
+
+ printContext.begin(pageRect.width());
+
+ printContext.computePageRects(pageRect, /*headerHeight*/0, /*footerHeight*/0, /*userScaleFactor*/1.0, pageHeight);
+
+ int docCopies;
+ int pageCopies;
+ if (printer->collateCopies() == true){
+ docCopies = 1;
+ pageCopies = printer->numCopies();
+ } else {
+ docCopies = printer->numCopies();
+ pageCopies = 1;
+ }
+
+ int fromPage = printer->fromPage();
+ int toPage = printer->toPage();
+ bool ascending = true;
+
+ if (fromPage == 0 && toPage == 0) {
+ fromPage = 1;
+ toPage = printContext.pageCount();
+ }
+ // paranoia check
+ fromPage = qMax(1, fromPage);
+ toPage = qMin(printContext.pageCount(), toPage);
+
+ if (printer->pageOrder() == QPrinter::LastPageFirst) {
+ int tmp = fromPage;
+ fromPage = toPage;
+ toPage = tmp;
+ ascending = false;
+ }
+
+ painter.scale(zoomFactorX, zoomFactorY);
+ GraphicsContext ctx(&painter);
+
+ for (int i = 0; i < docCopies; ++i) {
+ int page = fromPage;
+ while (true) {
+ for (int j = 0; j < pageCopies; ++j) {
+ if (printer->printerState() == QPrinter::Aborted
+ || printer->printerState() == QPrinter::Error) {
+ printContext.end();
+ return;
+ }
+ printContext.spoolPage(ctx, page - 1, pageRect.width());
+ if (j < pageCopies - 1)
+ printer->newPage();
+ }
+
+ if (page == toPage)
+ break;
+
+ if (ascending)
+ ++page;
+ else
+ --page;
+
+ printer->newPage();
+ }
+
+ if ( i < docCopies - 1)
+ printer->newPage();
+ }
+
+ printContext.end();
+}
+#endif // QT_NO_PRINTER
+
+/*!
+ Evaluates the JavaScript defined by \a scriptSource using this frame as context
+ and returns the result of the last executed statement.
+
+ \sa addToJavaScriptWindowObject(), javaScriptWindowObjectCleared()
+*/
+QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
+{
+ ScriptController *proxy = d->frame->script();
+ QVariant rc;
+ if (proxy) {
+ JSC::JSValuePtr v = proxy->evaluate(ScriptSourceCode(scriptSource)).jsValue();
+ if (v) {
+ int distance = 0;
+ rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject()->globalExec(), v, QMetaType::Void, &distance);
+ }
+ }
+ return rc;
+}
+
+/*!
+ \since 4.5
+
+ Returns the frame's security origin.
+*/
+QWebSecurityOrigin QWebFrame::securityOrigin() const
+{
+ QWebFrame* that = const_cast<QWebFrame*>(this);
+ QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(QWebFramePrivate::core(that)->document()->securityOrigin());
+ return QWebSecurityOrigin(priv);
+}
+
+WebCore::Frame* QWebFramePrivate::core(QWebFrame* webFrame)
+{
+ return webFrame->d->frame;
+}
+
+QWebFrame* QWebFramePrivate::kit(WebCore::Frame* coreFrame)
+{
+ return static_cast<FrameLoaderClientQt*>(coreFrame->loader()->client())->webFrame();
+}
+
+
+/*!
+ \fn void QWebFrame::javaScriptWindowObjectCleared()
+
+ This signal is emitted whenever the global window object of the JavaScript
+ environment is cleared, e.g., before starting a new load.
+
+ If you intend to add QObjects to a QWebFrame using
+ addToJavaScriptWindowObject(), you should add them in a slot connected
+ to this signal. This ensures that your objects remain accessible when
+ loading new URLs.
+*/
+
+/*!
+ \fn void QWebFrame::provisionalLoad()
+ \internal
+*/
+
+/*!
+ \fn void QWebFrame::titleChanged(const QString &title)
+
+ This signal is emitted whenever the title of the frame changes.
+ The \a title string specifies the new title.
+
+ \sa title()
+*/
+
+/*!
+ \fn void QWebFrame::urlChanged(const QUrl &url)
+
+ This signal is emitted with the URL of the frame when the frame's title is
+ received. The new URL is specified by \a url.
+
+ \sa url()
+*/
+
+/*!
+ \fn void QWebFrame::initialLayoutCompleted()
+
+ This signal is emitted when the frame is laid out the first time.
+ This is the first time you will see contents displayed on the frame.
+
+ \note A frame can be laid out multiple times.
+*/
+
+/*!
+ \fn void QWebFrame::iconChanged()
+
+ This signal is emitted when the icon ("favicon") associated with the frame
+ has been loaded.
+
+ \sa icon()
+*/
+
+/*!
+ \class QWebHitTestResult
+ \since 4.4
+ \brief The QWebHitTestResult class provides information about the web
+ page content after a hit test.
+
+ QWebHitTestResult is returned by QWebFrame::hitTestContent() to provide
+ information about the content of the web page at the specified position.
+*/
+
+/*!
+ \internal
+*/
+QWebHitTestResult::QWebHitTestResult(QWebHitTestResultPrivate *priv)
+ : d(priv)
+{
+}
+
+QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest)
+ : isContentEditable(false)
+ , isContentSelected(false)
+{
+ if (!hitTest.innerNode())
+ return;
+ pos = hitTest.point();
+ boundingRect = hitTest.boundingBox();
+ title = hitTest.title();
+ linkText = hitTest.textContent();
+ linkUrl = hitTest.absoluteLinkURL();
+ linkTitle = hitTest.titleDisplayString();
+ alternateText = hitTest.altDisplayString();
+ imageUrl = hitTest.absoluteImageURL();
+ innerNonSharedNode = hitTest.innerNonSharedNode();
+ WebCore::Image *img = hitTest.image();
+ if (img) {
+ QPixmap *pix = img->nativeImageForCurrentFrame();
+ if (pix)
+ pixmap = *pix;
+ }
+ WebCore::Frame *wframe = hitTest.targetFrame();
+ if (wframe)
+ linkTargetFrame = QWebFramePrivate::kit(wframe);
+
+ isContentEditable = hitTest.isContentEditable();
+ isContentSelected = hitTest.isSelected();
+
+ if (innerNonSharedNode && innerNonSharedNode->document()
+ && innerNonSharedNode->document()->frame())
+ frame = QWebFramePrivate::kit(innerNonSharedNode->document()->frame());
+}
+
+/*!
+ Constructs a null hit test result.
+*/
+QWebHitTestResult::QWebHitTestResult()
+ : d(0)
+{
+}
+
+/*!
+ Constructs a hit test result from \a other.
+*/
+QWebHitTestResult::QWebHitTestResult(const QWebHitTestResult &other)
+ : d(0)
+{
+ if (other.d)
+ d = new QWebHitTestResultPrivate(*other.d);
+}
+
+/*!
+ Assigns the \a other hit test result to this.
+*/
+QWebHitTestResult &QWebHitTestResult::operator=(const QWebHitTestResult &other)
+{
+ if (this != &other) {
+ if (other.d) {
+ if (!d)
+ d = new QWebHitTestResultPrivate;
+ *d = *other.d;
+ } else {
+ delete d;
+ d = 0;
+ }
+ }
+ return *this;
+}
+
+/*!
+ Destructor.
+*/
+QWebHitTestResult::~QWebHitTestResult()
+{
+ delete d;
+}
+
+/*!
+ Returns true if the hit test result is null; otherwise returns false.
+*/
+bool QWebHitTestResult::isNull() const
+{
+ return !d;
+}
+
+/*!
+ Returns the position where the hit test occured.
+*/
+QPoint QWebHitTestResult::pos() const
+{
+ if (!d)
+ return QPoint();
+ return d->pos;
+}
+
+/*!
+ \since 4.5
+ Returns the bounding rect of the element.
+*/
+QRect QWebHitTestResult::boundingRect() const
+{
+ if (!d)
+ return QRect();
+ return d->boundingRect;
+}
+
+/*!
+ Returns the title of the nearest enclosing HTML element.
+*/
+QString QWebHitTestResult::title() const
+{
+ if (!d)
+ return QString();
+ return d->title;
+}
+
+/*!
+ Returns the text of the link.
+*/
+QString QWebHitTestResult::linkText() const
+{
+ if (!d)
+ return QString();
+ return d->linkText;
+}
+
+/*!
+ Returns the url to which the link points to.
+*/
+QUrl QWebHitTestResult::linkUrl() const
+{
+ if (!d)
+ return QUrl();
+ return d->linkUrl;
+}
+
+/*!
+ Returns the title of the link.
+*/
+QUrl QWebHitTestResult::linkTitle() const
+{
+ if (!d)
+ return QUrl();
+ return d->linkTitle;
+}
+
+/*!
+ Returns the frame that will load the link if it is activated.
+*/
+QWebFrame *QWebHitTestResult::linkTargetFrame() const
+{
+ if (!d)
+ return 0;
+ return d->linkTargetFrame;
+}
+
+/*!
+ Returns the alternate text of the element. This corresponds to the HTML alt attribute.
+*/
+QString QWebHitTestResult::alternateText() const
+{
+ if (!d)
+ return QString();
+ return d->alternateText;
+}
+
+/*!
+ Returns the url of the image.
+*/
+QUrl QWebHitTestResult::imageUrl() const
+{
+ if (!d)
+ return QUrl();
+ return d->imageUrl;
+}
+
+/*!
+ Returns a QPixmap containing the image. A null pixmap is returned if the
+ element being tested is not an image.
+*/
+QPixmap QWebHitTestResult::pixmap() const
+{
+ if (!d)
+ return QPixmap();
+ return d->pixmap;
+}
+
+/*!
+ Returns true if the content is editable by the user; otherwise returns false.
+*/
+bool QWebHitTestResult::isContentEditable() const
+{
+ if (!d)
+ return false;
+ return d->isContentEditable;
+}
+
+/*!
+ Returns true if the content tested is part of the selection; otherwise returns false.
+*/
+bool QWebHitTestResult::isContentSelected() const
+{
+ if (!d)
+ return false;
+ return d->isContentSelected;
+}
+
+/*!
+ Returns the frame the hit test was executed in.
+*/
+QWebFrame *QWebHitTestResult::frame() const
+{
+ if (!d)
+ return 0;
+ return d->frame;
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
new file mode 100644
index 0000000..18ae697
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -0,0 +1,204 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2007 Staikos Computing Services Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBFRAME_H
+#define QWEBFRAME_H
+
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qvariant.h>
+#include <QtGui/qicon.h>
+#include <QtScript/qscriptengine.h>
+#if QT_VERSION >= 0x040400
+#include <QtNetwork/qnetworkaccessmanager.h>
+#endif
+#include "qwebkitglobal.h"
+
+QT_BEGIN_NAMESPACE
+class QRect;
+class QPoint;
+class QPainter;
+class QPixmap;
+class QMouseEvent;
+class QWheelEvent;
+class QNetworkRequest;
+class QRegion;
+class QPrinter;
+QT_END_NAMESPACE
+
+class QWebNetworkRequest;
+class QWebFramePrivate;
+class QWebPage;
+class QWebHitTestResult;
+class QWebHistoryItem;
+class QWebSecurityOrigin;
+
+namespace WebCore {
+ class WidgetPrivate;
+ class FrameLoaderClientQt;
+ class ChromeClientQt;
+}
+class QWebFrameData;
+class QWebHitTestResultPrivate;
+class QWebFrame;
+
+class QWEBKIT_EXPORT QWebHitTestResult
+{
+public:
+ QWebHitTestResult();
+ QWebHitTestResult(const QWebHitTestResult &other);
+ QWebHitTestResult &operator=(const QWebHitTestResult &other);
+ ~QWebHitTestResult();
+
+ bool isNull() const;
+
+ QPoint pos() const;
+ QRect boundingRect() const;
+ QString title() const;
+
+ QString linkText() const;
+ QUrl linkUrl() const;
+ QUrl linkTitle() const;
+ QWebFrame *linkTargetFrame() const;
+
+ QString alternateText() const; // for img, area, input and applet
+
+ QUrl imageUrl() const;
+ QPixmap pixmap() const;
+
+ bool isContentEditable() const;
+ bool isContentSelected() const;
+
+ QWebFrame *frame() const;
+
+private:
+ QWebHitTestResult(QWebHitTestResultPrivate *priv);
+ QWebHitTestResultPrivate *d;
+
+ friend class QWebFrame;
+ friend class QWebPagePrivate;
+ friend class QWebPage;
+};
+
+class QWEBKIT_EXPORT QWebFrame : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
+ Q_PROPERTY(QString title READ title)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl)
+ Q_PROPERTY(QIcon icon READ icon)
+ Q_PROPERTY(QSize contentsSize READ contentsSize)
+ Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition)
+private:
+ QWebFrame(QWebPage *parent, QWebFrameData *frameData);
+ QWebFrame(QWebFrame *parent, QWebFrameData *frameData);
+ ~QWebFrame();
+
+public:
+ QWebPage *page() const;
+
+ void load(const QUrl &url);
+#if QT_VERSION < 0x040400
+ void load(const QWebNetworkRequest &request);
+#else
+ void load(const QNetworkRequest &request,
+ QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
+ const QByteArray &body = QByteArray());
+#endif
+ void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
+ void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
+
+ void addToJavaScriptWindowObject(const QString &name, QObject *object);
+ void addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership);
+ QString toHtml() const;
+ QString toPlainText() const;
+ QString renderTreeDump() const;
+
+ QString title() const;
+ void setUrl(const QUrl &url);
+ QUrl url() const;
+ QIcon icon() const;
+ QMultiMap<QString, QString> metaData() const;
+
+ QString frameName() const;
+
+ QWebFrame *parentFrame() const;
+ QList<QWebFrame*> childFrames() const;
+
+ Qt::ScrollBarPolicy scrollBarPolicy(Qt::Orientation orientation) const;
+ void setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPolicy policy);
+
+ void setScrollBarValue(Qt::Orientation orientation, int value);
+ int scrollBarValue(Qt::Orientation orientation) const;
+ int scrollBarMinimum(Qt::Orientation orientation) const;
+ int scrollBarMaximum(Qt::Orientation orientation) const;
+
+ void scroll(int, int);
+ QPoint scrollPosition() const;
+ void setScrollPosition(const QPoint &pos);
+
+ void render(QPainter *painter, const QRegion &clip);
+ void render(QPainter *painter);
+
+ void setTextSizeMultiplier(qreal factor);
+ qreal textSizeMultiplier() const;
+
+ qreal zoomFactor() const;
+ void setZoomFactor(qreal factor);
+
+ QPoint pos() const;
+ QRect geometry() const;
+ QSize contentsSize() const;
+
+ QWebHitTestResult hitTestContent(const QPoint &pos) const;
+
+ virtual bool event(QEvent *);
+
+ QWebSecurityOrigin securityOrigin() const;
+
+public Q_SLOTS:
+ QVariant evaluateJavaScript(const QString& scriptSource);
+#ifndef QT_NO_PRINTER
+ void print(QPrinter *printer) const;
+#endif
+
+Q_SIGNALS:
+ void javaScriptWindowObjectCleared();
+
+ void provisionalLoad();
+ void titleChanged(const QString &title);
+ void urlChanged(const QUrl &url);
+
+ void initialLayoutCompleted();
+
+ void iconChanged();
+
+private:
+ friend class QWebPage;
+ friend class QWebPagePrivate;
+ friend class QWebFramePrivate;
+ friend class WebCore::WidgetPrivate;
+ friend class WebCore::FrameLoaderClientQt;
+ friend class WebCore::ChromeClientQt;
+ QWebFramePrivate *d;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
new file mode 100644
index 0000000..14f69cd
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -0,0 +1,116 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2007 Staikos Computing Services Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBFRAME_P_H
+#define QWEBFRAME_P_H
+
+#include "qwebframe.h"
+#include "qwebpage_p.h"
+
+#include "EventHandler.h"
+#include "KURL.h"
+#include "PlatformString.h"
+#include "wtf/RefPtr.h"
+#include "Frame.h"
+
+namespace WebCore
+{
+ class FrameLoaderClientQt;
+ class FrameView;
+ class HTMLFrameOwnerElement;
+ class Scrollbar;
+}
+class QWebPage;
+
+
+class QWebFrameData
+{
+public:
+ WebCore::KURL url;
+ WebCore::String name;
+ WebCore::HTMLFrameOwnerElement* ownerElement;
+
+ WebCore::String referrer;
+ bool allowsScrolling;
+ int marginWidth;
+ int marginHeight;
+};
+
+class QWebFramePrivate
+{
+public:
+ QWebFramePrivate()
+ : q(0)
+ , horizontalScrollBarPolicy(Qt::ScrollBarAsNeeded)
+ , verticalScrollBarPolicy(Qt::ScrollBarAsNeeded)
+ , frameLoaderClient(0)
+ , frame(0)
+ , page(0)
+ , allowsScrolling(true)
+ , marginWidth(-1)
+ , marginHeight(-1)
+ {}
+ void init(QWebFrame *qframe, WebCore::Page *page,
+ QWebFrameData *frameData);
+
+ inline QWebFrame *parentFrame() { return qobject_cast<QWebFrame*>(q->parent()); }
+
+ WebCore::Scrollbar* horizontalScrollBar() const;
+ WebCore::Scrollbar* verticalScrollBar() const;
+
+ Qt::ScrollBarPolicy horizontalScrollBarPolicy;
+ Qt::ScrollBarPolicy verticalScrollBarPolicy;
+
+ static WebCore::Frame* core(QWebFrame*);
+ static QWebFrame* kit(WebCore::Frame*);
+
+ QWebFrame *q;
+ WebCore::FrameLoaderClientQt *frameLoaderClient;
+ WebCore::Frame *frame;
+ QWebPage *page;
+
+ bool allowsScrolling;
+ int marginWidth;
+ int marginHeight;
+};
+
+class QWebHitTestResultPrivate
+{
+public:
+ QWebHitTestResultPrivate() : isContentEditable(false), isContentSelected(false) {}
+ QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest);
+
+ QPoint pos;
+ QRect boundingRect;
+ QString title;
+ QString linkText;
+ QUrl linkUrl;
+ QString linkTitle;
+ QPointer<QWebFrame> linkTargetFrame;
+ QString alternateText;
+ QUrl imageUrl;
+ QPixmap pixmap;
+ bool isContentEditable;
+ bool isContentSelected;
+ QPointer<QWebFrame> frame;
+ RefPtr<WebCore::Node> innerNonSharedNode;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
new file mode 100644
index 0000000..07d027d
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
@@ -0,0 +1,443 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebhistory.h"
+#include "qwebhistory_p.h"
+
+#include "PlatformString.h"
+#include "Image.h"
+#include "KURL.h"
+#include "Page.h"
+#include "PageGroup.h"
+
+#include <QSharedData>
+
+/*!
+ \class QWebHistoryItem
+ \ingroup explicitly-shared
+ \since 4.4
+ \brief The QWebHistoryItem class represents one item in the history of a QWebPage
+
+ Each QWebHistoryItem instance represents an entry in the history stack of a Web page,
+ containing information about the page, its location, and when it was last visited.
+
+ The following table shows the properties of the page held by the history item, and
+ the functions used to access them.
+
+ \table
+ \header \o Function \o Description
+ \row \o title() \o The page title.
+ \row \o url() \o The location of the page.
+ \row \o originalUrl() \o The URL used to access the page.
+ \row \o lastVisited() \o The date and time of the user's last visit to the page.
+ \row \o icon() \o The icon associated with the page that was provided by the server.
+ \row \o userData() \o The user specific data that was stored with the history item.
+ \endtable
+
+ \note QWebHistoryItem objects are value based and \l{explicitly shared}.
+
+ \sa QWebHistory, QWebPage::history(), QWebHistoryInterface
+*/
+
+/*!
+ Constructs a history item from \a other.
+*/
+QWebHistoryItem::QWebHistoryItem(const QWebHistoryItem &other)
+ : d(other.d)
+{
+}
+
+/*!
+ Assigns the \a other history item to this.
+*/
+QWebHistoryItem &QWebHistoryItem::operator=(const QWebHistoryItem &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Destroys the history item.
+*/
+QWebHistoryItem::~QWebHistoryItem()
+{
+}
+
+/*!
+ Returns the original URL associated with the history item.
+
+ \sa url()
+*/
+QUrl QWebHistoryItem::originalUrl() const
+{
+ if (d->item)
+ return QUrl(d->item->originalURL().string());
+ return QUrl();
+}
+
+
+/*!
+ Returns the URL associated with the history item.
+
+ \sa originalUrl(), title(), lastVisited()
+*/
+QUrl QWebHistoryItem::url() const
+{
+ if (d->item)
+ return QUrl(d->item->url().string());
+ return QUrl();
+}
+
+
+/*!
+ Returns the title of the page associated with the history item.
+
+ \sa icon(), url(), lastVisited()
+*/
+QString QWebHistoryItem::title() const
+{
+ if (d->item)
+ return d->item->title();
+ return QString();
+}
+
+
+/*!
+ Returns the date and time that the page associated with the item was last visited.
+
+ \sa title(), icon(), url()
+*/
+QDateTime QWebHistoryItem::lastVisited() const
+{
+ //FIXME : this will be wrong unless we correctly set lastVisitedTime ourselves
+ if (d->item)
+ return QDateTime::fromTime_t((uint)d->item->lastVisitedTime());
+ return QDateTime();
+}
+
+
+/*!
+ Returns the icon associated with the history item.
+
+ \sa title(), url(), lastVisited()
+*/
+QIcon QWebHistoryItem::icon() const
+{
+ if (d->item)
+ return *d->item->icon()->nativeImageForCurrentFrame();
+ return QIcon();
+}
+
+/*!
+ \since 4.5
+ Returns the user specific data that was stored with the history item.
+
+ \sa setUserData()
+*/
+QVariant QWebHistoryItem::userData() const
+{
+ if (d->item)
+ return d->item->userData();
+ return QVariant();
+}
+
+/*!
+ \since 4.5
+
+ Stores user specific data \a userData with the history item.
+
+ \sa userData()
+*/
+void QWebHistoryItem::setUserData(const QVariant& userData)
+{
+ if (d->item)
+ d->item->setUserData(userData);
+}
+
+/*!*
+ \internal
+*/
+QWebHistoryItem::QWebHistoryItem(QWebHistoryItemPrivate *priv)
+{
+ d = priv;
+}
+
+/*!
+ \since 4.5
+ Returns whether this is a valid history item.
+*/
+bool QWebHistoryItem::isValid() const
+{
+ return d->item;
+}
+
+/*!
+ \class QWebHistory
+ \since 4.4
+ \brief The QWebHistory class represents the history of a QWebPage
+
+ Each QWebPage instance contains a history of visited pages that can be accessed
+ by QWebPage::history(). QWebHistory represents this history and makes it possible
+ to navigate it.
+
+ The history uses the concept of a \e{current item}, dividing the pages visited
+ into those that can be visited by navigating \e back and \e forward using the
+ back() and forward() functions. The current item can be obtained by calling
+ currentItem(), and an arbitrary item in the history can be made the current
+ item by passing it to goToItem().
+
+ A list of items describing the pages that can be visited by going back can be
+ obtained by calling the backItems() function; similarly, items describing the
+ pages ahead of the current page can be obtained with the forwardItems() function.
+ The total list of items is obtained with the items() function.
+
+ Just as with containers, functions are available to examine the history in terms
+ of a list. Arbitrary items in the history can be obtained with itemAt(), the total
+ number of items is given by count(), and the history can be cleared with the
+ clear() function.
+
+ \sa QWebHistoryItem, QWebHistoryInterface, QWebPage
+*/
+
+
+QWebHistory::QWebHistory()
+ : d(0)
+{
+}
+
+QWebHistory::~QWebHistory()
+{
+ delete d;
+}
+
+/*!
+ Clears the history.
+
+ \sa count(), items()
+*/
+void QWebHistory::clear()
+{
+ RefPtr<WebCore::HistoryItem> current = d->lst->currentItem();
+ int capacity = d->lst->capacity();
+ d->lst->setCapacity(0);
+
+ WebCore::Page* page = d->lst->page();
+ if (page && page->groupPtr())
+ page->groupPtr()->removeVisitedLinks();
+
+ d->lst->setCapacity(capacity);
+ d->lst->addItem(current.get());
+ d->lst->goToItem(current.get());
+}
+
+/*!
+ Returns a list of all items currently in the history.
+
+ \sa count(), clear()
+*/
+QList<QWebHistoryItem> QWebHistory::items() const
+{
+ const WebCore::HistoryItemVector &items = d->lst->entries();
+
+ QList<QWebHistoryItem> ret;
+ for (int i = 0; i < items.size(); ++i) {
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
+ ret.append(QWebHistoryItem(priv));
+ }
+ return ret;
+}
+
+/*!
+ Returns the list of items in the backwards history list.
+ At most \a maxItems entries are returned.
+
+ \sa forwardItems()
+*/
+QList<QWebHistoryItem> QWebHistory::backItems(int maxItems) const
+{
+ WebCore::HistoryItemVector items(maxItems);
+ d->lst->backListWithLimit(maxItems, items);
+
+ QList<QWebHistoryItem> ret;
+ for (int i = 0; i < items.size(); ++i) {
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
+ ret.append(QWebHistoryItem(priv));
+ }
+ return ret;
+}
+
+/*!
+ Returns the list of items in the forward history list.
+ At most \a maxItems entries are returned.
+
+ \sa backItems()
+*/
+QList<QWebHistoryItem> QWebHistory::forwardItems(int maxItems) const
+{
+ WebCore::HistoryItemVector items(maxItems);
+ d->lst->forwardListWithLimit(maxItems, items);
+
+ QList<QWebHistoryItem> ret;
+ for (int i = 0; i < items.size(); ++i) {
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
+ ret.append(QWebHistoryItem(priv));
+ }
+ return ret;
+}
+
+/*!
+ Returns true if there is an item preceding the current item in the history;
+ otherwise returns false.
+
+ \sa canGoForward()
+*/
+bool QWebHistory::canGoBack() const
+{
+ return d->lst->backListCount() > 0;
+}
+
+/*!
+ Returns true if we have an item to go forward to; otherwise returns false.
+
+ \sa canGoBack()
+*/
+bool QWebHistory::canGoForward() const
+{
+ return d->lst->forwardListCount() > 0;
+}
+
+/*!
+ Set the current item to be the previous item in the history and goes to the
+ corresponding page; i.e., goes back one history item.
+
+ \sa forward(), goToItem()
+*/
+void QWebHistory::back()
+{
+ d->lst->goBack();
+ WebCore::Page* page = d->lst->page();
+ page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+}
+
+/*!
+ Sets the current item to be the next item in the history and goes to the
+ corresponding page; i.e., goes forward one history item.
+
+ \sa back(), goToItem()
+*/
+void QWebHistory::forward()
+{
+ d->lst->goForward();
+ WebCore::Page* page = d->lst->page();
+ page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+}
+
+/*!
+ Sets the current item to be the specified \a item in the history and goes to the page.
+
+ \sa back(), forward()
+*/
+void QWebHistory::goToItem(const QWebHistoryItem &item)
+{
+ d->lst->goToItem(item.d->item);
+ WebCore::Page* page = d->lst->page();
+ page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+}
+
+/*!
+ Returns the item before the current item in the history.
+*/
+QWebHistoryItem QWebHistory::backItem() const
+{
+ WebCore::HistoryItem *i = d->lst->backItem();
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(i);
+ return QWebHistoryItem(priv);
+}
+
+/*!
+ Returns the current item in the history.
+*/
+QWebHistoryItem QWebHistory::currentItem() const
+{
+ WebCore::HistoryItem *i = d->lst->currentItem();
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(i);
+ return QWebHistoryItem(priv);
+}
+
+/*!
+ Returns the item after the current item in the history.
+*/
+QWebHistoryItem QWebHistory::forwardItem() const
+{
+ WebCore::HistoryItem *i = d->lst->forwardItem();
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(i);
+ return QWebHistoryItem(priv);
+}
+
+/*!
+ \since 4.5
+ Returns the index of the current item in history.
+*/
+int QWebHistory::currentItemIndex() const
+{
+ return d->lst->backListCount();
+}
+
+/*!
+ Returns the item at index \a i in the history.
+*/
+QWebHistoryItem QWebHistory::itemAt(int i) const
+{
+ WebCore::HistoryItem *item = d->lst->itemAtIndex(i);
+
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(item);
+ return QWebHistoryItem(priv);
+}
+
+/*!
+ Returns the total number of items in the history.
+*/
+int QWebHistory::count() const
+{
+ return d->lst->entries().size();
+}
+
+/*!
+ \since 4.5
+ Returns the maximum number of items in the history.
+
+ \sa setMaximumItemCount()
+*/
+int QWebHistory::maximumItemCount() const
+{
+ return d->lst->capacity();
+}
+
+/*!
+ \since 4.5
+ Sets the maximum number of items in the history to \a count.
+
+ \sa maximumItemCount()
+*/
+void QWebHistory::setMaximumItemCount(int count)
+{
+ d->lst->setCapacity(count);
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
new file mode 100644
index 0000000..c39077d
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
@@ -0,0 +1,107 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBHISTORY_H
+#define QWEBHISTORY_H
+
+#include <QtCore/qurl.h>
+#include <QtCore/qstring.h>
+#include <QtGui/qicon.h>
+#include <QtCore/qdatetime.h>
+#include <QtCore/qshareddata.h>
+
+#include "qwebkitglobal.h"
+
+class QWebPage;
+
+namespace WebCore {
+ class FrameLoaderClientQt;
+}
+
+class QWebHistoryItemPrivate;
+class QWEBKIT_EXPORT QWebHistoryItem
+{
+public:
+ QWebHistoryItem(const QWebHistoryItem &other);
+ QWebHistoryItem &operator=(const QWebHistoryItem &other);
+ ~QWebHistoryItem();
+
+ QUrl originalUrl() const;
+ QUrl url() const;
+
+ QString title() const;
+ QDateTime lastVisited() const;
+
+ QIcon icon() const;
+
+ QVariant userData() const;
+ void setUserData(const QVariant& userData);
+
+ bool isValid() const;
+
+private:
+ QWebHistoryItem(QWebHistoryItemPrivate *priv);
+ friend class QWebHistory;
+ friend class QWebPage;
+ friend class WebCore::FrameLoaderClientQt;
+ QExplicitlySharedDataPointer<QWebHistoryItemPrivate> d;
+};
+
+class QWebHistoryPrivate;
+class QWEBKIT_EXPORT QWebHistory
+{
+public:
+ void clear();
+
+ QList<QWebHistoryItem> items() const;
+ QList<QWebHistoryItem> backItems(int maxItems) const;
+ QList<QWebHistoryItem> forwardItems(int maxItems) const;
+
+ bool canGoBack() const;
+ bool canGoForward() const;
+
+ void back();
+ void forward();
+ void goToItem(const QWebHistoryItem &item);
+
+ QWebHistoryItem backItem() const;
+ QWebHistoryItem currentItem() const;
+ QWebHistoryItem forwardItem() const;
+ QWebHistoryItem itemAt(int i) const;
+
+ int currentItemIndex() const;
+
+ int count() const;
+
+ int maximumItemCount() const;
+ void setMaximumItemCount(int count);
+
+private:
+ QWebHistory();
+ ~QWebHistory();
+
+ friend class QWebPage;
+ friend class QWebPagePrivate;
+
+ Q_DISABLE_COPY(QWebHistory)
+
+ QWebHistoryPrivate *d;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
new file mode 100644
index 0000000..32e69fe
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBHISTORY_P_H
+#define QWEBHISTORY_P_H
+
+#include "BackForwardList.h"
+#include "HistoryItem.h"
+
+class QWebHistoryItemPrivate : public QSharedData
+{
+public:
+ QWebHistoryItemPrivate(WebCore::HistoryItem *i)
+ {
+ if (i)
+ i->ref();
+ item = i;
+ }
+ ~QWebHistoryItemPrivate()
+ {
+ if (item)
+ item->deref();
+ }
+ WebCore::HistoryItem *item;
+};
+
+class QWebHistoryPrivate : public QSharedData
+{
+public:
+ QWebHistoryPrivate(WebCore::BackForwardList *l)
+ {
+ l->ref();
+ lst = l;
+ }
+ ~QWebHistoryPrivate()
+ {
+ lst->deref();
+ }
+ WebCore::BackForwardList *lst;
+};
+
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
new file mode 100644
index 0000000..88a1aa3
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
@@ -0,0 +1,118 @@
+/*
+ Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ This class provides all functionality needed for tracking global history.
+*/
+
+#include "config.h"
+#include "qwebhistoryinterface.h"
+
+#include <QCoreApplication>
+
+#include "PageGroup.h"
+#include "PlatformString.h"
+
+
+static QWebHistoryInterface *default_interface;
+
+static bool gRoutineAdded;
+
+static void gCleanupInterface()
+{
+ if (default_interface && default_interface->parent() == 0)
+ delete default_interface;
+ default_interface = 0;
+}
+
+/*!
+ Sets a new default interface, \a defaultInterface, that will be used by all of WebKit
+ for managing history.
+
+ If an interface without a parent has already been set, the old interface will be deleted.
+ When the application exists QWebHistoryInterface will automatically delete the
+ \a defaultInterface if it does not have a parent.
+*/
+void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface *defaultInterface)
+{
+ if (default_interface == defaultInterface)
+ return;
+ if (default_interface && default_interface->parent() == 0)
+ delete default_interface;
+
+ default_interface = defaultInterface;
+ WebCore::PageGroup::removeAllVisitedLinks();
+
+ //### enable after the introduction of a version
+ //WebCore::PageGroup::setShouldTrackVisitedLinks(true);
+
+ if (!gRoutineAdded) {
+ qAddPostRoutine(gCleanupInterface);
+ gRoutineAdded = true;
+ }
+}
+
+/*!
+ Returns the default interface that will be used by WebKit. If no
+ default interface has been set, QtWebkit will not track history.
+*/
+QWebHistoryInterface *QWebHistoryInterface::defaultInterface()
+{
+ return default_interface;
+}
+
+/*!
+ \class QWebHistoryInterface
+ \since 4.4
+ \brief The QWebHistoryInterface class provides an interface to implement link history.
+
+ The QWebHistoryInterface is an interface that can be used to
+ implement link history. It contains two pure virtual methods that
+ are called by the WebKit engine. addHistoryEntry() is used to add
+ pages that have been visited to the interface, while
+ historyContains() is used to query whether this page has been
+ visited by the user.
+*/
+
+/*!
+ Constructs a new QWebHistoryInterface with parent \a parent.
+*/
+QWebHistoryInterface::QWebHistoryInterface(QObject *parent) : QObject(parent)
+{
+}
+
+/*!
+ Destructor. If this is currently the default interface it will be unset.
+*/
+QWebHistoryInterface::~QWebHistoryInterface()
+{
+ if (default_interface == this)
+ default_interface = 0;
+}
+
+/*!
+ \fn bool QWebHistoryInterface::historyContains(const QString &url) const = 0
+
+ Called by the WebKit engine to query whether a certain \a url has been visited by the user already.
+ Returns true if the \a url is part of the history of visited links; otherwise returns false.
+*/
+
+/*!
+ \fn void QWebHistoryInterface::addHistoryEntry(const QString &url) = 0
+
+ Called by WebKit to add another \a url to the list of visited pages.
+*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h
new file mode 100644
index 0000000..670fca0
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2007 Staikos Computing Services, Inc. <info@staikos.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ This class provides all functionality needed for tracking global history.
+*/
+
+#ifndef QWEBHISTORYINTERFACE_H
+#define QWEBHISTORYINTERFACE_H
+
+#include <QtCore/qobject.h>
+
+#include "qwebkitglobal.h"
+
+class QWEBKIT_EXPORT QWebHistoryInterface : public QObject
+{
+ Q_OBJECT
+public:
+ QWebHistoryInterface(QObject *parent = 0);
+ ~QWebHistoryInterface();
+
+ static void setDefaultInterface(QWebHistoryInterface *defaultInterface);
+ static QWebHistoryInterface *defaultInterface();
+
+ virtual bool historyContains(const QString &url) const = 0;
+ virtual void addHistoryEntry(const QString &url) = 0;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
new file mode 100644
index 0000000..19d9218
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBKITGLOBAL_H
+#define QWEBKITGLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(Q_OS_WIN)
+# if defined(QT_NODLL)
+# undef QT_MAKEDLL
+# undef QT_DLL
+# elif defined(QT_MAKEDLL) /* create a Qt DLL library */
+# if defined(QT_DLL)
+# undef QT_DLL
+# endif
+# if defined(BUILD_WEBKIT)
+# define QWEBKIT_EXPORT Q_DECL_EXPORT
+# else
+# define QWEBKIT_EXPORT Q_DECL_IMPORT
+# endif
+# elif defined(QT_DLL) /* use a Qt DLL library */
+# define QWEBKIT_EXPORT Q_DECL_IMPORT
+# endif
+#endif
+
+#if !defined(QWEBKIT_EXPORT)
+# if defined(QT_SHARED)
+# define QWEBKIT_EXPORT Q_DECL_EXPORT
+# else
+# define QWEBKIT_EXPORT
+# endif
+#endif
+
+#if QT_VERSION < 0x040400
+ #ifndef QT_BEGIN_NAMESPACE
+ #define QT_BEGIN_NAMESPACE
+ #endif
+
+ #ifndef QT_END_NAMESPACE
+ #define QT_END_NAMESPACE
+ #endif
+#endif
+
+
+#endif // QWEBKITGLOBAL_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
new file mode 100644
index 0000000..0e5b5da
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -0,0 +1,2752 @@
+/*
+ Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2007 Staikos Computing Services Inc.
+ Copyright (C) 2007 Apple Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebpage.h"
+#include "qwebview.h"
+#include "qwebframe.h"
+#include "qwebpage_p.h"
+#include "qwebframe_p.h"
+#include "qwebhistory.h"
+#include "qwebhistory_p.h"
+#include "qwebsettings.h"
+
+#include "Frame.h"
+#include "FrameTree.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClientQt.h"
+#include "FrameView.h"
+#include "ChromeClientQt.h"
+#include "ContextMenu.h"
+#include "ContextMenuClientQt.h"
+#include "DocumentLoader.h"
+#include "DragClientQt.h"
+#include "DragController.h"
+#include "DragData.h"
+#include "EditorClientQt.h"
+#include "Settings.h"
+#include "Page.h"
+#include "Pasteboard.h"
+#include "FrameLoader.h"
+#include "FrameLoadRequest.h"
+#include "KURL.h"
+#include "Logging.h"
+#include "Image.h"
+#include "InspectorClientQt.h"
+#include "InspectorController.h"
+#include "FocusController.h"
+#include "Editor.h"
+#include "Scrollbar.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformWheelEvent.h"
+#include "ProgressTracker.h"
+#include "RefPtr.h"
+#include "HashMap.h"
+#include "HitTestResult.h"
+#include "WindowFeatures.h"
+#include "LocalizedStrings.h"
+#include "runtime/InitializeThreading.h"
+
+#include <QApplication>
+#include <QBasicTimer>
+#include <QBitArray>
+#include <QDebug>
+#include <QDragEnterEvent>
+#include <QDragLeaveEvent>
+#include <QDragMoveEvent>
+#include <QDropEvent>
+#include <QFileDialog>
+#include <QHttpRequestHeader>
+#include <QInputDialog>
+#include <QLocale>
+#include <QMessageBox>
+#include <QNetworkProxy>
+#include <QUndoStack>
+#include <QUrl>
+#include <QPainter>
+#include <QClipboard>
+#include <QSslSocket>
+#include <QStyle>
+#include <QSysInfo>
+#if QT_VERSION >= 0x040400
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#else
+#include "qwebnetworkinterface.h"
+#endif
+
+using namespace WebCore;
+
+bool QWebPagePrivate::drtRun = false;
+void QWEBKIT_EXPORT qt_drt_run(bool b)
+{
+ QWebPagePrivate::drtRun = b;
+}
+
+void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName)
+{
+ page->handle()->page->setGroupName(groupName);
+}
+
+QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
+{
+ return page->handle()->page->groupName();
+}
+
+// Lookup table mapping QWebPage::WebActions to the associated Editor commands
+static const char* editorCommandWebActions[] =
+{
+ 0, // OpenLink,
+
+ 0, // OpenLinkInNewWindow,
+ 0, // OpenFrameInNewWindow,
+
+ 0, // DownloadLinkToDisk,
+ 0, // CopyLinkToClipboard,
+
+ 0, // OpenImageInNewWindow,
+ 0, // DownloadImageToDisk,
+ 0, // CopyImageToClipboard,
+
+ 0, // Back,
+ 0, // Forward,
+ 0, // Stop,
+ 0, // Reload,
+
+ "Cut", // Cut,
+ "Copy", // Copy,
+ "Paste", // Paste,
+
+ "Undo", // Undo,
+ "Redo", // Redo,
+ "MoveForward", // MoveToNextChar,
+ "MoveBackward", // MoveToPreviousChar,
+ "MoveWordForward", // MoveToNextWord,
+ "MoveWordBackward", // MoveToPreviousWord,
+ "MoveDown", // MoveToNextLine,
+ "MoveUp", // MoveToPreviousLine,
+ "MoveToBeginningOfLine", // MoveToStartOfLine,
+ "MoveToEndOfLine", // MoveToEndOfLine,
+ "MoveToBeginningOfParagraph", // MoveToStartOfBlock,
+ "MoveToEndOfParagraph", // MoveToEndOfBlock,
+ "MoveToBeginningOfDocument", // MoveToStartOfDocument,
+ "MoveToEndOfDocument", // MoveToEndOfDocument,
+ "MoveForwardAndModifySelection", // SelectNextChar,
+ "MoveBackwardAndModifySelection", // SelectPreviousChar,
+ "MoveWordForwardAndModifySelection", // SelectNextWord,
+ "MoveWordBackwardAndModifySelection", // SelectPreviousWord,
+ "MoveDownAndModifySelection", // SelectNextLine,
+ "MoveUpAndModifySelection", // SelectPreviousLine,
+ "MoveToBeginningOfLineAndModifySelection", // SelectStartOfLine,
+ "MoveToEndOfLineAndModifySelection", // SelectEndOfLine,
+ "MoveToBeginningOfParagraphAndModifySelection", // SelectStartOfBlock,
+ "MoveToEndOfParagraphAndModifySelection", // SelectEndOfBlock,
+ "MoveToBeginningOfDocumentAndModifySelection", //SelectStartOfDocument,
+ "MoveToEndOfDocumentAndModifySelection", // SelectEndOfDocument,
+ "DeleteWordBackward", // DeleteStartOfWord,
+ "DeleteWordForward", // DeleteEndOfWord,
+
+ 0, // SetTextDirectionDefault,
+ 0, // SetTextDirectionLeftToRight,
+ 0, // SetTextDirectionRightToLeft,
+
+ "ToggleBold", // ToggleBold,
+ "ToggleItalic", // ToggleItalic,
+ "ToggleUnderline", // ToggleUnderline,
+
+ 0, // InspectElement,
+
+ "InsertNewline", // InsertParagraphSeparator
+ "InsertLineBreak", // InsertLineSeparator
+
+ "SelectAll", // SelectAll
+
+ 0 // WebActionCount
+};
+
+// Lookup the appropriate editor command to use for WebAction \a action
+const char* QWebPagePrivate::editorCommandForWebActions(QWebPage::WebAction action)
+{
+ if ((action > QWebPage::NoWebAction) && (action < int(sizeof(editorCommandWebActions) / sizeof(const char*))))
+ return editorCommandWebActions[action];
+
+ return 0;
+}
+
+#ifndef QT_NO_CURSOR
+SetCursorEvent::SetCursorEvent(const QCursor& cursor)
+ : QEvent(static_cast<QEvent::Type>(EventType))
+ , m_cursor(cursor)
+{}
+
+QCursor SetCursorEvent::cursor() const
+{
+ return m_cursor;
+}
+#endif
+
+// If you change this make sure to also adjust the docs for QWebPage::userAgentForUrl
+#define WEBKIT_VERSION "527+"
+
+static inline DragOperation dropActionToDragOp(Qt::DropActions actions)
+{
+ unsigned result = 0;
+ if (actions & Qt::CopyAction)
+ result |= DragOperationCopy;
+ if (actions & Qt::MoveAction)
+ result |= DragOperationMove;
+ if (actions & Qt::LinkAction)
+ result |= DragOperationLink;
+ return (DragOperation)result;
+}
+
+static inline Qt::DropAction dragOpToDropAction(unsigned actions)
+{
+ Qt::DropAction result = Qt::IgnoreAction;
+ if (actions & DragOperationCopy)
+ result = Qt::CopyAction;
+ else if (actions & DragOperationMove)
+ result = Qt::MoveAction;
+ else if (actions & DragOperationLink)
+ result = Qt::LinkAction;
+ return result;
+}
+
+QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
+ : q(qq)
+ , view(0)
+ , viewportSize(QSize(0,0))
+{
+ WebCore::InitializeLoggingChannelsIfNecessary();
+ JSC::initializeThreading();
+ WebCore::FrameLoader::setLocalLoadPolicy(WebCore::FrameLoader::AllowLocalLoadsForLocalAndSubstituteData);
+
+ chromeClient = new ChromeClientQt(q);
+ contextMenuClient = new ContextMenuClientQt();
+ editorClient = new EditorClientQt(q);
+ page = new Page(chromeClient, contextMenuClient, editorClient,
+ new DragClientQt(q), new InspectorClientQt(q));
+
+ // ### should be configurable
+ page->settings()->setDefaultTextEncodingName("iso-8859-1");
+
+ settings = new QWebSettings(page->settings());
+
+#ifndef QT_NO_UNDOSTACK
+ undoStack = 0;
+#endif
+ mainFrame = 0;
+#if QT_VERSION < 0x040400
+ networkInterface = 0;
+#else
+ networkManager = 0;
+#endif
+ pluginFactory = 0;
+ insideOpenCall = false;
+ forwardUnsupportedContent = false;
+ editable = false;
+ linkPolicy = QWebPage::DontDelegateLinks;
+#ifndef QT_NO_CONTEXTMENU
+ currentContextMenu = 0;
+#endif
+
+ history.d = new QWebHistoryPrivate(page->backForwardList());
+ memset(actions, 0, sizeof(actions));
+}
+
+QWebPagePrivate::~QWebPagePrivate()
+{
+#ifndef QT_NO_CONTEXTMENU
+ delete currentContextMenu;
+#endif
+#ifndef QT_NO_UNDOSTACK
+ delete undoStack;
+#endif
+ delete settings;
+ delete page;
+}
+
+#if QT_VERSION < 0x040400
+bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type)
+{
+ if (insideOpenCall
+ && frame == mainFrame)
+ return true;
+ return q->acceptNavigationRequest(frame, request, type);
+}
+#else
+bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
+{
+ if (insideOpenCall
+ && frame == mainFrame)
+ return true;
+ return q->acceptNavigationRequest(frame, request, type);
+}
+#endif
+
+void QWebPagePrivate::createMainFrame()
+{
+ if (!mainFrame) {
+ QWebFrameData frameData;
+ frameData.ownerElement = 0;
+ frameData.allowsScrolling = true;
+ frameData.marginWidth = 0;
+ frameData.marginHeight = 0;
+ mainFrame = new QWebFrame(q, &frameData);
+
+ emit q->frameCreated(mainFrame);
+ }
+}
+
+static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAction action)
+{
+ switch (action) {
+ case WebCore::ContextMenuItemTagOpenLink: return QWebPage::OpenLink;
+ case WebCore::ContextMenuItemTagOpenLinkInNewWindow: return QWebPage::OpenLinkInNewWindow;
+ case WebCore::ContextMenuItemTagDownloadLinkToDisk: return QWebPage::DownloadLinkToDisk;
+ case WebCore::ContextMenuItemTagCopyLinkToClipboard: return QWebPage::CopyLinkToClipboard;
+ case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow;
+ case WebCore::ContextMenuItemTagDownloadImageToDisk: return QWebPage::DownloadImageToDisk;
+ case WebCore::ContextMenuItemTagCopyImageToClipboard: return QWebPage::CopyImageToClipboard;
+ case WebCore::ContextMenuItemTagOpenFrameInNewWindow: return QWebPage::OpenFrameInNewWindow;
+ case WebCore::ContextMenuItemTagCopy: return QWebPage::Copy;
+ case WebCore::ContextMenuItemTagGoBack: return QWebPage::Back;
+ case WebCore::ContextMenuItemTagGoForward: return QWebPage::Forward;
+ case WebCore::ContextMenuItemTagStop: return QWebPage::Stop;
+ case WebCore::ContextMenuItemTagReload: return QWebPage::Reload;
+ case WebCore::ContextMenuItemTagCut: return QWebPage::Cut;
+ case WebCore::ContextMenuItemTagPaste: return QWebPage::Paste;
+ case WebCore::ContextMenuItemTagDefaultDirection: return QWebPage::SetTextDirectionDefault;
+ case WebCore::ContextMenuItemTagLeftToRight: return QWebPage::SetTextDirectionLeftToRight;
+ case WebCore::ContextMenuItemTagRightToLeft: return QWebPage::SetTextDirectionRightToLeft;
+ case WebCore::ContextMenuItemTagBold: return QWebPage::ToggleBold;
+ case WebCore::ContextMenuItemTagItalic: return QWebPage::ToggleItalic;
+ case WebCore::ContextMenuItemTagUnderline: return QWebPage::ToggleUnderline;
+ case WebCore::ContextMenuItemTagInspectElement: return QWebPage::InspectElement;
+ default: break;
+ }
+ return QWebPage::NoWebAction;
+}
+
+#ifndef QT_NO_CONTEXTMENU
+QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMenu,
+ const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions)
+{
+ QMenu* menu = new QMenu(view);
+ for (int i = 0; i < items->count(); ++i) {
+ const ContextMenuItem &item = items->at(i);
+ switch (item.type()) {
+ case WebCore::CheckableActionType: /* fall through */
+ case WebCore::ActionType: {
+ QWebPage::WebAction action = webActionForContextMenuAction(item.action());
+ QAction *a = q->action(action);
+ if (a) {
+ ContextMenuItem it(item);
+ webcoreMenu->checkOrEnableIfNeeded(it);
+ PlatformMenuItemDescription desc = it.releasePlatformDescription();
+ a->setEnabled(desc.enabled);
+ a->setChecked(desc.checked);
+ a->setCheckable(item.type() == WebCore::CheckableActionType);
+
+ menu->addAction(a);
+ visitedWebActions->setBit(action);
+ }
+ break;
+ }
+ case WebCore::SeparatorType:
+ menu->addSeparator();
+ break;
+ case WebCore::SubmenuType: {
+ QMenu *subMenu = createContextMenu(webcoreMenu, item.platformSubMenu(), visitedWebActions);
+
+ bool anyEnabledAction = false;
+
+ QList<QAction *> actions = subMenu->actions();
+ for (int i = 0; i < actions.count(); ++i) {
+ if (actions.at(i)->isVisible())
+ anyEnabledAction |= actions.at(i)->isEnabled();
+ }
+
+ // don't show sub-menus with just disabled actions
+ if (anyEnabledAction) {
+ subMenu->setTitle(item.title());
+ menu->addAction(subMenu->menuAction());
+ } else {
+ delete subMenu;
+ }
+ break;
+ }
+ }
+ }
+ return menu;
+}
+#endif // QT_NO_CONTEXTMENU
+
+QWebFrame *QWebPagePrivate::frameAt(const QPoint &pos) const
+{
+ QWebFrame *frame = mainFrame;
+
+redo:
+ QList<QWebFrame*> children = frame->childFrames();
+ for (int i = 0; i < children.size(); ++i) {
+ if (children.at(i)->geometry().contains(pos)) {
+ frame = children.at(i);
+ goto redo;
+ }
+ }
+ if (frame->geometry().contains(pos))
+ return frame;
+ return 0;
+}
+
+void QWebPagePrivate::_q_webActionTriggered(bool checked)
+{
+ QAction *a = qobject_cast<QAction *>(q->sender());
+ if (!a)
+ return;
+ QWebPage::WebAction action = static_cast<QWebPage::WebAction>(a->data().toInt());
+ q->triggerAction(action, checked);
+}
+
+void QWebPagePrivate::updateAction(QWebPage::WebAction action)
+{
+ QAction *a = actions[action];
+ if (!a || !mainFrame)
+ return;
+
+ WebCore::FrameLoader *loader = mainFrame->d->frame->loader();
+ WebCore::Editor *editor = page->focusController()->focusedOrMainFrame()->editor();
+
+ bool enabled = a->isEnabled();
+ bool checked = a->isChecked();
+
+ switch (action) {
+ case QWebPage::Back:
+ enabled = loader->canGoBackOrForward(-1);
+ break;
+ case QWebPage::Forward:
+ enabled = loader->canGoBackOrForward(1);
+ break;
+ case QWebPage::Stop:
+ enabled = loader->isLoading();
+ break;
+ case QWebPage::Reload:
+ enabled = !loader->isLoading();
+ break;
+ case QWebPage::Cut:
+ enabled = editor->canCut();
+ break;
+ case QWebPage::Copy:
+ enabled = editor->canCopy();
+ break;
+ case QWebPage::Paste:
+ enabled = editor->canPaste();
+ break;
+#ifndef QT_NO_UNDOSTACK
+ case QWebPage::Undo:
+ case QWebPage::Redo:
+ // those two are handled by QUndoStack
+ break;
+#endif // QT_NO_UNDOSTACK
+ case QWebPage::MoveToNextChar:
+ case QWebPage::MoveToPreviousChar:
+ case QWebPage::MoveToNextWord:
+ case QWebPage::MoveToPreviousWord:
+ case QWebPage::MoveToNextLine:
+ case QWebPage::MoveToPreviousLine:
+ case QWebPage::MoveToStartOfLine:
+ case QWebPage::MoveToEndOfLine:
+ case QWebPage::MoveToStartOfBlock:
+ case QWebPage::MoveToEndOfBlock:
+ case QWebPage::MoveToStartOfDocument:
+ case QWebPage::MoveToEndOfDocument:
+ case QWebPage::SelectNextChar:
+ case QWebPage::SelectPreviousChar:
+ case QWebPage::SelectNextWord:
+ case QWebPage::SelectPreviousWord:
+ case QWebPage::SelectNextLine:
+ case QWebPage::SelectPreviousLine:
+ case QWebPage::SelectStartOfLine:
+ case QWebPage::SelectEndOfLine:
+ case QWebPage::SelectStartOfBlock:
+ case QWebPage::SelectEndOfBlock:
+ case QWebPage::SelectStartOfDocument:
+ case QWebPage::SelectEndOfDocument:
+ case QWebPage::DeleteStartOfWord:
+ case QWebPage::DeleteEndOfWord:
+ case QWebPage::SetTextDirectionDefault:
+ case QWebPage::SetTextDirectionLeftToRight:
+ case QWebPage::SetTextDirectionRightToLeft:
+ case QWebPage::ToggleBold:
+ case QWebPage::ToggleItalic:
+ case QWebPage::ToggleUnderline:
+ enabled = editor->canEditRichly();
+ if (enabled)
+ checked = editor->command(editorCommandForWebActions(action)).state() != FalseTriState;
+ else
+ checked = false;
+ break;
+ default: break;
+ }
+
+ a->setEnabled(enabled);
+
+ if (a->isCheckable())
+ a->setChecked(checked);
+}
+
+void QWebPagePrivate::updateNavigationActions()
+{
+ updateAction(QWebPage::Back);
+ updateAction(QWebPage::Forward);
+ updateAction(QWebPage::Stop);
+ updateAction(QWebPage::Reload);
+}
+
+void QWebPagePrivate::updateEditorActions()
+{
+ updateAction(QWebPage::Cut);
+ updateAction(QWebPage::Copy);
+ updateAction(QWebPage::Paste);
+ updateAction(QWebPage::MoveToNextChar);
+ updateAction(QWebPage::MoveToPreviousChar);
+ updateAction(QWebPage::MoveToNextWord);
+ updateAction(QWebPage::MoveToPreviousWord);
+ updateAction(QWebPage::MoveToNextLine);
+ updateAction(QWebPage::MoveToPreviousLine);
+ updateAction(QWebPage::MoveToStartOfLine);
+ updateAction(QWebPage::MoveToEndOfLine);
+ updateAction(QWebPage::MoveToStartOfBlock);
+ updateAction(QWebPage::MoveToEndOfBlock);
+ updateAction(QWebPage::MoveToStartOfDocument);
+ updateAction(QWebPage::MoveToEndOfDocument);
+ updateAction(QWebPage::SelectNextChar);
+ updateAction(QWebPage::SelectPreviousChar);
+ updateAction(QWebPage::SelectNextWord);
+ updateAction(QWebPage::SelectPreviousWord);
+ updateAction(QWebPage::SelectNextLine);
+ updateAction(QWebPage::SelectPreviousLine);
+ updateAction(QWebPage::SelectStartOfLine);
+ updateAction(QWebPage::SelectEndOfLine);
+ updateAction(QWebPage::SelectStartOfBlock);
+ updateAction(QWebPage::SelectEndOfBlock);
+ updateAction(QWebPage::SelectStartOfDocument);
+ updateAction(QWebPage::SelectEndOfDocument);
+ updateAction(QWebPage::DeleteStartOfWord);
+ updateAction(QWebPage::DeleteEndOfWord);
+ updateAction(QWebPage::SetTextDirectionDefault);
+ updateAction(QWebPage::SetTextDirectionLeftToRight);
+ updateAction(QWebPage::SetTextDirectionRightToLeft);
+ updateAction(QWebPage::ToggleBold);
+ updateAction(QWebPage::ToggleItalic);
+ updateAction(QWebPage::ToggleUnderline);
+}
+
+void QWebPagePrivate::timerEvent(QTimerEvent *ev)
+{
+ int timerId = ev->timerId();
+ if (timerId == tripleClickTimer.timerId())
+ tripleClickTimer.stop();
+ else
+ q->QObject::timerEvent(ev);
+}
+
+void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = frame->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0));
+ ev->setAccepted(accepted);
+}
+
+void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ if (tripleClickTimer.isActive()
+ && (ev->pos() - tripleClick).manhattanLength()
+ < QApplication::startDragDistance()) {
+ mouseTripleClickEvent(ev);
+ return;
+ }
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 1);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ ev->setAccepted(accepted);
+}
+
+void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 2);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ ev->setAccepted(accepted);
+
+ tripleClickTimer.start(QApplication::doubleClickInterval(), q);
+ tripleClick = ev->pos();
+}
+
+void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 3);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ ev->setAccepted(accepted);
+}
+
+void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 0);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
+ ev->setAccepted(accepted);
+
+#ifndef QT_NO_CLIPBOARD
+ if (QApplication::clipboard()->supportsSelection()) {
+ bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
+ Pasteboard::generalPasteboard()->setSelectionMode(true);
+ WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame();
+ if (ev->button() == Qt::LeftButton) {
+ if(focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) {
+ focusFrame->editor()->copy();
+ ev->setAccepted(true);
+ }
+ } else if (ev->button() == Qt::MidButton) {
+ if(focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) {
+ focusFrame->editor()->paste();
+ ev->setAccepted(true);
+ }
+ }
+ Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
+ }
+#endif
+}
+
+#ifndef QT_NO_CONTEXTMENU
+void QWebPagePrivate::contextMenuEvent(QContextMenuEvent *ev)
+{
+ QMenu *menu = q->createStandardContextMenu();
+ if (menu) {
+ menu->exec(ev->globalPos());
+ delete menu;
+ }
+}
+#endif // QT_NO_CONTEXTMENU
+
+/*!
+ \since 4.5
+ This function creates the standard context menu which is shown when
+ the user clicks on the web page with the right mouse button. It is
+ called from the default contextMenuEvent() handler. The popup menu's
+ ownership is transferred to the caller.
+ */
+QMenu *QWebPage::createStandardContextMenu()
+{
+#ifndef QT_NO_CONTEXTMENU
+ QMenu *menu = d->currentContextMenu;
+ d->currentContextMenu = 0;
+ return menu;
+#else
+ return 0;
+#endif
+}
+
+#ifndef QT_NO_WHEELEVENT
+void QWebPagePrivate::wheelEvent(QWheelEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ WebCore::PlatformWheelEvent pev(ev);
+ bool accepted = frame->eventHandler()->handleWheelEvent(pev);
+ ev->setAccepted(accepted);
+}
+#endif // QT_NO_WHEELEVENT
+
+#ifndef QT_NO_SHORTCUT
+QWebPage::WebAction QWebPagePrivate::editorActionForKeyEvent(QKeyEvent* event)
+{
+ static struct {
+ QKeySequence::StandardKey standardKey;
+ QWebPage::WebAction action;
+ } editorActions[] = {
+ { QKeySequence::Cut, QWebPage::Cut },
+ { QKeySequence::Copy, QWebPage::Copy },
+ { QKeySequence::Paste, QWebPage::Paste },
+ { QKeySequence::Undo, QWebPage::Undo },
+ { QKeySequence::Redo, QWebPage::Redo },
+ { QKeySequence::MoveToNextChar, QWebPage::MoveToNextChar },
+ { QKeySequence::MoveToPreviousChar, QWebPage::MoveToPreviousChar },
+ { QKeySequence::MoveToNextWord, QWebPage::MoveToNextWord },
+ { QKeySequence::MoveToPreviousWord, QWebPage::MoveToPreviousWord },
+ { QKeySequence::MoveToNextLine, QWebPage::MoveToNextLine },
+ { QKeySequence::MoveToPreviousLine, QWebPage::MoveToPreviousLine },
+ { QKeySequence::MoveToStartOfLine, QWebPage::MoveToStartOfLine },
+ { QKeySequence::MoveToEndOfLine, QWebPage::MoveToEndOfLine },
+ { QKeySequence::MoveToStartOfBlock, QWebPage::MoveToStartOfBlock },
+ { QKeySequence::MoveToEndOfBlock, QWebPage::MoveToEndOfBlock },
+ { QKeySequence::MoveToStartOfDocument, QWebPage::MoveToStartOfDocument },
+ { QKeySequence::MoveToEndOfDocument, QWebPage::MoveToEndOfDocument },
+ { QKeySequence::SelectNextChar, QWebPage::SelectNextChar },
+ { QKeySequence::SelectPreviousChar, QWebPage::SelectPreviousChar },
+ { QKeySequence::SelectNextWord, QWebPage::SelectNextWord },
+ { QKeySequence::SelectPreviousWord, QWebPage::SelectPreviousWord },
+ { QKeySequence::SelectNextLine, QWebPage::SelectNextLine },
+ { QKeySequence::SelectPreviousLine, QWebPage::SelectPreviousLine },
+ { QKeySequence::SelectStartOfLine, QWebPage::SelectStartOfLine },
+ { QKeySequence::SelectEndOfLine, QWebPage::SelectEndOfLine },
+ { QKeySequence::SelectStartOfBlock, QWebPage::SelectStartOfBlock },
+ { QKeySequence::SelectEndOfBlock, QWebPage::SelectEndOfBlock },
+ { QKeySequence::SelectStartOfDocument, QWebPage::SelectStartOfDocument },
+ { QKeySequence::SelectEndOfDocument, QWebPage::SelectEndOfDocument },
+ { QKeySequence::DeleteStartOfWord, QWebPage::DeleteStartOfWord },
+ { QKeySequence::DeleteEndOfWord, QWebPage::DeleteEndOfWord },
+#if QT_VERSION >= 0x040500
+ { QKeySequence::InsertParagraphSeparator, QWebPage::InsertParagraphSeparator },
+ { QKeySequence::InsertLineSeparator, QWebPage::InsertLineSeparator },
+#endif
+ { QKeySequence::SelectAll, QWebPage::SelectAll },
+ { QKeySequence::UnknownKey, QWebPage::NoWebAction }
+ };
+
+ for (int i = 0; editorActions[i].standardKey != QKeySequence::UnknownKey; ++i)
+ if (event == editorActions[i].standardKey)
+ return editorActions[i].action;
+
+ return QWebPage::NoWebAction;
+}
+#endif // QT_NO_SHORTCUT
+
+void QWebPagePrivate::keyPressEvent(QKeyEvent *ev)
+{
+ bool handled = false;
+ WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+ WebCore::Editor* editor = frame->editor();
+ // we forward the key event to WebCore first to handle potential DOM
+ // defined event handlers and later on end up in EditorClientQt::handleKeyboardEvent
+ // to trigger editor commands via triggerAction().
+ if (!handled)
+ handled = frame->eventHandler()->keyEvent(ev);
+ if (!handled) {
+ handled = true;
+ QFont defaultFont;
+ if (view)
+ defaultFont = view->font();
+ QFontMetrics fm(defaultFont);
+ int fontHeight = fm.height();
+ if (!handleScrolling(ev)) {
+ switch (ev->key()) {
+ case Qt::Key_Backspace:
+ if (ev->modifiers() == Qt::ShiftModifier)
+ q->triggerAction(QWebPage::Forward);
+ else
+ q->triggerAction(QWebPage::Back);
+ default:
+ handled = false;
+ break;
+ }
+ }
+ }
+
+ ev->setAccepted(handled);
+}
+
+void QWebPagePrivate::keyReleaseEvent(QKeyEvent *ev)
+{
+ if (ev->isAutoRepeat()) {
+ ev->setAccepted(true);
+ return;
+ }
+
+ WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+ bool handled = frame->eventHandler()->keyEvent(ev);
+ ev->setAccepted(handled);
+}
+
+void QWebPagePrivate::focusInEvent(QFocusEvent *ev)
+{
+ FocusController *focusController = page->focusController();
+ Frame *frame = focusController->focusedFrame();
+ focusController->setActive(true);
+ if (frame) {
+ frame->selection()->setFocused(true);
+ } else {
+ focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame));
+ }
+}
+
+void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
+{
+ // only set the focused frame inactive so that we stop painting the caret
+ // and the focus frame. But don't tell the focus controller so that upon
+ // focusInEvent() we can re-activate the frame.
+ FocusController *focusController = page->focusController();
+ focusController->setActive(false);
+ Frame *frame = focusController->focusedFrame();
+ if (frame) {
+ frame->selection()->setFocused(false);
+ }
+}
+
+void QWebPagePrivate::dragEnterEvent(QDragEnterEvent *ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
+ dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData));
+ ev->setDropAction(action);
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent *ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone);
+ page->dragController()->dragExited(&dragData);
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragMoveEvent(QDragMoveEvent *ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
+ dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData));
+ ev->setDropAction(action);
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dropEvent(QDropEvent *ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
+ dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData));
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::leaveEvent(QEvent *ev)
+{
+ // Fake a mouse move event just outside of the widget, since all
+ // the interesting mouse-out behavior like invalidating scrollbars
+ // is handled by the WebKit event handler's mouseMoved function.
+ QMouseEvent fakeEvent(QEvent::MouseMove, QCursor::pos(), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+ mouseMoveEvent(&fakeEvent);
+}
+
+/*!
+ \property QWebPage::palette
+ \brief the page's palette
+
+ The base brush of the palette is used to draw the background of the main frame.
+
+ By default, this property contains the application's default palette.
+*/
+void QWebPage::setPalette(const QPalette &pal)
+{
+ d->palette = pal;
+ if (!d->mainFrame || !d->mainFrame->d->frame->view())
+ return;
+
+ QBrush brush = pal.brush(QPalette::Base);
+ QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor();
+ QWebFramePrivate::core(d->mainFrame)->view()->updateBackgroundRecursively(backgroundColor, !backgroundColor.alpha());
+}
+
+QPalette QWebPage::palette() const
+{
+ return d->palette;
+}
+
+void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
+{
+ WebCore::Frame *frame = page->focusController()->focusedOrMainFrame();
+ WebCore::Editor *editor = frame->editor();
+
+ if (!editor->canEdit()) {
+ ev->ignore();
+ return;
+ }
+
+ if (!ev->preeditString().isEmpty()) {
+ QString preedit = ev->preeditString();
+ // ### FIXME: use the provided QTextCharFormat (use color at least)
+ Vector<CompositionUnderline> underlines;
+ underlines.append(CompositionUnderline(0, preedit.length(), Color(0,0,0), false));
+ editor->setComposition(preedit, underlines, preedit.length(), 0);
+ } else if (!ev->commitString().isEmpty()) {
+ editor->confirmComposition(ev->commitString());
+ }
+ ev->accept();
+}
+
+void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event)
+{
+ WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+ WebCore::Editor* editor = frame->editor();
+ if (editor->canEdit()) {
+ if (event->modifiers() == Qt::NoModifier
+ || event->modifiers() == Qt::ShiftModifier
+ || event->modifiers() == Qt::KeypadModifier) {
+ if (event->key() < Qt::Key_Escape) {
+ event->accept();
+ } else {
+ switch (event->key()) {
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
+ case Qt::Key_Delete:
+ case Qt::Key_Home:
+ case Qt::Key_End:
+ case Qt::Key_Backspace:
+ case Qt::Key_Left:
+ case Qt::Key_Right:
+ case Qt::Key_Up:
+ case Qt::Key_Down:
+ case Qt::Key_Tab:
+ event->accept();
+ default:
+ break;
+ }
+ }
+ }
+#ifndef QT_NO_SHORTCUT
+ else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) {
+ event->accept();
+ }
+#endif
+ }
+}
+
+bool QWebPagePrivate::handleScrolling(QKeyEvent *ev)
+{
+ ScrollDirection direction;
+ ScrollGranularity granularity;
+
+#ifndef QT_NO_SHORTCUT
+ if (ev == QKeySequence::MoveToNextPage
+ || (ev->key() == Qt::Key_Space && !(ev->modifiers() & Qt::ShiftModifier))) {
+ granularity = ScrollByPage;
+ direction = ScrollDown;
+ } else if (ev == QKeySequence::MoveToPreviousPage
+ || (ev->key() == Qt::Key_Space) && (ev->modifiers() & Qt::ShiftModifier)) {
+ granularity = ScrollByPage;
+ direction = ScrollUp;
+ } else
+#endif // QT_NO_SHORTCUT
+ if (ev->key() == Qt::Key_Up && ev->modifiers() & Qt::ControlModifier
+ || ev->key() == Qt::Key_Home) {
+ granularity = ScrollByDocument;
+ direction = ScrollUp;
+ } else if (ev->key() == Qt::Key_Down && ev->modifiers() & Qt::ControlModifier
+ || ev->key() == Qt::Key_End) {
+ granularity = ScrollByDocument;
+ direction = ScrollDown;
+ } else {
+ switch (ev->key()) {
+ case Qt::Key_Up:
+ granularity = ScrollByLine;
+ direction = ScrollUp;
+ break;
+ case Qt::Key_Down:
+ granularity = ScrollByLine;
+ direction = ScrollDown;
+ break;
+ case Qt::Key_Left:
+ granularity = ScrollByLine;
+ direction = ScrollLeft;
+ break;
+ case Qt::Key_Right:
+ granularity = ScrollByLine;
+ direction = ScrollRight;
+ break;
+ default:
+ return false;
+ }
+ }
+
+ if (!mainFrame->d->frame->eventHandler()->scrollOverflow(direction, granularity))
+ mainFrame->d->frame->view()->scroll(direction, granularity);
+
+ return true;
+}
+
+/*!
+ This method is used by the input method to query a set of properties of the page
+ to be able to support complex input method operations as support for surrounding
+ text and reconversions.
+
+ \a property specifies which property is queried.
+
+ \sa QWidget::inputMethodEvent(), QInputMethodEvent, QInputContext
+*/
+QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
+{
+ switch(property) {
+ case Qt::ImMicroFocus: {
+ Frame *frame = d->page->focusController()->focusedFrame();
+ if (frame) {
+ return QVariant(frame->selection()->absoluteCaretBounds());
+ }
+ return QVariant();
+ }
+ case Qt::ImFont: {
+ QWebView *webView = qobject_cast<QWebView *>(d->view);
+ if (webView)
+ return QVariant(webView->font());
+ return QVariant();
+ }
+ case Qt::ImCursorPosition: {
+ Frame *frame = d->page->focusController()->focusedFrame();
+ if (frame) {
+ Selection selection = frame->selection()->selection();
+ if (selection.isCaret()) {
+ return QVariant(selection.start().offset());
+ }
+ }
+ return QVariant();
+ }
+ case Qt::ImSurroundingText: {
+ Frame *frame = d->page->focusController()->focusedFrame();
+ if (frame) {
+ Document *document = frame->document();
+ if (document->focusedNode()) {
+ return QVariant(document->focusedNode()->nodeValue());
+ }
+ }
+ return QVariant();
+ }
+ case Qt::ImCurrentSelection:
+ return QVariant(selectedText());
+ default:
+ return QVariant();
+ }
+}
+
+/*!
+ \enum QWebPage::FindFlag
+
+ This enum describes the options available to QWebPage's findText() function. The options
+ can be OR-ed together from the following list:
+
+ \value FindBackward Searches backwards instead of forwards.
+ \value FindCaseSensitively By default findText() works case insensitive. Specifying this option
+ changes the behaviour to a case sensitive find operation.
+ \value FindWrapsAroundDocument Makes findText() restart from the beginning of the document if the end
+ was reached and the text was not found.
+*/
+
+/*!
+ \enum QWebPage::LinkDelegationPolicy
+
+ This enum defines the delegation policies a webpage can have when activating links and emitting
+ the linkClicked() signal.
+
+ \value DontDelegateLinks No links are delegated. Instead, QWebPage tries to handle them all.
+ \value DelegateExternalLinks When activating links that point to documents not stored on the
+ local filesystem or an equivalent - such as the Qt resource system - then linkClicked() is emitted.
+ \value DelegateAllLinks Whenever a link is activated the linkClicked() signal is emitted.
+*/
+
+/*!
+ \enum QWebPage::NavigationType
+
+ This enum describes the types of navigation available when browsing through hyperlinked
+ documents.
+
+ \value NavigationTypeLinkClicked The user clicked on a link or pressed return on a focused link.
+ \value NavigationTypeFormSubmitted The user activated a submit button for an HTML form.
+ \value NavigationTypeBackOrForward Navigation to a previously shown document in the back or forward history is requested.
+ \value NavigationTypeReload The user activated the reload action.
+ \value NavigationTypeFormResubmitted An HTML form was submitted a second time.
+ \value NavigationTypeOther A navigation to another document using a method not listed above.
+*/
+
+/*!
+ \enum QWebPage::WebAction
+
+ This enum describes the types of action which can be performed on the web page.
+ Actions which are related to text editing, cursor movement, and text selection
+ only have an effect if \l contentEditable is true.
+
+ \value NoWebAction No action is triggered.
+ \value OpenLink Open the current link.
+ \value OpenLinkInNewWindow Open the current link in a new window.
+ \value OpenFrameInNewWindow Replicate the current frame in a new window.
+ \value DownloadLinkToDisk Download the current link to the disk.
+ \value CopyLinkToClipboard Copy the current link to the clipboard.
+ \value OpenImageInNewWindow Open the highlighted image in a new window.
+ \value DownloadImageToDisk Download the highlighted image to the disk.
+ \value CopyImageToClipboard Copy the highlighted image to the clipboard.
+ \value Back Navigate back in the history of navigated links.
+ \value Forward Navigate forward in the history of navigated links.
+ \value Stop Stop loading the current page.
+ \value Reload Reload the current page.
+ \value Cut Cut the content currently selected into the clipboard.
+ \value Copy Copy the content currently selected into the clipboard.
+ \value Paste Paste content from the clipboard.
+ \value Undo Undo the last editing action.
+ \value Redo Redo the last editing action.
+ \value MoveToNextChar Move the cursor to the next character.
+ \value MoveToPreviousChar Move the cursor to the previous character.
+ \value MoveToNextWord Move the cursor to the next word.
+ \value MoveToPreviousWord Move the cursor to the previous word.
+ \value MoveToNextLine Move the cursor to the next line.
+ \value MoveToPreviousLine Move the cursor to the previous line.
+ \value MoveToStartOfLine Move the cursor to the start of the line.
+ \value MoveToEndOfLine Move the cursor to the end of the line.
+ \value MoveToStartOfBlock Move the cursor to the start of the block.
+ \value MoveToEndOfBlock Move the cursor to the end of the block.
+ \value MoveToStartOfDocument Move the cursor to the start of the document.
+ \value MoveToEndOfDocument Move the cursor to the end of the document.
+ \value SelectNextChar Select to the next character.
+ \value SelectPreviousChar Select to the previous character.
+ \value SelectNextWord Select to the next word.
+ \value SelectPreviousWord Select to the previous word.
+ \value SelectNextLine Select to the next line.
+ \value SelectPreviousLine Select to the previous line.
+ \value SelectStartOfLine Select to the start of the line.
+ \value SelectEndOfLine Select to the end of the line.
+ \value SelectStartOfBlock Select to the start of the block.
+ \value SelectEndOfBlock Select to the end of the block.
+ \value SelectStartOfDocument Select to the start of the document.
+ \value SelectEndOfDocument Select to the end of the document.
+ \value DeleteStartOfWord Delete to the start of the word.
+ \value DeleteEndOfWord Delete to the end of the word.
+ \value SetTextDirectionDefault Set the text direction to the default direction.
+ \value SetTextDirectionLeftToRight Set the text direction to left-to-right.
+ \value SetTextDirectionRightToLeft Set the text direction to right-to-left.
+ \value ToggleBold Toggle the formatting between bold and normal weight.
+ \value ToggleItalic Toggle the formatting between italic and normal style.
+ \value ToggleUnderline Toggle underlining.
+ \value InspectElement Show the Web Inspector with the currently highlighted HTML element.
+ \value InsertParagraphSeparator Insert a new paragraph.
+ \value InsertLineSeparator Insert a new line.
+ \value SelectAll Selects all content.
+ \omitvalue WebActionCount
+
+*/
+
+/*!
+ \enum QWebPage::WebWindowType
+
+ \value WebBrowserWindow The window is a regular web browser window.
+ \value WebModalDialog The window acts as modal dialog.
+*/
+
+/*!
+ \class QWebPage
+ \since 4.4
+ \brief The QWebPage class provides an object to view and edit web documents.
+
+ QWebPage holds a main frame responsible for web content, settings, the history
+ of navigated links and actions. This class can be used, together with QWebFrame,
+ to provide functionality like QWebView in a widget-less environment.
+
+ QWebPage's API is very similar to QWebView, as you are still provided with
+ common functions like action() (known as \l{QWebView::}{pageAction()} in
+ QWebView), triggerAction(), findText() and settings(). More QWebView-like
+ functions can be found in the main frame of QWebPage, obtained via
+ QWebPage::mainFrame(). For example, the load(), setUrl() and setHtml()
+ unctions for QWebPage can be accessed using QWebFrame.
+
+ The loadStarted() signal is emitted when the page begins to load.The
+ loadProgress() signal, on the other hand, is emitted whenever an element
+ of the web page completes loading, such as an embedded image, a script,
+ etc. Finally, the loadFinished() signal is emitted when the page has
+ loaded completely. Its argument, either true or false, indicates whether
+ or not the load operation succeeded.
+
+ \section1 Using QWebPage in a Widget-less Environment
+
+ Before you begin painting a QWebPage object, you need to set the size of
+ the viewport by calling setViewportSize(). Then, you invoke the main
+ frame's render function (QWebFrame::render()). An example of this
+ is shown in the code snippet below.
+
+ Suppose we have a \c Thumbnail class as follows:
+
+ \snippet doc/src/snippets/webkit/webpage/main.cpp 0
+
+ The \c Thumbnail's constructor takes in a \a url. We connect our QWebPage
+ object's \l{QWebPage::}{loadFinished()} signal to our private slot,
+ \c render().
+
+ \snippet doc/src/snippets/webkit/webpage/main.cpp 1
+
+ The \c render() function shows how we can paint a thumbnail using a
+ QWebPage object.
+
+ \snippet doc/src/snippets/webkit/webpage/main.cpp 2
+
+ We begin by setting the \l{QWebPage::viewportSize()}{viewportSize} and
+ then we instantiate a QImage object, \c image, with the same size as our
+ \l{QWebPage::viewportSize()}{viewportSize}. This image is then sent
+ as a parameter to \c painter. Next, we render the contents of the main
+ frame and its subframes into \c painter. Finally, we save the scaled image.
+
+ \sa QWebFrame
+*/
+
+/*!
+ Constructs an empty QWebView with parent \a parent.
+*/
+QWebPage::QWebPage(QObject *parent)
+ : QObject(parent)
+ , d(new QWebPagePrivate(this))
+{
+ setView(qobject_cast<QWidget *>(parent));
+
+ connect(this, SIGNAL(loadProgress(int)), this, SLOT(_q_onLoadProgressChanged(int)));
+}
+
+/*!
+ Destroys the web page.
+*/
+QWebPage::~QWebPage()
+{
+ FrameLoader *loader = d->mainFrame->d->frame->loader();
+ if (loader)
+ loader->detachFromParent();
+ delete d;
+}
+
+/*!
+ Returns the main frame of the page.
+
+ The main frame provides access to the hierarchy of sub-frames and is also needed if you
+ want to explicitly render a web page into a given painter.
+
+ \sa currentFrame()
+*/
+QWebFrame *QWebPage::mainFrame() const
+{
+ d->createMainFrame();
+ return d->mainFrame;
+}
+
+/*!
+ Returns the frame currently active.
+
+ \sa mainFrame(), frameCreated()
+*/
+QWebFrame *QWebPage::currentFrame() const
+{
+ return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame();
+}
+
+/*!
+ Returns a pointer to the view's history of navigated web pages.
+*/
+QWebHistory *QWebPage::history() const
+{
+ return &d->history;
+}
+
+/*!
+ Sets the \a view that is associated with the web page.
+
+ \sa view()
+*/
+void QWebPage::setView(QWidget *view)
+{
+ d->view = view;
+ setViewportSize(view ? view->size() : QSize(0, 0));
+}
+
+/*!
+ Returns the view widget that is associated with the web page.
+
+ \sa setView()
+*/
+QWidget *QWebPage::view() const
+{
+ return d->view;
+}
+
+/*!
+ This function is called whenever a JavaScript program tries to print a \a message to the web browser's console.
+
+ For example in case of evaluation errors the source URL may be provided in \a sourceID as well as the \a lineNumber.
+
+ The default implementation prints nothing.
+*/
+void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
+{
+ Q_UNUSED(message)
+ Q_UNUSED(lineNumber)
+ Q_UNUSED(sourceID)
+}
+
+/*!
+ This function is called whenever a JavaScript program running inside \a frame calls the alert() function with
+ the message \a msg.
+
+ The default implementation shows the message, \a msg, with QMessageBox::information.
+*/
+void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
+{
+#ifndef QT_NO_MESSAGEBOX
+ QMessageBox::information(d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
+#endif
+}
+
+/*!
+ This function is called whenever a JavaScript program running inside \a frame calls the confirm() function
+ with the message, \a msg. Returns true if the user confirms the message; otherwise returns false.
+
+ The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons.
+*/
+bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
+{
+#ifdef QT_NO_MESSAGEBOX
+ return true;
+#else
+ return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No);
+#endif
+}
+
+/*!
+ This function is called whenever a JavaScript program running inside \a frame tries to prompt the user for input.
+ The program may provide an optional message, \a msg, as well as a default value for the input in \a defaultValue.
+
+ If the prompt was cancelled by the user the implementation should return false; otherwise the
+ result should be written to \a result and true should be returned.
+
+ The default implementation uses QInputDialog::getText.
+*/
+bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result)
+{
+ bool ok = false;
+#ifndef QT_NO_INPUTDIALOG
+ QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);
+ if (ok && result) {
+ *result = x;
+ }
+#endif
+ return ok;
+}
+
+/*!
+ This function is called whenever WebKit wants to create a new window of the given \a type, for
+ example when a JavaScript program requests to open a document in a new window.
+
+ If the new window can be created, the new window's QWebPage is returned; otherwise a null pointer is returned.
+
+ If the view associated with the web page is a QWebView object, then the default implementation forwards
+ the request to QWebView's createWindow() function; otherwise it returns a null pointer.
+
+ \sa acceptNavigationRequest()
+*/
+QWebPage *QWebPage::createWindow(WebWindowType type)
+{
+ QWebView *webView = qobject_cast<QWebView *>(d->view);
+ if (webView) {
+ QWebView *newView = webView->createWindow(type);
+ if (newView)
+ return newView->page();
+ }
+ return 0;
+}
+
+/*!
+ This function is called whenever WebKit encounters a HTML object element with type "application/x-qt-plugin".
+ The \a classid, \a url, \a paramNames and \a paramValues correspond to the HTML object element attributes and
+ child elements to configure the embeddable object.
+*/
+QObject *QWebPage::createPlugin(const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues)
+{
+ Q_UNUSED(classid)
+ Q_UNUSED(url)
+ Q_UNUSED(paramNames)
+ Q_UNUSED(paramValues)
+ return 0;
+}
+
+static WebCore::FrameLoadRequest frameLoadRequest(const QUrl &url, WebCore::Frame *frame)
+{
+ WebCore::ResourceRequest rr(url, frame->loader()->outgoingReferrer());
+ return WebCore::FrameLoadRequest(rr);
+}
+
+static void openNewWindow(const QUrl& url, WebCore::Frame* frame)
+{
+ if (Page* oldPage = frame->page()) {
+ WindowFeatures features;
+ if (Page* newPage = oldPage->chrome()->createWindow(frame,
+ frameLoadRequest(url, frame), features))
+ newPage->chrome()->show();
+ }
+}
+
+/*!
+ This function can be called to trigger the specified \a action.
+ It is also called by QtWebKit if the user triggers the action, for example
+ through a context menu item.
+
+ If \a action is a checkable action then \a checked specified whether the action
+ is toggled or not.
+
+ \sa action()
+*/
+void QWebPage::triggerAction(WebAction action, bool checked)
+{
+ WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame();
+ if (!frame)
+ return;
+ WebCore::Editor *editor = frame->editor();
+ const char *command = 0;
+
+ switch (action) {
+ case OpenLink:
+ if (QWebFrame *targetFrame = d->hitTestResult.linkTargetFrame()) {
+ WTF::RefPtr<WebCore::Frame> wcFrame = targetFrame->d->frame;
+ targetFrame->d->frame->loader()->loadFrameRequestWithFormAndValues(frameLoadRequest(d->hitTestResult.linkUrl(), wcFrame.get()),
+ /*lockHistory*/ false, /*event*/ 0,
+ /*HTMLFormElement*/ 0, /*formValues*/
+ WTF::HashMap<String, String>());
+ break;
+ }
+ // fall through
+ case OpenLinkInNewWindow:
+ openNewWindow(d->hitTestResult.linkUrl(), frame);
+ break;
+ case OpenFrameInNewWindow: {
+ KURL url = frame->loader()->documentLoader()->unreachableURL();
+ if (url.isEmpty())
+ url = frame->loader()->documentLoader()->url();
+ openNewWindow(url, frame);
+ break;
+ }
+ case CopyLinkToClipboard:
+ editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText());
+ break;
+ case OpenImageInNewWindow:
+ openNewWindow(d->hitTestResult.imageUrl(), frame);
+ break;
+ case DownloadImageToDisk:
+ frame->loader()->client()->startDownload(WebCore::ResourceRequest(d->hitTestResult.imageUrl(), frame->loader()->outgoingReferrer()));
+ break;
+ case DownloadLinkToDisk:
+ frame->loader()->client()->startDownload(WebCore::ResourceRequest(d->hitTestResult.linkUrl(), frame->loader()->outgoingReferrer()));
+ break;
+#ifndef QT_NO_CLIPBOARD
+ case CopyImageToClipboard:
+ QApplication::clipboard()->setPixmap(d->hitTestResult.pixmap());
+ break;
+#endif
+ case Back:
+ d->page->goBack();
+ break;
+ case Forward:
+ d->page->goForward();
+ break;
+ case Stop:
+ mainFrame()->d->frame->loader()->stopForUserCancel();
+ break;
+ case Reload:
+ mainFrame()->d->frame->loader()->reload();
+ break;
+ case SetTextDirectionDefault:
+ editor->setBaseWritingDirection(NaturalWritingDirection);
+ break;
+ case SetTextDirectionLeftToRight:
+ editor->setBaseWritingDirection(LeftToRightWritingDirection);
+ break;
+ case SetTextDirectionRightToLeft:
+ editor->setBaseWritingDirection(RightToLeftWritingDirection);
+ break;
+ case InspectElement:
+ if (!d->hitTestResult.isNull())
+ d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get());
+ else
+ d->page->inspectorController()->show();
+ break;
+ default:
+ command = QWebPagePrivate::editorCommandForWebActions(action);
+ break;
+ }
+
+ if (command)
+ editor->command(command).execute();
+}
+
+QSize QWebPage::viewportSize() const
+{
+ if (d->mainFrame && d->mainFrame->d->frame->view())
+ return d->mainFrame->d->frame->view()->frameRect().size();
+
+ return d->viewportSize;
+}
+
+/*!
+ \property QWebPage::viewportSize
+ \brief the size of the viewport
+
+ The size affects for example the visibility of scrollbars
+ if the document is larger than the viewport.
+
+ By default, for a newly-created Web page, this property contains a size with
+ zero width and height.
+*/
+void QWebPage::setViewportSize(const QSize &size) const
+{
+ d->viewportSize = size;
+
+ QWebFrame *frame = mainFrame();
+ if (frame->d->frame && frame->d->frame->view()) {
+ WebCore::FrameView* view = frame->d->frame->view();
+ view->setFrameRect(QRect(QPoint(0, 0), size));
+ frame->d->frame->forceLayout();
+ view->adjustViewSize();
+ }
+}
+
+
+/*!
+ \fn bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
+
+ This function is called whenever WebKit requests to navigate \a frame to the resource specified by \a request by means of
+ the specified navigation type \a type.
+
+ If \a frame is a null pointer then navigation to a new window is requested. If the request is
+ accepted createWindow() will be called.
+
+ The default implementation interprets the page's linkDelegationPolicy and emits linkClicked accordingly or returns true
+ to let QWebPage handle the navigation itself.
+
+ \sa createWindow()
+*/
+#if QT_VERSION >= 0x040400
+bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
+#else
+bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type)
+#endif
+{
+ if (type == NavigationTypeLinkClicked) {
+ switch (d->linkPolicy) {
+ case DontDelegateLinks:
+ return true;
+
+ case DelegateExternalLinks:
+ if (WebCore::FrameLoader::shouldTreatSchemeAsLocal(request.url().scheme()))
+ return true;
+ emit linkClicked(request.url());
+ return false;
+
+ case DelegateAllLinks:
+ emit linkClicked(request.url());
+ return false;
+ }
+ }
+ return true;
+}
+
+/*!
+ \property QWebPage::selectedText
+ \brief the text currently selected
+
+ By default, this property contains an empty string.
+
+ \sa selectionChanged()
+*/
+QString QWebPage::selectedText() const
+{
+ return d->page->focusController()->focusedOrMainFrame()->selectedText();
+}
+
+/*!
+ Returns a QAction for the specified WebAction \a action.
+
+ The action is owned by the QWebPage but you can customize the look by
+ changing its properties.
+
+ QWebPage also takes care of implementing the action, so that upon
+ triggering the corresponding action is performed on the page.
+
+ \sa triggerAction()
+*/
+QAction *QWebPage::action(WebAction action) const
+{
+ if (action == QWebPage::NoWebAction) return 0;
+ if (d->actions[action])
+ return d->actions[action];
+
+ QString text;
+ QIcon icon;
+ QStyle *style = view() ? view()->style() : qApp->style();
+ bool checkable = false;
+
+ switch (action) {
+ case OpenLink:
+ text = contextMenuItemTagOpenLink();
+ break;
+ case OpenLinkInNewWindow:
+ text = contextMenuItemTagOpenLinkInNewWindow();
+ break;
+ case OpenFrameInNewWindow:
+ text = contextMenuItemTagOpenFrameInNewWindow();
+ break;
+
+ case DownloadLinkToDisk:
+ text = contextMenuItemTagDownloadLinkToDisk();
+ break;
+ case CopyLinkToClipboard:
+ text = contextMenuItemTagCopyLinkToClipboard();
+ break;
+
+ case OpenImageInNewWindow:
+ text = contextMenuItemTagOpenImageInNewWindow();
+ break;
+ case DownloadImageToDisk:
+ text = contextMenuItemTagDownloadImageToDisk();
+ break;
+ case CopyImageToClipboard:
+ text = contextMenuItemTagCopyImageToClipboard();
+ break;
+
+ case Back:
+ text = contextMenuItemTagGoBack();
+#if QT_VERSION >= 0x040400
+ icon = style->standardIcon(QStyle::SP_ArrowBack);
+#endif
+ break;
+ case Forward:
+ text = contextMenuItemTagGoForward();
+#if QT_VERSION >= 0x040400
+ icon = style->standardIcon(QStyle::SP_ArrowForward);
+#endif
+ break;
+ case Stop:
+ text = contextMenuItemTagStop();
+#if QT_VERSION >= 0x040400
+ icon = style->standardIcon(QStyle::SP_BrowserStop);
+#endif
+ break;
+ case Reload:
+ text = contextMenuItemTagReload();
+#if QT_VERSION >= 0x040400
+ icon = style->standardIcon(QStyle::SP_BrowserReload);
+#endif
+ break;
+
+ case Cut:
+ text = contextMenuItemTagCut();
+ break;
+ case Copy:
+ text = contextMenuItemTagCopy();
+ break;
+ case Paste:
+ text = contextMenuItemTagPaste();
+ break;
+#ifndef QT_NO_UNDOSTACK
+ case Undo: {
+ QAction *a = undoStack()->createUndoAction(d->q);
+ d->actions[action] = a;
+ return a;
+ }
+ case Redo: {
+ QAction *a = undoStack()->createRedoAction(d->q);
+ d->actions[action] = a;
+ return a;
+ }
+#endif // QT_NO_UNDOSTACK
+ case MoveToNextChar:
+ text = tr("Move the cursor to the next character");
+ break;
+ case MoveToPreviousChar:
+ text = tr("Move the cursor to the previous character");
+ break;
+ case MoveToNextWord:
+ text = tr("Move the cursor to the next word");
+ break;
+ case MoveToPreviousWord:
+ text = tr("Move the cursor to the previous word");
+ break;
+ case MoveToNextLine:
+ text = tr("Move the cursor to the next line");
+ break;
+ case MoveToPreviousLine:
+ text = tr("Move the cursor to the previous line");
+ break;
+ case MoveToStartOfLine:
+ text = tr("Move the cursor to the start of the line");
+ break;
+ case MoveToEndOfLine:
+ text = tr("Move the cursor to the end of the line");
+ break;
+ case MoveToStartOfBlock:
+ text = tr("Move the cursor to the start of the block");
+ break;
+ case MoveToEndOfBlock:
+ text = tr("Move the cursor to the end of the block");
+ break;
+ case MoveToStartOfDocument:
+ text = tr("Move the cursor to the start of the document");
+ break;
+ case MoveToEndOfDocument:
+ text = tr("Move the cursor to the end of the document");
+ break;
+ case SelectNextChar:
+ text = tr("Select to the next character");
+ break;
+ case SelectPreviousChar:
+ text = tr("Select to the previous character");
+ break;
+ case SelectNextWord:
+ text = tr("Select to the next word");
+ break;
+ case SelectPreviousWord:
+ text = tr("Select to the previous word");
+ break;
+ case SelectNextLine:
+ text = tr("Select to the next line");
+ break;
+ case SelectPreviousLine:
+ text = tr("Select to the previous line");
+ break;
+ case SelectStartOfLine:
+ text = tr("Select to the start of the line");
+ break;
+ case SelectEndOfLine:
+ text = tr("Select to the end of the line");
+ break;
+ case SelectStartOfBlock:
+ text = tr("Select to the start of the block");
+ break;
+ case SelectEndOfBlock:
+ text = tr("Select to the end of the block");
+ break;
+ case SelectStartOfDocument:
+ text = tr("Select to the start of the document");
+ break;
+ case SelectEndOfDocument:
+ text = tr("Select to the end of the document");
+ break;
+ case DeleteStartOfWord:
+ text = tr("Delete to the start of the word");
+ break;
+ case DeleteEndOfWord:
+ text = tr("Delete to the end of the word");
+ break;
+
+ case SetTextDirectionDefault:
+ text = contextMenuItemTagDefaultDirection();
+ break;
+ case SetTextDirectionLeftToRight:
+ text = contextMenuItemTagLeftToRight();
+ checkable = true;
+ break;
+ case SetTextDirectionRightToLeft:
+ text = contextMenuItemTagRightToLeft();
+ checkable = true;
+ break;
+
+ case ToggleBold:
+ text = contextMenuItemTagBold();
+ checkable = true;
+ break;
+ case ToggleItalic:
+ text = contextMenuItemTagItalic();
+ checkable = true;
+ break;
+ case ToggleUnderline:
+ text = contextMenuItemTagUnderline();
+ checkable = true;
+ break;
+
+ case InspectElement:
+ text = contextMenuItemTagInspectElement();
+ break;
+
+ case NoWebAction:
+ return 0;
+ }
+
+ if (text.isEmpty())
+ return 0;
+
+ QAction *a = new QAction(d->q);
+ a->setText(text);
+ a->setData(action);
+ a->setCheckable(checkable);
+ a->setIcon(icon);
+
+ connect(a, SIGNAL(triggered(bool)),
+ this, SLOT(_q_webActionTriggered(bool)));
+
+ d->actions[action] = a;
+ d->updateAction(action);
+ return a;
+}
+
+/*!
+ \property QWebPage::modified
+ \brief whether the page contains unsubmitted form data
+
+ By default, this property is false.
+*/
+bool QWebPage::isModified() const
+{
+#ifdef QT_NO_UNDOSTACK
+ return false;
+#else
+ if (!d->undoStack)
+ return false;
+ return d->undoStack->canUndo();
+#endif // QT_NO_UNDOSTACK
+}
+
+#ifndef QT_NO_UNDOSTACK
+/*!
+ Returns a pointer to the undo stack used for editable content.
+*/
+QUndoStack *QWebPage::undoStack() const
+{
+ if (!d->undoStack)
+ d->undoStack = new QUndoStack(const_cast<QWebPage *>(this));
+
+ return d->undoStack;
+}
+#endif // QT_NO_UNDOSTACK
+
+/*! \reimp
+*/
+bool QWebPage::event(QEvent *ev)
+{
+ switch (ev->type()) {
+ case QEvent::Timer:
+ d->timerEvent(static_cast<QTimerEvent*>(ev));
+ break;
+ case QEvent::MouseMove:
+ d->mouseMoveEvent(static_cast<QMouseEvent*>(ev));
+ break;
+ case QEvent::MouseButtonPress:
+ d->mousePressEvent(static_cast<QMouseEvent*>(ev));
+ break;
+ case QEvent::MouseButtonDblClick:
+ d->mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev));
+ break;
+ case QEvent::MouseButtonRelease:
+ d->mouseReleaseEvent(static_cast<QMouseEvent*>(ev));
+ break;
+#ifndef QT_NO_CONTEXTMENU
+ case QEvent::ContextMenu:
+ d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev));
+ break;
+#endif
+#ifndef QT_NO_WHEELEVENT
+ case QEvent::Wheel:
+ d->wheelEvent(static_cast<QWheelEvent*>(ev));
+ break;
+#endif
+ case QEvent::KeyPress:
+ d->keyPressEvent(static_cast<QKeyEvent*>(ev));
+ break;
+ case QEvent::KeyRelease:
+ d->keyReleaseEvent(static_cast<QKeyEvent*>(ev));
+ break;
+ case QEvent::FocusIn:
+ d->focusInEvent(static_cast<QFocusEvent*>(ev));
+ break;
+ case QEvent::FocusOut:
+ d->focusOutEvent(static_cast<QFocusEvent*>(ev));
+ break;
+#ifndef QT_NO_DRAGANDDROP
+ case QEvent::DragEnter:
+ d->dragEnterEvent(static_cast<QDragEnterEvent*>(ev));
+ break;
+ case QEvent::DragLeave:
+ d->dragLeaveEvent(static_cast<QDragLeaveEvent*>(ev));
+ break;
+ case QEvent::DragMove:
+ d->dragMoveEvent(static_cast<QDragMoveEvent*>(ev));
+ break;
+ case QEvent::Drop:
+ d->dropEvent(static_cast<QDropEvent*>(ev));
+ break;
+#endif
+ case QEvent::InputMethod:
+ d->inputMethodEvent(static_cast<QInputMethodEvent*>(ev));
+ case QEvent::ShortcutOverride:
+ d->shortcutOverrideEvent(static_cast<QKeyEvent*>(ev));
+ break;
+ case QEvent::Leave:
+ d->leaveEvent(ev);
+ break;
+ default:
+ return QObject::event(ev);
+ }
+
+ return true;
+}
+
+/*!
+ Similar to QWidget::focusNextPrevChild it focuses the next focusable web element
+ if \a next is true; otherwise the previous element is focused.
+
+ Returns true if it can find a new focusable element, or false if it can't.
+*/
+bool QWebPage::focusNextPrevChild(bool next)
+{
+ QKeyEvent ev(QEvent::KeyPress, Qt::Key_Tab, Qt::KeyboardModifiers(next ? Qt::NoModifier : Qt::ShiftModifier));
+ d->keyPressEvent(&ev);
+ bool hasFocusedNode = false;
+ Frame *frame = d->page->focusController()->focusedFrame();
+ if (frame) {
+ Document *document = frame->document();
+ hasFocusedNode = document && document->focusedNode();
+ }
+ //qDebug() << "focusNextPrevChild(" << next << ") =" << ev.isAccepted() << "focusedNode?" << hasFocusedNode;
+ return hasFocusedNode;
+}
+
+/*!
+ \property QWebPage::contentEditable
+ \brief whether the content in this QWebPage is editable or not
+ \since 4.5
+
+ If this property is enabled the contents of the page can be edited by the user through a visible
+ cursor. If disabled (the default) only HTML elements in the web page with their
+ \c{contenteditable} attribute set are editable.
+*/
+void QWebPage::setContentEditable(bool editable)
+{
+ if (d->editable != editable) {
+ d->editable = editable;
+ d->page->setTabKeyCyclesThroughElements(!editable);
+ if (d->mainFrame) {
+ WebCore::Frame* frame = d->mainFrame->d->frame;
+ if (editable) {
+ frame->applyEditingStyleToBodyElement();
+ // FIXME: mac port calls this if there is no selectedDOMRange
+ //frame->setSelectionFromNone();
+ } else {
+ frame->removeEditingStyleFromBodyElement();
+ }
+ }
+
+ d->updateEditorActions();
+ }
+}
+
+bool QWebPage::isContentEditable() const
+{
+ return d->editable;
+}
+
+/*!
+ \property QWebPage::forwardUnsupportedContent
+ \brief whether QWebPage should forward unsupported content through the
+ unsupportedContent signal
+
+ If disabled the download of such content is aborted immediately.
+
+ By default unsupported content is not forwarded.
+*/
+
+void QWebPage::setForwardUnsupportedContent(bool forward)
+{
+ d->forwardUnsupportedContent = forward;
+}
+
+bool QWebPage::forwardUnsupportedContent() const
+{
+ return d->forwardUnsupportedContent;
+}
+
+/*!
+ \property QWebPage::linkDelegationPolicy
+ \brief how QWebPage should delegate the handling of links through the
+ linkClicked() signal
+
+ The default is to delegate no links.
+*/
+
+void QWebPage::setLinkDelegationPolicy(LinkDelegationPolicy policy)
+{
+ d->linkPolicy = policy;
+}
+
+QWebPage::LinkDelegationPolicy QWebPage::linkDelegationPolicy() const
+{
+ return d->linkPolicy;
+}
+
+#ifndef QT_NO_CONTEXTMENU
+/*!
+ Filters the context menu event, \a event, through handlers for scrollbars and
+ custom event handlers in the web page. Returns true if the event was handled;
+ otherwise false.
+
+ A web page may swallow a context menu event through a custom event handler, allowing for context
+ menus to be implemented in HTML/JavaScript. This is used by \l{http://maps.google.com/}{Google
+ Maps}, for example.
+*/
+bool QWebPage::swallowContextMenuEvent(QContextMenuEvent *event)
+{
+ d->page->contextMenuController()->clearContextMenu();
+
+ if (QWebFrame* webFrame = d->frameAt(event->pos())) {
+ Frame* frame = QWebFramePrivate::core(webFrame);
+ if (Scrollbar* scrollbar = frame->view()->scrollbarUnderMouse(PlatformMouseEvent(event, 1))) {
+ return scrollbar->contextMenu(PlatformMouseEvent(event, 1));
+ }
+ }
+
+ WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
+ focusedFrame->eventHandler()->sendContextMenuEvent(PlatformMouseEvent(event, 1));
+ ContextMenu *menu = d->page->contextMenuController()->contextMenu();
+ // If the website defines its own handler then sendContextMenuEvent takes care of
+ // calling/showing it and the context menu pointer will be zero. This is the case
+ // on maps.google.com for example.
+
+ return !menu;
+}
+#endif // QT_NO_CONTEXTMENU
+
+/*!
+ Updates the page's actions depending on the position \a pos. For example if \a pos is over an image
+ element the CopyImageToClipboard action is enabled.
+*/
+void QWebPage::updatePositionDependentActions(const QPoint &pos)
+{
+ // First we disable all actions, but keep track of which ones were originally enabled.
+ QBitArray originallyEnabledWebActions(QWebPage::WebActionCount);
+ for (int i = ContextMenuItemTagNoAction; i < ContextMenuItemBaseApplicationTag; ++i) {
+ QWebPage::WebAction action = webActionForContextMenuAction(WebCore::ContextMenuAction(i));
+ if (QAction *a = this->action(action)) {
+ originallyEnabledWebActions.setBit(action, a->isEnabled());
+ a->setEnabled(false);
+ }
+ }
+
+ WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
+ HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false);
+
+ d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result));
+ WebCore::ContextMenu menu(result);
+ menu.populate();
+ if (d->page->inspectorController()->enabled())
+ menu.addInspectElementItem();
+
+ QBitArray visitedWebActions(QWebPage::WebActionCount);
+
+#ifndef QT_NO_CONTEXTMENU
+ delete d->currentContextMenu;
+
+ // Then we let createContextMenu() enable the actions that are put into the menu
+ d->currentContextMenu = d->createContextMenu(&menu, menu.platformDescription(), &visitedWebActions);
+#endif // QT_NO_CONTEXTMENU
+
+ // Finally, we restore the original enablement for the actions that were not put into the menu.
+ originallyEnabledWebActions &= ~visitedWebActions; // Mask out visited actions (they're part of the menu)
+ for (int i = 0; i < QWebPage::WebActionCount; ++i) {
+ if (originallyEnabledWebActions.at(i)) {
+ if (QAction *a = this->action(QWebPage::WebAction(i))) {
+ a->setEnabled(true);
+ }
+ }
+ }
+
+ // This whole process ensures that any actions put into to the context menu has the right
+ // enablement, while also keeping the correct enablement for actions that were left out of
+ // the menu.
+
+}
+
+
+
+/*!
+ \enum QWebPage::Extension
+
+ This enum describes the types of extensions that the page can support. Before using these extensions, you
+ should verify that the extension is supported by calling supportsExtension().
+
+ \value ChooseMultipleFilesExtension Whether the web page supports multiple file selection.
+ This extension is invoked when the web content requests one or more file names, for example
+ as a result of the user clicking on a "file upload" button in a HTML form where multiple
+ file selection is allowed.
+
+*/
+
+/*!
+ \class QWebPage::ExtensionOption
+ \since 4.4
+ \brief The ExtensionOption class provides an extended input argument to QWebPage's extension support.
+
+ \sa QWebPage::extension()
+*/
+
+/*!
+ \class QWebPage::ChooseMultipleFilesExtensionOption
+ \since 4.5
+ \brief The ChooseMultipleFilesExtensionOption class describes the option
+ for the multiple files selection extension.
+
+ The ChooseMultipleFilesExtensionOption class holds the frame originating the request
+ and the suggested filenames which might be provided.
+
+ \sa QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
+*/
+
+/*!
+ \class QWebPage::ChooseMultipleFilesExtensionReturn
+ \since 4.5
+ \brief The ChooseMultipleFilesExtensionReturn describes the return value
+ for the multiple files selection extension.
+
+ The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user
+ when the extension is invoked.
+
+ \sa QWebPage::ChooseMultipleFilesExtensionOption
+*/
+
+/*!
+ This virtual function can be reimplemented in a QWebPage subclass to provide support for extensions. The \a option
+ argument is provided as input to the extension; the output results can be stored in \a output.
+
+ The behavior of this function is determined by \a extension.
+
+ You can call supportsExtension() to check if an extension is supported by the page.
+
+ Returns true if the extension was called successfully; otherwise returns false.
+
+ \sa supportsExtension(), Extension
+*/
+bool QWebPage::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output)
+{
+#ifndef QT_NO_FILEDIALOG
+ if (extension == ChooseMultipleFilesExtension) {
+ // FIXME: do not ignore suggestedFiles
+ QStringList suggestedFiles = static_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFileNames;
+ QStringList names = QFileDialog::getOpenFileNames(d->view, QString::null);
+ static_cast<ChooseMultipleFilesExtensionReturn*>(output)->fileNames = names;
+ return true;
+ }
+#endif
+
+ return false;
+}
+
+/*!
+ This virtual function returns true if the web page supports \a extension; otherwise false is returned.
+
+ \sa extension()
+*/
+bool QWebPage::supportsExtension(Extension extension) const
+{
+#ifndef QT_NO_FILEDIALOG
+ return extension == ChooseMultipleFilesExtension;
+#else
+ Q_UNUSED(extension);
+ return false;
+#endif
+}
+
+/*!
+ Finds the next occurrence of the string, \a subString, in the page, using the given \a options.
+ Returns true of \a subString was found and selects the match visually; otherwise returns false.
+*/
+bool QWebPage::findText(const QString &subString, FindFlags options)
+{
+ ::TextCaseSensitivity caseSensitivity = ::TextCaseInsensitive;
+ if (options & FindCaseSensitively)
+ caseSensitivity = ::TextCaseSensitive;
+
+ ::FindDirection direction = ::FindDirectionForward;
+ if (options & FindBackward)
+ direction = ::FindDirectionBackward;
+
+ const bool shouldWrap = options & FindWrapsAroundDocument;
+
+ return d->page->findString(subString, caseSensitivity, direction, shouldWrap);
+}
+
+/*!
+ Returns a pointer to the page's settings object.
+
+ \sa QWebSettings::globalSettings()
+*/
+QWebSettings *QWebPage::settings() const
+{
+ return d->settings;
+}
+
+/*!
+ This function is called when the web content requests a file name, for example
+ as a result of the user clicking on a "file upload" button in a HTML form.
+
+ A suggested filename may be provided in \a suggestedFile. The frame originating the
+ request is provided as \a parentFrame.
+*/
+QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile)
+{
+#ifndef QT_NO_FILEDIALOG
+ return QFileDialog::getOpenFileName(d->view, QString::null, suggestedFile);
+#else
+ return QString::null;
+#endif
+}
+
+#if QT_VERSION < 0x040400 && !defined qdoc
+
+void QWebPage::setNetworkInterface(QWebNetworkInterface *interface)
+{
+ d->networkInterface = interface;
+}
+
+QWebNetworkInterface *QWebPage::networkInterface() const
+{
+ if (d->networkInterface)
+ return d->networkInterface;
+ else
+ return QWebNetworkInterface::defaultInterface();
+}
+
+#ifndef QT_NO_NETWORKPROXY
+void QWebPage::setNetworkProxy(const QNetworkProxy& proxy)
+{
+ d->networkProxy = proxy;
+}
+
+QNetworkProxy QWebPage::networkProxy() const
+{
+ return d->networkProxy;
+}
+#endif
+
+#else
+
+/*!
+ Sets the QNetworkAccessManager \a manager responsible for serving network requests for this
+ QWebPage.
+
+ \sa networkAccessManager()
+*/
+void QWebPage::setNetworkAccessManager(QNetworkAccessManager *manager)
+{
+ if (manager == d->networkManager)
+ return;
+ if (d->networkManager && d->networkManager->parent() == this)
+ delete d->networkManager;
+ d->networkManager = manager;
+}
+
+/*!
+ Returns the QNetworkAccessManager that is responsible for serving network
+ requests for this QWebPage.
+
+ \sa setNetworkAccessManager()
+*/
+QNetworkAccessManager *QWebPage::networkAccessManager() const
+{
+ if (!d->networkManager) {
+ QWebPage *that = const_cast<QWebPage *>(this);
+ that->d->networkManager = new QNetworkAccessManager(that);
+ }
+ return d->networkManager;
+}
+
+#endif
+
+/*!
+ Sets the QWebPluginFactory \a factory responsible for creating plugins embedded into this
+ QWebPage.
+
+ Note: The plugin factory is only used if the QWebSettings::PluginsEnabled attribute is enabled.
+
+ \sa pluginFactory()
+*/
+void QWebPage::setPluginFactory(QWebPluginFactory *factory)
+{
+ d->pluginFactory = factory;
+}
+
+/*!
+ Returns the QWebPluginFactory that is responsible for creating plugins embedded into
+ this QWebPage. If no plugin factory is installed a null pointer is returned.
+
+ \sa setPluginFactory()
+*/
+QWebPluginFactory *QWebPage::pluginFactory() const
+{
+ return d->pluginFactory;
+}
+
+/*!
+ This function is called when a user agent for HTTP requests is needed. You can reimplement this
+ function to dynamically return different user agents for different URLs, based on the \a url parameter.
+
+ The default implementation returns the following value:
+
+ "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko, Safari/419.3) %AppVersion"
+
+ In this string the following values are replaced at run-time:
+ \list
+ \o %Platform% and %Subplatform% are expanded to the windowing system and the operation system.
+ \o %Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true.
+ \o %Locale% is replaced with QLocale::name().
+ \o %WebKitVersion% currently expands to 527+
+ \o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version.
+ \endlist
+*/
+QString QWebPage::userAgentForUrl(const QUrl& url) const
+{
+ Q_UNUSED(url)
+ QString ua = QLatin1String("Mozilla/5.0 ("
+
+ // Plastform
+#ifdef Q_WS_MAC
+ "Macintosh"
+#elif defined Q_WS_QWS
+ "QtEmbedded"
+#elif defined Q_WS_WIN
+ "Windows"
+#elif defined Q_WS_X11
+ "X11"
+#else
+ "Unknown"
+#endif
+ "; "
+
+ // Placeholder for security strength (N or U)
+ "%1; "
+
+ // Subplatform"
+#ifdef Q_OS_AIX
+ "AIX"
+#elif defined Q_OS_WIN32
+ "%2"
+#elif defined Q_OS_DARWIN
+#ifdef __i386__ || __x86_64__
+ "Intel Mac OS X"
+#else
+ "PPC Mac OS X"
+#endif
+
+#elif defined Q_OS_BSDI
+ "BSD"
+#elif defined Q_OS_BSD4
+ "BSD Four"
+#elif defined Q_OS_CYGWIN
+ "Cygwin"
+#elif defined Q_OS_DGUX
+ "DG/UX"
+#elif defined Q_OS_DYNIX
+ "DYNIX/ptx"
+#elif defined Q_OS_FREEBSD
+ "FreeBSD"
+#elif defined Q_OS_HPUX
+ "HP-UX"
+#elif defined Q_OS_HURD
+ "GNU Hurd"
+#elif defined Q_OS_IRIX
+ "SGI Irix"
+#elif defined Q_OS_LINUX
+ "Linux"
+#elif defined Q_OS_LYNX
+ "LynxOS"
+#elif defined Q_OS_NETBSD
+ "NetBSD"
+#elif defined Q_OS_OS2
+ "OS/2"
+#elif defined Q_OS_OPENBSD
+ "OpenBSD"
+#elif defined Q_OS_OS2EMX
+ "OS/2"
+#elif defined Q_OS_OSF
+ "HP Tru64 UNIX"
+#elif defined Q_OS_QNX6
+ "QNX RTP Six"
+#elif defined Q_OS_QNX
+ "QNX"
+#elif defined Q_OS_RELIANT
+ "Reliant UNIX"
+#elif defined Q_OS_SCO
+ "SCO OpenServer"
+#elif defined Q_OS_SOLARIS
+ "Sun Solaris"
+#elif defined Q_OS_ULTRIX
+ "DEC Ultrix"
+#elif defined Q_OS_UNIX
+ "UNIX BSD/SYSV system"
+#elif defined Q_OS_UNIXWARE
+ "UnixWare Seven, Open UNIX Eight"
+#else
+ "Unknown"
+#endif
+ "; ");
+
+ QChar securityStrength(QLatin1Char('N'));
+#if !defined(QT_NO_OPENSSL)
+ if (QSslSocket::supportsSsl())
+ securityStrength = QLatin1Char('U');
+#endif
+ ua = ua.arg(securityStrength);
+
+#if defined Q_OS_WIN32
+ QString ver;
+ switch(QSysInfo::WindowsVersion) {
+ case QSysInfo::WV_32s:
+ ver = "Windows 3.1";
+ break;
+ case QSysInfo::WV_95:
+ ver = "Windows 95";
+ break;
+ case QSysInfo::WV_98:
+ ver = "Windows 98";
+ break;
+ case QSysInfo::WV_Me:
+ ver = "Windows 98; Win 9x 4.90";
+ break;
+ case QSysInfo::WV_NT:
+ ver = "WinNT4.0";
+ break;
+ case QSysInfo::WV_2000:
+ ver = "Windows NT 5.0";
+ break;
+ case QSysInfo::WV_XP:
+ ver = "Windows NT 5.1";
+ break;
+ case QSysInfo::WV_2003:
+ ver = "Windows NT 5.2";
+ break;
+ case QSysInfo::WV_VISTA:
+ ver = "Windows NT 6.0";
+ break;
+ case QSysInfo::WV_CE:
+ ver = "Windows CE";
+ break;
+ case QSysInfo::WV_CENET:
+ ver = "Windows CE .NET";
+ break;
+ case QSysInfo::WV_CE_5:
+ ver = "Windows CE 5.x";
+ break;
+ case QSysInfo::WV_CE_6:
+ ver = "Windows CE 6.x";
+ break;
+ }
+ ua = QString(ua).arg(ver);
+#endif
+
+ // Language
+ QLocale locale;
+ if (d->view)
+ locale = d->view->locale();
+ QString name = locale.name();
+ name[2] = QLatin1Char('-');
+ ua.append(name);
+ ua.append(QLatin1String(") "));
+
+ // webkit/qt version
+ ua.append(QLatin1String("AppleWebKit/" WEBKIT_VERSION " (KHTML, like Gecko, Safari/419.3) "));
+
+ // Application name/version
+ QString appName = QCoreApplication::applicationName();
+ if (!appName.isEmpty()) {
+ ua.append(QLatin1Char(' ') + appName);
+#if QT_VERSION >= 0x040400
+ QString appVer = QCoreApplication::applicationVersion();
+ if (!appVer.isEmpty())
+ ua.append(QLatin1Char('/') + appVer);
+#endif
+ } else {
+ // Qt version
+ ua.append(QLatin1String("Qt/"));
+ ua.append(QLatin1String(qVersion()));
+ }
+ return ua;
+}
+
+
+void QWebPagePrivate::_q_onLoadProgressChanged(int) {
+ m_totalBytes = page->progress()->totalPageAndResourceBytesToLoad();
+ m_bytesReceived = page->progress()->totalBytesReceived();
+}
+
+
+/*!
+ Returns the total number of bytes that were received from the network to render the current page,
+ including extra content such as embedded images.
+
+ \sa bytesReceived()
+*/
+quint64 QWebPage::totalBytes() const {
+ return d->m_bytesReceived;
+}
+
+
+/*!
+ Returns the number of bytes that were received from the network to render the current page.
+
+ \sa totalBytes()
+*/
+quint64 QWebPage::bytesReceived() const {
+ return d->m_totalBytes;
+}
+
+/*!
+ \fn void QWebPage::loadStarted()
+
+ This signal is emitted when a new load of the page is started.
+
+ \sa loadFinished()
+*/
+
+/*!
+ \fn void QWebPage::loadProgress(int progress)
+
+ This signal is emitted when the global progress status changes.
+ The current value is provided by \a progress and scales from 0 to 100,
+ which is the default range of QProgressBar.
+ It accumulates changes from all the child frames.
+
+ \sa bytesReceived()
+*/
+
+/*!
+ \fn void QWebPage::loadFinished(bool ok)
+
+ This signal is emitted when a load of the page is finished.
+ \a ok will indicate whether the load was successful or any error occurred.
+
+ \sa loadStarted()
+*/
+
+/*!
+ \fn void QWebPage::linkHovered(const QString &link, const QString &title, const QString &textContent)
+
+ This signal is emitted when the mouse hovers over a link.
+
+ \a link contains the link url.
+ \a title is the link element's title, if it is specified in the markup.
+ \a textContent provides text within the link element, e.g., text inside an HTML anchor tag.
+
+ When the mouse leaves the link element the signal is emitted with empty parameters.
+
+ \sa linkClicked()
+*/
+
+/*!
+ \fn void QWebPage::statusBarMessage(const QString& text)
+
+ This signal is emitted when the statusbar \a text is changed by the page.
+*/
+
+/*!
+ \fn void QWebPage::frameCreated(QWebFrame *frame)
+
+ This signal is emitted whenever the page creates a new \a frame.
+*/
+
+/*!
+ \fn void QWebPage::selectionChanged()
+
+ This signal is emitted whenever the selection changes.
+
+ \sa selectedText()
+*/
+
+/*!
+ \fn void QWebPage::contentsChanged()
+ \since 4.5
+
+ This signal is emitted whenever the text in form elements changes
+ as well as other editable content.
+
+ \sa contentEditable, QWebFrame::toHtml(), QWebFrame::toPlainText()
+*/
+
+/*!
+ \fn void QWebPage::geometryChangeRequested(const QRect& geom)
+
+ This signal is emitted whenever the document wants to change the position and size of the
+ page to \a geom. This can happen for example through JavaScript.
+*/
+
+/*!
+ \fn void QWebPage::repaintRequested(const QRect& dirtyRect)
+
+ This signal is emitted whenever this QWebPage should be updated and no view was set.
+ \a dirtyRect contains the area that needs to be updated. To paint the QWebPage get
+ the mainFrame() and call the render(QPainter*, const QRegion&) method with the
+ \a dirtyRect as the second parameter.
+
+ \sa mainFrame()
+ \sa view()
+*/
+
+/*!
+ \fn void QWebPage::scrollRequested(int dx, int dy, const QRect& rectToScroll)
+
+ This signal is emitted whenever the content given by \a rectToScroll needs
+ to be scrolled \a dx and \a dy downwards and no view was set.
+
+ \sa view()
+*/
+
+/*!
+ \fn void QWebPage::windowCloseRequested()
+
+ This signal is emitted whenever the page requests the web browser window to be closed,
+ for example through the JavaScript \c{window.close()} call.
+*/
+
+/*!
+ \fn void QWebPage::printRequested(QWebFrame *frame)
+
+ This signal is emitted whenever the page requests the web browser to print \a frame,
+ for example through the JavaScript \c{window.print()} call.
+
+ \sa QWebFrame::print(), QPrintPreviewDialog
+*/
+
+/*!
+ \fn void QWebPage::unsupportedContent(QNetworkReply *reply)
+
+ This signals is emitted when webkit cannot handle a link the user navigated to.
+
+ At signal emissions time the meta data of the QNetworkReply \a reply is available.
+
+ \note This signal is only emitted if the forwardUnsupportedContent property is set to true.
+
+ \sa downloadRequested()
+*/
+
+/*!
+ \fn void QWebPage::downloadRequested(const QNetworkRequest &request)
+
+ This signal is emitted when the user decides to download a link. The url of
+ the link as well as additional meta-information is contained in \a request.
+
+ \sa unsupportedContent()
+*/
+
+/*!
+ \fn void QWebPage::microFocusChanged()
+
+ This signal is emitted when for example the position of the cursor in an editable form
+ element changes. It is used inform input methods about the new on-screen position where
+ the user is able to enter text. This signal is usually connected to QWidget's updateMicroFocus()
+ slot.
+*/
+
+/*!
+ \fn void QWebPage::linkClicked(const QUrl &url)
+
+ This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy
+ property is set to delegate the link handling for the specified \a url.
+
+ By default no links are delegated and are handled by QWebPage instead.
+
+ \sa linkHovered()
+*/
+
+/*!
+ \fn void QWebPage::toolBarVisibilityChangeRequested(bool visible)
+
+ This signal is emitted whenever the visibility of the toolbar in a web browser
+ window that hosts QWebPage should be changed to \a visible.
+*/
+
+/*!
+ \fn void QWebPage::statusBarVisibilityChangeRequested(bool visible)
+
+ This signal is emitted whenever the visibility of the statusbar in a web browser
+ window that hosts QWebPage should be changed to \a visible.
+*/
+
+/*!
+ \fn void QWebPage::menuBarVisibilityChangeRequested(bool visible)
+
+ This signal is emitted whenever the visibility of the menubar in a web browser
+ window that hosts QWebPage should be changed to \a visible.
+*/
+
+/*!
+ \fn void QWebPage::databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
+ \since 4.5
+
+ This signal is emitted whenever the web site shown in \a frame is asking to store data
+ to the database \a databaseName and the quota allocated to that web site is exceeded.
+*/
+
+/*!
+ \since 4.5
+ \fn void QWebPage::saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
+
+ This signal is emitted shortly before the history of navigated pages
+ in \a frame is changed, for example when navigating back in the history.
+
+ The provided QWebHistoryItem, \a item, holds the history entry of the frame before
+ the change.
+
+ A potential use-case for this signal is to store custom data in
+ the QWebHistoryItem associated to the frame, using QWebHistoryItem::setUserData().
+*/
+
+/*!
+ \since 4.5
+ \fn void QWebPage::restoreFrameStateRequested(QWebFrame* frame);
+
+ This signal is emitted when the load of \a frame is finished and the application may now update its state accordingly.
+*/
+
+/*!
+ \fn QWebPagePrivate* QWebPage::handle() const
+ \internal
+*/
+
+#include "moc_qwebpage.cpp"
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
new file mode 100644
index 0000000..7253cee
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -0,0 +1,334 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2007 Staikos Computing Services Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBPAGE_H
+#define QWEBPAGE_H
+
+#include "qwebsettings.h"
+#include "qwebkitglobal.h"
+
+#include <QtCore/qobject.h>
+#include <QtGui/qwidget.h>
+
+QT_BEGIN_NAMESPACE
+class QNetworkProxy;
+class QUndoStack;
+class QUrl;
+class QMenu;
+class QNetworkRequest;
+class QNetworkReply;
+class QNetworkAccessManager;
+QT_END_NAMESPACE
+
+class QWebFrame;
+class QWebNetworkRequest;
+class QWebHistory;
+
+class QWebPagePrivate;
+class QWebFrameData;
+class QWebNetworkInterface;
+class QWebPluginFactory;
+class QWebHitTestResult;
+class QWebHistoryItem;
+
+namespace WebCore {
+ class ChromeClientQt;
+ class EditorClientQt;
+ class FrameLoaderClientQt;
+ class FrameLoadRequest;
+ class InspectorClientQt;
+ class ResourceHandle;
+ class HitTestResult;
+}
+
+class QWEBKIT_EXPORT QWebPage : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool modified READ isModified)
+ Q_PROPERTY(QString selectedText READ selectedText)
+ Q_PROPERTY(QSize viewportSize READ viewportSize WRITE setViewportSize)
+ Q_PROPERTY(bool forwardUnsupportedContent READ forwardUnsupportedContent WRITE setForwardUnsupportedContent)
+ Q_PROPERTY(LinkDelegationPolicy linkDelegationPolicy READ linkDelegationPolicy WRITE setLinkDelegationPolicy)
+ Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
+ Q_PROPERTY(bool contentEditable READ isContentEditable WRITE setContentEditable)
+ Q_ENUMS(LinkDelegationPolicy NavigationType WebAction)
+public:
+ enum NavigationType {
+ NavigationTypeLinkClicked,
+ NavigationTypeFormSubmitted,
+ NavigationTypeBackOrForward,
+ NavigationTypeReload,
+ NavigationTypeFormResubmitted,
+ NavigationTypeOther
+ };
+
+ enum WebAction {
+ NoWebAction = - 1,
+
+ OpenLink,
+
+ OpenLinkInNewWindow,
+ OpenFrameInNewWindow,
+
+ DownloadLinkToDisk,
+ CopyLinkToClipboard,
+
+ OpenImageInNewWindow,
+ DownloadImageToDisk,
+ CopyImageToClipboard,
+
+ Back,
+ Forward,
+ Stop,
+ Reload,
+
+ Cut,
+ Copy,
+ Paste,
+
+ Undo,
+ Redo,
+ MoveToNextChar,
+ MoveToPreviousChar,
+ MoveToNextWord,
+ MoveToPreviousWord,
+ MoveToNextLine,
+ MoveToPreviousLine,
+ MoveToStartOfLine,
+ MoveToEndOfLine,
+ MoveToStartOfBlock,
+ MoveToEndOfBlock,
+ MoveToStartOfDocument,
+ MoveToEndOfDocument,
+ SelectNextChar,
+ SelectPreviousChar,
+ SelectNextWord,
+ SelectPreviousWord,
+ SelectNextLine,
+ SelectPreviousLine,
+ SelectStartOfLine,
+ SelectEndOfLine,
+ SelectStartOfBlock,
+ SelectEndOfBlock,
+ SelectStartOfDocument,
+ SelectEndOfDocument,
+ DeleteStartOfWord,
+ DeleteEndOfWord,
+
+ SetTextDirectionDefault,
+ SetTextDirectionLeftToRight,
+ SetTextDirectionRightToLeft,
+
+ ToggleBold,
+ ToggleItalic,
+ ToggleUnderline,
+
+ InspectElement,
+
+ InsertParagraphSeparator,
+ InsertLineSeparator,
+
+ SelectAll,
+
+ WebActionCount
+ };
+
+ enum FindFlag {
+ FindBackward = 1,
+ FindCaseSensitively = 2,
+ FindWrapsAroundDocument = 4
+ };
+ Q_DECLARE_FLAGS(FindFlags, FindFlag)
+
+ enum LinkDelegationPolicy {
+ DontDelegateLinks,
+ DelegateExternalLinks,
+ DelegateAllLinks
+ };
+
+ enum WebWindowType {
+ WebBrowserWindow,
+ WebModalDialog
+ };
+
+ explicit QWebPage(QObject *parent = 0);
+ ~QWebPage();
+
+ QWebFrame *mainFrame() const;
+ QWebFrame *currentFrame() const;
+
+ QWebHistory *history() const;
+ QWebSettings *settings() const;
+
+ void setView(QWidget *view);
+ QWidget *view() const;
+
+ bool isModified() const;
+#ifndef QT_NO_UNDOSTACK
+ QUndoStack *undoStack() const;
+#endif
+
+#if QT_VERSION < 0x040400 && !defined(qdoc)
+ void setNetworkInterface(QWebNetworkInterface *interface);
+ QWebNetworkInterface *networkInterface() const;
+
+ // #### why is this in the page itself?
+#ifndef QT_NO_NETWORKPROXY
+ void setNetworkProxy(const QNetworkProxy& proxy);
+ QNetworkProxy networkProxy() const;
+#endif
+
+#else
+ void setNetworkAccessManager(QNetworkAccessManager *manager);
+ QNetworkAccessManager *networkAccessManager() const;
+#endif
+
+ void setPluginFactory(QWebPluginFactory *factory);
+ QWebPluginFactory *pluginFactory() const;
+
+ quint64 totalBytes() const;
+ quint64 bytesReceived() const;
+
+ QString selectedText() const;
+
+ QAction *action(WebAction action) const;
+ virtual void triggerAction(WebAction action, bool checked = false);
+
+ QSize viewportSize() const;
+ void setViewportSize(const QSize &size) const;
+
+ virtual bool event(QEvent*);
+ bool focusNextPrevChild(bool next);
+
+ QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+
+ bool findText(const QString &subString, FindFlags options = 0);
+
+ void setForwardUnsupportedContent(bool forward);
+ bool forwardUnsupportedContent() const;
+
+ void setLinkDelegationPolicy(LinkDelegationPolicy policy);
+ LinkDelegationPolicy linkDelegationPolicy() const;
+
+ void setPalette(const QPalette &palette);
+ QPalette palette() const;
+
+ void setContentEditable(bool editable);
+ bool isContentEditable() const;
+
+#ifndef QT_NO_CONTEXTMENU
+ bool swallowContextMenuEvent(QContextMenuEvent *event);
+#endif
+ void updatePositionDependentActions(const QPoint &pos);
+
+ QMenu *createStandardContextMenu();
+
+ enum Extension {
+ ChooseMultipleFilesExtension
+ };
+ class ExtensionOption
+ {};
+ class ExtensionReturn
+ {};
+
+ class ChooseMultipleFilesExtensionOption : public ExtensionOption {
+ public:
+ QWebFrame *parentFrame;
+ QStringList suggestedFileNames;
+ };
+
+ class ChooseMultipleFilesExtensionReturn : public ExtensionReturn {
+ public:
+ QStringList fileNames;
+ };
+
+ virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
+ virtual bool supportsExtension(Extension extension) const;
+
+ inline QWebPagePrivate* handle() const { return d; }
+
+Q_SIGNALS:
+ void loadStarted();
+ void loadProgress(int progress);
+ void loadFinished(bool ok);
+
+ void linkHovered(const QString &link, const QString &title, const QString &textContent);
+ void statusBarMessage(const QString& text);
+ void selectionChanged();
+ void frameCreated(QWebFrame *frame);
+ void geometryChangeRequested(const QRect& geom);
+ void repaintRequested(const QRect& dirtyRect);
+ void scrollRequested(int dx, int dy, const QRect& scrollViewRect);
+ void windowCloseRequested();
+ void printRequested(QWebFrame *frame);
+ void linkClicked(const QUrl &url);
+
+ void toolBarVisibilityChangeRequested(bool visible);
+ void statusBarVisibilityChangeRequested(bool visible);
+ void menuBarVisibilityChangeRequested(bool visible);
+
+#if QT_VERSION >= 0x040400
+ void unsupportedContent(QNetworkReply *reply);
+ void downloadRequested(const QNetworkRequest &request);
+#endif
+
+ void microFocusChanged();
+ void contentsChanged();
+ void databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
+
+ void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
+ void restoreFrameStateRequested(QWebFrame* frame);
+
+protected:
+ virtual QWebPage *createWindow(WebWindowType type);
+ virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
+
+#if QT_VERSION >= 0x040400
+ virtual bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type);
+#else
+ virtual bool acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, NavigationType type);
+#endif
+ virtual QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile);
+ virtual void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg);
+ virtual bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg);
+ virtual bool javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result);
+ virtual void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID);
+
+ virtual QString userAgentForUrl(const QUrl& url) const;
+
+private:
+ Q_PRIVATE_SLOT(d, void _q_onLoadProgressChanged(int))
+ Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked))
+ QWebPagePrivate *d;
+
+ friend class QWebFrame;
+ friend class QWebPagePrivate;
+ friend class QWebView;
+ friend class WebCore::ChromeClientQt;
+ friend class WebCore::EditorClientQt;
+ friend class WebCore::FrameLoaderClientQt;
+ friend class WebCore::InspectorClientQt;
+ friend class WebCore::ResourceHandle;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QWebPage::FindFlags)
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
new file mode 100644
index 0000000..a1f33ab
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -0,0 +1,173 @@
+/*
+ Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2008 Holger Hans Peter Freyther
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBPAGE_P_H
+#define QWEBPAGE_P_H
+
+#include <qbasictimer.h>
+#include <qnetworkproxy.h>
+#include <qpointer.h>
+#include <qevent.h>
+
+#include "qwebpage.h"
+#include "qwebhistory.h"
+#include "qwebframe.h"
+
+#include "KURL.h"
+#include "PlatformString.h"
+
+#include <wtf/RefPtr.h>
+
+namespace WebCore
+{
+ class ChromeClientQt;
+ class ContextMenuClientQt;
+ class ContextMenuItem;
+ class ContextMenu;
+ class EditorClientQt;
+ class Element;
+ class Node;
+ class Page;
+
+#ifndef QT_NO_CURSOR
+ class SetCursorEvent : public QEvent {
+ public:
+ static const int EventType = 724;
+ SetCursorEvent(const QCursor&);
+
+ QCursor cursor() const;
+ private:
+ QCursor m_cursor;
+ };
+#endif
+}
+
+QT_BEGIN_NAMESPACE
+class QUndoStack;
+class QMenu;
+class QBitArray;
+QT_END_NAMESPACE
+
+class QWebPagePrivate
+{
+public:
+ QWebPagePrivate(QWebPage *);
+ ~QWebPagePrivate();
+ void createMainFrame();
+#ifndef QT_NO_CONTEXTMENU
+ QMenu *createContextMenu(const WebCore::ContextMenu *webcoreMenu, const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions);
+#endif
+
+ QWebFrame *frameAt(const QPoint &pos) const;
+
+ void _q_onLoadProgressChanged(int);
+ void _q_webActionTriggered(bool checked);
+ void updateAction(QWebPage::WebAction action);
+ void updateNavigationActions();
+ void updateEditorActions();
+
+ void timerEvent(QTimerEvent*);
+
+ void mouseMoveEvent(QMouseEvent*);
+ void mousePressEvent(QMouseEvent*);
+ void mouseDoubleClickEvent(QMouseEvent*);
+ void mouseTripleClickEvent(QMouseEvent*);
+ void mouseReleaseEvent(QMouseEvent*);
+#ifndef QT_NO_CONTEXTMENU
+ void contextMenuEvent(QContextMenuEvent*);
+#endif
+#ifndef QT_NO_WHEELEVENT
+ void wheelEvent(QWheelEvent*);
+#endif
+ void keyPressEvent(QKeyEvent*);
+ void keyReleaseEvent(QKeyEvent*);
+ void focusInEvent(QFocusEvent*);
+ void focusOutEvent(QFocusEvent*);
+
+ void dragEnterEvent(QDragEnterEvent *);
+ void dragLeaveEvent(QDragLeaveEvent *);
+ void dragMoveEvent(QDragMoveEvent *);
+ void dropEvent(QDropEvent *);
+
+ void inputMethodEvent(QInputMethodEvent*);
+
+ void shortcutOverrideEvent(QKeyEvent*);
+ void leaveEvent(QEvent *);
+ bool handleScrolling(QKeyEvent*);
+
+#ifndef QT_NO_SHORTCUT
+ static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event);
+#endif
+ static const char* editorCommandForWebActions(QWebPage::WebAction action);
+
+ WebCore::ChromeClientQt *chromeClient;
+ WebCore::ContextMenuClientQt *contextMenuClient;
+ WebCore::EditorClientQt *editorClient;
+ WebCore::Page *page;
+
+ QPointer<QWebFrame> mainFrame;
+
+ QWebPage *q;
+#ifndef QT_NO_UNDOSTACK
+ QUndoStack *undoStack;
+#endif
+ QWidget *view;
+
+ bool insideOpenCall;
+ quint64 m_totalBytes;
+ quint64 m_bytesReceived;
+
+ QPoint tripleClick;
+ QBasicTimer tripleClickTimer;
+
+#if QT_VERSION < 0x040400
+ bool acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type);
+
+ QWebNetworkInterface *networkInterface;
+#ifndef QT_NO_NETWORKPROXY
+ QNetworkProxy networkProxy;
+#endif
+
+#else
+ bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type);
+ QNetworkAccessManager *networkManager;
+#endif
+
+ bool forwardUnsupportedContent;
+ QWebPage::LinkDelegationPolicy linkPolicy;
+
+ QSize viewportSize;
+ QWebHistory history;
+ QWebHitTestResult hitTestResult;
+#ifndef QT_NO_CONTEXTMENU
+ QPointer<QMenu> currentContextMenu;
+#endif
+ QWebSettings *settings;
+ QPalette palette;
+ bool editable;
+
+ QAction *actions[QWebPage::WebActionCount];
+
+ QWebPluginFactory *pluginFactory;
+
+ static bool drtRun;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
new file mode 100644
index 0000000..d2bb124
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -0,0 +1,216 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebpluginfactory.h"
+
+/*!
+ \class QWebPluginFactory
+ \since 4.4
+ \brief The QWebPluginFactory class creates plugins to be embedded into web
+ pages.
+
+ QWebPluginFactory is a factory for creating plugins for QWebPage. A plugin
+ factory can be installed on a QWebPage using QWebPage::setPluginFactory().
+
+ \note The plugin factory is only used if plugins are enabled through QWebSettings.
+
+ You can provide a QWebPluginFactory by implementing the plugins() and the
+ create() method. For plugins() it is necessary to describe the plugins the
+ factory can create, including a description and the supported MIME types.
+ The MIME types each plugin can handle should match the ones specified in
+ in the HTML \c{<object>} tag.
+
+ The create() method is called if the requested MIME type is supported. The
+ implementation has to return a new instance of the plugin requested for the
+ given MIME type and the specified URL.
+*/
+
+
+/*!
+ \class QWebPluginFactory::Plugin
+ \since 4.4
+ \brief the QWebPluginFactory::Plugin structure describes the properties of a plugin a QWebPluginFactory can create.
+*/
+
+/*!
+ \variable QWebPluginFactory::Plugin::name
+ The name of the plugin.
+*/
+
+/*!
+ \variable QWebPluginFactory::Plugin::description
+ The description of the plugin.
+*/
+
+/*!
+ \variable QWebPluginFactory::Plugin::mimeTypes
+ The list of mime types supported by the plugin.
+*/
+
+/*!
+ \class QWebPluginFactory::MimeType
+ \since 4.4
+ \brief The QWebPluginFactory::MimeType structure describes a mime type supported by a plugin.
+*/
+
+/*!
+ \variable QWebPluginFactory::MimeType::name
+
+ The full name of the MIME type; e.g., \c{text/plain} or \c{image/png}.
+*/
+
+/*!
+ \variable QWebPluginFactory::MimeType::description
+ The description of the mime type.
+*/
+
+/*!
+ \variable QWebPluginFactory::MimeType::fileExtensions
+ The list of file extensions that are used by this mime type.
+
+ For example, a mime type for PDF documents would return "pdf" as its file extension.
+*/
+
+/*!
+ Constructs a QWebPluginFactory with parent \a parent.
+*/
+QWebPluginFactory::QWebPluginFactory(QObject *parent)
+ : QObject(parent)
+{
+}
+
+/*!
+ Destructor.
+*/
+QWebPluginFactory::~QWebPluginFactory()
+{
+}
+
+/*!
+ \fn QList<Plugin> QWebPluginFactory::plugins() const = 0
+
+ This function is reimplemented in subclasses to return a list of
+ supported plugins the factory can create.
+
+ \note Currently, this function is only called when JavaScript programs
+ access the global \c plugins or \c mimetypes objects.
+*/
+
+/*!
+ This function is called to refresh the list of supported plugins. It may be called after a new plugin
+ has been installed in the system.
+*/
+void QWebPluginFactory::refreshPlugins()
+{
+}
+
+/*!
+ \fn QObject *QWebPluginFactory::create(const QString &mimeType, const QUrl &url,
+ const QStringList &argumentNames, const QStringList &argumentValues) const = 0
+
+ Implemented in subclasses to create a new plugin that can display content of
+ the MIME type given by \a mimeType. The URL of the content is provided in \a url.
+ The returned object should be a QWidget.
+
+ The HTML object element can provide parameters through the \c{<param>} tag.
+ The name and the value attributes of these tags are specified by the
+ \a argumentNames and \a argumentValues string lists.
+
+ For example:
+
+ \code
+ <object type="application/x-pdf" data="http://qtsoftware.com/document.pdf" width="500" height="400">
+ <param name="showTableOfContents" value="true" />
+ <param name="hideThumbnails" value="false" />
+ </object>
+ \endcode
+
+ The above object element will result in a call to create() with the following arguments:
+ \table
+ \header \o Parameter
+ \o Value
+ \row \o mimeType
+ \o "application/x-pdf"
+ \row \o url
+ \o "http://qtsoftware.com/document.pdf"
+ \row \o argumentNames
+ \o "showTableOfContents" "hideThumbnails"
+ \row \o argumentVaues
+ \o "true" "false"
+ \endtable
+
+ \note Ownership of the returned object will be transferred to the caller.
+*/
+
+/*!
+ \enum QWebPluginFactory::Extension
+
+ This enum describes the types of extensions that the plugin factory can support. Before using these extensions, you
+ should verify that the extension is supported by calling supportsExtension().
+
+ Currently there are no extensions.
+*/
+
+/*!
+ \class QWebPluginFactory::ExtensionOption
+ \since 4.4
+ \brief The ExtensionOption class provides an extended input argument to QWebPluginFactory's extension support.
+
+ \sa QWebPluginFactory::extension()
+*/
+
+/*!
+ \class QWebPluginFactory::ExtensionReturn
+ \since 4.4
+ \brief The ExtensionOption class provides an extended output argument to QWebPluginFactory's extension support.
+
+ \sa QWebPluginFactory::extension()
+*/
+
+/*!
+ This virtual function can be reimplemented in a QWebPluginFactory subclass to provide support for extensions. The \a option
+ argument is provided as input to the extension; the output results can be stored in \a output.
+
+ The behaviour of this function is determined by \a extension.
+
+ You can call supportsExtension() to check if an extension is supported by the factory.
+
+ By default, no extensions are supported, and this function returns false.
+
+ \sa supportsExtension(), Extension
+*/
+bool QWebPluginFactory::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output)
+{
+ Q_UNUSED(extension)
+ Q_UNUSED(option)
+ Q_UNUSED(output)
+ return false;
+}
+
+/*!
+ This virtual function returns true if the plugin factory supports \a extension; otherwise false is returned.
+
+ \sa extension()
+*/
+bool QWebPluginFactory::supportsExtension(Extension extension) const
+{
+ Q_UNUSED(extension)
+ return false;
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
new file mode 100644
index 0000000..3531b06
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
@@ -0,0 +1,74 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBPLUGINFACTORY_H
+#define QWEBPLUGINFACTORY_H
+
+#include "qwebkitglobal.h"
+
+#include <QtCore/qobject.h>
+#include <QtCore/qstringlist.h>
+
+QT_BEGIN_NAMESPACE
+class QUrl;
+class QString;
+QT_END_NAMESPACE
+class QWebPluginFactoryPrivate;
+
+class QWEBKIT_EXPORT QWebPluginFactory : public QObject
+{
+ Q_OBJECT
+public:
+ struct MimeType {
+ QString name;
+ QString description;
+ QStringList fileExtensions;
+ };
+
+ struct Plugin {
+ QString name;
+ QString description;
+ QList<MimeType> mimeTypes;
+ };
+
+ explicit QWebPluginFactory(QObject *parent = 0);
+ virtual ~QWebPluginFactory();
+
+ virtual QList<Plugin> plugins() const = 0;
+ virtual void refreshPlugins();
+
+ virtual QObject *create(const QString &mimeType,
+ const QUrl &url,
+ const QStringList &argumentNames,
+ const QStringList &argumentValues) const = 0;
+
+ enum Extension {
+ };
+ class ExtensionOption
+ {};
+ class ExtensionReturn
+ {};
+ virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
+ virtual bool supportsExtension(Extension extension) const;
+
+private:
+ QWebPluginFactoryPrivate *d;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
new file mode 100644
index 0000000..5217362
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -0,0 +1,176 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
+#include "qwebdatabase.h"
+#include "qwebdatabase_p.h"
+
+#include "DatabaseTracker.h"
+#include "KURL.h"
+#include "SecurityOrigin.h"
+#include <QStringList>
+
+using namespace WebCore;
+
+/*!
+ \class QWebSecurityOrigin
+ \since 4.5
+ \brief The QWebSecurityOrigin class defines a security boundary for web sites.
+
+ QWebSecurityOrigin provides access to the security domains defined by web sites.
+ An origin consists of a host name, a scheme, and a port number. Web sites with the same
+ security origin can access each other's resources for client-side scripting or databases.
+
+ ### diagram
+
+ For example the site \c{http://www.example.com/my/page.html} is allowed to share the same
+ database as \c{http://www.example.com/my/overview.html}, or access each other's
+ documents when used in HTML frame sets and JavaScript. At the same time it prevents
+ \c{http://www.malicious.com/evil.html} from accessing \c{http://www.example.com/}'s resources,
+ because they are of a different security origin.
+
+ QWebSecurity also provides access to all databases defined within a security origin.
+
+ For more information refer to the
+ \l{http://en.wikipedia.org/wiki/Same_origin_policy}{"Same origin policy" Wikipedia Article}.
+
+ \sa QWebFrame::securityOrigin()
+*/
+
+/*!
+ Constructs a security origin from \a other.
+*/
+QWebSecurityOrigin::QWebSecurityOrigin(const QWebSecurityOrigin& other) : d(other.d)
+{
+}
+
+/*!
+ Assigns the \a other security origin to this.
+*/
+QWebSecurityOrigin& QWebSecurityOrigin::operator=(const QWebSecurityOrigin& other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns the scheme defining the security origin.
+*/
+QString QWebSecurityOrigin::scheme() const
+{
+ return d->origin->protocol();
+}
+
+/*!
+ Returns the host name defining the security origin.
+*/
+QString QWebSecurityOrigin::host() const
+{
+ return d->origin->host();
+}
+
+/*!
+ Returns the port number defining the security origin.
+*/
+int QWebSecurityOrigin::port() const
+{
+ return d->origin->port();
+}
+
+/*!
+ Returns the number of bytes all databases in the security origin
+ use on the disk.
+*/
+qint64 QWebSecurityOrigin::databaseUsage() const
+{
+ return DatabaseTracker::tracker().usageForOrigin(d->origin.get());
+}
+
+/*!
+ Returns the quota for the databases in the security origin.
+*/
+qint64 QWebSecurityOrigin::databaseQuota() const
+{
+ return DatabaseTracker::tracker().quotaForOrigin(d->origin.get());
+}
+
+/*!
+ Sets the quota for the databases in the security origin to \a quota bytes.
+
+ If the quota is set to a value less than the current usage, the quota will remain
+ and no data will be purged to meet the new quota. However, no new data can be added
+ to databases in this origin.
+*/
+void QWebSecurityOrigin::setDatabaseQuota(qint64 quota)
+{
+ DatabaseTracker::tracker().setQuota(d->origin.get(), quota);
+}
+
+/*!
+ Destroys the security origin.
+*/
+QWebSecurityOrigin::~QWebSecurityOrigin()
+{
+}
+
+/*!
+ \internal
+*/
+QWebSecurityOrigin::QWebSecurityOrigin(QWebSecurityOriginPrivate* priv)
+{
+ d = priv;
+}
+
+/*!
+ Returns a list of all security origins with a database quota defined.
+*/
+QList<QWebSecurityOrigin> QWebSecurityOrigin::allOrigins()
+{
+ Vector<RefPtr<SecurityOrigin> > coreOrigins;
+ DatabaseTracker::tracker().origins(coreOrigins);
+ QList<QWebSecurityOrigin> webOrigins;
+
+ for (unsigned i = 0; i < coreOrigins.size(); ++i) {
+ QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(coreOrigins[i].get());
+ webOrigins.append(priv);
+ }
+ return webOrigins;
+}
+
+/*!
+ Returns a list of all databases defined in the security origin.
+*/
+QList<QWebDatabase> QWebSecurityOrigin::databases() const
+{
+ Vector<String> nameVector;
+ QList<QWebDatabase> databases;
+ if (!DatabaseTracker::tracker().databaseNamesForOrigin(d->origin.get(), nameVector))
+ return databases;
+ for (unsigned i = 0; i < nameVector.size(); ++i) {
+ QWebDatabasePrivate* priv = new QWebDatabasePrivate();
+ priv->name = nameVector[i];
+ priv->origin = this->d->origin;
+ QWebDatabase webDatabase(priv);
+ databases.append(webDatabase);
+ }
+ return databases;
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
new file mode 100644
index 0000000..ebe4a77
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _WEBSECURITYORIGIN_H_
+#define _WEBSECURITYORIGIN_H_
+
+#include <QtCore/qurl.h>
+#include <QtCore/qshareddata.h>
+
+#include "qwebkitglobal.h"
+
+namespace WebCore {
+ class SecurityOrigin;
+ class ChromeClientQt;
+};
+
+class QWebSecurityOriginPrivate;
+class QWebDatabase;
+class QWebFrame;
+
+class QWEBKIT_EXPORT QWebSecurityOrigin
+{
+public:
+ static QList<QWebSecurityOrigin> allOrigins();
+
+ ~QWebSecurityOrigin();
+
+ QString scheme() const;
+ QString host() const;
+ int port() const;
+
+ qint64 databaseUsage() const;
+ qint64 databaseQuota() const;
+
+ void setDatabaseQuota(qint64 quota);
+
+ QList<QWebDatabase> databases() const;
+
+ QWebSecurityOrigin(const QWebSecurityOrigin& other);
+ QWebSecurityOrigin &operator=(const QWebSecurityOrigin& other);
+private:
+ friend class QWebDatabase;
+ friend class QWebFrame;
+ friend class WebCore::ChromeClientQt;
+ QWebSecurityOrigin(QWebSecurityOriginPrivate* priv);
+
+private:
+ QExplicitlySharedDataPointer<QWebSecurityOriginPrivate> d;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h
new file mode 100644
index 0000000..73fe8ed
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h
@@ -0,0 +1,40 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _WEBSECURITYORIGIN_P_H_
+#define _WEBSECURITYORIGIN_P_H_
+
+#include "SecurityOrigin.h"
+#include "RefPtr.h"
+
+class QWebSecurityOriginPrivate : public QSharedData
+{
+public:
+ QWebSecurityOriginPrivate(WebCore::SecurityOrigin* o)
+ {
+ Q_ASSERT(o);
+ origin = o;
+ }
+ ~QWebSecurityOriginPrivate()
+ {
+ }
+ WTF::RefPtr<WebCore::SecurityOrigin> origin;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
new file mode 100644
index 0000000..1ad23f6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -0,0 +1,781 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebsettings.h"
+
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+
+#include "Cache.h"
+#include "Page.h"
+#include "PageCache.h"
+#include "Settings.h"
+#include "KURL.h"
+#include "PlatformString.h"
+#include "IconDatabase.h"
+#include "Image.h"
+#include "IntSize.h"
+#include "ApplicationCacheStorage.h"
+#include "DatabaseTracker.h"
+
+#include <QHash>
+#include <QSharedData>
+#include <QUrl>
+#include <QFileInfo>
+
+class QWebSettingsPrivate
+{
+public:
+ QWebSettingsPrivate(WebCore::Settings *wcSettings = 0)
+ : settings(wcSettings)
+ {
+ }
+
+ QHash<int, QString> fontFamilies;
+ QHash<int, int> fontSizes;
+ QHash<int, bool> attributes;
+ QUrl userStyleSheetLocation;
+ QString localStorageDatabasePath;
+ QString offlineWebApplicationCachePath;
+ qint64 offlineStorageDefaultQuota;
+
+ void apply();
+ WebCore::Settings *settings;
+};
+
+typedef QHash<int, QPixmap> WebGraphicHash;
+Q_GLOBAL_STATIC(WebGraphicHash, _graphics)
+
+static WebGraphicHash* graphics()
+{
+ WebGraphicHash* hash = _graphics();
+
+ if (hash->isEmpty()) {
+ hash->insert(QWebSettings::MissingImageGraphic, QPixmap(QLatin1String(":webkit/resources/missingImage.png")));
+ hash->insert(QWebSettings::MissingPluginGraphic, QPixmap(QLatin1String(":webkit/resources/nullPlugin.png")));
+ hash->insert(QWebSettings::DefaultFrameIconGraphic, QPixmap(QLatin1String(":webkit/resources/urlIcon.png")));
+ hash->insert(QWebSettings::TextAreaSizeGripCornerGraphic, QPixmap(QLatin1String(":webkit/resources/textAreaResizeCorner.png")));
+ }
+
+ return hash;
+}
+
+Q_GLOBAL_STATIC(QList<QWebSettingsPrivate *>, allSettings);
+
+void QWebSettingsPrivate::apply()
+{
+ if (settings) {
+ settings->setTextAreasAreResizable(true);
+
+ QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+
+ QString family = fontFamilies.value(QWebSettings::StandardFont,
+ global->fontFamilies.value(QWebSettings::StandardFont));
+ settings->setStandardFontFamily(family);
+
+ family = fontFamilies.value(QWebSettings::FixedFont,
+ global->fontFamilies.value(QWebSettings::FixedFont));
+ settings->setFixedFontFamily(family);
+
+ family = fontFamilies.value(QWebSettings::SerifFont,
+ global->fontFamilies.value(QWebSettings::SerifFont));
+ settings->setSerifFontFamily(family);
+
+ family = fontFamilies.value(QWebSettings::SansSerifFont,
+ global->fontFamilies.value(QWebSettings::SansSerifFont));
+ settings->setSansSerifFontFamily(family);
+
+ family = fontFamilies.value(QWebSettings::CursiveFont,
+ global->fontFamilies.value(QWebSettings::CursiveFont));
+ settings->setCursiveFontFamily(family);
+
+ family = fontFamilies.value(QWebSettings::FantasyFont,
+ global->fontFamilies.value(QWebSettings::FantasyFont));
+ settings->setFantasyFontFamily(family);
+
+ int size = fontSizes.value(QWebSettings::MinimumFontSize,
+ global->fontSizes.value(QWebSettings::MinimumFontSize));
+ settings->setMinimumFontSize(size);
+
+ size = fontSizes.value(QWebSettings::MinimumLogicalFontSize,
+ global->fontSizes.value(QWebSettings::MinimumLogicalFontSize));
+ settings->setMinimumLogicalFontSize(size);
+
+ size = fontSizes.value(QWebSettings::DefaultFontSize,
+ global->fontSizes.value(QWebSettings::DefaultFontSize));
+ settings->setDefaultFontSize(size);
+
+ size = fontSizes.value(QWebSettings::DefaultFixedFontSize,
+ global->fontSizes.value(QWebSettings::DefaultFixedFontSize));
+ settings->setDefaultFixedFontSize(size);
+
+ bool value = attributes.value(QWebSettings::AutoLoadImages,
+ global->attributes.value(QWebSettings::AutoLoadImages));
+ settings->setLoadsImagesAutomatically(value);
+
+ value = attributes.value(QWebSettings::JavascriptEnabled,
+ global->attributes.value(QWebSettings::JavascriptEnabled));
+ settings->setJavaScriptEnabled(value);
+
+ value = attributes.value(QWebSettings::JavascriptCanOpenWindows,
+ global->attributes.value(QWebSettings::JavascriptCanOpenWindows));
+ settings->setJavaScriptCanOpenWindowsAutomatically(value);
+
+ value = attributes.value(QWebSettings::JavaEnabled,
+ global->attributes.value(QWebSettings::JavaEnabled));
+ settings->setJavaEnabled(value);
+
+ value = attributes.value(QWebSettings::PluginsEnabled,
+ global->attributes.value(QWebSettings::PluginsEnabled));
+ settings->setPluginsEnabled(value);
+
+ value = attributes.value(QWebSettings::PrivateBrowsingEnabled,
+ global->attributes.value(QWebSettings::PrivateBrowsingEnabled));
+ settings->setPrivateBrowsingEnabled(value);
+
+ value = attributes.value(QWebSettings::JavascriptCanAccessClipboard,
+ global->attributes.value(QWebSettings::JavascriptCanAccessClipboard));
+ settings->setDOMPasteAllowed(value);
+
+ value = attributes.value(QWebSettings::DeveloperExtrasEnabled,
+ global->attributes.value(QWebSettings::DeveloperExtrasEnabled));
+ settings->setDeveloperExtrasEnabled(value);
+
+ QUrl location = !userStyleSheetLocation.isEmpty() ? userStyleSheetLocation : global->userStyleSheetLocation;
+ settings->setUserStyleSheetLocation(WebCore::KURL(location));
+
+ QString localStoragePath = !localStorageDatabasePath.isEmpty() ? localStorageDatabasePath : global->localStorageDatabasePath;
+ settings->setLocalStorageDatabasePath(localStoragePath);
+
+ value = attributes.value(QWebSettings::ZoomTextOnly,
+ global->attributes.value(QWebSettings::ZoomTextOnly));
+ settings->setZoomsTextOnly(value);
+
+ value = attributes.value(QWebSettings::PrintElementBackgrounds,
+ global->attributes.value(QWebSettings::PrintElementBackgrounds));
+ settings->setShouldPrintBackgrounds(value);
+
+ value = attributes.value(QWebSettings::OfflineStorageDatabaseEnabled,
+ global->attributes.value(QWebSettings::OfflineStorageDatabaseEnabled));
+ settings->setDatabasesEnabled(value);
+
+ value = attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled,
+ global->attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled));
+ settings->setOfflineWebApplicationCacheEnabled(value);
+
+ value = attributes.value(QWebSettings::LocalStorageDatabaseEnabled,
+ global->attributes.value(QWebSettings::LocalStorageDatabaseEnabled));
+ settings->setLocalStorageEnabled(value);
+ } else {
+ QList<QWebSettingsPrivate *> settings = *::allSettings();
+ for (int i = 0; i < settings.count(); ++i)
+ settings[i]->apply();
+ }
+}
+
+/*!
+ Returns the global settings object.
+
+ Any setting changed on the default object is automatically applied to all
+ QWebPage instances where the particular setting is not overriden already.
+*/
+QWebSettings *QWebSettings::globalSettings()
+{
+ static QWebSettings *global = 0;
+ if (!global)
+ global = new QWebSettings;
+ return global;
+}
+
+/*!
+ \class QWebSettings
+ \since 4.4
+ \brief The QWebSettings class provides an object to store the settings used
+ by QWebPage and QWebFrame.
+
+ Each QWebPage object has its own QWebSettings object, which configures the
+ settings for that page. If a setting is not configured, then it is looked
+ up in the global settings object, which can be accessed using
+ QWebSettings::globalSettings().
+
+ QWebSettings allows configuring font properties such as font size and font
+ family, the location of a custom stylesheet, and generic attributes like java
+ script, plugins, etc. The \l{QWebSettings::WebAttribute}{WebAttribute}
+ enum further describes this.
+
+ QWebSettings also configures global properties such as the web page memory
+ cache and the web page icon database, local database storage and offline
+ applications storage.
+
+ \section1 Web Application Support
+
+ WebKit provides support for features specified in \l{HTML 5} that improve the
+ performance and capabilities of Web applications. These include client-side
+ (offline) storage and the use of a Web application cache.
+
+ Client-side (offline) storage is an improvement over the use of cookies to
+ store persistent data in Web applications. Applications can configure and
+ enable the use of an offline storage database by calling the
+ setOfflineStoragePath() with an appropriate file path, and can limit the quota
+ for each application by calling setOfflineStorageDefaultQuota().
+
+ \sa QWebPage::settings(), QWebView::settings(), {Browser}
+*/
+
+/*!
+ \enum QWebSettings::FontFamily
+
+ This enum describes the generic font families defined by CSS 2.
+ For more information see the
+ \l{http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families}{CSS standard}.
+
+ \value StandardFont
+ \value FixedFont
+ \value SerifFont
+ \value SansSerifFont
+ \value CursiveFont
+ \value FantasyFont
+*/
+
+/*!
+ \enum QWebSettings::FontSize
+
+ This enum describes the font sizes configurable through QWebSettings.
+
+ \value MinimumFontSize The hard minimum font size.
+ \value MinimumLogicalFontSize The minimum logical font size that is applied
+ after zooming with QWebFrame's textSizeMultiplier().
+ \value DefaultFontSize The default font size for regular text.
+ \value DefaultFixedFontSize The default font size for fixed-pitch text.
+*/
+
+/*!
+ \enum QWebSettings::WebGraphic
+
+ This enums describes the standard graphical elements used in webpages.
+
+ \value MissingImageGraphic The replacement graphic shown when an image could not be loaded.
+ \value MissingPluginGraphic The replacement graphic shown when a plugin could not be loaded.
+ \value DefaultFrameIconGraphic The default icon for QWebFrame::icon().
+ \value TextAreaSizeGripCornerGraphic The graphic shown for the size grip of text areas.
+*/
+
+/*!
+ \enum QWebSettings::WebAttribute
+
+ This enum describes various attributes that are configurable through QWebSettings.
+
+ \value AutoLoadImages Specifies whether images are automatically loaded in
+ web pages.
+ \value JavascriptEnabled Enables or disables the running of JavaScript
+ programs.
+ \value JavaEnabled Enables or disables Java applets.
+ Currently Java applets are not supported.
+ \value PluginsEnabled Enables or disables plugins in Web pages.
+ \value PrivateBrowsingEnabled Private browsing prevents WebKit from
+ recording visited pages in the history and storing web page icons.
+ \value JavascriptCanOpenWindows Specifies whether JavaScript programs
+ can open new windows.
+ \value JavascriptCanAccessClipboard Specifies whether JavaScript programs
+ can read or write to the clipboard.
+ \value DeveloperExtrasEnabled Enables extra tools for Web developers.
+ Currently this enables the "Inspect" element in the context menu,
+ which shows the WebKit WebInspector for web site debugging.
+ \value LinksIncludedInFocusChain Specifies whether hyperlinks should be
+ included in the keyboard focus chain.
+ \value ZoomTextOnly Specifies whether the zoom factor on a frame applies to
+ only the text or all content.
+ \value PrintElementBackgrounds Specifies whether the background color and images
+ are also drawn when the page is printed.
+ \value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5
+ offline storage feature is enabled or not.
+ \value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5
+ web application cache feature is enabled or not.
+ \value LocalStorageDatabaseEnabled Specifies whether support for the HTML 5
+ local storage feature is enabled or not.
+*/
+
+/*!
+ \internal
+*/
+QWebSettings::QWebSettings()
+ : d(new QWebSettingsPrivate)
+{
+ // Initialize our global defaults
+ d->fontSizes.insert(QWebSettings::MinimumFontSize, 0);
+ d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 0);
+ d->fontSizes.insert(QWebSettings::DefaultFontSize, 14);
+ d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 14);
+ d->fontFamilies.insert(QWebSettings::StandardFont, QLatin1String("Arial"));
+ d->fontFamilies.insert(QWebSettings::FixedFont, QLatin1String("Courier New"));
+ d->fontFamilies.insert(QWebSettings::SerifFont, QLatin1String("Times New Roman"));
+ d->fontFamilies.insert(QWebSettings::SansSerifFont, QLatin1String("Arial"));
+ d->fontFamilies.insert(QWebSettings::CursiveFont, QLatin1String("Arial"));
+ d->fontFamilies.insert(QWebSettings::FantasyFont, QLatin1String("Arial"));
+
+ d->attributes.insert(QWebSettings::AutoLoadImages, true);
+ d->attributes.insert(QWebSettings::JavascriptEnabled, true);
+ d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true);
+ d->attributes.insert(QWebSettings::ZoomTextOnly, false);
+ d->attributes.insert(QWebSettings::PrintElementBackgrounds, true);
+ d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true);
+ d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true);
+ d->attributes.insert(QWebSettings::LocalStorageDatabaseEnabled, true);
+ d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
+
+}
+
+/*!
+ \internal
+*/
+QWebSettings::QWebSettings(WebCore::Settings *settings)
+ : d(new QWebSettingsPrivate(settings))
+{
+ d->settings = settings;
+ d->apply();
+ allSettings()->append(d);
+}
+
+/*!
+ \internal
+*/
+QWebSettings::~QWebSettings()
+{
+ if (d->settings)
+ allSettings()->removeAll(d);
+
+ delete d;
+}
+
+/*!
+ Sets the font size for \a type to \a size.
+*/
+void QWebSettings::setFontSize(FontSize type, int size)
+{
+ d->fontSizes.insert(type, size);
+ d->apply();
+}
+
+/*!
+ Returns the default font size for \a type.
+*/
+int QWebSettings::fontSize(FontSize type) const
+{
+ int defaultValue = 0;
+ if (d->settings) {
+ QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+ defaultValue = global->fontSizes.value(type);
+ }
+ return d->fontSizes.value(type, defaultValue);
+}
+
+/*!
+ Resets the font size for \a type to the size specified in the global
+ settings object.
+
+ This function has no effect on the global QWebSettings instance.
+*/
+void QWebSettings::resetFontSize(FontSize type)
+{
+ if (d->settings) {
+ d->fontSizes.remove(type);
+ d->apply();
+ }
+}
+
+/*!
+ Specifies the location of a user stylesheet to load with every web page.
+
+ The \a location can be a URL or a path on the local filesystem.
+
+ \sa userStyleSheetUrl()
+*/
+void QWebSettings::setUserStyleSheetUrl(const QUrl &location)
+{
+ d->userStyleSheetLocation = location;
+ d->apply();
+}
+
+/*!
+ Returns the location of the user stylesheet.
+
+ \sa setUserStyleSheetUrl()
+*/
+QUrl QWebSettings::userStyleSheetUrl() const
+{
+ return d->userStyleSheetLocation;
+}
+
+/*!
+ Sets the path of the icon database to \a path. The icon database is used
+ to store "favicons" associated with web sites.
+
+ \a path must point to an existing directory where the icons are stored.
+
+ Setting an empty path disables the icon database.
+*/
+void QWebSettings::setIconDatabasePath(const QString &path)
+{
+ WebCore::iconDatabase()->delayDatabaseCleanup();
+
+ if (!path.isEmpty()) {
+ WebCore::iconDatabase()->setEnabled(true);
+ QFileInfo info(path);
+ if (info.isDir() && info.isWritable())
+ WebCore::iconDatabase()->open(path);
+ } else {
+ WebCore::iconDatabase()->setEnabled(false);
+ WebCore::iconDatabase()->close();
+ }
+}
+
+/*!
+ Returns the path of the icon database or an empty string if the icon
+ database is disabled.
+
+ \sa setIconDatabasePath(), clearIconDatabase()
+*/
+QString QWebSettings::iconDatabasePath()
+{
+ if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen()) {
+ return WebCore::iconDatabase()->databasePath();
+ } else {
+ return QString();
+ }
+}
+
+/*!
+ Clears the icon database.
+*/
+void QWebSettings::clearIconDatabase()
+{
+ if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen())
+ WebCore::iconDatabase()->removeAllIcons();
+}
+
+/*!
+ Returns the web site's icon for \a url.
+
+ If the web site does not specify an icon, or the icon is not in the
+ database, a null QIcon is returned.
+
+ \note The returned icon's size is arbitrary.
+
+ \sa setIconDatabasePath()
+*/
+QIcon QWebSettings::iconForUrl(const QUrl &url)
+{
+ WebCore::Image* image = WebCore::iconDatabase()->iconForPageURL(WebCore::KURL(url).string(),
+ WebCore::IntSize(16, 16));
+ if (!image) {
+ return QPixmap();
+ }
+ QPixmap *icon = image->nativeImageForCurrentFrame();
+ if (!icon) {
+ return QPixmap();
+ }
+ return *icon;
+}
+
+/*!
+ Sets \a graphic to be drawn when QtWebKit needs to draw an image of the
+ given \a type.
+
+ For example, when an image cannot be loaded the pixmap specified by
+ \l{QWebSettings::WebGraphic}{MissingImageGraphic} is drawn instead.
+
+ \sa webGraphic()
+*/
+void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap &graphic)
+{
+ WebGraphicHash *h = graphics();
+ if (graphic.isNull())
+ h->remove(type);
+ else
+ h->insert(type, graphic);
+}
+
+/*!
+ Returns a previously set pixmap used to draw replacement graphics of the
+ specified \a type.
+
+ For example, when an image cannot be loaded the pixmap specified by
+ \l{QWebSettings::WebGraphic}{MissingImageGraphic} is drawn instead.
+
+ \sa setWebGraphic()
+*/
+QPixmap QWebSettings::webGraphic(WebGraphic type)
+{
+ return graphics()->value(type);
+}
+
+/*!
+ Sets the maximum number of pages to hold in the memory cache to \a pages.
+*/
+void QWebSettings::setMaximumPagesInCache(int pages)
+{
+ WebCore::pageCache()->setCapacity(qMax(0, pages));
+}
+
+/*!
+ Returns the maximum number of web pages that are kept in the memory cache.
+*/
+int QWebSettings::maximumPagesInCache()
+{
+ return WebCore::pageCache()->capacity();
+}
+
+/*!
+ Specifies the capacities for the memory cache for dead objects such as
+ stylesheets or scripts.
+
+ The \a cacheMinDeadCapacity specifies the \e minimum number of bytes that
+ dead objects should consume when the cache is under pressure.
+
+ \a cacheMaxDead is the \e maximum number of bytes that dead objects should
+ consume when the cache is \bold not under pressure.
+
+ \a totalCapacity specifies the \e maximum number of bytes that the cache
+ should consume \bold overall.
+
+ The cache is enabled by default. Calling setObjectCacheCapacities(0, 0, 0)
+ will disable the cache. Calling it with one non-zero enables it again.
+*/
+void QWebSettings::setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity)
+{
+ bool disableCache = cacheMinDeadCapacity == 0 && cacheMaxDead == 0 && totalCapacity == 0;
+ WebCore::cache()->setDisabled(disableCache);
+
+ WebCore::cache()->setCapacities(qMax(0, cacheMinDeadCapacity),
+ qMax(0, cacheMaxDead),
+ qMax(0, totalCapacity));
+}
+
+/*!
+ Sets the actual font family to \a family for the specified generic family,
+ \a which.
+*/
+void QWebSettings::setFontFamily(FontFamily which, const QString &family)
+{
+ d->fontFamilies.insert(which, family);
+ d->apply();
+}
+
+/*!
+ Returns the actual font family for the specified generic font family,
+ \a which.
+*/
+QString QWebSettings::fontFamily(FontFamily which) const
+{
+ QString defaultValue;
+ if (d->settings) {
+ QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+ defaultValue = global->fontFamilies.value(which);
+ }
+ return d->fontFamilies.value(which, defaultValue);
+}
+
+/*!
+ Resets the actual font family to the default font family, specified by
+ \a which.
+
+ This function has no effect on the global QWebSettings instance.
+*/
+void QWebSettings::resetFontFamily(FontFamily which)
+{
+ if (d->settings) {
+ d->fontFamilies.remove(which);
+ d->apply();
+ }
+}
+
+/*!
+ \fn void QWebSettings::setAttribute(WebAttribute attribute, bool on)
+
+ Enables or disables the specified \a attribute feature depending on the
+ value of \a on.
+*/
+void QWebSettings::setAttribute(WebAttribute attr, bool on)
+{
+ d->attributes.insert(attr, on);
+ d->apply();
+}
+
+/*!
+ \fn bool QWebSettings::testAttribute(WebAttribute attribute) const
+
+ Returns true if \a attribute is enabled; otherwise returns false.
+*/
+bool QWebSettings::testAttribute(WebAttribute attr) const
+{
+ bool defaultValue = false;
+ if (d->settings) {
+ QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+ defaultValue = global->attributes.value(attr);
+ }
+ return d->attributes.value(attr, defaultValue);
+}
+
+/*!
+ \fn void QWebSettings::resetAttribute(WebAttribute attribute)
+
+ Resets the setting of \a attribute.
+ This function has no effect on the global QWebSettings instance.
+
+ \sa globalSettings()
+*/
+void QWebSettings::resetAttribute(WebAttribute attr)
+{
+ if (d->settings) {
+ d->attributes.remove(attr);
+ d->apply();
+ }
+}
+
+/*!
+ \since 4.5
+
+ Sets the path for HTML5 offline storage to \a path.
+
+ \a path must point to an existing directory where the databases are stored.
+
+ Setting an empty path disables the feature.
+
+ \sa offlineStoragePath()
+*/
+void QWebSettings::setOfflineStoragePath(const QString& path)
+{
+#if ENABLE(DATABASE)
+ WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(path);
+#endif
+}
+
+/*!
+ \since 4.5
+
+ Returns the path of the HTML5 offline storage or an empty string if the
+ feature is disabled.
+
+ \sa setOfflineStoragePath()
+*/
+QString QWebSettings::offlineStoragePath()
+{
+#if ENABLE(DATABASE)
+ return WebCore::DatabaseTracker::tracker().databaseDirectoryPath();
+#else
+ return QString();
+#endif
+}
+
+/*!
+ \since 4.5
+
+ Sets the value of the default quota for new offline storage databases
+ to \a maximumSize.
+*/
+void QWebSettings::setOfflineStorageDefaultQuota(qint64 maximumSize)
+{
+ QWebSettings::globalSettings()->d->offlineStorageDefaultQuota = maximumSize;
+}
+
+/*!
+ \since 4.5
+
+ Returns the value of the default quota for new offline storage databases.
+*/
+qint64 QWebSettings::offlineStorageDefaultQuota()
+{
+ return QWebSettings::globalSettings()->d->offlineStorageDefaultQuota;
+}
+
+/*
+ \internal
+ \relates QWebSettings
+
+ Sets the path for HTML5 offline web application cache storage to \a path.
+
+ \a path must point to an existing directory where the cache is stored.
+
+ Setting an empty path disables the feature.
+
+ \sa offlineWebApplicationCachePath()
+*/
+void QWEBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QString& path)
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ WebCore::cacheStorage().setCacheDirectory(path);
+#endif
+}
+
+/*
+ \internal
+ \relates QWebSettings
+
+ Returns the path of the HTML5 offline web application cache storage
+ or an empty string if the feature is disabled.
+
+ \sa setOfflineWebApplicationCachePath()
+*/
+QString QWEBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ return WebCore::cacheStorage().cacheDirectory();
+#else
+ return QString();
+#endif
+}
+
+/*
+ \since 4.5
+ \relates QWebSettings
+
+ Sets the path for HTML5 local storage databases to \a path.
+
+ \a path must point to an existing directory where the cache is stored.
+
+ Setting an empty path disables the feature.
+
+ \sa localStorageDatabasePath()
+*/
+void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path)
+{
+ QWebSettingsPrivate *d = settings->handle();
+ d->localStorageDatabasePath = path;
+ d->apply();
+}
+
+/*
+ \since 4.5
+ \relates QWebSettings
+
+ Returns the path for HTML5 local storage databases
+ or an empty string if the feature is disabled.
+
+ \sa setLocalStorageDatabasePath()
+*/
+QString QWEBKIT_EXPORT qt_websettings_localStorageDatabasePath(QWebSettings* settings)
+{
+ return settings->handle()->localStorageDatabasePath;
+}
+
+/*!
+ \fn QWebSettingsPrivate* QWebSettings::handle() const
+ \internal
+*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
new file mode 100644
index 0000000..3d0660b
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
@@ -0,0 +1,130 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBSETTINGS_H
+#define QWEBSETTINGS_H
+
+#include "qwebkitglobal.h"
+
+#include <QtCore/qstring.h>
+#include <QtGui/qpixmap.h>
+#include <QtGui/qicon.h>
+#include <QtCore/qshareddata.h>
+
+namespace WebCore
+{
+ class Settings;
+}
+
+class QWebPage;
+class QWebSettingsPrivate;
+QT_BEGIN_NAMESPACE
+class QUrl;
+QT_END_NAMESPACE
+
+class QWEBKIT_EXPORT QWebSettings
+{
+public:
+ enum FontFamily {
+ StandardFont,
+ FixedFont,
+ SerifFont,
+ SansSerifFont,
+ CursiveFont,
+ FantasyFont
+ };
+ enum WebAttribute {
+ AutoLoadImages,
+ JavascriptEnabled,
+ JavaEnabled,
+ PluginsEnabled,
+ PrivateBrowsingEnabled,
+ JavascriptCanOpenWindows,
+ JavascriptCanAccessClipboard,
+ DeveloperExtrasEnabled,
+ LinksIncludedInFocusChain,
+ ZoomTextOnly,
+ PrintElementBackgrounds,
+ OfflineStorageDatabaseEnabled,
+ OfflineWebApplicationCacheEnabled,
+ LocalStorageDatabaseEnabled
+ };
+ enum WebGraphic {
+ MissingImageGraphic,
+ MissingPluginGraphic,
+ DefaultFrameIconGraphic,
+ TextAreaSizeGripCornerGraphic
+ };
+ enum FontSize {
+ MinimumFontSize,
+ MinimumLogicalFontSize,
+ DefaultFontSize,
+ DefaultFixedFontSize
+ };
+
+ static QWebSettings *globalSettings();
+
+ void setFontFamily(FontFamily which, const QString &family);
+ QString fontFamily(FontFamily which) const;
+ void resetFontFamily(FontFamily which);
+
+ void setFontSize(FontSize type, int size);
+ int fontSize(FontSize type) const;
+ void resetFontSize(FontSize type);
+
+ void setAttribute(WebAttribute attr, bool on);
+ bool testAttribute(WebAttribute attr) const;
+ void resetAttribute(WebAttribute attr);
+
+ void setUserStyleSheetUrl(const QUrl &location);
+ QUrl userStyleSheetUrl() const;
+
+ static void setIconDatabasePath(const QString &location);
+ static QString iconDatabasePath();
+ static void clearIconDatabase();
+ static QIcon iconForUrl(const QUrl &url);
+
+ static void setWebGraphic(WebGraphic type, const QPixmap &graphic);
+ static QPixmap webGraphic(WebGraphic type);
+
+ static void setMaximumPagesInCache(int pages);
+ static int maximumPagesInCache();
+ static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity);
+
+ static void setOfflineStoragePath(const QString& path);
+ static QString offlineStoragePath();
+ static void setOfflineStorageDefaultQuota(qint64 maximumSize);
+ static qint64 offlineStorageDefaultQuota();
+
+ inline QWebSettingsPrivate* handle() const { return d; }
+
+private:
+ friend class QWebPagePrivate;
+ friend class QWebSettingsPrivate;
+
+ Q_DISABLE_COPY(QWebSettings)
+
+ QWebSettings();
+ QWebSettings(WebCore::Settings *settings);
+ ~QWebSettings();
+
+ QWebSettingsPrivate *d;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
new file mode 100644
index 0000000..ea503a1
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -0,0 +1,962 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2008 Holger Hans Peter Freyther
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebview.h"
+#include "qwebframe.h"
+#include "qwebpage_p.h"
+
+#include "qbitmap.h"
+#include "qevent.h"
+#include "qpainter.h"
+#include "qprinter.h"
+
+class QWebViewPrivate
+{
+public:
+ QWebViewPrivate(QWebView *view)
+ : view(view)
+ , page(0)
+#ifndef QT_NO_CURSOR
+ , cursorSetByWebCore(false)
+ , usesWebCoreCursor(true)
+#endif
+ {}
+
+ QWebView *view;
+ QWebPage *page;
+
+
+#ifndef QT_NO_CURSOR
+ /*
+ * We keep track of if we have called setCursor and if the CursorChange
+ * event is sent due our setCursor call and if we currently use the WebCore
+ * Cursor and use it to decide if we can update to another WebCore Cursor.
+ */
+ bool cursorSetByWebCore;
+ bool usesWebCoreCursor;
+
+ void setCursor(const QCursor& newCursor)
+ {
+ webCoreCursor = newCursor;
+
+ if (usesWebCoreCursor) {
+ cursorSetByWebCore = true;
+ view->setCursor(webCoreCursor);
+ }
+ }
+
+ QCursor webCoreCursor;
+#endif
+};
+
+/*!
+ \class QWebView
+ \since 4.4
+ \brief The QWebView class provides a widget that is used to view and edit
+ web documents.
+ \ingroup advanced
+
+ QWebView is the main widget component of the QtWebKit web browsing module.
+ It can be used in various applications to display web content live from the
+ Internet.
+
+ The image below shows QWebView previewed in \QD with the Trolltech website.
+
+ \image qwebview-url.png
+
+ A web site can be loaded onto QWebView with the load() function. Like all
+ Qt Widgets, the show() function must be invoked in order to display
+ QWebView. The snippet below illustrates this:
+
+ \snippet doc/src/snippets/webkit/simple/main.cpp Using QWebView
+
+ Alternatively, setUrl() can also be used to load a web site. If you have
+ the HTML content readily available, you can use setHtml() instead.
+
+ The loadStarted() signal is emitted when the view begins loading. The
+ loadProgress() signal, on the other hand, is emitted whenever an element of
+ the web view completes loading, such as an embedded image, a script, etc.
+ Finally, the loadFinished() signal is emitted when the view has loaded
+ completely. It's argument - either \c true or \c false - indicates
+ load success or failure.
+
+ The page() function returns a pointer to the web page object. See
+ \l{Elements of QWebView} for an explanation of how the web page
+ is related to the view. To modify your web view's settings, you can access
+ the QWebSettings object with the settings() function. With QWebSettings,
+ you can change the default fonts, enable or disable features such as
+ JavaScript and plugins.
+
+ The title of an HTML document can be accessed with the title() property.
+ Additionally, a web site may also specify an icon, which can be accessed
+ using the icon() property. If the title or the icon changes, the corresponding
+ titleChanged() and iconChanged() signals will be emitted. The
+ textSizeMultiplier() property can be used to change the overall size of
+ the text displayed in the web view.
+
+ If you require a custom context menu, you can implement it by reimplementing
+ \l{QWidget::}{contextMenuEvent()} and populating your QMenu with the actions
+ obtained from pageAction(). More functionality such as reloading the view,
+ copying selected text to the clipboard, or pasting into the view, is also
+ encapsulated within the QAction objects returned by pageAction(). These
+ actions can be programmatically triggered using triggerPageAction().
+ Alternatively, the actions can be added to a toolbar or a menu directly.
+ QWebView maintains the state of the returned actions but allows
+ modification of action properties such as \l{QAction::}{text} or
+ \l{QAction::}{icon}.
+
+ A QWebView can be printed onto a QPrinter using the print() function.
+ This function is marked as a slot and can be conveniently connected to
+ \l{QPrintPreviewDialog}'s \l{QPrintPreviewDialog::}{paintRequested()}
+ signal.
+
+ If you want to provide support for web sites that allow the user to open
+ new windows, such as pop-up windows, you can subclass QWebView and
+ reimplement the createWindow() function.
+
+ \section1 Elements of QWebView
+
+ QWebView consists of other objects such as QWebFrame and QWebPage. The
+ flowchart below shows these elements are related.
+
+ \image qwebview-diagram.png
+
+ \note It is possible to use QWebPage and QWebFrame, without using QWebView,
+ if you do not require QWidget attributes. Nevertheless, QtWebKit depends
+ on QtGui, so you should use a QApplication instead of QCoreApplication.
+
+ \sa {Previewer Example}, {Browser}
+*/
+
+/*!
+ Constructs an empty QWebView with parent \a parent.
+
+ \sa load()
+*/
+QWebView::QWebView(QWidget *parent)
+ : QWidget(parent)
+{
+ d = new QWebViewPrivate(this);
+
+#if !defined(Q_WS_QWS)
+ setAttribute(Qt::WA_InputMethodEnabled);
+#endif
+
+ setAcceptDrops(true);
+
+ setMouseTracking(true);
+ setFocusPolicy(Qt::WheelFocus);
+}
+
+/*!
+ Destroys the web view.
+*/
+QWebView::~QWebView()
+{
+ if (d->page)
+ d->page->d->view = 0;
+
+ if (d->page && d->page->parent() == this)
+ delete d->page;
+ delete d;
+}
+
+/*!
+ Returns a pointer to the underlying web page.
+
+ \sa setPage()
+*/
+QWebPage *QWebView::page() const
+{
+ if (!d->page) {
+ QWebView *that = const_cast<QWebView *>(this);
+ that->setPage(new QWebPage(that));
+ }
+ return d->page;
+}
+
+/*!
+ Makes \a page the new web page of the web view.
+
+ The parent QObject of the provided page remains the owner
+ of the object. If the current document is a child of the web
+ view, it will be deleted.
+
+ \sa page()
+*/
+void QWebView::setPage(QWebPage *page)
+{
+ if (d->page == page)
+ return;
+ if (d->page) {
+ if (d->page->parent() == this) {
+ delete d->page;
+ } else {
+ d->page->disconnect(this);
+ }
+ }
+ d->page = page;
+ if (d->page) {
+ d->page->setView(this);
+ d->page->setPalette(palette());
+ // #### connect signals
+ QWebFrame *mainFrame = d->page->mainFrame();
+ connect(mainFrame, SIGNAL(titleChanged(const QString&)),
+ this, SIGNAL(titleChanged(const QString&)));
+ connect(mainFrame, SIGNAL(iconChanged()),
+ this, SIGNAL(iconChanged()));
+ connect(mainFrame, SIGNAL(urlChanged(const QUrl &)),
+ this, SIGNAL(urlChanged(const QUrl &)));
+
+ connect(d->page, SIGNAL(loadStarted()),
+ this, SIGNAL(loadStarted()));
+ connect(d->page, SIGNAL(loadProgress(int)),
+ this, SIGNAL(loadProgress(int)));
+ connect(d->page, SIGNAL(loadFinished(bool)),
+ this, SIGNAL(loadFinished(bool)));
+ connect(d->page, SIGNAL(statusBarMessage(const QString &)),
+ this, SIGNAL(statusBarMessage(const QString &)));
+ connect(d->page, SIGNAL(linkClicked(const QUrl &)),
+ this, SIGNAL(linkClicked(const QUrl &)));
+
+ connect(d->page, SIGNAL(microFocusChanged()),
+ this, SLOT(updateMicroFocus()));
+ }
+ setAttribute(Qt::WA_OpaquePaintEvent, d->page);
+ update();
+}
+
+/*!
+ Loads the specified \a url and displays it.
+
+ \note The view remains the same until enough data has arrived to display the new \a url.
+
+ \sa setUrl(), url(), urlChanged()
+*/
+void QWebView::load(const QUrl &url)
+{
+ page()->mainFrame()->load(url);
+}
+
+/*!
+ \fn void QWebView::load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation, const QByteArray &body)
+
+ Loads a network request, \a request, using the method specified in \a operation.
+
+ \a body is optional and is only used for POST operations.
+
+ \note The view remains the same until enough data has arrived to display the new url.
+
+ \sa url(), urlChanged()
+*/
+
+#if QT_VERSION < 0x040400 && !defined(qdoc)
+void QWebView::load(const QWebNetworkRequest &request)
+#else
+void QWebView::load(const QNetworkRequest &request,
+ QNetworkAccessManager::Operation operation,
+ const QByteArray &body)
+#endif
+{
+ page()->mainFrame()->load(request
+#if QT_VERSION >= 0x040400
+ , operation, body
+#endif
+ );
+}
+
+/*!
+ Sets the content of the web view to the specified \a html.
+
+ External objects such as stylesheets or images referenced in the HTML
+ document are located relative to \a baseUrl.
+
+ When using this method, WebKit assumes that external resources such as
+ JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
+ specified. For example, the encoding of an external script can be specified
+ through the charset attribute of the HTML script tag. Alternatively, the
+ encoding can also be specified by the web server.
+
+ \sa load(), setContent(), QWebFrame::toHtml()
+*/
+void QWebView::setHtml(const QString &html, const QUrl &baseUrl)
+{
+ page()->mainFrame()->setHtml(html, baseUrl);
+}
+
+/*!
+ Sets the content of the web view to the specified content \a data. If the \a mimeType argument
+ is empty it is currently assumed that the content is HTML but in future versions we may introduce
+ auto-detection.
+
+ External objects referenced in the content are located relative to \a baseUrl.
+
+ \sa load(), setHtml(), QWebFrame::toHtml()
+*/
+void QWebView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
+{
+ page()->mainFrame()->setContent(data, mimeType, baseUrl);
+}
+
+/*!
+ Returns a pointer to the view's history of navigated web pages.
+
+ It is equivalent to
+
+ \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 0
+*/
+QWebHistory *QWebView::history() const
+{
+ return page()->history();
+}
+
+/*!
+ Returns a pointer to the view/page specific settings object.
+
+ It is equivalent to
+
+ \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 1
+
+ \sa QWebSettings::globalSettings()
+*/
+QWebSettings *QWebView::settings() const
+{
+ return page()->settings();
+}
+
+/*!
+ \property QWebView::title
+ \brief the title of the web page currently viewed
+
+ By default, this property contains an empty string.
+
+ \sa titleChanged()
+*/
+QString QWebView::title() const
+{
+ if (d->page)
+ return d->page->mainFrame()->title();
+ return QString();
+}
+
+/*!
+ \property QWebView::url
+ \brief the url of the web page currently viewed
+
+ Setting this property clears the view and loads the URL.
+
+ By default, this property contains an empty, invalid URL.
+
+ \sa load(), urlChanged()
+*/
+
+void QWebView::setUrl(const QUrl &url)
+{
+ page()->mainFrame()->setUrl(url);
+}
+
+QUrl QWebView::url() const
+{
+ if (d->page)
+ return d->page->mainFrame()->url();
+ return QUrl();
+}
+
+/*!
+ \property QWebView::icon
+ \brief the icon associated with the web page currently viewed
+
+ By default, this property contains a null icon.
+
+ \sa iconChanged(), QWebSettings::iconForUrl()
+*/
+QIcon QWebView::icon() const
+{
+ if (d->page)
+ return d->page->mainFrame()->icon();
+ return QIcon();
+}
+
+/*!
+ \property QWebView::selectedText
+ \brief the text currently selected
+
+ By default, this property contains an empty string.
+
+ \sa findText(), selectionChanged()
+*/
+QString QWebView::selectedText() const
+{
+ if (d->page)
+ return d->page->selectedText();
+ return QString();
+}
+
+/*!
+ Returns a pointer to a QAction that encapsulates the specified web action \a action.
+*/
+QAction *QWebView::pageAction(QWebPage::WebAction action) const
+{
+ return page()->action(action);
+}
+
+/*!
+ Triggers the specified \a action. If it is a checkable action the specified
+ \a checked state is assumed.
+
+ The following example triggers the copy action and therefore copies any
+ selected text to the clipboard.
+
+ \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 2
+
+ \sa pageAction()
+*/
+void QWebView::triggerPageAction(QWebPage::WebAction action, bool checked)
+{
+ page()->triggerAction(action, checked);
+}
+
+/*!
+ \property QWebView::modified
+ \brief whether the document was modified by the user
+
+ Parts of HTML documents can be editable for example through the
+ \c{contenteditable} attribute on HTML elements.
+
+ By default, this property is false.
+*/
+bool QWebView::isModified() const
+{
+ if (d->page)
+ return d->page->isModified();
+ return false;
+}
+
+/*
+Qt::TextInteractionFlags QWebView::textInteractionFlags() const
+{
+ // ### FIXME (add to page)
+ return Qt::TextInteractionFlags();
+}
+*/
+
+/*
+ \property QWebView::textInteractionFlags
+ \brief how the view should handle user input
+
+ Specifies how the user can interact with the text on the page.
+*/
+
+/*
+void QWebView::setTextInteractionFlags(Qt::TextInteractionFlags flags)
+{
+ Q_UNUSED(flags)
+ // ### FIXME (add to page)
+}
+*/
+
+/*!
+ \reimp
+*/
+QSize QWebView::sizeHint() const
+{
+ return QSize(800, 600); // ####...
+}
+
+/*!
+ \property QWebView::zoomFactor
+ \since 4.5
+ \brief the zoom factor for the view
+*/
+
+void QWebView::setZoomFactor(qreal factor)
+{
+ page()->mainFrame()->setZoomFactor(factor);
+}
+
+qreal QWebView::zoomFactor() const
+{
+ return page()->mainFrame()->zoomFactor();
+}
+
+/*!
+ \property QWebView::textSizeMultiplier
+ \brief the scaling factor for all text in the frame
+ \obsolete
+
+ Use setZoomFactor instead, in combination with the
+ ZoomTextOnly attribute in QWebSettings.
+
+ \note Setting this property also enables the
+ ZoomTextOnly attribute in QWebSettings.
+
+ By default, this property contains a value of 1.0.
+*/
+
+/*!
+ Sets the value of the multiplier used to scale the text in a Web page to
+ the \a factor specified.
+*/
+void QWebView::setTextSizeMultiplier(qreal factor)
+{
+ page()->mainFrame()->setTextSizeMultiplier(factor);
+}
+
+/*!
+ Returns the value of the multiplier used to scale the text in a Web page.
+*/
+qreal QWebView::textSizeMultiplier() const
+{
+ return page()->mainFrame()->textSizeMultiplier();
+}
+
+/*!
+ Finds the next occurrence of the string, \a subString, in the page, using
+ the given \a options. Returns true of \a subString was found and selects
+ the match visually; otherwise returns false.
+
+ \sa selectedText(), selectionChanged()
+*/
+bool QWebView::findText(const QString &subString, QWebPage::FindFlags options)
+{
+ if (d->page)
+ return d->page->findText(subString, options);
+ return false;
+}
+
+/*! \reimp
+*/
+bool QWebView::event(QEvent *e)
+{
+ if (d->page) {
+#ifndef QT_NO_CONTEXTMENU
+ if (e->type() == QEvent::ContextMenu) {
+ if (!isEnabled())
+ return false;
+ QContextMenuEvent *event = static_cast<QContextMenuEvent *>(e);
+ if (d->page->swallowContextMenuEvent(event)) {
+ e->accept();
+ return true;
+ }
+ d->page->updatePositionDependentActions(event->pos());
+ } else
+#endif // QT_NO_CONTEXTMENU
+ if (e->type() == QEvent::ShortcutOverride) {
+ d->page->event(e);
+#ifndef QT_NO_CURSOR
+ } else if (e->type() == static_cast<QEvent::Type>(WebCore::SetCursorEvent::EventType)) {
+ d->setCursor(static_cast<WebCore::SetCursorEvent*>(e)->cursor());
+#if QT_VERSION >= 0x040400
+ } else if (e->type() == QEvent::CursorChange) {
+ // Okay we might use the WebCore Cursor now.
+ d->usesWebCoreCursor = d->cursorSetByWebCore;
+ d->cursorSetByWebCore = false;
+
+ // Go back to the WebCore Cursor. QWidget::unsetCursor is appromixated with this
+ if (!d->usesWebCoreCursor && cursor().shape() == Qt::ArrowCursor) {
+ d->usesWebCoreCursor = true;
+ d->setCursor(d->webCoreCursor);
+ }
+#endif
+#endif
+ } else if (e->type() == QEvent::Leave) {
+ d->page->event(e);
+ }
+ }
+
+ return QWidget::event(e);
+}
+
+/*!
+ Prints the main frame to the given \a printer.
+
+ \sa QWebFrame::print(), QPrintPreviewDialog
+*/
+void QWebView::print(QPrinter *printer) const
+{
+#ifndef QT_NO_PRINTER
+ page()->mainFrame()->print(printer);
+#endif
+}
+
+/*!
+ Convenience slot that stops loading the document.
+
+ It is equivalent to
+
+ \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 3
+
+ \sa reload(), pageAction(), loadFinished()
+*/
+void QWebView::stop()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Stop);
+}
+
+/*!
+ Convenience slot that loads the previous document in the list of documents
+ built by navigating links. Does nothing if there is no previous document.
+
+ It is equivalent to
+
+ \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 4
+
+ \sa forward(), pageAction()
+*/
+void QWebView::back()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Back);
+}
+
+/*!
+ Convenience slot that loads the next document in the list of documents
+ built by navigating links. Does nothing if there is no next document.
+
+ It is equivalent to
+
+ \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 5
+
+ \sa back(), pageAction()
+*/
+void QWebView::forward()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Forward);
+}
+
+/*!
+ Reloads the current document.
+
+ \sa stop(), pageAction(), loadStarted()
+*/
+void QWebView::reload()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Reload);
+}
+
+/*! \reimp
+*/
+void QWebView::resizeEvent(QResizeEvent *e)
+{
+ if (d->page)
+ d->page->setViewportSize(e->size());
+}
+
+/*! \reimp
+*/
+void QWebView::paintEvent(QPaintEvent *ev)
+{
+ if (!d->page)
+ return;
+#ifdef QWEBKIT_TIME_RENDERING
+ QTime time;
+ time.start();
+#endif
+
+ QWebFrame *frame = d->page->mainFrame();
+ QPainter p(this);
+
+ frame->render(&p, ev->region());
+
+#ifdef QWEBKIT_TIME_RENDERING
+ int elapsed = time.elapsed();
+ qDebug()<<"paint event on "<<ev->region()<<", took to render = "<<elapsed;
+#endif
+}
+
+/*!
+ This function is called whenever WebKit wants to create a new window of the given \a type, for example as a result of
+ a JavaScript request to open a document in a new window.
+
+ \sa QWebPage::createWindow()
+*/
+QWebView *QWebView::createWindow(QWebPage::WebWindowType type)
+{
+ Q_UNUSED(type)
+ return 0;
+}
+
+/*! \reimp
+*/
+void QWebView::mouseMoveEvent(QMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+
+/*! \reimp
+*/
+void QWebView::mousePressEvent(QMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+
+/*! \reimp
+*/
+void QWebView::mouseDoubleClickEvent(QMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+
+/*! \reimp
+*/
+void QWebView::mouseReleaseEvent(QMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+
+#ifndef QT_NO_CONTEXTMENU
+/*! \reimp
+*/
+void QWebView::contextMenuEvent(QContextMenuEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+#endif // QT_NO_CONTEXTMENU
+
+#ifndef QT_NO_WHEELEVENT
+/*! \reimp
+*/
+void QWebView::wheelEvent(QWheelEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+#endif // QT_NO_WHEELEVENT
+
+/*! \reimp
+*/
+void QWebView::keyPressEvent(QKeyEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ if (!ev->isAccepted())
+ QWidget::keyPressEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebView::keyReleaseEvent(QKeyEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ if (!ev->isAccepted())
+ QWidget::keyReleaseEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebView::focusInEvent(QFocusEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ else
+ QWidget::focusInEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebView::focusOutEvent(QFocusEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ else
+ QWidget::focusOutEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebView::dragEnterEvent(QDragEnterEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->page)
+ d->page->event(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QWebView::dragLeaveEvent(QDragLeaveEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->page)
+ d->page->event(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QWebView::dragMoveEvent(QDragMoveEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->page)
+ d->page->event(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QWebView::dropEvent(QDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->page)
+ d->page->event(ev);
+#endif
+}
+
+/*! \reimp
+*/
+bool QWebView::focusNextPrevChild(bool next)
+{
+ if (d->page && d->page->focusNextPrevChild(next))
+ return true;
+ return QWidget::focusNextPrevChild(next);
+}
+
+/*!\reimp
+*/
+QVariant QWebView::inputMethodQuery(Qt::InputMethodQuery property) const
+{
+ if (d->page)
+ return d->page->inputMethodQuery(property);
+ return QVariant();
+}
+
+/*!\reimp
+*/
+void QWebView::inputMethodEvent(QInputMethodEvent *e)
+{
+ if (d->page)
+ d->page->event(e);
+}
+
+/*!\reimp
+*/
+void QWebView::changeEvent(QEvent *e)
+{
+ if (d->page && e->type() == QEvent::PaletteChange) {
+ d->page->setPalette(palette());
+ }
+ QWidget::changeEvent(e);
+}
+
+/*!
+ \fn void QWebView::titleChanged(const QString &title)
+
+ This signal is emitted whenever the \a title of the main frame changes.
+
+ \sa title()
+*/
+
+/*!
+ \fn void QWebView::urlChanged(const QUrl &url)
+
+ This signal is emitted when the \a url of the view changes.
+
+ \sa url(), load()
+*/
+
+/*!
+ \fn void QWebView::statusBarMessage(const QString& text)
+
+ This signal is emitted when the statusbar \a text is changed by the page.
+*/
+
+/*!
+ \fn void QWebView::iconChanged()
+
+ This signal is emitted whenever the icon of the page is loaded or changes.
+
+ \sa icon()
+*/
+
+/*!
+ \fn void QWebView::loadStarted()
+
+ This signal is emitted when a new load of the page is started.
+
+ \sa loadProgress(), loadFinished()
+*/
+
+/*!
+ \fn void QWebView::loadFinished(bool ok)
+
+ This signal is emitted when a load of the page is finished.
+ \a ok will indicate whether the load was successful or any error occurred.
+
+ \sa loadStarted()
+*/
+
+/*!
+ \fn void QWebView::selectionChanged()
+
+ This signal is emitted whenever the selection changes.
+
+ \sa selectedText()
+*/
+
+/*!
+ \fn void QWebView::loadProgress(int progress)
+
+ This signal is emitted every time an element in the web page
+ completes loading and the overall loading progress advances.
+
+ This signal tracks the progress of all child frames.
+
+ The current value is provided by \a progress and scales from 0 to 100,
+ which is the default range of QProgressBar.
+
+ \sa loadStarted(), loadFinished()
+*/
+
+/*!
+ \fn void QWebView::linkClicked(const QUrl &url)
+
+ This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy
+ property is set to delegate the link handling for the specified \a url.
+
+ \sa QWebPage::linkDelegationPolicy()
+*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
new file mode 100644
index 0000000..1172f39
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
@@ -0,0 +1,159 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2007 Staikos Computing Services Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBVIEW_H
+#define QWEBVIEW_H
+
+#include "qwebkitglobal.h"
+#include "qwebpage.h"
+#include <QtGui/qwidget.h>
+#include <QtGui/qicon.h>
+#include <QtCore/qurl.h>
+#if QT_VERSION >= 0x040400
+#include <QtNetwork/qnetworkaccessmanager.h>
+#endif
+
+QT_BEGIN_NAMESPACE
+class QNetworkRequest;
+class QPrinter;
+QT_END_NAMESPACE
+
+class QWebPage;
+class QWebViewPrivate;
+class QWebNetworkRequest;
+
+class QWEBKIT_EXPORT QWebView : public QWidget
+{
+ Q_OBJECT
+ Q_PROPERTY(QString title READ title)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl)
+ Q_PROPERTY(QIcon icon READ icon)
+ Q_PROPERTY(QString selectedText READ selectedText)
+ Q_PROPERTY(bool modified READ isModified)
+ //Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
+ Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
+public:
+ explicit QWebView(QWidget *parent = 0);
+ virtual ~QWebView();
+
+ QWebPage *page() const;
+ void setPage(QWebPage *page);
+
+ void load(const QUrl &url);
+#if QT_VERSION < 0x040400 && !defined(qdoc)
+ void load(const QWebNetworkRequest &request);
+#else
+ void load(const QNetworkRequest &request,
+ QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
+ const QByteArray &body = QByteArray());
+#endif
+ void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
+ void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
+
+ QWebHistory *history() const;
+ QWebSettings *settings() const;
+
+ QString title() const;
+ void setUrl(const QUrl &url);
+ QUrl url() const;
+ QIcon icon() const;
+
+ QString selectedText() const;
+
+ QAction *pageAction(QWebPage::WebAction action) const;
+ void triggerPageAction(QWebPage::WebAction action, bool checked = false);
+
+ bool isModified() const;
+
+ /*
+ Qt::TextInteractionFlags textInteractionFlags() const;
+ void setTextInteractionFlags(Qt::TextInteractionFlags flags);
+ void setTextInteractionFlag(Qt::TextInteractionFlag flag);
+ */
+
+ QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+
+ QSize sizeHint() const;
+
+ qreal zoomFactor() const;
+ void setZoomFactor(qreal factor);
+
+ void setTextSizeMultiplier(qreal factor);
+ qreal textSizeMultiplier() const;
+
+ bool findText(const QString &subString, QWebPage::FindFlags options = 0);
+
+ virtual bool event(QEvent *);
+
+public Q_SLOTS:
+ void stop();
+ void back();
+ void forward();
+ void reload();
+
+ void print(QPrinter *printer) const;
+
+Q_SIGNALS:
+ void loadStarted();
+ void loadProgress(int progress);
+ void loadFinished(bool);
+ void titleChanged(const QString& title);
+ void statusBarMessage(const QString& text);
+ void linkClicked(const QUrl &url);
+ void selectionChanged();
+ void iconChanged();
+ void urlChanged(const QUrl &url);
+
+protected:
+ void resizeEvent(QResizeEvent *e);
+ void paintEvent(QPaintEvent *ev);
+
+ virtual QWebView *createWindow(QWebPage::WebWindowType type);
+
+ virtual void changeEvent(QEvent*);
+ virtual void mouseMoveEvent(QMouseEvent*);
+ virtual void mousePressEvent(QMouseEvent*);
+ virtual void mouseDoubleClickEvent(QMouseEvent*);
+ virtual void mouseReleaseEvent(QMouseEvent*);
+#ifndef QT_NO_CONTEXTMENU
+ virtual void contextMenuEvent(QContextMenuEvent*);
+#endif
+#ifndef QT_NO_WHEELEVENT
+ virtual void wheelEvent(QWheelEvent*);
+#endif
+ virtual void keyPressEvent(QKeyEvent*);
+ virtual void keyReleaseEvent(QKeyEvent*);
+ virtual void dragEnterEvent(QDragEnterEvent *);
+ virtual void dragLeaveEvent(QDragLeaveEvent *);
+ virtual void dragMoveEvent(QDragMoveEvent *);
+ virtual void dropEvent(QDropEvent *);
+ virtual void focusInEvent(QFocusEvent*);
+ virtual void focusOutEvent(QFocusEvent*);
+ virtual void inputMethodEvent(QInputMethodEvent*);
+
+ virtual bool focusNextPrevChild(bool next);
+
+private:
+ friend class QWebPage;
+ QWebViewPrivate *d;
+};
+
+#endif // QWEBVIEW_H
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
new file mode 100644
index 0000000..8e0b50a
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -0,0 +1,11423 @@
+2009-02-25 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix the documentation for the linkHovered signal.
+
+ * Api/qwebpage.cpp:
+
+2009-02-23 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix the Copyright notices in a few files
+
+ * WebKit_pch.h:
+
+2008-12-13 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by NOBODY (OOPS!).
+
+ The Qt API exposes a global history patch CSSStyleSelector to make API consumers work again
+
+ https://bugs.webkit.org/show_bug.cgi?id=20952
+
+ The QtWebKit port made the mistake of exposing a global history. This broke
+ with the addition of PageGroup and LinkHash. This needs to be repaired
+ for Qt4.5.
+
+ Add a function to LinkHash.cpp that is resolving a URL. Use this
+ function from within CSSStyleSelector to forward the url to the
+ QWebHistoryInterface API.
+
+ It is sad that there is a path within visitedLinkHash which is now
+ doing a memcpy, it is sad to add a PLATFORM(QT) define to CSSStyleSelector
+ and using QtWebKit types within WebCore is a layering violation as well.
+
+ PageGroup::setShouldTrackVisitedLinks is currently not enabled. For
+ Qt4.6 a second version of the QWebHistoryInterface is going to be
+ added which will fix things up.
+
+ * Api/qwebhistoryinterface.cpp:
+ (QWebHistoryInterface::setDefaultInterface): Add note for Qt4.6
+ * Api/qwebpage.cpp: Remove PageGroup::setShouldTrackVisitedLinks(true)
+ (QWebPagePrivate::QWebPagePrivate):
+ * tests/qwebhistoryinterface/qwebhistoryinterface.pro: Added unit test.
+ * tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp: Added unit test.
+ (tst_QWebHistoryInterface::tst_QWebHistoryInterface):
+ (tst_QWebHistoryInterface::~tst_QWebHistoryInterface):
+ (tst_QWebHistoryInterface::init):
+ (tst_QWebHistoryInterface::cleanup):
+ (FakeHistoryImplementation::addHistoryEntry):
+ (FakeHistoryImplementation::historyContains):
+ (tst_QWebHistoryInterface::visitedLinks): Check the Qt4.4 behaviour.
+ * tests/tests.pro:
+
+2009-02-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Avoid loading plugins when they're disabled in the settings.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::canShowMIMEType): Don't call into the
+ PluginDatabase if plugins are disabled in the settings.
+
+2009-02-13 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Removed documentation for internal functions.
+
+ * Api/qwebsettings.cpp:
+
+2009-02-13 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Corrected some minor qdoc errors.
+
+ * Api/qwebsettings.cpp:
+
+2009-02-10 Karsten Heimrich <kheimric@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fixes missing navigation/url update while clicking on anchor inside
+ webpage.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage):
+ update and emit in case we navigate inside a webpage
+
+2009-02-06 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc - made 2 functions internal as they are not part of the API anymore (and this fixes 2 qdoc warnings)
+
+ * Api/qwebsettings.cpp:
+
+2009-02-06 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added an overload of QWebFrame::addToJavaScriptWindowObject that takes a QScriptEngine::ValueOwnership parameter.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject): New overload.
+ * Api/qwebframe.h:
+ * tests/qwebframe/tst_qwebframe.cpp: Added unit tests for ownership
+ models.
+
+2009-02-04 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Documented the return value of the evaluateJavaScript() function.
+
+ * Api/qwebframe.cpp:
+
+2009-02-03 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added a unit test to verify the succesful conversion from QByteArray to
+ JSByteArray and back to QByteArray.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-30 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Hide the Offline Web Application Cache path API from the public API
+ for now.
+
+ * Api/qwebsettings.cpp:
+ (qt_websettings_setOfflineWebApplicationCachePath):
+ (qt_websettings_offlineWebApplicationCachePath):
+ * Api/qwebsettings.h:
+
+2009-01-28 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ Provide default implementations of JavaScript dialog boxes like in
+ most web browsers, i.e. indicate that is from JavaScript and show the
+ frame URL.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+
+2009-01-27 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ http://www.qtsoftware.com/developer/task-tracker/index_html?id=238391&method=entry
+
+ [Qt] If QPainter fails to start on a QPrinter instance, do not
+ continue printing.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+
+2009-01-26 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: qdoc fix for a link to a property and added a basic description of the offline caching and storage features from HTML 5.
+
+ * Api/qwebpage.cpp:
+ * Api/qwebsettings.cpp:
+
+2009-01-25 Urs Wolfer <uwolfer@kde.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add QWebPage::SelectAll to WebAction enum to select all content.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22946
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::editorActionForKeyEvent):
+ * Api/qwebpage.h:
+
+2009-01-25 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Fixed the terminology used.
+
+ * Api/qwebpage.cpp:
+
+2009-01-25 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Rename links from trolltech.com to qtsoftware.com
+
+ * Api/qwebpluginfactory.cpp:
+
+2009-01-25 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Make QWebPage auto-test more robust by cleaning up generated files
+
+ Sometimes the auto-test may segfault, leaving behind files because the
+ call to cleanupTestCase() never happens, so we also clean up the files
+ at initTestCase() just to make sure we're running in a clean environment.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::cleanupFiles):
+ (tst_QWebPage::initTestCase):
+ (tst_QWebPage::cleanupTestCase):
+
+2008-12-20 Urs Wolfer <uwolfer@kde.org>
+
+ Reviewed by Simon Hausmann.
+
+ Fix: compile qwebhistory.h with pendantic comiler flag.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22947
+
+ * Api/qwebhistory.h:
+
+2009-01-23 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Make the test more robust by taking into account the platform-specific
+ cursor flashing time.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-20 Friedemann Kleint <Friedemann.Kleint@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix spelling error in QWebPage
+
+ * Api/qwebpage.cpp:
+ (QWebPage::action):
+
+2009-01-19 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix calling of onkeypress event handlers on input elements when pressing enter
+ and other text insertion commands in the Qt port.
+
+ Similar to the win and mac ports don't execute text inserting editor
+ commands on RawKeyDown but continue processing the event first in
+ WebCore, i.e. also get a keypress event sent. If unhandled it will
+ come back to EditorClientQt::handleKeyboardEvent later and we execute
+ it then.
+
+ This also fixes search by pressing enter on www.trafikanten.no.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::editorCommandForWebActions): Make function
+ accessible from other files.
+ (QWebPage::triggerAction): Adjust to new function visibility.
+ * Api/qwebpage_p.h: Ditto.
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent): Don't execute
+ text inserting commands on RawKeyPressDown.
+
+2009-01-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Increase popup focus delay time to a sensible 500 ms.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Adam Roben.
+
+ [Qt] Prevent crash if plugin data is NULL.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp: NULL check.
+ (WebCore::FrameLoaderClientQt::objectContentType):
+
+2009-01-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Per-line cursor movement tests depend on platform-specific font
+ metrics. Remove them to avoid test failures on different platforms.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::cursorMovements):
+
+2009-01-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ http://www.qtsoftware.com/developer/task-tracker/index_html?id=219344&method=entry
+
+ [Qt] API documentation for QWebPage::WebAction enum.
+
+ * Api/qwebpage.cpp:
+
+2009-01-14 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Unit tests for text selection and editing actions of QWebPage.
+ The following are tested:
+ - the actions are not NULL
+ - the actions are disabled when contentEditable is false
+ - the actions are enabled when contentEditable is true
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::textSelection):
+ (tst_QWebPage::textEditing):
+
+2009-01-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix failing assertion when pressing an extra mouse button on a
+ QWebView.
+
+ Mice with more than three buttons - for example with a dedicated
+ "back" button - can generate Qt::XButton1 or Button2.
+ WebCore::MouseButton contains only Left, Middle and Right, so in
+ Qt's PlatformMouseEvent we map to NoButton, resulting in a mouse
+ press or release even with no button set. That triggers an assertion
+ in EventTargetNode::dispatchMouseEvent requiring that either a button
+ is set or it is just a mouse move event, which is correct.
+
+ In QWebPage decide not to dispatch such mouse events where we cannot
+ map the mouse button to a WebCore::MouseButton.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseTripleClickEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+
+2009-01-14 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ http://www.qtsoftware.com/developer/task-tracker/index_html?id=241144&method=entry
+
+ [Qt] Create actions for text selection and editing for QWebPage.
+ Also properly disable and enable them when contentEditable is toggled.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPage::action):
+
+2009-01-14 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Unit tests for cursor movements. The following are tested:
+ - the actions are not NULL
+ - the actions are disabled when contentEditable is false
+ - the actions are enabled when contentEditable is true
+ - the cursor moves properly when the actions are triggered
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (CursorTrackedPage::CursorTrackedPage):
+ (CursorTrackedPage::selectedText):
+ (CursorTrackedPage::selectionStartOffset):
+ (CursorTrackedPage::selectionEndOffset):
+ (CursorTrackedPage::isSelectionCollapsed):
+ (tst_QWebPage::cursorMovements):
+
+2009-01-13 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ [Qt] Missing piece from my previous commit:
+ Disable and enable the cursor navigation actions when contentEditable
+ is changed.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateEditorActions):
+
+2009-01-13 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Create actions for cursor navigation for QWebPage.
+ Also properly disable and enable them when contentEditable is toggled.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPage::action):
+
+2009-01-08 Yongjun Zhang <yongjun.zhang@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23187
+
+ Update webview with the intersected rect.
+
+ In ChromeClientQt::repaint, view should be updated with the
+ intersected rect, not the whole windowRect;
+
+ This generally is not a problem for normal viewport setup where
+ viewport size is the same as the qwebview widget size. However, if we
+ set the viewport size smaller than qwebkit widget, we will see
+ unwanted painting outside the viewport.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+
+2009-01-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23171
+
+ Based on patch by Yael Aharon <yael.aharon@nokia.com>
+
+ Make the QWebSettings functions for setting the path for the local
+ storage database private QtWebkit API, including the ability to
+ associated a QWebPage with a named page group.
+
+ * Api/qwebpage.cpp:
+ (qt_webpage_setGroupName): Added.
+ (qt_webpage_groupName): Added.
+ * Api/qwebpage.h:
+ (ExtensionOption::handle): Added internal helper function.
+ * Api/qwebsettings.cpp:
+ (qt_websettings_setLocalStorageDatabasePath): Made private API.
+ (qt_websettings_localStorageDatabasePath): Made private API.
+ * Api/qwebsettings.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::database): Small cleanup.
+ (tst_QWebPage::multiplePageGroupsAndLocalStorage): New test for the
+ page group handling, written by Yael.
+
+2009-01-12 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Ensure that we're always notified of navigation actions for local anchors
+
+ FrameLoader::checkNavigationPolicy() does not notify us if the request has
+ been checked before (which happens for local anchors), but in the case of
+ our clients not accepting the navigation request we do want to be notified
+ again later on, so we clear the lastCheckedRequest flag.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2009-01-12 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Build fix: use qobject_cast which does not rely on RTTI. This fixes the
+ unit test when building it with a version of Qt (e.g. Qt/Embedded)
+ configured without RTTI.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-01-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ When the QWebView is disabled context menus implemented in JavaScript should not pop up.
+
+ Just like in QWidget::event() we have to check for the disabled state and
+ ignore context menu events.
+
+ * Api/qwebview.cpp:
+
+2009-01-12 Simon Hausmann <simon.hausmann@nokia.com
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix QWebView appearance when showed uninitialized without page.
+
+ Only set WA_OpaquePaintEvent if we have a page set that will actually
+ paint the entire contents, otherwise the optimization does not apply
+ as we do not have a paintEvent() implementation and Qt has to fill the
+ view with its default background instead.
+
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+ (QWebView::setPage):
+
+2009-01-11 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Do not create a QVariant from QObject* directly, use the
+ template-specialized function.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (MyQObject::myOverloadedSlot):
+
+2009-01-09 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Documentation fixes, remove duplicated docs, document missing
+ parameters and return values.
+
+ * Api/qwebdatabase.cpp:
+ * Api/qwebpage.cpp:
+
+2009-01-09 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix linking against QtWebKit on Windows, by defining the EXPORT macros
+ _exactly_ the same way as in qglobal.h, depending on QT_NODLL,
+ QT_MAKEDLL and QT_SHARED.
+
+ * Api/qwebkitglobal.h:
+
+2009-01-09 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Remove qwebnetworkinterface.h from WEBKIT_API_HEADERS as it's not
+ public Qt 4.4/4.5 API.
+
+ * Api/headers.pri:
+
+2009-01-09 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Qt build fix, remove qcookiejar.h from the API headers and
+ therefore HEADERS. It's not part of the API and it moc shouldn't be
+ called on it.
+
+ * Api/headers.pri:
+
+2009-01-09 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Remove files not present anymore from the WEBKIT_API_HEADERS variable.
+
+ * Api/headers.pri:
+
+2009-01-08 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Simon Hausmann.
+
+ Don't set the minimumFontSize and minimumLogicalFontSize as these are
+ just for accessibility and should be left up to the client application.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-01-08 Kavindra Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Small fixes to the API documentation, missing 4.5 tags and
+ undocumented parameters.
+
+ * Api/qwebhistory.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebsettings.cpp:
+
+2009-01-07 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by George Staikos.
+
+ Fix unused variable warnings
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (TestPage::createWindow):
+
+2009-01-07 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ Qt build fix after r39670.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2009-01-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Holger Freyther.
+
+ Allow building QtWebKit statically (within Qt).
+
+ http://trolltech.com/developer/task-tracker/index_html?id=211273&method=entry
+
+ * Api/qwebkitglobal.h:
+
+2009-01-05 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by George Staikos.
+
+ Fixes QWebFrame::setScrollBarPolicy(..) to actually work. Also happens
+ to fix 192 layout tests that were previously failing for Qt.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setScrollBarPolicy):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2008-12-19 Jade Han <jade.han@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Allow conversion of JavaScript Number and Boolean types to Qt types
+
+ https://bugs.webkit.org/show_bug.cgi?id=22880
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (MyQObject::myInvokableWithBoolArg):
+
+2008-12-18 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ When Web Inspector is launched without an associated node,
+ call show() instead of inspect().
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+
+2008-12-18 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - stub out FrameLoaderClient::shouldUseCredentialStorage().
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::shouldUseCredentialStorage):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-12-18 Sam Weinig <sam@webkit.org>
+
+ Reviewed by John Sullivan.
+
+ Stub out FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-12-16 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ Added support for unload event counting to the Qt DRT.
+
+ * Api/qwebpage.cpp:
+ (qt_drt_run): Moved function here.
+ * Api/qwebpage_p.h: Moved drt run boolean here.
+ * WebCoreSupport/EditorClientQt.cpp: Moved drt run boolean.
+ (WebCore::EditorClientQt::shouldShowDeleteInterface): Use the new drt
+ run variable.
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad): Add DRT
+ output for unload event handler counting.
+
+2008-12-15 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ Change the order of sub frame initialisation to avoid crashes
+
+ Add the newly created frame to the FrameTree before calling
+ WebCore::Frame::init to not segfault on
+ LayoutTests/fast/loader/frame-creation-removal.html.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2008-12-15 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ Implement setJavaScriptProfilingEnabled in the Qt DRT to pass fast/profiler.
+
+ * Api/qwebframe.cpp:
+ (qt_drt_setJavaScriptProfilingEnabled):
+
+2008-12-12 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix pressing return/enter not triggering any action on web sites
+ that define event handlers, such as the JS console in the web
+ inspector.
+
+ Process the key events in the DOM first and if not handled map them
+ to editor actions.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::editorActionForKeyEvent): Made a class method.
+ (QWebPagePrivate::keyPressEvent): Pass the key event first to the DOM.
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent): Map the key event to
+ actions and trigger them.
+
+2008-12-12 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Create the plugin widget even though the web page has no associated
+ view. This prevents the plugin to be uselessly constructed more than once.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::createViewlessPlugin):
+
+2008-12-11 Enrico Ros <enrico.ros@m31.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix the broken focus behavior that happened when QWebPage lost
+ focus to a popup menu.
+
+ The previous code didn't notify the QWebPage at all when the
+ focus was back in (breaking focus rects, caret blinking, ...).
+ By the way when a popup is show, 2 FocusOut events are delivered
+ to the QWebPage, but this doesn't seem to hurt.
+
+ Added a test to check popup opening, closing a lineedit blinks.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusInEvent):
+ (QWebPagePrivate::focusOutEvent):
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (tst_QWebFrame::):
+
+2008-12-11 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ When the web page is navigated away, delete the instance
+ of the native plugin.
+
+ http://trolltech.com/developer/task-tracker/index_html?id=214946&method=entry
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (PluginTrackedPage::PluginTrackedPage):
+ (PluginTrackedPage::createPlugin):
+ (tst_QWebPage::destroyPlugin):
+
+2008-12-11 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Allow applications to save and restore their state between loads.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::restoreViewState):
+ (WebCore::FrameLoaderClientQt::saveViewStateToItem):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::modified):
+
+2008-12-08 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Darin Adler and Holger Freyther.
+
+ Make Widget::frameRectsChanged() and overrides non-const
+
+ This will hopefully allow us to get rid of some of the mutables in
+ the classes that react to the callback by changing their own state.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+
+2008-12-10 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ API changes discussed with Simon Hausmann, Tor Arne
+ Vestbø, Ariya Hidayat...
+
+ * Api/qwebdatabase.cpp:
+ (QWebDatabase::fileName):
+ (QWebDatabase::removeDatabase):
+ * Api/qwebdatabase.h:
+ * Api/qwebframe.cpp:
+ (QWebFrame::scroll):
+ (QWebFrame::scrollPosition):
+ (QWebFrame::setScrollPosition):
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::setContentEditable):
+ (QWebPage::isContentEditable):
+ (QWebPage::extension):
+ * Api/qwebpage.h:
+ * Api/qwebsecurityorigin.cpp:
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::setEditable):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::exceededDatabaseQuota):
+ (WebCore::ChromeClientQt::runOpenPanel):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::isEditable):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::database):
+
+2008-12-09 Balazs Kelemen <Kelemen.Balazs.3@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Extended QtLauncher so now it can load pages from an url list
+ one by one. This can be useful for testing purposes (eq. leak hunting).
+ The -r option activates this feature.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20932
+
+ * QtLauncher/main.cpp:
+ (MainWindow::webPage):
+ Just a coding style repairing (* written with no space between the return type name)
+ (MainWindow::webView):
+ I need the webView to connect it with the URLLoader object.
+ (URLLoader::URLLoader):
+ (URLLoader::loadNext):
+ (URLLoader::init):
+ (URLLoader::getUrl):
+ (main):
+
+2008-12-10 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build, added const to Node* parameter after change
+ in signature.
+
+ * WebCoreSupport/ChromeClientQt.h:
+ (WebCore::ChromeClientQt::formStateDidChange):
+
+2008-12-09 Brett Wilson <brettw@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22177
+
+ Add a callback on ChromeClient that the state of form elements on
+ the page has changed. This is to allow clients implementing session
+ saving to know when the current state is dirty.
+
+ * WebCoreSupport/ChromeClientQt.h:
+ (WebCore::ChromeClientQt::formStateDidChange):
+
+2008-12-09 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix the documentation of the localStorageDatabasePath setters/getters.
+
+ * Api/qwebsettings.cpp:
+
+2008-12-08 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Multiple files support for the file chooser.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::chooseFiles):
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runOpenPanel):
+
+2008-12-06 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dave Hyatt
+
+ https://bugs.webkit.org/show_bug.cgi?id=15671
+
+ Renderer::caretRect() is now localCaretRect(), which needs
+ converting to absolute coordinates (taking transforms into account).
+
+ * Api/qwebpage.cpp:
+ (QWebPage::inputMethodQuery):
+
+2008-12-03 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Allow passing jsNull and jsUndefined to Qt plugins
+
+ Currently limited to functions with QString and QVariant arguments,
+ and properties of these types. Both jsNull and jsUndefined ends up
+ as default-constructed QStrings and QVariants, which means you can
+ check for isEmpty() and isValid() in the native plugin code.
+
+ Based on patches by Jade Han <jade.han@nokia.com>
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-12-02 Simon Hausmann <hausmann@webkit.org>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Initial API documentation for QWebDatabase, QWebSecurityOrigin and
+ QWebFrame::securityOrigin().
+
+ * Api/qwebdatabase.cpp:
+ * Api/qwebframe.cpp:
+ * Api/qwebsecurityorigin.cpp:
+
+2008-11-27 Kent Hansen <khansen@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Added auto tests for making JavaScript bindings for Qt plugin widgets
+ work again.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (PluginPage::PluginPage):
+ (PluginPage::CallInfo::CallInfo):
+ (PluginPage::createPlugin):
+ (tst_QWebPage::createPlugin):
+
+2008-11-25 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Build fix. Use WebCore::Frame::loader instead of QWebFrame
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::updateGlobalHistory):
+
+2008-11-24 Darin Fisher <darin@chromium.org>
+
+ Fix bustage.
+
+ http://bugs.webkit.org/show_bug.cgi?id=15643
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::isSelectTrailingWhitespaceEnabled):
+ * WebCoreSupport/EditorClientQt.h:
+
+2008-11-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ - https://bugs.webkit.org/show_bug.cgi?id=22470
+ remove unneeded URL argument from FrameLoaderClient::updateGlobalHistory
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::updateGlobalHistory): Get the URL from the
+ DocumentLoader.
+ * WebCoreSupport/FrameLoaderClientQt.h: Remove argument.
+
+2008-11-24 Darin Fisher <darin@chromium.org>
+
+ Fix bustage.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22448
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2008-11-20 Sam Weinig <sam@webkit.org>
+
+ Fix Qt build.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2008-11-19 Darin Fisher <darin@chromium.org>
+
+ Fix bustage.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22373
+ Ports busted by addition of ScriptValue.{h,cpp}
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2008-11-19 Darin Fisher <darin@chromium.org>
+
+ Fix bustage.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22373
+ Ports busted by addition of ScriptValue.{h,cpp}
+
+ * Api/qwebframe.cpp:
+
+2008-11-19 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build, remove file referenced in the qrc file that does not
+ exist and is not needed.
+
+ * tests/qwebframe/qwebframe.qrc:
+
+2008-11-18 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Missing file in new unit test for QWebFrame (r38493).
+
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebframe/qwebframe.qrc: Added.
+
+2008-11-18 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ Make sure QWidget based plugins are invisible until placed into the layout
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-11-18 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ React properly to frame rect changes for QWidget based plugins
+
+ We now set the geometry of the QWidget in frameRectsChanged,
+ intead of setFrameRect, which means we pick up the changes to
+ the frame rect when scrolling. We also set a mask on the
+ widget to keep it from painting over scrollbars and the like
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+
+2008-11-18 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix crash when trying to pick a file using the file chooser.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runOpenPanel):
+
+2008-11-18 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ Attempt to share transitionToCommittedForNewPage of FrameLoaderClient with the different ports
+
+ After Hyatt's work on Widget and ScrollView there is little difference
+ between the implementation of Qt, Gtk+ and Win. In fact any kind of
+ difference is mostly a bug. Alp has fixed two of such errors for the Gtk+
+ port and the Qt port has at least one of them left.
+
+ The only difference between the implementations is in getting the the
+ IntSize for the new FrameView, the background color to be applied and
+ eventually some post processing.
+
+ Unify the implementations by providing a static helper function that
+ takes a Frame, IntSize, color and transparency bit and calling it from
+ the Gtk+, the Qt and the Windows port.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::setPalette):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2008-11-17 Geoffrey Garen <ggaren@apple.com>
+
+ Not reviewed.
+
+ Try to fix qt build.
+
+ * Api/qwebframe.cpp:
+
+2008-11-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Tor Arne Vestbø and Simon Hausmann.
+
+ Fix regression when loading resources from Qt resource system using qrc:/.
+
+ Added a unit test to catch future regression.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * tests/qwebframe/image.png: Added.
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-11-16 Darin Adler <darin@apple.com>
+
+ - try to fix build
+
+ * Api/qwebhistory.cpp: Added include of "KURL.h".
+
+2008-10-24 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Added some basic unit tests for the public database API.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::initTestCase):
+ (tst_QWebPage::cleanupTestCase):
+ (tst_QWebPage::database):
+
+2008-11-14 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build, add missing export macros for the new classes.
+
+ * Api/qwebdatabase.h:
+ * Api/qwebsecurityorigin.h:
+
+2008-10-24 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Adding public API to provide access to the security origin
+ (QWebSecurityOrigin) and the databases used for the offline
+ storage (QWebDatabase).
+
+ In addition QWebSettings gains configuration functions for
+ enabling/disabling offline storage, web application cache
+ and DOM local storage.
+
+ This commits lands the core feature(s), the unit tests and the
+ documentation are going to follow in the comming days/weeks.
+
+ Note: The API is not frozen yet.
+
+ * Api/headers.pri:
+ * Api/qwebdatabase.cpp: Added.
+ (QWebDatabase::QWebDatabase):
+ (QWebDatabase::operator=):
+ (QWebDatabase::name):
+ (QWebDatabase::displayName):
+ (QWebDatabase::expectedSize):
+ (QWebDatabase::size):
+ (QWebDatabase::absoluteFilePath):
+ (QWebDatabase::origin):
+ (QWebDatabase::remove):
+ (QWebDatabase::~QWebDatabase):
+ * Api/qwebdatabase.h: Added.
+ * Api/qwebdatabase_p.h: Added.
+ * Api/qwebframe.cpp:
+ (QWebFrame::securityOrigin):
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebsecurityorigin.cpp: Added.
+ (QWebSecurityOrigin::QWebSecurityOrigin):
+ (QWebSecurityOrigin::operator=):
+ (QWebSecurityOrigin::scheme):
+ (QWebSecurityOrigin::host):
+ (QWebSecurityOrigin::port):
+ (QWebSecurityOrigin::databaseUsage):
+ (QWebSecurityOrigin::databaseQuota):
+ (QWebSecurityOrigin::setDatabaseQuota):
+ (QWebSecurityOrigin::~QWebSecurityOrigin):
+ (QWebSecurityOrigin::allOrigins):
+ (QWebSecurityOrigin::databases):
+ * Api/qwebsecurityorigin.h: Added.
+ * Api/qwebsecurityorigin_p.h: Added.
+ (QWebSecurityOriginPrivate::QWebSecurityOriginPrivate):
+ (QWebSecurityOriginPrivate::~QWebSecurityOriginPrivate):
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setOfflineStoragePath):
+ (QWebSettings::offlineStoragePath):
+ (QWebSettings::setOfflineStorageDefaultQuota):
+ (QWebSettings::offlineStorageDefaultQuota):
+ (QWebSettings::setOfflineWebApplicationCachePath):
+ (QWebSettings::offlineWebApplicationCachePath):
+ (QWebSettings::setLocalStorageDatabasePath):
+ (QWebSettings::localStorageDatabasePath):
+ * Api/qwebsettings.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::exceededDatabaseQuota):
+
+2008-11-12 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Mention the color role change (r38331) in the API doc.
+
+ * Api/qwebpage.cpp:
+
+2008-11-11 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Tor Arne Vestbø and Simon Hausmann.
+
+ Use QPalette::Base (instead of QPalette::Background) for the page
+ background.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::updateBackground):
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+
+2008-11-11 Cameron Zwarich <zwarich@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Remove pointless dependencies on the now-deleted kjs directory.
+
+ * WebKit_pch.h:
+
+2008-11-10 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ To fit Qt API, scroll offset is a QPoint instead of a QSize.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::scrollOffset):
+ (QWebFrame::setScrollOffset):
+ * Api/qwebframe.h:
+
+2008-11-10 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Fixed qdoc warnings by supplying function documentation.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebview.cpp:
+
+2008-11-10 Tobias Koenig <tobias.koenig@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Removed old and stale prf file that breaks the MingW build.
+
+ * Api/qtwebkit.prf: Removed.
+
+2008-11-10 Kavindra Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Clarify QWebFrame/View::setHTML docs with regards to relative URLs
+
+ * Api/qwebframe.cpp:
+ * Api/qwebview.cpp:
+
+2008-11-10 Joerg Bornemann <joerg.bornemann@nokia.com>
+
+ Reviewed by Simon Hausmann
+
+ Don't define _CRT_RAND_S on Windows CE in the precompiled
+ header, to fix the CE build.
+
+ * WebKit_pch.h:
+
+2008-11-07 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Tor Arne Vestbø and Simon Hausmann.
+
+ Added an option to allow printing the background color and images.
+ Mostly reworked from a patch by Holger.
+ This setting is enabled by default.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+
+2008-11-06 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added a unit tests for QWebFrame::metaData().
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-11-06 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Improved documentation for QWebFrame::metaData().
+
+ * Api/qwebframe.cpp:
+
+2008-11-05 Sriram Yadavalli <sriram.yadavalli@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Added QWebFrame::metaData() to provide a way in the public API
+ to retrieve the values of the <meta> tags.
+
+ See https://bugs.webkit.org/show_bug.cgi?id=22071
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::metaData):
+ * Api/qwebframe.h:
+
+2008-10-24 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add userData() and setUserData() to QWebHistoryItem.
+ Add setMaximumItemCount() and maximumItemCount() to QWebHistory.
+ Add currentItemIndex() to QWebHistory.
+
+ See also https://bugs.webkit.org/show_bug.cgi?id=21864
+
+ Small cleanup by Simon (docs and forward declaration of QWebHistoryItem in qwebframe.h)
+
+ * Api/qwebframe.h:
+ * Api/qwebhistory.cpp:
+ (QWebHistoryItem::userData):
+ (QWebHistoryItem::setUserData):
+ (QWebHistory::currentItemIndex):
+ (QWebHistory::maximumItemCount):
+ (QWebHistory::setMaximumItemCount):
+ * Api/qwebhistory.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::saveViewStateToItem):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::modified):
+
+2008-11-03 Cameron Zwarich <zwarich@apple.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Move more files into the runtime subdirectory of JavaScriptCore.
+
+ * Api/qwebpage.cpp:
+
+2008-10-25 Jade Han <jade.han@nokia.com>
+
+ Reviewed by Anders.
+
+ Enable custom properties for Qt runtime objects in QtWebKit
+
+ https://bugs.webkit.org/show_bug.cgi?id=21813
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-10-24 Sam Weinig <sam@webkit.org>
+
+ Another Qt build fix.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+
+2008-10-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Fix https://bugs.webkit.org/show_bug.cgi?id=21759
+ Layering violation: FileChooser should not depend on Document/Frame/Page
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runOpenPanel):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-10-24 Timothy Hatcher <timothy@apple.com>
+
+ Stub out new InspectorClient methods.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21856
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::populateSetting): Not implemented.
+ (WebCore::InspectorClientQt::storeSetting): Ditto.
+ (WebCore::InspectorClientQt::removeSetting): Ditto.
+ * WebCoreSupport/InspectorClientQt.h:
+
+2008-10-24 Darin Adler <darin@apple.com>
+
+ - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript): Use JSValue* instead of JSValuePtr.
+
+2008-10-23 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Invalid history entries could cause a crash in QT Webkit
+
+ * Api/qwebhistory.cpp:
+ (QWebHistoryItem::originalUrl):
+ (QWebHistoryItem::url):
+ (QWebHistoryItem::title):
+ (QWebHistoryItem::lastVisited):
+ (QWebHistoryItem::icon):
+ (QWebHistoryItem::isValid):
+ * Api/qwebhistory.h:
+ * Api/qwebhistory_p.h:
+ (QWebHistoryItemPrivate::QWebHistoryItemPrivate):
+ (QWebHistoryItemPrivate::~QWebHistoryItemPrivate):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::modified):
+
+2008-10-22 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ emit scrollRequested unconditionally when scrolling.
+
+ See https://bugs.webkit.org/show_bug.cgi?id=21790
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::scroll):
+
+2008-10-23 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne.
+
+ Fix handling of mouse events when embedding QWebView into the
+ QGraphicsView.
+
+ QWebPage accepts or ignores events to indicate whether the web page
+ handled the event. However for QWebView to behave like a good widget
+ it should always accept the mouse events to indicate that it handled
+ them and that they should not be subject to event propagation.
+
+ The graphics view relies on acceptance of the initial mouse click to
+ make the embedded widget the focus item.
+
+ * Api/qwebview.cpp:
+ (QWebView::mouseMoveEvent):
+ (QWebView::mousePressEvent):
+ (QWebView::mouseDoubleClickEvent):
+ (QWebView::mouseReleaseEvent):
+ (QWebView::contextMenuEvent):
+ (QWebView::wheelEvent):
+
+2008-10-22 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ For public API, use the term boundingRect instead of boundingBox.
+
+ * Api/qwebframe.cpp:
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+ (QWebHitTestResult::boundingRect):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+
+2008-06-03 Siraj Razick <siraj.razick@collabora.co.uk>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19374
+
+ Expose boundingBox value in QWebHitTestResult
+
+ Add API function QRect QWebHitResult::boundingBox() const
+
+ API docs by Ariya.
+
+ * Api/qwebframe.cpp:
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+ (QWebHitTestResult::boundingBox):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+
+2008-10-21 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ emit repaintRequested unconditionally when repaint is requested.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+
+2008-10-20 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Remove FrameLoaderClient::detachedFromParent4. It is no longer used by any port.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-10-19 Darin Adler <darin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
+ improve performance by eliminating JSValue as a base class for JSCell
+
+ Remove most uses of JSValue, which will be removed in a future patch.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript): Use JSValuePtr.
+
+2008-10-14 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Clip painter to dirty rect before passing on to WebKit
+
+ This was previously done in ScrollViewQt, but after the
+ refactoring of ScrollView we need to do it in QWebFrame
+ instead, similar to Safari/Win.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::render):
+
+2008-10-08 Matthias Ettrich <ettrich@nokia.com>
+
+ Reviewed by Simon.
+
+ Make QWebView ignore focus changes with PopupFocusReason to avoid
+ massive updates when menus open and close.
+
+ * Api/qwebview.cpp:
+ (QWebView::focusInEvent):
+ (QWebView::focusOutEvent):
+
+2008-10-08 Kavindra Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixed a qdoc warning and adjusted some spacing
+
+ * Api/qwebframe.cpp:
+
+2008-10-08 Rhys Weatherley <rhys.weatherley@nokia.com>
+
+ Reviewed by Simon.
+
+ Compile for platforms without context menus.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::createStandardContextMenu):
+
+2008-10-08 André Pönitz <apoenitz@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix compilation with Qt namespaces.
+
+ * WebCoreSupport/EditCommandQt.h:
+
+2008-10-07 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ QtWebKit build fix after changes to FrameLoaderClient.h in r37371
+
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-10-07 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ [qt] Build fix after Scrollbar.h and Widget.h changes.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::swallowContextMenuEvent):
+
+2008-10-06 David Hyatt <hyatt@apple.com>
+
+ Enable viewless Mac WebKit to paint some basic pages.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2008-10-03 David Hyatt <hyatt@apple.com>
+
+ Fix scroll method on Qt. The delta was supposed to use .width()/.height() and not .x()/.y().
+
+ Fix the QtPluginWidget to do an invalidate properly.
+
+ Reviewed by ggaren
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::scroll):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+
+2008-10-03 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Build fix. Remove addToDirtyRegion from the header file.
+
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-10-03 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Build fix.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::scroll):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-10-03 David Hyatt <hyatt@apple.com>
+
+ Remove addToDirtyRegion.
+
+ Reviewed by Oliver Hunt
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+
+2008-10-02 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21314
+
+ Make scrollBackingStore cross-platform.
+
+ Reviewed by Sam Weinig
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+ (WebCore::ChromeClientQt::scroll):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-10-01 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21282
+
+ Make contentsToScreen/screenToContents cross-platform. Only implemented by Mac/Win right now.
+
+ Reviewed by Adam Roben
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::windowToScreen):
+ (WebCore::ChromeClientQt::screenToWindow):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-09-30 Dave Hyatt <hyatt@apple.com>
+
+ http://bugs.webkit.org/show_bug.cgi?id=21250
+
+ Rename updateContents to repaintContentRectangle and make it cross-platform by always sending
+ repaints up through the ChromeClient.
+
+ Reviewed by Darin Adler
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-09-29 Gunnar Sletta <gunnar@trolltech.com>
+
+ Reviewed by Simon
+
+ Compile on windows using MSVC 2005
+
+ For the PCH We need to define _WIN32_WINNT and include windows.h early on,
+ otherwise we'll miss several functions.
+
+ * WebKit_pch.h:
+
+2008-09-29 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Simon.
+
+ Changed copyright from Trolltech ASA to Nokia.
+
+ Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008.
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebhistory.cpp:
+ * Api/qwebhistory.h:
+ * Api/qwebhistory_p.h:
+ * Api/qwebkitglobal.h:
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebpluginfactory.h:
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+ * Plugins/ICOHandler.cpp:
+ * QtLauncher/main.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+ * WebCoreSupport/InspectorClientQt.h:
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/qwebpage/tst_qwebpage.cpp:
+
+2008-09-28 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by David Hyatt.
+
+ Ensure the mainThreadIdentifier is set as well as other bits and pieces of
+ the threading machinery, by calling JSC::initializeThreading().
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2008-09-27 David Hyatt <hyatt@apple.com>
+
+ Forgot to land renaming changes in WebKit.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::render):
+ (QWebFrame::pos):
+ (QWebFrame::geometry):
+ * Api/qwebpage.cpp:
+ (QWebPage::viewportSize):
+ (QWebPage::setViewportSize):
+
+2008-09-27 Simon Hausmann <hausmann@webkit.org>
+
+ Qt build fix - use frameRect instead of frameGeometry, adapt
+ to renamed scrollbar frameview methods.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::viewportSize):
+ (QWebPage::setViewportSize):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2008-09-27 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Qt build fix - rename frameGeometry to frameRect per r36995.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::render):
+ (QWebFrame::pos):
+ (QWebFrame::geometry):
+
+2008-09-26 Ariya Hidayat <ahidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixed potential crash when deleting QWebView instance.
+
+ When deleting the view, sets the page's view to NULL.
+ The reason is that the page is smart and its destructor might lead to a call
+ that operates on a view (which is in the process of being deleted).
+
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+ (QWebView::~QWebView):
+
+2008-09-26 Ariya Hidayat <ahidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixed using modifiers to type special symbols (e.g '@','$') does not work on Mac OS X.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+
+2008-09-26 HÃ¥vard Wall <hwall@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix compilation with QT_NO_MESSAGEBOX
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+
+2008-09-23 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Remove deprecated JS Qt bindings object call/construct code and fix autotests
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-09-16 Alp Toker <alp@nuanti.com>
+
+ Prospective Qt build fix. ScrollBar.h -> Scrollbar.h
+
+ * Api/qwebframe.cpp:
+ * Api/qwebpage.cpp:
+
+2008-09-15 Eli Fidler <eli@staikos.net>
+
+ Reviewed by Simon.
+
+ Yahoo assumes non-RFC compliant HTTP redirect behaviour. QtWebKit is (more)
+ compliant, so broken. I think the Yahoo-assumed behaviour is real-world standard.
+
+ Basically, Yahoo's login procedure for flickr looks like this:
+ 1. load flickr.com, click "sign in"
+ 2. this is a Yahoo page with a form
+ (https://login.yahoo.com/config/login?.src=flickr...)
+ when you click the "Sign In" button, the form submits to a yahoo.com POST URL
+ 3. The POST returns with a 302 (redirect) to another yahoo.com URL
+ 4. If you POST the redirected Location:, it all breaks. Yahoo assumes you will
+ convert the method to GET, which works fine but is definitely not
+ RFC-compliant. It would be compliant for 303, and the RFC says that many
+ implementations treat 302 and 303 the same way (for HTTP/1.0 compliance), but
+ converting to GET is explicitly wrong for 302.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+
+2008-09-15 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Make QtInstance::create() private and fix caching
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2008-09-11 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Rubber-stamped by Simon.
+
+ Prevent leaking pages and frames in QWebKit autotest
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+
+2008-09-11 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon
+
+ Fix QtWebKit autotest
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::userStyleSheet):
+
+2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
+
+ Reviewed by Simon.
+
+ Added missing WebCore prefix to ResourceRequest
+
+ This is needed for Windows/CE compilation where there is a conflict
+ with a global ResourceRequest type. Elsewhere in this file ResourceRequest
+ is also prefixed with WebCore::
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+
+2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+
+ Reviewed by Maciej Stachowiak.
+
+ Bug 20704: Replace the KJS namespace
+ <https://bugs.webkit.org/show_bug.cgi?id=20704>
+
+ Rename the KJS namespace to JSC.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+ (QWebFrame::evaluateJavaScript):
+
+2008-09-04 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon
+
+ Fix the QtWebKit build to match changes in r36016
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2008-09-04 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Re-enable support for user stylesheets in QtWebKit
+
+ QtWebKit now follows the FRAME_LOADS_USER_STYLESHEET
+ code path, which allows us to keep API support for
+ loading user style sheets from remote URLs.
+
+ As part of the change UserStyleSheetLoader.cpp/h was
+ moved from WebCore/loader/mac to WebCore/loader.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::userStyleSheet):
+
+2008-08-29 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Eric Seidel.
+
+ [janitor/qt] Start replacing port specific getters with the generic native getter
+ To get the native presentation of an image we currently have platform
+ specific #ifdef's and a generic getter using NativeImagePtr. This patch
+ extends this to the ImageBuffer and updates the Qt platform to get rid
+ of the special #ifdefs.
+
+ https://bugs.webkit.org/attachment.cgi?id=22861
+
+ * Api/qwebframe.cpp:
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+ * Api/qwebhistory.cpp:
+ * Api/qwebsettings.cpp:
+ (QWebSettings::iconForUrl):
+
+2008-08-29 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Catch up with the introduction of PageGroup in r30840. Enable tracking of
+ visited links, enable this in QWebPage next to the other WebCore init call.
+ Calling this more than once is no issue and a cheap operation, we also do not
+ reset the state. When clearing the history of a page, clear the link state.
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::clear):
+ * Api/qwebhistoryinterface.cpp:
+ (QWebHistoryInterface::setDefaultInterface):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2008-08-29 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Revert revision 34348 which removed the global historyContains() function.
+
+ This function was needed to implement the public API of QWebHistoryInterface
+ and will be used again in the near future.
+
+ * Api/qwebhistoryinterface.cpp:
+ (WebCore::historyContains):
+
+2008-08-27 Erik Bunce <elbunce@thehive.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20223
+
+ Add QWebPage::contentsChanged() signal to notify of content changes.
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedContents):
+
+2008-08-27 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Anders
+
+ <rdar://problem/6134133> - Crash when loading large movie as a standalone document
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::pluginWillHandleLoadError): Stubbed for now
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-08-25 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ [inspector] Emit signals from attachWindow and detachWindow in the Qt platform
+ Allow the user of the API to honor the attachWindow and detachWindow
+ requests and attach the QWebPage/QWebView wherever it is wanted. This needs
+ some more API in QWebPage to be properly exposed.
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::createPage):
+ (WebCore::InspectorClientQt::attachWindow):
+ (WebCore::InspectorClientQt::detachWindow):
+ * WebCoreSupport/InspectorClientQt.h:
+
+2008-08-19 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Geoff Garen.
+
+ Bring back shared JSGlobalData and implicit locking, because too many clients rely on it.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2008-08-15 HÃ¥vard Wall <hwall@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: compile with QT_NO_UNDOCOMMAND/STACK
+
+
+ * Api/qwebpage.cpp:
+ (SetCursorEvent::SetCursorEvent):
+ (QWebPagePrivate::createContextMenu):
+ (QWebPage::action):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/EditCommandQt.cpp:
+ (EditCommandQt::EditCommandQt):
+ * WebCoreSupport/EditCommandQt.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (dumpPath):
+ (WebCore::EditorClientQt::shouldInsertText):
+ (WebCore::EditorClientQt::shouldChangeSelectedRange):
+ (WebCore::EditorClientQt::isEditable):
+ (WebCore::EditorClientQt::registerCommandForUndo):
+ (WebCore::EditorClientQt::clearUndoRedoOperations):
+ (WebCore::EditorClientQt::canUndo):
+ (WebCore::EditorClientQt::canRedo):
+ (WebCore::EditorClientQt::undo):
+ (WebCore::EditorClientQt::redo):
+ (WebCore::EditorClientQt::shouldInsertNode):
+
+2008-08-15 HÃ¥vard Wall <hwall@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: compile with QT_NO_STYLE_STYLESHEET
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-08-15 HÃ¥vard Wall <hwall@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: compile with QT_NO_SHORTCUT
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::dragMoveEvent):
+
+2008-08-15 HÃ¥vard Wall <hwall@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: compile with QT_NO_CONTEXTMENU
+
+
+ * Api/qwebpage.cpp:
+ (editorCommandForWebActions):
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::createMainFrame):
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPage::setEditable):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+
+2008-08-15 HÃ¥vard Wall <hwall@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: compile with QT_NO_WHEELEVENT
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+
+2008-08-15 HÃ¥vard Wall <hwall@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: compile with QT_NO_PRINTER
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+ * Api/qwebframe.h:
+
+2008-08-15 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc: Added documentation for default property values.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPage::triggerAction):
+ (QWebPage::acceptNavigationRequest):
+ (QWebPage::action):
+ * Api/qwebview.cpp:
+
+2008-08-15 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc: Renamed snippets that appear in the code directory.
+
+
+ * Api/qwebview.cpp:
+ (QWebView::event):
+ (QWebView::print):
+
+2008-08-12 Timothy Hatcher <timothy@apple.com>
+
+ Add a stub for InspectorClient::setAttachedWindowHeight.
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::setAttachedWindowHeight):
+ Call notImplemented().
+ * WebCoreSupport/InspectorClientQt.h:
+
+2008-08-13 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Use full-page zoom in QtLauncher.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::zoomIn):
+ (MainWindow::zoomOut):
+ (MainWindow::resetZoom):
+ (MainWindow::setupUI):
+
+2008-08-13 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix linking with QtWebKit.
+
+ * Api/qwebframe.h: remove non-existing function/property.
+
+2008-08-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Based on patch by Siraj razick <siraj.razick@collabora.co.uk>
+
+ https://bugs.webkit.org/show_bug.cgi?id=19125
+
+ Added functions to get/set the zoom factor.
+
+ Added a QWebFrame/QWebView::zoomFactor as well as a boolean
+ ZoomTextOnly attribute in QWebSettings.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setZoomFactor):
+ (QWebFrame::zoomFactor):
+ * Api/qwebframe.h:
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+ * Api/qwebview.cpp:
+ (QWebView::setZoomFactor):
+ (QWebView::zoomFactor):
+ * Api/qwebview.h:
+
+2008-08-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Fix QWebFrame::setHtml() not setting the new contents immediately.
+
+ Added a setter to the DocumentLoader to toggle the deferred loading of the main
+ resource when it comes from substitute data.
+
+ Disable deferred loading of the main resource when we have valid substitute data,
+ as used by QWebFrame::setHtml.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::download):
+
+2008-08-13 Simon Hausmann <hausmann@webkit.org>
+
+ Rubber-stamped by Holger.
+
+ Fix QWebPage::isModified().
+
+ isModified() would return true after loading a new page or it would continue to
+ return true after undoing modifications. Fix this by eliminating the
+ QWebPagePrivate::modified variable and use the undoStack's canUndo() property
+ instead.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19252
+
+ * Api/qwebpage.cpp:
+ (QWebPage::action):
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedContents):
+
+2008-08-13 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Updated docs with the signal emission behavior of urlChanged()
+
+ * Api/qwebframe.cpp:
+
+2008-08-13 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix Ctrl+Y to work again when editing text in contextEditable mode.
+
+ This fixes regression in LayoutTests/editing/pasteboard/emacs-cntl-y-001.html
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+
+2008-08-13 Thiago Macieira <tjmaciei@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix encoding of [ and ] in the host part of the URL
+
+ Until QUrl is fixed (making QUrl's tolerant parser more tolerant), we have to
+ add this workaround to the QUrl <> WebCore::KURL conversion operator so that it
+ doesn't encode [ and ] when they are found in the host part. That is, the
+ following URL:
+ http://[::1]/
+ is valid and should not be reencoded to:
+ http://%5b::1%5d/
+
+ This change adds the automatic test for it.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2008-08-12 Urs Wolfer <uwolfer@kde.org>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20357
+
+ Fix crash in QWebPage in case contextMenuEvent has been overwritten
+ because context menu has the view as parent and thus is deleted too early.
+
+ Add testcase for this crash.
+
+ * Api/qwebpage_p.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::contextMenuCrash):
+
+2008-08-07 Simon Hausmann <hausmann@webkit.org>
+
+ Rubber-stamped by Lars.
+
+ Added API tests for QWebPage/QWebFrame based on QTestLib.
+
+ * tests/qwebframe/qwebframe.pro: Added.
+ * tests/qwebframe/tst_qwebframe.cpp: Added.
+ * tests/qwebpage/qwebpage.pro: Added.
+ * tests/qwebpage/tst_qwebpage.cpp: Added.
+ * tests/tests.pro: Added.
+
+2008-08-06 Benjamin C Meyer <ben@meyerhome.net>
+
+ Reviewed by Simon.
+
+ During the drag operation only accept the event if the action is not ignore action.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragMoveEvent):
+ (QWebPagePrivate::dropEvent):
+
+2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Fix the Qt build due to recent ScriptController refactoring.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2008-08-05 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Move event handling of the return-key from EditorClientQt to QWebPage.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20191
+
+ This is a first step in refactoring the big switch block
+ in EditorClientQt::handleKeyboardEvent to using WebActions
+ instead.
+
+ The new logic uses two new StandardKeys from QKeySequence:
+
+ - InsertParagraphSeparator
+ - InsertLineSeparator
+
+ Which translate to the commands InsertNewline and InsertLineBreak
+ respectivly. On Windows/X11 pressing the shift modifier will invoke
+ the latter action. For Mac this is triggered by pressing the meta
+ modifier (Ctrl).
+
+ Initial patch by: Erik Bunce
+
+ * Api/qwebpage.cpp:
+ (editorActionForKeyEvent):
+ * Api/qwebpage.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+
+2008-08-04 Erik Bunce <elbunce@thehive.com>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20221
+
+ Add updateAction() support to ToggleBold, ToggleItalic, and ToggleUnderline.
+ Add lookup table for mapping web actions to editor commands.
+
+ * Api/qwebpage.cpp:
+ (editorCommandForWebActions):
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPage::triggerAction):
+ (QWebPage::setEditable):
+
+2008-08-03 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ A bunch of improvements to the QtLauncher.
+
+ Among others:
+ - Unify and unclutter the toolbar, use menu for addition actions
+ - Simplify URL edit, just use QLineEdit (no fancy close button etc)
+ - Guess the URL from the command line so now we can run ./QtLauncher www.google.com
+ - Shortcut keys for most actions
+ - Simple autocomplete for the URL edit
+ - Actions for zooming, New Window and Close Window
+ - Show Format menu only when the content is set to editable
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::webPage):
+ (MainWindow::changeLocation):
+ (MainWindow::loadFinished):
+ (MainWindow::showLinkHover):
+ (MainWindow::newWindow):
+ (MainWindow::zoomIn):
+ (MainWindow::zoomOut):
+ (MainWindow::resetZoom):
+ (MainWindow::print):
+ (MainWindow::setEditable):
+ (MainWindow::dumpHtml):
+ (MainWindow::setupUI):
+ (main):
+
+2008-08-04 Erik Bunce <elbunce@thehive.com>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20198
+
+ Allow Copy key sequence to work in non-editable areas.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+
+2008-07-31 Erik Bunce <elbunce@thehive.com>
+
+ Reviewed by Simon.
+
+ Make sure edit actions get updated when the contents change.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedContents):
+
+2008-07-31 Erik Bunce <elbunce@thehive.com>
+
+ Reviewed by Simon.
+
+ Add simple edit test abilities to QtLauncher.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::setEditable):
+ (MainWindow::dumpHtml):
+
+2008-07-31 Alexey Proskuryakov <ap@webkit.org>
+
+ Rubber-stamped by Maciej.
+
+ Eliminate JSLock (it was already disabled, removing the stub implementaion and all
+ call sites now).
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2008-07-27 David Kilzer <ddkilzer@apple.com>
+
+ Fix Qt build failure.
+
+ * Api/qwebframe.h:
+ (QWebFrame::setScrollOffset): Make argument const.
+
+2008-07-26 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20010
+ [Qt] Add API access to scrolling
+
+ * Api/qwebframe.cpp: Added access to a frame scroll offset.
+ (QWebFrame::scroll):
+ (QWebFrame::scrollOffset):
+ (QWebFrame::setScrollOffset):
+ * Api/qwebframe.h:
+
+2008-07-26 Daniel Jalkut <jalkut@red-sweater.com>
+
+ Build fix. Adjust to updated WebCore FrameLoader method names & signatures.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2008-07-25 Joerg Bornemann <joerg.bornemann@trolltech.com>
+
+ Reviewed by Simon.
+
+ Compile with QT_NO_PRINTER.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2008-07-24 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon
+
+ Don't insert text on keyDown event in EditorClientQt.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+
+2008-07-04 Benjamin C Meyer <ben@meyerhome.net>
+
+ Reviewed by Simon.
+
+ Update the webkit version in the QtWebKit useragent string to match trunk
+
+ * Api/qwebpage.cpp:
+
+2008-07-02 Simon Hausmann <hausmann@webkit.org>
+
+ Build fix.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction): The signature of setBaseWritingDirection
+ changed to take an enum instead of a string.
+
+2008-07-01 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Disable JSLock for per-thread contexts.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+ Pass a parameter (false) to JSLock to indicate that WebKit doesn't need locking.
+ Include JSLock.h, as it is no longer brought in implicitly.
+
+2008-07-01 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Don't show the tooltip instantly in the QtLauncher.
+
+ Let the QWebView handle tooltips by itself, so we get
+ the expected delay as everywhere else.
+
+ * QtLauncher/main.cpp:
+
+2008-06-30 Simon Hausmann <hausmann@webkit.org>
+
+ Rubber-stamped by Niko.
+
+ Removed the obsolete and unmaintained WebKitPart. The integration of
+ QtWebKit into KDE is now done in the webkitkde component inside KDE.
+
+ * WebKitPart/WebKitFactory.cpp: Removed.
+ * WebKitPart/WebKitFactory.h: Removed.
+ * WebKitPart/WebKitPart.cpp: Removed.
+ * WebKitPart/WebKitPart.desktop: Removed.
+ * WebKitPart/WebKitPart.h: Removed.
+ * WebKitPart/WebKitPart.rc: Removed.
+ * WebKitPart/WebKitPartBrowser.rc: Removed.
+ * WebKitPart/WebKitPartBrowserExtension.cpp: Removed.
+ * WebKitPart/WebKitPartBrowserExtension.h: Removed.
+ * WebKitPart/WebKitPartClient.cpp: Removed.
+ * WebKitPart/WebKitPartClient.h: Removed.
+ * WebKitPart/WebKitPartInterface.cpp: Removed.
+ * WebKitPart/WebKitPartInterface.h: Removed.
+ * WebKitPart/org.kde.WebKitPart.xml: Removed.
+
+2008-06-24 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build, added missing include for RuntimeObjectImp.
+
+ * Api/qwebframe.cpp:
+
+2008-06-23 Benjamin C Meyer <ben@meyerhome.net>
+
+ Reviewed by Simon.
+
+ Add function to retrieve the standard context menu
+
+2008-06-20 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19082
+ [Qt] Full-page plugins not activated
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::committedLoad): Re-check if there's a
+ plugin present, as it can be created during the function.
+
+2008-06-20 Marco Barisione <marco.barisione@collabora.co.uk>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19082
+ [Qt] Full-page plugins not activated
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::canShowMIMEType): Return true if the
+ MIME type is supported by a plugin.
+
+2008-06-18 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Prepare JavaScript heap for being per-thread.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject): Trying not to break the build.
+
+2008-06-18 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Qt Build fix after r34627.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - give Frame object functions shorter names: scriptProxy() -> script(),
+ selectionController() -> selection(), animationController() -> animation()
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusInEvent):
+ (QWebPagePrivate::focusOutEvent):
+ (QWebPage::inputMethodQuery):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - new names for more JavaScriptCore files
+
+ * WebKit_pch.h:
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - new names for a few key JavaScriptCore files
+
+ * Api/qwebframe.cpp:
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Rubber stamped by Sam.
+
+ - new names for kjs_binding.h and kjs_proxy.h
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+ * WebKit_pch.h:
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ - fix build
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init): Added a missing semicolon.
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - more https://bugs.webkit.org/show_bug.cgi?id=17257
+ start ref counts at 1 instead of 0 for speed
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init): Use create instead of new.
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createDocumentLoader): Ditto.
+
+2008-06-13 Darin Adler <darin@apple.com>
+
+ - try to fix build
+
+ * WebCoreSupport/FrameLoaderClientQt.h: Add missing argument.
+
+2008-06-13 Darin Adler <darin@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - updated for addition of FormState argument to action policy functions
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2008-06-11 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix left-click and middle-click mouse event are not properly accepted.
+
+ When copying or pasting text using left or middle-click, the event must be
+ accepted so that it will not be potentially processed further by the parent
+ and/or sub-classed widget.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseReleaseEvent):
+
+2008-06-11 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix input element does not accept character typed in using AltGr.
+
+ EditorClient is modified to catch AltGr and Ctrl+Alt key combination.
+ This fixes http://trolltech.com/developer/task-tracker/index_html?id=207050&method=entry
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+
+2008-05-26 Jonathon Jongsma <jonathon.jongsma@collabora.co.uk>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19323
+
+ Implemented the QWebPage::editable property.
+
+ Small documentation fixes by Simon.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::setEditable):
+ (QWebPage::isEditable):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h: implement the editable property and add API so that
+ applications can switch edit mode on and off for a particular QWebPage
+ * WebCoreSupport/EditorClientQt.cpp: retrieve editable property from the
+ QWebPage instead of always returning false
+
+2008-06-09 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon
+
+ Make sure web action in context menus have the right enablement,
+ while not messing up other web actions not included in the menu.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+ (QWebPage::updatePositionDependentActions):
+ * Api/qwebpage_p.h:
+
+2008-06-09 Benjamin C Meyer <ben@meyerhome.net>
+
+ Reviewed by Simon
+
+ Add Shift-Space shortcut to go up one screen, the opposite of Space
+ which goes down one screen.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::handleScrolling):
+
+2008-06-04 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix a failing assertion when calling QWebFrame::evaluateJavaScript.
+
+ The starting line number has to be 1 instead of 0.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2008-06-03 Jonathon Jongsma <jonathon.jongsma@collabora.co.uk>
+
+ Reviewed by Darin Adler.
+
+ * Api/qwebhistoryinterface.cpp: Remove WebCore::historyContains(). This
+ function is not used anywhere internally and is only a convenience
+ function that can still be accomplished using
+ QWebHistoryInterface::historyContains();
+
+2008-05-29 Kavindra Devi Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc: Mention the requirement of a QApplication with QtWebKit
+
+
+ * Api/qwebview.cpp:
+
+2008-05-29 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Some clarifications for the documentation.
+
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpluginfactory.cpp:
+
+2008-05-27 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix web inspector does not returns its state properly after its window is minimized.
+
+ As hinted by Holger, InspectorClientView::hideEvent is not needed.
+ This fixes bug https://bugs.webkit.org/show_bug.cgi?id=18967
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+
+2008-05-21 Siraj Razick <siraj.razick@collabora.co.uk>
+
+ Reviewed by Simon.
+
+ Add <param name="classid"/> support for application/x-qt-object plugins
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-05-13 Andy Shaw <andy@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: QWebHistory::forward() should go forwards and not back
+
+ * Api/qwebhistory.cpp:
+
+2008-05-12 Alexey Proskuryakov <ap@webkit.org>
+
+ Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify
+ SquirrelFish merging.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2008-05-09 Thiago Macieira <tjmaciei@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix bad includes in QtWebKit public headers.
+
+ Make sure to include qglobal.h using the QtCore prefix so that an explicit
+ include/QtCore is not needed in the application's build system. Also make sure
+ that qwebsettings.h includes the local qwebkitglobal.h.
+
+
+ * Api/qwebkitglobal.h:
+ * Api/qwebsettings.h:
+
+2008-05-08 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18935
+
+ Based on work by Sriram Neelakandan for the Gtk port.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp: Initialize
+ m_hasSentResponseToPlugin.
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::redirectDataToPlugin):
+
+2008-05-08 Warwick Allison <warwick@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: WebKit expects initial input method state to be *disabled*.
+
+ At least QWS does not need the initial input method state to be forced to
+ enabled, but other platforms (esp. X11) do. Until fixed/tested on those
+ platforms, this is specific to QWS.
+
+
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+
+2008-05-06 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix logic error in QWebHitTestResult::isNull().
+
+ * Api/qwebframe.cpp:
+
+2008-05-02 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc: Mention that you have to enable plugins in QWebSettings for them to work.
+
+ * Api/qwebpage.cpp:
+
+2008-05-02 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build, ExecState is required here.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2008-05-01 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
+
+ Reviewed by Alp Toker.
+ Qt parts OK'ed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=14750
+ Added support for NPAPI plugins on Gtk and Qt-x11 ports.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::finishedLoading):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ (WebCore::FrameLoaderClientQt::redirectDataToPlugin):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-04-30 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Qt 4.3 build fix.
+
+ Fixes a brace error that made Qt 4.4 build but not Qt 4.3.
+
+ * Api/qwebview.cpp:
+ (QWebView::event):
+
+2008-04-30 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ In focusIn and focusOut event always update the active state of the
+ focus controller. Fixes ~400 failing layout tests due to missing
+ editing callbacks that relied on the correct focus.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusInEvent):
+ (QWebPagePrivate::focusOutEvent):
+
+2008-04-29 Lincoln Ramsay <lincoln.ramsay@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix compilation with QT_NO_PRINTER
+
+
+ * Api/qwebview.cpp:
+ (QWebView::print):
+
+2008-04-29 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Ensure that relative URL is converted to absolute URL.
+
+ This is necessary because loading a relative URL is not really supported
+ (the web page may load, but the subsequent URLs for images and links will
+ not be resolved properly).
+ This also fixes https://bugs.webkit.org/show_bug.cgi?id=18484
+
+
+ * Api/qwebframe.cpp:
+ (ensureAbsoluteUrl):
+ (QWebFrame::setUrl):
+ (QWebFrame::load):
+
+2008-04-29 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Simplification of Qt Launcher (no animation and use standard progress bar widget)
+
+ Status bar shows the hovered link without any animation. Progress bar just uses the standard QProgressBar (no custom widget). The launcher is leaner and faster to use under the debugger and/or valgrind.
+
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2008-04-29 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Update the cursor when the frame/page loading is finished.
+
+ This fixes https://bugs.webkit.org/show_bug.cgi?id=18712
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady):
+
+2008-04-29 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Holger.
+
+ Fixes: QWebPage::acceptNavigationRequest not being called / linkClicked() not being emitted when clicking on <a href="..." target="_blank"> kind of links.
+
+ Call QWebPage::acceptNavigationRequest when the creation of a new window with
+ URL is requested. The frame pointer is set to null in this case.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setViewportSize):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::startDownload):
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2008-04-29 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Use the WebCore facility to do the scrolling. Move some code around.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPagePrivate::shortcutOverrideEvent):
+ (QWebPagePrivate::handleScrolling):
+ * Api/qwebpage_p.h:
+
+2008-04-29 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ fix potential crash when loading image(s)
+
+ Crash may occur. If compiled with 4.3, the variable is not initialized.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2008-04-29 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Calling QWebView::setCursor will override the WebCore Cursor.
+ Calling QWebView::setCursor will override the WebCore Cursor using
+ QWidget::unsetCursor will revert to the WebCore Cursor.
+
+ For detecting the unset we have to compare the shape of the
+ cursor to the default arrow. Qt::WA_SetCursor can not be used
+ as it is set unconditionally but conditionally removed.
+
+ Calling QWidget::setCursor will immediately send the CursorChange
+ event. We listen to this event to decide if we currently use a
+ WebCore cursor, got a cursor from outside, or revert to the default.
+
+ This should be race free and work reliable, the manual test for this
+ is WebCore/manual-tests/cursor.html
+
+ * Api/qwebpage.cpp:
+ (SetCursorEvent::SetCursorEvent):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::QWebViewPrivate):
+ (QWebViewPrivate::setCursor):
+ (QWebView::QWebView):
+ (QWebView::event):
+
+2008-04-29 Kavindra Devi Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ Documentation fixes:
+
+ - Fixed a qdoc warning
+ - Mention that fav icons can be of arbitrary size
+ - Fix signature of QWebPage::acceptNavigationRequest show in the documentation
+
+ * Api/qwebframe.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebsettings.cpp:
+ * Api/qwebview.cpp:
+
+2008-04-28 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix QWebView::loadFinished isn't always emitted
+
+ Replaced loadDone() with loadFinished(bool) and moved the signals for progress
+ tracking (start, progres, and finish) to the page instead of the frame. This
+ ensures that we emit loadFinished even when a subframe started the actual load.
+
+ This causes a few regressions in the layout tests that we for now accept for
+ the sake of the correct API. Layout tests we can fix any time though, including
+ patch release, the API however we can't change anymore in patch releases.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::totalBytes):
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+ (QWebView::setPage):
+ * Api/qwebview.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (drtDescriptionSuitableForTestResult):
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::transitionToCommittedFromCachedPage):
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+ (WebCore::FrameLoaderClientQt::willChangeTitle):
+ (WebCore::FrameLoaderClientQt::createDocumentLoader):
+ (WebCore::FrameLoaderClientQt::download):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-04-28 Kavindra Devi Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ Added more documentation for QWebSettings, QWebPluginFactory and QWebFrame
+
+ * Api/qwebframe.cpp:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setUserStyleSheetUrl):
+ (QWebSettings::iconForUrl):
+ (QWebSettings::webGraphic):
+ (QWebSettings::maximumPagesInCache):
+ (QWebSettings::setFontFamily):
+ (QWebSettings::resetFontFamily):
+ (QWebSettings::testAttribute):
+ (QWebSettings::resetAttribute):
+
+2008-04-28 Ariya Hidayat <ahidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix document/frame title not reset when loading a new URI
+
+ We should assume first the frame has no title. If it has, then the dispatchDidReceiveTitle()
+ will be called very soon with the correct title.
+ This properly resets the title when we navigate to a URI without a title.
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-04-28 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Minor documentation changes.
+
+ * Api/qwebview.cpp:
+
+2008-04-28 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Prevent middle-click from triggering open URL from clipboard when the event has already been accepted.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseTripleClickEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+
+2008-04-28 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix scrollbar behavior in QtWebKit to match QScrollBar.
+
+ Right click context menu is now supported, along with
+ middle click to center slider thumb over mouse cursor.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::linkDelegationPolicy):
+
+2008-04-28 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Implemented channel-based logging for QtWebKit.
+
+ Comma-separated log channels are read from the QT_WEBKIT_LOG environment variable.
+ Warnings for notImplemented() is still output by default, but can be disabled
+ by setting DISABLE_NI_WARNINGS=1.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2008-04-28 Simon Hausmann <shausman@trolltech.com>
+
+ Rubber-stamped by Lars
+
+ Removed setHtml(const QByteArray &) overload as it breaks the common use of the setHtml() API.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+
+2008-04-28 Kavindra Devi Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc - adding more documentation to QWebFrame, QWebPage and QWebView
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebview.cpp:
+ (QWebView::stop):
+ (QWebView::back):
+ (QWebView::changeEvent):
+
+2008-04-28 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Holger.
+
+ Fixes: Popups/Context menu in WebKit appearing at the wrong location when embedded in the graphics view or using multiple screens
+
+ Give the popups the right parent widget and the right coordinates relative within the parent.
+
+
+ * Api/qwebpage.cpp:
+
+2008-04-28 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc: Add see also's (and a few minor whitespace/typo corrections)
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::~QWebFrame):
+ (QWebFrame::setHtml):
+ (QWebFrame::setContent):
+ (QWebFrame::parentFrame):
+ (QWebFrame::childFrames):
+ (QWebFrame::setScrollBarValue):
+ (QWebFrame::scrollBarValue):
+ (QWebFrame::scrollBarMaximum):
+ (QWebFrame::scrollBarMinimum):
+ (QWebFrame::render):
+ (QWebFrame::pos):
+ (QWebFrame::geometry):
+ (QWebFrame::print):
+ (QWebFrame::evaluateJavaScript):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPage::~QWebPage):
+ (QWebPage::javaScriptPrompt):
+ (openNewWindow):
+ (QWebPage::setViewportSize):
+ (QWebPage::acceptNavigationRequest):
+ (QWebPage::action):
+ (QWebPage::userAgentForUrl):
+ (QWebPagePrivate::_q_onLoadProgressChanged):
+ * Api/qwebview.cpp:
+ (QWebView::event):
+
+2008-04-28 Kavindra Devi Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ Submitting more documentation for QWebPage
+
+
+ * Api/qwebpage.cpp:
+
+2008-04-28 Lincoln Ramsay <lincoln.ramsay@trolltech.com>
+
+ Reviewed by Simon.
+
+ Compile when QT_NO_CLIPBOARD is defined.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+
+2008-04-28 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Minor documentation fix.
+
+
+ * Api/qwebhistory.cpp:
+
+2008-04-28 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Implement QWebPage::createPlugin
+
+ The code is coming from the demo browser and needed here
+ for some manual tests.
+
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/main.cpp:
+ (WebPage::createPlugin):
+
+2008-04-28 Simon Hausmann <hausmann@webkit.org>
+
+ Qt/Win build fix. Include config.h to get the implicit MathExtras.h
+ inclusion correct with regards to rand_s.
+
+ * Api/qwebhistory.cpp:
+
+2008-04-28 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18713
+
+ Fix scrollbar painting issues in QtWebKit.
+
+ Hovering and click-draging outside of the scrollbar would
+ produce unexpected and inconcistent results. We also didn't
+ pass on leave-events to the underlying WebKit code, which
+ was nessecary to implement the paint fix.
+
+ Note: The event handling of the Leave event should be moved
+ out of QWebView::event() and into a proper override for 4.5.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::leaveEvent):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::event):
+
+2008-04-25 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon, Holger.
+
+ Fixed focus handling when a node is focused while the corresponding QWebPage does not have the focus.
+
+ * Correctly de- and reactivate the focused frame in focusOut/focusInEvent
+ without telling the focus controller. We don't want to change the focused frame
+ - the controller has to remember it in fact - but instead just deactivate the
+ frame for correct painting as RenderTheme::isFocused() uses the activation
+ state of the frame.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusInEvent):
+ (QWebPagePrivate::focusOutEvent):
+
+2008-04-25 Kavindra Devi Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ completed documentation for the Detailed Description section for QWebView
+
+
+ * Api/qwebview.cpp:
+
+2008-04-25 Denis Dzyubenko <denis.dzyubenko@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixed the way QWebHistory works - when you call back(), forward() or goToItem() functions it changes the current item in history *and* loads the corresponding page.
+
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::back):
+ (QWebHistory::forward):
+ (QWebHistory::goToItem):
+
+2008-04-25 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix resubmit of HTML forms when initially denied by QWebPage::acceptNavigationRequest().
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2008-04-25 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ When pressing backspace in a line edit in a webpage we should not go back to the previous page.
+
+ The shortcut for back on Windows is backspace. Implemented shortcut override
+ handling in QWebView/QWebPage to prevent this.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::wheelEvent):
+ (editorActionForKeyEvent):
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPagePrivate::inputMethodEvent):
+ (QWebPagePrivate::shortcutOverrideEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::event):
+
+2008-04-25 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix triple-clicking does not work in a web page
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPagePrivate::timerEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPage::undoStack):
+ * Api/qwebpage_p.h:
+
+2008-04-25 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ When pressing Ctrl-Up the keyboard modifiers could include other modifiers
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+
+2008-04-25 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix handling of Javascript's confirm() function in QtWebKit.
+
+
+ * Api/qwebpage.cpp:
+
+2008-04-25 Kavindra Devi Palaraja <kdpalara@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc - added a screenshot, flowchart, and a snippet to the QWebView documentation to improve clarity
+
+
+ * Api/qwebview.cpp:
+
+2008-04-25 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ QWebPage: missing signal when window.print() is requested from javascript
+
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+
+2008-04-25 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: "Save Image" action wasn't doing anything.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+
+2008-04-25 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Apply key event changes to the current frame, not the main frame.
+
+ Example: hitting space bar should scroll current frame, not the main frame
+ which doesn't even have a scrollbar.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+
+2008-04-25 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: QWebFrame crash when fetching the icon
+
+ Just call QWebSettings::iconForUrl to not duplicate code and obey the mutex lock.
+
+ * Api/qwebframe.cpp:
+
+2008-04-25 Warwick Allison <warwick@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: Scrollbars did not report correct maximum.
+
+ * Api/qwebframe.cpp:
+
+2008-04-25 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Documentation updates for some of the QWeb classes
+
+ * Api/qwebframe.cpp:
+ * Api/qwebhistory.cpp:
+ * Api/qwebsettings.cpp:
+ * Api/qwebview.cpp:
+
+2008-04-25 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Implement dumping of resource load callbacks to pass http/tests/xmlhttprequest/abort-should-cancel-load.html
+
+ Similar to Editing and Frameloading we do the dumping within WebCore
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (qt_dump_frame_loader):
+ (qt_dump_resource_load_callbacks):
+ (drtDescriptionSuitableForTestResult):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+
+2008-04-24 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam.
+
+ Change some String arguments to be const references instead.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::shouldInsertText):
+ * WebCoreSupport/EditorClientQt.h:
+
+2008-04-24 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Cosmetic changes to make the code more readable.
+ -Early exit if we don't have a webview
+ -handle the empty tooltip and non-empty tooltip case separately
+
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::setToolTip):
+ (WebCore::ChromeClientQt::print):
+
+2008-04-24 Paul Olav Tvete <paul@trolltech.com>
+
+ Reviewed by Simon.
+
+ Automatically wrap tooltip text and hide a shown tooltip when it is empty.
+
+ QWidget::setTooltip("") will still show the old tooltip for up to 10 seconds.
+ Workaround as discussed with Matthias.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::setToolTip):
+
+2008-04-24 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ Allow to disable caching completeley by calling setObjectCacheCapacities(0, 0, 0)
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::setObjectCacheCapacities):
+
+2008-04-24 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Improve keyboard scrolling
+
+ Match Down/Up keys scroll distance with Safari (i.e. faster) and add Home and End shortcuts to scroll to the top/botom.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+
+2008-04-24 Olivier Goffart <ogoffart@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix various compiler warnings in the Qt port.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+ * Api/qwebsettings.cpp:
+ (graphics):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-04-24 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Cleaned up copyright headers (removed misplaced class descriptions and
+ fixed inconsistent whitespace and indentation).
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebhistory.cpp:
+ * Api/qwebhistory.h:
+ * Api/qwebhistory_p.h:
+ * Api/qwebhistoryinterface.cpp:
+ * Api/qwebhistoryinterface.h:
+ * Api/qwebkitglobal.h:
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebpluginfactory.h:
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+ * Api/qwebview.h:
+ * QtLauncher/main.cpp:
+
+2008-04-24 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Added basic URL guessing to QtLauncher (same as in the demo browser).
+
+
+ * QtLauncher/main.cpp:
+ (MainWindow::changeLocation):
+ (MainWindow::guessUrlFromString):
+
+2008-04-24 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon Hausmann <hausmann@webkit.org>.
+
+ Prevent double deletions of the default web interface.
+
+
+ * Api/qwebhistoryinterface.cpp:
+ (gCleanupInterface):
+ (QWebHistoryInterface::QWebHistoryInterface):
+
+2008-04-23 Simon Hausmann <hausmann@webkit.org>
+
+ Fix compilation against Qt 4.3
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+ * QtLauncher/main.cpp:
+ (main):
+
+2008-04-23 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon.
+
+ * Make sure the "Inspect Element" item gets added to the ContextMenu, a call
+ to ContextMenu::populate() is not adding it, the ContextMenuController does
+ add it after the call to populate(). Do that as well.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::updatePositionDependentActions):
+
+2008-04-23 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix crashes on window.close().
+
+ We should not delete the QWebPage object in the ChromeClient but leave it up to
+ the application when and whether to delete a browser window. For this we now
+ emit the windowCloseRequested() signal.
+
+ Done with Tor Arne.
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ * WebCoreSupport/ChromeClientQt.cpp:
+
+2008-04-23 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix parsing of external scripts/stylesheets when using setHtml(const QString &html).
+
+ We used to pass the html string to the frameloader in utf-16, which also meant that the default
+ encoding of external scripts/stylesheets became utf-16. That doesn't make sense, so assume utf-8
+ by default. This is now also documented.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setHtml):
+ * Api/qwebview.cpp:
+
+2008-04-23 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes background color propagation when using a custom QWebPage
+
+ Set the palette in setPage(), not during the creation on-demand.
+
+
+ * Api/qwebview.cpp:
+ (QWebView::page):
+ (QWebView::setPage):
+
+2008-04-23 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix the user agent on the mac to be BSD4
+
+ Put Q_OS_DARWIN before Q_OS_BSD4 sense they are both defined on the mac
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+
+2008-04-23 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Holger.
+
+ Added missing copyright notice.
+ Small fixes to the documentation.
+
+ * Api/qwebpluginfactory.cpp:
+
+2008-04-23 Zack Rusin <zack@tungstengraphics.com>
+
+ Reviewed by Simon.
+
+ Added a contentsSize() property.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::contentsSize):
+ (QWebFrame::hitTestContent):
+ * Api/qwebframe.h:
+
+2008-04-22 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: QWebPage's QNetworkManager's can be shared among webpages.
+
+ Don't force the deletion of the object, but let QObject take care of it.
+
+ * Api/qwebpage.cpp:
+
+2008-04-22 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Documentation for QWebPluginFactory and documentation updates for QWebPage.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setLinkDelegationPolicy):
+ (QWebPage::linkDelegationPolicy):
+ (QWebPage::swallowContextMenuEvent):
+ (QWebPage::updatePositionDependentActions):
+ (QWebPage::extension):
+ (QWebPage::networkAccessManager):
+ * Api/qwebpluginfactory.cpp:
+ (QWebPluginFactory::QWebPluginFactory):
+ (QWebPluginFactory::~QWebPluginFactory):
+ (QWebPluginFactory::refreshPlugins):
+
+2008-04-22 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Added QWebPage::swallowContextMenuEvent and QWebPage::updatePositionDependentActions.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPage::setLinkDelegationPolicy):
+ (QWebPage::linkDelegationPolicy):
+ (QWebPage::swallowContextMenuEvent):
+ (QWebPage::updatePositionDependentActions):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::event):
+
+2008-04-22 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Added Extension APIs for QWebPage.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setLinkDelegationPolicy):
+ (QWebPage::linkDelegationPolicy):
+ (QWebPage::extension):
+ * Api/qwebpage.h:
+ * Api/qwebpluginfactory.cpp:
+ (QWebPluginFactory::extension):
+
+2008-04-22 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Emit loadProgress() signal on loadStarted().
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::postProgressEstimateChangedNotification):
+
+2008-04-22 Zack Rusin <zack@kde.org>
+
+ Reviewed by Simon.
+
+ Fix background propagation from the QWebView's palette.
+
+ The background brush of the palette needs to be propagated to the WebCore::FrameView.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::updateBackground):
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dropEvent):
+ (QWebPage::setPalette):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::page):
+ (QWebView::changeEvent):
+ * Api/qwebview.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-04-22 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix maps.google.com
+
+ We have to include a version in the Safari tag in the user-agent.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+
+2008-04-22 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Add visual focusing hint for clear button and
+ change focus to web page after user enters new URL.
+
+ * QtLauncher/main.cpp:
+ (ClearButton::paintEvent):
+ (MainWindow::changeLocation):
+
+2008-04-22 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Added QWebFrame::hitTestContent() and QWebHitTestResult.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::hitTestContent):
+ (QWebFrame::event):
+ (QWebHitTestResult::QWebHitTestResult):
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+ (QWebHitTestResult::operator=):
+ (QWebHitTestResult::~QWebHitTestResult):
+ (QWebHitTestResult::isNull):
+ (QWebHitTestResult::pos):
+ (QWebHitTestResult::title):
+ (QWebHitTestResult::linkText):
+ (QWebHitTestResult::linkUrl):
+ (QWebHitTestResult::linkTitle):
+ (QWebHitTestResult::linkTargetFrame):
+ (QWebHitTestResult::alternateText):
+ (QWebHitTestResult::imageUrl):
+ (QWebHitTestResult::pixmap):
+ (QWebHitTestResult::isContentEditable):
+ (QWebHitTestResult::isContentSelected):
+ (QWebHitTestResult::frame):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::contextMenuEvent):
+ (QWebPage::triggerAction):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2008-04-22 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Don't crash if an input method query is done without a page.
+
+
+ * Api/qwebview.cpp:
+ (QWebView::inputMethodQuery):
+
+2008-04-22 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Added re-implementations of QObject::event for future safety.
+
+ This makes it easier to fix bugs with the event handling even in patch releases
+ and is a general style we follow in Qt.
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ (QWebView::event):
+ * Api/qwebview.h:
+
+2008-04-22 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix construction of the user agent.
+
+ The user-agent is now composed of
+ * the platform and subplatform
+ * the Qt version or application name and version (if set)
+ * the locale
+ * the SSL settings
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::networkAccessManager):
+ (QWebPage::setPluginFactory):
+ (QWebPage::pluginFactory):
+ (QWebPage::userAgentForUrl):
+ * QtLauncher/main.cpp:
+
+2008-04-22 Thiago Macieira <tjmaciei@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: Pedantic compilation fix
+
+ Don't put semi-colons after braces closing namespaces.
+
+ * Api/qwebsettings.h:
+
+2008-04-21 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Changed the return type of QWebFrame::evaluateJavaScript from a QString to a QVariant.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+ * Api/qwebframe.h:
+
+2008-04-21 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fixes redundant "Fonts" submenu in default lineedits that has only disabled items.
+
+ Don't show sub-menus that have only actions that are disabled.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+
+2008-04-21 Kavindra Devi Palaraja <kdpalara@trolltech.com>.
+
+ Reviewed by Simon.
+
+ Lots of documentation fixes, fixed all qdoc warnings.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setTextSizeMultiplier):
+ * Api/qwebhistoryinterface.cpp:
+ (gCleanupInterface):
+ (QWebHistoryInterface::QWebHistoryInterface):
+ (QWebHistoryInterface::~QWebHistoryInterface):
+ * Api/qwebpage.cpp:
+ (QWebPage::inputMethodQuery):
+ (QWebPage::view):
+ (QWebPage::javaScriptConsoleMessage):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::viewportSize):
+ (QWebPage::acceptNavigationRequest):
+ (QWebPage::action):
+ (QWebPage::event):
+ (QWebPage::focusNextPrevChild):
+ (QWebPage::setForwardUnsupportedContent):
+ (QWebPage::setLinkDelegationPolicy):
+ (QWebPage::findText):
+ (QWebPage::settings):
+ (QWebPage::networkProxy):
+ (QWebPage::setNetworkAccessManager):
+ * Api/qwebpage.h:
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setIconDatabasePath):
+ (QWebSettings::iconForUrl):
+ (QWebSettings::fontFamily):
+ * Api/qwebview.cpp:
+ (QWebView::load):
+ * Api/qwebview.h:
+
+2008-04-21 Marius Bugge Monsen <mmonsen@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix compile failure on solaris-cc
+
+ * Api/qwebpage.h: Removed trailing semicolons and moved the private
+ d-pointer to not confuse the compiler
+
+2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ Build fix for Qt 4.3
+
+ * When building WebCore/internal make sure the QT_[BEGIN,END]_NAMESPACE is
+ always defined. Do this by adding defines to the compiler line
+ * For users of our API this is not feasible. Every public header file should
+ include qwebkitglobal.h. Define the QT_BEGIN_NAMESPACE and QT_END_NAMESPACE
+ when we are building everything < 4.4.0 and don't have them defined.
+
+ * Api/qwebkitglobal.h:
+
+2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Initialize the WebGraphics with the one found in WebCore
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+
+2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Allow TextAreas to be resized.
+ * No QWebSettings for this is introduced.
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+
+2008-04-21 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Holger.
+
+ Fixes: QWebView::url property behaviour strange in designer
+
+ Added QWebView/QWebFrame::setUrl, which unlike load() clears the view immediately, schedules a load of the url but also makes sure url() returns the set url. This setter is now also used for the url property.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setUrl):
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ (QWebView::setUrl):
+ * Api/qwebview.h:
+
+2008-04-21 Andre Poenitz <andre.poenitz@trolltech.com>
+
+ Reviewed by Simon Hausmann <hausmann@webkit.org>.
+
+ Fix compilation with Qt namespaces
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+ * Api/qwebview.h:
+
+2008-04-21 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ When printing on high resolution printers we need to scale the painter accordingly (for now).
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+
+2008-04-21 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Provide a print preview in the QtLauncher
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::showLinkHover):
+ (MainWindow::print):
+
+2008-04-20 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Alp Toker.
+
+ Share the printing code between the Gtk and the Qt port
+ and added printing to the Qt WebKit API.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ (QWebView::print):
+ * Api/qwebview.h:
+
+2008-04-19 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Qt build fix (renderer() -> contentRenderer()).
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::renderTreeDump):
+ (QWebFrame::render):
+
+2008-04-18 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Many API changes and additions after a full review with Jasmin Blanchette <jasmin@trolltech.com>
+
+ The diff is too big to mention the changes individually, but most of the changes were of cosmetic
+ nature where methods or enums have been renamed or prefixed/suffixed according to the consistency
+ rules of the Qt API.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+ (QWebFrame::toHtml):
+ (QWebFrame::toPlainText):
+ (QWebFrame::icon):
+ (QWebFrame::setContent):
+ (QWebFrame::setScrollBarPolicy):
+ (QWebFrame::render):
+ (QWebFrame::setTextSizeMultiplier):
+ (QWebFrame::textSizeMultiplier):
+ (QWebFrame::pos):
+ * Api/qwebframe.h:
+ * Api/qwebhistory.cpp:
+ * Api/qwebhistory.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPagePrivate::acceptNavigationRequest):
+ (webActionForContextMenuAction):
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPage::view):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::createWindow):
+ (QWebPage::triggerAction):
+ (QWebPage::setViewportSize):
+ (QWebPage::acceptNavigationRequest):
+ (QWebPage::action):
+ (QWebPage::focusNextPrevChild):
+ (QWebPage::setForwardUnsupportedContent):
+ (QWebPage::forwardUnsupportedContent):
+ (QWebPage::setLinkDelegationPolicy):
+ (QWebPage::findText):
+ (QWebPage::networkAccessManager):
+ (QWebPageContext::imageUrl):
+ (QWebPageContext::image):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setIconDatabasePath):
+ (QWebSettings::iconDatabasePath):
+ (QWebSettings::clearIconDatabase):
+ (QWebSettings::iconForUrl):
+ (QWebSettings::setWebGraphic):
+ (QWebSettings::fontFamily):
+ (QWebSettings::setAttribute):
+ (QWebSettings::testAttribute):
+ (QWebSettings::resetAttribute):
+ * Api/qwebsettings.h:
+ * Api/qwebview.cpp:
+ (QWebView::setPage):
+ (QWebView::icon):
+ (QWebView::setTextSizeMultiplier):
+ (QWebView::textSizeMultiplier):
+ (QWebView::findText):
+ (QWebView::reload):
+ (QWebView::mouseMoveEvent):
+ * Api/qwebview.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (main):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::ChromeClientQt):
+ (WebCore::ChromeClientQt::setWindowRect):
+ (WebCore::ChromeClientQt::toolbarsVisible):
+ (WebCore::ChromeClientQt::setStatusbarVisible):
+ (WebCore::ChromeClientQt::statusbarVisible):
+ (WebCore::ChromeClientQt::setScrollbarsVisible):
+ (WebCore::ChromeClientQt::setResizable):
+ (WebCore::ChromeClientQt::scrollBackingStore):
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+ (WebCore::ChromeClientQt::setToolTip):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::didPerformFirstNavigation):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientQt::createFrame):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+
+2008-04-18 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Added QWebView::find/QWebFrame::find.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::focusNextPrevChild):
+ (QWebPage::find):
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+ (QWebView::find):
+ * Api/qwebview.h:
+
+2008-04-15 Ariya Hidayat <ariya.hidayat@trolltech.com>
+
+ Reviewed by Simon.
+
+ fix potential crash when loading image(s)
+
+ Crash may occur. If compiled with 4.3, the variable is not initialized.
+ This fix solves https://bugs.webkit.org/show_bug.cgi?id=17174
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2008-04-15 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Update the micro focus for input methods as soon as the composition mode changes
+ or the caret/selection changes.
+
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+ (QWebView::setPage):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedSelection):
+ (WebCore::EditorClientQt::setInputMethodState):
+
+2008-04-15 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Don't use QDir, QString or any locale sensitive function before constructing Q(Core)Application,
+ it yields undefined behaviour or wrong default codec initialization.
+
+
+ * QtLauncher/main.cpp:
+ (WebPage::createWindow):
+
+2008-04-15 Olivier Goffart <ogoffart@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: copy to clipboard when selecting, and paste when clicking with the middle button
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseReleaseEvent): If the clipboard supports
+ selections then we support copy & paste into the selection.
+
+2008-04-15 Michael Brasser <michael.brasser@trolltech.com>
+
+ Reviewed by Simon.
+
+ Add basic input method support.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dropEvent):
+ (QWebPagePrivate::inputMethodEvent):
+ (QWebPage::inputMethodQuery):
+ (QWebPage::event):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+ (QWebView::inputMethodQuery):
+ (QWebView::inputMethodEvent):
+ * Api/qwebview.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+
+2008-04-15 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Added (QWebFrame|QWebView)::textZoomFactor.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setTextZoomFactor):
+ (QWebFrame::textZoomFactor):
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ (QWebView::setTextZoomFactor):
+ (QWebView::textZoomFactor):
+ * Api/qwebview.h:
+
+2008-04-15 Michael Brasser <michael.brasser@trolltech.com>
+
+ Reviewed by Simon.
+
+ Added simple scrolling API to QWebFrame.
+
+ The intent is that it works similar to QAbstractScrollArea.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setScrollBarValue):
+ (QWebFrame::scrollBarValue):
+ (QWebFrame::scrollBarMaximum):
+ (QWebFrame::scrollBarMinimum):
+ * Api/qwebframe.h:
+
+2008-04-15 Olivier Goffart <ogoffart@trolltech.com>
+
+ Reviewed by Holger.
+
+ Fixes: implement the OpenFrameInNewWindow action.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+
+2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fix compilation with Qt namespaces
+
+ Qt can be configured to have all of its classes inside a specified namespaces.
+ This is for example used in plugin/component environments like Eclipse.
+
+ This change makes it possible to let the Qt port compile against a namespaced
+ Qt by the use of macros Qt provides to properly forward declare Qt classes in
+ the namespace.
+
+ * Api/qwebframe.h:
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpluginfactory.h:
+ * Api/qwebsettings.h:
+ * Api/qwebview.h:
+
+2008-04-05 Olivier Goffart <ogoffart@trolltech.com>
+
+ Reviewed by Holger.
+
+ Fixes: Right clicking an image and choosing "copy image" doesnt put anything in the clipboard.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+
+2008-04-05 Olivier Goffart <ogoffart@trolltech.com>
+
+ Reviewed by Simon.
+
+ Fixes: Right click, and "Open image" open the link instead of the image.
+
+
+ * Api/qwebpage.cpp:
+
+2008-04-05 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Added doc stub for QWebSettings so class docs are generated
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2008-04-05 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Propose the addition of updateRequest and scrollRequest to the QWebPage.
+
+ * The question is if these signals belong to QWebPage or QWebFrame.
+ -It is more easy to have them in QWebPage because ScrollView is invoking
+ the ChromeClient with the right coordinates
+ -On the other hand someone wants to render frames separately. But this is partly
+ doomed as you can have overlapping frames and what you paint would not relate to
+ what you normally see on webpages.
+
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::scrollBackingStore):
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+
+2008-04-03 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Roll out r31599 and r31605 again after discussion with Mark Rowe.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::icon):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::iconForUrl):
+
+2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Change IconDatabase::iconForPageURL to return more information. E.g. if
+ an image has been found, or if the loading of an image has been scheduled.
+ * Update FrameLoader to use another method to trigger reading from disk
+ * Update the QWebFrame and QWebSettings
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::icon):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::iconForUrl):
+
+2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Safari is using the IconDatabase the following way (assumption). Before they
+ call iconDatabase()->open they "retain" all URLs they are interested in, these
+ could come from the history.
+ * When opening the iconDatabase() a thread will be started that is going to import
+ the URLs, all none manually retained URLs are scheduled for removal. The removal
+ is going to happen when the next icon gets stored in the database.
+ * We do not have any IconDatabase code, we can not retain the URLs before opening the
+ database. To disable the automatic pruning of the icons we will ask the IconDatabase
+ to delay this operation. This means our IconDatabase, when used, will grow, so we should
+ try to have a IconDatabase class in 4.4.
+ * The only way to counter the growth is a call to QWebSettings::clearIconDatabase
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::clearIconDatabase):
+ * Api/qwebsettings.h:
+
+2008-04-03 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Add a way to get the site icon for a url
+ static QPixmap iconForUrl(const QUrl &url);
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::iconForUrl):
+ * Api/qwebsettings.h:
+
+2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Update the Copyright info in QWebSettings
+
+
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+
+2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * The isEmpty check is not needed anymore with the earlier backport
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::icon):
+
+2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * For the http tests we need the output of the FrameLoaderClient. The QtWebKit API
+ is not exporting enough to create the output in DRT itself. Settle with the approach
+ Lars has taken for the Editing support and add branches to our FrameLoaderClient code.
+ * run-webkit-tests http/tests(/loading) can now be executed.
+ * For tests in loading/ directories we are going to throw away the dirty
+ QWebPage to start with something clean.
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (qt_dump_frame_loader):
+ (drtDescriptionSuitableForTestResult):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidCancelClientRedirect):
+ (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect):
+ (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchWillClose):
+ (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+ (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::registerForIconNotification):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2008-04-02 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Export the PageCache and Cache capacity call one to one. This is only there
+ to allow the QtLauncher to play with caching.
+ * TODO: make API decisions and consider following the windows Api to set a WebCacheModel
+ and determine certain values automatically.
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::setPageCacheCapacity):
+ (QWebSettings::setObjectCacheCapacities):
+ * Api/qwebsettings.h:
+ * QtLauncher/main.cpp:
+
+2008-04-02 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ Prepapre everything for enabling the PageCache for the Qt Platform:
+ * Claim that we can cache pages
+ * Create the FrameView FrameLoaderClientQt::transitionToCommittedForNewPage using
+ the initial size of the viewport and stop creating it in the QWebFramePrivate::init
+
+ Differences to the Windows port:
+ * attachToWindow/detachFromWindow is not called and is not (yet) part
+ of Widget/ScrollView of the Qt platform. We might need that for plugin
+ support in the future.
+ * We store the margin's and scrolling flag inside QWebFrame and use it when
+ creating the FrameView.
+
+ What is missing:
+ * API to call pageCache()->setCapacity(XYZ);
+
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+ (WebCore::FrameLoaderClientQt::blockedError):
+
+2008-04-02 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * For the PageCache support we do not want to create a FrameView in the constructor
+ of QWebFrame. In QWegPage::viewportSize() we currently call mainFrame() and that will
+ create a QWebFrame if no mainFrame is present and this gets called when we try to
+ create a FrameView...
+ * Keep a copy of the initial viewportSize around and use it if we do not have a Frame
+ or FrameView.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::triggerAction):
+ * Api/qwebpage_p.h:
+
+2008-04-02 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Always return true in FrameLoaderClientQt::shouldGoToHistoryItem, like the windows port
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+
+2008-04-02 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Attempt to make the m_webFrame null pointer checking consistent. Always check for
+ m_webFrame. It should get set by the QWebFrame with the FramerLoaderClientQt::setFrame
+ call and should stay valid until the destruction of the QWebFrame.
+ * Currently the same checking is not needed for m_frame as it will only set to 0 in
+ FrameLoaderClientQt::frameLoaderDestroyed and should be not 0 because of the setFrame
+ initialisation.
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveContentLength):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-04-01 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Get the RefCounting of WebCore::Frame right and make sure that both QWebFrame
+ and WebCore::Frame get destroyed if we leave site with subframes and on the
+ end of the application.
+ * Use adoptRef in FrameLoaderClientQt::createFrame to get the refs right for subframes. We
+ do not want to add an extra reference. Without this we are leaking subframes.
+ * Assume that the lifetime of a Frame and FrameLoader are the same, when the Frame is gone
+ we want to destroy the QWebFrame (e.g. on a page with subframes). Add delete m_webFrame
+ in the frameLoaderDestroyed method to do that.
+ * If we happen to delete the QWebFrame before the FrameLoaderClientQt we set m_webFrame to
+ zero in the FrameLoaderClientQt to avoid bad things.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::~QWebFrame):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-04-01 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Do not save a RefPtr to the frame. The FrameLoaderClient, Frame and
+ QWebFrame should have the same lifetime everything else is a leak
+ or issue.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ * Api/qwebframe_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-04-01 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Do not store the QWebFrame associated with a ScrollView/FrameView
+ in the WebCore::Widget.
+ * Instead of asking the Widget for the QWebFrame use the QWebFramePrivate::core
+ and QWebFramePrivate::kit function to convert from and to QWebFrame.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+
+2008-04-01 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Do not store the FrameView in the QWebFrame and cope with the situation when
+ a WebCore::Frame has no WebCore::FrameView.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ (QWebFramePrivate::horizontalScrollBar):
+ (QWebFramePrivate::verticalScrollBar):
+ (QWebFrame::innerText):
+ (QWebFrame::renderTreeDump):
+ (QWebFrame::setVerticalScrollBarPolicy):
+ (QWebFrame::setHorizontalScrollBarPolicy):
+ (QWebFrame::render):
+ (QWebFrame::layout):
+ (QWebFrame::pos):
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::contextMenuEvent):
+ (QWebPagePrivate::wheelEvent):
+ (QWebPage::triggerAction):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-04-01 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Change the order of the methods to match with the FrameLoaderClient.h to ease
+ removing methods in the future.
+
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-04-01 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Remove virtuals in the FrameLoaderClientQt that don't exist in the base class.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::detachedFromParent4):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ Remove newly obsolete FrameLoaderClient methods
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-03-22 Mark Rowe <mrowe@apple.com>
+
+ Qt build fix.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+
+2008-03-18 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix the Qt build. Don't return void in non-void functions.
+
+ * Api/qwebpluginfactory.cpp:
+ (QWebPluginFactory::extension):
+
+2008-03-16 Thiago Macieira <thiago.macieira@trolltech.com>
+
+ Reviewed by Simon.
+
+ Don't use RefPtr in classes you haven't seen the implementation of.
+
+ Forward-declaration and declaration of RefPtr<Foo> is ok. But you
+ cannot *use* said objects until Foo is defined. This is true even for
+ initialisation with a 0.
+
+ Seems the HP aCC compiler is more strict here than gcc.
+
+ * Api/qwebframe_p.h:
+
+2008-03-14 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setHtml):
+ (QWebFrame::setContent):
+
+2008-03-13 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJSWindowObject):
+
+2008-03-12 Simon Hausmann <hausmann@webkit.org>
+
+ Fix compilation against Qt 4.3
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2008-03-11 Rodney Dawes <dobey@wayofthemonkey.com>
+
+ Fix the Qt build.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (FrameLoaderClientQt::CreatePlugin):
+
+2008-03-11 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build (silly typo).
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2008-03-11 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Moved obscuring progress bar to the lower right corner.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::resizeEvent):
+
+2008-03-11 Tor Arne Vestbø <tavestbo@trolltech.com>
+
+ Reviewed by Simon.
+
+ Added reload action and grouped stop and reload actions together.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2008-03-11 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Set a Icon on the QAction if we have one.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::action):
+
+2008-03-11 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJSWindowObject):
+
+2008-03-07 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Done with Lars.
+
+ Replaced the QWebObjectPlugin interfaces with QWebPluginFactory.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::cancel):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ * Api/qwebnetworkinterface_p.h:
+ (QWebNetworkJobPrivate::QWebNetworkJobPrivate):
+ * Api/qwebobjectplugin.cpp: Removed.
+ * Api/qwebobjectplugin.h: Removed.
+ * Api/qwebobjectplugin_p.h: Removed.
+ * Api/qwebobjectpluginconnector.cpp: Removed.
+ * Api/qwebobjectpluginconnector.h: Removed.
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::setPluginFactory):
+ (QWebPage::pluginFactory):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpluginfactory.cpp: Added.
+ (QWebPluginFactory::QWebPluginFactory):
+ (QWebPluginFactory::~QWebPluginFactory):
+ (QWebPluginFactory::refreshPlugins):
+ (QWebPluginFactory::extension):
+ * Api/qwebpluginfactory.h: Added.
+ (MimeType::):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-03-07 Simon Hausmann <hausmann@webkit.org>
+
+ Fix the Qt build.
+
+ * Api/qwebframe.cpp:
+
+2008-03-04 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ - Remove all unnecessary includes of JSDOMWindowBase.h, we prefer including
+ JSDOMWindow.h
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJSWindowObject):
+
+2008-03-04 Mark Rowe <mrowe@apple.com>
+
+ Another go at fixing the Qt build.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJSWindowObject):
+
+2008-02-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - remove separate client calls for "standard" and "reload' history
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::updateGlobalHistory):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2008-02-24 Darin Adler <darin@apple.com>
+
+ - another try at fixing the build
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::load): Replace new FormData with FormData::create.
+
+2008-02-22 Sam Weinig <sam@webkit.org>
+
+ Fix Qt build.
+
+ * Api/qwebhistoryinterface.cpp:
+
+2008-02-22 Sam Weinig <sam@webkit.org>
+
+ Rubber-stamped by Adam Roben.
+
+ Rid the project of the Devil known as DeprecatedString!
+
+ * Api/qwebhistory.cpp:
+ * Api/qwebhistoryinterface.cpp:
+
+2008-02-18 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequestPrivate::init): Removed use of DeprecatedString.
+
+2008-01-24 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon.
+
+ Documentation tidying.
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebhistoryinterface.cpp:
+ * Api/qwebview.cpp:
+
+2008-01-24 Jarek Kobus <jkobus@trolltech.com>
+
+ Reviewed by Simon.
+
+ Text for translations were used wrongly as comments
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientQt::shouldFallBack):
+
+2008-01-24 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * We have a KURL->QUrl conversion on KURL itself, make use of it.
+ * This conversion is supposed to be loss-free
+
+
+ * Api/qwebframe.cpp:
+
+2008-01-23 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ * Rubber stamped by Simon
+
+ * Fix leaking of sub frames (WebCore::Frame). We keep one reference too many.
+ This was found while working on the page-cache, other ports are not affected.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2008-01-23 Rohan McGovern <rohan.mcgovern@trolltech.com>
+
+ Reviewed by Simon Hausmann <hausmann@webkit.org>.
+
+ Fix Qtopia compilation with QT_NO_TOOLTIP
+
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::print):
+
+2008-01-23 Geir Vattekar <gvatteka@trolltech.com>
+
+ Reviewed by Simon.
+
+ Doc: Replaced \code with snippets in the docs
+
+
+ * Api/qwebview.cpp:
+
+2008-01-23 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Tweak key presses even to match commonly expected behavior
+ - space key == page down
+ - page down moved down not a page, but slightly less then a page so you don't loose your spot when reading.
+ - Use font height rather then a hard coded "10" for left, right, up, down
+ - Ctrl-Up moves to the top of the page
+ - Ctrl-Down move to the bottom of the page
+ - Backspace == GoBack
+ - Shift-Backspace == GoForward
+
+
+ * Api/qwebpage.cpp:
+ (dropActionToDragOp):
+ (dragOpToDropAction):
+ (QWebPagePrivate::keyPressEvent):
+
+2008-01-23 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Implemented FrameLoaderClient::startDownload() and FrameLoaderClient::download().
+
+ Added two signals to QWebPage to handle downloading of links and handling of
+ unsupported content.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::download):
+ (WebCore::FrameLoaderClientQt::assignIdentifierToInitialRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::willUseArchive):
+
+2008-01-22 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ setup a family for cursive and fantasy fonts as well.
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2008-01-22 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Implement ChromeClientQt::setToolTip
+ Implement ChromeClientQt::mouseDidMoveOverElement
+
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::ChromeClientQt):
+ (WebCore::ChromeClientQt::focus):
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+ (WebCore::ChromeClientQt::setToolTip):
+ (WebCore::ChromeClientQt::print):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-01-21 Darin Adler <darin@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - updated for changes to ChromeClient database functions
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::exceededDatabaseQuota):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-01-21 Benjamin Meyer <bmeyer@trolltech.com>
+
+ Reviewed by Simon.
+
+ Change QWebHistoryInterface::addHistoryEntry() from const to non-const
+
+
+ * Api/qwebhistoryinterface.h:
+
+2008-01-21 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Simon.
+
+ * Don't leak the d-pointer in QWebSettings.
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::~QWebSettings):
+
+2008-01-21 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Update the WebKit version number from WebKit/win/WebKit.vcproj/VERSION.
+
+ This has the fortunate side-effect that gmail sends us sensible HTML/JS again :)
+
+
+ * Api/qwebpage.cpp:
+
+2008-01-21 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix focus chain handling and cycling through focusable objects (links) using tab/backtab.
+
+ * Fix GraphicsContext::drawFocusRing to also draw single focus rects.
+ * Implemented QWebPage::focusNextPrevChild by sending fake tab/shift-tab events
+ and make the return value depend on whether we successfully determined a focusable
+ node or not.
+ * Changed QWebView::focusNextPrevChild() to call the base QWidget implementation correctly
+ if we could not handle the focus chain ourselves.
+ * Changed the focus policy of QWebView to correctly use WheelFocus instead of ClickFocus.
+ * Made ChromeClientQt::canTakeFocus() and takeFocus() dummy method since they are only
+ used to control the situation of stepping out of the focus chain inside the page.
+ * Made inclusion of links in the focus chain configurable through QWebSettings::LinksIncludedInFocusChain.
+ The layout tests expect this to be disabled but for the user it seems sensible to have it
+ on by default, hence the default in qwebsettings.cpp
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::focusNextPrevChild):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+ (QWebView::focusNextPrevChild):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::canTakeFocus):
+ (WebCore::ChromeClientQt::takeFocus):
+
+2008-01-18 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Coding style fixes and added a comment about the include order.
+
+ * WebKit_pch.h:
+
+2008-01-18 Marius Storm-Olsen <marius@trolltech.com>
+
+ Reviewed by Simon Hausmann <hausmann@webkit.org>.
+
+ Add use of precompiled header, when building inside Qt.
+
+ Compiling WebKit was taking forever; 17 minutes on my machine for _one_ build! Adding the PCH at least brings it down to 12 minutes for one build, for me.
+
+
+ * WebKit_pch.h: Added.
+
+2008-01-18 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Ask the WebCore::IconDatabase only if our URL is not empty. Otherwise
+ we will see a crash in a HashSet.
+ * It is crashing there because the StringImpl of an empty String is 0.
+ * We avoid this crash by checking for isEmpty() in WebKit as there is no
+ use to ask the iconDatabase for an empty string. We will fallback to the
+ defaultIcon.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::icon):
+
+2008-01-17 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Minor documentation fixes
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebview.cpp:
+
+2008-01-17 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Lars.
+
+ Fix form elements not focusing correctly after the qt widget lost its focus.
+
+ When receiving a focus out event notify the focus controller. Otherwise its
+ m_focusedFrame variable remains unchanged and setFocusedFrame on a focusIn
+ event shortcuts and doesn't call setActive(true).
+
+
+ * Api/qwebpage.cpp:
+
+2008-01-17 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Holger.
+
+ Lots of updates to the documentation.
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebhistory.cpp:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dropEvent):
+ (QWebPage::history):
+ (openNewWindow):
+ (QWebPage::triggerAction):
+ (QWebPage::viewportSize):
+ (QWebPage::navigationRequested):
+ (QWebPage::action):
+ (QWebPage::event):
+ (QWebPageContext::targetFrame):
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+
+2008-01-17 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Lars.
+
+ Added a urlChanged signals to QWebFrame and QWebView.
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ (QWebView::setPage):
+ * Api/qwebview.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-01-17 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Lars.
+
+ Fixed docs and sanity checks in QWebSettings::setIconDatabaseEnabled
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::setIconDatabaseEnabled):
+
+2008-01-17 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Lars.
+
+ Added QWebView::createWindow() which is forwarded from QWebPage::createWindow() for convenience.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::createWindow):
+ * Api/qwebview.cpp:
+ (QWebView::createWindow):
+ * Api/qwebview.h:
+
+2008-01-17 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Lars.
+
+ add a 0 pointer check.
+
+ Fixes a crash in the demo web browser.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+
+2008-01-17 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix QWebFrame::title().
+
+ For the titleChanged() signal we use the documentloader's title. For the property we have to use the same
+ instead of Document::title() as the latter is not trimmed and not suited for a window caption.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::title):
+
+2008-01-17 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Maciej, Lars, Holger.
+
+ http://bugs.webkit.org/show_bug.cgi?id=16589
+
+ Add a document parameter to WebCore::cookies, setCookies and cookiesEnabled.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequestPrivate::init):
+ (QWebNetworkManager::started):
+
+2008-01-17 Warwick Allison <warwick@trolltech.com>
+
+ Reviewed by Simon Hausmann <hausmann@webkit.org>.
+
+ Follow QWidget::keyPressEvent advice and call parents.
+
+ Without this, Back does not work in Qtopia, for example.
+
+
+ * Api/qwebview.cpp:
+ (QWebView::keyPressEvent):
+ (QWebView::keyReleaseEvent):
+
+2008-01-17 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Fix compilation against Qt 4.3 after the recent KURL <> QUrl conversion fixes.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+
+2008-01-17 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Holger.
+
+ Fix compilation against Qt 4.4 without files that are specific for the Qt 4.3 build.
+
+
+ * Api/qwebframe.cpp:
+ * Api/qwebpage.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-01-17 Lincoln Ramsay <lincoln.ramsay@trolltech.com>
+
+ Reviewed by Simon Hausmann <hausmann@webkit.org>.
+
+ Fixes compilation with QT_NO_DRAGANDDROP
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::event):
+ * Api/qwebview.cpp:
+ (QWebView::dragEnterEvent):
+ (QWebView::dragLeaveEvent):
+ (QWebView::dragMoveEvent):
+ (QWebView::dropEvent):
+
+2008-01-17 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Fix compilation, removed obsolete privateBrowsingEnabled() method.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-01-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon Hausmann <simon.hausmann@trolltech.com>.
+
+ Removed a whole bunch of notImplemented() warnings.
+
+ I don't want to hide the real warnings in lots of things that
+ I am by now pretty certain we won't need.
+
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm):
+ (WebCore::FrameLoaderClientQt::canShowMIMEType):
+
+2008-01-16 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix crash when bringing up the context menu on maps.google.com.
+
+ If the website provides its own context menu then we don't have a ContextMenu pointer.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::contextMenuEvent):
+
+2008-01-16 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Don't crash when receiving all sorts of events on a default constructed QWebView without a page.
+
+ * Api/qwebview.cpp:
+ (QWebView::mouseMoveEvent):
+ (QWebView::mousePressEvent):
+ (QWebView::mouseDoubleClickEvent):
+ (QWebView::mouseReleaseEvent):
+ (QWebView::contextMenuEvent):
+ (QWebView::wheelEvent):
+ (QWebView::keyPressEvent):
+ (QWebView::keyReleaseEvent):
+ (QWebView::focusInEvent):
+ (QWebView::focusOutEvent):
+ (QWebView::dragEnterEvent):
+ (QWebView::dragLeaveEvent):
+ (QWebView::dragMoveEvent):
+ (QWebView::dropEvent):
+ (QWebView::focusNextPrevChild):
+
+2008-01-16 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Made the url property read-write.
+
+ * Api/qwebview.h:
+
+2008-01-16 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Don't crash when showing a default initialized QWebView that has no page/frame yet.
+
+ * Api/qwebview.cpp:
+ (QWebView::paintEvent):
+
+2008-01-16 Holger Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ Change hoveringOverLink implementation to have less issues.
+
+ * Currently we only compare a pointer. In the worst case we
+ could delete the Element we have pointed to and a new one
+ gets the same address. But even if that doesn't happen the
+ WebCore::Element is mutable and JavaScript could change the
+ URL, Title or Content. So we have to compare all these three
+ attributes.
+ * This does not seem to be a performance impact.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseMoveEvent):
+ * Api/qwebpage_p.h:
+
+2008-01-16 Holger Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Move the hoverElement from QWebFrame to QWebPage. As it is
+ only used there.
+
+
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseMoveEvent):
+ * Api/qwebpage_p.h:
+
+2008-01-16 Holger Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ EventHandler changes/fixes in QWebPage:
+ -mouse{Press,Move,Release}Event:
+ Send the event always to the mainFrame of the QWebPage.
+
+ -contextMenuEvent, key{Press,Release}Event:
+ Send the event to the focused frame.
+
+ This is following the Windows port and fixes a issue with the
+ Web Inspector where we were sending the events to a wrong frame.
+
+ It is guaranteed that the mainFrame will always have an eventHandler
+ and frameView set. There is no need to check for this in QWebPage.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateEditorActions):
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::contextMenuEvent):
+ (QWebPagePrivate::wheelEvent):
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPagePrivate::keyReleaseEvent):
+ (QWebPagePrivate::focusInEvent):
+ * Api/qwebpage_p.h:
+
+2008-01-16 Holger Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Add core and kit functions to QWebFramePrivate to convert from
+ QWebFrame to WebCore::Frame and vice versa.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::core):
+ (QWebFramePrivate::kit):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+
+2008-01-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ add conversion methods from and to QUrl to KURL.
+
+ Use them in the places I found at the moment. Fixes a bug
+ where form data was encoded twice.
+ Also fix QWebSettings to take a QUrl for the user style sheet
+ location.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+ * Api/qwebpage.cpp:
+ (QWebPage::createPlugin):
+ (frameLoadRequest):
+ (QWebPage::triggerAction):
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ * Api/qwebsettings.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createWindow):
+ (WebCore::ChromeClientQt::show):
+
+2008-01-16 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Lars.
+
+ * Make the InspectorClientView inherit from QWebView instead of QWidget. This
+ way paintEvent, mouse{Press,Release}Event and other events get forwarded to
+ the QWebPage/WebInspector automatically.
+
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::createWindow):
+ (WebCore::InspectorClientView::InspectorClientView):
+
+2008-01-10 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam.
+
+ - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::requestQuotaIncreaseForNewDatabase):
+ (WebCore::ChromeClientQt::requestQuotaIncreaseForDatabaseOperation):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2008-01-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ document QWebHistory
+
+
+ * Api/qwebhistory.cpp:
+ (QWebHistoryItem::QWebHistoryItem):
+ (QWebHistoryItem::operator=):
+ (QWebHistoryItem::~QWebHistoryItem):
+ (QWebHistoryItem::originalUrl):
+ (QWebHistoryItem::currentUrl):
+ (QWebHistoryItem::title):
+ (QWebHistoryItem::icon):
+ (QWebHistory::canGoBack):
+ (QWebHistory::canGoForward):
+ (QWebHistory::goBack):
+ (QWebHistory::goForward):
+ (QWebHistory::goToItem):
+ * Api/qwebhistory.h:
+
+2008-01-10 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Make the reset() functions not do anything on the default QWebSettings object.
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::resetFontSize):
+ (QWebSettings::resetFontFamily):
+ (QWebSettings::clearAttribute):
+
+2008-01-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ rename QWebPageHistory to QWebHistory.
+
+
+ * Api/qwebhistory.cpp: Added.
+ (QWebHistoryItem::QWebHistoryItem):
+ (QWebHistoryItem::operator=):
+ (QWebHistoryItem::~QWebHistoryItem):
+ (QWebHistoryItem::originalUrl):
+ (QWebHistoryItem::currentUrl):
+ (QWebHistoryItem::title):
+ (QWebHistoryItem::lastVisited):
+ (QWebHistoryItem::icon):
+ (QWebHistory::QWebHistory):
+ (QWebHistory::~QWebHistory):
+ (QWebHistory::clear):
+ (QWebHistory::items):
+ (QWebHistory::backItems):
+ (QWebHistory::forwardItems):
+ (QWebHistory::canGoBack):
+ (QWebHistory::canGoForward):
+ (QWebHistory::goBack):
+ (QWebHistory::goForward):
+ (QWebHistory::goToItem):
+ (QWebHistory::backItem):
+ (QWebHistory::currentItem):
+ (QWebHistory::forwardItem):
+ (QWebHistory::itemAtIndex):
+ * Api/qwebhistory.h: Added.
+ * Api/qwebhistory_p.h: Added.
+ (QWebHistoryItemPrivate::QWebHistoryItemPrivate):
+ (QWebHistoryItemPrivate::~QWebHistoryItemPrivate):
+ (QWebHistoryPrivate::QWebHistoryPrivate):
+ (QWebHistoryPrivate::~QWebHistoryPrivate):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpagehistory.cpp: Removed.
+ * Api/qwebpagehistory.h: Removed.
+ * Api/qwebpagehistory_p.h: Removed.
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+
+2008-01-10 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Documentation for QWebSettings
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::~QWebSettings):
+ (QWebSettings::setFontSize):
+ (QWebSettings::resetFontSize):
+ (QWebSettings::setUserStyleSheetLocation):
+ (QWebSettings::userStyleSheetLocation):
+ (QWebSettings::iconDatabaseEnabled):
+ (QWebSettings::webGraphic):
+ (QWebSettings::setFontFamily):
+ (QWebSettings::resetFontFamily):
+ (QWebSettings::setAttribute):
+
+2008-01-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Document QWebHistoryInterface.
+
+
+ * Api/qwebhistoryinterface.cpp:
+ (QWebHistoryInterface::defaultInterface):
+ (QWebHistoryInterface::~QWebHistoryInterface):
+
+2008-01-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Documentation for QWebFrame.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::url):
+ (QWebFrame::name):
+ (QWebFrame::page):
+ (QWebFrame::setHtml):
+ (QWebFrame::parentFrame):
+ (QWebFrame::render):
+ (QWebFrame::pos):
+ (QWebFrame::geometry):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+
+2008-01-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ fix the drawing errors that where introduced due to refactoring.
+
+ Correctly clip to the rectangle we want to draw in ScrollView::paint().
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::render):
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ (QWebView::paintEvent):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::scrollBackingStore):
+
+2008-01-10 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Added a whole bunch of docs for QWebPage and fixed some minor doc glitches in QWebView.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dropEvent):
+ (QWebPage::QWebPage):
+ (QWebPage::~QWebPage):
+ (QWebPage::mainFrame):
+ (QWebPage::currentFrame):
+ (QWebPage::history):
+ (QWebPage::setView):
+ (QWebPage::view):
+ (QWebPage::javaScriptConsoleMessage):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::createWindow):
+ (QWebPage::createModalDialog):
+ (openNewWindow):
+ (QWebPage::triggerAction):
+ (QWebPage::viewportSize):
+ (QWebPage::navigationRequested):
+ (QWebPage::selectedText):
+ (QWebPage::isModified):
+ (QWebPage::focusNextPrevChild):
+ (QWebPage::settings):
+ (QWebPage::networkProxy):
+ (QWebPage::setNetworkAccessManager):
+ (QWebPage::networkAccessManager):
+ (QWebPagePrivate::_q_onLoadProgressChanged):
+ * Api/qwebview.cpp:
+
+2008-01-07 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Alp Toker.
+
+ * Qt and Gtk must know if a ContextMenuItem is checkable. Add a new ContextMenuItemType for checkable
+ actions.
+ * Use this information in the Gtk platform to create a GtkCheckMenuItem when needed.
+ * Update the ContextMenuController to accept CheckableActionTypes as well.
+ * Change ContextMenu.cpp to use the CheckableActionType. The information if a item is checkable
+ was extracted from ContextMenu::checkOrEnableIfNeeded.
+ * Update the Qt and Windows port.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+
+2008-01-07 Simon Hausmann <hausmann@webkit.org>
+
+ Build fix for the Windows build. MSVC wants to see the full
+ declaration of arguments even when just passing them through.
+
+ * Api/qwebpage.cpp:
+
+2008-01-07 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Added the missing parameters to make it possible to do POST operations from the public API.
+
+ This is ugly though as it also requires including qnetworkaccessmanager.h. It would be nicer if the
+ two extra arguments were in QNetworkRequest :-/
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+ * Api/qwebframe.h:
+ * Api/qwebview.cpp:
+ (QWebView::load):
+ * Api/qwebview.h:
+
+2008-01-07 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Ported of the network backend of the Qt platform to Qt 4.4's new networking API.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+ * Api/qwebframe.h:
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebobjectplugin.cpp:
+ * Api/qwebobjectplugin.h:
+ * Api/qwebobjectplugin_p.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ * Api/qwebobjectpluginconnector.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPagePrivate::navigationRequested):
+ (QWebPage::setNetworkInterface):
+ (QWebPage::networkInterface):
+ (QWebPage::setNetworkAccessManager):
+ (QWebPage::networkAccessManager):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-01-07 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Move the QWebPagePrivate methods up to the other private ones
+
+ * Api/qwebpage.cpp:
+ (dropActionToDragOp):
+ (dragOpToDropAction):
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::contextMenuEvent):
+ (QWebPagePrivate::wheelEvent):
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPagePrivate::keyReleaseEvent):
+ (QWebPagePrivate::focusInEvent):
+ (QWebPagePrivate::focusOutEvent):
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragLeaveEvent):
+ (QWebPagePrivate::dragMoveEvent):
+ (QWebPagePrivate::dropEvent):
+ (QWebPage::focusNextPrevChild):
+
+2008-01-07 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Add reimplemented comments for the methods reimplemented in QWebView and QWebPage.
+
+
+ * Api/qwebpage.cpp:
+ (dragOpToDropAction):
+ * Api/qwebview.cpp:
+ (QWebView::mouseMoveEvent):
+ (QWebView::mousePressEvent):
+ (QWebView::mouseDoubleClickEvent):
+ (QWebView::mouseReleaseEvent):
+ (QWebView::contextMenuEvent):
+ (QWebView::keyPressEvent):
+ (QWebView::keyReleaseEvent):
+ (QWebView::focusInEvent):
+ (QWebView::focusOutEvent):
+ (QWebView::dragEnterEvent):
+ (QWebView::dragLeaveEvent):
+ (QWebView::dragMoveEvent):
+ (QWebView::dropEvent):
+
+2008-01-07 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Lars.
+
+ * This layout is not needed anymore as Widget::invalidateRect will not
+ draw anymore.
+
+
+ * Api/qwebview.cpp:
+ (QWebView::paintEvent):
+
+2008-01-04 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Remove most dependencies of Widget/ScrollView onto native QWidgets.
+
+ This also brings the code closer in line with the Windows code. Seems
+ to work nicely on first try :)
+
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::updateBackingStore):
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+ (WebCore::ChromeClientQt::setToolTip):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2008-01-04 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Remove the todo from QWebPage and move the code to QWebView.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::wheelEvent):
+ (QWebPagePrivate::focusInEvent):
+ * Api/qwebview.cpp:
+ (QWebView::wheelEvent):
+ (QWebView::focusInEvent):
+
+2008-01-04 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Move the various event methods to QWebPagePrivate. This is similar to
+ QTextControl as well.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::event):
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::contextMenuEvent):
+ (QWebPagePrivate::wheelEvent):
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPagePrivate::keyReleaseEvent):
+ (QWebPagePrivate::focusInEvent):
+ (QWebPagePrivate::focusOutEvent):
+ (QWebPage::focusNextPrevChild):
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragLeaveEvent):
+ (QWebPagePrivate::dragMoveEvent):
+ (QWebPagePrivate::dropEvent):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2008-01-04 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Forward the event from QWebView to QWebPage through QObject::event. This
+ is similar to the way QTextControl is working.
+
+
+ * Api/qwebpage.cpp:
+ (dragOpToDropAction):
+ (QWebPage::event):
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+ (QWebView::mouseMoveEvent):
+ (QWebView::mousePressEvent):
+ (QWebView::mouseDoubleClickEvent):
+ (QWebView::mouseReleaseEvent):
+ (QWebView::contextMenuEvent):
+ (QWebView::wheelEvent):
+ (QWebView::keyPressEvent):
+ (QWebView::keyReleaseEvent):
+ (QWebView::focusInEvent):
+ (QWebView::focusOutEvent):
+ (QWebView::dragEnterEvent):
+ (QWebView::dragLeaveEvent):
+ (QWebView::dragMoveEvent):
+ (QWebView::dropEvent):
+ * Api/qwebview.h:
+
+2008-01-04 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ make QWebPage a QObject and get things to compile.
+
+ Nothing works currently though.
+
+
+ * Api/qwebobjectpluginconnector.cpp:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::QWebPage):
+ (QWebPage::setView):
+ (QWebPage::view):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptPrompt):
+ (dragOpToDropAction):
+ (QWebPage::mousePressEvent):
+ (QWebPage::mouseDoubleClickEvent):
+ (QWebPage::mouseReleaseEvent):
+ (QWebPage::wheelEvent):
+ (QWebPage::keyPressEvent):
+ (QWebPage::focusInEvent):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+ (QWebView::setPage):
+ (QWebView::resizeEvent):
+ (QWebView::paintEvent):
+ * Api/qwebview.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::windowRect):
+ (WebCore::ChromeClientQt::pageRect):
+ (WebCore::ChromeClientQt::focus):
+ (WebCore::ChromeClientQt::unfocus):
+ (WebCore::ChromeClientQt::canTakeFocus):
+ (WebCore::ChromeClientQt::takeFocus):
+ (WebCore::ChromeClientQt::canRunModal):
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::startDrag):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::createWindow):
+ (WebCore::InspectorClientView::InspectorClientView):
+ (WebCore::InspectorClientView::page):
+ (WebCore::InspectorClientView::hideEvent):
+ (WebCore::InspectorClientView::closeEvent):
+ (WebCore::InspectorClientQt::createPage):
+ (WebCore::InspectorClientQt::closeWindow):
+
+2008-01-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Added some preliminary class documentation for QWebView, fixed a missing const() and some missing Q_PROPERTYs
+
+
+ * Api/qwebview.cpp:
+ (QWebView::setHtml):
+ (QWebView::setContent):
+ (QWebView::history):
+ (QWebView::settings):
+ (QWebView::action):
+ (QWebView::triggerAction):
+ (QWebView::stop):
+ (QWebView::backward):
+ (QWebView::forward):
+ (QWebView::reload):
+ * Api/qwebview.h:
+
+2008-01-04 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ add a viewportSize to QWebPage.
+
+ This is required to eventually make it a QObject only.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+ (QWebPage::viewportSize):
+ (QWebPage::setViewportSize):
+ * Api/qwebpage.h:
+
+2008-01-04 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ take a QString as identifier in QWebFrame::addToJSWindowObject.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJSWindowObject):
+ * Api/qwebframe.h:
+
+2008-01-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Call the frame arguments for the javascript callbacks "originatingFrame"
+
+
+ * Api/qwebpage.h:
+
+2008-01-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Moved the QWebPage::addToHistory signal into QWebHistoryInterface
+
+
+ * Api/qwebhistoryinterface.h:
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::updateGlobalHistoryForStandardLoad):
+
+2008-01-04 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ moved title(), url(), icon() and initialLayoutComplete() from QWebPage to QWebFrame
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::url):
+ (QWebFrame::icon):
+ (QWebFrame::setVerticalScrollBarPolicy):
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::networkInterface):
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+ (QWebView::title):
+ (QWebView::url):
+ (QWebView::icon):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2008-01-03 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Moved QWebPage::open to QWebFrame::load and added setHtml.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+ (QWebFrame::setHtml):
+ (QWebFrame::setContent):
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebview.cpp:
+ (QWebView::load):
+ (QWebView::setHtml):
+ * Api/qwebview.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createWindow):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::createPage):
+
+2008-01-03 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Lars.
+
+ Added the first revision of QWebView and started moving functionality from QWebPave over to QWebView and QWebFrame.
+
+
+ * Api/headers.pri:
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+ * Api/qwebpage.h:
+ * Api/qwebpagehistory.h:
+ * Api/qwebview.cpp: Added.
+ (QWebView::QWebView):
+ (QWebView::~QWebView):
+ (QWebView::page):
+ (QWebView::setPage):
+ (QWebView::load):
+ (QWebView::setHtml):
+ (QWebView::history):
+ (QWebView::settings):
+ (QWebView::title):
+ (QWebView::url):
+ (QWebView::icon):
+ (QWebView::selectedText):
+ (QWebView::action):
+ (QWebView::triggerAction):
+ (QWebView::isModified):
+ (QWebView::textInteractionFlags):
+ (QWebView::setTextInteractionFlags):
+ (QWebView::sizeHint):
+ (QWebView::stop):
+ (QWebView::backward):
+ (QWebView::forward):
+ (QWebView::reload):
+ * Api/qwebview.h: Added.
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::webPage):
+ (MainWindow::changeLocation):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-12-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Alexey.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction): Removed some use of Editor member functions we plan
+ to eventually eliminate. Switch from Editor::execCommand to Editor::command.
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent): Ditto. Also updated name from
+ MoveUpByPageAndModifyCaret to MovePageUp and from MoveDownByPageAndModifyCaret
+ to MovePageDown.
+
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ As part of doing some CachedPage and client cleanup, keep Qt building
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::savePlatformDataToCachedPage):
+ (WebCore::FrameLoaderClientQt::transitionToCommittedFromCachedPage):
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-12-12 Sam Weinig <sam@webkit.org>
+
+ Build fix.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::userAgent):
+
+2007-12-12 Sam Weinig <sam@webkit.org>
+
+ Build fix.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequestPrivate::init):
+ * Api/qwebpage.cpp:
+ (QWebPage::url):
+ (QWebPageContext::QWebPageContext):
+ * Api/qwebpagehistory.cpp:
+ (QWebHistoryItem::originalUrl):
+ (QWebHistoryItem::currentUrl):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2007-12-07 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5535636>
+ Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard.
+
+ http://bugs.webkit.org/show_bug.cgi?id=13916
+ JavaScript detects Tab as a character input on a textfield validation
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+ (WebCore::EditorClientQt::handleInputMethodKeydown):
+ * WebCoreSupport/EditorClientQt.h:
+ Updated for cross-platform changes as much as it was possible without a Qt build environment.
+
+2007-12-07 Darin Adler <darin@apple.com>
+
+ - try to fix build
+
+ * Api/qwebhistoryinterface.cpp:
+ (WebCore::historyContains): There's a WebCore function here in WebKit! Needs to
+ be updated, since WebCore changed, but this should not be here.
+
+2007-12-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp: Removed obsolete privateBrowsingEnabled.
+ * WebCoreSupport/FrameLoaderClientQt.h: Ditto.
+
+2007-12-04 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Implement the InspectorClient for the Qt port
+ * It does not support highlighting of nodes yet
+ * Use QRC to open the internal page. The important thing is the
+ '/' in the URL to make WebCore::Document::completeURL behave the
+ way we want.
+ * To make the InspectorClient work we will have to mark qrc as secure.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebpage.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::hideEvent):
+ (WebCore::InspectorClientQt::InspectorClientQt):
+ (WebCore::InspectorClientQt::inspectorDestroyed):
+ (WebCore::InspectorClientQt::createPage):
+ (WebCore::InspectorClientQt::localizedStringsURL):
+ (WebCore::InspectorClientQt::showWindow):
+ (WebCore::InspectorClientQt::closeWindow):
+ (WebCore::InspectorClientQt::attachWindow):
+ (WebCore::InspectorClientQt::detachWindow):
+ * WebCoreSupport/InspectorClientQt.h:
+
+2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Rubber stamped by Mark.
+
+ Always include config.h at the beginning of the file.
+
+ * Api/qwebsettings.cpp:
+
+2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Avoid crashes by making sure everything is layouted before
+ we start painting. This avoids a crash in Widget::invalidateRect
+ because QPainter::begin would fail
+ * The QWebFrame::layout() methods and calls are left untouched because
+ this would be an API decision.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::layout):
+ * Api/qwebpage.cpp:
+ (QWebPage::paintEvent):
+
+2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * SubClass QWebPage to handle hide and close events.
+ * Forward these events to the InspectorController
+ * The other options would have been using an eventFilter
+ on the webpage and making InspectorClient a QObject or
+ creating a QObject Observer.
+ * Provide a simple QWebPage* createWindow implementation. This is needed
+ to make FrameLoaderClientQt::dispatchCreatePage stop crashing in the case
+ of the inspector client.
+
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::InspectorClientWebPage):
+ (WebCore::InspectorClientWebPage::createWindow):
+ (WebCore::InspectorClientWebPage::hideEvent):
+ (WebCore::InspectorClientWebPage::closeEvent):
+ (WebCore::InspectorClientQt::createPage):
+
+2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Allow adding the Inspect ContextMenuItem to our Menu
+ * Open the Inspector when Inspect was activated. This requires
+ that we keep the innerNonSharedNode from the HitTest around. This
+ forces us to include <wtf/RefPtr.h> in the private header. It is
+ the first non Qt header but should be okay.
+
+
+ * Api/qwebpage.cpp:
+ (webActionForContextMenuAction):
+ (QWebPage::triggerAction):
+ (QWebPage::action):
+ (QWebPageContext::QWebPageContext):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Add the Developer Extras to the WebAttribute and propagate it
+ to WebCore::Settings. This will enable the Inspect Element menu item
+ * CodingStyle fixes in QWebSettings
+ * Enable the Developer Extras in the QtLauncher
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ * Api/qwebsettings.h:
+ * QtLauncher/main.cpp:
+ (main):
+
+2007-12-03 Geoffrey Garen <ggaren@apple.com>
+
+ Removed unnecessary and possibly incorrect #include from my last
+ check-in.
+
+ * Api/qwebframe.cpp:
+
+2007-12-03 Geoffrey Garen <ggaren@apple.com>
+
+ Qt build fix: Get globalExec() from the right place.
+
+2007-11-30 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Self destruct the clients like the ohter ports do
+
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runBeforeUnloadConfirmPanel):
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ * WebCoreSupport/DragClientQt.cpp:
+ * WebCoreSupport/EditorClientQt.cpp:
+ * WebCoreSupport/InspectorClientQt.cpp:
+
+2007-11-29 Brady Eidson <beidson@apple.com>
+
+ Keep it building with new client method
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::requestQuotaIncreaseForNewDatabase):
+ (WebCore::ChromeClientQt::requestQuotaIncreaseForDatabaseOperation):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-11-22 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Fix compilation (don't define notImplemented twice)
+
+ * Api/qwebnetworkinterface.cpp:
+
+2007-11-22 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by George.
+
+ Use Q_SIGNALS/Q_SLOTS in the public API
+
+ * Api/qwebframe.h:
+ * Api/qwebpage.h:
+
+2007-11-22 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by George.
+
+ Fixed the signature of the QWebPage constructor to follow Qt guidelines.
+
+ * Api/qwebpage.h:
+
+2007-11-22 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by George.
+
+ Use <QtModule/headerfile.h> instead of <Classname> in public HEADER files, to not require the include paths for the other modules to be present
+
+ * Api/qcookiejar.h:
+ * Api/qwebframe.h:
+ * Api/qwebhistoryinterface.h:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebobjectplugin.h:
+ * Api/qwebobjectplugin_p.h:
+ * Api/qwebobjectpluginconnector.h:
+ * Api/qwebpage.h:
+ * Api/qwebpagehistory.h:
+ * Api/qwebsettings.h:
+
+2007-11-22 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by George.
+
+ Removed inline copy of QExplicitlySharedDataPointer. This is not needed anymore since we require Qt >= 4.3.0.
+
+ * Api/qwebpagehistory.h:
+
+2007-11-22 George Staikos <staikos@kde.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ Fix license headers
+
+
+ * Api/qwebobjectplugin.cpp:
+ * Api/qwebobjectplugin.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ * Api/qwebobjectpluginconnector.h:
+
+2007-11-22 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by George Staikos <staikos@kde.org>.
+
+ Fix shadowing of "page" variable that is passed as argument as well as a member variable.
+
+ This also fixes compilation with gcc 4.3.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+
+2007-11-21 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Simon.
+
+ * Connect up the signal for all subframes too.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+
+2007-11-20 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Adam Treat <adam.treat@torchmobile.com>.
+
+ Remove static linkage of QtWebKit against the ICO image format plugin.
+
+ Instead build the support for the ICO image format as a proper standalone qt image format plugin and install it.
+
+
+ * Plugins/Plugins.pro:
+
+2007-11-20 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by George Staikos <staikos@kde.org>.
+
+ Added a default argument to textContent for the hoveringOverLink signal to keep existing two-argument connections working
+
+
+ * Api/qwebpage.h:
+
+2007-11-20 George Staikos <staikos@kde.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ Add an argument to pass the link text in the hovering signal
+
+
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::mouseMoveEvent):
+ * Api/qwebpage.h:
+
+2007-11-20 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Simon and George.
+
+ * Be quiet and allow suppression of NotImplemented calls at runtime.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
+
+2007-11-19 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Simon.
+
+ * Don't segfault when event pos is outside of the widget.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::mouseMoveEvent):
+ (QWebPage::mousePressEvent):
+ (QWebPage::mouseDoubleClickEvent):
+ (QWebPage::mouseReleaseEvent):
+ (QWebPage::contextMenuEvent):
+
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::localizedStringsURL): Empty stub.
+ * WebCoreSupport/InspectorClientQt.h: Added localizedStringsURL.
+
+2007-11-13 Geoffrey Garen <ggaren@apple.com>
+
+ Build fix: changed Shared to RefCounted.
+
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ * WebCoreSupport/ContextMenuClientQt.h:
+ * WebCoreSupport/EditorClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-11-10 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Nikolas.
+
+ When populating the context menu with sub-menus don't add sub-menus if they're empty.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+
+2007-11-10 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Nikolas.
+
+ Added support for the Bold/Italic/Underline toggle actions.
+
+
+ * Api/qwebpage.cpp:
+ (webActionForContextMenuAction):
+ (QWebPage::triggerAction):
+ (QWebPage::action):
+ * Api/qwebpage.h:
+
+2007-11-10 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Nikolas.
+
+ Before adding an action to the context menu call checkOrEnableIfNeeded for each action
+ to update the enable/checked state correctly.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+ (QWebPage::contextMenuEvent):
+ * Api/qwebpage_p.h:
+
+2007-11-10 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Nikolas.
+
+ Mark the text direction actions as checkable actions.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::action):
+
+2007-11-09 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Holger.
+
+ Implemented the webcore actions for changing the text direction.
+
+
+ * Api/qwebpage.cpp:
+ (webActionForContextMenuAction):
+ (QWebPage::triggerAction):
+ (QWebPage::action):
+ * Api/qwebpage.h:
+
+2007-11-09 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Holger.
+
+ Fix ContextMenu allocation in the Qt port.
+
+ Store all items and submenus value based in ContextMenu and ContextMenuItem.
+ That fixes the crashes when the context menu was populated with sub-menus because
+ of the use of temporary ContextMenu objects like this:
+
+ ContextMenu subMenu(...);
+ subMenu.appendItem(...);
+ subMenu.appendItem(...);
+
+ subMenuItem.setSubMenu(&subMenu); // temporary pointer, need to _copy_ contents
+
+
+ * Api/qwebpage.cpp:
+ (QWebPage::contextMenuEvent):
+ * Api/qwebpage_p.h:
+
+2007-11-09 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Holger.
+
+ Renamed QWebPage::NumWebActions to QWebPage::WebActionCount (for consistency) and fixed its value.
+
+
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2007-11-08 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Sam.
+
+ - windowObjectCleared() is no longer const. It needs to setup the
+ script debugger and cannot be const to do so.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::windowObjectCleared):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-11-08 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by nobody (well, Holger knows about it), build fix for Qt 4.3.
+
+ The buildbots use Qt 4.4 which has the function in question, but Qt
+ 4.3 doesn't have it. Use removeAll() as replacement instead, it
+ shouldn't make a difference in performance.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::~QWebSettings):
+
+2007-11-08 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Lars Knoll <lars@trolltech.com>.
+
+ Cleanup checking for the request method.
+
+ * Check the request method only in QWebNetworkManager::add.
+ * Currently HEAD, GET, POST are allowed and for everything else
+ QWebNetworkManager::add returns false.
+ * Returning false is compatible with ResourceHandle::start and it
+ can be used in ResourceHandle::loadResourceSynchronously to generate
+ a ResourceError
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+
+2007-11-08 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Lars Knoll <lars@trolltech.com>.
+
+ Fix bug in the implementation of synchronous network jobs.
+
+ * George (pmax) reviewed the networking patches and found the following bug (thanks for reviewing)
+ - if (jobMode == AsynchronousJob) {
+ + if (jobMode == SynchronousJob) {
+ add job to synchronous list/hash
+
+ * Just applying the above change will lead to crashes because we can finish
+ jobs before we started them.
+
+ * Avoid these issues by saving all work (starting a job, sending data and
+ finishing it) inside one list. JobWork will contain any
+ of the above three work types and doWork will just work on this list
+ (m_pendingWork). As foreach takes a copy of the list calling started, data
+ and finished will not add new work and we gurantee that if we have JobStarted
+ it will be in the list before JobData and JobFinished.
+
+ * Observation: We might just kill the code to handle sync jobs.
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::queueStart):
+ (QWebNetworkManager::queueData):
+ (QWebNetworkManager::queueFinished):
+ (QWebNetworkManager::doWork):
+ * Api/qwebnetworkinterface_p.h:
+ (QWebNetworkManager::JobWork::):
+ (QWebNetworkManager::JobWork::JobWork):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Fix the Qt build by setting up WindowFeatures before calling
+ createWindow on the Chrome. This is similar to openNewWindow in
+ page/ContextMenuController.cpp
+
+ * Api/qwebpage.cpp:
+ (openNewWindow):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Make the setting of letting Javascript access the clipboard configurable through QWebSettings, turn it off by default and turn it on in DumpRenderTree.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ * Api/qwebsettings.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed QWebPageHistory::goToItem to take a value instead of a pointer.
+
+ * Api/qwebpagehistory.cpp:
+ * Api/qwebpagehistory.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Removed unimplemented QWebHistoryItem::children() function
+
+ * Api/qwebpagehistory.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed the getter functions in QWebSettings to transparently resolve against the default settings.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::fontSize):
+ (QWebSettings::fontFamily):
+ (QWebSettings::testAttribute):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added explicit functions for resetting the font sizes and font families.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::resetFontSize):
+ (QWebSettings::resetFontFamily):
+ * Api/qwebsettings.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Combined the font sizes accessors/setters under one setter/getter with an enum.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::QWebSettingsPrivate):
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setFontSize):
+ * Api/qwebsettings.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Renamed QWebPage::userAgentStringForUrl(url) to QWebPage::userAgentFor(url);
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::userAgent):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Renamed QWebPage::webActionTriggered to QWebPage::triggerAction
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::_q_webActionTriggered):
+ (QWebPage::keyPressEvent):
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed the virtual QWebPage::setWindowGeometry to be a geometryChangeRequest signal instead.
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::setWindowRect):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Renamed QWebPage::webAction() to QWebPage::action()
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+ * Api/qwebpage.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Removed a bunch of slots/functions that are now available through the new actions API.
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added some more comments to the API after another round of API review with Lars.
+
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Moved QWebFrame::selectedText() to QWebPage::selectedText().
+
+ The currently selected text is a property of the page as a whole.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::selectedText):
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Implemented support for settings propagation.
+
+ If an individual setting is not set in a page's QWebSettings then it is inherited from the default settings.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::QWebSettingsPrivate):
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::~QWebSettings):
+ (QWebSettings::setFontFamily):
+ * Api/qwebsettings.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Reworked the QWebSettings API.
+ QWebPage now returns a pointer to its mutable QWebSettings object and the settings of newly created QWebPageObjects are initialized from QWebSettings::defaultSettings().
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPage::QWebPage):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::QWebSettingsPrivate):
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::defaultSettings):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setMinimumFontSize):
+ (QWebSettings::setMinimumLogicalFontSize):
+ (QWebSettings::setDefaultFontSize):
+ (QWebSettings::setDefaultFixedFontSize):
+ (QWebSettings::setUserStyleSheetLocation):
+ (QWebSettings::setFontFamily):
+ (QWebSettings::fontFamily):
+ (QWebSettings::setAttribute):
+ * Api/qwebsettings.h:
+ * QtLauncher/main.cpp:
+ (main):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Made the QWebSettings::webGraphic functions static. The implementation was using QWebSettings::global() anyway.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::setWebGraphic):
+ * Api/qwebsettings.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Moved the WebCore::Image specific function loadResourcePixmap from qwebsettings.cpp to ImageQt.cpp and made it static.
+
+ * Api/qwebsettings.cpp:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed the icondatabase accessor to be a static function because it doesn't change the QWebSettings object.
+
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed the webAction() accessor to not be a slot but just a public function.
+
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Implemented createWindow() in QtLauncher.
+
+ * QtLauncher/main.cpp:
+ (WebPage::WebPage):
+ (MainWindow::MainWindow):
+ (WebPage::createWindow):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Implemented opening links in new windows
+
+ * Api/qwebpage.cpp:
+ (frameLoadRequest):
+ (openNewWindow):
+ (QWebPage::webActionTriggered):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added and implemented the "OpenLink" action.
+
+ * Api/qwebpage.cpp:
+ (webActionForContextMenuAction):
+ (QWebPage::webActionTriggered):
+ (QWebPage::webAction):
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Adjust the state of the reload action correctly.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateNavigationActions):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Initialize the undo/redo actions from QUndoStack. That automatically takes care of enabling/disabling them as well as the activation/trigger.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPage::webAction):
+ (QWebPage::undoStack):
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added undo/redo toolbar buttons, moved the location line edit into a separate toolbar.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Update the editor actions when the selection changes.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateEditorActions):
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedSelection):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added cut/copy/paste actions to the toolbar of QtLauncher
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Started working on keeping the state of the navigation actions up-to-date.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateNavigationActions):
+ (QWebPage::webAction):
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::postProgressStartedNotification):
+ (WebCore::FrameLoaderClientQt::didPerformFirstNavigation):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Use the navigational web actions in the toolbar
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Store a bunch of QActions in QWebPagePrivate, corresponding to QWebPage::WebAction.
+ Added QWebPageContext to hold context sensitive information (for example used by the context menu).
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (webActionForContextMenuAction):
+ (QWebPagePrivate::createContextMenu):
+ (QWebPagePrivate::_q_webActionTriggered):
+ (QWebPage::webActionTriggered):
+ (QWebPage::webAction):
+ (QWebPage::contextMenuEvent):
+ (QWebPageContext::QWebPageContext):
+ (QWebPageContext::operator=):
+ (QWebPageContext::~QWebPageContext):
+ (QWebPageContext::pos):
+ (QWebPageContext::text):
+ (QWebPageContext::linkUrl):
+ (QWebPageContext::imageUrl):
+ (QWebPageContext::image):
+ (QWebPageContext::targetFrame):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Moved the editing actions implemented in keyPressEvent into webActionTriggered.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::webActionTriggered):
+ (QWebPage::keyPressEvent):
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Introduced a central virtual void webActionTriggered(WebAction action) method that is called from various
+ convenience methods such as cut()/copy()/paste().
+
+ * Api/qwebpage.cpp:
+ (QWebPage::goBack):
+ (QWebPage::webActionTriggered):
+ (QWebPage::cut):
+ (QWebPage::copy):
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Restructure the context menu classes for the Qt port. ContextMenu and ContextMenuItem don't store
+ QActions/QMenus anymore but just store the action type, tag, title and optionally submenu as created
+ in ContextMenu::populate().
+ For the actual Qt context menu we traverse this structure after sendContextMenuEvent and create a QMenu
+ out of it. That menu is currently not functional anymore though.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+ (QWebPage::contextMenuEvent):
+ * Api/qwebpage_p.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed ContextMenu::setPlatformDescription for the Qt port to not show the qmenu right away
+ but instead just behave as a normal setter that takes ownership of the platform menu description (the qmenu).
+ Instead now QWebPage::contextMenuEvent() retrieves the QMenu after calling sendContextMenuEvent and calls exec()
+ on it.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::contextMenuEvent):
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ (WebCore::ContextMenuClientQt::getCustomMenuFromDefaultItems):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed to PlatformMouseEvent constructor to allow construction from a QContextMenuEvent.
+ Call sendContextMenuEvent on the event handler from a QWidget::contextMenuEvent re-implementation instead of in mousePressEvent.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::mousePressEvent):
+ (QWebPage::contextMenuEvent):
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Turned onLoadProgressChanged into a real private slot.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::QWebPage):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Make QWebHistory an explicitly shared object, returned as a pointer by QWebPage::history().
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpagehistory.cpp:
+ (QWebPageHistory::QWebPageHistory):
+ * Api/qwebpagehistory.h:
+
+2007-11-07 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ comments on API changes that we'd like to do.
+
+ * Api/qwebpage.h:
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars Knoll <lars@trolltech.com>.
+
+ Add a QWebPage::frameCreated() signal and fix DRT
+
+ The removal of createFrame in QWebPage broke the re-implementation
+ in DumpRenderTree. Instead emit a frameCreated() signal and
+ connect to it in DumpRenderTree.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2007-11-07 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Remove QWebPage::createFrame()
+
+ now that QWebFrame doesn't have virtual methods anymore, there
+ is no need for a createFrame() factory method in QWebpage.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars Knoll <lars@trolltech.com>.
+
+ Moved all the event handlers from QWebFrame into QWebPage.
+
+ This cleans up the public API and allows us to remove the
+ HackWebFrame hack in DumpRenderTree.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::pos):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::frameAt):
+ (QWebPage::mouseMoveEvent):
+ (QWebPage::mousePressEvent):
+ (QWebPage::mouseDoubleClickEvent):
+ (QWebPage::mouseReleaseEvent):
+ (QWebPage::wheelEvent):
+ * Api/qwebpage_p.h:
+
+2007-11-07 Holger Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Lars Knoll <lars@trolltech.com>.
+
+ Use correct UserAgent string.
+
+ * Only have one User Agent String and this place is QWebPage
+ * QWebPage::open -> QWebNetworkRequest -> QWebPage::open ->
+ ResourceRequest -> FrameLoader::load -> QWebNetworkRequest
+ * ResourceRequest is != 0 when getting called from WebCore, we
+ will only do requests when coming from WebCore and then we can
+ use the User-Agent set with the help of the FrameLoaderClient
+ * We might want to change QWebNetworkRequest a bit
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequestPrivate::init):
+
+2007-11-07 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ remove two notImplemented() warnings, as I believe we don't
+ have to implement these methods. Add some (commented out)
+ debug code in one place.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedSelection):
+ (WebCore::EditorClientQt::didWriteSelectionToPasteboard):
+
+2007-11-05 Tristan O'Tierney <tristan@apple.com>
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createWindow):
+ * WebCoreSupport/ChromeClientQt.h:
+ Revised to use new WebCore ChromeClient createWindow API.
+
+2007-10-31 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ fix most of the issues I found with Clipboard and DnD.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::dragLeaveEvent):
+
+2007-10-31 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ QDrag objects need to be created on the heap.
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::startDrag):
+
+2007-10-31 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ a dragLeave event is not the same as cancelling a drag.
+
+ * Api/qwebpage.cpp:
+
+2007-10-26 Mark Rowe <mrowe@apple.com>
+
+ Build fix. Add missing #include of Platform.h.
+
+ * Api/qwebhistoryinterface.cpp:
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * We need to set a != 0 status code for the fast/loader/xmlhttprequest-missing-file-exception.html
+ * libxml2 has the semantic that when writing an empty string and finishing it will report an error. For QXmlStreamReader this is valid.
+ * This is causing some regressions...
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+ (QWebNetworkInterface::addJob):
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * Make fast/loader/xmlhttprequest-bad-mimetype.html pass. We use QHttp to download local files but we may not set the HTTP result code on the ResourceResponse.
+ * We can use the cross-platform result now. QWebNetworkInterface/Manager behaves the same as mac for local files.
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * fast/dom/onerror-img.html regressed due checking the JobStates because in case of error (e.g. not being able to connect) the job will no be started.
+ * Use the error message from Qt. It might or might not be translated.
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJob::errorString):
+ (QWebNetworkJob::setErrorString):
+ (QWebNetworkManager::finished):
+ (QWebNetworkManager::doWork):
+ (WebCoreHttp::onRequestFinished):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * Use the JobStatus to make sure to not deliver finished/data before the job has started. This is the case with the fast/dom/onerror-img.html test case.
+ * We have no idea if any data will come so we can still finish and then get pending data. This luckily can't happen for the local file case.
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::doWork):
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * No need to initialize values in the QWebNetworkJob c'tor
+ * Add a JobStatus to QWebNetworkJob and verify that the jobs are handled in the way we expect them to be handled. This means no data after the job has finished, not finishing a job before it has been started.
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJob::status):
+ (QWebNetworkJob::setStatus):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ (QWebNetworkJobPrivate::QWebNetworkJobPrivate):
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * Consistency: Always name the jobs job.
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::onSslErrors):
+ (WebCoreHttp::onAuthenticationRequired):
+ (WebCoreHttp::onProxyAuthenticationRequired):
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * Implement our own queuing of network jobs to allow special handling of synchronous jobs. This makes us pass the fast/dom/xmlhttprequest-html-response-encoding.html test without a crash. Sync jobs will get a special treatment over the normals ones and in theory more than one sync job is supported.
+ * This should be thread-safe besides QWebNetworkJob::{ref,deref}
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJob::~QWebNetworkJob):
+ (QWebNetworkManager::QWebNetworkManager):
+ (QWebNetworkManager::self):
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::finished):
+ (QWebNetworkInterfacePrivate::sendFileData):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+ (QWebNetworkManager::queueStart):
+ (QWebNetworkManager::queueData):
+ (QWebNetworkManager::queueFinished):
+ (QWebNetworkManager::doScheduleWork):
+ (QWebNetworkManager::doWork):
+ (gCleanupInterface):
+ (QWebNetworkInterface::setDefaultInterface):
+ (QWebNetworkInterface::defaultInterface):
+ (QWebNetworkInterface::QWebNetworkInterface):
+ (QWebNetworkInterface::started):
+ (QWebNetworkInterface::data):
+ (QWebNetworkInterface::finished):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::cancel):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ (QWebNetworkManager::):
+ (QWebNetworkManager::JobData::JobData):
+ (QWebNetworkManager::JobFinished::JobFinished):
+
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * Do the percent replacement only when we are not base64. With base64 we should not have any % in it anyway.
+ * Have a custom decodePercentEncoding method that works without doing any charset conversion. With converting back to latin1() we lost some information.
+ * We pass the char-decoding.html test now
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (decodePercentEncoding):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+
+2007-10-24 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Lars Knoll <lars@trolltech.com>.
+
+ * Stop crashing on fast/events/frame-tab-focus.html the keyEvent can be 0.
+
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeypress):
+
+2007-10-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ remove some notImplemented() warnings.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::isContinuousSpellCheckingEnabled):
+ (WebCore::EditorClientQt::isGrammarCheckingEnabled):
+ (WebCore::EditorClientQt::respondToChangedSelection):
+
+2007-10-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ allow paste from DOM so we pass more test cases.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setSettings):
+
+2007-10-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Simplify the PlatformKeyEvent constructor. No need to have an extra boolean for isKeyUp in there, as the QKeyEvent has the information.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::keyPressEvent):
+ (QWebPage::keyReleaseEvent):
+
+2007-10-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ some smaller fixes to the editing support in DRT. Makes another few tests pass.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (qt_dump_editing_callbacks):
+ (qt_drt_run):
+
+2007-10-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ implemented support for most editing shortcuts to make contentEditable usable.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::keyPressEvent):
+
+2007-10-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ no need to call setIsActive ourselves on the frame, as the focus controller does it for us.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::focusInEvent):
+
+2007-10-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Implement support for testing editing.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (qt_dump_editing_callbacks):
+ (qt_dump_set_accepts_editing):
+ (dumpPath):
+ (dumpRange):
+ (WebCore::EditorClientQt::shouldDeleteRange):
+ (WebCore::EditorClientQt::shouldShowDeleteInterface):
+ (WebCore::EditorClientQt::shouldBeginEditing):
+ (WebCore::EditorClientQt::shouldEndEditing):
+ (WebCore::EditorClientQt::shouldInsertText):
+ (WebCore::EditorClientQt::shouldChangeSelectedRange):
+ (WebCore::EditorClientQt::shouldApplyStyle):
+ (WebCore::EditorClientQt::didBeginEditing):
+ (WebCore::EditorClientQt::respondToChangedContents):
+ (WebCore::EditorClientQt::respondToChangedSelection):
+ (WebCore::EditorClientQt::didEndEditing):
+ (WebCore::EditorClientQt::shouldInsertNode):
+
+2007-10-19 Alp Toker <alp@atoker.com>
+
+ Reviewed by Oliver.
+
+ GTK+ build fix enabling the new local database storage feature.
+ There is also a prospective Qt build fix.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runDatabaseSizeLimitPrompt):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-10-19 Simon Hausmann <hausmann@kde.org>
+
+ Fix the Qt/Windows build: Include the moc file from the .cpp file so
+ that config.h is included before wtf/MathExtras. The former defines
+ the MSVC defines for rand_s.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2007-10-19 Simon Hausmann <shausman@trolltech.com>
+
+ Reviewed by Lars.
+
+ Fix the windows/qt build by including config.h first to fix wtf/MathExtras.h inclusion.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebpage.cpp:
+
+2007-10-10 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ changes to keep the build from breaking
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-10-09 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ set a default encoding for documents. Makes fast/dom/Document/document-charset.html pass.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setSettings):
+
+2007-10-09 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Don't return a 404 status code for empty data: urls. Fixes fast/dom/HTMLHeadElement/head-check.html
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::cancel):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+
+2007-10-09 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Don't set up connections inside QWebPage::createFrame, as users might be reimplementing that method. Make sure we get only one titleChanged() signal per title change, and implement the support for testing this in DRT.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::createFrame):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-10-09 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ add a clear() method to QWebPageHistory.
+
+ * Api/qwebpagehistory.cpp:
+ (QWebPageHistory::clear):
+ (QWebPageHistory::itemAtIndex):
+ * Api/qwebpagehistory.h:
+
+2007-10-05 Lars Knoll <lars@trolltech.com>
+
+ add proper error messages to the FrameLoaderClient.
+ Implement ChromeClientQt::closeWindowSoon and
+ FrameLoaderClientQt::dispatchCreatePage (which should go away IMO).
+ Some fixes in DRT to make it work correctly with multiple windows.
+
+ Reviewed by Maciej.
+
+ * Api/qwebframe.h:
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::cancel):
+ (QWebNetworkInterface::addJob):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::closeWindowSoon):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::cancelledError):
+ (WebCore::):
+ (WebCore::FrameLoaderClientQt::blockedError):
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::dispatchCreatePage):
+
+2007-10-03 Lars Knoll <lars@trolltech.com>
+
+ Signed off by Olliej.
+
+ move WebKitQt to WebKit/qt for consistency with the other ports.
+
+ * Api/headers.pri: Renamed from WebKitQt/Api/headers.pri.
+ * Api/qcookiejar.cpp: Renamed from WebKitQt/Api/qcookiejar.cpp.
+ (QCookieJarPrivate::QCookieJarPrivate):
+ (qHash):
+ (QCookieJar::QCookieJar):
+ (QCookieJar::~QCookieJar):
+ (QCookieJar::setCookies):
+ (QCookieJar::cookies):
+ (QCookieJar::isEnabled):
+ (QCookieJar::setEnabled):
+ (gCleanupJar):
+ (QCookieJar::setCookieJar):
+ (QCookieJar::cookieJar):
+ * Api/qcookiejar.h: Renamed from WebKitQt/Api/qcookiejar.h.
+ * Api/qtwebkit.prf: Renamed from WebKitQt/Api/qtwebkit.prf.
+ * Api/qwebframe.cpp: Renamed from WebKitQt/Api/qwebframe.cpp.
+ (QWebFramePrivate::init):
+ (QWebFramePrivate::parentFrame):
+ (QWebFramePrivate::horizontalScrollBar):
+ (QWebFramePrivate::verticalScrollBar):
+ (QWebFrame::QWebFrame):
+ (QWebFrame::~QWebFrame):
+ (QWebFrame::addToJSWindowObject):
+ (QWebFrame::markup):
+ (QWebFrame::innerText):
+ (QWebFrame::renderTreeDump):
+ (QWebFrame::title):
+ (QWebFrame::name):
+ (QWebFrame::page):
+ (QWebFrame::selectedText):
+ (QWebFrame::childFrames):
+ (QWebFrame::verticalScrollBarPolicy):
+ (QWebFrame::setVerticalScrollBarPolicy):
+ (QWebFrame::horizontalScrollBarPolicy):
+ (QWebFrame::setHorizontalScrollBarPolicy):
+ (QWebFrame::render):
+ (QWebFrame::layout):
+ (QWebFrame::pos):
+ (QWebFrame::geometry):
+ (QWebFrame::evaluateJavaScript):
+ (QWebFrame::mouseMoveEvent):
+ (QWebFrame::mousePressEvent):
+ (QWebFrame::mouseDoubleClickEvent):
+ (QWebFrame::mouseReleaseEvent):
+ (QWebFrame::wheelEvent):
+ * Api/qwebframe.h: Renamed from WebKitQt/Api/qwebframe.h.
+ * Api/qwebframe_p.h: Renamed from WebKitQt/Api/qwebframe_p.h.
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebhistoryinterface.cpp: Renamed from WebKitQt/Api/qwebhistoryinterface.cpp.
+ (WebCore::historyContains):
+ (gCleanupInterface):
+ (QWebHistoryInterface::setDefaultInterface):
+ (QWebHistoryInterface::defaultInterface):
+ (QWebHistoryInterface::QWebHistoryInterface):
+ * Api/qwebhistoryinterface.h: Renamed from WebKitQt/Api/qwebhistoryinterface.h.
+ * Api/qwebkitglobal.h: Renamed from WebKitQt/Api/qwebkitglobal.h.
+ * Api/qwebnetworkinterface.cpp: Renamed from WebKitQt/Api/qwebnetworkinterface.cpp.
+ (qHash):
+ (operator==):
+ (QWebNetworkRequestPrivate::init):
+ (QWebNetworkRequestPrivate::setURL):
+ (QWebNetworkRequest::QWebNetworkRequest):
+ (QWebNetworkRequest::operator=):
+ (QWebNetworkRequest::~QWebNetworkRequest):
+ (QWebNetworkRequest::url):
+ (QWebNetworkRequest::setUrl):
+ (QWebNetworkRequest::httpHeader):
+ (QWebNetworkRequest::setHttpHeader):
+ (QWebNetworkRequest::httpHeaderField):
+ (QWebNetworkRequest::setHttpHeaderField):
+ (QWebNetworkRequest::postData):
+ (QWebNetworkRequest::setPostData):
+ (QWebNetworkJob::QWebNetworkJob):
+ (QWebNetworkJob::~QWebNetworkJob):
+ (QWebNetworkJob::url):
+ (QWebNetworkJob::postData):
+ (QWebNetworkJob::httpHeader):
+ (QWebNetworkJob::request):
+ (QWebNetworkJob::response):
+ (QWebNetworkJob::setResponse):
+ (QWebNetworkJob::cancelled):
+ (QWebNetworkJob::ref):
+ (QWebNetworkJob::deref):
+ (QWebNetworkJob::networkInterface):
+ (QWebNetworkJob::frame):
+ (QWebNetworkManager::QWebNetworkManager):
+ (QWebNetworkManager::self):
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::cancel):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ (QWebNetworkManager::addHttpJob):
+ (QWebNetworkManager::cancelHttpJob):
+ (QWebNetworkManager::httpConnectionClosed):
+ (QWebNetworkInterfacePrivate::sendFileData):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+ (gCleanupInterface):
+ (QWebNetworkInterface::setDefaultInterface):
+ (QWebNetworkInterface::defaultInterface):
+ (QWebNetworkInterface::QWebNetworkInterface):
+ (QWebNetworkInterface::~QWebNetworkInterface):
+ (QWebNetworkInterface::addJob):
+ (QWebNetworkInterface::cancelJob):
+ (WebCoreHttp::WebCoreHttp):
+ (WebCoreHttp::~WebCoreHttp):
+ (WebCoreHttp::request):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::getConnection):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::onDone):
+ (WebCoreHttp::onStateChanged):
+ (WebCoreHttp::cancel):
+ (WebCoreHttp::onSslErrors):
+ (WebCoreHttp::onAuthenticationRequired):
+ (WebCoreHttp::onProxyAuthenticationRequired):
+ (HostInfo::HostInfo):
+ * Api/qwebnetworkinterface.h: Renamed from WebKitQt/Api/qwebnetworkinterface.h.
+ * Api/qwebnetworkinterface_p.h: Renamed from WebKitQt/Api/qwebnetworkinterface_p.h.
+ (QWebNetworkJobPrivate::QWebNetworkJobPrivate):
+ (WebCore::HostInfo::HostInfo):
+ (WebCore::WebCoreHttp::HttpConnection::HttpConnection):
+ * Api/qwebobjectplugin.cpp: Renamed from WebKitQt/Api/qwebobjectplugin.cpp.
+ (QWebFactoryLoader::QWebFactoryLoader):
+ (QWebFactoryLoader::self):
+ (QWebFactoryLoader::descriptionForName):
+ (QWebFactoryLoader::mimetypesForName):
+ (QWebFactoryLoader::mimeTypeForExtension):
+ (QWebFactoryLoader::extensions):
+ (QWebFactoryLoader::nameForMimetype):
+ (QWebFactoryLoader::create):
+ (QWebObjectPlugin::QWebObjectPlugin):
+ (QWebObjectPlugin::~QWebObjectPlugin):
+ (QWebObjectPlugin::descriptionForKey):
+ (QWebObjectPlugin::mimetypesForKey):
+ (QWebObjectPlugin::extensionsForMimetype):
+ * Api/qwebobjectplugin.h: Renamed from WebKitQt/Api/qwebobjectplugin.h.
+ * Api/qwebobjectplugin_p.h: Renamed from WebKitQt/Api/qwebobjectplugin_p.h.
+ (QWebFactoryLoader::names):
+ (QWebFactoryLoader::supportsMimeType):
+ * Api/qwebobjectpluginconnector.cpp: Renamed from WebKitQt/Api/qwebobjectpluginconnector.cpp.
+ (QWebObjectPluginConnector::QWebObjectPluginConnector):
+ (QWebObjectPluginConnector::frame):
+ (QWebObjectPluginConnector::pluginParentWidget):
+ (QWebObjectPluginConnector::requestUrl):
+ * Api/qwebobjectpluginconnector.h: Renamed from WebKitQt/Api/qwebobjectpluginconnector.h.
+ * Api/qwebpage.cpp: Renamed from WebKitQt/Api/qwebpage.cpp.
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPagePrivate::navigationRequested):
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::QWebPage):
+ (QWebPage::~QWebPage):
+ (QWebPage::createFrame):
+ (QWebPage::open):
+ (QWebPage::url):
+ (QWebPage::title):
+ (QWebPage::mainFrame):
+ (QWebPage::sizeHint):
+ (QWebPage::stop):
+ (QWebPage::history):
+ (QWebPage::goBack):
+ (QWebPage::goForward):
+ (QWebPage::goToHistoryItem):
+ (QWebPage::javaScriptConsoleMessage):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::createWindow):
+ (QWebPage::createModalDialog):
+ (QWebPage::createPlugin):
+ (QWebPage::navigationRequested):
+ (QWebPage::setWindowGeometry):
+ (QWebPage::canCut):
+ (QWebPage::canCopy):
+ (QWebPage::canPaste):
+ (QWebPage::cut):
+ (QWebPage::copy):
+ (QWebPage::paste):
+ (QWebPage::isModified):
+ (QWebPage::undoStack):
+ (dropActionToDragOp):
+ (dragOpToDropAction):
+ (QWebPage::resizeEvent):
+ (QWebPage::paintEvent):
+ (QWebPage::mouseMoveEvent):
+ (QWebPage::mousePressEvent):
+ (QWebPage::mouseDoubleClickEvent):
+ (QWebPage::mouseReleaseEvent):
+ (QWebPage::wheelEvent):
+ (QWebPage::keyPressEvent):
+ (QWebPage::keyReleaseEvent):
+ (QWebPage::focusInEvent):
+ (QWebPage::focusOutEvent):
+ (QWebPage::focusNextPrevChild):
+ (QWebPage::dragEnterEvent):
+ (QWebPage::dragLeaveEvent):
+ (QWebPage::dragMoveEvent):
+ (QWebPage::dropEvent):
+ (QWebPage::setNetworkInterface):
+ (QWebPage::networkInterface):
+ (QWebPage::icon):
+ (QWebPage::setSettings):
+ (QWebPage::settings):
+ (QWebPage::chooseFile):
+ (QWebPage::setNetworkProxy):
+ (QWebPage::networkProxy):
+ (QWebPage::userAgentStringForUrl):
+ (QWebPage::onLoadProgressChanged):
+ (QWebPage::totalBytes):
+ * Api/qwebpage.h: Renamed from WebKitQt/Api/qwebpage.h.
+ * Api/qwebpage_p.h: Renamed from WebKitQt/Api/qwebpage_p.h.
+ * Api/qwebpagehistory.cpp: Renamed from WebKitQt/Api/qwebpagehistory.cpp.
+ (QWebHistoryItem::QWebHistoryItem):
+ (QWebHistoryItem::operator=):
+ (QWebHistoryItem::~QWebHistoryItem):
+ (QWebHistoryItem::originalUrl):
+ (QWebHistoryItem::currentUrl):
+ (QWebHistoryItem::title):
+ (QWebHistoryItem::lastVisited):
+ (QWebHistoryItem::icon):
+ (QWebPageHistory::QWebPageHistory):
+ (QWebPageHistory::itemAtIndex):
+ (QWebPageHistory::operator=):
+ (QWebPageHistory::~QWebPageHistory):
+ (QWebPageHistory::items):
+ (QWebPageHistory::backItems):
+ (QWebPageHistory::forwardItems):
+ (QWebPageHistory::canGoBack):
+ (QWebPageHistory::canGoForward):
+ (QWebPageHistory::goBack):
+ (QWebPageHistory::goForward):
+ (QWebPageHistory::goToItem):
+ (QWebPageHistory::backItem):
+ (QWebPageHistory::currentItem):
+ (QWebPageHistory::forwardItem):
+ * Api/qwebpagehistory.h: Renamed from WebKitQt/Api/qwebpagehistory.h.
+ (QExplicitlySharedDataPointer::operator*):
+ (QExplicitlySharedDataPointer::operator->):
+ (QExplicitlySharedDataPointer::operator T *):
+ (QExplicitlySharedDataPointer::operator const T *):
+ (QExplicitlySharedDataPointer::data):
+ (QExplicitlySharedDataPointer::constData):
+ (QExplicitlySharedDataPointer::operator==):
+ (QExplicitlySharedDataPointer::operator!=):
+ (QExplicitlySharedDataPointer::QExplicitlySharedDataPointer):
+ (QExplicitlySharedDataPointer::~QExplicitlySharedDataPointer):
+ (QExplicitlySharedDataPointer::operator=):
+ (QExplicitlySharedDataPointer::operator!):
+ (::QExplicitlySharedDataPointer):
+ * Api/qwebpagehistory_p.h: Renamed from WebKitQt/Api/qwebpagehistory_p.h.
+ (QWebHistoryItemPrivate::QWebHistoryItemPrivate):
+ (QWebHistoryItemPrivate::~QWebHistoryItemPrivate):
+ (QWebPageHistoryPrivate::QWebPageHistoryPrivate):
+ (QWebPageHistoryPrivate::~QWebPageHistoryPrivate):
+ * Api/qwebsettings.cpp: Renamed from WebKitQt/Api/qwebsettings.cpp.
+ (QWebSettingsPrivate::QWebSettingsPrivate):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::~QWebSettings):
+ (QWebSettings::setMinimumFontSize):
+ (QWebSettings::minimumFontSize):
+ (QWebSettings::setMinimumLogicalFontSize):
+ (QWebSettings::minimumLogicalFontSize):
+ (QWebSettings::setDefaultFontSize):
+ (QWebSettings::defaultFontSize):
+ (QWebSettings::setDefaultFixedFontSize):
+ (QWebSettings::defaultFixedFontSize):
+ (QWebSettings::setUserStyleSheetLocation):
+ (QWebSettings::userStyleSheetLocation):
+ (QWebSettings::setIconDatabaseEnabled):
+ (QWebSettings::iconDatabaseEnabled):
+ (QWebSettings::setWebGraphic):
+ (QWebSettings::webGraphic):
+ (QWebSettings::operator=):
+ (QWebSettings::setGlobal):
+ (QWebSettings::global):
+ (QWebSettings::setFontFamily):
+ (QWebSettings::fontFamily):
+ (QWebSettings::setAttribute):
+ (QWebSettings::testAttribute):
+ (loadResourcePixmap):
+ * Api/qwebsettings.h: Renamed from WebKitQt/Api/qwebsettings.h.
+ * ChangeLog: Renamed from WebKitQt/ChangeLog.
+ * Plugins/ICOHandler.cpp: Renamed from WebKitQt/Plugins/ICOHandler.cpp.
+ (IcoHeader::operator >>):
+ (IcoHeader::BMP_INFOHDR::):
+ (IcoHeader::operator<<):
+ (IcoHeader::LessDifference::LessDifference):
+ (IcoHeader::LessDifference::operator ()):
+ (IcoHeader::loadFromDIB):
+ (ICOHandler::ICOHandler):
+ (ICOHandler::canRead):
+ (ICOHandler::read):
+ (ICOHandler::write):
+ (ICOHandler::name):
+ (ICOPlugin::keys):
+ (ICOPlugin::capabilities):
+ (ICOPlugin::create):
+ * Plugins/ICOHandler.h: Renamed from WebKitQt/Plugins/ICOHandler.h.
+ * Plugins/Plugins.pro: Renamed from WebKitQt/Plugins/Plugins.pro.
+ * QtLauncher/QtLauncher.pro: Renamed from WebKitQt/QtLauncher/QtLauncher.pro.
+ * QtLauncher/main.cpp: Renamed from WebKitQt/QtLauncher/main.cpp.
+ (HoverLabel::HoverLabel):
+ (HoverLabel::setHoverLink):
+ (HoverLabel::sizeForFont):
+ (HoverLabel::sizeHint):
+ (HoverLabel::updateSize):
+ (HoverLabel::resetAnimation):
+ (HoverLabel::paintEvent):
+ (HoverLabel::interpolate):
+ (ClearButton::ClearButton):
+ (ClearButton::paintEvent):
+ (SearchEdit::SearchEdit):
+ (SearchEdit::~SearchEdit):
+ (SearchEdit::paintEvent):
+ (SearchEdit::resizeEvent):
+ (SearchEdit::moveEvent):
+ (MainWindow::MainWindow):
+ (MainWindow::changeLocation):
+ (MainWindow::loadFinished):
+ (MainWindow::showLinkHover):
+ (MainWindow::resizeEvent):
+ (main):
+ * WebCoreSupport/ChromeClientQt.cpp: Renamed from WebKitQt/WebCoreSupport/ChromeClientQt.cpp.
+ (WebCore::ChromeClientQt::ChromeClientQt):
+ (WebCore::ChromeClientQt::~ChromeClientQt):
+ (WebCore::ChromeClientQt::setWindowRect):
+ (WebCore::ChromeClientQt::windowRect):
+ (WebCore::ChromeClientQt::pageRect):
+ (WebCore::ChromeClientQt::scaleFactor):
+ (WebCore::ChromeClientQt::focus):
+ (WebCore::ChromeClientQt::unfocus):
+ (WebCore::ChromeClientQt::canTakeFocus):
+ (WebCore::ChromeClientQt::takeFocus):
+ (WebCore::ChromeClientQt::createWindow):
+ (WebCore::ChromeClientQt::createModalDialog):
+ (WebCore::ChromeClientQt::show):
+ (WebCore::ChromeClientQt::canRunModal):
+ (WebCore::ChromeClientQt::runModal):
+ (WebCore::ChromeClientQt::setToolbarsVisible):
+ (WebCore::ChromeClientQt::toolbarsVisible):
+ (WebCore::ChromeClientQt::setStatusbarVisible):
+ (WebCore::ChromeClientQt::statusbarVisible):
+ (WebCore::ChromeClientQt::setScrollbarsVisible):
+ (WebCore::ChromeClientQt::scrollbarsVisible):
+ (WebCore::ChromeClientQt::setMenubarVisible):
+ (WebCore::ChromeClientQt::menubarVisible):
+ (WebCore::ChromeClientQt::setResizable):
+ (WebCore::ChromeClientQt::addMessageToConsole):
+ (WebCore::ChromeClientQt::chromeDestroyed):
+ (WebCore::ChromeClientQt::canRunBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::closeWindowSoon):
+ (WebCore::ChromeClientQt::runJavaScriptAlert):
+ (WebCore::ChromeClientQt::runJavaScriptConfirm):
+ (WebCore::ChromeClientQt::runJavaScriptPrompt):
+ (WebCore::ChromeClientQt::setStatusbarText):
+ (WebCore::ChromeClientQt::shouldInterruptJavaScript):
+ (WebCore::ChromeClientQt::tabsToLinks):
+ (WebCore::ChromeClientQt::windowResizerRect):
+ (WebCore::ChromeClientQt::addToDirtyRegion):
+ (WebCore::ChromeClientQt::scrollBackingStore):
+ (WebCore::ChromeClientQt::updateBackingStore):
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+ (WebCore::ChromeClientQt::setToolTip):
+ (WebCore::ChromeClientQt::print):
+ * WebCoreSupport/ChromeClientQt.h: Renamed from WebKitQt/WebCoreSupport/ChromeClientQt.h.
+ * WebCoreSupport/ContextMenuClientQt.cpp: Renamed from WebKitQt/WebCoreSupport/ContextMenuClientQt.cpp.
+ (WebCore::ContextMenuClientQt::contextMenuDestroyed):
+ (WebCore::ContextMenuClientQt::getCustomMenuFromDefaultItems):
+ (WebCore::ContextMenuClientQt::contextMenuItemSelected):
+ (WebCore::ContextMenuClientQt::downloadURL):
+ (WebCore::ContextMenuClientQt::lookUpInDictionary):
+ (WebCore::ContextMenuClientQt::speak):
+ (WebCore::ContextMenuClientQt::stopSpeaking):
+ (WebCore::ContextMenuClientQt::searchWithGoogle):
+ * WebCoreSupport/ContextMenuClientQt.h: Renamed from WebKitQt/WebCoreSupport/ContextMenuClientQt.h.
+ * WebCoreSupport/DragClientQt.cpp: Renamed from WebKitQt/WebCoreSupport/DragClientQt.cpp.
+ (WebCore::DragClientQt::actionMaskForDrag):
+ (WebCore::DragClientQt::willPerformDragDestinationAction):
+ (WebCore::DragClientQt::dragControllerDestroyed):
+ (WebCore::DragClientQt::dragSourceActionMaskForPoint):
+ (WebCore::DragClientQt::willPerformDragSourceAction):
+ (WebCore::DragClientQt::startDrag):
+ * WebCoreSupport/DragClientQt.h: Renamed from WebKitQt/WebCoreSupport/DragClientQt.h.
+ (WebCore::DragClientQt::DragClientQt):
+ * WebCoreSupport/EditCommandQt.cpp: Renamed from WebKitQt/WebCoreSupport/EditCommandQt.cpp.
+ (EditCommandQt::EditCommandQt):
+ (EditCommandQt::~EditCommandQt):
+ (EditCommandQt::redo):
+ (EditCommandQt::undo):
+ * WebCoreSupport/EditCommandQt.h: Renamed from WebKitQt/WebCoreSupport/EditCommandQt.h.
+ * WebCoreSupport/EditorClientQt.cpp: Renamed from WebKitQt/WebCoreSupport/EditorClientQt.cpp.
+ (WebCore::EditorClientQt::shouldDeleteRange):
+ (WebCore::EditorClientQt::shouldShowDeleteInterface):
+ (WebCore::EditorClientQt::isContinuousSpellCheckingEnabled):
+ (WebCore::EditorClientQt::isGrammarCheckingEnabled):
+ (WebCore::EditorClientQt::spellCheckerDocumentTag):
+ (WebCore::EditorClientQt::shouldBeginEditing):
+ (WebCore::EditorClientQt::shouldEndEditing):
+ (WebCore::EditorClientQt::shouldInsertText):
+ (WebCore::EditorClientQt::shouldChangeSelectedRange):
+ (WebCore::EditorClientQt::shouldApplyStyle):
+ (WebCore::EditorClientQt::shouldMoveRangeAfterDelete):
+ (WebCore::EditorClientQt::didBeginEditing):
+ (WebCore::EditorClientQt::respondToChangedContents):
+ (WebCore::EditorClientQt::respondToChangedSelection):
+ (WebCore::EditorClientQt::didEndEditing):
+ (WebCore::EditorClientQt::didWriteSelectionToPasteboard):
+ (WebCore::EditorClientQt::didSetSelectionTypesForPasteboard):
+ (WebCore::EditorClientQt::selectWordBeforeMenuEvent):
+ (WebCore::EditorClientQt::isEditable):
+ (WebCore::EditorClientQt::registerCommandForUndo):
+ (WebCore::EditorClientQt::registerCommandForRedo):
+ (WebCore::EditorClientQt::clearUndoRedoOperations):
+ (WebCore::EditorClientQt::canUndo):
+ (WebCore::EditorClientQt::canRedo):
+ (WebCore::EditorClientQt::undo):
+ (WebCore::EditorClientQt::redo):
+ (WebCore::EditorClientQt::shouldInsertNode):
+ (WebCore::EditorClientQt::pageDestroyed):
+ (WebCore::EditorClientQt::smartInsertDeleteEnabled):
+ (WebCore::EditorClientQt::toggleContinuousSpellChecking):
+ (WebCore::EditorClientQt::toggleGrammarChecking):
+ (WebCore::EditorClientQt::handleKeypress):
+ (WebCore::EditorClientQt::handleInputMethodKeypress):
+ (WebCore::EditorClientQt::EditorClientQt):
+ (WebCore::EditorClientQt::textFieldDidBeginEditing):
+ (WebCore::EditorClientQt::textFieldDidEndEditing):
+ (WebCore::EditorClientQt::textDidChangeInTextField):
+ (WebCore::EditorClientQt::doTextFieldCommandFromEvent):
+ (WebCore::EditorClientQt::textWillBeDeletedInTextField):
+ (WebCore::EditorClientQt::textDidChangeInTextArea):
+ (WebCore::EditorClientQt::ignoreWordInSpellDocument):
+ (WebCore::EditorClientQt::learnWord):
+ (WebCore::EditorClientQt::checkSpellingOfString):
+ (WebCore::EditorClientQt::checkGrammarOfString):
+ (WebCore::EditorClientQt::updateSpellingUIWithGrammarString):
+ (WebCore::EditorClientQt::updateSpellingUIWithMisspelledWord):
+ (WebCore::EditorClientQt::showSpellingUI):
+ (WebCore::EditorClientQt::spellingUIIsShowing):
+ (WebCore::EditorClientQt::getGuessesForWord):
+ (WebCore::EditorClientQt::isEditing):
+ (WebCore::EditorClientQt::setInputMethodState):
+ * WebCoreSupport/EditorClientQt.h: Renamed from WebKitQt/WebCoreSupport/EditorClientQt.h.
+ * WebCoreSupport/FrameLoaderClientQt.cpp: Renamed from WebKitQt/WebCoreSupport/FrameLoaderClientQt.cpp.
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::~FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::webFrame):
+ (WebCore::FrameLoaderClientQt::callPolicyFunction):
+ (WebCore::FrameLoaderClientQt::slotCallPolicyFunction):
+ (WebCore::FrameLoaderClientQt::hasWebView):
+ (WebCore::FrameLoaderClientQt::hasFrameView):
+ (WebCore::FrameLoaderClientQt::hasBackForwardList):
+ (WebCore::FrameLoaderClientQt::resetBackForwardList):
+ (WebCore::FrameLoaderClientQt::provisionalItemIsTarget):
+ (WebCore::FrameLoaderClientQt::loadProvisionalItemFromPageCache):
+ (WebCore::FrameLoaderClientQt::invalidateCurrentItemPageCache):
+ (WebCore::FrameLoaderClientQt::privateBrowsingEnabled):
+ (WebCore::FrameLoaderClientQt::makeDocumentView):
+ (WebCore::FrameLoaderClientQt::makeRepresentation):
+ (WebCore::FrameLoaderClientQt::forceLayout):
+ (WebCore::FrameLoaderClientQt::forceLayoutForNonHTML):
+ (WebCore::FrameLoaderClientQt::setCopiesOnScroll):
+ (WebCore::FrameLoaderClientQt::tokenForLoadErrorReset):
+ (WebCore::FrameLoaderClientQt::resetAfterLoadError):
+ (WebCore::FrameLoaderClientQt::doNotResetAfterLoadError):
+ (WebCore::FrameLoaderClientQt::willCloseDocument):
+ (WebCore::FrameLoaderClientQt::detachedFromParent2):
+ (WebCore::FrameLoaderClientQt::detachedFromParent3):
+ (WebCore::FrameLoaderClientQt::detachedFromParent4):
+ (WebCore::FrameLoaderClientQt::loadedFromCachedPage):
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidCancelClientRedirect):
+ (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect):
+ (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchWillClose):
+ (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+ (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+ (WebCore::FrameLoaderClientQt::dispatchShow):
+ (WebCore::FrameLoaderClientQt::cancelPolicyCheck):
+ (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm):
+ (WebCore::FrameLoaderClientQt::dispatchDidLoadMainResource):
+ (WebCore::FrameLoaderClientQt::clearLoadingFromPageCache):
+ (WebCore::FrameLoaderClientQt::isLoadingFromPageCache):
+ (WebCore::FrameLoaderClientQt::revertToProvisionalState):
+ (WebCore::FrameLoaderClientQt::clearUnarchivingState):
+ (WebCore::FrameLoaderClientQt::postProgressStartedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressEstimateChangedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady):
+ (WebCore::FrameLoaderClientQt::willChangeTitle):
+ (WebCore::FrameLoaderClientQt::didChangeTitle):
+ (WebCore::FrameLoaderClientQt::finishedLoading):
+ (WebCore::FrameLoaderClientQt::finalSetupForReplace):
+ (WebCore::FrameLoaderClientQt::setDefersLoading):
+ (WebCore::FrameLoaderClientQt::isArchiveLoadPending):
+ (WebCore::FrameLoaderClientQt::cancelPendingArchiveLoad):
+ (WebCore::FrameLoaderClientQt::clearArchivedResources):
+ (WebCore::FrameLoaderClientQt::canShowMIMEType):
+ (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
+ (WebCore::FrameLoaderClientQt::generatedMIMETypeForURLScheme):
+ (WebCore::FrameLoaderClientQt::frameLoadCompleted):
+ (WebCore::FrameLoaderClientQt::restoreViewState):
+ (WebCore::FrameLoaderClientQt::provisionalLoadStarted):
+ (WebCore::FrameLoaderClientQt::shouldTreatURLAsSameAsCurrent):
+ (WebCore::FrameLoaderClientQt::addHistoryItemForFragmentScroll):
+ (WebCore::FrameLoaderClientQt::didFinishLoad):
+ (WebCore::FrameLoaderClientQt::prepareForDataSourceReplacement):
+ (WebCore::FrameLoaderClientQt::setTitle):
+ (WebCore::FrameLoaderClientQt::userAgent):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveIcon):
+ (WebCore::FrameLoaderClientQt::frameLoaderDestroyed):
+ (WebCore::FrameLoaderClientQt::canHandleRequest):
+ (WebCore::FrameLoaderClientQt::windowObjectCleared):
+ (WebCore::FrameLoaderClientQt::didPerformFirstNavigation):
+ (WebCore::FrameLoaderClientQt::registerForIconNotification):
+ (WebCore::FrameLoaderClientQt::setDocumentViewFromCachedPage):
+ (WebCore::FrameLoaderClientQt::updateGlobalHistoryForStandardLoad):
+ (WebCore::FrameLoaderClientQt::updateGlobalHistoryForReload):
+ (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
+ (WebCore::FrameLoaderClientQt::saveViewStateToItem):
+ (WebCore::FrameLoaderClientQt::saveDocumentViewToCachedPage):
+ (WebCore::FrameLoaderClientQt::canCachePage):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::cancelledError):
+ (WebCore::FrameLoaderClientQt::blockedError):
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientQt::shouldFallBack):
+ (WebCore::FrameLoaderClientQt::createDocumentLoader):
+ (WebCore::FrameLoaderClientQt::download):
+ (WebCore::FrameLoaderClientQt::assignIdentifierToInitialRequest):
+ (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveAuthenticationChallenge):
+ (WebCore::FrameLoaderClientQt::dispatchDidCancelAuthenticationChallenge):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveContentLength):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+ (WebCore::FrameLoaderClientQt::dispatchCreatePage):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientQt::dispatchUnableToImplementPolicy):
+ (WebCore::FrameLoaderClientQt::startDownload):
+ (WebCore::FrameLoaderClientQt::willUseArchive):
+ (WebCore::FrameLoaderClientQt::createFrame):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ (WebCore::FrameLoaderClientQt::redirectDataToPlugin):
+ (WebCore::FrameLoaderClientQt::createJavaAppletWidget):
+ (WebCore::FrameLoaderClientQt::overrideMediaType):
+ * WebCoreSupport/FrameLoaderClientQt.h: Renamed from WebKitQt/WebCoreSupport/FrameLoaderClientQt.h.
+ * WebCoreSupport/InspectorClientQt.cpp: Renamed from WebKitQt/WebCoreSupport/InspectorClientQt.cpp.
+ (WebCore::InspectorClientQt::inspectorDestroyed):
+ (WebCore::InspectorClientQt::createPage):
+ (WebCore::InspectorClientQt::showWindow):
+ (WebCore::InspectorClientQt::closeWindow):
+ (WebCore::InspectorClientQt::attachWindow):
+ (WebCore::InspectorClientQt::detachWindow):
+ (WebCore::InspectorClientQt::highlight):
+ (WebCore::InspectorClientQt::hideHighlight):
+ * WebCoreSupport/InspectorClientQt.h: Renamed from WebKitQt/WebCoreSupport/InspectorClientQt.h.
+ * WebKitPart/WebKitFactory.cpp: Renamed from WebKitQt/WebKitPart/WebKitFactory.cpp.
+ (WebKitFactory::WebKitFactory):
+ (WebKitFactory::~WebKitFactory):
+ (WebKitFactory::createPartObject):
+ (WebKitFactory::instance):
+ (WebKitFactory::ref):
+ (WebKitFactory::deref):
+ * WebKitPart/WebKitFactory.h: Renamed from WebKitQt/WebKitPart/WebKitFactory.h.
+ * WebKitPart/WebKitPart.cpp: Renamed from WebKitQt/WebKitPart/WebKitPart.cpp.
+ (WebKitPart::WebKitPart):
+ (WebKitPart::~WebKitPart):
+ (WebKitPart::openFile):
+ (WebKitPart::openUrl):
+ (WebKitPart::closeUrl):
+ (WebKitPart::parentPart):
+ (WebKitPart::frame):
+ (WebKitPart::initView):
+ * WebKitPart/WebKitPart.desktop: Renamed from WebKitQt/WebKitPart/WebKitPart.desktop.
+ * WebKitPart/WebKitPart.h: Renamed from WebKitQt/WebKitPart/WebKitPart.h.
+ (WebKitPart::):
+ * WebKitPart/WebKitPart.rc: Renamed from WebKitQt/WebKitPart/WebKitPart.rc.
+ * WebKitPart/WebKitPartBrowser.rc: Renamed from WebKitQt/WebKitPart/WebKitPartBrowser.rc.
+ * WebKitPart/WebKitPartBrowserExtension.cpp: Renamed from WebKitQt/WebKitPart/WebKitPartBrowserExtension.cpp.
+ (WebKitPartBrowserExtension::WebKitPartBrowserExtension):
+ * WebKitPart/WebKitPartBrowserExtension.h: Renamed from WebKitQt/WebKitPart/WebKitPartBrowserExtension.h.
+ * WebKitPart/WebKitPartClient.cpp: Renamed from WebKitQt/WebKitPart/WebKitPartClient.cpp.
+ (WebKitPartClient::WebKitPartClient):
+ (WebKitPartClient::~WebKitPartClient):
+ * WebKitPart/WebKitPartClient.h: Renamed from WebKitQt/WebKitPart/WebKitPartClient.h.
+ * WebKitPart/WebKitPartInterface.cpp: Renamed from WebKitQt/WebKitPart/WebKitPartInterface.cpp.
+ (WebKitPartInterface::WebKitPartInterface):
+ (WebKitPartInterface::~WebKitPartInterface):
+ (WebKitPartInterface::url):
+ * WebKitPart/WebKitPartInterface.h: Renamed from WebKitQt/WebKitPart/WebKitPartInterface.h.
+ * WebKitPart/org.kde.WebKitPart.xml: Renamed from WebKitQt/WebKitPart/org.kde.WebKitPart.xml.
+
+2007-10-02 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Eric Seidel.
+
+ Open the requested url on the newly created window.
+ Implement createModalDialog and provide new API for this.
+ Patch by M. Mehdi Salem Naraghi (momesana) with additions by me.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::createModalDialog):
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createWindow):
+ (WebCore::ChromeClientQt::createModalDialog):
+
+2007-10-02 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by bdash.
+
+ Add API to retrieve the frame name from QWebFrame.
+ Implement support for DRT::dumpChildrenAsText.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::name):
+ * Api/qwebframe.h:
+
+2007-10-02 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by bdash.
+
+ Fix the handling of the response header for data urls. Make sure we always pass absolute URLs to WebKit from both DRT and QtLauncher.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ (QWebNetworkInterfacePrivate::sendFileData):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::onSslErrors):
+ * QtLauncher/main.cpp:
+ (main):
+
+2007-10-01 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Eric.
+
+ Fix a wrong extension mapping in the MIMETypeRegistry and identify about: url's as frames in the FrameLoaderClient.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::makeDocumentView):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2007-09-30 George Staikos <staikos@kde.org>
+
+ Qt build fix (OS X specific).
+
+ * QtLauncher/QtLauncher.pro:
+
+2007-09-26 Mark Rowe <mrowe@apple.com>
+
+ Qt build fix.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::objectContentType): Check for empty URL instead of invalid URL.
+
+2007-09-25 David Kilzer <ddkilzer@webkit.org>
+
+ Reviewed by Adam.
+
+ - Fix http://bugs.webkit.org/show_bug.cgi?id=14885
+ LGPL'ed files contain incorrect FSF address
+
+ * Api/qcookiejar.cpp:
+ * Api/qcookiejar.h:
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebhistoryinterface.cpp:
+ * Api/qwebhistoryinterface.h:
+ * Api/qwebkitglobal.h:
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebobjectplugin.cpp:
+ * Api/qwebobjectplugin.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ * Api/qwebobjectpluginconnector.h:
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpagehistory.cpp:
+ * Api/qwebpagehistory.h:
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+ * WebCoreSupport/EditCommandQt.cpp:
+ * WebCoreSupport/EditCommandQt.h:
+
+2007-09-25 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Simon and Lars.
+
+ Modifies the addToJSWindowObject to bind js objects using the built-in
+ kjs_window class. Make sure to protect the created runtime object from
+ garbage collection.
+
+ Adds a signal to QWebFrame to notify clients of the beginning of a
+ provisional load. DRT needs this.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJSWindowObject):
+ * Api/qwebframe.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
+
+2007-09-10 Qing Zhao <qing@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Don't re-encode urls, resulting in double encoding. Fixes login to
+ GMail.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequestPrivate::init):
+ (QWebNetworkManager::started):
+
+2007-09-08 Mark Rowe <mrowe@apple.com>
+
+ Qt build fix. Move stub method implementations to the right class.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didPerformFirstNavigation):
+
+2007-09-08 Brady Eidson <beidson@apple.com>
+
+ YABF (Yet Another Build Fix)
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::iconDatabaseEnabled):
+
+2007-09-08 Brady Eidson <beidson@apple.com>
+
+ Better build fix
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClient::registerForIconNotification):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-09-08 Brady Eidson <beidson@apple.com>
+
+ Build fix
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClient::registerForIconNotification):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-09-05 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Darin Adler, Maciej Stachowiak, Mark Rowe, Tim Hatcher.
+
+ Fixed <rdar://problem/5326009> Make non-browser WebKit clients have no
+ memory cache, or a very tiny one
+
+ Keep the Qt build working with an empty stub.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClient::didPerformFirstNavigation):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-09-07 George Staikos <staikos@kde.org>
+
+ Fix typo.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::onLoadProgressChanged):
+
+2007-09-07 Qing Zhao <qing@staikos.net>
+
+ Reviewed by Anders and George.
+
+ Export page size and load progress in bytes.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::QWebPage):
+ (QWebPage::onLoadProgressChanged):
+ (QWebPage::totalBytes):
+ (QWebPage::bytesReceived):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2007-09-06 George Staikos <staikos@kde.org>
+
+ Reviewed by Anders.
+
+ Make popup windows work again.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+
+2007-09-01 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Sam.
+
+ <rdar://problem/5344848> IME is incorrectly used for key events when on non-editable regions
+
+ EditorClient::setInputMethodState stub
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-08-30 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Use QKeySequence::StandardKey for the page wise scrolling shortcuts.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::keyPressEvent):
+
+2007-08-30 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ When scrolling with the keyboard don't call update() on the entire widget.
+ The scrollbar/scrollview implementation is already smart enough to scroll with bitblt
+ on a value change.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::keyPressEvent):
+
+2007-08-30 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Fix scrolling with the keyboard if only one of the two scrollbars is visible.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::keyPressEvent):
+
+2007-08-29 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Fix compilation.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::objectContentType):
+
+2007-08-19 Mike Hommey <mh+webkit@glandium.org>
+
+ Reviewed by George Staikos.
+
+ Don't export ICO symbols.
+
+ * Plugins/Plugins.pro:
+
+2007-08-19 George Staikos <staikos@kde.org>
+
+ Fix compilation.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-08-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed and landed by Simon.
+
+ Limit the set of properties from the computed style to apply to Qt
+ plugin widgets, as only a few of them make sense.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+
+2007-08-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ Use <object>'s classid attribute for creation of plugins through QWebPage::createPlugin.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::createPlugin):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2007-08-10 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added support for network jobs from Qt resources using the qrc protocol.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkInterface::addJob):
+
+2007-08-10 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added support for "application/x-qt-styled-widget" that is treated like "application/x-qt-plugin" but also
+ gets a Qt widget stylesheet set from the CSS computed style and the element style attribute.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2007-08-10 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added virtual QWebPage::createPlugin that is called for embedded objects with the mime type "application/x-qt-plugin"
+ and fixed widget embedding by setting the right QWidget parent.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::createPlugin):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2007-08-02 George Staikos <staikos@kde.org>
+
+ Reviewed by Simon.
+
+ Add an interface for the useragent string.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentStringForUrl):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::userAgent):
+
+2007-08-01 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by George Staikos.
+
+ Add an interface to manage global history for clients
+
+ * Api/headers.pri:
+ * Api/qwebhistoryinterface.cpp: Added.
+ (WebCore::historyContains):
+ (gCleanupInterface):
+ (QWebHistoryInterface::setDefaultInterface):
+ (QWebHistoryInterface::defaultInterface):
+ (QWebHistoryInterface::QWebHistoryInterface):
+ * Api/qwebhistoryinterface.h: Added.
+
+2007-07-30 Adam Treat <adam.treat@torchmobile.com>
+
+ Fix build.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::shouldMoveRangeAfterDelete):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-07-30 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Link QtLauncher into $$OUTPUT_DIR/bin
+
+ * QtLauncher/QtLauncher.pro:
+
+2007-07-29 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by George Staikos.
+
+ Change QWebPage::paintEvent to draw using the individual rects provided
+ via the QRegion and set the widget to use opaque paint events.
+
+ These changes greatly reduce the cpu load as we are no longer painting the
+ entire page for each 1px scroll :P
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::render):
+ * Api/qwebpage.cpp:
+ (QWebPage::QWebPage):
+ (QWebPage::paintEvent):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::addToDirtyRegion):
+
+2007-07-29 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Respect the margins when creating frames.
+ Set the scroll mode to always off like we did before the rendered
+ frames patch and the other ports do now.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+
+2007-07-27 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Mark.
+
+ Don't create an app bundle on OSX to keep WebKitTools/Scripts/run-launcher working.
+
+ * QtLauncher/QtLauncher.pro:
+
+2007-07-27 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Fix compilation with MSVC.
+
+ * Api/qwebpagehistory.cpp:
+ (QWebPageHistory::operator=):
+ * Api/qwebpagehistory.h:
+ * Api/qwebsettings.cpp:
+ (QWebSettings::operator=):
+ * Api/qwebsettings.h:
+
+2007-07-26 Qing Zhao <qing@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Add a signal for history notification.
+
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2007-07-24 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Niko and Lars.
+
+ These are no longer necessary or used.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-07-20 Adam Treat <adam@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Add a signal for first layout and add the action type for the policy
+ function.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::navigationRequested):
+ (QWebPage::navigationRequested):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2007-07-19 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by George.
+
+ Do a recursive layout on the frame's children. This fixes a
+ segfault found when rendering some framesets.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::render):
+ (QWebFrame::layout):
+ * Api/qwebframe.h:
+
+2007-07-18 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Adam.
+
+ Make the Page with the now required InspectorClient.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::initView):
+
+2007-07-18 Sam Weinig <sam@webkit.org>
+
+ Build fix.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::canShowMIMEType):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+
+2007-07-18 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack & Simon
+
+ Reallow setting of scrollbar policies on QWebFrame.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::verticalScrollBarPolicy):
+ (QWebFrame::setVerticalScrollBarPolicy):
+ (QWebFrame::horizontalScrollBarPolicy):
+ * Api/qwebframe.h:
+
+2007-07-17 Adam Treat <adam.treat@torchmobile.com>
+
+ Build fix.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2007-07-17 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Blind build fix for Qt after r24366 by adding the additional
+ WebCore::ResourceRequest& parameter to the download method.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::download):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-07-17 Adam Roben <aroben@apple.com>
+
+ Remove ContextMenuClientQt::shouldIncludeInspectElementItem
+
+ Reviewed by Tim.
+
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ * WebCoreSupport/ContextMenuClientQt.h:
+
+2007-07-16 Adam Roben <aroben@apple.com>
+
+ Updated ChromeClientQt for ChromeClient changes.
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::print): Added a Frame* parameter.
+ * WebCoreSupport/ChromeClientQt.h: Ditto.
+
+2007-07-13 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Mitz.
+
+ Build fix. Stub out ChromeClientQt::print.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::print):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-07-12 George Staikos <staikos@kde.org>
+
+ Qt build fix for assertions.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+
+2007-07-12 George Staikos <staikos@kde.org>
+
+ Qt build fix.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+
+2007-07-10 Mark Rowe <mrowe@apple.com>
+
+ Qt build fix after r24126.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2007-07-10 Eli Fidler <eli@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Properly url-decode data urls.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+
+2007-07-09 Adam Treat <adam@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Convert QWebFrame from a QFrame to a pure QObject to eliminate all
+ traces of widgets.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ (QWebFramePrivate::parentFrame):
+ (QWebFrame::QWebFrame):
+ (QWebFrame::render):
+ (QWebFrame::pos):
+ (QWebFrame::geometry):
+ (QWebFrame::evaluateJavaScript):
+ (QWebFrame::mouseMoveEvent):
+ (QWebFrame::mousePressEvent):
+ (QWebFrame::mouseDoubleClickEvent):
+ (QWebFrame::mouseReleaseEvent):
+ (QWebFrame::wheelEvent):
+ * Api/qwebframe.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ (QWebObjectPluginConnector::pluginParentWidget):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::QWebPage):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::resizeEvent):
+ (QWebPage::paintEvent):
+ (QWebPage::mouseMoveEvent):
+ (QWebPage::mousePressEvent):
+ (QWebPage::mouseDoubleClickEvent):
+ (QWebPage::mouseReleaseEvent):
+ (QWebPage::wheelEvent):
+ (QWebPage::keyPressEvent):
+ (QWebPage::keyReleaseEvent):
+ (QWebPage::focusInEvent):
+ (QWebPage::focusOutEvent):
+ (QWebPage::focusNextPrevChild):
+ (QWebPage::chooseFile):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::addToDirtyRegion):
+
+2007-07-09 George Staikos <staikos@kde.org>
+
+ Fix a minor memory leak in the loader.
+
+ * Api/qwebnetworkinterface.cpp:
+ (gCleanupInterface):
+ (QWebNetworkInterface::setDefaultInterface):
+ (QWebNetworkInterface::defaultInterface):
+
+2007-07-09 George Staikos <staikos@kde.org>
+
+ Fix a massive memory leak in the loader.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::httpConnectionClosed):
+ (WebCoreHttp::~WebCoreHttp):
+
+2007-07-09 George Staikos <staikos@kde.org>
+
+ Reviewed by Simon.
+
+ Rework much of the HTTP stuff to make it more stable, and add SSL and
+ proxy support. Major memory leak also discovered but it needs more
+ research as the obvious fix causes crashes.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (WebCoreHttp::WebCoreHttp):
+ (WebCoreHttp::~WebCoreHttp):
+ (WebCoreHttp::request):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::getConnection):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::onDone):
+ (WebCoreHttp::onStateChanged):
+ (WebCoreHttp::onSslErrors):
+ (WebCoreHttp::onAuthenticationRequired):
+ (WebCoreHttp::onProxyAuthenticationRequired):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ (WebCore::WebCoreHttp::HttpConnection::HttpConnection):
+
+2007-07-06 Adam Treat <adam@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Convert QWebFrame to a QFrame from a scroll area.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ (QWebFramePrivate::parentFrame):
+ (QWebFramePrivate::horizontalScrollBar):
+ (QWebFramePrivate::verticalScrollBar):
+ (QWebFrame::QWebFrame):
+ (QWebFrame::resizeEvent):
+ (QWebFrame::suppressScrollbars):
+ (QWebFrame::paintEvent):
+ (QWebFrame::mouseMoveEvent):
+ (QWebFrame::mousePressEvent):
+ (QWebFrame::mouseDoubleClickEvent):
+ (QWebFrame::mouseReleaseEvent):
+ (QWebFrame::wheelEvent):
+ (QWebFrame::keyPressEvent):
+ (QWebFrame::focusInEvent):
+ (QWebFrame::focusOutEvent):
+ (QWebFrame::evaluateJavaScript):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ (QWebObjectPluginConnector::pluginParentWidget):
+
+2007-07-04 Adam Roben <aroben@apple.com>
+
+ Added a stub for ChromeClientQt::setToolTip
+
+ Reviewed by Sam.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::setToolTip):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-07-04 Adam Roben <aroben@apple.com>
+
+ Added a stub for ChromeClientQt::mouseDidMoveOverElement
+
+ Reviewed by Sam.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-06-28 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Propagate mouse double click events from Qt to WebCore.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::mouseDoubleClickEvent):
+ * Api/qwebframe.h:
+
+2007-06-28 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Implemented clipboard functions in QWebPage, in particular can(Cut|Copy|Paste), cut/copy/paste as slot as well as a selectionChanged() signal.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::canCut):
+ (QWebPage::canCopy):
+ (QWebPage::canPaste):
+ (QWebPage::cut):
+ (QWebPage::copy):
+ (QWebPage::paste):
+ * Api/qwebpage.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+
+2007-06-27 George Staikos <staikos@kde.org>
+
+ Compile with various Qt configurations.
+
+ * Api/qwebnetworkinterface.cpp:
+ (WebCoreHttp::scheduleNextRequest):
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::dragEnterEvent):
+ (QWebPage::dragLeaveEvent):
+ (QWebPage::dragMoveEvent):
+ (QWebPage::dropEvent):
+ (QWebPage::chooseFile):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::startDrag):
+
+2007-06-27 Eli Fidler <eli@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Check for QT_NO_IMAGE_TEXT and compile either way.
+
+ * Plugins/ICOHandler.cpp:
+ (ICOHandler::read):
+
+2007-06-27 Eli Fidler <eli@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Remove QT3_SUPPORT dependency in the ICO plugin.
+
+ * Plugins/ICOHandler.cpp:
+ (IcoHeader::loadFromDIB):
+
+2007-06-25 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack.
+
+ Start to add proxy and SSL support to WebKit Qt. Proxy works
+ unauthenticated. Added hooks to be able to add authentication.
+ Also fixes some network errors.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequestPrivate::setURL):
+ (QWebNetworkJob::frame):
+ (WebCoreHttp::WebCoreHttp):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::onDone):
+ (WebCoreHttp::onSslErrors):
+ (WebCoreHttp::onAuthenticationRequired):
+ (WebCoreHttp::onProxyAuthenticationRequired):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::setNetworkProxy):
+ (QWebPage::networkProxy):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2007-06-21 Adam Treat <adam@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Implement the default resources on Qt.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::icon):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::setWebGraphic):
+ (QWebSettings::webGraphic):
+ (loadResourcePixmap):
+ * Api/qwebsettings.h:
+
+2007-06-15 Adam Treat <adam@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Add ICO support to the Qt build.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::icon):
+ * Api/qwebpage.h:
+ * Api/qwebsettings.cpp:
+ (QWebSettings::setIconDatabaseEnabled):
+ (QWebSettings::iconDatabaseEnabled):
+ * Api/qwebsettings.h:
+ * Plugins: Added.
+ * Plugins/ICOHandler.cpp: Added.
+ (IcoHeader::operator >>):
+ (IcoHeader::BMP_INFOHDR::):
+ (IcoHeader::operator<<):
+ (IcoHeader::LessDifference::LessDifference):
+ (IcoHeader::LessDifference::operator ()):
+ (IcoHeader::loadFromDIB):
+ (ICOHandler::ICOHandler):
+ (ICOHandler::canRead):
+ (ICOHandler::read):
+ (ICOHandler::write):
+ (ICOHandler::name):
+ (ICOPlugin::keys):
+ (ICOPlugin::capabilities):
+ (ICOPlugin::create):
+ * Plugins/ICOHandler.h: Added.
+ * Plugins/Plugins.pro: Added.
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveIcon):
+
+2007-06-15 George Staikos <staikos@kde.org>
+
+ Fixing the Qt build.
+
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ (WebCore::ContextMenuClientQt::shouldIncludeInspectElementItem):
+ * WebCoreSupport/ContextMenuClientQt.h:
+
+2007-06-20 Adam Roben <aroben@apple.com>
+
+ More speculative Qt build fixes.
+
+ Add a stub implementation of InspectorClientQt.
+
+ * WebCoreSupport/InspectorClientQt.cpp: Added.
+ (WebCore::InspectorClientQt::inspectorDestroyed):
+ (WebCore::InspectorClientQt::createPage):
+ (WebCore::InspectorClientQt::showWindow):
+ (WebCore::InspectorClientQt::closeWindow):
+ (WebCore::InspectorClientQt::attachWindow):
+ (WebCore::InspectorClientQt::detachWindow):
+ (WebCore::InspectorClientQt::highlight):
+ (WebCore::InspectorClientQt::hideHighlight):
+ * WebCoreSupport/InspectorClientQt.h: Added.
+
+2007-06-19 George Staikos <staikos@kde.org>
+
+ Reviewed by Tim Hatcher.
+
+ Add https support.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkInterface::addJob):
+ (QWebNetworkInterface::cancelJob):
+ (WebCoreHttp::WebCoreHttp):
+
+2007-06-14 George Staikos <staikos@kde.org>
+
+ Reviewed by Lars.
+
+ Add evaluateJavaScript() method.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+ * Api/qwebframe.h:
+
+2007-06-14 George Staikos <staikos@kde.org>
+
+ Reviewed by Lars.
+
+ Implement most of the editing commands, better focus handling, fix some
+ keyboard and mouse handling, and add keyboard navigation. May be
+ refactored later as the key switches are ugly.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ (QWebFrame::mousePressEvent):
+ (QWebFrame::mouseReleaseEvent):
+ (QWebFrame::wheelEvent):
+ (QWebFrame::keyPressEvent):
+ (QWebFrame::keyReleaseEvent):
+ (QWebFrame::focusInEvent):
+ (QWebFrame::focusOutEvent):
+ (QWebFrame::focusNextPrevChild):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeypress):
+
+2007-06-14 George Staikos <staikos@kde.org>
+
+ Reviewed by Lars.
+
+ Implement all of the Javascript dialogs and file chooser.
+ Also makes the statusbar virtual into a signal and shuffles some
+ virtuals around a bit. The helper in FrameLoaderClientQt may go away
+ shortly.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::chooseFile):
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::canRunBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runJavaScriptAlert):
+ (WebCore::ChromeClientQt::runJavaScriptConfirm):
+ (WebCore::ChromeClientQt::runJavaScriptPrompt):
+ (WebCore::ChromeClientQt::setStatusbarText):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::chooseFile):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-06-14 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Removed QWebHistoryItem::parent() as it is not implemented and WebCore's
+
+ HistoryItem itself doesn't seem to have a parent pointer either.
+
+ * Api/qwebpagehistory.h:
+
+2007-06-14 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Make it possible to copy QWebHistoryItem objects.
+
+ * Api/qwebpagehistory.cpp:
+ * Api/qwebpagehistory.h:
+
+2007-06-14 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by George
+
+ Fix a crash when a request from the plugin resulted
+ in a HTTP redirect.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+
+2007-06-14 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by George.
+
+ Work around a bug in Qt's QHttp implementation and
+ get web pages to load again.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::open):
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added a make install target that installs the Qt port and renamed
+ WebKitQt to QtWebKit
+
+ * Api/headers.pri: Added.
+ * Api/qtwebkit.prf: Added.
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added httpHeaderField setter/getter to QWebNetworkRequest for convenience.
+
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed QWebObjectPluginConnector::requestUrl to take a QWebNetworkRequest as argument.
+
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ (QWebObjectPluginConnector::requestUrl):
+ * Api/qwebobjectpluginconnector.h:
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added a QWebNetworkRequest convenience constructor.
+
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::open):
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed the QWebPage::open(const QUrl &url, const QHttpRequestHeader &httpHeader, const QByteArray &postData)
+ overload to take a QWebNetworkRequest instead.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::open):
+ * Api/qwebpage.h:
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ In QWebPage::open(const QUrl &, const QHttpRequestHeader &, ...) don't make the population
+ of the WebCore::ResourceRequest depend on the validity of the QHttpRequestHeader but just
+ pick the individual fields if we can use them.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::open):
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Minor QWebNetworkRequet API fixlet
+
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Use QWebNetworkRequest for QWebPage::navigationRequested.
+
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::navigationRequested):
+ (QWebPage::navigationRequested):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Some docs for QWebNetworkRequest
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequest::QWebNetworkRequest):
+ (QWebNetworkRequest::~QWebNetworkRequest):
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Moved QWebNetworkJob::Method enum into QWebNetworkRequest.
+
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ (QWebObjectPluginConnector::requestUrl):
+ * Api/qwebobjectpluginconnector.h:
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Rename QWebNetworkJob::request() into QWebNetworkJob::httpHeader() and added
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJob::postData):
+ (WebCoreHttp::WebCoreHttp):
+ (WebCoreHttp::scheduleNextRequest):
+ * Api/qwebnetworkinterface.h:
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Introduce QWebNetworkRequest in the public API.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequestPrivate::init):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Changed QWebNetworkJobPrivate to aggregate a QWebNetworkRequest instead of inheriting from it.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ (QWebObjectPluginConnector::requestUrl):
+
+2007-06-13 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Rename QWebNetworkRequest::request into QWebNetworkRequest::httpHeader.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequest::init):
+ (QWebNetworkRequest::setURL):
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::started):
+ * Api/qwebnetworkinterface_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2007-06-12 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by George Staikos.
+
+ Remove duplicate symbols.
+
+ * Api/qwebobjectplugin_p.h:
+
+2007-06-13 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Niko.
+
+ Fix compilation, and remove dependency on Qt
+ private header.
+
+ * Api/qwebobjectplugin_p.h:
+ (QWebFactoryLoader::supportsMimeType):
+
+2007-06-13 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Niko.
+
+ Parts of the patch done by Zack.
+ Fix up some parts in the implementation of QWebNetworkInterface
+ so it can be used by plugins.
+ Change the plugin API so we can actually get all the information
+ required by the JS bridge from them as well.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJob::cancelled):
+ (QWebNetworkManager::cancel):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::finished):
+ * Api/qwebobjectplugin.cpp:
+ (QWebFactoryLoader::QWebFactoryLoader):
+ (QWebFactoryLoader::descriptionForName):
+ (QWebFactoryLoader::mimetypesForName):
+ (QWebFactoryLoader::mimeTypeForExtension):
+ (QWebFactoryLoader::extensions):
+ (QWebFactoryLoader::nameForMimetype):
+ (QWebFactoryLoader::create):
+ (QWebObjectPlugin::descriptionForKey):
+ (QWebObjectPlugin::mimetypesForKey):
+ * Api/qwebobjectplugin.h:
+ * Api/qwebobjectplugin_p.h:
+ (QWebFactoryLoader::names):
+ * Api/qwebobjectpluginconnector.cpp:
+ (QWebObjectPluginConnector::requestUrl):
+ * Api/qwebpage.cpp:
+ (QWebPage::networkInterface):
+
+2007-06-11 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added a QWebPage::open overload to allow specifying the http header and post data.
+ (it's an overload instead of a merged openUrl to avoid including qhttp.h in qwebpage.h,
+ which would imply that one has to have QT += network in the .pro file for using WebKitQt)
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+
+2007-06-11 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added the possibility to intercept url requests through QWebPage::navigationRequested.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::createFrame):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2007-06-11 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Added a QWebNetworkRequest::init overload that takes a WebCore::ResourceRequest,
+ to be called from FrameLoaderClientQt in the near future.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+ * Api/qwebnetworkinterface_p.h:
+
+2007-06-11 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Moved the postData setup into QWebNetworkRequest::init.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequest::init):
+ (QWebNetworkManager::add):
+
+2007-06-11 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Moved HTTP header field propagation to QWebNetworkRequest::init.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequest::init):
+ (QWebNetworkManager::add):
+
+2007-06-11 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Started moving the code to separate a WebCore::ResourceRequest into a QUrl, postData
+ and QHttpRequestHeader into a separate little QWebNetworkRequest struct.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkRequest::init):
+ (QWebNetworkManager::add):
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebobjectpluginconnector.cpp:
+ (QWebObjectPluginConnector::requestUrl):
+
+2007-06-11 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Forgot to export the plugin connector.
+
+ * Api/qwebobjectpluginconnector.h
+
+2007-06-08 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack.
+
+ Add a QWebObjectPluginConnector class. The class will
+ facility communication between the plugin and WebKit.
+ Currently it's used to make the plugin network capable.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJobPrivate::setDefaults):
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ (QWebNetworkJobPrivate::QWebNetworkJobPrivate):
+ * Api/qwebobjectplugin.cpp:
+ (QWebFactoryLoader::create):
+ * Api/qwebobjectplugin.h:
+ * Api/qwebobjectplugin_p.h:
+ * Api/qwebobjectpluginconnector.cpp: Added.
+ (QWebObjectPluginConnector::QWebObjectPluginConnector):
+ (QWebObjectPluginConnector::frame):
+ (QWebObjectPluginConnector::pluginParentWidget):
+ (QWebObjectPluginConnector::requestUrl):
+ * Api/qwebobjectpluginconnector.h: Added.
+ (QWebObjectPluginConnector::):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2007-06-06 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Add an API to create and load plugins.
+ Don't include moc files by hand anymore, rather let
+ qmake handle them.
+
+ * Api/qcookiejar.cpp:
+ (QCookieJar::cookieJar):
+ * Api/qwebframe.cpp:
+ (QWebFrame::scrollContentsBy):
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebobjectplugin.cpp: Added.
+ (QWebFactoryLoader::QWebFactoryLoader):
+ (QWebFactoryLoader::self):
+ (QWebFactoryLoader::mimeTypeForExtension):
+ (QWebFactoryLoader::create):
+ (QWebObjectPlugin::QWebObjectPlugin):
+ (QWebObjectPlugin::~QWebObjectPlugin):
+ (QWebObjectPlugin::extensionsForMimetype):
+ * Api/qwebobjectplugin.h: Added.
+ * Api/qwebobjectplugin_p.h: Added.
+ (QWebFactoryLoader::mimeTypes):
+ (QWebFactoryLoader::extensions):
+ (QWebFactoryLoader::supportsMimeType):
+ * Api/qwebpage.cpp:
+ (QWebPage::settings):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::postProgressEstimateChangedNotification):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2007-05-28 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by andersca and simon
+
+ Adding public settings Api to the Qt port.
+ QWebSetting's is a value based settings
+ object settable on the QWebPage.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::QWebPage):
+ (QWebPage::setSettings):
+ (QWebPage::settings):
+ * Api/qwebpage.h:
+ * Api/qwebsettings.cpp: Added.
+ (QWebSettingsPrivate::QWebSettingsPrivate):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::~QWebSettings):
+ (QWebSettings::setMinimumFontSize):
+ (QWebSettings::minimumFontSize):
+ (QWebSettings::setMinimumLogicalFontSize):
+ (QWebSettings::minimumLogicalFontSize):
+ (QWebSettings::setDefaultFontSize):
+ (QWebSettings::defaultFontSize):
+ (QWebSettings::setDefaultFixedFontSize):
+ (QWebSettings::defaultFixedFontSize):
+ (QWebSettings::setUserStyleSheetLocation):
+ (QWebSettings::userStyleSheetLocation):
+ (QWebSettings::setGlobal):
+ (QWebSettings::global):
+ (QWebSettings::setFontFamily):
+ (QWebSettings::fontFamily):
+ (QWebSettings::setAttribute):
+ (QWebSettings::testAttribute):
+ * Api/qwebsettings.h: Added.
+ * QtLauncher/main.cpp:
+ (main):
+2007-05-27 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Sam Weinig.
+
+ Consolidate all notImplemented() macro definitions into
+ one header file for all platforms.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ * WebCoreSupport/EditorClientQt.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2007-05-25 George Staikos <staikos@kde.org>
+
+ Reviewed by Simon.
+
+ The http loader should only ask for .... http cookies!
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+
+2007-05-24 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Fix multipart/form-data HTTP POSTs. The content-type wasn't set
+ correctly. Fortunately WebCore does it already, so there's no need
+ for us to do it since we already transfer all HTTP header fields :)
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+
+2007-05-23 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack, idea from Lars.
+
+ Share WebCoreHttp and therefore HTTP connections among multiple
+ QWebNetworkInterface instances by moving the code into
+ QWebNetworkManager.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::addHttpJob):
+ (QWebNetworkManager::cancelHttpJob):
+ (QWebNetworkManager::httpConnectionClosed):
+ (QWebNetworkInterface::addJob):
+ (QWebNetworkInterface::cancelJob):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::cancel):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+
+2007-05-23 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack, discussed also with Lars.
+
+ Make it possible to specify a per-QWebPage network interface (needed
+ for the KDE KIO integration).
+
+ Merged the file and the network loader into
+ QWebNetworkInterface(Private), which simplifies the loading code.
+
+ When receiving a redirection don't emit the data of the redirected job
+ to the document. (otherwise the kind of "This page has moved" text
+ appears right on top of the real page content)
+
+ * Api/qwebnetworkinterface.cpp:
+ (qHash):
+ (operator==):
+ (QWebNetworkJob::QWebNetworkJob):
+ (QWebNetworkJob::networkInterface):
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::cancel):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ (QWebNetworkInterfacePrivate::sendFileData):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+ (QWebNetworkInterfacePrivate::addHttpJob):
+ (QWebNetworkInterfacePrivate::httpConnectionClosed):
+ (QWebNetworkInterface::setDefaultInterface):
+ (QWebNetworkInterface::QWebNetworkInterface):
+ (QWebNetworkInterface::addJob):
+ (QWebNetworkInterface::cancelJob):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::cancel):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::setNetworkInterface):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2007-05-23 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Don't do HTTP downloads in a second thread. Simplifies
+ the code significantly and fixes crashes on some
+ Web pages.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add):
+ (QWebNetworkInterface::QWebNetworkInterface):
+ (QWebNetworkInterface::addJob):
+ (QWebNetworkInterface::cancelJob):
+ (LoaderThread::LoaderThread):
+ (LoaderThread::run):
+ (WebCoreHttp::cancel):
+ (NetworkLoader::NetworkLoader):
+ (NetworkLoader::request):
+ (NetworkLoader::cancel):
+ * Api/qwebnetworkinterface_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveContentLength):
+
+2007-05-23 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJobPrivate::setURL):
+ (QWebNetworkManager::started):
+ Fix Host: line in HTTP headers and resolving of relative URLs
+ when redirecting.
+ * Api/qwebnetworkinterface_p.h:
+ Clean up qHash forward declaration a bit.
+
+2007-05-23 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow): Fix loading progress signal/slot connection.
+
+2007-05-22 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::add): Fix http headers for POST.
+
+2007-05-21 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon
+
+ Remove the userHandle methods from QWebnetworkJob again.
+ They don't really give us anything and just clutter the API.
+
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+
+2007-05-21 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ * Api/qwebnetworkinterface.h: Export the net API.
+
+2007-05-21 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack.
+
+ Add an API layer for network downloads. Basically QWebnetworkInterface
+ is an interface class for downloading resources. QWebnetworkJob describes
+ the actual object to download.
+
+ QWebNetworkInterface has a default implementation that replaces the
+ old ResourceHandleManager class in the Qt port.
+
+ * Api/qwebnetworkinterface.cpp: Added.
+ (QWebNetworkJobPrivate::setURL):
+ (QWebNetworkJob::QWebNetworkJob):
+ (QWebNetworkJob::~QWebNetworkJob):
+ (QWebNetworkJob::url):
+ (QWebNetworkJob::postData):
+ (QWebNetworkJob::request):
+ (QWebNetworkJob::response):
+ (QWebNetworkJob::setResponse):
+ (QWebNetworkJob::cancelled):
+ (QWebNetworkJob::ref):
+ (QWebNetworkJob::deref):
+ (QWebNetworkJob::setUserHandle):
+ (QWebNetworkJob::userHandle):
+ (QWebNetworkManager::QWebNetworkManager):
+ (QWebNetworkManager::self):
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::cancel):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ (QWebNetworkInterface::setDefaultInterface):
+ (QWebNetworkInterface::defaultInterface):
+ (QWebNetworkInterface::QWebNetworkInterface):
+ (QWebNetworkInterface::~QWebNetworkInterface):
+ (QWebNetworkInterface::addJob):
+ (QWebNetworkInterface::cancelJob):
+ (LoaderThread::LoaderThread):
+ (LoaderThread::run):
+ (FileLoader::FileLoader):
+ (FileLoader::request):
+ (FileLoader::sendData):
+ (FileLoader::parseDataUrl):
+ (WebCoreHttp::WebCoreHttp):
+ (WebCoreHttp::~WebCoreHttp):
+ (WebCoreHttp::request):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::getConnection):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::onStateChanged):
+ (WebCoreHttp::cancel):
+ (HostInfo::HostInfo):
+ (qHash):
+ (operator==):
+ (NetworkLoader::NetworkLoader):
+ (NetworkLoader::~NetworkLoader):
+ (NetworkLoader::request):
+ (NetworkLoader::connectionClosed):
+ (NetworkLoader::cancel):
+ * Api/qwebnetworkinterface.h: Added.
+ (QWebNetworkJob::setHandle):
+ (QWebNetworkJob::handle):
+ * Api/qwebnetworkinterface_p.h: Added.
+ (WebCore::LoaderThread::):
+ (WebCore::LoaderThread::waitForSetup):
+ (WebCore::HostInfo::HostInfo):
+
+2007-05-18 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Nikolas.
+
+ * Api/qwebpage.h: Changed the loadProgressChanged API to use an
+ percent integer instead of a double precision floating pointer number.
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::postProgressEstimateChangedNotification):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-05-18 Marius Bugge Monsen <mbm@trolltech.com>
+
+ Reviewed by Zack Rusin.
+
+ The default constructed KeyboardEvent has
+ no PlatformKeyboardEvent.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeypress):
+
+2007-05-17 Adam Treat <adam@staikos.net>
+
+ Reviewed by George Staikos.
+
+ - Implement frameLoadCompleted
+ - Fix build (by George)
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::frameLoadCompleted):
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2007-05-17 Adam Treat <adam@staikos.net>
+
+ Reviewed by George Staikos.
+
+ Implement canShowMIMEType
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::canShowMIMEType):
+
+2007-05-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ pass the mouse events to the event handler, not the frameview.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::mouseMoveEvent):
+ (QWebFrame::mouseReleaseEvent):
+
+2007-05-14 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Updates after Maciej's frame change.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::stop):
+ Call stopForUserCancel() instead of stopAllLoaders()
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::didFinishLoad):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+ Call QWebFrame::loadDone() from the places it's supposed to be
+ called from.
+
+2007-05-12 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Rob Buis.
+
+ - call Frame::init as needed - this prevents crashes but pages don't appear.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::initView):
+
+2007-05-08 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Ada.
+
+ Slight modification to last editor method fix.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::updateSpellingUIWithGrammarString):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-05-03 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Oliver.
+
+ Add missing user description parameter to spelling-related editor client method.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::updateSpellingUIWithGrammarString):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-04-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Zack.
+
+ Tie QT drag events to the DragController logic
+ to allow drag and drop events to be handled by
+ webkit.
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::QWebPage):
+ (dropActionToDragOp):
+ (dragOpToDropAction):
+ (QWebPage::dragEnterEvent):
+ (QWebPage::dragLeaveEvent):
+ (QWebPage::dragMoveEvent):
+ (QWebPage::dropEvent):
+ * Api/qwebpage.h:
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::startDrag):
+ * WebCoreSupport/DragClientQt.h:
+ (WebCore::DragClientQt::DragClientQt):
+
+2007-04-27 Holger Freyther <freyther@kde.org>
+
+ Reviewed by Maciej.
+
+ Remove unmaintained CMake build system.
+
+ * QtLauncher/CMakeLists.txt: Removed.
+ * WebKitPart/CMakeLists.txt: Removed.
+
+2007-04-25 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Adam.
+
+ Fix spelling error in spelling method name.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::updateSpellingUIWithGrammarString):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-04-24 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Oliver.
+
+ Spelling and grammar stubs
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::ignoreWordInSpellDocument):
+ (WebCore::EditorClientQt::learnWord):
+ (WebCore::EditorClientQt::checkSpellingOfString):
+ (WebCore::EditorClientQt::checkGrammarOfString):
+ (WebCore::EditorClientQt::udpateSpellingUIWithGrammarString):
+ (WebCore::EditorClientQt::updateSpellingUIWithMisspelledWord):
+ (WebCore::EditorClientQt::showSpellingUI):
+ (WebCore::EditorClientQt::spellingUIIsShowing):
+ (WebCore::EditorClientQt::getGuessesForWord):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-04-11 MorganL <morganl.webkit@yahoo.com>
+
+ Reviewed by Maciej.
+
+ Add a Frame pointer to ChromeClient methods:
+ http://bugs.webkit.org/show_bug.cgi?id=13127
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createWindow):
+ (WebCore::ChromeClientQt::createModalDialog):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-04-12 Mark Rowe <mrowe@apple.com>
+
+ Second part of Qt build fix.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::loadedFromCachedPage):
+ (WebCore::FrameLoaderClientQt::setDocumentViewFromCachedPage):
+ (WebCore::FrameLoaderClientQt::saveDocumentViewToCachedPage):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-03-27 Zack Rusin <zrusin@trolltech.com>
+
+ Fix the rendering crashes due triggered
+ asserts. Improve a bit the layout
+ scheduling.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::resizeEvent):
+ (QWebFrame::paintEvent):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::forceLayout):
+
+2007-03-16 Lars Knoll <lars@trolltech.com>
+
+ Fix the Qt build once again.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeypress):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::blockedError):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-03-13 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by George.
+
+ Don't try to load <object> tags with an invalid url.
+ Fixes LayoutTests/fast/dom/object-plugin-hides-properties.html
+ which hit an assertion in the frameloader.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::objectContentType):
+
+2007-03-13 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Anders.
+
+ Fix some crashes in the Qt build.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::markup):
+ Check for null pointer
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ Don't use an async callback into the FrameLoader.
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2007-03-11 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Adele.
+
+ Stub for EditorClientQt::respondToChangedSelection
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedSelection):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-03-07 Adele Peterson <adele@apple.com>
+
+ Reviewed by Darin Adler.
+
+ WebKitQT part of fix for:
+ http://bugs.webkit.org/show_bug.cgi?id=10871
+ http://bugs.webkit.org/show_bug.cgi?id=12677
+ <rdar://problem/4823129> REGRESSION: IME key events different in nightly
+ <rdar://problem/4759563> REGRESSION: Return key is always sent when you confirm a clause in kotoeri
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeypress): Changed handleKeyPress to handleKeypress.
+ (WebCore::EditorClientQt::handleInputMethodKeypress): Added.
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-03-07 Darin Adler <darin@apple.com>
+
+ * WebCoreSupport/FrameLoaderClientQt.h: Oops, forgot the header.
+
+2007-03-07 Darin Adler <darin@apple.com>
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::userAgent):
+ Try to fix the build by correcting the parameter here.
+
+2007-03-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders.
+
+ Try to fix the Qt build
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::willPerformDragDestinationAction):
+ (WebCore::DragClientQt::dragControllerDestroyed):
+ (WebCore::DragClientQt::createDragImageForLink):
+
+2007-02-26 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Kevin McCullough.
+
+ - fix Qt build for earlier SVG changes.
+
+ * WebCoreSupport/EditCommandQt.cpp:
+
+2007-02-24 Zack Rusin <zrusin@trolltech.com>
+
+ Adjust the animation a little bit to make it more natural.
+
+ * QtLauncher/main.cpp:
+ (HoverLabel::paintEvent):
+
+2007-02-23 Zack Rusin <zrusin@trolltech.com>
+
+ Adding a little bit of eye-candy to the last
+ commit (animations on hover events)
+
+ * QtLauncher/main.cpp:
+ (HoverLabel::HoverLabel):
+ (HoverLabel::setHoverLink):
+ (HoverLabel::sizeForFont):
+ (HoverLabel::sizeHint):
+ (HoverLabel::resetAnimation):
+ (HoverLabel::paintEvent):
+ (HoverLabel::interpolate):
+ (SearchEdit::resizeEvent):
+
+2007-02-23 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Adding API and code for notification of when the
+ mouse is hovering over a link and adding code to
+ the sample app to showcase it.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::mouseMoveEvent):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp:
+ (QWebPage::createFrame):
+ * Api/qwebpage.h:
+ * QtLauncher/main.cpp:
+ (HoverLabel::HoverLabel):
+ (HoverLabel::setHoverLink):
+ (HoverLabel::sizeHint):
+ (HoverLabel::updateSize):
+ (HoverLabel::paintEvent):
+ (ClearButton::ClearButton):
+ (ClearButton::paintEvent):
+ (SearchEdit::SearchEdit):
+ (SearchEdit::resizeEvent):
+ (SearchEdit::moveEvent):
+ (MainWindow::MainWindow):
+ (MainWindow::showLinkHover):
+ (MainWindow::resizeEvent):
+
+2007-02-22 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Fixing the default scroll offset, cleaning
+ up private methods and making the default
+ look not use any frames.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ (QWebFramePrivate::_q_handleKeyEvent):
+ (QWebFrame::QWebFrame):
+ (QWebFrame::wheelEvent):
+ (QWebFrame::keyPressEvent):
+ (QWebFrame::keyReleaseEvent):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+
+2007-02-22 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Make the qwebframe act as a proper canvas.
+ Implement it on top of QAbstractScrollArea.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::init):
+ (QWebFramePrivate::_q_adjustScrollbars):
+ (QWebFrame::init):
+ (QWebFrame::QWebFrame):
+ (QWebFrame::resizeEvent):
+ (QWebFrame::childFrames):
+ (QWebFrame::paintEvent):
+ (QWebFrame::mouseMoveEvent):
+ (QWebFrame::mousePressEvent):
+ (QWebFrame::mouseReleaseEvent):
+ (QWebFrame::wheelEvent):
+ (QWebFrame::keyPressEvent):
+ (QWebFrame::keyReleaseEvent):
+ (QWebFrame::dragEnterEvent):
+ (QWebFrame::dragLeaveEvent):
+ (QWebFrame::dragMoveEvent):
+ (QWebFrame::handleKeyEvent):
+ (QWebFrame::scrollContentsBy):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+
+2007-02-21 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack.
+
+ Add more editing support, and undo/redo. Requires some nasty evil
+ hacks that have to be sorted out in WebCore/editor.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPage::undoStack):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::didBeginEditing):
+ (WebCore::EditorClientQt::didEndEditing):
+ (WebCore::EditorClientQt::isEditable):
+ (WebCore::EditorClientQt::registerCommandForUndo):
+ (WebCore::EditorClientQt::registerCommandForRedo):
+ (WebCore::EditorClientQt::clearUndoRedoOperations):
+ (WebCore::EditorClientQt::canUndo):
+ (WebCore::EditorClientQt::canRedo):
+ (WebCore::EditorClientQt::undo):
+ (WebCore::EditorClientQt::redo):
+ (WebCore::EditorClientQt::handleKeyPress):
+ (WebCore::EditorClientQt::EditorClientQt):
+ (WebCore::EditorClientQt::textFieldDidBeginEditing):
+ (WebCore::EditorClientQt::textFieldDidEndEditing):
+ (WebCore::EditorClientQt::isEditing):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-02-21 Zack Rusin <zrusin@trolltech.com>
+
+ Fix compilation.
+
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ * WebCoreSupport/ContextMenuClientQt.h:
+
+2007-02-21 George Staikos <staikos@kde.org>
+
+ Fix compile.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::stop):
+
+2007-02-20 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Make editing of forms work plus make sure that non-void methods
+ always return something.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::canRunBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runJavaScriptConfirm):
+ (WebCore::ChromeClientQt::runJavaScriptPrompt):
+ (WebCore::ChromeClientQt::shouldInterruptJavaScript):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::shouldDeleteRange):
+ (WebCore::EditorClientQt::shouldBeginEditing):
+ (WebCore::EditorClientQt::shouldEndEditing):
+ (WebCore::EditorClientQt::shouldInsertText):
+ (WebCore::EditorClientQt::shouldChangeSelectedRange):
+ (WebCore::EditorClientQt::shouldApplyStyle):
+ (WebCore::EditorClientQt::shouldInsertNode):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache):
+ (WebCore::FrameLoaderClientQt::dispatchCreatePage):
+
+2007-02-17 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Maciej.
+
+ Additional coding by Maciej, additional review by Oliver.
+
+ Add stubs for the new methods in ChormeClient and EditorClient,
+ remove all references to FrameQt.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::shouldInterruptJavaScript):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::shouldChangeSelectedRange):
+ (WebCore::EditorClientQt::isEditable):
+ * WebCoreSupport/EditorClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::webFrame):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-02-18 Oliver Hunt <oliver@apple.com>
+
+ Build fix -- adding DragClientQt method stubs
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::willPerformDragSourceAction):
+ (WebCore::DragClientQt::startDrag):
+ (WebCore::DragClientQt::createDragImageForLink):
+ * WebCoreSupport/DragClientQt.h:
+
+2007-02-15 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam
+
+ Moved scroll state down into the cross platform FrameLoader -
+ Blind attempt at keeping Qt building
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::restoreViewState):
+ (WebCore::FrameLoaderClientQt::saveViewStateToItem):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-02-07 Anders Carlsson <acarlsson@apple.com>
+
+ Try fixing the Qt build.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::shouldInterruptJavaScript):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-02-02 Zack Rusin <zrusin@trolltech.com>
+
+ Compilation fix: forward declare d-ptr.
+
+ * Api/qcookiejar.h:
+
+2007-02-02 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Make the frames white by default and get the
+ files that WebCore can handle render inside
+ the frames.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+
+2007-02-01 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack and Lars.
+
+ Add a cookie interface for the Qt build.
+
+ * Api/qcookiejar.cpp: Added.
+ (QCookieJarPrivate::QCookieJarPrivate):
+ (qHash):
+ (QCookieJar::QCookieJar):
+ (QCookieJar::~QCookieJar):
+ (QCookieJar::setCookies):
+ (QCookieJar::cookies):
+ (QCookieJar::isEnabled):
+ (QCookieJar::setEnabled):
+ (gCleanupJar):
+ (QCookieJar::setCookieJar):
+ (QCookieJar::cookieJar):
+ * Api/qcookiejar.h: Added.
+
+2007-02-01 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Adam.
+
+ Fix form loading for the Qt build.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::callPolicyFunction):
+ (WebCore::FrameLoaderClientQt::slotCallPolicyFunction):
+ (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2007-01-31 Zack Rusin <zrusin@trolltech.com>
+
+ Expose the fact that the form has been edited
+ in the public api.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPage::isModified):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedContents):
+ (WebCore::EditorClientQt::isEditable):
+
+2007-01-31 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Properly propagate key events.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJSWindowObject):
+ (QWebFrame::innerText):
+ (QWebFrame::renderTreeDump):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebpage.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::pageDestroyed):
+ (WebCore::EditorClientQt::handleKeyPress):
+ (WebCore::EditorClientQt::EditorClientQt):
+ * WebCoreSupport/EditorClientQt.h:
+
+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.
+
+ * QtLauncher/main.cpp:
+ (ClearButton::ClearButton):
+ (ClearButton::paintEvent):
+ (SearchEdit::SearchEdit):
+ (SearchEdit::~SearchEdit):
+ (SearchEdit::paintEvent):
+ (SearchEdit::resizeEvent):
+ (SearchEdit::moveEvent):
+ (MainWindow::MainWindow):
+ (MainWindow::changeLocation):
+ (MainWindow::loadFinished):
+
+2007-01-30 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ Added import/export macros needed for build with ELF visibility and
+ for a build on Windows (in the future).
+
+ * Api/qwebframe.h:
+ * Api/qwebkitglobal.h: Added.
+ * Api/qwebpage.h:
+ * Api/qwebpagehistory.h:
+
+2007-01-30 Zack Rusin <zack@kde.org>
+
+ Change the signature of handleKeyPress
+ (make it compile)
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyPress):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-01-29 Zack Rusin <zack@kde.org>
+
+ Reviewed by Lars
+
+ Set the allows-scrolling property on the view.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+
+2007-01-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Adam.
+
+ Stub for new DragClient method
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::dragSourceActionMaskForPoint):
+ * WebCoreSupport/DragClientQt.h:
+
+2007-01-29 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Mark.
+
+ - updated for cross-platform data loading support
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createDocumentLoader):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-29 George Staikos <staikos@kde.org>
+
+ Make window resizing work.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setWindowGeometry):
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::setWindowRect):
+
+2007-01-29 George Staikos <staikos@kde.org>
+
+ Make popup windows work.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::createWindow):
+ * Api/qwebpage.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createWindow):
+
+2007-01-29 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Fix the way we handle native widgets (QWidget) inside
+ WebCore. Now WebCore::Widget owns the QWidget in all
+ cases. This is the only way to get well defined semantics
+ for all teh native widgets we have (currently ScrollView
+ and ScrollBar, but plugins will follow).
+
+ This has the side effect that one cannot rely on a defined
+ lifetime of a QWebFrame when using the API.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::~QWebFrame):
+ * Api/qwebpage.cpp:
+ (QWebPage::~QWebPage):
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::detachedFromParent3):
+ (WebCore::FrameLoaderClientQt::detachedFromParent4):
+ (WebCore::FrameLoaderClientQt::frameLoaderDestroyed):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-29 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack.
+
+ Implement more functions
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptConsoleMessage):
+ (QWebPage::statusTextChanged):
+ (QWebPage::runJavaScriptAlert):
+ * Api/qwebpage.h:
+ * Api/qwebpagehistory.cpp:
+ (QWebPageHistory::canGoBack):
+ (QWebPageHistory::canGoForward):
+ * Api/qwebpagehistory.h:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::addMessageToConsole):
+ (WebCore::ChromeClientQt::runJavaScriptAlert):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
+
+2007-01-26 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack.
+
+ Qt implementation.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ (QWebFrame::title):
+ (QWebFrame::selectedText):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::createFrame):
+ (QWebPage::open):
+ (QWebPage::url):
+ (QWebPage::title):
+ (QWebPage::focusFrame):
+ (QWebPage::stop):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::detachFrameLoader):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+ (WebCore::FrameLoaderClientQt::didChangeTitle):
+ (WebCore::FrameLoaderClientQt::setTitle):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-26 Lars Knoll <lars@trolltech.com>
+
+ Make it compile again with Qt 4.2 and add the copyright
+ headers where forgotten in the last submit.
+
+ * Api/qwebpagehistory.cpp:
+ * Api/qwebpagehistory.h:
+ (QExplicitlySharedDataPointer::operator*):
+ (QExplicitlySharedDataPointer::operator->):
+ (QExplicitlySharedDataPointer::operator T *):
+ (QExplicitlySharedDataPointer::operator const T *):
+ (QExplicitlySharedDataPointer::data):
+ (QExplicitlySharedDataPointer::constData):
+ (QExplicitlySharedDataPointer::operator==):
+ (QExplicitlySharedDataPointer::operator!=):
+ (QExplicitlySharedDataPointer::QExplicitlySharedDataPointer):
+ (QExplicitlySharedDataPointer::~QExplicitlySharedDataPointer):
+ (QExplicitlySharedDataPointer::operator=):
+ (QExplicitlySharedDataPointer::operator!):
+ (::QExplicitlySharedDataPointer):
+
+2007-01-26 Zack Rusin <zrusin@trolltech.com>
+
+ Reviewed by Lars
+
+ Implement history support on platform Qt.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::history):
+ (QWebPage::goBack):
+ (QWebPage::goForward):
+ (QWebPage::goToHistoryItem):
+ * Api/qwebpage.h:
+ * Api/qwebpagehistory.cpp: Added.
+ (QWebHistoryItem::~QWebHistoryItem):
+ (QWebHistoryItem::originalUrl):
+ (QWebHistoryItem::currentUrl):
+ (QWebHistoryItem::title):
+ (QWebHistoryItem::lastVisited):
+ (QWebHistoryItem::icon):
+ (QWebHistoryItem::QWebHistoryItem):
+ (QWebPageHistory::QWebPageHistory):
+ (QWebPageHistory::itemAtIndex):
+ (QWebPageHistory::~QWebPageHistory):
+ (QWebPageHistory::items):
+ (QWebPageHistory::backItems):
+ (QWebPageHistory::forwardItems):
+ (QWebPageHistory::goBack):
+ (QWebPageHistory::goForward):
+ (QWebPageHistory::goToItem):
+ (QWebPageHistory::backItem):
+ (QWebPageHistory::currentItem):
+ (QWebPageHistory::forwardItem):
+ * Api/qwebpagehistory.h: Added.
+ * Api/qwebpagehistory_p.h: Added.
+ (QWebHistoryItemPrivate::QWebHistoryItemPrivate):
+ (QWebHistoryItemPrivate::~QWebHistoryItemPrivate):
+ (QWebPageHistoryPrivate::QWebPageHistoryPrivate):
+ (QWebPageHistoryPrivate::~QWebPageHistoryPrivate):
+
+2007-01-26 Lars Knoll <lars@trolltech.com>
+
+ Get rid of FrameQtClient. It's unused since we moved over
+ to the loader.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+
+2007-01-26 Zack Rusin <zack@kde.org>
+
+ Reviewed by Lars
+
+ Correctly position child frames within the
+ toplevel frame. We were placed it on the widget
+ itself instead of the vieweport.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+
+2007-01-26 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Make sure we resize the HTML when resizing a
+ QWebFrame. Also ensure that the render tree
+ is up to date before dumping it.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::innerText):
+ (QWebFrame::renderTreeDump):
+ (QWebFrame::resizeEvent):
+ * Api/qwebframe.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createMainFrame):
+
+2007-01-26 Zack Rusin <zack@kde.org>
+
+ Reviewed by Lars
+
+ Display pages inside a mainwindow instead
+ of a custom qwidget.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (main):
+
+2007-01-25 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Emit the loadDone() signal from teh onload event callback
+ again. This hangs on one or two test cases, but removes
+ hundreds of failures elsewhere.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+
+2007-01-24 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Implement some bits and pieces required by the loader.
+ Fixes quite a few crashes and hangs in the lyout tests
+
+ * Api/qwebframe.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::finishedLoading):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2007-01-24 Lars Knoll <lars@trolltech.com>
+
+ Fix compilation again.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyPress):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-01-23 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Fix refcounting of FrameViews (they get created with a
+ refcount of 1) and add a few safety checks to the
+ FrameLoaderClientQt.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ (QWebFrame::~QWebFrame):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::detachedFromParent3):
+ (WebCore::FrameLoaderClientQt::detachedFromParent4):
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::postProgressStartedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressEstimateChangedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientQt::frameLoaderDestroyed):
+ (WebCore::FrameLoaderClientQt::windowObjectCleared):
+
+2007-01-23 Zack Rusin <zack@kde.org>
+
+ Adjust the DragClientQt to latest changes.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::dragControllerDestroyed):
+ * WebCoreSupport/DragClientQt.h:
+
+2007-01-23 Zack Rusin <zack@kde.org>
+
+ Fix the Qt build
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::willPerformDragDestinationAction):
+ * WebCoreSupport/DragClientQt.h:
+
+2007-01-23 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Maciej
+
+ Add support for Frames to the Qt build and fix some issues
+ in the API classes.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ (QWebFrame::~QWebFrame):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::createFrame):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::detachedFromParent3):
+ (WebCore::FrameLoaderClientQt::detachedFromParent4):
+ (WebCore::FrameLoaderClientQt::cancelPolicyCheck):
+ (WebCore::FrameLoaderClientQt::windowObjectCleared):
+ (WebCore::FrameLoaderClientQt::createFrame):
+ (WebCore::FrameLoaderClientQt::objectContentType):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ (WebCore::FrameLoaderClientQt::redirectDataToPlugin):
+ (WebCore::FrameLoaderClientQt::createJavaAppletWidget):
+ (WebCore::FrameLoaderClientQt::overrideMediaType):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-23 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Adam.
+
+ Qt build stubs for Drop logic
+
+ * WebCoreSupport/DragClientQt.cpp: Added.
+ (WebCore::DragClientQt::actionMaskForDrag):
+ (WebCore::DragClientQt::willPerformDragDestinationAction):
+ * WebCoreSupport/DragClientQt.h: Added.
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::initView):
+
+2007-01-19 John Sullivan <sullivan@apple.com>
+
+ Added stubs for new callbacks, to try to avoid breaking the Qt port.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-19 Anders Carlsson <acarlsson@apple.com>
+
+ Try fixing the QT build.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runJavaScriptAlert):
+ (WebCore::ChromeClientQt::runJavaScriptConfirm):
+ (WebCore::ChromeClientQt::runJavaScriptPrompt):
+ (WebCore::ChromeClientQt::setStatusbarText):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2007-01-18 Zack Rusin <zack@kde.org>
+
+ Reviewed by Lars.
+
+ Implementing a little bit of load progress tracking in the Qt port.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ (QWebFrame::page):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.h:
+ * QtLauncher/main.cpp:
+ (main):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::detachFrameLoader):
+ (WebCore::FrameLoaderClientQt::postProgressStartedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressEstimateChangedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-17 Alice Liu <alice.liu@apple.com>
+
+ Added these stubs to keep the Qt build from failing.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::didSetSelectionTypesForPasteboard):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-01-17 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Remove the inheritance from Shared<XxxClient> in the
+ client classes.
+
+ Answer asynchronously to most of the Policy checking methods
+ in FrameLoaderClientQt to avoid some crashes in the loader.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ * WebCoreSupport/ContextMenuClientQt.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ * WebCoreSupport/EditorClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::callPolicyFunction):
+ (WebCore::FrameLoaderClientQt::slotCallPolicyFunction):
+ (WebCore::FrameLoaderClientQt::cancelPolicyCheck):
+ (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-17 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ change all notImplemented() macros to use qDebug
+ instead of fprintf(stder, ...)
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ * WebCoreSupport/EditorClientQt.cpp:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2007-01-16 Alice Liu <alice.liu@apple.com>
+
+ Added these stubs to keep the Qt build from failing.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::didWriteSelectionToPasteboard):
+ * WebCoreSupport/EditorClientQt.h:
+
+2007-01-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Added the start of a public API to the Qt build
+ of WebKit. Currently we have QWebPage and QWebFrame
+ with a few small methods.
+
+ Converted the QtLauncher to use the new public API.
+
+ * Api/qwebframe.cpp: Added.
+ (QWebFrame::QWebFrame):
+ (QWebFrame::~QWebFrame):
+ (QWebFrame::addToJSWindowObject):
+ (QWebFrame::markup):
+ (QWebFrame::innerText):
+ (QWebFrame::renderTreeDump):
+ * Api/qwebframe.h: Added.
+ * Api/qwebframe_p.h: Added.
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp: Added.
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::QWebPage):
+ (QWebPage::~QWebPage):
+ (QWebPage::createFrame):
+ (QWebPage::open):
+ (QWebPage::mainFrame):
+ (QWebPage::sizeHint):
+ * Api/qwebpage.h: Added.
+ * Api/qwebpage_p.h: Added.
+ * QtLauncher/main.cpp:
+ (main):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::ChromeClientQt):
+ (WebCore::ChromeClientQt::setWindowRect):
+ (WebCore::ChromeClientQt::windowRect):
+ (WebCore::ChromeClientQt::pageRect):
+ (WebCore::ChromeClientQt::focus):
+ (WebCore::ChromeClientQt::unfocus):
+ (WebCore::ChromeClientQt::canTakeFocus):
+ (WebCore::ChromeClientQt::takeFocus):
+ (WebCore::ChromeClientQt::createWindow):
+ (WebCore::ChromeClientQt::createModalDialog):
+ (WebCore::ChromeClientQt::show):
+ (WebCore::ChromeClientQt::addMessageToConsole):
+ (WebCore::ChromeClientQt::chromeDestroyed):
+ (WebCore::ChromeClientQt::canRunBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::closeWindowSoon):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::detachFrameLoader):
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::partClearedInBegin):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-15 Anders Carlsson <acarlsson@apple.com>
+
+ Fix build.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::postProgressStartedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressEstimateChangedNotification):
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-13 Lars Knoll <lars@trolltech.com>
+
+ Compile again after yesterdays changes.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::assignIdentifierToInitialRequest):
+ (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveAuthenticationChallenge):
+ (WebCore::FrameLoaderClientQt::dispatchDidCancelAuthenticationChallenge):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveContentLength):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientQt::incrementProgress):
+ (WebCore::FrameLoaderClientQt::completeProgress):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-11 Brady Eidson <beidson@apple.com>
+
+ Keep the fancy new FrameLoaderClientQt building with a small api change in WebCore
+ Yay for the loader on QT!
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveAuthenticationChallenge):
+ (WebCore::FrameLoaderClientQt::dispatchDidCancelAuthenticationChallenge):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-11 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Darin
+
+ Start using the loader in the Qt port.
+
+ * QtLauncher/main.cpp:
+ (main):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::~FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::detachFrameLoader):
+ (WebCore::FrameLoaderClientQt::makeDocumentView):
+ (WebCore::FrameLoaderClientQt::makeRepresentation):
+ (WebCore::FrameLoaderClientQt::setCopiesOnScroll):
+ (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::cancelPolicyCheck):
+ (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm):
+ (WebCore::FrameLoaderClientQt::progressStarted):
+ (WebCore::FrameLoaderClientQt::progressCompleted):
+ (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady):
+ (WebCore::FrameLoaderClientQt::clearArchivedResources):
+ (WebCore::FrameLoaderClientQt::canShowMIMEType):
+ (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
+ (WebCore::FrameLoaderClientQt::provisionalLoadStarted):
+ (WebCore::FrameLoaderClientQt::prepareForDataSourceReplacement):
+ (WebCore::FrameLoaderClientQt::frameLoaderDestroyed):
+ (WebCore::FrameLoaderClientQt::canHandleRequest):
+ (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
+ (WebCore::FrameLoaderClientQt::canCachePage):
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::cancelledError):
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientQt::shouldFallBack):
+ (WebCore::FrameLoaderClientQt::createDocumentLoader):
+ (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientQt::willUseArchive):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-11 George Staikos <staikos@kde.org>
+
+ Fix Qt Build.
+
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ (WebCore::ContextMenuClientQt::searchWithGoogle):
+ * WebCoreSupport/ContextMenuClientQt.h:
+
+2007-01-06 George Staikos <staikos@kde.org>
+
+ Reviewed by Brady.
+
+ Make it link.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::cancelledError):
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientQt::shouldFallBack):
+ (WebCore::FrameLoaderClientQt::createDocumentLoader):
+ (WebCore::FrameLoaderClientQt::download):
+ (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveContentLength):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+ (WebCore::FrameLoaderClientQt::dispatchCreatePage):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientQt::dispatchUnableToImplementPolicy):
+ (WebCore::FrameLoaderClientQt::incrementProgress):
+ (WebCore::FrameLoaderClientQt::completeProgress):
+ (WebCore::FrameLoaderClientQt::startDownload):
+ (WebCore::FrameLoaderClientQt::willUseArchive):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2007-01-05 Lars Knoll <lars@trolltech.com>
+
+ Make the Qt build compile again
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::canTakeFocus):
+ (WebCore::ChromeClientQt::takeFocus):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ (WebCore::ContextMenuClientQt::getCustomMenuFromDefaultItems):
+ * WebCoreSupport/ContextMenuClientQt.h:
+
+2007-01-03 Lars Knoll <lars@trolltech.com>
+
+ Fix the Qt build
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setDocumentViewFromPageCache):
+ (WebCore::FrameLoaderClientQt::updateGlobalHistoryForStandardLoad):
+ (WebCore::FrameLoaderClientQt::updateGlobalHistoryForReload):
+ (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
+ (WebCore::FrameLoaderClientQt::saveScrollPositionAndViewStateToItem):
+ (WebCore::FrameLoaderClientQt::saveDocumentViewToPageCache):
+ (WebCore::FrameLoaderClientQt::canCachePage):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2006-12-29 George Staikos <staikos@kde.org>
+
+ Add missing notimplemented.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::frameLoaderDestroyed):
+ (WebCore::FrameLoaderClientQt::canHandleRequest):
+ (WebCore::FrameLoaderClientQt::partClearedInBegin):
+
+2006-12-21 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::hasWebView):
+ (WebCore::FrameLoaderClientQt::hasFrameView):
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+ (WebCore::FrameLoaderClientQt::setTitle):
+ (WebCore::FrameLoaderClientQt::partClearedInBegin):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ Remove some runtimw warnings
+ Add partClearedInBegin forwarding call, so
+ I can catch this in the layout tests.
+
+2006-12-19 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Rob.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::canRunBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::closeWindowSoon):
+ * WebCoreSupport/ChromeClientQt.h:
+ Make it compile.
+
+2006-12-16 Zack Rusin <zack@kde.org>
+
+ Adjust the client to the most recent interface.
+
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ (WebCore::ContextMenuClientQt::contextMenuDestroyed):
+ (WebCore::ContextMenuClientQt::addCustomContextMenuItems):
+ (WebCore::ContextMenuClientQt::contextMenuItemSelected):
+ (WebCore::ContextMenuClientQt::downloadURL):
+ (WebCore::ContextMenuClientQt::copyImageToClipboard):
+ (WebCore::ContextMenuClientQt::lookUpInDictionary):
+ * WebCoreSupport/ContextMenuClientQt.h:
+
+2006-12-14 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ * QtLauncher/QtLauncher.pro: Link this little test program
+ with rpath, for convenience. (This is never going to get installed
+ anyway)
+
+2006-12-12 George Staikos <staikos@kde.org>
+
+ Reviewed by Alexey.
+
+ Fix the Qt build again.
+
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ (WebCore::ContextMenuClientQt::speak):
+ (WebCore::ContextMenuClientQt::stopSpeaking):
+ * WebCoreSupport/ContextMenuClientQt.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::toggleContinuousSpellChecking):
+ (WebCore::EditorClientQt::toggleGrammarChecking):
+ * WebCoreSupport/EditorClientQt.h:
+
+2006-12-10 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack.
+
+ Add a default user agent for now.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::userAgent):
+
+2006-12-10 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Comment out a notImplemented() warning
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::clearUndoRedoOperations):
+
+2006-12-10 Zack Rusin <zack@kde.org>
+
+ Print out the method name if it's unimplemented.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2006-12-10 Zack Rusin <zack@kde.org>
+
+ Moving the clients from platform to their final location.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp: Added.
+ * WebCoreSupport/FrameLoaderClientQt.h: Added.
+ * WebCoreSupport/ChromeClientQt.cpp: Added.
+ * WebCoreSupport/ChromeClientQt.h: Added.
+ * WebCoreSupport/ContextMenuClientQt.cpp: Added.
+ * WebCoreSupport/ContextMenuClientQt.h: Added.
+ * WebCoreSupport/EditorClientQt.cpp: Added.
+ * WebCoreSupport/EditorClientQt.h: Added.
+
+2006-12-10 Zack Rusin <zack@kde.org>
+
+ Adjusting to the changes in platform/qt.
+
+ * QtLauncher/main.cpp:
+ (main):
+
+2006-12-09 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Make it possible to build WebKit with qmake.
+
+ * QtLauncher/QtLauncher.pro: Added.
+ * QtLauncher/main.cpp:
+
+2006-12-08 Zack Rusin <zack@kde.org>
+
+ Reviewed by Maciej.
+
+ Fix the build after the recent changes.
+
+ * QtLauncher/main.cpp:
+ (main):
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::initView):
+
+2006-11-19 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Zack.
+
+ http://bugs.webkit.org/show_bug.cgi?id=11649
+ Fix Qt-only build
+
+ * QtLauncher/CMakeLists.txt:
+
+2006-11-17 Zack Rusin <zack@kde.org>
+
+ Reviewed by Mitz. Landed by Niko.
+
+ Adjusting to the new api.
+
+ * QtLauncher/main.cpp:
+ (main):
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::initView):
+
+2006-11-10 Zack Rusin <zack@kde.org>
+
+ Reviewed and landed by Anders.
+
+ Adjusting to the recent loader changes, making it compile
+ and work.
+
+ * QtLauncher/main.cpp:
+ (main):
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::closeUrl):
+ (WebKitPart::initView):
+
+2006-11-03 Zack Rusin <zack@kde.org>
+
+ Reviewed by Maciej.
+
+ Fixing compile on both Qt and KDE platforms.
+
+ * QtLauncher/main.cpp:
+ (main): url has already been defined
+ * WebKitPart/WebKitPartBrowserExtension.cpp: removing
+ duplicate implementation of this class
+
+2006-10-31 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Maciej, landed by Anders.
+
+ * QtLauncher/CMakeLists.txt: Make linkage against kde libraries
+ optional
+ * QtLauncher/main.cpp: Make it compile without KDE.
+ (main):
+
+2006-11-02 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Maciej, landed by Anders.
+
+ * QtLauncher/main.cpp:
+ (main): Declare our frame as main frame to the Page object.
+ Fixes crashes on various web sites
+
+2006-10-31 Zack Rusin <zack@kde.org>
+
+ Reviewed by Mitz.
+
+ Fix the Qt build after last nights changes.
+
+ * QtLauncher/CMakeLists.txt:
+ * WebKitPart/CMakeLists.txt:
+
+2006-10-26 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed by Darin Adler.
+
+ Fix Qt/Linux build.
+
+ * QtLauncher/main.cpp:
+ (main):
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::openUrl):
+
+2006-10-24 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed by Maciej.
+
+ Fix Qt/Linux build.
+
+ - Remove BrowserExtensionQt, move it's methods to Page/FrameQt.
+ - Fix CMakeLists.txt to include platform/network.
+
+ * QtLauncher/CMakeLists.txt:
+ * WebKitPart/CMakeLists.txt:
+
+2006-10-24 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Darin Adler.
+
+ * QtLauncher/CMakeLists.txt, WebKitPart/CMakeLists.txt: Added project name to
+ kde4_automoc macro, as required by the latest KDE4 cmake module.
+
+2006-10-20 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed and landed by Anders.
+
+ Adapt to FrameQtClient changes, and provide some kind of status
+ information to the KPart wheter we're loading or not (started/completed signaling).
+
+ * WebKitPart/CMakeLists.txt:
+ * WebKitPart/WebKitPart.cpp:
+ (WebKitPart::WebKitPart):
+ (WebKitPart::~WebKitPart):
+ (WebKitPart::openUrl):
+ (WebKitPart::initView):
+ * WebKitPart/WebKitPart.h:
+ * WebKitPart/WebKitPartBrowserExtension.cpp: Added.
+ (WebKitPartBrowserExtension::WebKitPartBrowserExtension):
+ (WebKitPartBrowserExtension::~WebKitPartBrowserExtension):
+ * WebKitPart/WebKitPartBrowserExtension.h: Added.
+ * WebKitPart/WebKitPartClient.cpp:
+ (WebKitPartClient::WebKitPartClient):
+ (WebKitPartClient::loadFinished):
+ * WebKitPart/WebKitPartClient.h:
+ * WebKitPart/WebKitPartInterface.h:
+
+2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed by eseidel. Landed by eseidel.
+
+ Fix last remaining issue Qt/Linux build with gcc3.
+
+ * WebKitPart/WebKitPart.h: Remove Q_PROPERTY usage, which is not needed and made problems.
+
+2006-09-10 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed and landed by ap.
+
+ Fix QtLauncher - it is supposed to create a FrameView on its own nowadays.
+
+ * QtLauncher/main.cpp:
+ (main):
+
+2006-09-04 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed by Tim H.
+
+ Fixes last part of: http://bugs.webkit.org/show_bug.cgi?id=10644
+ Move QtLauncher down to WebKitQt.
+
+ * QtLauncher/CMakeLists.txt: Added.
+ * QtLauncher/main.cpp: Added.
+ (main):
+
+2006-09-04 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed by Darin Adler. Final polish by Sam.
+
+ Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10644
+ Add WebKitPart, an embeddable KPart for the KDE platform.
+
+ * WebKitPart/CMakeLists.txt: Added.
+ * WebKitPart/WebKitFactory.cpp: Added.
+ (WebKitFactory::WebKitFactory):
+ (WebKitFactory::~WebKitFactory):
+ (WebKitFactory::createPartObject):
+ (WebKitFactory::instance):
+ (WebKitFactory::ref):
+ (WebKitFactory::deref):
+ (init_libWebKitPart):
+ * WebKitPart/WebKitFactory.h: Added.
+ * WebKitPart/WebKitPart.cpp: Added.
+ (WebKitPart::WebKitPart):
+ (WebKitPart::~WebKitPart):
+ (WebKitPart::openFile):
+ (WebKitPart::openUrl):
+ (WebKitPart::closeUrl):
+ (WebKitPart::parentPart):
+ (WebKitPart::frame):
+ (WebKitPart::initView):
+ * WebKitPart/WebKitPart.desktop: Added.
+ * WebKitPart/WebKitPart.h: Added.
+ (WebKitPart::):
+ * WebKitPart/WebKitPart.rc: Added.
+ * WebKitPart/WebKitPartBrowser.rc: Added.
+ * WebKitPart/WebKitPartClient.cpp: Added.
+ (WebKitPartClient::WebKitPartClient):
+ (WebKitPartClient::~WebKitPartClient):
+ * WebKitPart/WebKitPartClient.h: Added.
+ * WebKitPart/WebKitPartInterface.cpp: Added.
+ (WebKitPartInterface::WebKitPartInterface):
+ (WebKitPartInterface::~WebKitPartInterface):
+ (WebKitPartInterface::url):
+ (WebKitPartInterface::closeURL):
+ * WebKitPart/WebKitPartInterface.h: Added.
+ * WebKitPart/org.kde.WebKitPart.xml: Added.
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp
new file mode 100644
index 0000000..44f3d44
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp
@@ -0,0 +1,459 @@
+/*
+ * kimgio import filter for MS Windows .ico files
+ *
+ * Distributed under the terms of the LGPL
+ * Copyright (c) 2000 Malte Starostik <malte@kde.org>
+ *
+ */
+
+#include "ICOHandler.h"
+
+#include <cstring>
+#include <cstdlib>
+#include <algorithm>
+#include <vector>
+
+#include <QtGui/QImage>
+#include <QtGui/QBitmap>
+#include <QtGui/QApplication>
+#include <QtCore/QVector>
+#include <QtGui/QDesktopWidget>
+
+namespace
+{
+ // Global header (see http://www.daubnet.com/formats/ICO.html)
+ struct IcoHeader
+ {
+ enum Type { Icon = 1, Cursor };
+ quint16 reserved;
+ quint16 type;
+ quint16 count;
+ };
+
+ inline QDataStream& operator >>( QDataStream& s, IcoHeader& h )
+ {
+ return s >> h.reserved >> h.type >> h.count;
+ }
+
+ // Based on qt_read_dib et al. from qimage.cpp
+ // (c) 1992-2002 Nokia Corporation and/or its subsidiary(-ies).
+ struct BMP_INFOHDR
+ {
+ static const quint32 Size = 40;
+ quint32 biSize; // size of this struct
+ quint32 biWidth; // pixmap width
+ quint32 biHeight; // pixmap height
+ quint16 biPlanes; // should be 1
+ quint16 biBitCount; // number of bits per pixel
+ enum Compression { RGB = 0 };
+ quint32 biCompression; // compression method
+ quint32 biSizeImage; // size of image
+ quint32 biXPelsPerMeter; // horizontal resolution
+ quint32 biYPelsPerMeter; // vertical resolution
+ quint32 biClrUsed; // number of colors used
+ quint32 biClrImportant; // number of important colors
+ };
+ const quint32 BMP_INFOHDR::Size;
+
+ QDataStream& operator >>( QDataStream &s, BMP_INFOHDR &bi )
+ {
+ s >> bi.biSize;
+ if ( bi.biSize == BMP_INFOHDR::Size )
+ {
+ s >> bi.biWidth >> bi.biHeight >> bi.biPlanes >> bi.biBitCount;
+ s >> bi.biCompression >> bi.biSizeImage;
+ s >> bi.biXPelsPerMeter >> bi.biYPelsPerMeter;
+ s >> bi.biClrUsed >> bi.biClrImportant;
+ }
+ return s;
+ }
+
+#if 0
+ QDataStream &operator<<( QDataStream &s, const BMP_INFOHDR &bi )
+ {
+ s << bi.biSize;
+ s << bi.biWidth << bi.biHeight;
+ s << bi.biPlanes;
+ s << bi.biBitCount;
+ s << bi.biCompression;
+ s << bi.biSizeImage;
+ s << bi.biXPelsPerMeter << bi.biYPelsPerMeter;
+ s << bi.biClrUsed << bi.biClrImportant;
+ return s;
+ }
+#endif
+
+ // Header for every icon in the file
+ struct IconRec
+ {
+ unsigned char width;
+ unsigned char height;
+ quint16 colors;
+ quint16 hotspotX;
+ quint16 hotspotY;
+ quint32 size;
+ quint32 offset;
+ };
+
+ inline QDataStream& operator >>( QDataStream& s, IconRec& r )
+ {
+ return s >> r.width >> r.height >> r.colors
+ >> r.hotspotX >> r.hotspotY >> r.size >> r.offset;
+ }
+
+ struct LessDifference
+ {
+ LessDifference( unsigned s, unsigned c )
+ : size( s ), colors( c ) {}
+
+ bool operator ()( const IconRec& lhs, const IconRec& rhs ) const
+ {
+ // closest size match precedes everything else
+ if ( std::abs( int( lhs.width - size ) ) <
+ std::abs( int( rhs.width - size ) ) ) return true;
+ else if ( std::abs( int( lhs.width - size ) ) >
+ std::abs( int( rhs.width - size ) ) ) return false;
+ else if ( colors == 0 )
+ {
+ // high/true color requested
+ if ( lhs.colors == 0 ) return true;
+ else if ( rhs.colors == 0 ) return false;
+ else return lhs.colors > rhs.colors;
+ }
+ else
+ {
+ // indexed icon requested
+ if ( lhs.colors == 0 && rhs.colors == 0 ) return false;
+ else if ( lhs.colors == 0 ) return false;
+ else return std::abs( int( lhs.colors - colors ) ) <
+ std::abs( int( rhs.colors - colors ) );
+ }
+ }
+ unsigned size;
+ unsigned colors;
+ };
+
+ bool loadFromDIB( QDataStream& stream, const IconRec& rec, QImage& icon )
+ {
+ BMP_INFOHDR header;
+ stream >> header;
+ if ( stream.atEnd() || header.biSize != BMP_INFOHDR::Size ||
+ header.biSize > rec.size ||
+ header.biCompression != BMP_INFOHDR::RGB ||
+ ( header.biBitCount != 1 && header.biBitCount != 4 &&
+ header.biBitCount != 8 && header.biBitCount != 24 &&
+ header.biBitCount != 32 ) ) return false;
+
+ unsigned paletteSize, paletteEntries;
+
+ if (header.biBitCount > 8)
+ {
+ paletteEntries = 0;
+ paletteSize = 0;
+ }
+ else
+ {
+ paletteSize = (1 << header.biBitCount);
+ paletteEntries = paletteSize;
+ if (header.biClrUsed && header.biClrUsed < paletteSize)
+ paletteEntries = header.biClrUsed;
+ }
+
+ // Always create a 32-bit image to get the mask right
+ // Note: this is safe as rec.width, rec.height are bytes
+ icon = QImage( rec.width, rec.height, QImage::Format_ARGB32 );
+ if ( icon.isNull() ) return false;
+
+ QVector< QRgb > colorTable( paletteSize );
+
+ colorTable.fill( QRgb( 0 ) );
+ for ( unsigned i = 0; i < paletteEntries; ++i )
+ {
+ unsigned char rgb[ 4 ];
+ stream.readRawData( reinterpret_cast< char* >( &rgb ),
+ sizeof( rgb ) );
+ colorTable[ i ] = qRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] );
+ }
+
+ unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4;
+
+ unsigned char* buf = new unsigned char[ bpl ];
+ for ( unsigned y = rec.height; !stream.atEnd() && y--; )
+ {
+ stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
+ unsigned char* pixel = buf;
+ QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) );
+ switch ( header.biBitCount )
+ {
+ case 1:
+ for ( unsigned x = 0; x < rec.width; ++x )
+ *p++ = colorTable[
+ ( pixel[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ];
+ break;
+ case 4:
+ for ( unsigned x = 0; x < rec.width; ++x )
+ if ( x & 1 ) *p++ = colorTable[ pixel[ x / 2 ] & 0x0f ];
+ else *p++ = colorTable[ pixel[ x / 2 ] >> 4 ];
+ break;
+ case 8:
+ for ( unsigned x = 0; x < rec.width; ++x )
+ *p++ = colorTable[ pixel[ x ] ];
+ break;
+ case 24:
+ for ( unsigned x = 0; x < rec.width; ++x )
+ *p++ = qRgb( pixel[ 3 * x + 2 ],
+ pixel[ 3 * x + 1 ],
+ pixel[ 3 * x ] );
+ break;
+ case 32:
+ for ( unsigned x = 0; x < rec.width; ++x )
+ *p++ = qRgba( pixel[ 4 * x + 2 ],
+ pixel[ 4 * x + 1 ],
+ pixel[ 4 * x ],
+ pixel[ 4 * x + 3] );
+ break;
+ }
+ }
+ delete[] buf;
+
+ if ( header.biBitCount < 32 )
+ {
+ // Traditional 1-bit mask
+ bpl = ( rec.width + 31 ) / 32 * 4;
+ buf = new unsigned char[ bpl ];
+ for ( unsigned y = rec.height; y--; )
+ {
+ stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
+ QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) );
+ for ( unsigned x = 0; x < rec.width; ++x, ++p )
+ if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) )
+ *p &= RGB_MASK;
+ }
+ delete[] buf;
+ }
+ return true;
+ }
+}
+
+ICOHandler::ICOHandler()
+{
+}
+
+bool ICOHandler::canRead() const
+{
+ return canRead(device());
+}
+
+bool ICOHandler::read(QImage *outImage)
+{
+
+ qint64 offset = device()->pos();
+
+ QDataStream stream( device() );
+ stream.setByteOrder( QDataStream::LittleEndian );
+ IcoHeader header;
+ stream >> header;
+ if ( stream.atEnd() || !header.count ||
+ ( header.type != IcoHeader::Icon && header.type != IcoHeader::Cursor) )
+ return false;
+
+ unsigned requestedSize = 32;
+ unsigned requestedColors = QApplication::desktop()->depth() > 8 ? 0 : QApplication::desktop()->depth();
+ int requestedIndex = -1;
+#if 0
+ if ( io->parameters() )
+ {
+ QStringList params = QString(io->parameters()).split( ';', QString::SkipEmptyParts );
+ QMap< QString, QString > options;
+ for ( QStringList::ConstIterator it = params.begin();
+ it != params.end(); ++it )
+ {
+ QStringList tmp = (*it).split( '=', QString::SkipEmptyParts );
+ if ( tmp.count() == 2 ) options[ tmp[ 0 ] ] = tmp[ 1 ];
+ }
+ if ( options[ "index" ].toUInt() )
+ requestedIndex = options[ "index" ].toUInt();
+ if ( options[ "size" ].toUInt() )
+ requestedSize = options[ "size" ].toUInt();
+ if ( options[ "colors" ].toUInt() )
+ requestedColors = options[ "colors" ].toUInt();
+ }
+#endif
+
+ typedef std::vector< IconRec > IconList;
+ IconList icons;
+ for ( unsigned i = 0; i < header.count; ++i )
+ {
+ if ( stream.atEnd() )
+ return false;
+ IconRec rec;
+ stream >> rec;
+ icons.push_back( rec );
+ }
+ IconList::const_iterator selected;
+ if (requestedIndex >= 0) {
+ selected = std::min( icons.begin() + requestedIndex, icons.end() );
+ } else {
+ selected = std::min_element( icons.begin(), icons.end(),
+ LessDifference( requestedSize, requestedColors ) );
+ }
+ if ( stream.atEnd() || selected == icons.end() ||
+ offset + selected->offset > device()->size() )
+ return false;
+
+ device()->seek( offset + selected->offset );
+ QImage icon;
+ if ( loadFromDIB( stream, *selected, icon ) )
+ {
+#ifndef QT_NO_IMAGE_TEXT
+ icon.setText( "X-Index", 0, QString::number( selected - icons.begin() ) );
+ if ( header.type == IcoHeader::Cursor )
+ {
+ icon.setText( "X-HotspotX", 0, QString::number( selected->hotspotX ) );
+ icon.setText( "X-HotspotY", 0, QString::number( selected->hotspotY ) );
+ }
+#endif
+ *outImage = icon;
+ return true;
+ }
+ return false;
+}
+
+bool ICOHandler::write(const QImage &/*image*/)
+{
+#if 0
+ if (image.isNull())
+ return;
+
+ QByteArray dibData;
+ QDataStream dib(dibData, QIODevice::ReadWrite);
+ dib.setByteOrder(QDataStream::LittleEndian);
+
+ QImage pixels = image;
+ QImage mask;
+ if (io->image().hasAlphaBuffer())
+ mask = image.createAlphaMask();
+ else
+ mask = image.createHeuristicMask();
+ mask.invertPixels();
+ for ( int y = 0; y < pixels.height(); ++y )
+ for ( int x = 0; x < pixels.width(); ++x )
+ if ( mask.pixel( x, y ) == 0 ) pixels.setPixel( x, y, 0 );
+
+ if (!qt_write_dib(dib, pixels))
+ return;
+
+ uint hdrPos = dib.device()->at();
+ if (!qt_write_dib(dib, mask))
+ return;
+ memmove(dibData.data() + hdrPos, dibData.data() + hdrPos + BMP_WIN + 8, dibData.size() - hdrPos - BMP_WIN - 8);
+ dibData.resize(dibData.size() - BMP_WIN - 8);
+
+ QDataStream ico(device());
+ ico.setByteOrder(QDataStream::LittleEndian);
+ IcoHeader hdr;
+ hdr.reserved = 0;
+ hdr.type = Icon;
+ hdr.count = 1;
+ ico << hdr.reserved << hdr.type << hdr.count;
+ IconRec rec;
+ rec.width = image.width();
+ rec.height = image.height();
+ if (image.numColors() <= 16)
+ rec.colors = 16;
+ else if (image.depth() <= 8)
+ rec.colors = 256;
+ else
+ rec.colors = 0;
+ rec.hotspotX = 0;
+ rec.hotspotY = 0;
+ rec.dibSize = dibData.size();
+ ico << rec.width << rec.height << rec.colors
+ << rec.hotspotX << rec.hotspotY << rec.dibSize;
+ rec.dibOffset = ico.device()->at() + sizeof(rec.dibOffset);
+ ico << rec.dibOffset;
+
+ BMP_INFOHDR dibHeader;
+ dib.device()->at(0);
+ dib >> dibHeader;
+ dibHeader.biHeight = image.height() << 1;
+ dib.device()->at(0);
+ dib << dibHeader;
+
+ ico.writeRawBytes(dibData.data(), dibData.size());
+ return true;
+#endif
+ return false;
+}
+
+QByteArray ICOHandler::name() const
+{
+ return "ico";
+}
+
+bool ICOHandler::canRead(QIODevice *device)
+{
+ if (!device) {
+ qWarning("ICOHandler::canRead() called with no device");
+ return false;
+ }
+
+ const qint64 oldPos = device->pos();
+
+ char head[8];
+ qint64 readBytes = device->read(head, sizeof(head));
+ const bool readOk = readBytes == sizeof(head);
+
+ if (device->isSequential()) {
+ while (readBytes > 0)
+ device->ungetChar(head[readBytes-- - 1]);
+ } else {
+ device->seek(oldPos);
+ }
+
+ if ( !readOk )
+ return false;
+
+ return head[2] == '\001' && head[3] == '\000' && // type should be 1
+ ( head[6] == 16 || head[6] == 32 || head[6] == 64 ) && // width can only be one of those
+ ( head[7] == 16 || head[7] == 32 || head[7] == 64 ); // same for height
+}
+
+class ICOPlugin : public QImageIOPlugin
+{
+public:
+ QStringList keys() const;
+ Capabilities capabilities(QIODevice *device, const QByteArray &format) const;
+ QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const;
+};
+
+QStringList ICOPlugin::keys() const
+{
+ return QStringList() << "ico" << "ICO";
+}
+
+QImageIOPlugin::Capabilities ICOPlugin::capabilities(QIODevice *device, const QByteArray &format) const
+{
+ if (format == "ico" || format == "ICO")
+ return Capabilities(CanRead);
+ if (!format.isEmpty())
+ return 0;
+ if (!device->isOpen())
+ return 0;
+
+ Capabilities cap;
+ if (device->isReadable() && ICOHandler::canRead(device))
+ cap |= CanRead;
+ return cap;
+}
+
+QImageIOHandler *ICOPlugin::create(QIODevice *device, const QByteArray &format) const
+{
+ QImageIOHandler *handler = new ICOHandler;
+ handler->setDevice(device);
+ handler->setFormat(format);
+ return handler;
+}
+
+Q_EXPORT_STATIC_PLUGIN(ICOPlugin)
+Q_EXPORT_PLUGIN2(qtwebico, ICOPlugin)
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h
new file mode 100644
index 0000000..4f1f1d6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h
@@ -0,0 +1,52 @@
+/*
+ * ico.h - kimgio import filter for MS Windows .ico files
+ *
+ * Distributed under the terms of the LGPL
+ * Copyright (c) 2000 Malte Starostik <malte@kde.org>
+ *
+ */
+
+// You can use QImageIO::setParameters() to request a specific
+// Icon out of an .ico file:
+//
+// Options consist of a name=value pair and are separated by a semicolon.
+// Available options are:
+// size=<size> select the icon that most closely matches <size> (pixels)
+// default: 32
+// colors=<num> select the icon that has <num> colors (or comes closest)
+// default: 1 << display depth or 0 (RGB) if display depth > 8
+// index=<index> select the indexth icon from the file. If this option
+// is present, the size and colors options will be ignored.
+// default: none
+// If both size and colors are given, size takes precedence.
+//
+// The old format is still supported:
+// the parameters consist of a single string in the form
+// "<size>[:<colors>]" which correspond to the options above
+//
+// If an icon was returned (i.e. the file is valid and the index option
+// if present was not out of range), the icon's index within the .ico
+// file is returned in the text tag "X-Index" of the image.
+// If the icon is in fact a cursor, its hotspot coordinates are returned
+// in the text tags "X-HotspotX" and "X-HotspotY".
+
+#ifndef _ICOHANDLER_H_
+#define _ICOHANDLER_H_
+
+#include <QtGui/QImageIOPlugin>
+
+class ICOHandler : public QImageIOHandler
+{
+public:
+ ICOHandler();
+
+ bool canRead() const;
+ bool read(QImage *image);
+ bool write(const QImage &image);
+
+ QByteArray name() const;
+
+ static bool canRead(QIODevice *device);
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro b/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro
new file mode 100644
index 0000000..a9b4f82
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro
@@ -0,0 +1,14 @@
+TEMPLATE = lib
+TARGET = qtwebico
+CONFIG += plugin
+HEADERS += ICOHandler.h
+SOURCES += ICOHandler.cpp
+
+include(../../WebKit.pri)
+
+contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
+unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
+
+target.path = $$[QT_INSTALL_PLUGINS]/imageformats
+INSTALLS += target
+
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
new file mode 100644
index 0000000..19b629d
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -0,0 +1,431 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "ChromeClientQt.h"
+
+#include "FileChooser.h"
+#include "Frame.h"
+#include "FrameLoadRequest.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClientQt.h"
+#include "FrameView.h"
+#include "HitTestResult.h"
+#include "NotImplemented.h"
+#include "WindowFeatures.h"
+#include "DatabaseTracker.h"
+#include "SecurityOrigin.h"
+
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include "qwebframe_p.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.h"
+
+#include <qtooltip.h>
+#include <qtextdocument.h>
+
+namespace WebCore
+{
+
+
+ChromeClientQt::ChromeClientQt(QWebPage* webPage)
+ : m_webPage(webPage)
+{
+ toolBarsVisible = statusBarVisible = menuBarVisible = true;
+}
+
+ChromeClientQt::~ChromeClientQt()
+{
+
+}
+
+void ChromeClientQt::setWindowRect(const FloatRect& rect)
+{
+ if (!m_webPage)
+ return;
+ emit m_webPage->geometryChangeRequested(QRect(qRound(rect.x()), qRound(rect.y()),
+ qRound(rect.width()), qRound(rect.height())));
+}
+
+
+FloatRect ChromeClientQt::windowRect()
+{
+ if (!m_webPage)
+ return FloatRect();
+
+ QWidget* view = m_webPage->view();
+ if (!view)
+ return FloatRect();
+ return IntRect(view->topLevelWidget()->geometry());
+}
+
+
+FloatRect ChromeClientQt::pageRect()
+{
+ if (!m_webPage)
+ return FloatRect();
+ return FloatRect(QRectF(QPointF(0,0), m_webPage->viewportSize()));
+}
+
+
+float ChromeClientQt::scaleFactor()
+{
+ notImplemented();
+ return 1;
+}
+
+
+void ChromeClientQt::focus()
+{
+ if (!m_webPage)
+ return;
+ QWidget* view = m_webPage->view();
+ if (!view)
+ return;
+
+ view->setFocus();
+}
+
+
+void ChromeClientQt::unfocus()
+{
+ if (!m_webPage)
+ return;
+ QWidget* view = m_webPage->view();
+ if (!view)
+ return;
+ view->clearFocus();
+}
+
+bool ChromeClientQt::canTakeFocus(FocusDirection)
+{
+ // This is called when cycling through links/focusable objects and we
+ // reach the last focusable object. Then we want to claim that we can
+ // take the focus to avoid wrapping.
+ return true;
+}
+
+void ChromeClientQt::takeFocus(FocusDirection)
+{
+ // don't do anything. This is only called when cycling to links/focusable objects,
+ // which in turn is called from focusNextPrevChild. We let focusNextPrevChild
+ // call QWidget::focusNextPrevChild accordingly, so there is no need to do anything
+ // here.
+}
+
+
+Page* ChromeClientQt::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
+{
+ QWebPage *newPage = m_webPage->createWindow(features.dialog ? QWebPage::WebModalDialog : QWebPage::WebBrowserWindow);
+ if (!newPage)
+ return 0;
+ newPage->mainFrame()->load(request.resourceRequest().url());
+ return newPage->d->page;
+}
+
+void ChromeClientQt::show()
+{
+ if (!m_webPage)
+ return;
+ QWidget* view = m_webPage->view();
+ if (!view)
+ return;
+ view->topLevelWidget()->show();
+}
+
+
+bool ChromeClientQt::canRunModal()
+{
+ notImplemented();
+ return false;
+}
+
+
+void ChromeClientQt::runModal()
+{
+ notImplemented();
+}
+
+
+void ChromeClientQt::setToolbarsVisible(bool visible)
+{
+ toolBarsVisible = visible;
+ emit m_webPage->toolBarVisibilityChangeRequested(visible);
+}
+
+
+bool ChromeClientQt::toolbarsVisible()
+{
+ return toolBarsVisible;
+}
+
+
+void ChromeClientQt::setStatusbarVisible(bool visible)
+{
+ emit m_webPage->statusBarVisibilityChangeRequested(visible);
+ statusBarVisible = visible;
+}
+
+
+bool ChromeClientQt::statusbarVisible()
+{
+ return statusBarVisible;
+ return false;
+}
+
+
+void ChromeClientQt::setScrollbarsVisible(bool)
+{
+ notImplemented();
+}
+
+
+bool ChromeClientQt::scrollbarsVisible()
+{
+ notImplemented();
+ return true;
+}
+
+
+void ChromeClientQt::setMenubarVisible(bool visible)
+{
+ menuBarVisible = visible;
+ emit m_webPage->menuBarVisibilityChangeRequested(visible);
+}
+
+bool ChromeClientQt::menubarVisible()
+{
+ return menuBarVisible;
+}
+
+void ChromeClientQt::setResizable(bool)
+{
+ notImplemented();
+}
+
+void ChromeClientQt::addMessageToConsole(const String& message, unsigned int lineNumber,
+ const String& sourceID)
+{
+ QString x = message;
+ QString y = sourceID;
+ m_webPage->javaScriptConsoleMessage(x, lineNumber, y);
+}
+
+void ChromeClientQt::chromeDestroyed()
+{
+ delete this;
+}
+
+bool ChromeClientQt::canRunBeforeUnloadConfirmPanel()
+{
+ return true;
+}
+
+bool ChromeClientQt::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
+{
+ return runJavaScriptConfirm(frame, message);
+}
+
+void ChromeClientQt::closeWindowSoon()
+{
+ m_webPage->mainFrame()->d->frame->loader()->stopAllLoaders();
+ emit m_webPage->windowCloseRequested();
+}
+
+void ChromeClientQt::runJavaScriptAlert(Frame* f, const String& msg)
+{
+ QString x = msg;
+ FrameLoaderClientQt *fl = static_cast<FrameLoaderClientQt*>(f->loader()->client());
+ m_webPage->javaScriptAlert(fl->webFrame(), x);
+}
+
+bool ChromeClientQt::runJavaScriptConfirm(Frame* f, const String& msg)
+{
+ QString x = msg;
+ FrameLoaderClientQt *fl = static_cast<FrameLoaderClientQt*>(f->loader()->client());
+ return m_webPage->javaScriptConfirm(fl->webFrame(), x);
+}
+
+bool ChromeClientQt::runJavaScriptPrompt(Frame* f, const String& message, const String& defaultValue, String& result)
+{
+ QString x = result;
+ FrameLoaderClientQt *fl = static_cast<FrameLoaderClientQt*>(f->loader()->client());
+ bool rc = m_webPage->javaScriptPrompt(fl->webFrame(), (QString)message, (QString)defaultValue, &x);
+ result = x;
+ return rc;
+}
+
+void ChromeClientQt::setStatusbarText(const String& msg)
+{
+ QString x = msg;
+ emit m_webPage->statusBarMessage(x);
+}
+
+bool ChromeClientQt::shouldInterruptJavaScript()
+{
+ notImplemented();
+ return false;
+}
+
+bool ChromeClientQt::tabsToLinks() const
+{
+ return m_webPage->settings()->testAttribute(QWebSettings::LinksIncludedInFocusChain);
+}
+
+IntRect ChromeClientQt::windowResizerRect() const
+{
+ return IntRect();
+}
+
+void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+{
+ // No double buffer, so only update the QWidget if content changed.
+ if (contentChanged) {
+ QWidget* view = m_webPage->view();
+ if (view) {
+ QRect rect(windowRect);
+ rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize()));
+ if (!rect.isEmpty())
+ view->update(rect);
+ }
+ emit m_webPage->repaintRequested(windowRect);
+ }
+
+ // FIXME: There is no "immediate" support for window painting. This should be done always whenever the flag
+ // is set.
+}
+
+void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&)
+{
+ QWidget* view = m_webPage->view();
+ if (view)
+ view->scroll(delta.width(), delta.height(), scrollViewRect);
+ emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect);
+}
+
+IntRect ChromeClientQt::windowToScreen(const IntRect& rect) const
+{
+ notImplemented();
+ return rect;
+}
+
+IntPoint ChromeClientQt::screenToWindow(const IntPoint& point) const
+{
+ notImplemented();
+ return point;
+}
+
+PlatformWidget ChromeClientQt::platformWindow() const
+{
+ return m_webPage->view();
+}
+
+void ChromeClientQt::contentsSizeChanged(Frame*, const IntSize&) const
+{
+}
+
+void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
+{
+ if (result.absoluteLinkURL() != lastHoverURL
+ || result.title() != lastHoverTitle
+ || result.textContent() != lastHoverContent) {
+ lastHoverURL = result.absoluteLinkURL();
+ lastHoverTitle = result.title();
+ lastHoverContent = result.textContent();
+ emit m_webPage->linkHovered(lastHoverURL.prettyURL(),
+ lastHoverTitle, lastHoverContent);
+ }
+}
+
+void ChromeClientQt::setToolTip(const String &tip)
+{
+#ifndef QT_NO_TOOLTIP
+ QWidget* view = m_webPage->view();
+ if (!view)
+ return;
+
+ if (tip.isEmpty()) {
+ view->setToolTip(QString());
+ QToolTip::hideText();
+ } else {
+ QString dtip = QLatin1String("<p>") + Qt::escape(tip) + QLatin1String("</p>");
+ view->setToolTip(dtip);
+ }
+#else
+ Q_UNUSED(tip);
+#endif
+}
+
+void ChromeClientQt::print(Frame *frame)
+{
+ emit m_webPage->printRequested(QWebFramePrivate::kit(frame));
+}
+
+void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseName)
+{
+ quint64 quota = QWebSettings::offlineStorageDefaultQuota();
+#if ENABLE(DATABASE)
+ if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin()))
+ DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota);
+#endif
+ emit m_webPage->databaseQuotaExceeded(QWebFramePrivate::kit(frame), databaseName);
+}
+
+void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
+{
+ RefPtr<FileChooser> fileChooser = prpFileChooser;
+ bool supportMulti = m_webPage->supportsExtension(QWebPage::ChooseMultipleFilesExtension);
+
+ if (fileChooser->allowsMultipleFiles() && supportMulti) {
+ QWebPage::ChooseMultipleFilesExtensionOption option;
+ option.parentFrame = QWebFramePrivate::kit(frame);
+
+ if (!fileChooser->filenames().isEmpty())
+ for (int i = 0; i < fileChooser->filenames().size(); ++i)
+ option.suggestedFileNames += fileChooser->filenames()[i];
+
+ QWebPage::ChooseMultipleFilesExtensionReturn output;
+ m_webPage->extension(QWebPage::ChooseMultipleFilesExtension, &option, &output);
+
+ if (!output.fileNames.isEmpty()) {
+ Vector<String> names;
+ for (int i = 0; i < output.fileNames.count(); ++i)
+ names.append(output.fileNames.at(i));
+ fileChooser->chooseFiles(names);
+ }
+ } else {
+ QString suggestedFile;
+ if (!fileChooser->filenames().isEmpty())
+ suggestedFile = fileChooser->filenames()[0];
+ QString file = m_webPage->chooseFile(QWebFramePrivate::kit(frame), suggestedFile);
+ if (!file.isEmpty())
+ fileChooser->chooseFile(file);
+ }
+}
+
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
new file mode 100644
index 0000000..a13bb7c
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ChromeClientQt_H
+#define ChromeClientQt_H
+
+#include "ChromeClient.h"
+#include "FloatRect.h"
+#include "RefCounted.h"
+#include "KURL.h"
+#include "PlatformString.h"
+
+class QWebPage;
+
+namespace WebCore {
+
+ class FileChooser;
+ class FloatRect;
+ class Page;
+ struct FrameLoadRequest;
+
+ class ChromeClientQt : public ChromeClient
+ {
+ public:
+ ChromeClientQt(QWebPage* webPage);
+ virtual ~ChromeClientQt();
+ virtual void chromeDestroyed();
+
+ virtual void setWindowRect(const FloatRect&);
+ virtual FloatRect windowRect();
+
+ virtual FloatRect pageRect();
+
+ virtual float scaleFactor();
+
+ virtual void focus();
+ virtual void unfocus();
+
+ virtual bool canTakeFocus(FocusDirection);
+ virtual void takeFocus(FocusDirection);
+
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
+ virtual void show();
+
+ virtual bool canRunModal();
+ virtual void runModal();
+
+ virtual void setToolbarsVisible(bool);
+ virtual bool toolbarsVisible();
+
+ virtual void setStatusbarVisible(bool);
+ virtual bool statusbarVisible();
+
+ virtual void setScrollbarsVisible(bool);
+ virtual bool scrollbarsVisible();
+
+ virtual void setMenubarVisible(bool);
+ virtual bool menubarVisible();
+
+ virtual void setResizable(bool);
+
+ virtual void addMessageToConsole(const String& message, unsigned int lineNumber,
+ const String& sourceID);
+
+ virtual bool canRunBeforeUnloadConfirmPanel();
+ virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
+
+ virtual void closeWindowSoon();
+
+ virtual void runJavaScriptAlert(Frame*, const String&);
+ virtual bool runJavaScriptConfirm(Frame*, const String&);
+ virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
+ virtual bool shouldInterruptJavaScript();
+
+ virtual void setStatusbarText(const String&);
+
+ virtual bool tabsToLinks() const;
+ virtual IntRect windowResizerRect() const;
+
+ virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+ virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+ virtual IntPoint screenToWindow(const IntPoint&) const;
+ virtual IntRect windowToScreen(const IntRect&) const;
+ virtual PlatformWidget platformWindow() const;
+ virtual void contentsSizeChanged(Frame*, const IntSize&) const;
+
+ virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
+
+ virtual void setToolTip(const String&);
+
+ virtual void print(Frame*);
+
+ virtual void exceededDatabaseQuota(Frame*, const String&);
+
+ virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
+
+ virtual void formStateDidChange(const Node*) { }
+
+ QWebPage* m_webPage;
+ WebCore::KURL lastHoverURL;
+ WebCore::String lastHoverTitle;
+ WebCore::String lastHoverContent;
+
+ bool toolBarsVisible;
+ bool statusBarVisible;
+ bool menuBarVisible;
+ };
+}
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
new file mode 100644
index 0000000..ae9d718
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ContextMenuClientQt.h"
+
+#include "ContextMenu.h"
+#include "HitTestResult.h"
+#include "KURL.h"
+#include "RefCounted.h"
+#include "NotImplemented.h"
+
+#include <stdio.h>
+
+namespace WebCore {
+
+void ContextMenuClientQt::contextMenuDestroyed()
+{
+ delete this;
+}
+
+PlatformMenuDescription ContextMenuClientQt::getCustomMenuFromDefaultItems(ContextMenu* menu)
+{
+ // warning: this transfers the ownership to the caller
+ return menu->releasePlatformDescription();
+}
+
+void ContextMenuClientQt::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
+{
+ notImplemented();
+}
+
+void ContextMenuClientQt::downloadURL(const KURL& url)
+{
+ notImplemented();
+}
+
+void ContextMenuClientQt::lookUpInDictionary(Frame*)
+{
+ notImplemented();
+}
+
+void ContextMenuClientQt::speak(const String&)
+{
+ notImplemented();
+}
+
+void ContextMenuClientQt::stopSpeaking()
+{
+ notImplemented();
+}
+
+void ContextMenuClientQt::searchWithGoogle(const Frame*)
+{
+ notImplemented();
+}
+
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h
new file mode 100644
index 0000000..ad6bfae
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ContextMenuClientQt_h
+#define ContextMenuClientQt_h
+
+#include "ContextMenuClient.h"
+
+#include <RefCounted.h>
+
+namespace WebCore {
+ class ContextMenu;
+
+ class ContextMenuClientQt : public ContextMenuClient
+ {
+ public:
+ virtual void contextMenuDestroyed();
+
+ virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*);
+ virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*);
+
+ virtual void downloadURL(const KURL& url);
+ virtual void lookUpInDictionary(Frame*);
+ virtual void speak(const String&);
+ virtual void stopSpeaking();
+ virtual void searchWithGoogle(const Frame*);
+ };
+}
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
new file mode 100644
index 0000000..b719868
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "DragClientQt.h"
+
+#include "ClipboardQt.h"
+#include "qwebpage.h"
+
+#include <QDrag>
+#include <QMimeData>
+
+
+namespace WebCore {
+
+DragDestinationAction DragClientQt::actionMaskForDrag(DragData*)
+{
+ return DragDestinationActionAny;
+}
+
+void DragClientQt::willPerformDragDestinationAction(DragDestinationAction, DragData*)
+{
+}
+
+void DragClientQt::dragControllerDestroyed()
+{
+ delete this;
+}
+
+DragSourceAction DragClientQt::dragSourceActionMaskForPoint(const IntPoint&)
+{
+ return DragSourceActionAny;
+}
+
+void DragClientQt::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*)
+{
+}
+
+void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard* clipboard, Frame*, bool)
+{
+#ifndef QT_NO_DRAGANDDROP
+ QMimeData* clipboardData = static_cast<ClipboardQt*>(clipboard)->clipboardData();
+ static_cast<ClipboardQt*>(clipboard)->invalidateWritableData();
+ QWidget* view = m_webPage->view();
+ if (view) {
+ QDrag *drag = new QDrag(view);
+ drag->setMimeData(clipboardData);
+ drag->start();
+ }
+#endif
+}
+
+
+DragImageRef DragClientQt::createDragImageForLink(KURL&, const String&, Frame*)
+{
+ return 0;
+}
+
+} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.h
new file mode 100644
index 0000000..4c83191
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "DragClient.h"
+class QWebPage;
+namespace WebCore {
+
+class DragClientQt : public DragClient {
+public:
+ DragClientQt(QWebPage* webPage) : m_webPage(webPage) {};
+ virtual void willPerformDragDestinationAction(DragDestinationAction,
+ DragData*);
+ virtual WebCore::DragDestinationAction actionMaskForDrag(DragData*);
+ virtual void dragControllerDestroyed();
+ virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&);
+ virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*);
+ virtual void startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false);
+ virtual DragImageRef createDragImageForLink(KURL&, const String& label, Frame*);
+private:
+ QWebPage* m_webPage;
+};
+
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.cpp
new file mode 100644
index 0000000..1532388
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.cpp
@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2007 Staikos Computing Services Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <wtf/Platform.h>
+#include "EditCommandQt.h"
+
+using namespace WebCore;
+
+EditCommandQt::EditCommandQt(WTF::RefPtr<EditCommand> cmd, QUndoCommand *parent)
+:
+#ifndef QT_NO_UNDOCOMMAND
+ QUndoCommand(parent),
+#endif
+ _cmd(cmd), _first(true)
+{
+}
+
+
+EditCommandQt::~EditCommandQt() {
+}
+
+
+void EditCommandQt::redo() {
+ if (_first) {
+ _first = false;
+ return;
+ }
+ if (_cmd) {
+ _cmd->reapply();
+ }
+}
+
+
+void EditCommandQt::undo() {
+ if (_cmd) {
+ _cmd->unapply();
+ }
+}
+
+
+// vim: ts=4 sw=4 et
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.h
new file mode 100644
index 0000000..ae6ea51
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.h
@@ -0,0 +1,50 @@
+/*
+ Copyright (C) 2007 Staikos Computing Services Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef EDITCOMMANDQT_H
+#define EDITCOMMANDQT_H
+
+#include <qglobal.h>
+QT_BEGIN_NAMESPACE
+class QUndoCommand;
+QT_END_NAMESPACE
+
+#include <QUndoCommand>
+#include <EditCommand.h>
+
+class EditCommandQt
+#ifndef QT_NO_UNDOCOMMAND
+ : public QUndoCommand
+#endif
+{
+ public:
+ EditCommandQt(WTF::RefPtr<WebCore::EditCommand> cmd, QUndoCommand *parent = 0);
+ ~EditCommandQt();
+
+ void redo();
+ void undo();
+
+ private:
+ WTF::RefPtr<WebCore::EditCommand> _cmd;
+ bool _first;
+};
+
+#endif
+
+// vim: ts=4 sw=4 et
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
new file mode 100644
index 0000000..a688779
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -0,0 +1,596 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006, 2008 Apple Computer, Inc.
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EditorClientQt.h"
+
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+
+#include "Document.h"
+#include "EditCommandQt.h"
+#include "Page.h"
+#include "Editor.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "KeyboardCodes.h"
+#include "KeyboardEvent.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "NotImplemented.h"
+#include "Node.h"
+#include "Range.h"
+
+#include <stdio.h>
+
+#include <QUndoStack>
+#define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__);
+
+static bool dumpEditingCallbacks = false;
+static bool acceptsEditing = true;
+void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b)
+{
+ dumpEditingCallbacks = b;
+}
+
+void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b)
+{
+ acceptsEditing = b;
+}
+
+
+static QString dumpPath(WebCore::Node *node)
+{
+ QString str = node->nodeName();
+
+ WebCore::Node *parent = node->parentNode();
+ while (parent) {
+ str.append(QLatin1String(" > "));
+ str.append(parent->nodeName());
+ parent = parent->parentNode();
+ }
+ return str;
+}
+
+static QString dumpRange(WebCore::Range *range)
+{
+ if (!range)
+ return QLatin1String("(null)");
+ QString str;
+ WebCore::ExceptionCode code;
+ str.sprintf("range from %ld of %ls to %ld of %ls",
+ range->startOffset(code), dumpPath(range->startContainer(code)).unicode(),
+ range->endOffset(code), dumpPath(range->endContainer(code)).unicode());
+ return str;
+}
+
+
+namespace WebCore {
+
+
+bool EditorClientQt::shouldDeleteRange(Range* range)
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).toUtf8().constData());
+
+ return true;
+}
+
+bool EditorClientQt::shouldShowDeleteInterface(HTMLElement* element)
+{
+ if (QWebPagePrivate::drtRun)
+ return element->className() == "needsDeletionUI";
+ return false;
+}
+
+bool EditorClientQt::isContinuousSpellCheckingEnabled()
+{
+ return false;
+}
+
+bool EditorClientQt::isGrammarCheckingEnabled()
+{
+ return false;
+}
+
+int EditorClientQt::spellCheckerDocumentTag()
+{
+ return 0;
+}
+
+bool EditorClientQt::shouldBeginEditing(WebCore::Range* range)
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).toUtf8().constData());
+ return true;
+}
+
+bool EditorClientQt::shouldEndEditing(WebCore::Range* range)
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).toUtf8().constData());
+ return true;
+}
+
+bool EditorClientQt::shouldInsertText(const String& string, Range* range, EditorInsertAction action)
+{
+ if (dumpEditingCallbacks) {
+ static const char *insertactionstring[] = {
+ "WebViewInsertActionTyped",
+ "WebViewInsertActionPasted",
+ "WebViewInsertActionDropped",
+ };
+
+ printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n",
+ QString(string).toUtf8().constData(), dumpRange(range).toUtf8().constData(), insertactionstring[action]);
+ }
+ return acceptsEditing;
+}
+
+bool EditorClientQt::shouldChangeSelectedRange(Range* currentRange, Range* proposedRange, EAffinity selectionAffinity, bool stillSelecting)
+{
+ if (dumpEditingCallbacks) {
+ static const char *affinitystring[] = {
+ "NSSelectionAffinityUpstream",
+ "NSSelectionAffinityDownstream"
+ };
+ static const char *boolstring[] = {
+ "FALSE",
+ "TRUE"
+ };
+
+ printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n",
+ dumpRange(currentRange).toUtf8().constData(),
+ dumpRange(proposedRange).toUtf8().constData(),
+ affinitystring[selectionAffinity], boolstring[stillSelecting]);
+ }
+ return acceptsEditing;
+}
+
+bool EditorClientQt::shouldApplyStyle(WebCore::CSSStyleDeclaration* style,
+ WebCore::Range* range)
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n",
+ QString(style->cssText()).toUtf8().constData(), dumpRange(range).toUtf8().constData());
+ return acceptsEditing;
+}
+
+bool EditorClientQt::shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*)
+{
+ notImplemented();
+ return true;
+}
+
+void EditorClientQt::didBeginEditing()
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n");
+ m_editing = true;
+}
+
+void EditorClientQt::respondToChangedContents()
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n");
+ m_page->d->updateEditorActions();
+
+ emit m_page->contentsChanged();
+}
+
+void EditorClientQt::respondToChangedSelection()
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n");
+// const Selection &selection = m_page->d->page->selection();
+// char buffer[1024];
+// selection.formatForDebugger(buffer, sizeof(buffer));
+// printf("%s\n", buffer);
+
+ m_page->d->updateEditorActions();
+ emit m_page->selectionChanged();
+ emit m_page->microFocusChanged();
+}
+
+void EditorClientQt::didEndEditing()
+{
+ if (dumpEditingCallbacks)
+ printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n");
+ m_editing = false;
+}
+
+void EditorClientQt::didWriteSelectionToPasteboard()
+{
+}
+
+void EditorClientQt::didSetSelectionTypesForPasteboard()
+{
+}
+
+bool EditorClientQt::selectWordBeforeMenuEvent()
+{
+ notImplemented();
+ return false;
+}
+
+bool EditorClientQt::isEditable()
+{
+ return m_page->isContentEditable();
+}
+
+void EditorClientQt::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> cmd)
+{
+#ifndef QT_NO_UNDOSTACK
+ Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
+ if (m_inUndoRedo || (frame && !frame->editor()->lastEditCommand() /* HACK!! Don't recreate undos */)) {
+ return;
+ }
+ m_page->undoStack()->push(new EditCommandQt(cmd));
+#endif // QT_NO_UNDOSTACK
+}
+
+void EditorClientQt::registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand>)
+{
+}
+
+void EditorClientQt::clearUndoRedoOperations()
+{
+#ifndef QT_NO_UNDOSTACK
+ return m_page->undoStack()->clear();
+#endif
+}
+
+bool EditorClientQt::canUndo() const
+{
+#ifdef QT_NO_UNDOSTACK
+ return false;
+#else
+ return m_page->undoStack()->canUndo();
+#endif
+}
+
+bool EditorClientQt::canRedo() const
+{
+#ifdef QT_NO_UNDOSTACK
+ return false;
+#else
+ return m_page->undoStack()->canRedo();
+#endif
+}
+
+void EditorClientQt::undo()
+{
+#ifndef QT_NO_UNDOSTACK
+ m_inUndoRedo = true;
+ m_page->undoStack()->undo();
+ m_inUndoRedo = false;
+#endif
+}
+
+void EditorClientQt::redo()
+{
+#ifndef QT_NO_UNDOSTACK
+ m_inUndoRedo = true;
+ m_page->undoStack()->redo();
+ m_inUndoRedo = false;
+#endif
+}
+
+bool EditorClientQt::shouldInsertNode(Node* node, Range* range, EditorInsertAction action)
+{
+ if (dumpEditingCallbacks) {
+ static const char *insertactionstring[] = {
+ "WebViewInsertActionTyped",
+ "WebViewInsertActionPasted",
+ "WebViewInsertActionDropped",
+ };
+
+ printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", dumpPath(node).toUtf8().constData(),
+ dumpRange(range).toUtf8().constData(), insertactionstring[action]);
+ }
+ return acceptsEditing;
+}
+
+void EditorClientQt::pageDestroyed()
+{
+ delete this;
+}
+
+bool EditorClientQt::smartInsertDeleteEnabled()
+{
+ notImplemented();
+ return false;
+}
+
+bool EditorClientQt::isSelectTrailingWhitespaceEnabled()
+{
+ notImplemented();
+ return false;
+}
+
+void EditorClientQt::toggleContinuousSpellChecking()
+{
+ notImplemented();
+}
+
+void EditorClientQt::toggleGrammarChecking()
+{
+ notImplemented();
+}
+
+void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
+{
+ Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
+ if (!frame || !frame->document()->focusedNode())
+ return;
+
+ const PlatformKeyboardEvent* kevent = event->keyEvent();
+ if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp)
+ return;
+
+ Node* start = frame->selection()->start().node();
+ if (!start)
+ return;
+
+ // FIXME: refactor all of this to use Actions or something like them
+ if (start->isContentEditable()) {
+#ifndef QT_NO_SHORTCUT
+ QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent());
+ if (action != QWebPage::NoWebAction) {
+ const char* cmd = QWebPagePrivate::editorCommandForWebActions(action);
+ // WebKit doesn't have enough information about mode to decide how commands that just insert text if executed via Editor should be treated,
+ // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated
+ // (e.g. Tab that inserts a Tab character, or Enter).
+ if (cmd && frame->editor()->command(cmd).isTextInsertion()
+ && kevent->type() == PlatformKeyboardEvent::RawKeyDown)
+ return;
+
+ m_page->triggerAction(action);
+ } else
+#endif // QT_NO_SHORTCUT
+ switch (kevent->windowsVirtualKeyCode()) {
+#if QT_VERSION < 0x040500
+ case VK_RETURN:
+#ifdef QT_WS_MAC
+ if (kevent->shiftKey() || kevent->metaKey())
+#else
+ if (kevent->shiftKey())
+#endif
+ frame->editor()->command("InsertLineBreak").execute();
+ else
+ frame->editor()->command("InsertNewline").execute();
+ break;
+#endif
+ case VK_BACK:
+ frame->editor()->deleteWithDirection(SelectionController::BACKWARD,
+ CharacterGranularity, false, true);
+ break;
+ case VK_DELETE:
+ frame->editor()->deleteWithDirection(SelectionController::FORWARD,
+ CharacterGranularity, false, true);
+ break;
+ case VK_LEFT:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveLeftAndModifySelection").execute();
+ else frame->editor()->command("MoveLeft").execute();
+ break;
+ case VK_RIGHT:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveRightAndModifySelection").execute();
+ else frame->editor()->command("MoveRight").execute();
+ break;
+ case VK_UP:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveUpAndModifySelection").execute();
+ else frame->editor()->command("MoveUp").execute();
+ break;
+ case VK_DOWN:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveDownAndModifySelection").execute();
+ else frame->editor()->command("MoveDown").execute();
+ break;
+ case VK_PRIOR: // PageUp
+ frame->editor()->command("MovePageUp").execute();
+ break;
+ case VK_NEXT: // PageDown
+ frame->editor()->command("MovePageDown").execute();
+ break;
+ case VK_TAB:
+ return;
+ default:
+ if (kevent->type() != PlatformKeyboardEvent::KeyDown && !kevent->ctrlKey()
+#ifndef Q_WS_MAC
+ // We need to exclude checking for Alt because it is just a different Shift
+ && !kevent->altKey()
+#endif
+ && !kevent->text().isEmpty()) {
+ frame->editor()->insertText(kevent->text(), event);
+ } else if (kevent->ctrlKey()) {
+ switch (kevent->windowsVirtualKeyCode()) {
+ case VK_A:
+ frame->editor()->command("SelectAll").execute();
+ break;
+ case VK_B:
+ frame->editor()->command("ToggleBold").execute();
+ break;
+ case VK_I:
+ frame->editor()->command("ToggleItalic").execute();
+ break;
+ default:
+ // catch combination AltGr+key or Ctrl+Alt+key
+ if (kevent->type() != PlatformKeyboardEvent::KeyDown && kevent->altKey() && !kevent->text().isEmpty()) {
+ frame->editor()->insertText(kevent->text(), event);
+ break;
+ }
+ return;
+ }
+ } else return;
+ }
+ } else {
+#ifndef QT_NO_SHORTCUT
+ if (kevent->qtEvent() == QKeySequence::Copy) {
+ m_page->triggerAction(QWebPage::Copy);
+ } else
+#endif // QT_NO_SHORTCUT
+ switch (kevent->windowsVirtualKeyCode()) {
+ case VK_UP:
+ frame->editor()->command("MoveUp").execute();
+ break;
+ case VK_DOWN:
+ frame->editor()->command("MoveDown").execute();
+ break;
+ case VK_PRIOR: // PageUp
+ frame->editor()->command("MovePageUp").execute();
+ break;
+ case VK_NEXT: // PageDown
+ frame->editor()->command("MovePageDown").execute();
+ break;
+ case VK_HOME:
+ if (kevent->ctrlKey())
+ frame->editor()->command("MoveToBeginningOfDocument").execute();
+ break;
+ case VK_END:
+ if (kevent->ctrlKey())
+ frame->editor()->command("MoveToEndOfDocument").execute();
+ break;
+ default:
+ if (kevent->ctrlKey()) {
+ switch (kevent->windowsVirtualKeyCode()) {
+ case VK_A:
+ frame->editor()->command("SelectAll").execute();
+ break;
+ default:
+ return;
+ }
+ } else return;
+ }
+ }
+ event->setDefaultHandled();
+}
+
+void EditorClientQt::handleInputMethodKeydown(KeyboardEvent*)
+{
+}
+
+EditorClientQt::EditorClientQt(QWebPage* page)
+ : m_page(page), m_editing(false), m_inUndoRedo(false)
+{
+}
+
+void EditorClientQt::textFieldDidBeginEditing(Element*)
+{
+ m_editing = true;
+}
+
+void EditorClientQt::textFieldDidEndEditing(Element*)
+{
+ m_editing = false;
+}
+
+void EditorClientQt::textDidChangeInTextField(Element*)
+{
+}
+
+bool EditorClientQt::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
+{
+ return false;
+}
+
+void EditorClientQt::textWillBeDeletedInTextField(Element*)
+{
+}
+
+void EditorClientQt::textDidChangeInTextArea(Element*)
+{
+}
+
+void EditorClientQt::ignoreWordInSpellDocument(const String&)
+{
+ notImplemented();
+}
+
+void EditorClientQt::learnWord(const String&)
+{
+ notImplemented();
+}
+
+void EditorClientQt::checkSpellingOfString(const UChar*, int, int*, int*)
+{
+ notImplemented();
+}
+
+void EditorClientQt::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*)
+{
+ notImplemented();
+}
+
+void EditorClientQt::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&)
+{
+ notImplemented();
+}
+
+void EditorClientQt::updateSpellingUIWithMisspelledWord(const String&)
+{
+ notImplemented();
+}
+
+void EditorClientQt::showSpellingUI(bool)
+{
+ notImplemented();
+}
+
+bool EditorClientQt::spellingUIIsShowing()
+{
+ notImplemented();
+ return false;
+}
+
+void EditorClientQt::getGuessesForWord(const String&, Vector<String>&)
+{
+ notImplemented();
+}
+
+bool EditorClientQt::isEditing() const
+{
+ return m_editing;
+}
+
+void EditorClientQt::setInputMethodState(bool active)
+{
+ QWidget *view = m_page->view();
+ if (view) {
+ view->setAttribute(Qt::WA_InputMethodEnabled, active);
+ emit m_page->microFocusChanged();
+ }
+}
+
+}
+
+// vim: ts=4 sw=4 et
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.h
new file mode 100644
index 0000000..b39f02b
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EditorClientQt_H
+#define EditorClientQt_H
+
+#include "EditorClient.h"
+#include "RefCounted.h"
+
+#include <wtf/Forward.h>
+
+class QWebPage;
+
+namespace WebCore {
+
+class EditorClientQt : public EditorClient {
+public:
+ EditorClientQt(QWebPage* page);
+
+ virtual void pageDestroyed();
+
+ virtual bool shouldDeleteRange(Range*);
+ virtual bool shouldShowDeleteInterface(HTMLElement*);
+ virtual bool smartInsertDeleteEnabled();
+ virtual bool isSelectTrailingWhitespaceEnabled();
+ virtual bool isContinuousSpellCheckingEnabled();
+ virtual void toggleContinuousSpellChecking();
+ virtual bool isGrammarCheckingEnabled();
+ virtual void toggleGrammarChecking();
+ virtual int spellCheckerDocumentTag();
+
+ virtual bool selectWordBeforeMenuEvent();
+ virtual bool isEditable();
+
+ virtual bool shouldBeginEditing(Range*);
+ virtual bool shouldEndEditing(Range*);
+ virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
+ virtual bool shouldInsertText(const String&, Range*, EditorInsertAction);
+ virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting);
+
+ virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
+
+ virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
+
+ virtual void didBeginEditing();
+ virtual void respondToChangedContents();
+ virtual void respondToChangedSelection();
+ virtual void didEndEditing();
+ virtual void didWriteSelectionToPasteboard();
+ virtual void didSetSelectionTypesForPasteboard();
+
+ virtual void registerCommandForUndo(PassRefPtr<EditCommand>);
+ virtual void registerCommandForRedo(PassRefPtr<EditCommand>);
+ virtual void clearUndoRedoOperations();
+
+ virtual bool canUndo() const;
+ virtual bool canRedo() const;
+
+ virtual void undo();
+ virtual void redo();
+
+ virtual void handleKeyboardEvent(KeyboardEvent*);
+ virtual void handleInputMethodKeydown(KeyboardEvent*);
+
+ virtual void textFieldDidBeginEditing(Element*);
+ virtual void textFieldDidEndEditing(Element*);
+ virtual void textDidChangeInTextField(Element*);
+ virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*);
+ virtual void textWillBeDeletedInTextField(Element*);
+ virtual void textDidChangeInTextArea(Element*);
+
+ virtual void ignoreWordInSpellDocument(const String&);
+ virtual void learnWord(const String&);
+ virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
+ virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
+ virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&);
+ virtual void updateSpellingUIWithMisspelledWord(const String&);
+ virtual void showSpellingUI(bool show);
+ virtual bool spellingUIIsShowing();
+ virtual void getGuessesForWord(const String&, Vector<String>& guesses);
+ virtual void setInputMethodState(bool enabled);
+
+ bool isEditing() const;
+
+private:
+ QWebPage* m_page;
+ bool m_editing;
+ bool m_inUndoRedo; // our undo stack works differently - don't re-enter!
+};
+
+}
+
+#endif
+
+// vim: ts=4 sw=4 et
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
new file mode 100644
index 0000000..c421d42
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -0,0 +1,1172 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Coypright (C) 2008 Holger Hans Peter Freyther
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CSSComputedStyleDeclaration.h"
+#include "CSSPropertyNames.h"
+#include "FrameLoaderClientQt.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "DocumentLoader.h"
+#include "MIMETypeRegistry.h"
+#include "ResourceResponse.h"
+#include "Page.h"
+#include "PluginData.h"
+#include "PluginDatabase.h"
+#include "ProgressTracker.h"
+#include "RenderPart.h"
+#include "ResourceRequest.h"
+#include "HistoryItem.h"
+#include "HTMLFormElement.h"
+#include "NotImplemented.h"
+#include "QNetworkReplyHandler.h"
+#include "ResourceHandleInternal.h"
+#include "ResourceHandle.h"
+#include "Settings.h"
+
+#include "qwebpage.h"
+#include "qwebframe.h"
+#include "qwebframe_p.h"
+#include "qwebhistoryinterface.h"
+#include "qwebpluginfactory.h"
+
+#include <qfileinfo.h>
+
+#include <QCoreApplication>
+#include <QDebug>
+#if QT_VERSION >= 0x040400
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#else
+#include "qwebnetworkinterface_p.h"
+#endif
+#include "qwebhistory_p.h"
+
+static bool dumpFrameLoaderCallbacks = false;
+static bool dumpResourceLoadCallbacks = false;
+
+static QMap<unsigned long, QString> dumpAssignedUrls;
+
+void QWEBKIT_EXPORT qt_dump_frame_loader(bool b)
+{
+ dumpFrameLoaderCallbacks = b;
+}
+
+void QWEBKIT_EXPORT qt_dump_resource_load_callbacks(bool b)
+{
+ dumpResourceLoadCallbacks = b;
+}
+
+// Compare with WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
+static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame)
+{
+ QWebFrame* frame = QWebFramePrivate::kit(_frame);
+ QString name = frame->frameName();
+
+ bool isMainFrame = frame == frame->page()->mainFrame();
+ if (isMainFrame) {
+ if (!name.isEmpty())
+ return QString::fromLatin1("main frame \"%1\"").arg(name);
+ return QLatin1String("main frame");
+ } else {
+ if (!name.isEmpty())
+ return QString::fromLatin1("frame \"%1\"").arg(name);
+ return QLatin1String("frame (anonymous)");
+ }
+}
+
+static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url)
+{
+ QUrl url = _url;
+ return url.toString();
+}
+
+static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceError& error)
+{
+ QString failingURL = error.failingURL();
+ return QString::fromLatin1("<NSError domain NSURLErrorDomain, code %1, failing URL \"%2\">").arg(error.errorCode()).arg(failingURL);
+}
+
+static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceRequest& request)
+{
+ QString url = request.url().string();
+ return QString::fromLatin1("<NSURLRequest %1>").arg(url);
+}
+
+static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceResponse& response)
+{
+ QString text = response.httpStatusText();
+ if (text.isEmpty())
+ return QLatin1String("(null)");
+
+ return text;
+}
+
+
+namespace WebCore
+{
+
+FrameLoaderClientQt::FrameLoaderClientQt()
+ : m_frame(0)
+ , m_webFrame(0)
+ , m_pluginView(0)
+ , m_hasSentResponseToPlugin(false)
+ , m_firstData(false)
+ , m_policyFunction(0)
+ , m_loadSucceeded(false)
+{
+ connect(this, SIGNAL(sigCallPolicyFunction(int)), this, SLOT(slotCallPolicyFunction(int)), Qt::QueuedConnection);
+}
+
+
+FrameLoaderClientQt::~FrameLoaderClientQt()
+{
+}
+
+void FrameLoaderClientQt::setFrame(QWebFrame* webFrame, Frame* frame)
+{
+ m_webFrame = webFrame;
+ m_frame = frame;
+ if (!m_webFrame || !m_webFrame->page()) {
+ qWarning("FrameLoaderClientQt::setFrame frame without Page!");
+ return;
+ }
+
+ connect(this, SIGNAL(loadStarted()),
+ m_webFrame->page(), SIGNAL(loadStarted()));
+ connect(this, SIGNAL(loadProgress(int)),
+ m_webFrame->page(), SIGNAL(loadProgress(int)));
+ connect(this, SIGNAL(loadFinished(bool)),
+ m_webFrame->page(), SIGNAL(loadFinished(bool)));
+ connect(this, SIGNAL(titleChanged(const QString&)),
+ m_webFrame, SIGNAL(titleChanged(const QString&)));
+}
+
+QWebFrame* FrameLoaderClientQt::webFrame() const
+{
+ return m_webFrame;
+}
+
+void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, PolicyAction action)
+{
+ ASSERT(!m_policyFunction);
+ ASSERT(function);
+
+ m_policyFunction = function;
+ emit sigCallPolicyFunction(action);
+}
+
+void FrameLoaderClientQt::slotCallPolicyFunction(int action)
+{
+ if (!m_frame || !m_policyFunction)
+ return;
+ FramePolicyFunction function = m_policyFunction;
+ m_policyFunction = 0;
+ (m_frame->loader()->*function)(WebCore::PolicyAction(action));
+}
+
+bool FrameLoaderClientQt::hasWebView() const
+{
+ //notImplemented();
+ return true;
+}
+
+void FrameLoaderClientQt::savePlatformDataToCachedPage(CachedPage*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::transitionToCommittedFromCachedPage(CachedPage*)
+{
+}
+
+void FrameLoaderClientQt::transitionToCommittedForNewPage()
+{
+ ASSERT(m_frame);
+ ASSERT(m_webFrame);
+
+ QBrush brush = m_webFrame->page()->palette().brush(QPalette::Base);
+ QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor();
+ WebCore::FrameLoaderClient::transitionToCommittedForNewPage(m_frame, m_webFrame->page()->viewportSize(),
+ backgroundColor, !backgroundColor.alpha(),
+ /*fixedLayoutSize*/ IntSize(),
+ /*useFixedLayout*/ false,
+ (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
+ (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
+}
+
+
+void FrameLoaderClientQt::makeRepresentation(DocumentLoader*)
+{
+ // don't need this for now I think.
+}
+
+
+void FrameLoaderClientQt::forceLayout()
+{
+ m_frame->forceLayout(true);
+}
+
+
+void FrameLoaderClientQt::forceLayoutForNonHTML()
+{
+}
+
+
+void FrameLoaderClientQt::setCopiesOnScroll()
+{
+ // apparently mac specific
+}
+
+
+void FrameLoaderClientQt::detachedFromParent2()
+{
+}
+
+
+void FrameLoaderClientQt::detachedFromParent3()
+{
+}
+
+void FrameLoaderClientQt::dispatchDidHandleOnloadEvents()
+{
+ // don't need this one
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didHandleOnloadEventsForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+}
+
+
+void FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidCancelClientRedirect()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didCancelClientRedirectForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url,
+ double interval,
+ double fireDate)
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - willPerformClientRedirectToURL: %s \n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(drtDescriptionSuitableForTestResult(url)));
+
+ notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didChangeLocationWithinPageForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ if (!m_webFrame)
+ return;
+
+ emit m_webFrame->urlChanged(m_webFrame->url());
+ m_webFrame->page()->d->updateNavigationActions();
+}
+
+
+void FrameLoaderClientQt::dispatchWillClose()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - willCloseFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+}
+
+
+void FrameLoaderClientQt::dispatchDidStartProvisionalLoad()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didStartProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ if (m_webFrame)
+ emit m_webFrame->provisionalLoad();
+}
+
+
+void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title)
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didReceiveTitle: %s\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(QString(title)));
+
+ if (!m_webFrame)
+ return;
+
+
+
+ // ### hack
+ emit m_webFrame->urlChanged(m_webFrame->url());
+ emit titleChanged(title);
+}
+
+
+void FrameLoaderClientQt::dispatchDidCommitLoad()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didCommitLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ if (m_frame->tree()->parent() || !m_webFrame)
+ return;
+
+ m_webFrame->page()->d->updateNavigationActions();
+
+ // We should assume first the frame has no title. If it has, then the above dispatchDidReceiveTitle()
+ // will be called very soon with the correct title.
+ // This properly resets the title when we navigate to a URI without a title.
+ emit titleChanged(String());
+}
+
+
+void FrameLoaderClientQt::dispatchDidFinishDocumentLoad()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didFinishDocumentLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ if (QWebPagePrivate::drtRun) {
+ int unloadEventCount = m_frame->eventHandler()->pendingFrameUnloadEventCount();
+ if (unloadEventCount)
+ printf("%s - has %u onunload handler(s)\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), unloadEventCount);
+ }
+
+ if (m_frame->tree()->parent() || !m_webFrame)
+ return;
+
+ m_webFrame->page()->d->updateNavigationActions();
+}
+
+
+void FrameLoaderClientQt::dispatchDidFinishLoad()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didFinishLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ m_loadSucceeded = true;
+
+ if (m_frame->tree()->parent() || !m_webFrame)
+ return;
+ m_webFrame->page()->d->updateNavigationActions();
+}
+
+
+void FrameLoaderClientQt::dispatchDidFirstLayout()
+{
+ if (m_webFrame)
+ emit m_webFrame->initialLayoutCompleted();
+}
+
+void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::dispatchShow()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientQt::cancelPolicyCheck()
+{
+// qDebug() << "FrameLoaderClientQt::cancelPolicyCheck";
+ m_policyFunction = 0;
+}
+
+
+void FrameLoaderClientQt::dispatchWillSubmitForm(FramePolicyFunction function,
+ PassRefPtr<FormState>)
+{
+ notImplemented();
+ Q_ASSERT(!m_policyFunction);
+ // FIXME: This is surely too simple
+ callPolicyFunction(function, PolicyUse);
+}
+
+
+void FrameLoaderClientQt::dispatchDidLoadMainResource(DocumentLoader*)
+{
+}
+
+
+void FrameLoaderClientQt::revertToProvisionalState(DocumentLoader*)
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientQt::postProgressStartedNotification()
+{
+ if (m_webFrame && m_frame->page()) {
+ emit loadStarted();
+ postProgressEstimateChangedNotification();
+ }
+ if (m_frame->tree()->parent() || !m_webFrame)
+ return;
+ m_webFrame->page()->d->updateNavigationActions();
+}
+
+void FrameLoaderClientQt::postProgressEstimateChangedNotification()
+{
+ if (m_webFrame && m_frame->page())
+ emit loadProgress(qRound(m_frame->page()->progress()->estimatedProgress() * 100));
+}
+
+void FrameLoaderClientQt::postProgressFinishedNotification()
+{
+ // send a mousemove event to
+ // (1) update the cursor to change according to whatever is underneath the mouse cursor right now
+ // (2) display the tool tip if the mouse hovers a node which has a tool tip
+ if (m_frame && m_frame->eventHandler() && m_webFrame->page()) {
+ QWidget* view = m_webFrame->page()->view();
+ if (view && view->hasFocus()) {
+ QPoint localPos = view->mapFromGlobal(QCursor::pos());
+ if (view->rect().contains(localPos)) {
+ QMouseEvent event(QEvent::MouseMove, localPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+ m_frame->eventHandler()->mouseMoved(PlatformMouseEvent(&event, 0));
+ }
+ }
+ }
+
+ if (m_webFrame && m_frame->page())
+ emit loadFinished(m_loadSucceeded);
+}
+
+void FrameLoaderClientQt::setMainFrameDocumentReady(bool b)
+{
+ // this is only interesting once we provide an external API for the DOM
+}
+
+
+void FrameLoaderClientQt::willChangeTitle(DocumentLoader*)
+{
+ // no need for, dispatchDidReceiveTitle is the right callback
+}
+
+
+void FrameLoaderClientQt::didChangeTitle(DocumentLoader *)
+{
+ // no need for, dispatchDidReceiveTitle is the right callback
+}
+
+
+void FrameLoaderClientQt::finishedLoading(DocumentLoader* loader)
+{
+ if (!m_pluginView) {
+ if(m_firstData) {
+ FrameLoader *fl = loader->frameLoader();
+ fl->setEncoding(m_response.textEncodingName(), false);
+ m_firstData = false;
+ }
+ }
+ else {
+ m_pluginView->didFinishLoading();
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
+ }
+}
+
+
+bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const
+{
+ if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType))
+ return true;
+
+ if (MIMETypeRegistry::isSupportedNonImageMIMEType(MIMEType))
+ return true;
+
+ if (m_frame && m_frame->settings() && m_frame->settings()->arePluginsEnabled()
+ && PluginDatabase::installedPlugins()->isMIMETypeRegistered(MIMEType))
+ return true;
+
+ return false;
+}
+
+bool FrameLoaderClientQt::representationExistsForURLScheme(const String& URLScheme) const
+{
+ return false;
+}
+
+
+String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String& URLScheme) const
+{
+ notImplemented();
+ return String();
+}
+
+
+void FrameLoaderClientQt::frameLoadCompleted()
+{
+ // Note: Can be called multiple times.
+ // Even if already complete, we might have set a previous item on a frame that
+ // didn't do any data loading on the past transaction. Make sure to clear these out.
+ m_frame->loader()->setPreviousHistoryItem(0);
+}
+
+
+void FrameLoaderClientQt::restoreViewState()
+{
+ if (!m_webFrame)
+ return;
+ emit m_webFrame->page()->restoreFrameStateRequested(m_webFrame);
+}
+
+
+void FrameLoaderClientQt::provisionalLoadStarted()
+{
+ // don't need to do anything here
+}
+
+
+void FrameLoaderClientQt::didFinishLoad()
+{
+// notImplemented();
+}
+
+
+void FrameLoaderClientQt::prepareForDataSourceReplacement()
+{
+ m_frame->loader()->detachChildren();
+}
+
+void FrameLoaderClientQt::setTitle(const String&, const KURL&)
+{
+ // no need for, dispatchDidReceiveTitle is the right callback
+}
+
+
+String FrameLoaderClientQt::userAgent(const KURL& url)
+{
+ if (m_webFrame) {
+ return m_webFrame->page()->userAgentForUrl(url);
+ }
+ return String();
+}
+
+void FrameLoaderClientQt::dispatchDidReceiveIcon()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didReceiveIconForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ if (m_webFrame) {
+ emit m_webFrame->iconChanged();
+ }
+}
+
+void FrameLoaderClientQt::frameLoaderDestroyed()
+{
+ delete m_webFrame;
+ m_frame = 0;
+ m_webFrame = 0;
+
+ delete this;
+}
+
+bool FrameLoaderClientQt::canHandleRequest(const WebCore::ResourceRequest&) const
+{
+ return true;
+}
+
+void FrameLoaderClientQt::windowObjectCleared()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didClearWindowObjectForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ if (m_webFrame)
+ emit m_webFrame->javaScriptWindowObjectCleared();
+}
+
+void FrameLoaderClientQt::didPerformFirstNavigation() const
+{
+ if (m_frame->tree()->parent() || !m_webFrame)
+ return;
+ m_webFrame->page()->d->updateNavigationActions();
+}
+
+void FrameLoaderClientQt::registerForIconNotification(bool)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::updateGlobalHistory()
+{
+ QWebHistoryInterface *history = QWebHistoryInterface::defaultInterface();
+ if (history)
+ history->addHistoryEntry(m_frame->loader()->documentLoader()->urlForHistory().prettyURL());
+}
+
+bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) const
+{
+ return true;
+}
+
+void FrameLoaderClientQt::saveViewStateToItem(WebCore::HistoryItem* item)
+{
+ QWebHistoryItem historyItem(new QWebHistoryItemPrivate(item));
+ emit m_webFrame->page()->saveFrameStateRequested(m_webFrame, &historyItem);
+}
+
+bool FrameLoaderClientQt::canCachePage() const
+{
+ return true;
+}
+
+void FrameLoaderClientQt::setMainDocumentError(WebCore::DocumentLoader* loader, const WebCore::ResourceError& error)
+{
+ if (!m_pluginView) {
+ if (m_firstData) {
+ loader->frameLoader()->setEncoding(m_response.textEncodingName(), false);
+ m_firstData = false;
+ }
+ } else {
+ m_pluginView->didFail(error);
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
+ }
+}
+
+void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
+{
+ if (!m_pluginView) {
+ if (!m_frame)
+ return;
+ FrameLoader *fl = loader->frameLoader();
+ if (m_firstData) {
+ fl->setEncoding(m_response.textEncodingName(), false);
+ m_firstData = false;
+ }
+ fl->addData(data, length);
+ }
+
+ // We re-check here as the plugin can have been created
+ if (m_pluginView) {
+ if (!m_hasSentResponseToPlugin) {
+ m_pluginView->didReceiveResponse(loader->response());
+ m_hasSentResponseToPlugin = true;
+ }
+ m_pluginView->didReceiveData(data, length);
+ }
+}
+
+WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request)
+{
+ return ResourceError("Error", -999, request.url().prettyURL(),
+ QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8));
+}
+
+// copied from WebKit/Misc/WebKitErrors[Private].h
+enum {
+ WebKitErrorCannotShowMIMEType = 100,
+ WebKitErrorCannotShowURL = 101,
+ WebKitErrorFrameLoadInterruptedByPolicyChange = 102,
+ WebKitErrorCannotUseRestrictedPort = 103,
+ WebKitErrorCannotFindPlugIn = 200,
+ WebKitErrorCannotLoadPlugIn = 201,
+ WebKitErrorJavaUnavailable = 202,
+};
+
+WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request)
+{
+ return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+ QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8));
+}
+
+
+WebCore::ResourceError FrameLoaderClientQt::cannotShowURLError(const WebCore::ResourceRequest& request)
+{
+ return ResourceError("Error", WebKitErrorCannotShowURL, request.url().string(),
+ QCoreApplication::translate("QWebFrame", "Cannot show URL", 0, QCoreApplication::UnicodeUTF8));
+}
+
+WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceRequest& request)
+{
+ return ResourceError("Error", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
+ QCoreApplication::translate("QWebFrame", "Frame load interruped by policy change", 0, QCoreApplication::UnicodeUTF8));
+}
+
+WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response)
+{
+ return ResourceError("Error", WebKitErrorCannotShowMIMEType, response.url().string(),
+ QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8));
+}
+
+WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response)
+{
+ return ResourceError("Error", -998 /* ### */, response.url().string(),
+ QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8));
+}
+
+WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse& response)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+bool FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError&)
+{
+ notImplemented();
+ return false;
+}
+
+WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
+{
+ RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData);
+ if (substituteData.isValid())
+ loader->setDeferMainResourceDataLoad(false);
+ return loader.release();
+}
+
+void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&)
+{
+#if QT_VERSION >= 0x040400
+ if (!m_webFrame)
+ return;
+
+ QNetworkReplyHandler* handler = handle->getInternal()->m_job;
+ QNetworkReply* reply = handler->release();
+ if (reply) {
+ QWebPage *page = m_webFrame->page();
+ if (page->forwardUnsupportedContent())
+ emit m_webFrame->page()->unsupportedContent(reply);
+ else
+ reply->abort();
+ }
+#endif
+}
+
+void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader* loader, const WebCore::ResourceRequest& request)
+{
+ if (dumpResourceLoadCallbacks)
+ dumpAssignedUrls[identifier] = drtDescriptionSuitableForTestResult(request.url());
+}
+
+void FrameLoaderClientQt::dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest& newRequest, const WebCore::ResourceResponse& redirectResponse)
+{
+ if (dumpResourceLoadCallbacks)
+ printf("%s - willSendRequest %s redirectResponse %s\n",
+ qPrintable(dumpAssignedUrls[identifier]),
+ qPrintable(drtDescriptionSuitableForTestResult(newRequest)),
+ qPrintable(drtDescriptionSuitableForTestResult(redirectResponse)));
+
+ // seems like the Mac code doesn't do anything here by default neither
+ //qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << request.url().string`();
+}
+
+bool
+FrameLoaderClientQt::shouldUseCredentialStorage(DocumentLoader*, unsigned long)
+{
+ notImplemented();
+ return false;
+}
+
+void FrameLoaderClientQt::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long, const WebCore::ResourceResponse& response)
+{
+
+ m_response = response;
+ m_firstData = true;
+ //qDebug() << " got response from" << response.url().string();
+}
+
+void FrameLoaderClientQt::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long, int)
+{
+}
+
+void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader* loader, unsigned long)
+{
+}
+
+void FrameLoaderClientQt::dispatchDidFailLoading(WebCore::DocumentLoader* loader, unsigned long identifier, const WebCore::ResourceError& error)
+{
+ if (dumpResourceLoadCallbacks)
+ printf("%s - didFailLoadingWithError: %s\n", qPrintable(dumpAssignedUrls[identifier]), qPrintable(drtDescriptionSuitableForTestResult(error)));
+
+ if (m_firstData) {
+ FrameLoader *fl = loader->frameLoader();
+ fl->setEncoding(m_response.textEncodingName(), false);
+ m_firstData = false;
+ }
+}
+
+bool FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int)
+{
+ notImplemented();
+ return false;
+}
+
+void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError&)
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ m_loadSucceeded = false;
+}
+
+void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError&)
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ m_loadSucceeded = false;
+}
+
+WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage()
+{
+ if (!m_webFrame)
+ return 0;
+ QWebPage *newPage = m_webFrame->page()->createWindow(QWebPage::WebBrowserWindow);
+ if (!newPage)
+ return 0;
+ return newPage->mainFrame()->d->frame;
+}
+
+void FrameLoaderClientQt::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WebCore::String& MIMEType, const WebCore::ResourceRequest&)
+{
+ // we need to call directly here
+ Q_ASSERT(!m_policyFunction);
+ m_policyFunction = function;
+ if (canShowMIMEType(MIMEType))
+ slotCallPolicyFunction(PolicyUse);
+ else
+ slotCallPolicyFunction(PolicyDownload);
+}
+
+void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>, const WebCore::String&)
+{
+ Q_ASSERT(!m_policyFunction);
+ Q_ASSERT(m_webFrame);
+ m_policyFunction = function;
+#if QT_VERSION < 0x040400
+ QWebNetworkRequest r(request);
+#else
+ QNetworkRequest r(request.toNetworkRequest());
+#endif
+ QWebPage* page = m_webFrame->page();
+
+ if (!page->d->acceptNavigationRequest(0, r, QWebPage::NavigationType(action.type()))) {
+ if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted)
+ m_frame->loader()->resetMultipleFormSubmissionProtection();
+
+ if (action.type() == NavigationTypeLinkClicked && r.url().hasFragment()) {
+ ResourceRequest emptyRequest;
+ m_frame->loader()->activeDocumentLoader()->setLastCheckedRequest(emptyRequest);
+ }
+
+ slotCallPolicyFunction(PolicyIgnore);
+ return;
+ }
+ slotCallPolicyFunction(PolicyUse);
+}
+
+void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>)
+{
+ Q_ASSERT(!m_policyFunction);
+ Q_ASSERT(m_webFrame);
+ m_policyFunction = function;
+#if QT_VERSION < 0x040400
+ QWebNetworkRequest r(request);
+#else
+ QNetworkRequest r(request.toNetworkRequest());
+#endif
+ QWebPage*page = m_webFrame->page();
+
+ if (!page->d->acceptNavigationRequest(m_webFrame, r, QWebPage::NavigationType(action.type()))) {
+ if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted)
+ m_frame->loader()->resetMultipleFormSubmissionProtection();
+
+ if (action.type() == NavigationTypeLinkClicked && r.url().hasFragment()) {
+ ResourceRequest emptyRequest;
+ m_frame->loader()->activeDocumentLoader()->setLastCheckedRequest(emptyRequest);
+ }
+
+ slotCallPolicyFunction(PolicyIgnore);
+ return;
+ }
+ slotCallPolicyFunction(PolicyUse);
+}
+
+void FrameLoaderClientQt::dispatchUnableToImplementPolicy(const WebCore::ResourceError&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request)
+{
+#if QT_VERSION >= 0x040400
+ if (!m_webFrame)
+ return;
+
+ QWebPage *page = m_webFrame->page();
+ emit m_webFrame->page()->downloadRequested(request.toNetworkRequest());
+#endif
+}
+
+PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
+ const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
+{
+ if (!m_webFrame)
+ return 0;
+
+ QWebFrameData frameData;
+ frameData.url = url;
+ frameData.name = name;
+ frameData.ownerElement = ownerElement;
+ frameData.referrer = referrer;
+ frameData.allowsScrolling = allowsScrolling;
+ frameData.marginWidth = marginWidth;
+ frameData.marginHeight = marginHeight;
+
+ QWebFrame* webFrame = new QWebFrame(m_webFrame, &frameData);
+ emit m_webFrame->page()->frameCreated(webFrame);
+
+ RefPtr<Frame> childFrame = adoptRef(webFrame->d->frame);
+
+ // ### set override encoding if we have one
+
+ FrameLoadType loadType = m_frame->loader()->loadType();
+ FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedHistory;
+
+ childFrame->loader()->loadURL(frameData.url, frameData.referrer, String(), childLoadType, 0, 0);
+
+ // The frame's onload handler may have removed it from the document.
+ if (!childFrame->tree()->parent())
+ return 0;
+
+ return childFrame.release();
+}
+
+ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& _mimeType)
+{
+// qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<_mimeType;
+ if (_mimeType == "application/x-qt-plugin" || _mimeType == "application/x-qt-styled-widget")
+ return ObjectContentOtherPlugin;
+
+ if (url.isEmpty() && !_mimeType.length())
+ return ObjectContentNone;
+
+ String mimeType = _mimeType;
+ if (!mimeType.length()) {
+ QFileInfo fi(url.path());
+ mimeType = MIMETypeRegistry::getMIMETypeForExtension(fi.suffix());
+ }
+
+ if (!mimeType.length())
+ return ObjectContentFrame;
+
+ if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
+ return ObjectContentImage;
+
+ if (PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType))
+ return ObjectContentNetscapePlugin;
+
+ if (m_frame->page() && m_frame->page()->pluginData() && m_frame->page()->pluginData()->supportsMimeType(mimeType))
+ return ObjectContentOtherPlugin;
+
+ if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
+ return ObjectContentFrame;
+
+ if (url.protocol() == "about")
+ return ObjectContentFrame;
+
+ return ObjectContentNone;
+}
+
+static const CSSPropertyID qstyleSheetProperties[] = {
+ CSSPropertyColor,
+ CSSPropertyFontFamily,
+ CSSPropertyFontSize,
+ CSSPropertyFontStyle,
+ CSSPropertyFontWeight
+};
+
+const unsigned numqStyleSheetProperties = sizeof(qstyleSheetProperties) / sizeof(qstyleSheetProperties[0]);
+
+class QtPluginWidget: public Widget
+{
+public:
+ QtPluginWidget(QWidget* w = 0): Widget(w) {}
+ ~QtPluginWidget()
+ {
+ if (platformWidget())
+ platformWidget()->deleteLater();
+ }
+ virtual void invalidateRect(const IntRect& r)
+ {
+ if (platformWidget())
+ platformWidget()->update(r);
+ }
+ virtual void frameRectsChanged()
+ {
+ if (!platformWidget())
+ return;
+
+ IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height()));
+ platformWidget()->setGeometry(windowRect);
+
+ ScrollView* parentScrollView = parent();
+ if (!parentScrollView)
+ return;
+
+ ASSERT(parentScrollView->isFrameView());
+ IntRect clipRect(static_cast<FrameView*>(parentScrollView)->windowClipRect());
+ clipRect.move(-windowRect.x(), -windowRect.y());
+ clipRect.intersect(platformWidget()->rect());
+ platformWidget()->setMask(QRegion(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()));
+ }
+};
+
+Widget* FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames,
+ const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+{
+// qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.prettyURL() << mimeType;
+// qDebug()<<"------\t url = "<<url.prettyURL();
+
+ if (!m_webFrame)
+ return 0;
+
+ QStringList params;
+ QStringList values;
+ QString classid(element->getAttribute("classid"));
+
+ for (int i = 0; i < paramNames.size(); ++i) {
+ params.append(paramNames[i]);
+ if (paramNames[i] == "classid")
+ classid = paramValues[i];
+ }
+ for (int i = 0; i < paramValues.size(); ++i)
+ values.append(paramValues[i]);
+
+ QString urlStr(url.string());
+ QUrl qurl = urlStr;
+
+ QObject* object = 0;
+
+ if (mimeType == "application/x-qt-plugin" || mimeType == "application/x-qt-styled-widget") {
+ object = m_webFrame->page()->createPlugin(classid, qurl, params, values);
+#ifndef QT_NO_STYLE_STYLESHEET
+ QWidget* widget = qobject_cast<QWidget*>(object);
+ if (widget && mimeType == "application/x-qt-styled-widget") {
+
+ QString styleSheet = element->getAttribute("style");
+ if (!styleSheet.isEmpty())
+ styleSheet += QLatin1Char(';');
+
+ for (int i = 0; i < numqStyleSheetProperties; ++i) {
+ CSSPropertyID property = qstyleSheetProperties[i];
+
+ styleSheet += QString::fromLatin1(::getPropertyName(property));
+ styleSheet += QLatin1Char(':');
+ styleSheet += computedStyle(element)->getPropertyValue(property);
+ styleSheet += QLatin1Char(';');
+ }
+
+ widget->setStyleSheet(styleSheet);
+ }
+#endif // QT_NO_STYLE_STYLESHEET
+ }
+
+#if QT_VERSION >= 0x040400
+ if (!object) {
+ QWebPluginFactory* factory = m_webFrame->page()->pluginFactory();
+ if (factory)
+ object = factory->create(mimeType, qurl, params, values);
+ }
+#endif
+
+ if (object) {
+ QWidget* widget = qobject_cast<QWidget*>(object);
+ if (widget) {
+ QWidget* view = m_webFrame->page()->view();
+ if (view)
+ widget->setParent(view);
+ QtPluginWidget* w = new QtPluginWidget();
+ w->setPlatformWidget(widget);
+ // Make sure it's invisible until properly placed into the layout
+ w->setFrameRect(IntRect(0, 0, 0, 0));
+ return w;
+ }
+ // FIXME: make things work for widgetless plugins as well
+ delete object;
+ } else { // NPAPI Plugins
+ PluginView* pluginView = PluginView::create(m_frame, pluginSize, element, url,
+ paramNames, paramValues, mimeType, loadManually);
+ return pluginView;
+ }
+
+ return 0;
+}
+
+void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget)
+{
+ ASSERT(!m_pluginView);
+ m_pluginView = static_cast<PluginView*>(pluginWidget);
+ m_hasSentResponseToPlugin = false;
+}
+
+Widget* FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL,
+ const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+ notImplemented();
+ return 0;
+}
+
+String FrameLoaderClientQt::overrideMediaType() const
+{
+ return String();
+}
+
+QString FrameLoaderClientQt::chooseFile(const QString& oldFile)
+{
+ return webFrame()->page()->chooseFile(webFrame(), oldFile);
+}
+
+}
+
+#include "moc_FrameLoaderClientQt.cpp"
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
new file mode 100644
index 0000000..c743c23
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef FrameLoaderClientQt_H
+#define FrameLoaderClientQt_H
+
+#include <qobject.h>
+#include <QUrl>
+
+#include "FrameLoaderClient.h"
+#include "KURL.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "RefCounted.h"
+#include "ResourceResponse.h"
+#include "PluginView.h"
+class QWebFrame;
+
+namespace WebCore {
+
+ class AuthenticationChallenge;
+ class DocumentLoader;
+ class Element;
+ class FormState;
+ class NavigationAction;
+ class String;
+ class ResourceLoader;
+
+ struct LoadErrorResetToken;
+
+ class FrameLoaderClientQt : public QObject, public FrameLoaderClient {
+ Q_OBJECT
+
+ friend class ::QWebFrame;
+ void callPolicyFunction(FramePolicyFunction function, PolicyAction action);
+ private slots:
+ void slotCallPolicyFunction(int);
+ signals:
+ void sigCallPolicyFunction(int);
+ void loadStarted();
+ void loadProgress(int d);
+ void loadFinished(bool);
+ void titleChanged(const QString& title);
+
+ public:
+ FrameLoaderClientQt();
+ ~FrameLoaderClientQt();
+ virtual void frameLoaderDestroyed();
+
+ void setFrame(QWebFrame* webFrame, Frame* frame);
+ QWebFrame* webFrame() const;
+
+ virtual bool hasWebView() const; // mainly for assertions
+
+ virtual void makeRepresentation(DocumentLoader*);
+ virtual void forceLayout();
+ virtual void forceLayoutForNonHTML();
+
+ virtual void setCopiesOnScroll();
+
+ virtual void detachedFromParent2();
+ virtual void detachedFromParent3();
+
+ virtual void assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&);
+
+ virtual void dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long, WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
+ virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier);
+ virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
+ virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
+ virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long, const WebCore::ResourceResponse&);
+ virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long, int);
+ virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long);
+ virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long, const WebCore::ResourceError&);
+ virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int);
+
+ virtual void dispatchDidHandleOnloadEvents();
+ virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
+ virtual void dispatchDidCancelClientRedirect();
+ virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate);
+ virtual void dispatchDidChangeLocationWithinPage();
+ virtual void dispatchWillClose();
+ virtual void dispatchDidReceiveIcon();
+ virtual void dispatchDidStartProvisionalLoad();
+ virtual void dispatchDidReceiveTitle(const String& title);
+ virtual void dispatchDidCommitLoad();
+ virtual void dispatchDidFailProvisionalLoad(const ResourceError&);
+ virtual void dispatchDidFailLoad(const WebCore::ResourceError&);
+ virtual void dispatchDidFinishDocumentLoad();
+ virtual void dispatchDidFinishLoad();
+ virtual void dispatchDidFirstLayout();
+ virtual void dispatchDidFirstVisuallyNonEmptyLayout();
+
+ virtual WebCore::Frame* dispatchCreatePage();
+ virtual void dispatchShow();
+
+ virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WebCore::String&, const WebCore::ResourceRequest&);
+ virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>, const WebCore::String&);
+ virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>);
+ virtual void cancelPolicyCheck();
+
+ virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&);
+
+ virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr<FormState>);
+
+ virtual void dispatchDidLoadMainResource(DocumentLoader*);
+ virtual void revertToProvisionalState(DocumentLoader*);
+ virtual void setMainDocumentError(DocumentLoader*, const ResourceError&);
+
+ virtual void postProgressStartedNotification();
+ virtual void postProgressEstimateChangedNotification();
+ virtual void postProgressFinishedNotification();
+
+ virtual void setMainFrameDocumentReady(bool);
+
+ virtual void startDownload(const WebCore::ResourceRequest&);
+
+ virtual void willChangeTitle(DocumentLoader*);
+ virtual void didChangeTitle(DocumentLoader*);
+
+ virtual void committedLoad(WebCore::DocumentLoader*, const char*, int);
+ virtual void finishedLoading(DocumentLoader*);
+
+ virtual void updateGlobalHistory();
+ virtual bool shouldGoToHistoryItem(HistoryItem*) const;
+
+ virtual ResourceError cancelledError(const ResourceRequest&);
+ virtual ResourceError blockedError(const ResourceRequest&);
+ virtual ResourceError cannotShowURLError(const ResourceRequest&);
+ virtual ResourceError interruptForPolicyChangeError(const ResourceRequest&);
+
+ virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&);
+ virtual ResourceError fileDoesNotExistError(const ResourceResponse&);
+ virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&);
+
+ virtual bool shouldFallBack(const ResourceError&);
+
+ virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
+ virtual bool canShowMIMEType(const String& MIMEType) const;
+ virtual bool representationExistsForURLScheme(const String& URLScheme) const;
+ virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const;
+
+ virtual void frameLoadCompleted();
+ virtual void saveViewStateToItem(WebCore::HistoryItem*);
+ virtual void restoreViewState();
+ virtual void provisionalLoadStarted();
+ virtual void didFinishLoad();
+ virtual void prepareForDataSourceReplacement();
+
+ virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
+ virtual void setTitle(const String& title, const KURL&);
+
+ virtual String userAgent(const WebCore::KURL&);
+
+ virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedForNewPage();
+
+ virtual bool canCachePage() const;
+ virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
+
+ virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
+ const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) ;
+ virtual Widget* createPlugin(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);
+ virtual void redirectDataToPlugin(Widget* pluginWidget);
+
+ virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues);
+
+ virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
+ virtual String overrideMediaType() const;
+
+ virtual void windowObjectCleared();
+ virtual void didPerformFirstNavigation() const;
+
+ virtual void registerForIconNotification(bool);
+
+ QString chooseFile(const QString& oldFile);
+
+ private:
+ Frame *m_frame;
+ QWebFrame *m_webFrame;
+ ResourceResponse m_response;
+ bool m_firstData;
+ FramePolicyFunction m_policyFunction;
+
+ // Plugin view to redirect data to
+ WebCore::PluginView* m_pluginView;
+ bool m_hasSentResponseToPlugin;
+
+ bool m_loadSucceeded;
+ };
+
+}
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
new file mode 100644
index 0000000..7335280
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InspectorClientQt.h"
+
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include "qwebview.h"
+
+#include <QtCore/QCoreApplication>
+
+#include "InspectorController.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+class InspectorClientWebPage : public QWebPage
+{
+ Q_OBJECT
+ friend class InspectorClientQt;
+public:
+ QWebPage* createWindow(QWebPage::WebWindowType)
+ {
+ QWidget *w = new QWebView(0);
+ QWebPage *page = new QWebPage(w);
+ page->setView(w);
+ connect(page, SIGNAL(destroyed()), w, SLOT(deleteLater()));
+ return page;
+ }
+
+Q_SIGNALS:
+ void attachRequested();
+ void detachRequested();
+};
+
+
+class InspectorClientView : public QWebView {
+public:
+ InspectorClientView(InspectorController* controller)
+ : QWebView(0)
+ , m_controller(controller)
+ {
+ setPage(new InspectorClientWebPage);
+ connect(page(), SIGNAL(destroyed()), SLOT(deleteLater()));
+ }
+
+protected:
+
+ void closeEvent(QCloseEvent* ev)
+ {
+ QWidget::closeEvent(ev);
+ m_controller->setWindowVisible(false);
+ }
+
+private:
+ InspectorController* m_controller;
+};
+
+
+InspectorClientQt::InspectorClientQt(QWebPage* page)
+ : m_inspectedWebPage(page)
+{}
+
+void InspectorClientQt::inspectorDestroyed()
+{
+ delete this;
+}
+
+Page* InspectorClientQt::createPage()
+{
+ if (m_webPage)
+ return m_webPage->d->page;
+
+ InspectorClientView* view = new InspectorClientView(m_inspectedWebPage->d->page->inspectorController());
+ m_webPage.set(qobject_cast<InspectorClientWebPage*>(view->page()));
+ m_webPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
+ m_webPage->view()->setMinimumSize(400,300);
+ return m_webPage->d->page;
+}
+
+String InspectorClientQt::localizedStringsURL()
+{
+ notImplemented();
+ return String();
+}
+
+void InspectorClientQt::showWindow()
+{
+ if (!m_webPage)
+ return;
+
+ updateWindowTitle();
+ m_webPage->view()->show();
+ m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(true);
+}
+
+void InspectorClientQt::closeWindow()
+{
+ if (!m_webPage)
+ return;
+
+ m_webPage->view()->hide();
+ m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(false);
+}
+
+bool InspectorClientQt::windowVisible()
+{
+ if (!m_webPage)
+ return false;
+ return m_webPage->view()->isVisible();
+}
+
+void InspectorClientQt::attachWindow()
+{
+ if (!m_webPage)
+ return;
+
+ emit m_webPage->attachRequested();
+}
+
+void InspectorClientQt::detachWindow()
+{
+ if (!m_webPage)
+ return;
+
+ emit m_webPage->detachRequested();
+}
+
+void InspectorClientQt::setAttachedWindowHeight(unsigned height)
+{
+ notImplemented();
+}
+
+void InspectorClientQt::highlight(Node* node)
+{
+ notImplemented();
+}
+
+void InspectorClientQt::hideHighlight()
+{
+ notImplemented();
+}
+
+void InspectorClientQt::inspectedURLChanged(const String& newURL)
+{
+ m_inspectedURL = newURL;
+ updateWindowTitle();
+}
+
+void InspectorClientQt::updateWindowTitle()
+{
+ if (!m_webPage)
+ return;
+
+ QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2");
+ m_webPage->view()->setWindowTitle(caption.arg(m_inspectedURL));
+}
+
+void InspectorClientQt::populateSetting(const String& key, InspectorController::Setting& setting)
+{
+ notImplemented();
+}
+
+void InspectorClientQt::storeSetting(const String& key, const InspectorController::Setting& setting)
+{
+ notImplemented();
+}
+
+void InspectorClientQt::removeSetting(const String& key)
+{
+ notImplemented();
+}
+
+}
+
+#include "InspectorClientQt.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
new file mode 100644
index 0000000..49c2d56
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorClientQt_h
+#define InspectorClientQt_h
+
+#include "InspectorClient.h"
+#include "OwnPtr.h"
+#include <QtCore/QString>
+
+class QWebPage;
+
+namespace WebCore {
+ class Node;
+ class Page;
+ class String;
+ class InspectorClientWebPage;
+
+ class InspectorClientQt : public InspectorClient {
+ public:
+ InspectorClientQt(QWebPage*);
+
+ virtual void inspectorDestroyed();
+
+ virtual Page* createPage();
+
+ virtual String localizedStringsURL();
+
+ virtual void showWindow();
+ virtual void closeWindow();
+ virtual bool windowVisible();
+
+ virtual void attachWindow();
+ virtual void detachWindow();
+
+ virtual void setAttachedWindowHeight(unsigned height);
+
+ virtual void highlight(Node*);
+ virtual void hideHighlight();
+ virtual void inspectedURLChanged(const String& newURL);
+
+ virtual void populateSetting(const String& key, InspectorController::Setting&);
+ virtual void storeSetting(const String& key, const InspectorController::Setting&);
+ virtual void removeSetting(const String& key);
+
+ private:
+ void updateWindowTitle();
+ QWebPage* m_inspectedWebPage;
+ OwnPtr<InspectorClientWebPage> m_webPage;
+ QString m_inspectedURL;
+ };
+}
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h b/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h
new file mode 100644
index 0000000..ae8ec88
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h
@@ -0,0 +1,83 @@
+/*
+ * This file is part of the precompiled header for all of WebKit.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This is a precompiled header file for use in Xcode / Mac GCC /
+ * GCC >= 3.4 / VC to greatly speed the building of QtWebKit.
+ *
+ * The order of the includes appears random and arbitrary. But unfortunately
+ * MSVC is very sensitive and behaves fairly strange when compiling with
+ * precompiled headers. Please be very careful when adding, removing or
+ * changing the order of included header files.
+ */
+
+
+#if defined __cplusplus
+
+#if defined(_WIN32) && !defined(_WIN32_WCE)
+#define _CRT_RAND_S
+#define _WIN32_WINNT 0x0500
+#include <windows.h>
+#endif
+
+#include "../../JavaScriptCore/config.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <algorithm>
+#include <assert.h>
+#include <ctype.h>
+#include <limits.h>
+
+#include <wtf/HashTable.h>
+#include <wtf/Vector.h>
+#include <wtf/ListHashSet.h>
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/HashTraits.h>
+#include <wtf/HashIterators.h>
+#include <wtf/TCPageMap.h>
+#include <wtf/Assertions.h>
+#include <wtf/HashCountedSet.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Platform.h>
+#include <wtf/RefPtr.h>
+#include <wtf/VectorTraits.h>
+#include <wtf/MathExtras.h>
+#include <wtf/HashFunctions.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/OwnArrayPtr.h>
+#include <wtf/ListRefPtr.h>
+#include <wtf/FastMalloc.h>
+#include <wtf/TCSystemAlloc.h>
+#include <wtf/StringExtras.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Forward.h>
+#include <wtf/UnusedParam.h>
+#include <wtf/AlwaysInline.h>
+#include <wtf/GetPtr.h>
+
+#include "../../WebCore/bindings/js/JSDOMBinding.h"
+#include "../../JavaScriptCore/runtime/MathObject.h"
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/image.png b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/image.png
new file mode 100644
index 0000000..8d70364
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/image.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
new file mode 100644
index 0000000..e45e6dc
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+TARGET = tst_qwebframe
+include(../../../../WebKit.pri)
+SOURCES += tst_qwebframe.cpp
+RESOURCES += qwebframe.qrc
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
new file mode 100644
index 0000000..69e62d9
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+<file>image.png</file>
+</qresource>
+</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
new file mode 100644
index 0000000..36660a3
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -0,0 +1,2355 @@
+/*
+ Copyright (C) 2008,2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+#include <QtTest/QtTest>
+
+#include <qwebpage.h>
+#include <qwidget.h>
+#include <qwebview.h>
+#include <qwebframe.h>
+#include <qwebhistory.h>
+#include <QAbstractItemView>
+#include <QApplication>
+#include <QComboBox>
+#include <QRegExp>
+#include <QNetworkRequest>
+//TESTED_CLASS=
+//TESTED_FILES=
+
+// Task 160192
+/**
+ * Starts an event loop that runs until the given signal is received.
+ Optionally the event loop
+ * can return earlier on a timeout.
+ *
+ * \return \p true if the requested signal was received
+ * \p false on timeout
+ */
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
+{
+ QEventLoop loop;
+ QObject::connect(obj, signal, &loop, SLOT(quit()));
+ QTimer timer;
+ QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
+ if (timeout > 0) {
+ QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.setSingleShot(true);
+ timer.start(timeout);
+ }
+ loop.exec();
+ return timeoutSpy.isEmpty();
+}
+
+/* Mostly a test for the JavaScript related parts of QWebFrame */
+
+
+struct CustomType {
+ QString string;
+};
+Q_DECLARE_METATYPE(CustomType)
+
+Q_DECLARE_METATYPE(QBrush*)
+Q_DECLARE_METATYPE(QObjectList)
+Q_DECLARE_METATYPE(QList<int>)
+Q_DECLARE_METATYPE(Qt::BrushStyle)
+Q_DECLARE_METATYPE(QVariantList)
+Q_DECLARE_METATYPE(QVariantMap)
+
+class MyQObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty)
+ Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty)
+ Q_PROPERTY(QVariantList variantListProperty READ variantListProperty WRITE setVariantListProperty)
+ Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty)
+ Q_PROPERTY(QStringList stringListProperty READ stringListProperty WRITE setStringListProperty)
+ Q_PROPERTY(QByteArray byteArrayProperty READ byteArrayProperty WRITE setByteArrayProperty)
+ Q_PROPERTY(QBrush brushProperty READ brushProperty WRITE setBrushProperty)
+ Q_PROPERTY(double hiddenProperty READ hiddenProperty WRITE setHiddenProperty SCRIPTABLE false)
+ Q_PROPERTY(int writeOnlyProperty WRITE setWriteOnlyProperty)
+ Q_PROPERTY(int readOnlyProperty READ readOnlyProperty)
+ Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
+ Q_PROPERTY(CustomType propWithCustomType READ propWithCustomType WRITE setPropWithCustomType)
+ Q_ENUMS(Policy Strategy)
+ Q_FLAGS(Ability)
+
+public:
+ enum Policy {
+ FooPolicy = 0,
+ BarPolicy,
+ BazPolicy
+ };
+
+ enum Strategy {
+ FooStrategy = 10,
+ BarStrategy,
+ BazStrategy
+ };
+
+ enum AbilityFlag {
+ NoAbility = 0x000,
+ FooAbility = 0x001,
+ BarAbility = 0x080,
+ BazAbility = 0x200,
+ AllAbility = FooAbility | BarAbility | BazAbility
+ };
+
+ Q_DECLARE_FLAGS(Ability, AbilityFlag)
+
+ MyQObject(QObject* parent = 0)
+ : QObject(parent),
+ m_intValue(123),
+ m_variantValue(QLatin1String("foo")),
+ m_variantListValue(QVariantList() << QVariant(123) << QVariant(QLatin1String("foo"))),
+ m_stringValue(QLatin1String("bar")),
+ m_stringListValue(QStringList() << QLatin1String("zig") << QLatin1String("zag")),
+ m_brushValue(QColor(10, 20, 30, 40)),
+ m_hiddenValue(456.0),
+ m_writeOnlyValue(789),
+ m_readOnlyValue(987),
+ m_qtFunctionInvoked(-1) { }
+
+ ~MyQObject() { }
+
+ int intProperty() const {
+ return m_intValue;
+ }
+ void setIntProperty(int value) {
+ m_intValue = value;
+ }
+
+ QVariant variantProperty() const {
+ return m_variantValue;
+ }
+ void setVariantProperty(const QVariant &value) {
+ m_variantValue = value;
+ }
+
+ QVariantList variantListProperty() const {
+ return m_variantListValue;
+ }
+ void setVariantListProperty(const QVariantList &value) {
+ m_variantListValue = value;
+ }
+
+ QString stringProperty() const {
+ return m_stringValue;
+ }
+ void setStringProperty(const QString &value) {
+ m_stringValue = value;
+ }
+
+ QStringList stringListProperty() const {
+ return m_stringListValue;
+ }
+ void setStringListProperty(const QStringList &value) {
+ m_stringListValue = value;
+ }
+
+ QByteArray byteArrayProperty() const {
+ return m_byteArrayValue;
+ }
+ void setByteArrayProperty(const QByteArray &value) {
+ m_byteArrayValue = value;
+ }
+
+ QBrush brushProperty() const {
+ return m_brushValue;
+ }
+ Q_INVOKABLE void setBrushProperty(const QBrush &value) {
+ m_brushValue = value;
+ }
+
+ double hiddenProperty() const {
+ return m_hiddenValue;
+ }
+ void setHiddenProperty(double value) {
+ m_hiddenValue = value;
+ }
+
+ int writeOnlyProperty() const {
+ return m_writeOnlyValue;
+ }
+ void setWriteOnlyProperty(int value) {
+ m_writeOnlyValue = value;
+ }
+
+ int readOnlyProperty() const {
+ return m_readOnlyValue;
+ }
+
+ QKeySequence shortcut() const {
+ return m_shortcut;
+ }
+ void setShortcut(const QKeySequence &seq) {
+ m_shortcut = seq;
+ }
+
+ CustomType propWithCustomType() const {
+ return m_customType;
+ }
+ void setPropWithCustomType(const CustomType &c) {
+ m_customType = c;
+ }
+
+ int qtFunctionInvoked() const {
+ return m_qtFunctionInvoked;
+ }
+
+ QVariantList qtFunctionActuals() const {
+ return m_actuals;
+ }
+
+ void resetQtFunctionInvoked() {
+ m_qtFunctionInvoked = -1;
+ m_actuals.clear();
+ }
+
+ Q_INVOKABLE void myInvokable() {
+ m_qtFunctionInvoked = 0;
+ }
+ Q_INVOKABLE void myInvokableWithIntArg(int arg) {
+ m_qtFunctionInvoked = 1;
+ m_actuals << arg;
+ }
+ Q_INVOKABLE void myInvokableWithLonglongArg(qlonglong arg) {
+ m_qtFunctionInvoked = 2;
+ m_actuals << arg;
+ }
+ Q_INVOKABLE void myInvokableWithFloatArg(float arg) {
+ m_qtFunctionInvoked = 3;
+ m_actuals << arg;
+ }
+ Q_INVOKABLE void myInvokableWithDoubleArg(double arg) {
+ m_qtFunctionInvoked = 4;
+ m_actuals << arg;
+ }
+ Q_INVOKABLE void myInvokableWithStringArg(const QString &arg) {
+ m_qtFunctionInvoked = 5;
+ m_actuals << arg;
+ }
+ Q_INVOKABLE void myInvokableWithIntArgs(int arg1, int arg2) {
+ m_qtFunctionInvoked = 6;
+ m_actuals << arg1 << arg2;
+ }
+ Q_INVOKABLE int myInvokableReturningInt() {
+ m_qtFunctionInvoked = 7;
+ return 123;
+ }
+ Q_INVOKABLE qlonglong myInvokableReturningLongLong() {
+ m_qtFunctionInvoked = 39;
+ return 456;
+ }
+ Q_INVOKABLE QString myInvokableReturningString() {
+ m_qtFunctionInvoked = 8;
+ return QLatin1String("ciao");
+ }
+ Q_INVOKABLE void myInvokableWithIntArg(int arg1, int arg2) { // overload
+ m_qtFunctionInvoked = 9;
+ m_actuals << arg1 << arg2;
+ }
+ Q_INVOKABLE void myInvokableWithEnumArg(Policy policy) {
+ m_qtFunctionInvoked = 10;
+ m_actuals << policy;
+ }
+ Q_INVOKABLE void myInvokableWithQualifiedEnumArg(MyQObject::Policy policy) {
+ m_qtFunctionInvoked = 36;
+ m_actuals << policy;
+ }
+ Q_INVOKABLE Policy myInvokableReturningEnum() {
+ m_qtFunctionInvoked = 37;
+ return BazPolicy;
+ }
+ Q_INVOKABLE MyQObject::Policy myInvokableReturningQualifiedEnum() {
+ m_qtFunctionInvoked = 38;
+ return BazPolicy;
+ }
+ Q_INVOKABLE QVector<int> myInvokableReturningVectorOfInt() {
+ m_qtFunctionInvoked = 11;
+ return QVector<int>();
+ }
+ Q_INVOKABLE void myInvokableWithVectorOfIntArg(const QVector<int> &) {
+ m_qtFunctionInvoked = 12;
+ }
+ Q_INVOKABLE QObject* myInvokableReturningQObjectStar() {
+ m_qtFunctionInvoked = 13;
+ return this;
+ }
+ Q_INVOKABLE QObjectList myInvokableWithQObjectListArg(const QObjectList &lst) {
+ m_qtFunctionInvoked = 14;
+ m_actuals << qVariantFromValue(lst);
+ return lst;
+ }
+ Q_INVOKABLE QVariant myInvokableWithVariantArg(const QVariant &v) {
+ m_qtFunctionInvoked = 15;
+ m_actuals << v;
+ return v;
+ }
+ Q_INVOKABLE QVariantMap myInvokableWithVariantMapArg(const QVariantMap &vm) {
+ m_qtFunctionInvoked = 16;
+ m_actuals << vm;
+ return vm;
+ }
+ Q_INVOKABLE QList<int> myInvokableWithListOfIntArg(const QList<int> &lst) {
+ m_qtFunctionInvoked = 17;
+ m_actuals << qVariantFromValue(lst);
+ return lst;
+ }
+ Q_INVOKABLE QObject* myInvokableWithQObjectStarArg(QObject* obj) {
+ m_qtFunctionInvoked = 18;
+ m_actuals << qVariantFromValue(obj);
+ return obj;
+ }
+ Q_INVOKABLE QBrush myInvokableWithQBrushArg(const QBrush &brush) {
+ m_qtFunctionInvoked = 19;
+ m_actuals << qVariantFromValue(brush);
+ return brush;
+ }
+ Q_INVOKABLE void myInvokableWithBrushStyleArg(Qt::BrushStyle style) {
+ m_qtFunctionInvoked = 43;
+ m_actuals << qVariantFromValue(style);
+ }
+ Q_INVOKABLE void myInvokableWithVoidStarArg(void* arg) {
+ m_qtFunctionInvoked = 44;
+ m_actuals << qVariantFromValue(arg);
+ }
+ Q_INVOKABLE void myInvokableWithAmbiguousArg(int arg) {
+ m_qtFunctionInvoked = 45;
+ m_actuals << qVariantFromValue(arg);
+ }
+ Q_INVOKABLE void myInvokableWithAmbiguousArg(uint arg) {
+ m_qtFunctionInvoked = 46;
+ m_actuals << qVariantFromValue(arg);
+ }
+ Q_INVOKABLE void myInvokableWithDefaultArgs(int arg1, const QString &arg2 = "") {
+ m_qtFunctionInvoked = 47;
+ m_actuals << qVariantFromValue(arg1) << qVariantFromValue(arg2);
+ }
+ Q_INVOKABLE QObject& myInvokableReturningRef() {
+ m_qtFunctionInvoked = 48;
+ return *this;
+ }
+ Q_INVOKABLE const QObject& myInvokableReturningConstRef() const {
+ const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 49;
+ return *this;
+ }
+ Q_INVOKABLE void myInvokableWithPointArg(const QPoint &arg) {
+ const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 50;
+ m_actuals << qVariantFromValue(arg);
+ }
+ Q_INVOKABLE void myInvokableWithPointArg(const QPointF &arg) {
+ const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 51;
+ m_actuals << qVariantFromValue(arg);
+ }
+ Q_INVOKABLE void myInvokableWithBoolArg(bool arg) {
+ m_qtFunctionInvoked = 52;
+ m_actuals << arg;
+ }
+
+ void emitMySignal() {
+ emit mySignal();
+ }
+ void emitMySignalWithIntArg(int arg) {
+ emit mySignalWithIntArg(arg);
+ }
+ void emitMySignal2(bool arg) {
+ emit mySignal2(arg);
+ }
+ void emitMySignal2() {
+ emit mySignal2();
+ }
+ void emitMySignalWithDateTimeArg(QDateTime dt) {
+ emit mySignalWithDateTimeArg(dt);
+ }
+ void emitMySignalWithRegexArg(QRegExp r) {
+ emit mySignalWithRegexArg(r);
+ }
+
+public Q_SLOTS:
+ void mySlot() {
+ m_qtFunctionInvoked = 20;
+ }
+ void mySlotWithIntArg(int arg) {
+ m_qtFunctionInvoked = 21;
+ m_actuals << arg;
+ }
+ void mySlotWithDoubleArg(double arg) {
+ m_qtFunctionInvoked = 22;
+ m_actuals << arg;
+ }
+ void mySlotWithStringArg(const QString &arg) {
+ m_qtFunctionInvoked = 23;
+ m_actuals << arg;
+ }
+
+ void myOverloadedSlot() {
+ m_qtFunctionInvoked = 24;
+ }
+ void myOverloadedSlot(QObject* arg) {
+ m_qtFunctionInvoked = 41;
+ m_actuals << qVariantFromValue(arg);
+ }
+ void myOverloadedSlot(bool arg) {
+ m_qtFunctionInvoked = 25;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QStringList &arg) {
+ m_qtFunctionInvoked = 42;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(double arg) {
+ m_qtFunctionInvoked = 26;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(float arg) {
+ m_qtFunctionInvoked = 27;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(int arg) {
+ m_qtFunctionInvoked = 28;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QString &arg) {
+ m_qtFunctionInvoked = 29;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QColor &arg) {
+ m_qtFunctionInvoked = 30;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QBrush &arg) {
+ m_qtFunctionInvoked = 31;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QDateTime &arg) {
+ m_qtFunctionInvoked = 32;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QDate &arg) {
+ m_qtFunctionInvoked = 33;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QRegExp &arg) {
+ m_qtFunctionInvoked = 34;
+ m_actuals << arg;
+ }
+ void myOverloadedSlot(const QVariant &arg) {
+ m_qtFunctionInvoked = 35;
+ m_actuals << arg;
+ }
+
+ void qscript_call(int arg) {
+ m_qtFunctionInvoked = 40;
+ m_actuals << arg;
+ }
+
+protected Q_SLOTS:
+ void myProtectedSlot() {
+ m_qtFunctionInvoked = 36;
+ }
+
+private Q_SLOTS:
+ void myPrivateSlot() { }
+
+Q_SIGNALS:
+ void mySignal();
+ void mySignalWithIntArg(int arg);
+ void mySignalWithDoubleArg(double arg);
+ void mySignal2(bool arg = false);
+ void mySignalWithDateTimeArg(QDateTime dt);
+ void mySignalWithRegexArg(QRegExp r);
+
+private:
+ int m_intValue;
+ QVariant m_variantValue;
+ QVariantList m_variantListValue;
+ QString m_stringValue;
+ QStringList m_stringListValue;
+ QByteArray m_byteArrayValue;
+ QBrush m_brushValue;
+ double m_hiddenValue;
+ int m_writeOnlyValue;
+ int m_readOnlyValue;
+ QKeySequence m_shortcut;
+ CustomType m_customType;
+ int m_qtFunctionInvoked;
+ QVariantList m_actuals;
+};
+
+class MyOtherQObject : public MyQObject
+{
+public:
+ MyOtherQObject(QObject* parent = 0)
+ : MyQObject(parent) { }
+};
+
+class MyEnumTestQObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString p1 READ p1)
+ Q_PROPERTY(QString p2 READ p2)
+ Q_PROPERTY(QString p3 READ p3 SCRIPTABLE false)
+ Q_PROPERTY(QString p4 READ p4)
+ Q_PROPERTY(QString p5 READ p5 SCRIPTABLE false)
+ Q_PROPERTY(QString p6 READ p6)
+public:
+ MyEnumTestQObject(QObject* parent = 0)
+ : QObject(parent) { }
+ QString p1() const {
+ return QLatin1String("p1");
+ }
+ QString p2() const {
+ return QLatin1String("p2");
+ }
+ QString p3() const {
+ return QLatin1String("p3");
+ }
+ QString p4() const {
+ return QLatin1String("p4");
+ }
+ QString p5() const {
+ return QLatin1String("p5");
+ }
+ QString p6() const {
+ return QLatin1String("p5");
+ }
+public Q_SLOTS:
+ void mySlot() { }
+ void myOtherSlot() { }
+Q_SIGNALS:
+ void mySignal();
+};
+
+class tst_QWebFrame : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QWebFrame();
+ virtual ~tst_QWebFrame();
+ bool eventFilter(QObject* watched, QEvent* event);
+
+public slots:
+ void init();
+ void cleanup();
+
+private slots:
+ void getSetStaticProperty();
+ void getSetDynamicProperty();
+ void getSetChildren();
+ void callQtInvokable();
+ void connectAndDisconnect();
+ void classEnums();
+ void classConstructor();
+ void overrideInvokable();
+ void transferInvokable();
+ void findChild();
+ void findChildren();
+ void overloadedSlots();
+ void enumerate_data();
+ void enumerate();
+ void objectDeleted();
+ void typeConversion();
+ void symmetricUrl();
+ void progressSignal();
+ void domCycles();
+ void setHtml();
+ void setHtmlWithResource();
+ void ipv6HostEncoding();
+ void metaData();
+ void popupFocus();
+ void jsByteArray();
+ void ownership();
+private:
+ QString evalJS(const QString&s) {
+ // Convert an undefined return variant to the string "undefined"
+ QVariant ret = evalJSV(s);
+ if (ret.userType() == QMetaType::Void)
+ return "undefined";
+ else
+ return ret.toString();
+ }
+ QVariant evalJSV(const QString &s) {
+ return m_page->mainFrame()->evaluateJavaScript(s);
+ }
+
+ QString evalJS(const QString&s, QString& type) {
+ return evalJSV(s, type).toString();
+ }
+ QVariant evalJSV(const QString &s, QString& type) {
+ // As a special measure, if we get an exception we set the type to 'error'
+ // (in ecma, an Error object has typeof object, but qtscript has a convenience function)
+ // Similarly, an array is an object, but we'd prefer to have a type of 'array'
+ // Also, consider a QMetaType::Void QVariant to be undefined
+ QString escaped = s;
+ escaped.replace('\'', "\\'"); // Don't preescape your single quotes!
+ evalJS("var retvalue;\
+ var typevalue; \
+ try {\
+ retvalue = eval('" + escaped + "'); \
+ typevalue = typeof retvalue; \
+ if (retvalue instanceof Array) \
+ typevalue = 'array'; \
+ } \
+ catch(e) {\
+ retvalue = e.name + ': ' + e.message;\
+ typevalue = 'error';\
+ }");
+ QVariant ret = evalJSV("retvalue");
+ if (ret.userType() != QMetaType::Void)
+ type = evalJS("typevalue");
+ else {
+ ret = QString("undefined");
+ type = sUndefined;
+ }
+ evalJS("delete retvalue; delete typevalue");
+ return ret;
+ }
+ QObject* firstChildByClassName(QObject* parent, const char* className) {
+ const QObjectList & children = parent->children();
+ foreach (QObject* child, children) {
+ if (!strcmp(child->metaObject()->className(), className)) {
+ return child;
+ }
+ }
+ return 0;
+ }
+
+ const QString sTrue;
+ const QString sFalse;
+ const QString sUndefined;
+ const QString sArray;
+ const QString sFunction;
+ const QString sError;
+ const QString sString;
+ const QString sObject;
+ const QString sNumber;
+
+private:
+ QWebView* m_view;
+ QWebPage* m_page;
+ MyQObject* m_myObject;
+ QWebView* m_popupTestView;
+ int m_popupTestPaintCount;
+};
+
+tst_QWebFrame::tst_QWebFrame()
+ : sTrue("true"), sFalse("false"), sUndefined("undefined"), sArray("array"), sFunction("function"), sError("error"),
+ sString("string"), sObject("object"), sNumber("number"), m_popupTestView(0), m_popupTestPaintCount(0)
+{
+}
+
+tst_QWebFrame::~tst_QWebFrame()
+{
+}
+
+bool tst_QWebFrame::eventFilter(QObject* watched, QEvent* event)
+{
+ // used on the popupFocus test
+ if (watched == m_popupTestView) {
+ if (event->type() == QEvent::Paint)
+ m_popupTestPaintCount++;
+ }
+ return QObject::eventFilter(watched, event);
+}
+
+void tst_QWebFrame::init()
+{
+ m_view = new QWebView();
+ m_page = m_view->page();
+ m_myObject = new MyQObject();
+ m_page->mainFrame()->addToJavaScriptWindowObject("myObject", m_myObject);
+}
+
+void tst_QWebFrame::cleanup()
+{
+ delete m_view;
+ delete m_myObject;
+}
+
+void tst_QWebFrame::getSetStaticProperty()
+{
+ QCOMPARE(evalJS("typeof myObject.noSuchProperty"), sUndefined);
+
+ // initial value (set in MyQObject constructor)
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.intProperty", type);
+ QCOMPARE(type, sNumber);
+ QCOMPARE(ret.type(), QVariant::Double);
+ QCOMPARE(ret.toInt(), 123);
+ }
+ QCOMPARE(evalJS("myObject.intProperty === 123.0"), sTrue);
+
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.variantProperty", type);
+ QCOMPARE(type, sString);
+ QCOMPARE(ret.type(), QVariant::String);
+ QCOMPARE(ret.toString(), QLatin1String("foo"));
+ }
+ QCOMPARE(evalJS("myObject.variantProperty == 'foo'"), sTrue);
+
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.stringProperty", type);
+ QCOMPARE(type, sString);
+ QCOMPARE(ret.type(), QVariant::String);
+ QCOMPARE(ret.toString(), QLatin1String("bar"));
+ }
+ QCOMPARE(evalJS("myObject.stringProperty === 'bar'"), sTrue);
+
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.variantListProperty", type);
+ QCOMPARE(type, sArray);
+ QCOMPARE(ret.type(), QVariant::List);
+ QVariantList vl = ret.value<QVariantList>();
+ QCOMPARE(vl.size(), 2);
+ QCOMPARE(vl.at(0).toInt(), 123);
+ QCOMPARE(vl.at(1).toString(), QLatin1String("foo"));
+ }
+ QCOMPARE(evalJS("myObject.variantListProperty.length === 2"), sTrue);
+ QCOMPARE(evalJS("myObject.variantListProperty[0] === 123"), sTrue);
+ QCOMPARE(evalJS("myObject.variantListProperty[1] === 'foo'"), sTrue);
+
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.stringListProperty", type);
+ QCOMPARE(type, sArray);
+ QCOMPARE(ret.type(), QVariant::List);
+ QVariantList vl = ret.value<QVariantList>();
+ QCOMPARE(vl.size(), 2);
+ QCOMPARE(vl.at(0).toString(), QLatin1String("zig"));
+ QCOMPARE(vl.at(1).toString(), QLatin1String("zag"));
+ }
+ QCOMPARE(evalJS("myObject.stringListProperty.length === 2"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.stringListProperty[0]"), sString);
+ QCOMPARE(evalJS("myObject.stringListProperty[0]"), QLatin1String("zig"));
+ QCOMPARE(evalJS("typeof myObject.stringListProperty[1]"), sString);
+ QCOMPARE(evalJS("myObject.stringListProperty[1]"), QLatin1String("zag"));
+
+ // property change in C++ should be reflected in script
+ m_myObject->setIntProperty(456);
+ QCOMPARE(evalJS("myObject.intProperty == 456"), sTrue);
+ m_myObject->setIntProperty(789);
+ QCOMPARE(evalJS("myObject.intProperty == 789"), sTrue);
+
+ m_myObject->setVariantProperty(QLatin1String("bar"));
+ QCOMPARE(evalJS("myObject.variantProperty === 'bar'"), sTrue);
+ m_myObject->setVariantProperty(42);
+ QCOMPARE(evalJS("myObject.variantProperty === 42"), sTrue);
+ m_myObject->setVariantProperty(qVariantFromValue(QBrush()));
+//XFAIL
+// QCOMPARE(evalJS("typeof myObject.variantProperty"), sVariant);
+
+ m_myObject->setStringProperty(QLatin1String("baz"));
+ QCOMPARE(evalJS("myObject.stringProperty === 'baz'"), sTrue);
+ m_myObject->setStringProperty(QLatin1String("zab"));
+ QCOMPARE(evalJS("myObject.stringProperty === 'zab'"), sTrue);
+
+ // property change in script should be reflected in C++
+ QCOMPARE(evalJS("myObject.intProperty = 123"), QLatin1String("123"));
+ QCOMPARE(evalJS("myObject.intProperty == 123"), sTrue);
+ QCOMPARE(m_myObject->intProperty(), 123);
+ QCOMPARE(evalJS("myObject.intProperty = 'ciao!';"
+ "myObject.intProperty == 0"), sTrue);
+ QCOMPARE(m_myObject->intProperty(), 0);
+ QCOMPARE(evalJS("myObject.intProperty = '123';"
+ "myObject.intProperty == 123"), sTrue);
+ QCOMPARE(m_myObject->intProperty(), 123);
+
+ QCOMPARE(evalJS("myObject.stringProperty = 'ciao'"), QLatin1String("ciao"));
+ QCOMPARE(evalJS("myObject.stringProperty"), QLatin1String("ciao"));
+ QCOMPARE(m_myObject->stringProperty(), QLatin1String("ciao"));
+ QCOMPARE(evalJS("myObject.stringProperty = 123;"
+ "myObject.stringProperty"), QLatin1String("123"));
+ QCOMPARE(m_myObject->stringProperty(), QLatin1String("123"));
+ QCOMPARE(evalJS("myObject.stringProperty = null"), QString());
+ QCOMPARE(evalJS("myObject.stringProperty"), QString());
+ QCOMPARE(m_myObject->stringProperty(), QString());
+ QCOMPARE(evalJS("myObject.stringProperty = undefined"), sUndefined);
+ QCOMPARE(evalJS("myObject.stringProperty"), QString());
+ QCOMPARE(m_myObject->stringProperty(), QString());
+
+ QCOMPARE(evalJS("myObject.variantProperty = new Number(1234);"
+ "myObject.variantProperty").toDouble(), 1234.0);
+ QCOMPARE(m_myObject->variantProperty().toDouble(), 1234.0);
+
+ QCOMPARE(evalJS("myObject.variantProperty = new Boolean(1234);"
+ "myObject.variantProperty"), sTrue);
+ QCOMPARE(m_myObject->variantProperty().toBool(), true);
+
+ QCOMPARE(evalJS("myObject.variantProperty = null;"
+ "myObject.variantProperty.valueOf()"), sUndefined);
+ QCOMPARE(m_myObject->variantProperty(), QVariant());
+ QCOMPARE(evalJS("myObject.variantProperty = undefined;"
+ "myObject.variantProperty.valueOf()"), sUndefined);
+ QCOMPARE(m_myObject->variantProperty(), QVariant());
+
+ QCOMPARE(evalJS("myObject.variantProperty = 'foo';"
+ "myObject.variantProperty.valueOf()"), QLatin1String("foo"));
+ QCOMPARE(m_myObject->variantProperty(), QVariant(QLatin1String("foo")));
+ QCOMPARE(evalJS("myObject.variantProperty = 42;"
+ "myObject.variantProperty").toDouble(), 42.0);
+ QCOMPARE(m_myObject->variantProperty().toDouble(), 42.0);
+
+ QCOMPARE(evalJS("myObject.variantListProperty = [1, 'two', true];"
+ "myObject.variantListProperty.length == 3"), sTrue);
+ QCOMPARE(evalJS("myObject.variantListProperty[0] === 1"), sTrue);
+ QCOMPARE(evalJS("myObject.variantListProperty[1]"), QLatin1String("two"));
+ QCOMPARE(evalJS("myObject.variantListProperty[2] === true"), sTrue);
+
+ QCOMPARE(evalJS("myObject.stringListProperty = [1, 'two', true];"
+ "myObject.stringListProperty.length == 3"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.stringListProperty[0]"), sString);
+ QCOMPARE(evalJS("myObject.stringListProperty[0] == '1'"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.stringListProperty[1]"), sString);
+ QCOMPARE(evalJS("myObject.stringListProperty[1]"), QLatin1String("two"));
+ QCOMPARE(evalJS("typeof myObject.stringListProperty[2]"), sString);
+ QCOMPARE(evalJS("myObject.stringListProperty[2]"), QLatin1String("true"));
+
+ // try to delete
+ QCOMPARE(evalJS("delete myObject.intProperty"), sFalse);
+ QCOMPARE(evalJS("myObject.intProperty == 123"), sTrue);
+
+ QCOMPARE(evalJS("delete myObject.variantProperty"), sFalse);
+ QCOMPARE(evalJS("myObject.variantProperty").toDouble(), 42.0);
+
+ // custom property
+ QCOMPARE(evalJS("myObject.customProperty"), sUndefined);
+ QCOMPARE(evalJS("myObject.customProperty = 123;"
+ "myObject.customProperty == 123"), sTrue);
+ QVariant v = m_page->mainFrame()->evaluateJavaScript("myObject.customProperty");
+ QCOMPARE(v.type(), QVariant::Double);
+ QCOMPARE(v.toInt(), 123);
+
+ // non-scriptable property
+ QCOMPARE(m_myObject->hiddenProperty(), 456.0);
+ QCOMPARE(evalJS("myObject.hiddenProperty"), sUndefined);
+ QCOMPARE(evalJS("myObject.hiddenProperty = 123;"
+ "myObject.hiddenProperty == 123"), sTrue);
+ QCOMPARE(m_myObject->hiddenProperty(), 456.0);
+
+ // write-only property
+ QCOMPARE(m_myObject->writeOnlyProperty(), 789);
+ QCOMPARE(evalJS("typeof myObject.writeOnlyProperty"), sUndefined);
+ QCOMPARE(evalJS("myObject.writeOnlyProperty = 123;"
+ "typeof myObject.writeOnlyProperty"), sUndefined);
+ QCOMPARE(m_myObject->writeOnlyProperty(), 123);
+
+ // read-only property
+ QCOMPARE(m_myObject->readOnlyProperty(), 987);
+ QCOMPARE(evalJS("myObject.readOnlyProperty == 987"), sTrue);
+ QCOMPARE(evalJS("myObject.readOnlyProperty = 654;"
+ "myObject.readOnlyProperty == 987"), sTrue);
+ QCOMPARE(m_myObject->readOnlyProperty(), 987);
+}
+
+void tst_QWebFrame::getSetDynamicProperty()
+{
+ // initially the object does not have the property
+ // In WebKit, RuntimeObjects do not inherit Object, so don't have hasOwnProperty
+
+ //QCOMPARE(evalJS("myObject.hasOwnProperty('dynamicProperty')"), sFalse);
+ QCOMPARE(evalJS("typeof myObject.dynamicProperty"), sUndefined);
+
+ // add a dynamic property in C++
+ QCOMPARE(m_myObject->setProperty("dynamicProperty", 123), false);
+ //QCOMPARE(evalJS("myObject.hasOwnProperty('dynamicProperty')"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.dynamicProperty != 'undefined'"), sTrue);
+ QCOMPARE(evalJS("myObject.dynamicProperty == 123"), sTrue);
+
+ // property change in script should be reflected in C++
+ QCOMPARE(evalJS("myObject.dynamicProperty = 'foo';"
+ "myObject.dynamicProperty"), QLatin1String("foo"));
+ QCOMPARE(m_myObject->property("dynamicProperty").toString(), QLatin1String("foo"));
+
+ // delete the property (XFAIL - can't delete properties)
+ QEXPECT_FAIL("", "can't delete properties", Continue);
+ QCOMPARE(evalJS("delete myObject.dynamicProperty"), sTrue);
+ /*
+ QCOMPARE(m_myObject->property("dynamicProperty").isValid(), false);
+ QCOMPARE(evalJS("typeof myObject.dynamicProperty"), sUndefined);
+ // QCOMPARE(evalJS("myObject.hasOwnProperty('dynamicProperty')"), sFalse);
+ QCOMPARE(evalJS("typeof myObject.dynamicProperty"), sUndefined);
+ */
+}
+
+void tst_QWebFrame::getSetChildren()
+{
+ // initially the object does not have the child
+ // (again, no hasOwnProperty)
+
+ //QCOMPARE(evalJS("myObject.hasOwnProperty('child')"), sFalse);
+ QCOMPARE(evalJS("typeof myObject.child"), sUndefined);
+
+ // add a child
+ MyQObject* child = new MyQObject(m_myObject);
+ child->setObjectName("child");
+// QCOMPARE(evalJS("myObject.hasOwnProperty('child')"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.child != 'undefined'"), sTrue);
+
+ // add a grandchild
+ MyQObject* grandChild = new MyQObject(child);
+ grandChild->setObjectName("grandChild");
+// QCOMPARE(evalJS("myObject.child.hasOwnProperty('grandChild')"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.child.grandChild != 'undefined'"), sTrue);
+
+ // delete grandchild
+ delete grandChild;
+// QCOMPARE(evalJS("myObject.child.hasOwnProperty('grandChild')"), sFalse);
+ QCOMPARE(evalJS("typeof myObject.child.grandChild == 'undefined'"), sTrue);
+
+ // delete child
+ delete child;
+// QCOMPARE(evalJS("myObject.hasOwnProperty('child')"), sFalse);
+ QCOMPARE(evalJS("typeof myObject.child == 'undefined'"), sTrue);
+}
+
+Q_DECLARE_METATYPE(QVector<int>)
+Q_DECLARE_METATYPE(QVector<double>)
+Q_DECLARE_METATYPE(QVector<QString>)
+
+void tst_QWebFrame::callQtInvokable()
+{
+ qRegisterMetaType<QObjectList>();
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokable()"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 0);
+ QCOMPARE(m_myObject->qtFunctionActuals(), QVariantList());
+
+ // extra arguments should silently be ignored
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokable(10, 20, 30)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 0);
+ QCOMPARE(m_myObject->qtFunctionActuals(), QVariantList());
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithIntArg(123)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 123);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithIntArg('123')"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 123);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithLonglongArg(123)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 2);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toLongLong(), qlonglong(123));
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithFloatArg(123.5)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 3);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDouble(), 123.5);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithDoubleArg(123.5)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 4);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDouble(), 123.5);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithDoubleArg(new Number(1234.5))"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 4);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDouble(), 1234.5);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithBoolArg(new Boolean(true))"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 52);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toBool(), true);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithStringArg('ciao')"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 5);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QLatin1String("ciao"));
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithStringArg(123)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 5);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QLatin1String("123"));
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithStringArg(null)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 5);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QString());
+ QVERIFY(m_myObject->qtFunctionActuals().at(0).toString().isEmpty());
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithStringArg(undefined)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 5);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QString());
+ QVERIFY(m_myObject->qtFunctionActuals().at(0).toString().isEmpty());
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithIntArgs(123, 456)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 6);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 2);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 123);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(1).toInt(), 456);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.myInvokableReturningInt()"), QLatin1String("123"));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 7);
+ QCOMPARE(m_myObject->qtFunctionActuals(), QVariantList());
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.myInvokableReturningLongLong()"), QLatin1String("456"));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 39);
+ QCOMPARE(m_myObject->qtFunctionActuals(), QVariantList());
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.myInvokableReturningString()"), QLatin1String("ciao"));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 8);
+ QCOMPARE(m_myObject->qtFunctionActuals(), QVariantList());
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithIntArg(123, 456)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 9);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 2);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 123);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(1).toInt(), 456);
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("typeof myObject.myInvokableWithVoidStarArg(null)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 44);
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokableWithVoidStarArg(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: incompatible type of argument(s) in call to myInvokableWithVoidStarArg(); candidates were\n myInvokableWithVoidStarArg(void*)"));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), -1);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokableWithAmbiguousArg(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: ambiguous call of overloaded function myInvokableWithAmbiguousArg(); candidates were\n myInvokableWithAmbiguousArg(int)\n myInvokableWithAmbiguousArg(uint)"));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokableWithDefaultArgs(123, 'hello')", type);
+ QCOMPARE(type, sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 47);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 2);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 123);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(1).toString(), QLatin1String("hello"));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokableWithDefaultArgs(456)", type);
+ QCOMPARE(type, sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 47);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 2);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 456);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(1).toString(), QString());
+ }
+
+ // calling function that returns (const)ref
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("typeof myObject.myInvokableReturningRef()");
+ QCOMPARE(ret, sUndefined);
+ //QVERIFY(!m_engine->hasUncaughtException());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 48);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("typeof myObject.myInvokableReturningConstRef()");
+ QCOMPARE(ret, sUndefined);
+ //QVERIFY(!m_engine->hasUncaughtException());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 49);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableReturningQObjectStar()", type);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 13);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 0);
+ QCOMPARE(type, sObject);
+ QCOMPARE(ret.userType(), int(QMetaType::QObjectStar));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableWithQObjectListArg([myObject])", type);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 14);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(type, sArray);
+ QCOMPARE(ret.userType(), int(QVariant::List)); // All lists get downgraded to QVariantList
+ QVariantList vl = qvariant_cast<QVariantList>(ret);
+ QCOMPARE(vl.count(), 1);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ m_myObject->setVariantProperty(QVariant(123));
+ QVariant ret = evalJSV("myObject.myInvokableWithVariantArg(myObject.variantProperty)", type);
+ QCOMPARE(type, sNumber);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0), m_myObject->variantProperty());
+ QCOMPARE(ret.userType(), int(QMetaType::Double)); // all JS numbers are doubles, even though this started as an int
+ QCOMPARE(ret.toInt(),123);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableWithVariantArg(null)", type);
+ QCOMPARE(type, sObject);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0), QVariant());
+ QVERIFY(!m_myObject->qtFunctionActuals().at(0).isValid());
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableWithVariantArg(undefined)", type);
+ QCOMPARE(type, sObject);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0), QVariant());
+ QVERIFY(!m_myObject->qtFunctionActuals().at(0).isValid());
+ }
+
+ /* XFAIL - variant support
+ m_myObject->resetQtFunctionInvoked();
+ {
+ m_myObject->setVariantProperty(qVariantFromValue(QBrush()));
+ QVariant ret = evalJS("myObject.myInvokableWithVariantArg(myObject.variantProperty)");
+ QVERIFY(ret.isVariant());
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(ret.toVariant(), m_myObject->qtFunctionActuals().at(0));
+ QCOMPARE(ret.toVariant(), m_myObject->variantProperty());
+ }
+ */
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableWithVariantArg(123)", type);
+ QCOMPARE(type, sNumber);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0), QVariant(123));
+ QCOMPARE(ret.userType(), int(QMetaType::Double));
+ QCOMPARE(ret.toInt(),123);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableWithVariantMapArg({ a:123, b:'ciao' })", type);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 16);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::QVariantMap));
+
+ QVariantMap vmap = qvariant_cast<QVariantMap>(v);
+ QCOMPARE(vmap.keys().size(), 2);
+ QCOMPARE(vmap.keys().at(0), QLatin1String("a"));
+ QCOMPARE(vmap.value("a"), QVariant(123));
+ QCOMPARE(vmap.keys().at(1), QLatin1String("b"));
+ QCOMPARE(vmap.value("b"), QVariant("ciao"));
+
+ QCOMPARE(type, sObject);
+
+ QCOMPARE(ret.userType(), int(QMetaType::QVariantMap));
+ vmap = qvariant_cast<QVariantMap>(ret);
+ QCOMPARE(vmap.keys().size(), 2);
+ QCOMPARE(vmap.keys().at(0), QLatin1String("a"));
+ QCOMPARE(vmap.value("a"), QVariant(123));
+ QCOMPARE(vmap.keys().at(1), QLatin1String("b"));
+ QCOMPARE(vmap.value("b"), QVariant("ciao"));
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableWithListOfIntArg([1, 5])", type);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 17);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), qMetaTypeId<QList<int> >());
+ QList<int> ilst = qvariant_cast<QList<int> >(v);
+ QCOMPARE(ilst.size(), 2);
+ QCOMPARE(ilst.at(0), 1);
+ QCOMPARE(ilst.at(1), 5);
+
+ QCOMPARE(type, sArray);
+ QCOMPARE(ret.userType(), int(QMetaType::QVariantList)); // ints get converted to doubles, so this is a qvariantlist
+ QVariantList vlst = qvariant_cast<QVariantList>(ret);
+ QCOMPARE(vlst.size(), 2);
+ QCOMPARE(vlst.at(0).toInt(), 1);
+ QCOMPARE(vlst.at(1).toInt(), 5);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QVariant ret = evalJSV("myObject.myInvokableWithQObjectStarArg(myObject)", type);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 18);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::QObjectStar));
+ QCOMPARE(qvariant_cast<QObject*>(v), (QObject*)m_myObject);
+
+ QCOMPARE(ret.userType(), int(QMetaType::QObjectStar));
+ QCOMPARE(qvariant_cast<QObject*>(ret), (QObject*)m_myObject);
+
+ QCOMPARE(type, sObject);
+ }
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ // no implicit conversion from integer to QObject*
+ QString type;
+ evalJS("myObject.myInvokableWithQObjectStarArg(123)", type);
+ QCOMPARE(type, sError);
+ }
+
+ /*
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString fun = evalJS("myObject.myInvokableWithQBrushArg");
+ Q_ASSERT(fun.isFunction());
+ QColor color(10, 20, 30, 40);
+ // QColor should be converted to a QBrush
+ QVariant ret = fun.call(QString(), QStringList()
+ << qScriptValueFromValue(m_engine, color));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 19);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QVariant v = m_myObject->qtFunctionActuals().at(0);
+ QCOMPARE(v.userType(), int(QMetaType::QBrush));
+ QCOMPARE(qvariant_cast<QColor>(v), color);
+
+ QCOMPARE(qscriptvalue_cast<QColor>(ret), color);
+ }
+ */
+
+ // private slots should not be part of the QObject binding
+ QCOMPARE(evalJS("typeof myObject.myPrivateSlot"), sUndefined);
+
+ // protected slots should be fine
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myProtectedSlot()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 36);
+
+ // call with too few arguments
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokableWithIntArg()", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("SyntaxError: too few arguments in call to myInvokableWithIntArg(); candidates are\n myInvokableWithIntArg(int,int)\n myInvokableWithIntArg(int)"));
+ }
+
+ // call function where not all types have been registered
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokableWithBrushStyleArg(0)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: cannot call myInvokableWithBrushStyleArg(): unknown type `Qt::BrushStyle'"));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), -1);
+ }
+
+ // call function with incompatible argument type
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokableWithQBrushArg(null)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: incompatible type of argument(s) in call to myInvokableWithQBrushArg(); candidates were\n myInvokableWithQBrushArg(QBrush)"));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), -1);
+ }
+}
+
+void tst_QWebFrame::connectAndDisconnect()
+{
+ // connect(function)
+ QCOMPARE(evalJS("typeof myObject.mySignal"), sFunction);
+ QCOMPARE(evalJS("typeof myObject.mySignal.connect"), sFunction);
+ QCOMPARE(evalJS("typeof myObject.mySignal.disconnect"), sFunction);
+
+ {
+ QString type;
+ evalJS("myObject.mySignal.connect(123)", type);
+ QCOMPARE(type, sError);
+ }
+
+ evalJS("myHandler = function() { window.gotSignal = true; window.signalArgs = arguments; window.slotThisObject = this; window.signalSender = __qt_sender__; }");
+
+ QCOMPARE(evalJS("myObject.mySignal.connect(myHandler)"), sUndefined);
+
+ evalJS("gotSignal = false");
+ evalJS("myObject.mySignal()");
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+ QCOMPARE(evalJS("signalArgs.length == 0"), sTrue);
+ QCOMPARE(evalJS("signalSender"),evalJS("myObject"));
+ QCOMPARE(evalJS("slotThisObject == window"), sTrue);
+
+ evalJS("gotSignal = false");
+ m_myObject->emitMySignal();
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+ QCOMPARE(evalJS("signalArgs.length == 0"), sTrue);
+
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myHandler)"), sUndefined);
+
+ evalJS("gotSignal = false");
+ m_myObject->emitMySignalWithIntArg(123);
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+ QCOMPARE(evalJS("signalArgs.length == 1"), sTrue);
+ QCOMPARE(evalJS("signalArgs[0] == 123.0"), sTrue);
+
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(myHandler)"), sUndefined);
+ {
+ QString type;
+ evalJS("myObject.mySignal.disconnect(myHandler)", type);
+ QCOMPARE(type, sError);
+ }
+
+ evalJS("gotSignal = false");
+ QCOMPARE(evalJS("myObject.mySignal2.connect(myHandler)"), sUndefined);
+ m_myObject->emitMySignal2(true);
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+ QCOMPARE(evalJS("signalArgs.length == 1"), sTrue);
+ QCOMPARE(evalJS("signalArgs[0]"), sTrue);
+
+ QCOMPARE(evalJS("myObject.mySignal2.disconnect(myHandler)"), sUndefined);
+
+ QCOMPARE(evalJS("typeof myObject['mySignal2()']"), sFunction);
+ QCOMPARE(evalJS("typeof myObject['mySignal2()'].connect"), sFunction);
+ QCOMPARE(evalJS("typeof myObject['mySignal2()'].disconnect"), sFunction);
+
+ QCOMPARE(evalJS("myObject['mySignal2()'].connect(myHandler)"), sUndefined);
+
+ evalJS("gotSignal = false");
+ m_myObject->emitMySignal2();
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+
+ QCOMPARE(evalJS("myObject['mySignal2()'].disconnect(myHandler)"), sUndefined);
+
+ // connect(object, function)
+ evalJS("otherObject = { name:'foo' }");
+ QCOMPARE(evalJS("myObject.mySignal.connect(otherObject, myHandler)"), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(otherObject, myHandler)"), sUndefined);
+ evalJS("gotSignal = false");
+ m_myObject->emitMySignal();
+ QCOMPARE(evalJS("gotSignal"), sFalse);
+
+ {
+ QString type;
+ evalJS("myObject.mySignal.disconnect(otherObject, myHandler)", type);
+ QCOMPARE(type, sError);
+ }
+
+ QCOMPARE(evalJS("myObject.mySignal.connect(otherObject, myHandler)"), sUndefined);
+ evalJS("gotSignal = false");
+ m_myObject->emitMySignal();
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+ QCOMPARE(evalJS("signalArgs.length == 0"), sTrue);
+ QCOMPARE(evalJS("slotThisObject"),evalJS("otherObject"));
+ QCOMPARE(evalJS("signalSender"),evalJS("myObject"));
+ QCOMPARE(evalJS("slotThisObject.name"), QLatin1String("foo"));
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(otherObject, myHandler)"), sUndefined);
+
+ evalJS("yetAnotherObject = { name:'bar', func : function() { } }");
+ QCOMPARE(evalJS("myObject.mySignal2.connect(yetAnotherObject, myHandler)"), sUndefined);
+ evalJS("gotSignal = false");
+ m_myObject->emitMySignal2(true);
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+ QCOMPARE(evalJS("signalArgs.length == 1"), sTrue);
+ QCOMPARE(evalJS("slotThisObject == yetAnotherObject"), sTrue);
+ QCOMPARE(evalJS("signalSender == myObject"), sTrue);
+ QCOMPARE(evalJS("slotThisObject.name"), QLatin1String("bar"));
+ QCOMPARE(evalJS("myObject.mySignal2.disconnect(yetAnotherObject, myHandler)"), sUndefined);
+
+ QCOMPARE(evalJS("myObject.mySignal2.connect(myObject, myHandler)"), sUndefined);
+ evalJS("gotSignal = false");
+ m_myObject->emitMySignal2(true);
+ QCOMPARE(evalJS("gotSignal"), sTrue);
+ QCOMPARE(evalJS("signalArgs.length == 1"), sTrue);
+ QCOMPARE(evalJS("slotThisObject == myObject"), sTrue);
+ QCOMPARE(evalJS("signalSender == myObject"), sTrue);
+ QCOMPARE(evalJS("myObject.mySignal2.disconnect(myObject, myHandler)"), sUndefined);
+
+ // connect(obj, string)
+ QCOMPARE(evalJS("myObject.mySignal.connect(yetAnotherObject, 'func')"), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignal.connect(myObject, 'mySlot')"), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(yetAnotherObject, 'func')"), sUndefined);
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(myObject, 'mySlot')"), sUndefined);
+
+ // check that emitting signals from script works
+
+ // no arguments
+ QCOMPARE(evalJS("myObject.mySignal.connect(myObject.mySlot)"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.mySignal()"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 20);
+ QCOMPARE(evalJS("myObject.mySignal.disconnect(myObject.mySlot)"), sUndefined);
+
+ // one argument
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.mySlotWithIntArg)"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 21);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 123);
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject.mySlotWithIntArg)"), sUndefined);
+
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.mySlotWithDoubleArg)"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 22);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDouble(), 123.0);
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject.mySlotWithDoubleArg)"), sUndefined);
+
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.mySlotWithStringArg)"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 23);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toString(), QLatin1String("123"));
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject.mySlotWithStringArg)"), sUndefined);
+
+ // connecting to overloaded slot
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.myOverloadedSlot)"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 26); // double overload
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 123);
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject.myOverloadedSlot)"), sUndefined);
+
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject['myOverloadedSlot(int)'])"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg(456)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 28); // int overload
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), 456);
+ QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject['myOverloadedSlot(int)'])"), sUndefined);
+
+ // erroneous input
+ {
+ // ### QtScript adds .connect to all functions, WebKit does only to signals/slots
+ QString type;
+ QString ret = evalJS("(function() { }).connect()", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: Result of expression '(function() { }).connect' [undefined] is not a function."));
+ }
+ {
+ QString type;
+ QString ret = evalJS("var o = { }; o.connect = Function.prototype.connect; o.connect()", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: Result of expression 'o.connect' [undefined] is not a function."));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("(function() { }).connect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: Result of expression '(function() { }).connect' [undefined] is not a function."));
+ }
+ {
+ QString type;
+ QString ret = evalJS("var o = { }; o.connect = Function.prototype.connect; o.connect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: Result of expression 'o.connect' [undefined] is not a function."));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokable.connect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.connect: MyQObject::myInvokable() is not a signal"));
+ }
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokable.connect(function() { })", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.connect: MyQObject::myInvokable() is not a signal"));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("myObject.mySignal.connect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.connect: target is not a function"));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("myObject.mySignal.disconnect()", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: no arguments given"));
+ }
+ {
+ QString type;
+ QString ret = evalJS("var o = { }; o.disconnect = myObject.mySignal.disconnect; o.disconnect()", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: no arguments given"));
+ }
+
+ /* XFAIL - Function.prototype doesn't get connect/disconnect, just signals/slots
+ {
+ QString type;
+ QString ret = evalJS("(function() { }).disconnect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: this object is not a signal"));
+ }
+ */
+
+ {
+ QString type;
+ QString ret = evalJS("var o = { }; o.disconnect = myObject.myInvokable.disconnect; o.disconnect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokable.disconnect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
+ }
+ {
+ QString type;
+ QString ret = evalJS("myObject.myInvokable.disconnect(function() { })", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: MyQObject::myInvokable() is not a signal"));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("myObject.mySignal.disconnect(123)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("TypeError: QtMetaMethod.disconnect: target is not a function"));
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("myObject.mySignal.disconnect(function() { })", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: QtMetaMethod.disconnect: failed to disconnect from MyQObject::mySignal()"));
+ }
+
+ // when the wrapper dies, the connection stays alive
+ QCOMPARE(evalJS("myObject.mySignal.connect(myObject.mySlot)"), sUndefined);
+ m_myObject->resetQtFunctionInvoked();
+ m_myObject->emitMySignal();
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 20);
+ evalJS("myObject = null");
+ evalJS("gc()");
+ m_myObject->resetQtFunctionInvoked();
+ m_myObject->emitMySignal();
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 20);
+}
+
+void tst_QWebFrame::classEnums()
+{
+ // We don't do the meta thing currently, unfortunately!!!
+ /*
+ QString myClass = m_engine->newQMetaObject(m_myObject->metaObject(), m_engine->undefinedValue());
+ m_engine->globalObject().setProperty("MyQObject", myClass);
+
+ QCOMPARE(static_cast<MyQObject::Policy>(evalJS("MyQObject.FooPolicy").toInt()),
+ MyQObject::FooPolicy);
+ QCOMPARE(static_cast<MyQObject::Policy>(evalJS("MyQObject.BarPolicy").toInt()),
+ MyQObject::BarPolicy);
+ QCOMPARE(static_cast<MyQObject::Policy>(evalJS("MyQObject.BazPolicy").toInt()),
+ MyQObject::BazPolicy);
+
+ QCOMPARE(static_cast<MyQObject::Strategy>(evalJS("MyQObject.FooStrategy").toInt()),
+ MyQObject::FooStrategy);
+ QCOMPARE(static_cast<MyQObject::Strategy>(evalJS("MyQObject.BarStrategy").toInt()),
+ MyQObject::BarStrategy);
+ QCOMPARE(static_cast<MyQObject::Strategy>(evalJS("MyQObject.BazStrategy").toInt()),
+ MyQObject::BazStrategy);
+
+ QCOMPARE(MyQObject::Ability(evalJS("MyQObject.NoAbility").toInt()),
+ MyQObject::NoAbility);
+ QCOMPARE(MyQObject::Ability(evalJS("MyQObject.FooAbility").toInt()),
+ MyQObject::FooAbility);
+ QCOMPARE(MyQObject::Ability(evalJS("MyQObject.BarAbility").toInt()),
+ MyQObject::BarAbility);
+ QCOMPARE(MyQObject::Ability(evalJS("MyQObject.BazAbility").toInt()),
+ MyQObject::BazAbility);
+ QCOMPARE(MyQObject::Ability(evalJS("MyQObject.AllAbility").toInt()),
+ MyQObject::AllAbility);
+
+ // enums from Qt are inherited through prototype
+ QCOMPARE(static_cast<Qt::FocusPolicy>(evalJS("MyQObject.StrongFocus").toInt()),
+ Qt::StrongFocus);
+ QCOMPARE(static_cast<Qt::Key>(evalJS("MyQObject.Key_Left").toInt()),
+ Qt::Key_Left);
+
+ QCOMPARE(evalJS("MyQObject.className()"), QLatin1String("MyQObject"));
+
+ qRegisterMetaType<MyQObject::Policy>("Policy");
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.myInvokableWithEnumArg(MyQObject.BazPolicy)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 10);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), int(MyQObject::BazPolicy));
+
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.myInvokableWithQualifiedEnumArg(MyQObject.BazPolicy)"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 36);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), int(MyQObject::BazPolicy));
+
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QVariant ret = evalJS("myObject.myInvokableReturningEnum()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 37);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 0);
+ QCOMPARE(ret.isVariant());
+ }
+ m_myObject->resetQtFunctionInvoked();
+ {
+ QVariant ret = evalJS("myObject.myInvokableReturningQualifiedEnum()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 38);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 0);
+ QCOMPARE(ret.isNumber());
+ }
+ */
+}
+
+void tst_QWebFrame::classConstructor()
+{
+ /*
+ QString myClass = qScriptValueFromQMetaObject<MyQObject>(m_engine);
+ m_engine->globalObject().setProperty("MyQObject", myClass);
+
+ QString myObj = evalJS("myObj = MyQObject()");
+ QObject* qobj = myObj.toQObject();
+ QVERIFY(qobj != 0);
+ QCOMPARE(qobj->metaObject()->className(), "MyQObject");
+ QCOMPARE(qobj->parent(), (QObject*)0);
+
+ QString qobjectClass = qScriptValueFromQMetaObject<QObject>(m_engine);
+ m_engine->globalObject().setProperty("QObject", qobjectClass);
+
+ QString otherObj = evalJS("otherObj = QObject(myObj)");
+ QObject* qqobj = otherObj.toQObject();
+ QVERIFY(qqobj != 0);
+ QCOMPARE(qqobj->metaObject()->className(), "QObject");
+ QCOMPARE(qqobj->parent(), qobj);
+
+ delete qobj;
+ */
+}
+
+void tst_QWebFrame::overrideInvokable()
+{
+ m_myObject->resetQtFunctionInvoked();
+ QCOMPARE(evalJS("myObject.myInvokable()"), sUndefined);
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 0);
+
+ /* XFAIL - can't write to functions with RuntimeObject
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myInvokable = function() { window.a = 123; }");
+ evalJS("myObject.myInvokable()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), -1);
+ QCOMPARE(evalJS("window.a").toDouble(), 123.0);
+
+ evalJS("myObject.myInvokable = function() { window.a = 456; }");
+ evalJS("myObject.myInvokable()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), -1);
+ QCOMPARE(evalJS("window.a").toDouble(), 456.0);
+ */
+
+ evalJS("delete myObject.myInvokable");
+ evalJS("myObject.myInvokable()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 0);
+
+ /* XFAIL - ditto
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myInvokable = myObject.myInvokableWithIntArg");
+ evalJS("myObject.myInvokable(123)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 1);
+ */
+
+ evalJS("delete myObject.myInvokable");
+ m_myObject->resetQtFunctionInvoked();
+ // this form (with the '()') is read-only
+ evalJS("myObject['myInvokable()'] = function() { window.a = 123; }");
+ evalJS("myObject.myInvokable()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 0);
+}
+
+void tst_QWebFrame::transferInvokable()
+{
+ /* XFAIL - can't put to functions with RuntimeObject
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.foozball = myObject.myInvokable");
+ evalJS("myObject.foozball()");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 0);
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.foozball = myObject.myInvokableWithIntArg");
+ evalJS("myObject.foozball(123)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 1);
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myInvokable = myObject.myInvokableWithIntArg");
+ evalJS("myObject.myInvokable(123)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 1);
+
+ MyOtherQObject other;
+ m_page->mainFrame()->addToJSWindowObject("myOtherObject", &other);
+ evalJS("myOtherObject.foo = myObject.foozball");
+ other.resetQtFunctionInvoked();
+ evalJS("myOtherObject.foo(456)");
+ QCOMPARE(other.qtFunctionInvoked(), 1);
+ */
+}
+
+void tst_QWebFrame::findChild()
+{
+ /*
+ QObject* child = new QObject(m_myObject);
+ child->setObjectName(QLatin1String("myChildObject"));
+
+ {
+ QString result = evalJS("myObject.findChild('noSuchChild')");
+ QCOMPARE(result.isNull());
+ }
+
+ {
+ QString result = evalJS("myObject.findChild('myChildObject')");
+ QCOMPARE(result.isQObject());
+ QCOMPARE(result.toQObject(), child);
+ }
+
+ delete child;
+ */
+}
+
+void tst_QWebFrame::findChildren()
+{
+ /*
+ QObject* child = new QObject(m_myObject);
+ child->setObjectName(QLatin1String("myChildObject"));
+
+ {
+ QString result = evalJS("myObject.findChildren('noSuchChild')");
+ QCOMPARE(result.isArray());
+ QCOMPARE(result.property(QLatin1String("length")).toDouble(), 0.0);
+ }
+
+ {
+ QString result = evalJS("myObject.findChildren('myChildObject')");
+ QCOMPARE(result.isArray());
+ QCOMPARE(result.property(QLatin1String("length")).toDouble(), 1.0);
+ QCOMPARE(result.property(QLatin1String("0")).toQObject(), child);
+ }
+
+ QObject* namelessChild = new QObject(m_myObject);
+
+ {
+ QString result = evalJS("myObject.findChildren('myChildObject')");
+ QCOMPARE(result.isArray());
+ QCOMPARE(result.property(QLatin1String("length")).toDouble(), 1.0);
+ QCOMPARE(result.property(QLatin1String("0")).toQObject(), child);
+ }
+
+ QObject* anotherChild = new QObject(m_myObject);
+ anotherChild->setObjectName(QLatin1String("anotherChildObject"));
+
+ {
+ QString result = evalJS("myObject.findChildren('anotherChildObject')");
+ QCOMPARE(result.isArray());
+ QCOMPARE(result.property(QLatin1String("length")).toDouble(), 1.0);
+ QCOMPARE(result.property(QLatin1String("0")).toQObject(), anotherChild);
+ }
+
+ anotherChild->setObjectName(QLatin1String("myChildObject"));
+ {
+ QString result = evalJS("myObject.findChildren('myChildObject')");
+ QCOMPARE(result.isArray());
+ QCOMPARE(result.property(QLatin1String("length")).toDouble(), 2.0);
+ QObject* o1 = result.property(QLatin1String("0")).toQObject();
+ QObject* o2 = result.property(QLatin1String("1")).toQObject();
+ if (o1 != child) {
+ QCOMPARE(o1, anotherChild);
+ QCOMPARE(o2, child);
+ } else {
+ QCOMPARE(o1, child);
+ QCOMPARE(o2, anotherChild);
+ }
+ }
+
+ // find all
+ {
+ QString result = evalJS("myObject.findChildren()");
+ QVERIFY(result.isArray());
+ int count = 3;
+ QCOMPARE(result.property("length"), QLatin1String(count);
+ for (int i = 0; i < 3; ++i) {
+ QObject* o = result.property(i).toQObject();
+ if (o == namelessChild || o == child || o == anotherChild)
+ --count;
+ }
+ QVERIFY(count == 0);
+ }
+
+ delete anotherChild;
+ delete namelessChild;
+ delete child;
+ */
+}
+
+void tst_QWebFrame::overloadedSlots()
+{
+ // should pick myOverloadedSlot(double)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(10)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 26);
+
+ // should pick myOverloadedSlot(double)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(10.0)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 26);
+
+ // should pick myOverloadedSlot(QString)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot('10')");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 29);
+
+ // should pick myOverloadedSlot(bool)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(true)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 25);
+
+ // should pick myOverloadedSlot(QDateTime)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(new Date())");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 32);
+
+ // should pick myOverloadedSlot(QRegExp)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(new RegExp())");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 34);
+
+ // should pick myOverloadedSlot(QVariant)
+ /* XFAIL
+ m_myObject->resetQtFunctionInvoked();
+ QString f = evalJS("myObject.myOverloadedSlot");
+ f.call(QString(), QStringList() << m_engine->newVariant(QVariant("ciao")));
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 35);
+ */
+ // should pick myOverloadedSlot(QObject*)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(myObject)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 41);
+
+ // should pick myOverloadedSlot(QObject*)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(null)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 41);
+
+ // should pick myOverloadedSlot(QStringList)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(['hello'])");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 42);
+}
+
+void tst_QWebFrame::enumerate_data()
+{
+ QTest::addColumn<QStringList>("expectedNames");
+
+ QTest::newRow("enumerate all")
+ << (QStringList()
+ // meta-object-defined properties:
+ // inherited
+ << "objectName"
+ // non-inherited
+ << "p1" << "p2" << "p4" << "p6"
+ // dynamic properties
+ << "dp1" << "dp2" << "dp3"
+ // inherited slots
+ << "destroyed(QObject*)" << "destroyed()"
+ << "deleteLater()"
+ // not included because it's private:
+ // << "_q_reregisterTimers(void*)"
+ // signals
+ << "mySignal()"
+ // slots
+ << "mySlot()" << "myOtherSlot()");
+}
+
+void tst_QWebFrame::enumerate()
+{
+ QFETCH(QStringList, expectedNames);
+
+ MyEnumTestQObject enumQObject;
+ // give it some dynamic properties
+ enumQObject.setProperty("dp1", "dp1");
+ enumQObject.setProperty("dp2", "dp2");
+ enumQObject.setProperty("dp3", "dp3");
+ m_page->mainFrame()->addToJavaScriptWindowObject("myEnumObject", &enumQObject);
+
+ // enumerate in script
+ {
+ evalJS("var enumeratedProperties = []");
+ evalJS("for (var p in myEnumObject) { enumeratedProperties.push(p); }");
+ QStringList result = evalJSV("enumeratedProperties").toStringList();
+ QCOMPARE(result.size(), expectedNames.size());
+ for (int i = 0; i < expectedNames.size(); ++i)
+ QCOMPARE(result.at(i), expectedNames.at(i));
+ }
+}
+
+void tst_QWebFrame::objectDeleted()
+{
+ MyQObject* qobj = new MyQObject();
+ m_page->mainFrame()->addToJavaScriptWindowObject("bar", qobj);
+ evalJS("bar.objectName = 'foo';");
+ QCOMPARE(qobj->objectName(), QLatin1String("foo"));
+ evalJS("bar.intProperty = 123;");
+ QCOMPARE(qobj->intProperty(), 123);
+ qobj->resetQtFunctionInvoked();
+ evalJS("bar.myInvokable.call(bar);");
+ QCOMPARE(qobj->qtFunctionInvoked(), 0);
+
+ // do this, to ensure that we cache that it implements call
+ evalJS("bar()");
+
+ // now delete the object
+ delete qobj;
+
+ QCOMPARE(evalJS("typeof bar"), sObject);
+
+ // any attempt to access properties of the object should result in an exception
+ {
+ QString type;
+ QString ret = evalJS("bar.objectName", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: cannot access member `objectName' of deleted QObject"));
+ }
+ {
+ QString type;
+ QString ret = evalJS("bar.objectName = 'foo'", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: cannot access member `objectName' of deleted QObject"));
+ }
+
+ // myInvokable is stored in member table (since we've accessed it before deletion)
+ {
+ QString type;
+ evalJS("bar.myInvokable", type);
+ QCOMPARE(type, sFunction);
+ }
+
+ {
+ QString type;
+ QString ret = evalJS("bar.myInvokable.call(bar);", type);
+ ret = evalJS("bar.myInvokable(bar)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: cannot call function of deleted QObject"));
+ }
+ // myInvokableWithIntArg is not stored in member table (since we've not accessed it)
+ {
+ QString type;
+ QString ret = evalJS("bar.myInvokableWithIntArg", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: cannot access member `myInvokableWithIntArg' of deleted QObject"));
+ }
+
+ // access from script
+ evalJS("window.o = bar;");
+ {
+ QString type;
+ QString ret = evalJS("o.objectName", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: cannot access member `objectName' of deleted QObject"));
+ }
+ {
+ QString type;
+ QString ret = evalJS("o.myInvokable()", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: cannot call function of deleted QObject"));
+ }
+ {
+ QString type;
+ QString ret = evalJS("o.myInvokableWithIntArg(10)", type);
+ QCOMPARE(type, sError);
+ QCOMPARE(ret, QLatin1String("Error: cannot access member `myInvokableWithIntArg' of deleted QObject"));
+ }
+}
+
+void tst_QWebFrame::typeConversion()
+{
+ m_myObject->resetQtFunctionInvoked();
+
+ QDateTime localdt(QDate(2008,1,18), QTime(12,31,0));
+ QDateTime utclocaldt = localdt.toUTC();
+ QDateTime utcdt(QDate(2008,1,18), QTime(12,31,0), Qt::UTC);
+
+ // Dates in JS (default to local)
+ evalJS("myObject.myOverloadedSlot(new Date(2008,0,18,12,31,0))");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 32);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDateTime().toUTC(), utclocaldt);
+
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(new Date(Date.UTC(2008,0,18,12,31,0)))");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 32);
+ QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
+ QCOMPARE(m_myObject->qtFunctionActuals().at(0).toDateTime().toUTC(), utcdt);
+
+ // Pushing QDateTimes into JS
+ // Local
+ evalJS("function checkDate(d) {window.__date_equals = (d.toString() == new Date(2008,0,18,12,31,0))?true:false;}");
+ evalJS("myObject.mySignalWithDateTimeArg.connect(checkDate)");
+ m_myObject->emitMySignalWithDateTimeArg(localdt);
+ QCOMPARE(evalJS("window.__date_equals"), sTrue);
+ evalJS("delete window.__date_equals");
+ m_myObject->emitMySignalWithDateTimeArg(utclocaldt);
+ QCOMPARE(evalJS("window.__date_equals"), sTrue);
+ evalJS("delete window.__date_equals");
+ evalJS("myObject.mySignalWithDateTimeArg.disconnect(checkDate); delete checkDate;");
+
+ // UTC
+ evalJS("function checkDate(d) {window.__date_equals = (d.toString() == new Date(Date.UTC(2008,0,18,12,31,0)))?true:false; }");
+ evalJS("myObject.mySignalWithDateTimeArg.connect(checkDate)");
+ m_myObject->emitMySignalWithDateTimeArg(utcdt);
+ QCOMPARE(evalJS("window.__date_equals"), sTrue);
+ evalJS("delete window.__date_equals");
+ evalJS("myObject.mySignalWithDateTimeArg.disconnect(checkDate); delete checkDate;");
+
+ // ### RegExps
+}
+
+void tst_QWebFrame::symmetricUrl()
+{
+ QVERIFY(m_view->url().isEmpty());
+
+ QCOMPARE(m_view->history()->count(), 0);
+
+ QUrl dataUrl("data:text/html,<h1>Test");
+
+ m_view->setUrl(dataUrl);
+ QCOMPARE(m_view->url(), dataUrl);
+ QCOMPARE(m_view->history()->count(), 0);
+
+ // loading is _not_ immediate, so the text isn't set just yet.
+ QVERIFY(m_view->page()->mainFrame()->toPlainText().isEmpty());
+
+ ::waitForSignal(m_view, SIGNAL(loadFinished(bool)));
+
+ QCOMPARE(m_view->history()->count(), 1);
+ QCOMPARE(m_view->page()->mainFrame()->toPlainText(), QString("Test"));
+
+ QUrl dataUrl2("data:text/html,<h1>Test2");
+ QUrl dataUrl3("data:text/html,<h1>Test3");
+
+ m_view->setUrl(dataUrl2);
+ m_view->setUrl(dataUrl3);
+
+ QCOMPARE(m_view->url(), dataUrl3);
+
+ ::waitForSignal(m_view, SIGNAL(loadFinished(bool)));
+
+ QCOMPARE(m_view->history()->count(), 2);
+
+ QCOMPARE(m_view->page()->mainFrame()->toPlainText(), QString("Test3"));
+}
+
+void tst_QWebFrame::progressSignal()
+{
+ QSignalSpy progressSpy(m_view, SIGNAL(loadProgress(int)));
+
+ QUrl dataUrl("data:text/html,<h1>Test");
+ m_view->setUrl(dataUrl);
+
+ ::waitForSignal(m_view, SIGNAL(loadFinished(bool)));
+
+ QVERIFY(progressSpy.size() >= 2);
+
+ // WebKit defines initialProgressValue as 10%, not 0%
+ QCOMPARE(progressSpy.first().first().toInt(), 10);
+
+ // But we always end at 100%
+ QCOMPARE(progressSpy.last().first().toInt(), 100);
+}
+
+void tst_QWebFrame::domCycles()
+{
+ m_view->setHtml("<html><body>");
+ QVariant v = m_page->mainFrame()->evaluateJavaScript("document");
+ QVERIFY(v.type() == QVariant::Map);
+}
+
+void tst_QWebFrame::setHtml()
+{
+ QString html("<html><body><p>hello world</p></body></html>");
+ m_view->page()->mainFrame()->setHtml(html);
+ QCOMPARE(m_view->page()->mainFrame()->toHtml(), html);
+}
+
+void tst_QWebFrame::setHtmlWithResource()
+{
+ QString html("<html><body><p>hello world</p><img src='qrc:/image.png'/></body></html>");
+
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+
+ // in few seconds, the image should be completey loaded
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+ frame->setHtml(html);
+ QTest::qWait(200);
+ QCOMPARE(spy.count(), 1);
+
+ QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1);
+ QCOMPARE(frame->evaluateJavaScript("document.images[0].width").toInt(), 128);
+ QCOMPARE(frame->evaluateJavaScript("document.images[0].height").toInt(), 128);
+}
+
+class TestNetworkManager : public QNetworkAccessManager
+{
+public:
+ TestNetworkManager(QObject* parent) : QNetworkAccessManager(parent) {}
+
+ QList<QUrl> requestedUrls;
+
+protected:
+ virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) {
+ requestedUrls.append(request.url());
+ QNetworkRequest redirectedRequest = request;
+ redirectedRequest.setUrl(QUrl("data:text/html,<p>hello"));
+ return QNetworkAccessManager::createRequest(op, redirectedRequest, outgoingData);
+ }
+};
+
+void tst_QWebFrame::ipv6HostEncoding()
+{
+ TestNetworkManager* networkManager = new TestNetworkManager(m_page);
+ m_page->setNetworkAccessManager(networkManager);
+ networkManager->requestedUrls.clear();
+
+ QUrl baseUrl = QUrl::fromEncoded("http://[::1]/index.html");
+ m_view->setHtml("<p>Hi", baseUrl);
+ m_view->page()->mainFrame()->evaluateJavaScript("var r = new XMLHttpRequest();"
+ "r.open('GET', 'http://[::1]/test.xml', false);"
+ "r.send(null);"
+ );
+ QCOMPARE(networkManager->requestedUrls.count(), 1);
+ QCOMPARE(networkManager->requestedUrls.at(0), QUrl::fromEncoded("http://[::1]/test.xml"));
+}
+
+void tst_QWebFrame::metaData()
+{
+ m_view->setHtml("<html>"
+ " <head>"
+ " <meta name=\"description\" content=\"Test description\">"
+ " <meta name=\"keywords\" content=\"HTML, JavaScript, Css\">"
+ " </head>"
+ "</html>");
+
+ QMultiMap<QString, QString> metaData = m_view->page()->mainFrame()->metaData();
+
+ QCOMPARE(metaData.count(), 2);
+
+ QCOMPARE(metaData.value("description"), QString("Test description"));
+ QCOMPARE(metaData.value("keywords"), QString("HTML, JavaScript, Css"));
+ QCOMPARE(metaData.value("nonexistant"), QString());
+
+ m_view->setHtml("<html>"
+ " <head>"
+ " <meta name=\"samekey\" content=\"FirstValue\">"
+ " <meta name=\"samekey\" content=\"SecondValue\">"
+ " </head>"
+ "</html>");
+
+ metaData = m_view->page()->mainFrame()->metaData();
+
+ QCOMPARE(metaData.count(), 2);
+
+ QStringList values = metaData.values("samekey");
+ QCOMPARE(values.count(), 2);
+
+ QVERIFY(values.contains("FirstValue"));
+ QVERIFY(values.contains("SecondValue"));
+
+ QCOMPARE(metaData.value("nonexistant"), QString());
+}
+
+void tst_QWebFrame::popupFocus()
+{
+ QWebView view;
+ view.setHtml("<html>"
+ " <body>"
+ " <select name=\"select\">"
+ " <option>1</option>"
+ " <option>2</option>"
+ " </select>"
+ " <input type=\"text\"> </input>"
+ " <textarea name=\"text_area\" rows=\"3\" cols=\"40\">"
+ "This test checks whether showing and hiding a popup"
+ "takes the focus away from the webpage."
+ " </textarea>"
+ " </body>"
+ "</html>");
+ view.resize(400, 100);
+ view.show();
+ view.setFocus();
+ QTest::qWait(200);
+ QVERIFY2(view.hasFocus(),
+ "The WebView should be created");
+
+ // open the popup by clicking. check if focus is on the popup
+ QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(25, 25));
+ QObject* webpopup = firstChildByClassName(&view, "WebCore::QWebPopup");
+ QComboBox* combo = qobject_cast<QComboBox*>(webpopup);
+ QTest::qWait(500);
+ QVERIFY2(!view.hasFocus() && combo->view()->hasFocus(),
+ "Focus sould be on the Popup");
+
+ // hide the popup and check if focus is on the page
+ combo->hidePopup();
+ QTest::qWait(500);
+ QVERIFY2(view.hasFocus() && !combo->view()->hasFocus(),
+ "Focus sould be back on the WebView");
+
+ // triple the flashing time, should at least blink twice already
+ int delay = qApp->cursorFlashTime() * 3;
+
+ // focus the lineedit and check if it blinks
+ QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(200, 25));
+ m_popupTestView = &view;
+ view.installEventFilter( this );
+ QTest::qWait(delay);
+ QVERIFY2(m_popupTestPaintCount >= 4,
+ "The input field should have a blinking caret");
+}
+
+void tst_QWebFrame::jsByteArray()
+{
+ QByteArray ba("hello world");
+ m_myObject->setByteArrayProperty(ba);
+
+ // read-only property
+ QCOMPARE(m_myObject->byteArrayProperty(), ba);
+ QString type;
+ QVariant v = evalJSV("myObject.byteArrayProperty");
+ QCOMPARE(int(v.type()), int(QVariant::ByteArray));
+
+ QCOMPARE(v.toByteArray(), ba);
+}
+
+void tst_QWebFrame::ownership()
+{
+ // test ownership
+ {
+ QPointer<QObject> ptr = new QObject();
+ QVERIFY(ptr != 0);
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", ptr, QScriptEngine::ScriptOwnership);
+ }
+ QVERIFY(ptr == 0);
+ }
+ {
+ QPointer<QObject> ptr = new QObject();
+ QVERIFY(ptr != 0);
+ QObject* before = ptr;
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", ptr, QScriptEngine::QtOwnership);
+ }
+ QVERIFY(ptr == before);
+ delete ptr;
+ }
+ {
+ QObject* parent = new QObject();
+ QObject* child = new QObject(parent);
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", child, QScriptEngine::QtOwnership);
+ QVariant v = frame->evaluateJavaScript("test");
+ QCOMPARE(qvariant_cast<QObject*>(v), child);
+ delete parent;
+ v = frame->evaluateJavaScript("test");
+ QCOMPARE(qvariant_cast<QObject*>(v), (QObject *)0);
+ }
+ {
+ QPointer<QObject> ptr = new QObject();
+ QVERIFY(ptr != 0);
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", ptr, QScriptEngine::AutoOwnership);
+ }
+ // no parent, so it should be like ScriptOwnership
+ QVERIFY(ptr == 0);
+ }
+ {
+ QObject* parent = new QObject();
+ QPointer<QObject> child = new QObject(parent);
+ QVERIFY(child != 0);
+ {
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ frame->addToJavaScriptWindowObject("test", child, QScriptEngine::AutoOwnership);
+ }
+ // has parent, so it should be like QtOwnership
+ QVERIFY(child != 0);
+ delete parent;
+ }
+}
+
+QTEST_MAIN(tst_QWebFrame)
+#include "tst_qwebframe.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
new file mode 100644
index 0000000..af3b348
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_qwebhistoryinterface
+include(../../../../WebKit.pri)
+SOURCES += tst_qwebhistoryinterface.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp
new file mode 100644
index 0000000..435cada
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp
@@ -0,0 +1,94 @@
+/*
+ Copyright (C) 2008 Holger Hans Peter Freyther
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+#include <QtTest/QtTest>
+
+#include <qwebpage.h>
+#include <qwebview.h>
+#include <qwebframe.h>
+#include <qwebhistoryinterface.h>
+#include <QDebug>
+
+class tst_QWebHistoryInterface : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QWebHistoryInterface();
+ virtual ~tst_QWebHistoryInterface();
+
+public slots:
+ void init();
+ void cleanup();
+
+private slots:
+ void visitedLinks();
+
+private:
+
+
+private:
+ QWebView* m_view;
+ QWebPage* m_page;
+};
+
+tst_QWebHistoryInterface::tst_QWebHistoryInterface()
+{
+}
+
+tst_QWebHistoryInterface::~tst_QWebHistoryInterface()
+{
+}
+
+void tst_QWebHistoryInterface::init()
+{
+ m_view = new QWebView();
+ m_page = m_view->page();
+}
+
+void tst_QWebHistoryInterface::cleanup()
+{
+ delete m_view;
+}
+
+class FakeHistoryImplementation : public QWebHistoryInterface {
+public:
+ void addHistoryEntry(const QString&) {}
+ bool historyContains(const QString& url) const {
+ return url == QLatin1String("http://www.trolltech.com/");
+ }
+};
+
+
+/*
+ * Test that visited links are properly colored. http://www.trolltech.com is marked
+ * as visited, so the below website should have exactly one element in the a:visited
+ * state.
+ */
+void tst_QWebHistoryInterface::visitedLinks()
+{
+ QWebHistoryInterface::setDefaultInterface(new FakeHistoryImplementation);
+ m_view->setHtml("<html><body><a href='http://www.trolltech.com'>Trolltech</a></body></html>");
+ QCOMPARE(m_page->mainFrame()->evaluateJavaScript("document.querySelectorAll(':visited').length;").toString(),
+ QString::fromLatin1("1"));
+}
+
+QTEST_MAIN(tst_QWebHistoryInterface)
+#include "tst_qwebhistoryinterface.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
new file mode 100644
index 0000000..bbd98c6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_qwebpage
+include(../../../../WebKit.pri)
+SOURCES += tst_qwebpage.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
new file mode 100644
index 0000000..6f2ce3b
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -0,0 +1,983 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+#include <QtTest/QtTest>
+
+#include <qwebpage.h>
+#include <qwidget.h>
+#include <qwebview.h>
+#include <qwebframe.h>
+#include <qwebhistory.h>
+#include <qnetworkrequest.h>
+#include <QDebug>
+#include <QLineEdit>
+#include <QMenu>
+#include <qwebsecurityorigin.h>
+#include <qwebdatabase.h>
+#include <QPushButton>
+
+// Will try to wait for the condition while allowing event processing
+#define QTRY_COMPARE(__expr, __expected) \
+ do { \
+ const int __step = 50; \
+ const int __timeout = 5000; \
+ if ((__expr) != (__expected)) { \
+ QTest::qWait(0); \
+ } \
+ for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
+ QTest::qWait(__step); \
+ } \
+ QCOMPARE(__expr, __expected); \
+ } while(0)
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+// Task 160192
+/**
+ * Starts an event loop that runs until the given signal is received.
+ Optionally the event loop
+ * can return earlier on a timeout.
+ *
+ * \return \p true if the requested signal was received
+ * \p false on timeout
+ */
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
+{
+ QEventLoop loop;
+ QObject::connect(obj, signal, &loop, SLOT(quit()));
+ QTimer timer;
+ QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
+ if (timeout > 0) {
+ QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.setSingleShot(true);
+ timer.start(timeout);
+ }
+ loop.exec();
+ return timeoutSpy.isEmpty();
+}
+
+class tst_QWebPage : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QWebPage();
+ virtual ~tst_QWebPage();
+
+public slots:
+ void init();
+ void cleanup();
+ void cleanupFiles();
+
+private slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+ void acceptNavigationRequest();
+ void loadFinished();
+ void acceptNavigationRequestWithNewWindow();
+ void userStyleSheet();
+ void modified();
+ void contextMenuCrash();
+ void database();
+ void createPlugin();
+ void destroyPlugin();
+ void createViewlessPlugin();
+ void multiplePageGroupsAndLocalStorage();
+ void cursorMovements();
+ void textSelection();
+ void textEditing();
+
+private:
+
+
+private:
+ QWebView* m_view;
+ QWebPage* m_page;
+};
+
+tst_QWebPage::tst_QWebPage()
+{
+}
+
+tst_QWebPage::~tst_QWebPage()
+{
+}
+
+void tst_QWebPage::init()
+{
+ m_view = new QWebView();
+ m_page = m_view->page();
+}
+
+void tst_QWebPage::cleanup()
+{
+ delete m_view;
+}
+
+void tst_QWebPage::cleanupFiles()
+{
+ QFile::remove("Databases.db");
+ QDir::current().rmdir("http_www.myexample.com_0");
+ QFile::remove("http_www.myexample.com_0.localstorage");
+}
+
+void tst_QWebPage::initTestCase()
+{
+ cleanupFiles(); // In case there are old files from previous runs
+}
+
+void tst_QWebPage::cleanupTestCase()
+{
+ cleanupFiles(); // Be nice
+}
+
+class NavigationRequestOverride : public QWebPage
+{
+public:
+ NavigationRequestOverride(QWebView* parent, bool initialValue) : QWebPage(parent), m_acceptNavigationRequest(initialValue) {}
+
+ bool m_acceptNavigationRequest;
+protected:
+ virtual bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, QWebPage::NavigationType type) {
+ Q_UNUSED(frame);
+ Q_UNUSED(request);
+ Q_UNUSED(type);
+
+ return m_acceptNavigationRequest;
+ }
+};
+
+void tst_QWebPage::acceptNavigationRequest()
+{
+ QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool)));
+
+ NavigationRequestOverride* newPage = new NavigationRequestOverride(m_view, false);
+ m_view->setPage(newPage);
+
+ m_view->setHtml(QString("<html><body><form name='tstform' action='data:text/html,foo'method='get'>"
+ "<input type='text'><input type='submit'></form></body></html>"), QUrl());
+ QTRY_COMPARE(loadSpy.count(), 1);
+
+ m_view->page()->mainFrame()->evaluateJavaScript("tstform.submit();");
+
+ newPage->m_acceptNavigationRequest = true;
+ m_view->page()->mainFrame()->evaluateJavaScript("tstform.submit();");
+ QTRY_COMPARE(loadSpy.count(), 2);
+
+ QCOMPARE(m_view->page()->mainFrame()->toPlainText(), QString("foo?"));
+
+ // Restore default page
+ m_view->setPage(0);
+}
+
+
+void tst_QWebPage::loadFinished()
+{
+ QSignalSpy spyLoadStarted(m_view, SIGNAL(loadStarted()));
+ QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
+
+ m_view->setHtml(QString("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
+ "<head><meta http-equiv='refresh' content='1'></head>foo \">"
+ "<frame src=\"data:text/html,bar\"></frameset>"), QUrl());
+ QTRY_COMPARE(spyLoadFinished.count(), 1);
+
+ QTest::qWait(3000);
+
+ QVERIFY(spyLoadStarted.count() > 1);
+ QVERIFY(spyLoadFinished.count() > 1);
+
+ spyLoadFinished.clear();
+
+ m_view->setHtml(QString("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
+ "foo \"><frame src=\"data:text/html,bar\"></frameset>"), QUrl());
+ QTRY_COMPARE(spyLoadFinished.count(), 1);
+ QCOMPARE(spyLoadFinished.count(), 1);
+}
+
+class TestPage : public QWebPage
+{
+public:
+ TestPage(QObject* parent = 0) : QWebPage(parent) {}
+
+ struct Navigation {
+ QPointer<QWebFrame> frame;
+ QNetworkRequest request;
+ NavigationType type;
+ };
+
+ QList<Navigation> navigations;
+ QList<QWebPage*> createdWindows;
+
+ virtual bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, NavigationType type) {
+ Navigation n;
+ n.frame = frame;
+ n.request = request;
+ n.type = type;
+ navigations.append(n);
+ return true;
+ }
+
+ virtual QWebPage* createWindow(WebWindowType) {
+ QWebPage* page = new TestPage(this);
+ createdWindows.append(page);
+ return page;
+ }
+};
+
+void tst_QWebPage::acceptNavigationRequestWithNewWindow()
+{
+ TestPage* page = new TestPage(m_view);
+ page->settings()->setAttribute(QWebSettings::LinksIncludedInFocusChain, true);
+ m_page = page;
+ m_view->setPage(m_page);
+
+ m_view->setUrl(QString("data:text/html,<a href=\"data:text/html,Reached\" target=\"_blank\">Click me</a>"));
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ QFocusEvent fe(QEvent::FocusIn);
+ m_page->event(&fe);
+
+ QVERIFY(m_page->focusNextPrevChild(/*next*/ true));
+
+ QKeyEvent keyEnter(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier);
+ m_page->event(&keyEnter);
+
+ QCOMPARE(page->navigations.count(), 2);
+
+ TestPage::Navigation n = page->navigations.at(1);
+ QVERIFY(n.frame.isNull());
+ QCOMPARE(n.request.url().toString(), QString("data:text/html,Reached"));
+ QVERIFY(n.type == QWebPage::NavigationTypeLinkClicked);
+
+ QCOMPARE(page->createdWindows.count(), 1);
+}
+
+class TestNetworkManager : public QNetworkAccessManager
+{
+public:
+ TestNetworkManager(QObject* parent) : QNetworkAccessManager(parent) {}
+
+ QList<QUrl> requestedUrls;
+
+protected:
+ virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) {
+ requestedUrls.append(request.url());
+ return QNetworkAccessManager::createRequest(op, request, outgoingData);
+ }
+};
+
+void tst_QWebPage::userStyleSheet()
+{
+ TestNetworkManager* networkManager = new TestNetworkManager(m_page);
+ m_page->setNetworkAccessManager(networkManager);
+ networkManager->requestedUrls.clear();
+
+ m_page->settings()->setUserStyleSheetUrl(QUrl("data:text/css,p { background-image: url('http://does.not/exist.png');}"));
+ m_view->setHtml("<p>hello world</p>");
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ QVERIFY(networkManager->requestedUrls.count() >= 2);
+ QCOMPARE(networkManager->requestedUrls.at(0), QUrl("data:text/css,p { background-image: url('http://does.not/exist.png');}"));
+ QCOMPARE(networkManager->requestedUrls.at(1), QUrl("http://does.not/exist.png"));
+}
+
+void tst_QWebPage::modified()
+{
+ m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>blub"));
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ m_page->mainFrame()->setUrl(QUrl("data:text/html,<body id=foo contenteditable>blah"));
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ QVERIFY(!m_page->isModified());
+
+// m_page->mainFrame()->evaluateJavaScript("alert(document.getElementById('foo'))");
+ m_page->mainFrame()->evaluateJavaScript("document.getElementById('foo').focus()");
+ m_page->mainFrame()->evaluateJavaScript("document.execCommand('InsertText', true, 'Test');");
+
+ QVERIFY(m_page->isModified());
+
+ m_page->mainFrame()->evaluateJavaScript("document.execCommand('Undo', true);");
+
+ QVERIFY(!m_page->isModified());
+
+ m_page->mainFrame()->evaluateJavaScript("document.execCommand('Redo', true);");
+
+ QVERIFY(m_page->isModified());
+
+ QVERIFY(m_page->history()->canGoBack());
+ QVERIFY(!m_page->history()->canGoForward());
+ QCOMPARE(m_page->history()->count(), 2);
+ QVERIFY(m_page->history()->backItem().isValid());
+ QVERIFY(!m_page->history()->forwardItem().isValid());
+
+ m_page->history()->back();
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ QVERIFY(!m_page->history()->canGoBack());
+ QVERIFY(m_page->history()->canGoForward());
+
+ QVERIFY(!m_page->isModified());
+
+ QVERIFY(m_page->history()->currentItemIndex() == 0);
+
+ m_page->history()->setMaximumItemCount(3);
+ QVERIFY(m_page->history()->maximumItemCount() == 3);
+
+ QVariant variant("string test");
+ m_page->history()->currentItem().setUserData(variant);
+ QVERIFY(m_page->history()->currentItem().userData().toString() == "string test");
+
+ m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is second page"));
+ m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is third page"));
+ QVERIFY(m_page->history()->count() == 2);
+ m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fourth page"));
+ QVERIFY(m_page->history()->count() == 2);
+ m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fifth page"));
+ QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*))));
+}
+
+void tst_QWebPage::contextMenuCrash()
+{
+ QWebView view;
+ view.setHtml("<p>test");
+ view.page()->updatePositionDependentActions(QPoint(0, 0));
+ QMenu* contextMenu = 0;
+ foreach (QObject* child, view.children()) {
+ contextMenu = qobject_cast<QMenu*>(child);
+ if (contextMenu)
+ break;
+ }
+ QVERIFY(contextMenu);
+ delete contextMenu;
+}
+
+void tst_QWebPage::database()
+{
+ QString path = QDir::currentPath();
+ m_page->settings()->setOfflineStoragePath(path);
+ QVERIFY(m_page->settings()->offlineStoragePath() == path);
+
+ QWebSettings::setOfflineStorageDefaultQuota(1024 * 1024);
+ QVERIFY(QWebSettings::offlineStorageDefaultQuota() == 1024 * 1024);
+
+ QString dbFileName = path + "Databases.db";
+
+ if (QFile::exists(dbFileName))
+ QFile::remove(dbFileName);
+
+ qRegisterMetaType<QWebFrame*>("QWebFrame*");
+ QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame *, QString)));
+ m_view->setHtml(QString("<html><head><script>var db; db=openDatabase('testdb', '1.0', 'test database API', 50000); </script></head><body><div></div></body></html>"), QUrl("http://www.myexample.com"));
+ QTRY_COMPARE(spy.count(), 1);
+ m_page->mainFrame()->evaluateJavaScript("var db2; db2=openDatabase('testdb', '1.0', 'test database API', 50000);");
+ QTRY_COMPARE(spy.count(),1);
+
+ m_page->mainFrame()->evaluateJavaScript("localStorage.test='This is a test for local storage';");
+ m_view->setHtml(QString("<html><body id='b'>text</body></html>"), QUrl("http://www.myexample.com"));
+
+ QVariant s1 = m_page->mainFrame()->evaluateJavaScript("localStorage.test");
+ QCOMPARE(s1.toString(), QString("This is a test for local storage"));
+
+ m_page->mainFrame()->evaluateJavaScript("sessionStorage.test='This is a test for session storage';");
+ m_view->setHtml(QString("<html><body id='b'>text</body></html>"), QUrl("http://www.myexample.com"));
+ QVariant s2 = m_page->mainFrame()->evaluateJavaScript("sessionStorage.test");
+ QCOMPARE(s2.toString(), QString("This is a test for session storage"));
+
+ m_view->setHtml(QString("<html><head></head><body><div></div></body></html>"), QUrl("http://www.myexample.com"));
+ m_page->mainFrame()->evaluateJavaScript("var db3; db3=openDatabase('testdb', '1.0', 'test database API', 50000);db3.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Test (text TEXT)', []); }, function(tx, result) { }, function(tx, error) { });");
+ QTest::qWait(200);
+
+ QWebSecurityOrigin origin = m_page->mainFrame()->securityOrigin();
+ QList<QWebDatabase> dbs = origin.databases();
+ if (dbs.count() > 0) {
+ QString fileName = dbs[0].fileName();
+ QVERIFY(QFile::exists(fileName));
+ QWebDatabase::removeDatabase(dbs[0]);
+ QVERIFY(!QFile::exists(fileName));
+ }
+ QTest::qWait(1000);
+}
+
+class PluginPage : public QWebPage
+{
+public:
+ PluginPage(QObject *parent = 0)
+ : QWebPage(parent) {}
+
+ struct CallInfo
+ {
+ CallInfo(const QString &c, const QUrl &u,
+ const QStringList &pn, const QStringList &pv,
+ QObject *r)
+ : classid(c), url(u), paramNames(pn),
+ paramValues(pv), returnValue(r)
+ {}
+ QString classid;
+ QUrl url;
+ QStringList paramNames;
+ QStringList paramValues;
+ QObject *returnValue;
+ };
+
+ QList<CallInfo> calls;
+
+protected:
+ virtual QObject *createPlugin(const QString &classid, const QUrl &url,
+ const QStringList &paramNames,
+ const QStringList &paramValues)
+ {
+ QObject *result = 0;
+ if (classid == "pushbutton")
+ result = new QPushButton();
+ else if (classid == "lineedit")
+ result = new QLineEdit();
+ if (result)
+ result->setObjectName(classid);
+ calls.append(CallInfo(classid, url, paramNames, paramValues, result));
+ return result;
+ }
+};
+
+void tst_QWebPage::createPlugin()
+{
+ QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool)));
+
+ PluginPage* newPage = new PluginPage(m_view);
+ m_view->setPage(newPage);
+
+ // plugins not enabled by default, so the plugin shouldn't be loaded
+ m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
+ QTRY_COMPARE(loadSpy.count(), 1);
+ QCOMPARE(newPage->calls.count(), 0);
+
+ m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+
+ // type has to be application/x-qt-plugin
+ m_view->setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='pushbutton' id='mybutton'/></body></html>"));
+ QTRY_COMPARE(loadSpy.count(), 2);
+ QCOMPARE(newPage->calls.count(), 0);
+
+ m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
+ QTRY_COMPARE(loadSpy.count(), 3);
+ QCOMPARE(newPage->calls.count(), 1);
+ {
+ PluginPage::CallInfo ci = newPage->calls.takeFirst();
+ QCOMPARE(ci.classid, QString::fromLatin1("pushbutton"));
+ QCOMPARE(ci.url, QUrl());
+ QCOMPARE(ci.paramNames.count(), 3);
+ QCOMPARE(ci.paramValues.count(), 3);
+ QCOMPARE(ci.paramNames.at(0), QString::fromLatin1("type"));
+ QCOMPARE(ci.paramValues.at(0), QString::fromLatin1("application/x-qt-plugin"));
+ QCOMPARE(ci.paramNames.at(1), QString::fromLatin1("classid"));
+ QCOMPARE(ci.paramValues.at(1), QString::fromLatin1("pushbutton"));
+ QCOMPARE(ci.paramNames.at(2), QString::fromLatin1("id"));
+ QCOMPARE(ci.paramValues.at(2), QString::fromLatin1("mybutton"));
+ QVERIFY(ci.returnValue != 0);
+ QVERIFY(ci.returnValue->inherits("QPushButton"));
+ }
+ // test JS bindings
+ QCOMPARE(newPage->mainFrame()->evaluateJavaScript("document.getElementById('mybutton').toString()").toString(),
+ QString::fromLatin1("[object HTMLObjectElement]"));
+ QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mybutton.toString()").toString(),
+ QString::fromLatin1("[object HTMLObjectElement]"));
+ QCOMPARE(newPage->mainFrame()->evaluateJavaScript("typeof mybutton.objectName").toString(),
+ QString::fromLatin1("string"));
+ QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mybutton.objectName").toString(),
+ QString::fromLatin1("pushbutton"));
+ QCOMPARE(newPage->mainFrame()->evaluateJavaScript("typeof mybutton.clicked").toString(),
+ QString::fromLatin1("function"));
+ QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mybutton.clicked.toString()").toString(),
+ QString::fromLatin1("function clicked() {\n [native code]\n}"));
+
+ m_view->setHtml(QString("<html><body><table>"
+ "<tr><object type='application/x-qt-plugin' classid='lineedit' id='myedit'/></tr>"
+ "<tr><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></tr>"
+ "</table></body></html>"), QUrl("http://foo.bar.baz"));
+ QTRY_COMPARE(loadSpy.count(), 4);
+ QCOMPARE(newPage->calls.count(), 2);
+ {
+ PluginPage::CallInfo ci = newPage->calls.takeFirst();
+ QCOMPARE(ci.classid, QString::fromLatin1("lineedit"));
+ QCOMPARE(ci.url, QUrl());
+ QCOMPARE(ci.paramNames.count(), 3);
+ QCOMPARE(ci.paramValues.count(), 3);
+ QCOMPARE(ci.paramNames.at(0), QString::fromLatin1("type"));
+ QCOMPARE(ci.paramValues.at(0), QString::fromLatin1("application/x-qt-plugin"));
+ QCOMPARE(ci.paramNames.at(1), QString::fromLatin1("classid"));
+ QCOMPARE(ci.paramValues.at(1), QString::fromLatin1("lineedit"));
+ QCOMPARE(ci.paramNames.at(2), QString::fromLatin1("id"));
+ QCOMPARE(ci.paramValues.at(2), QString::fromLatin1("myedit"));
+ QVERIFY(ci.returnValue != 0);
+ QVERIFY(ci.returnValue->inherits("QLineEdit"));
+ }
+ {
+ PluginPage::CallInfo ci = newPage->calls.takeFirst();
+ QCOMPARE(ci.classid, QString::fromLatin1("pushbutton"));
+ QCOMPARE(ci.url, QUrl());
+ QCOMPARE(ci.paramNames.count(), 3);
+ QCOMPARE(ci.paramValues.count(), 3);
+ QCOMPARE(ci.paramNames.at(0), QString::fromLatin1("type"));
+ QCOMPARE(ci.paramValues.at(0), QString::fromLatin1("application/x-qt-plugin"));
+ QCOMPARE(ci.paramNames.at(1), QString::fromLatin1("classid"));
+ QCOMPARE(ci.paramValues.at(1), QString::fromLatin1("pushbutton"));
+ QCOMPARE(ci.paramNames.at(2), QString::fromLatin1("id"));
+ QCOMPARE(ci.paramValues.at(2), QString::fromLatin1("mybutton"));
+ QVERIFY(ci.returnValue != 0);
+ QVERIFY(ci.returnValue->inherits("QPushButton"));
+ }
+
+ m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, false);
+
+ m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
+ QTRY_COMPARE(loadSpy.count(), 5);
+ QCOMPARE(newPage->calls.count(), 0);
+}
+
+class PluginTrackedPage : public QWebPage
+{
+public:
+
+ int count;
+ QPointer<QWidget> widget;
+
+ PluginTrackedPage(QWidget *parent = 0) : QWebPage(parent), count(0) {
+ settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ }
+
+ virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) {
+ count++;
+ QWidget *w = new QWidget;
+ widget = w;
+ return w;
+ }
+};
+
+void tst_QWebPage::destroyPlugin()
+{
+ PluginTrackedPage* page = new PluginTrackedPage(m_view);
+ m_view->setPage(page);
+
+ // we create the plugin, so the widget should be constructed
+ QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>");
+ m_view->setHtml(content);
+ QVERIFY(page->widget != 0);
+ QCOMPARE(page->count, 1);
+
+ // navigate away, the plugin widget should be destructed
+ m_view->setHtml("<html><body>Hi</body></html>");
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(page->widget == 0);
+}
+
+void tst_QWebPage::createViewlessPlugin()
+{
+ PluginTrackedPage* page = new PluginTrackedPage;
+ QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>");
+ page->mainFrame()->setHtml(content);
+ QCOMPARE(page->count, 1);
+ QVERIFY(page->widget != 0);
+ delete page;
+}
+
+// import private API
+void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName);
+QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page);
+void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path);
+
+void tst_QWebPage::multiplePageGroupsAndLocalStorage()
+{
+ QDir dir(QDir::currentPath());
+ dir.mkdir("path1");
+ dir.mkdir("path2");
+
+ QWebView view1;
+ QWebView view2;
+
+ qt_websettings_setLocalStorageDatabasePath(view1.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
+ qt_webpage_setGroupName(view1.page(), "group1");
+ qt_websettings_setLocalStorageDatabasePath(view2.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
+ qt_webpage_setGroupName(view2.page(), "group2");
+ QCOMPARE(qt_webpage_groupName(view1.page()), QString("group1"));
+ QCOMPARE(qt_webpage_groupName(view2.page()), QString("group2"));
+
+
+ view1.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+ view2.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+
+ view1.page()->mainFrame()->evaluateJavaScript("localStorage.test='value1';");
+ view2.page()->mainFrame()->evaluateJavaScript("localStorage.test='value2';");
+
+ view1.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+ view2.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
+
+ QVariant s1 = view1.page()->mainFrame()->evaluateJavaScript("localStorage.test");
+ QCOMPARE(s1.toString(), QString("value1"));
+
+ QVariant s2 = view2.page()->mainFrame()->evaluateJavaScript("localStorage.test");
+ QCOMPARE(s2.toString(), QString("value2"));
+
+ QTest::qWait(1000);
+
+ QFile::remove(QDir::toNativeSeparators(QDir::currentPath() + "/path1/http_www.myexample.com_0.localstorage"));
+ QFile::remove(QDir::toNativeSeparators(QDir::currentPath() + "/path2/http_www.myexample.com_0.localstorage"));
+ dir.rmdir(QDir::toNativeSeparators("./path1"));
+ dir.rmdir(QDir::toNativeSeparators("./path2"));
+}
+
+class CursorTrackedPage : public QWebPage
+{
+public:
+
+ CursorTrackedPage(QWidget *parent = 0): QWebPage(parent) {
+ setViewportSize(QSize(1024, 768)); // big space
+ }
+
+ QString selectedText() {
+ return mainFrame()->evaluateJavaScript("window.getSelection().toString()").toString();
+ }
+
+ int selectionStartOffset() {
+ return mainFrame()->evaluateJavaScript("window.getSelection().getRangeAt(0).startOffset").toInt();
+ }
+
+ int selectionEndOffset() {
+ return mainFrame()->evaluateJavaScript("window.getSelection().getRangeAt(0).endOffset").toInt();
+ }
+
+ // true if start offset == end offset, i.e. no selected text
+ int isSelectionCollapsed() {
+ return mainFrame()->evaluateJavaScript("window.getSelection().getRangeAt(0).collapsed").toBool();
+ }
+};
+
+void tst_QWebPage::cursorMovements()
+{
+ CursorTrackedPage* page = new CursorTrackedPage;
+ QString content("<html><body<p id=one>The quick brown fox</p><p id=two>jumps over the lazy dog</p><p>May the source<br/>be with you!</p></body></html>");
+ page->mainFrame()->setHtml(content);
+
+ // this will select the first paragraph
+ QString script = "var range = document.createRange(); " \
+ "var node = document.getElementById(\"one\"); " \
+ "range.selectNode(node); " \
+ "getSelection().addRange(range);";
+ page->mainFrame()->evaluateJavaScript(script);
+ QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
+
+ // these actions must exist
+ QVERIFY(page->action(QWebPage::MoveToNextChar) != 0);
+ QVERIFY(page->action(QWebPage::MoveToPreviousChar) != 0);
+ QVERIFY(page->action(QWebPage::MoveToNextWord) != 0);
+ QVERIFY(page->action(QWebPage::MoveToPreviousWord) != 0);
+ QVERIFY(page->action(QWebPage::MoveToNextLine) != 0);
+ QVERIFY(page->action(QWebPage::MoveToPreviousLine) != 0);
+ QVERIFY(page->action(QWebPage::MoveToStartOfLine) != 0);
+ QVERIFY(page->action(QWebPage::MoveToEndOfLine) != 0);
+ QVERIFY(page->action(QWebPage::MoveToStartOfBlock) != 0);
+ QVERIFY(page->action(QWebPage::MoveToEndOfBlock) != 0);
+ QVERIFY(page->action(QWebPage::MoveToStartOfDocument) != 0);
+ QVERIFY(page->action(QWebPage::MoveToEndOfDocument) != 0);
+
+ // right now they are disabled because contentEditable is false
+ QCOMPARE(page->action(QWebPage::MoveToNextChar)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToPreviousChar)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToNextWord)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToPreviousWord)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToNextLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToPreviousLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToStartOfLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToEndOfLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToStartOfBlock)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToEndOfBlock)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToStartOfDocument)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::MoveToEndOfDocument)->isEnabled(), false);
+
+ // make it editable before navigating the cursor
+ page->setContentEditable(true);
+
+ // here the actions are enabled after contentEditable is true
+ QCOMPARE(page->action(QWebPage::MoveToNextChar)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToPreviousChar)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToNextWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToPreviousWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToNextLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToPreviousLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToStartOfLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToEndOfLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToStartOfBlock)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToEndOfBlock)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToStartOfDocument)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::MoveToEndOfDocument)->isEnabled(), true);
+
+ // cursor will be before the word "jump"
+ page->triggerAction(QWebPage::MoveToNextChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 0);
+
+ // cursor will be between 'j' and 'u' in the word "jump"
+ page->triggerAction(QWebPage::MoveToNextChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 1);
+
+ // cursor will be between 'u' and 'm' in the word "jump"
+ page->triggerAction(QWebPage::MoveToNextChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 2);
+
+ // cursor will be after the word "jump"
+ page->triggerAction(QWebPage::MoveToNextWord);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 5);
+
+ // cursor will be after the word "lazy"
+ page->triggerAction(QWebPage::MoveToNextWord);
+ page->triggerAction(QWebPage::MoveToNextWord);
+ page->triggerAction(QWebPage::MoveToNextWord);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 19);
+
+ // cursor will be between 'z' and 'y' in "lazy"
+ page->triggerAction(QWebPage::MoveToPreviousChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 18);
+
+ // cursor will be between 'a' and 'z' in "lazy"
+ page->triggerAction(QWebPage::MoveToPreviousChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 17);
+
+ // cursor will be before the word "lazy"
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 15);
+
+ // cursor will be before the word "quick"
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 4);
+
+ // cursor will be between 'p' and 's' in the word "jumps"
+ page->triggerAction(QWebPage::MoveToNextWord);
+ page->triggerAction(QWebPage::MoveToNextWord);
+ page->triggerAction(QWebPage::MoveToNextWord);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 4);
+
+ // cursor will be before the word "jumps"
+ page->triggerAction(QWebPage::MoveToStartOfLine);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 0);
+
+ // cursor will be after the word "dog"
+ page->triggerAction(QWebPage::MoveToEndOfLine);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 23);
+
+ // cursor will be between 'w' and 'n' in "brown"
+ page->triggerAction(QWebPage::MoveToStartOfLine);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 14);
+
+ // cursor will be after the word "fox"
+ page->triggerAction(QWebPage::MoveToEndOfLine);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 19);
+
+ // cursor will be before the word "The"
+ page->triggerAction(QWebPage::MoveToStartOfDocument);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 0);
+
+ // cursor will be after the word "you!"
+ page->triggerAction(QWebPage::MoveToEndOfDocument);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 12);
+
+ // cursor will be before the word "be"
+ page->triggerAction(QWebPage::MoveToStartOfBlock);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 2);
+
+ // cursor will be after the word "you!"
+ page->triggerAction(QWebPage::MoveToEndOfBlock);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 12);
+
+ // try to move before the document start
+ page->triggerAction(QWebPage::MoveToStartOfDocument);
+ page->triggerAction(QWebPage::MoveToPreviousChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 0);
+ page->triggerAction(QWebPage::MoveToStartOfDocument);
+ page->triggerAction(QWebPage::MoveToPreviousWord);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 0);
+
+ // try to move past the document end
+ page->triggerAction(QWebPage::MoveToEndOfDocument);
+ page->triggerAction(QWebPage::MoveToNextChar);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 12);
+ page->triggerAction(QWebPage::MoveToEndOfDocument);
+ page->triggerAction(QWebPage::MoveToNextWord);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 12);
+
+ delete page;
+}
+
+void tst_QWebPage::textSelection()
+{
+ CursorTrackedPage* page = new CursorTrackedPage;
+ QString content("<html><body<p id=one>The quick brown fox</p>" \
+ "<p id=two>jumps over the lazy dog</p>" \
+ "<p>May the source<br/>be with you!</p></body></html>");
+ page->mainFrame()->setHtml(content);
+
+ // this will select the first paragraph
+ QString script = "var range = document.createRange(); " \
+ "var node = document.getElementById(\"one\"); " \
+ "range.selectNode(node); " \
+ "getSelection().addRange(range);";
+ page->mainFrame()->evaluateJavaScript(script);
+ QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
+
+ // these actions must exist
+ QVERIFY(page->action(QWebPage::SelectNextChar) != 0);
+ QVERIFY(page->action(QWebPage::SelectPreviousChar) != 0);
+ QVERIFY(page->action(QWebPage::SelectNextWord) != 0);
+ QVERIFY(page->action(QWebPage::SelectPreviousWord) != 0);
+ QVERIFY(page->action(QWebPage::SelectNextLine) != 0);
+ QVERIFY(page->action(QWebPage::SelectPreviousLine) != 0);
+ QVERIFY(page->action(QWebPage::SelectStartOfLine) != 0);
+ QVERIFY(page->action(QWebPage::SelectEndOfLine) != 0);
+ QVERIFY(page->action(QWebPage::SelectStartOfBlock) != 0);
+ QVERIFY(page->action(QWebPage::SelectEndOfBlock) != 0);
+ QVERIFY(page->action(QWebPage::SelectStartOfDocument) != 0);
+ QVERIFY(page->action(QWebPage::SelectEndOfDocument) != 0);
+
+ // right now they are disabled because contentEditable is false
+ QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectPreviousWord)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectNextLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectPreviousLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectStartOfLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectEndOfLine)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectStartOfBlock)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectEndOfBlock)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), false);
+
+ // make it editable before navigating the cursor
+ page->setContentEditable(true);
+
+ // here the actions are enabled after contentEditable is true
+ QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectPreviousWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectNextLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectPreviousLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectStartOfLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectEndOfLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectStartOfBlock)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectEndOfBlock)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), true);
+
+ delete page;
+}
+
+void tst_QWebPage::textEditing()
+{
+ CursorTrackedPage* page = new CursorTrackedPage;
+ QString content("<html><body<p id=one>The quick brown fox</p>" \
+ "<p id=two>jumps over the lazy dog</p>" \
+ "<p>May the source<br/>be with you!</p></body></html>");
+ page->mainFrame()->setHtml(content);
+
+ // this will select the first paragraph
+ QString script = "var range = document.createRange(); " \
+ "var node = document.getElementById(\"one\"); " \
+ "range.selectNode(node); " \
+ "getSelection().addRange(range);";
+ page->mainFrame()->evaluateJavaScript(script);
+ QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
+
+ // these actions must exist
+ QVERIFY(page->action(QWebPage::DeleteStartOfWord) != 0);
+ QVERIFY(page->action(QWebPage::DeleteEndOfWord) != 0);
+ QVERIFY(page->action(QWebPage::SetTextDirectionDefault) != 0);
+ QVERIFY(page->action(QWebPage::SetTextDirectionLeftToRight) != 0);
+ QVERIFY(page->action(QWebPage::SetTextDirectionRightToLeft) != 0);
+ QVERIFY(page->action(QWebPage::ToggleBold) != 0);
+ QVERIFY(page->action(QWebPage::ToggleItalic) != 0);
+ QVERIFY(page->action(QWebPage::ToggleUnderline) != 0);
+
+ // right now they are disabled because contentEditable is false
+ QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::DeleteEndOfWord)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SetTextDirectionDefault)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SetTextDirectionLeftToRight)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::SetTextDirectionRightToLeft)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), false);
+ QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), false);
+
+ // make it editable before navigating the cursor
+ page->setContentEditable(true);
+
+ // here the actions are enabled after contentEditable is true
+ QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::DeleteEndOfWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SetTextDirectionDefault)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SetTextDirectionLeftToRight)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SetTextDirectionRightToLeft)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), true);
+
+ delete page;
+}
+
+
+QTEST_MAIN(tst_QWebPage)
+#include "tst_qwebpage.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
new file mode 100644
index 0000000..16cb457
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
@@ -0,0 +1,3 @@
+
+TEMPLATE = subdirs
+SUBDIRS = qwebframe qwebpage qwebhistoryinterface