summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/Api
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/headers.pri4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp197
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h9
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp71
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h3
9 files changed, 222 insertions, 91 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
index e4bb618..d92eb1c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
+++ b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
@@ -6,4 +6,6 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
$$PWD/qwebhistoryinterface.h \
$$PWD/qwebdatabase.h \
$$PWD/qwebsecurityorigin.h \
- $$PWD/qwebelement.h
+ $$PWD/qwebelement.h \
+ $$PWD/qwebpluginfactory.h \
+ $$PWD/qwebhistory.h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
index 2db9cd0..2b25f95 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
@@ -160,6 +160,20 @@ void QWebDatabase::removeDatabase(const QWebDatabase &db)
}
/*!
+ \since 4.6
+
+ Deletes all web databases in the configured offline storage path.
+
+ \sa QWebSettings::setOfflineStoragePath()
+*/
+void QWebDatabase::removeAllDatabases()
+{
+#if ENABLE(DATABASE)
+ DatabaseTracker::tracker().deleteAllDatabases();
+#endif
+}
+
+/*!
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
index 4e832bb..5b4f704 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
@@ -46,6 +46,7 @@ public:
QWebSecurityOrigin origin() const;
static void removeDatabase(const QWebDatabase &db);
+ static void removeAllDatabases();
private:
QWebDatabase(QWebDatabasePrivate* priv);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 381251d..29d380d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -20,73 +20,71 @@
#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 "qwebelement.h"
+#include "CallFrame.h"
+#include "Document.h"
#include "DocumentLoader.h"
+#include "DragData.h"
+#include "Element.h"
#include "FocusController.h"
-#include "FrameLoaderClientQt.h"
#include "Frame.h"
+#include "FrameLoaderClientQt.h"
#include "FrameTree.h"
#include "FrameView.h"
+#include "GCController.h"
+#include "GraphicsContext.h"
+#include "HTMLMetaElement.h"
+#include "HitTestResult.h"
#include "IconDatabase.h"
#include "InspectorController.h"
+#include "JSDOMBinding.h"
+#include "JSDOMWindowBase.h"
+#include "JSLock.h"
+#include "JSObject.h"
+#include "NodeList.h"
#include "Page.h"
+#include "PlatformMouseEvent.h"
+#include "PlatformWheelEvent.h"
+#include "PrintContext.h"
#include "PutPropertySlot.h"
-#include "ResourceRequest.h"
+#include "RenderTreeAsText.h"
#include "RenderView.h"
-#include "SelectionController.h"
+#include "ResourceRequest.h"
+#include "ScriptController.h"
+#include "ScriptSourceCode.h"
+#include "ScriptValue.h"
#include "Scrollbar.h"
-#include "PrintContext.h"
+#include "SelectionController.h"
#include "SubstituteData.h"
-
-#include "markup.h"
#include "htmlediting.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 "markup.h"
#include "qt_instance.h"
#include "qt_runtime.h"
+#include "qwebelement.h"
+#include "qwebframe_p.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include "qwebsecurityorigin.h"
+#include "qwebsecurityorigin_p.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 <QMultiMap>
#include <qdebug.h>
#include <qevent.h>
#include <qfileinfo.h>
#include <qpainter.h>
-#include <QMultiMap>
+#include <qprinter.h>
+#include <qregion.h>
+
+#if QT_VERSION < 0x040400
+#include "qwebnetworkinterface.h"
+#endif
+
#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;
@@ -166,27 +164,56 @@ int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame *qframe)
return controller->numberOfActiveAnimations();
}
-void QWebFramePrivate::init(QWebFrame *qframe, WebCore::Page *webcorePage, QWebFrameData *frameData)
+void QWEBKIT_EXPORT qt_drt_clearFrameName(QWebFrame* qFrame)
{
- q = qframe;
+ Frame* frame = QWebFramePrivate::core(qFrame);
+ frame->tree()->clearName();
+}
- allowsScrolling = frameData->allowsScrolling;
- marginWidth = frameData->marginWidth;
- marginHeight = frameData->marginHeight;
+int QWEBKIT_EXPORT qt_drt_javaScriptObjectsCount()
+{
+ return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount();
+}
+
+void QWEBKIT_EXPORT qt_drt_garbageCollector_collect()
+{
+ gcController().garbageCollectNow();
+}
+void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone)
+{
+ gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
+}
+
+QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame,
+ WebCore::HTMLFrameOwnerElement* ownerFrameElement,
+ const WebCore::String& frameName)
+ : name(frameName)
+ , ownerElement(ownerFrameElement)
+ , page(parentPage)
+ , allowsScrolling(true)
+ , marginWidth(0)
+ , marginHeight(0)
+{
frameLoaderClient = new FrameLoaderClientQt();
- RefPtr<Frame> newFrame = Frame::create(webcorePage, frameData->ownerElement, frameLoaderClient);
- frame = newFrame.get();
- frameLoaderClient->setFrame(qframe, frame);
+ frame = Frame::create(page, ownerElement, frameLoaderClient);
// 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);
+ frame->tree()->setName(name);
+ if (parentFrame)
+ parentFrame->tree()->appendChild(frame);
+}
- // balanced by adoptRef in FrameLoaderClientQt::createFrame
- if (frameData->ownerElement)
- frame->ref();
+void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData)
+{
+ q = qframe;
+
+ allowsScrolling = frameData->allowsScrolling;
+ marginWidth = frameData->marginWidth;
+ marginHeight = frameData->marginHeight;
+ frame = frameData->frame.get();
+ frameLoaderClient = frameData->frameLoaderClient;
+ frameLoaderClient->setFrame(qframe, frame);
frame->init();
}
@@ -280,7 +307,7 @@ QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData)
, d(new QWebFramePrivate)
{
d->page = parent;
- d->init(this, parent->d->page, frameData);
+ d->init(this, frameData);
if (!frameData->url.isEmpty()) {
WebCore::ResourceRequest request(frameData->url, frameData->referrer);
@@ -293,7 +320,7 @@ QWebFrame::QWebFrame(QWebFrame *parent, QWebFrameData *frameData)
, d(new QWebFramePrivate)
{
d->page = parent->d->page;
- d->init(this, parent->d->page->d->page, frameData);
+ d->init(this, frameData);
}
QWebFrame::~QWebFrame()
@@ -316,6 +343,8 @@ QWebFrame::~QWebFrame()
new URL, you should add them in a slot connected to the
javaScriptWindowObjectCleared() signal.
+ If Javascript is not enabled for this page, then this method does nothing.
+
The \a object will never be explicitly deleted by QtWebKit.
*/
void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object)
@@ -338,10 +367,15 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
new URL, you should add them in a slot connected to the
javaScriptWindowObjectCleared() signal.
+ If Javascript is not enabled for this page, then this method does nothing.
+
The ownership of \a object is specified using \a own.
*/
void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership)
{
+ if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled))
+ return;
+
JSC::JSLock lock(false);
JSDOMWindow* window = toJSDOMWindow(d->frame);
JSC::Bindings::RootObject* root = d->frame->script()->bindingRootObject();
@@ -487,6 +521,17 @@ QUrl QWebFrame::url() const
}
/*!
+ \property QWebFrame::baseUrl
+ \brief the base URL of the frame, can be used to resolve relative URLs
+ \since 4.6
+*/
+
+QUrl QWebFrame::baseUrl() const
+{
+ return d->frame->loader()->baseURL();
+}
+
+/*!
\property QWebFrame::icon
\brief the icon associated with this frame
@@ -933,6 +978,27 @@ qreal QWebFrame::zoomFactor() const
}
/*!
+ \property QWebFrame::focus
+ \since 4.6
+
+ Returns true if this frame has keyboard input focus; otherwise, returns false.
+*/
+bool QWebFrame::hasFocus() const
+{
+ return QWebFramePrivate::kit(d->frame->page()->focusController()->focusedFrame()) == this;
+}
+
+/*!
+ \since 4.6
+
+ Gives keyboard input focus to this frame.
+*/
+void QWebFrame::setFocus()
+{
+ QWebFramePrivate::core(this)->page()->focusController()->setFocusedFrame(QWebFramePrivate::core(this));
+}
+
+/*!
Returns the position of the frame relative to it's parent frame.
*/
QPoint QWebFrame::pos() const
@@ -1229,6 +1295,25 @@ QWebFrame* QWebFramePrivate::kit(WebCore::Frame* coreFrame)
*/
/*!
+ \fn void QWebFrame::loadStarted()
+ \since 4.6
+
+ This signal is emitted when a new load of this frame is started.
+
+ \sa loadFinished()
+*/
+
+/*!
+ \fn void QWebFrame::loadFinished(bool ok)
+ \since 4.6
+
+ This signal is emitted when a load of this frame is finished.
+ \a ok will indicate whether the load was successful or any error occurred.
+
+ \sa loadStarted()
+*/
+
+/*!
\class QWebHitTestResult
\since 4.4
\brief The QWebHitTestResult class provides information about the web
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
index 3ed453e..2c5309a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -109,9 +109,11 @@ class QWEBKIT_EXPORT QWebFrame : public QObject
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
+ Q_PROPERTY(QUrl baseUrl READ baseUrl)
Q_PROPERTY(QIcon icon READ icon)
Q_PROPERTY(QSize contentsSize READ contentsSize)
Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition)
+ Q_PROPERTY(bool focus READ hasFocus)
private:
QWebFrame(QWebPage *parent, QWebFrameData *frameData);
QWebFrame(QWebFrame *parent, QWebFrameData *frameData);
@@ -140,6 +142,7 @@ public:
QString title() const;
void setUrl(const QUrl &url);
QUrl url() const;
+ QUrl baseUrl() const;
QIcon icon() const;
QMultiMap<QString, QString> metaData() const;
@@ -171,6 +174,9 @@ public:
qreal zoomFactor() const;
void setZoomFactor(qreal factor);
+ bool hasFocus() const;
+ void setFocus();
+
QPoint pos() const;
QRect geometry() const;
QSize contentsSize() const;
@@ -204,6 +210,9 @@ Q_SIGNALS:
void contentsSizeChanged(const QSize &size);
+ void loadStarted();
+ void loadFinished(bool ok);
+
private:
friend class QWebPage;
friend class QWebPagePrivate;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
index 0c7da90..2b5c187 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -43,9 +43,16 @@ class QWebPage;
class QWebFrameData
{
public:
+ QWebFrameData(WebCore::Page*, WebCore::Frame* parentFrame = 0,
+ WebCore::HTMLFrameOwnerElement* = 0,
+ const WebCore::String& frameName = WebCore::String());
+
WebCore::KURL url;
WebCore::String name;
WebCore::HTMLFrameOwnerElement* ownerElement;
+ WebCore::Page* page;
+ RefPtr<WebCore::Frame> frame;
+ WebCore::FrameLoaderClientQt* frameLoaderClient;
WebCore::String referrer;
bool allowsScrolling;
@@ -67,8 +74,7 @@ public:
, marginWidth(-1)
, marginHeight(-1)
{}
- void init(QWebFrame *qframe, WebCore::Page *page,
- QWebFrameData *frameData);
+ void init(QWebFrame* qframe, QWebFrameData* frameData);
inline QWebFrame *parentFrame() { return qobject_cast<QWebFrame*>(q->parent()); }
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 5899a1b..84753bd 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -325,11 +325,7 @@ bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRe
void QWebPagePrivate::createMainFrame()
{
if (!mainFrame) {
- QWebFrameData frameData;
- frameData.ownerElement = 0;
- frameData.allowsScrolling = true;
- frameData.marginWidth = 0;
- frameData.marginHeight = 0;
+ QWebFrameData frameData(page);
mainFrame = new QWebFrame(q, &frameData);
emit q->frameCreated(mainFrame);
@@ -420,23 +416,6 @@ QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMen
}
#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());
@@ -844,7 +823,7 @@ void QWebPagePrivate::focusInEvent(QFocusEvent *ev)
Frame *frame = focusController->focusedFrame();
focusController->setActive(true);
if (frame) {
- frame->selection()->setFocused(true);
+ focusController->setFocused(true);
} else {
focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame));
}
@@ -857,10 +836,7 @@ void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
// focusInEvent() we can re-activate the frame.
FocusController *focusController = page->focusController();
focusController->setActive(false);
- Frame *frame = focusController->focusedFrame();
- if (frame) {
- frame->selection()->setFocused(false);
- }
+ focusController->setFocused(false);
}
void QWebPagePrivate::dragEnterEvent(QDragEnterEvent *ev)
@@ -1337,6 +1313,21 @@ QWebFrame *QWebPage::currentFrame() const
return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame();
}
+
+/*!
+ Returns the frame at the given point \a pos.
+
+ \sa mainFrame(), currentFrame()
+*/
+QWebFrame* QWebPage::frameAt(const QPoint& pos) const
+{
+ QWebFrame* webFrame = mainFrame();
+ if (!webFrame->geometry().contains(pos))
+ return 0;
+ QWebHitTestResult hitTestResult = webFrame->hitTestContent(pos);
+ return hitTestResult.frame();
+}
+
/*!
Returns a pointer to the view's history of navigated web pages.
*/
@@ -1430,6 +1421,28 @@ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QStr
}
/*!
+ \fn bool QWebPage::shouldInterruptJavaScript()
+ \since 4.6
+ This function is called when a JavaScript program is running for a long period of time.
+
+ If the user wanted to stop the JavaScript the implementation should return true; otherwise false.
+
+ The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons.
+
+ \warning Because of binary compatibility constraints, this function is not virtual. If you want to
+ provide your own implementation in a QWebPage subclass, reimplement the shouldInterruptJavaScript()
+ slot in your subclass instead. QtWebKit will dynamically detect the slot and call it.
+*/
+bool QWebPage::shouldInterruptJavaScript()
+{
+#ifdef QT_NO_MESSAGEBOX
+ return false;
+#else
+ return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
+#endif
+}
+
+/*!
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.
@@ -2193,9 +2206,9 @@ bool QWebPage::swallowContextMenuEvent(QContextMenuEvent *event)
{
d->page->contextMenuController()->clearContextMenu();
- if (QWebFrame* webFrame = d->frameAt(event->pos())) {
+ if (QWebFrame* webFrame = frameAt(event->pos())) {
Frame* frame = QWebFramePrivate::core(webFrame);
- if (Scrollbar* scrollbar = frame->view()->scrollbarUnderPoint(PlatformMouseEvent(event, 1).pos())) {
+ if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos())) {
return scrollbar->contextMenu(PlatformMouseEvent(event, 1));
}
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index 86822d2..517a77c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -193,6 +193,7 @@ public:
QWebFrame *mainFrame() const;
QWebFrame *currentFrame() const;
+ QWebFrame* frameAt(const QPoint& pos) const;
QWebHistory *history() const;
QWebSettings *settings() const;
@@ -287,6 +288,9 @@ public:
inline QWebPagePrivate* handle() const { return d; }
+public Q_SLOTS:
+ bool shouldInterruptJavaScript();
+
Q_SIGNALS:
void loadStarted();
void loadProgress(int progress);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index 984bec1..3a3a674 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -75,9 +75,6 @@ public:
#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);
#ifndef NDEBUG