diff options
author | Ben Murdoch <benm@google.com> | 2011-05-13 16:23:25 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-16 11:35:02 +0100 |
commit | 65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch) | |
tree | f478babb801e720de7bfaee23443ffe029f58731 /Source/WebKit/qt | |
parent | 47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff) | |
download | external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2 |
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebKit/qt')
190 files changed, 71945 insertions, 0 deletions
diff --git a/Source/WebKit/qt/Api/DerivedSources.pro b/Source/WebKit/qt/Api/DerivedSources.pro new file mode 100644 index 0000000..3109ffe --- /dev/null +++ b/Source/WebKit/qt/Api/DerivedSources.pro @@ -0,0 +1,108 @@ +TEMPLATE = lib +TARGET = dummy + +include(headers.pri) + +CONFIG -= debug_and_release + +DESTDIR = ../../../include/QtWebKit + +QUOTE = "" +DOUBLE_ESCAPED_QUOTE = "" +ESCAPE = "" +win32-msvc* | wince* { + ESCAPE = "^" +} else:contains(QMAKE_HOST.os, "Windows"):isEmpty(QMAKE_SH) { + # MinGW's make will run makefile commands using sh, even if make + # was run from the Windows shell, if it finds sh in the path. + ESCAPE = "^" +} else { + QUOTE = "\'" + DOUBLE_ESCAPED_QUOTE = "\\\'" + ESCAPE = "\\" +} + +qtheader_module.target = $${DESTDIR}/QtWebKit +qtheader_module.depends = $${_PRO_FILE_} +qtheader_module.commands = echo $${QUOTE}$${LITERAL_HASH}ifndef QT_QTWEBKIT_MODULE_H$${QUOTE} > $${qtheader_module.target} && +qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}define QT_QTWEBKIT_MODULE_H$${QUOTE} >> $${qtheader_module.target} && +qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}include $${ESCAPE}<QtNetwork/QtNetwork$${ESCAPE}>$${QUOTE} >> $${qtheader_module.target} && +WEBKIT_CLASS_HEADERS = $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/QtWebKit + +regex = ".*\\sclass\\sQWEBKIT_EXPORT\\s(\\w+)\\s(.*)" + +for(HEADER, WEBKIT_API_HEADERS) { + # 1. Append to QtWebKit header that includes all other header files + # Quotes need to be escaped once more when placed in eval() + eval(qtheader_module.commands += echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$basename(HEADER)\\\"$${DOUBLE_ESCAPED_QUOTE} >> $${qtheader_module.target} &&) + + HEADER_NAME = $$basename(HEADER) + HEADER_TARGET = $$replace(HEADER_NAME, [^a-zA-Z0-9_], -) + HEADER_TARGET = "qtheader-$${HEADER_TARGET}" + + # 2. Create forwarding header files for qwebframe.h, etc. + # Normally they contain absolute paths, for package builds we make the path relative so that + # the package sources are relocatable. + + PATH_TO_HEADER = $$HEADER + CONFIG(standalone_package): PATH_TO_HEADER = ../../../Source/WebKit/qt/Api/$$basename(HEADER) + + eval($${HEADER_TARGET}.target = $${DESTDIR}/$${HEADER_NAME}) + eval($${HEADER_TARGET}.depends = $$HEADER) + eval($${HEADER_TARGET}.commands = echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$PATH_TO_HEADER\\\"$${DOUBLE_ESCAPED_QUOTE} > $$eval($${HEADER_TARGET}.target)) + + QMAKE_EXTRA_TARGETS += $$HEADER_TARGET + qtheader_module.depends += $$eval($${HEADER_TARGET}.target) + + # 3. Extract class names of exported classes from the headers and generate + # the class name header files + + src_words = $$cat($$HEADER) + # Really make sure we're dealing with words + src_words = $$split(src_words, " ") + + src = $$join(src_words, $${LITERAL_WHITESPACE}) + for(ever) { + # Looking up by line is faster, so we try that first + res = $$find(src_words, "QWEBKIT_EXPORT") + isEmpty(res):break() + + # Then do a slow lookup to ensure we're dealing with an exported class + res = $$find(src, $$regex) + isEmpty(res):break() + + exp = $$replace(src, $$regex, "EXPORTED_CLASS = \\1") + eval($$exp) + + CLASS_TARGET = "qtheader_$${EXPORTED_CLASS}" + + eval($${CLASS_TARGET}.target = $${DESTDIR}/$${EXPORTED_CLASS}) + eval($${CLASS_TARGET}.depends = $$eval($${HEADER_TARGET}.target)) + eval($${CLASS_TARGET}.commands = echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$basename(HEADER)\\\"$${DOUBLE_ESCAPED_QUOTE} > $$eval($${CLASS_TARGET}.target)) + + QMAKE_EXTRA_TARGETS += $$CLASS_TARGET + WEBKIT_CLASS_HEADERS += $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/$${EXPORTED_CLASS} + + generated_files.depends += $$eval($${CLASS_TARGET}.target) + qtheader_pri.depends += $$eval($${CLASS_TARGET}.target) + + # Qt's QRegExp does not support inline non-greedy matching, + # so we'll have to work around it by updating the haystack + src = $$replace(src, $$regex, "\\2") + src_words = $$join(src, $${LITERAL_WHITESPACE}) + } +} + +qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}endif // QT_QTWEBKIT_MODULE_H$${QUOTE} >> $${qtheader_module.target} +QMAKE_EXTRA_TARGETS += qtheader_module + +qtheader_pri.target = $${DESTDIR}/classheaders.pri +qtheader_pri.depends += $${_PRO_FILE_} +qtheader_pri.commands = echo $${QUOTE}WEBKIT_CLASS_HEADERS = $${WEBKIT_CLASS_HEADERS}$${QUOTE} > $${qtheader_pri.target} +QMAKE_EXTRA_TARGETS += qtheader_pri + +generated_files.depends += $${qtheader_module.target} $${qtheader_pri.target} +QMAKE_EXTRA_TARGETS += generated_files + + + diff --git a/Source/WebKit/qt/Api/headers.pri b/Source/WebKit/qt/Api/headers.pri new file mode 100644 index 0000000..29bb125 --- /dev/null +++ b/Source/WebKit/qt/Api/headers.pri @@ -0,0 +1,15 @@ +WEBKIT_API_HEADERS = $$PWD/qwebframe.h \ + $$PWD/qgraphicswebview.h \ + $$PWD/qwebkitglobal.h \ + $$PWD/qwebkitplatformplugin.h \ + $$PWD/qwebpage.h \ + $$PWD/qwebview.h \ + $$PWD/qwebsettings.h \ + $$PWD/qwebhistoryinterface.h \ + $$PWD/qwebdatabase.h \ + $$PWD/qwebsecurityorigin.h \ + $$PWD/qwebelement.h \ + $$PWD/qwebpluginfactory.h \ + $$PWD/qwebhistory.h \ + $$PWD/qwebinspector.h \ + $$PWD/qwebkitversion.h diff --git a/Source/WebKit/qt/Api/qgraphicswebview.cpp b/Source/WebKit/qt/Api/qgraphicswebview.cpp new file mode 100644 index 0000000..b6ac31b --- /dev/null +++ b/Source/WebKit/qt/Api/qgraphicswebview.cpp @@ -0,0 +1,1150 @@ +/* + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> + + 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 "qgraphicswebview.h" + +#if !defined(QT_NO_GRAPHICSVIEW) + +#include "qwebframe.h" +#include "qwebframe_p.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include "PageClientQt.h" +#include "FrameView.h" +#include "GraphicsContext.h" +#include "IntRect.h" +#include "TiledBackingStore.h" +#include <QtCore/qmetaobject.h> +#include <QtCore/qsharedpointer.h> +#include <QtCore/qtimer.h> +#include <QtGui/qapplication.h> +#include <QtGui/qgraphicsscene.h> +#include <QtGui/qgraphicssceneevent.h> +#include <QtGui/qgraphicsview.h> +#include <QtGui/qpixmapcache.h> +#include <QtGui/qscrollbar.h> +#include <QtGui/qstyleoption.h> +#include <QtGui/qinputcontext.h> +#if defined(Q_WS_X11) +#include <QX11Info> +#endif +#include <Settings.h> + +using namespace WebCore; + +class QGraphicsWebViewPrivate { +public: + QGraphicsWebViewPrivate(QGraphicsWebView* parent) + : q(parent) + , page(0) + , resizesToContents(false) {} + + virtual ~QGraphicsWebViewPrivate(); + + void syncLayers(); + + void updateResizesToContentsForPage(); + + void detachCurrentPage(); + + void _q_doLoadFinished(bool success); + void _q_contentsSizeChanged(const QSize&); + void _q_scaleChanged(); + +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + void _q_updateMicroFocus(); +#endif + void _q_pageDestroyed(); + + QGraphicsWebView* q; + QWebPage* page; + bool resizesToContents; + + QGraphicsItemOverlay* overlay() const + { + if (!page || !page->d->client) + return 0; + return pageClient()->overlay; + } + + PageClientQGraphicsWidget* pageClient() const + { + return static_cast<WebCore::PageClientQGraphicsWidget*> (page->d->client.get()); + } +}; + +QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate() +{ + detachCurrentPage(); +} + +void QGraphicsWebViewPrivate::syncLayers() +{ +#if USE(ACCELERATED_COMPOSITING) + pageClient()->syncLayers(); +#endif +} + +void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success) +{ + // If the page had no title, still make sure it gets the signal + if (q->title().isEmpty()) + emit q->urlChanged(q->url()); + + emit q->loadFinished(success); +} + +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) +void QGraphicsWebViewPrivate::_q_updateMicroFocus() +{ + // Ideally, this should be handled by a common call to an updateMicroFocus function + // in QGraphicsItem. See http://bugreports.qt.nokia.com/browse/QTBUG-7578. + QList<QGraphicsView*> views = q->scene()->views(); + for (int c = 0; c < views.size(); ++c) { + QInputContext* ic = views.at(c)->inputContext(); + if (ic) + ic->update(); + } +} +#endif + +void QGraphicsWebViewPrivate::_q_pageDestroyed() +{ + page = 0; + q->setPage(0); +} + +void QGraphicsWebViewPrivate::updateResizesToContentsForPage() +{ + ASSERT(page); + pageClient()->viewResizesToContents = resizesToContents; + if (resizesToContents) { + // resizes to contents mode requires preferred contents size to be set + if (!page->preferredContentsSize().isValid()) + page->setPreferredContentsSize(QSize(960, 800)); + + QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), + q, SLOT(_q_contentsSizeChanged(const QSize&)), Qt::UniqueConnection); + } else { + QObject::disconnect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), + q, SLOT(_q_contentsSizeChanged(const QSize&))); + } + page->d->page->mainFrame()->view()->setPaintsEntireContents(resizesToContents); + page->d->page->mainFrame()->view()->setDelegatesScrolling(resizesToContents); +} + +void QGraphicsWebViewPrivate::_q_contentsSizeChanged(const QSize& size) +{ + if (!resizesToContents) + return; + q->setGeometry(QRectF(q->geometry().topLeft(), size)); +} + +void QGraphicsWebViewPrivate::_q_scaleChanged() +{ +#if ENABLE(TILED_BACKING_STORE) + if (!page) + return; + pageClient()->updateTiledBackingStoreScale(); +#endif +} + +/*! + \class QGraphicsWebView + \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView. + \since 4.6 + + An instance of this class renders Web content from a URL or supplied as data, using + features of the QtWebKit module. + + If the width and height of the item are not set, they will default to 800 and 600, + respectively. If the Web page contents is larger than that, scrollbars will be shown + if not disabled explicitly. + + \section1 Browser Features + + Many of the functions, signals and properties provided by QWebView are also available + for this item, making it simple to adapt existing code to use QGraphicsWebView instead + of QWebView. + + The item uses a QWebPage object to perform the rendering of Web content, and this can + be obtained with the page() function, enabling the document itself to be accessed and + modified. + + As with QWebView, the item records the browsing history using a QWebHistory object, + accessible using the history() function. The QWebSettings object that defines the + configuration of the browser can be obtained with the settings() function, enabling + features like plugin support to be customized for each item. + + \sa QWebView, QGraphicsTextItem +*/ + +/*! + \fn void QGraphicsWebView::titleChanged(const QString &title) + + This signal is emitted whenever the \a title of the main frame changes. + + \sa title() +*/ + +/*! + \fn void QGraphicsWebView::urlChanged(const QUrl &url) + + This signal is emitted when the \a url of the view changes. + + \sa url(), load() +*/ + +/*! + \fn void QGraphicsWebView::iconChanged() + + This signal is emitted whenever the icon of the page is loaded or changes. + + In order for icons to be loaded, you will need to set an icon database path + using QWebSettings::setIconDatabasePath(). + + \sa icon(), QWebSettings::setIconDatabasePath() +*/ + +/*! + \fn void QGraphicsWebView::loadStarted() + + This signal is emitted when a new load of the page is started. + + \sa loadProgress(), loadFinished() +*/ + +/*! + \fn void QGraphicsWebView::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() +*/ + +/*! + Constructs an empty QGraphicsWebView with parent \a parent. + + \sa load() +*/ +QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent) + : QGraphicsWidget(parent) + , d(new QGraphicsWebViewPrivate(this)) +{ + setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); + setAcceptDrops(true); + setAcceptHoverEvents(true); + setAcceptTouchEvents(true); + setFocusPolicy(Qt::StrongFocus); + setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); +#if ENABLE(TILED_BACKING_STORE) + QObject::connect(this, SIGNAL(scaleChanged()), this, SLOT(_q_scaleChanged())); +#endif +} + +/*! + Destroys the item. +*/ +QGraphicsWebView::~QGraphicsWebView() +{ + delete d; +} + +/*! + Returns a pointer to the underlying web page. + + \sa setPage() +*/ +QWebPage* QGraphicsWebView::page() const +{ + if (!d->page) { + QGraphicsWebView* that = const_cast<QGraphicsWebView*>(this); + QWebPage* page = new QWebPage(that); + + // Default to not having a background, in the case + // the page doesn't provide one. + QPalette palette = QApplication::palette(); + palette.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0)); + page->setPalette(palette); + + that->setPage(page); + } + + return d->page; +} + +/*! \reimp +*/ +void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*) +{ +#if ENABLE(TILED_BACKING_STORE) + if (WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore()) { + // FIXME: We should set the backing store viewport earlier than in paint + backingStore->adjustVisibleRect(); + // QWebFrame::render is a public API, bypass it for tiled rendering so behavior does not need to change. + WebCore::GraphicsContext context(painter); + page()->mainFrame()->d->renderFromTiledBackingStore(&context, option->exposedRect.toAlignedRect()); + return; + } +#endif +#if USE(ACCELERATED_COMPOSITING) && !USE(TEXTURE_MAPPER) + page()->mainFrame()->render(painter, d->overlay() ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect()); +#else + page()->mainFrame()->render(painter, QWebFrame::AllLayers, option->exposedRect.toRect()); +#endif +} + +/*! \reimp +*/ +bool QGraphicsWebView::sceneEvent(QEvent* event) +{ + // Re-implemented in order to allows fixing event-related bugs in patch releases. + + if (d->page && (event->type() == QEvent::TouchBegin + || event->type() == QEvent::TouchEnd + || event->type() == QEvent::TouchUpdate)) { + d->page->event(event); + + // Always return true so that we'll receive also TouchUpdate and TouchEnd events + return true; + } + + return QGraphicsWidget::sceneEvent(event); +} + +/*! \reimp +*/ +QVariant QGraphicsWebView::itemChange(GraphicsItemChange change, const QVariant& value) +{ + switch (change) { + // Differently from QWebView, it is interesting to QGraphicsWebView to handle + // post mouse cursor change notifications. Reason: 'ItemCursorChange' is sent + // as the first action in QGraphicsItem::setCursor implementation, and at that + // item widget's cursor has not been effectively changed yet. + // After cursor is properly set (at 'ItemCursorHasChanged' emission time), we + // fire 'CursorChange'. + case ItemCursorChange: + return value; + case ItemCursorHasChanged: { + QEvent event(QEvent::CursorChange); + QApplication::sendEvent(this, &event); + return value; + } + default: + break; + } + + return QGraphicsWidget::itemChange(change, value); +} + +/*! \reimp +*/ +QSizeF QGraphicsWebView::sizeHint(Qt::SizeHint which, const QSizeF& constraint) const +{ + if (which == Qt::PreferredSize) + return QSizeF(800, 600); // ### + return QGraphicsWidget::sizeHint(which, constraint); +} + +/*! \reimp +*/ +QVariant QGraphicsWebView::inputMethodQuery(Qt::InputMethodQuery query) const +{ + if (d->page) + return d->page->inputMethodQuery(query); + return QVariant(); +} + +/*! \reimp +*/ +bool QGraphicsWebView::event(QEvent* event) +{ + // Re-implemented in order to allows fixing event-related bugs in patch releases. + + if (d->page) { +#ifndef QT_NO_CONTEXTMENU + if (event->type() == QEvent::GraphicsSceneContextMenu) { + if (!isEnabled()) + return false; + + QGraphicsSceneContextMenuEvent* ev = static_cast<QGraphicsSceneContextMenuEvent*>(event); + QContextMenuEvent fakeEvent(QContextMenuEvent::Reason(ev->reason()), ev->pos().toPoint()); + if (d->page->swallowContextMenuEvent(&fakeEvent)) { + event->accept(); + return true; + } + d->page->updatePositionDependentActions(fakeEvent.pos()); + } else +#endif // QT_NO_CONTEXTMENU + { +#ifndef QT_NO_CURSOR + if (event->type() == QEvent::CursorChange) { + // An unsetCursor will set the cursor to Qt::ArrowCursor. + // Thus this cursor change might be a QWidget::unsetCursor() + // If this is not the case and it came from WebCore, the + // QWebPageClient already has set its cursor internally + // to Qt::ArrowCursor, so updating the cursor is always + // right, as it falls back to the last cursor set by + // WebCore. + // FIXME: Add a QEvent::CursorUnset or similar to Qt. + if (cursor().shape() == Qt::ArrowCursor) + d->page->d->client->resetCursor(); + } +#endif + } + } + return QGraphicsWidget::event(event); +} + +void QGraphicsWebViewPrivate::detachCurrentPage() +{ + if (!page) + return; + + page->d->view.clear(); + page->d->client = 0; + + // if the page was created by us, we own it and need to + // destroy it as well. + + if (page->parent() == q) + delete page; + else + page->disconnect(q); + + page = 0; +} + +/*! + Makes \a page the new web page of the web graphicsitem. + + 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 QGraphicsWebView::setPage(QWebPage* page) +{ + if (d->page == page) + return; + + d->detachCurrentPage(); + d->page = page; + + if (!d->page) + return; + + d->page->d->client = new PageClientQGraphicsWidget(this, page); // set the page client + + if (d->overlay()) + d->overlay()->prepareGraphicsItemGeometryChange(); + + QSize size = geometry().size().toSize(); + page->setViewportSize(size); + + if (d->resizesToContents) + d->updateResizesToContentsForPage(); + + QWebFrame* mainFrame = d->page->mainFrame(); + + connect(mainFrame, SIGNAL(titleChanged(QString)), + this, SIGNAL(titleChanged(QString))); + connect(mainFrame, SIGNAL(iconChanged()), + this, SIGNAL(iconChanged())); + connect(mainFrame, SIGNAL(urlChanged(QUrl)), + this, SIGNAL(urlChanged(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, SLOT(_q_doLoadFinished(bool))); + connect(d->page, SIGNAL(statusBarMessage(QString)), + this, SIGNAL(statusBarMessage(QString))); + connect(d->page, SIGNAL(linkClicked(QUrl)), + this, SIGNAL(linkClicked(QUrl))); + connect(d->page, SIGNAL(destroyed()), + this, SLOT(_q_pageDestroyed())); +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + connect(d->page, SIGNAL(microFocusChanged()), + this, SLOT(_q_updateMicroFocus())); +#endif +} + +/*! + \property QGraphicsWebView::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 QGraphicsWebView::setUrl(const QUrl &url) +{ + page()->mainFrame()->setUrl(url); +} + +QUrl QGraphicsWebView::url() const +{ + if (d->page) + return d->page->mainFrame()->url(); + + return QUrl(); +} + +/*! + \property QGraphicsWebView::title + \brief the title of the web page currently viewed + + By default, this property contains an empty string. + + \sa titleChanged() +*/ +QString QGraphicsWebView::title() const +{ + if (d->page) + return d->page->mainFrame()->title(); + + return QString(); +} + +/*! + \property QGraphicsWebView::icon + \brief the icon associated with the web page currently viewed + + By default, this property contains a null icon. + + \sa iconChanged(), QWebSettings::iconForUrl() +*/ +QIcon QGraphicsWebView::icon() const +{ + if (d->page) + return d->page->mainFrame()->icon(); + + return QIcon(); +} + +/*! + \property QGraphicsWebView::zoomFactor + \brief the zoom factor for the view +*/ + +void QGraphicsWebView::setZoomFactor(qreal factor) +{ + if (factor == page()->mainFrame()->zoomFactor()) + return; + + page()->mainFrame()->setZoomFactor(factor); +} + +qreal QGraphicsWebView::zoomFactor() const +{ + return page()->mainFrame()->zoomFactor(); +} + +/*! \reimp +*/ +void QGraphicsWebView::updateGeometry() +{ + if (d->overlay()) + d->overlay()->prepareGraphicsItemGeometryChange(); + + QGraphicsWidget::updateGeometry(); + + if (!d->page) + return; + + QSize size = geometry().size().toSize(); + d->page->setViewportSize(size); +} + +/*! \reimp +*/ +void QGraphicsWebView::setGeometry(const QRectF& rect) +{ + QGraphicsWidget::setGeometry(rect); + + if (d->overlay()) + d->overlay()->prepareGraphicsItemGeometryChange(); + + if (!d->page) + return; + + // NOTE: call geometry() as setGeometry ensures that + // the geometry is within legal bounds (minimumSize, maximumSize) + QSize size = geometry().size().toSize(); + d->page->setViewportSize(size); +} + +/*! + Convenience slot that stops loading the document. + + \sa reload(), loadFinished() +*/ +void QGraphicsWebView::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. + + \sa forward() +*/ +void QGraphicsWebView::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. + + \sa back() +*/ +void QGraphicsWebView::forward() +{ + if (d->page) + d->page->triggerAction(QWebPage::Forward); +} + +/*! + Reloads the current document. + + \sa stop(), loadStarted() +*/ +void QGraphicsWebView::reload() +{ + if (d->page) + d->page->triggerAction(QWebPage::Reload); +} + +/*! + 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 QGraphicsWebView::load(const QUrl& url) +{ + page()->mainFrame()->load(url); +} + +/*! + \fn void QGraphicsWebView::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() +*/ + +void QGraphicsWebView::load(const QNetworkRequest& request, + QNetworkAccessManager::Operation operation, + const QByteArray& body) +{ + page()->mainFrame()->load(request, operation, body); +} + +/*! + 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. + + The \a html is loaded immediately; external objects are loaded asynchronously. + + 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. + + This is a convenience function equivalent to setContent(html, "text/html", baseUrl). + + \warning This function works only for HTML, for other mime types (i.e. XHTML, SVG) + setContent() should be used instead. + + \sa load(), setContent(), QWebFrame::toHtml(), QWebFrame::setContent() +*/ +void QGraphicsWebView::setHtml(const QString& html, const QUrl& baseUrl) +{ + page()->mainFrame()->setHtml(html, baseUrl); +} + +/*! + Sets the content of the web graphicsitem 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. + + The \a data is loaded immediately; external objects are loaded asynchronously. + + \sa load(), setHtml(), QWebFrame::toHtml() +*/ +void QGraphicsWebView::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 webkitsnippets/qtwebkit_qwebview_snippet.cpp 0 +*/ +QWebHistory* QGraphicsWebView::history() const +{ + return page()->history(); +} + +/*! + \property QGraphicsWebView::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 QGraphicsWebView::isModified() const +{ + if (d->page) + return d->page->isModified(); + return false; +} + +/*! + Returns a pointer to the view/page specific settings object. + + It is equivalent to + + \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 1 + + \sa QWebSettings::globalSettings() +*/ +QWebSettings* QGraphicsWebView::settings() const +{ + return page()->settings(); +} + +/*! + Returns a pointer to a QAction that encapsulates the specified web action \a action. +*/ +QAction *QGraphicsWebView::pageAction(QWebPage::WebAction action) const +{ +#ifdef QT_NO_ACTION + Q_UNUSED(action) + return 0; +#else + return page()->action(action); +#endif +} + +/*! + Triggers the specified \a action. If it is a checkable action the specified + \a checked state is assumed. + + \sa pageAction() +*/ +void QGraphicsWebView::triggerPageAction(QWebPage::WebAction action, bool checked) +{ + page()->triggerAction(action, checked); +} + +/*! + Finds the specified string, \a subString, in the page, using the given \a options. + + If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences + that exist in the page. All subsequent calls will extend the highlight, rather than + replace it, with occurrences of the new string. + + If the HighlightAllOccurrences flag is not passed, the function will select an occurrence + and all subsequent calls will replace the current occurrence with the next one. + + To clear the selection, just pass an empty string. + + Returns true if \a subString was found; otherwise returns false. + + \sa QWebPage::selectedText(), QWebPage::selectionChanged() +*/ +bool QGraphicsWebView::findText(const QString &subString, QWebPage::FindFlags options) +{ + if (d->page) + return d->page->findText(subString, options); + return false; +} + +/*! + \property QGraphicsWebView::resizesToContents + \brief whether the size of the QGraphicsWebView and its viewport changes to match the contents size + \since 4.7 + + If this property is set, the QGraphicsWebView will automatically change its + size to match the size of the main frame contents. As a result the top level frame + will never have scrollbars. It will also make CSS fixed positioning to behave like absolute positioning + with elements positioned relative to the document instead of the viewport. + + This property should be used in conjunction with the QWebPage::preferredContentsSize property. + If not explicitly set, the preferredContentsSize is automatically set to a reasonable value. + + \sa QWebPage::setPreferredContentsSize() +*/ +void QGraphicsWebView::setResizesToContents(bool enabled) +{ + if (d->resizesToContents == enabled) + return; + d->resizesToContents = enabled; + if (d->page) + d->updateResizesToContentsForPage(); +} + +bool QGraphicsWebView::resizesToContents() const +{ + return d->resizesToContents; +} + +/*! + \property QGraphicsWebView::tiledBackingStoreFrozen + \brief whether the tiled backing store updates its contents + \since 4.7 + + If the tiled backing store is enabled using QWebSettings::TiledBackingStoreEnabled attribute, this property + can be used to disable backing store updates temporarily. This can be useful for example for running + a smooth animation that changes the scale of the QGraphicsWebView. + + When the backing store is unfrozen, its contents will be automatically updated to match the current + state of the document. If the QGraphicsWebView scale was changed, the backing store is also + re-rendered using the new scale. + + If the tiled backing store is not enabled, this property does nothing. + + \sa QWebSettings::TiledBackingStoreEnabled + \sa QGraphicsObject::scale +*/ +bool QGraphicsWebView::isTiledBackingStoreFrozen() const +{ +#if ENABLE(TILED_BACKING_STORE) + WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore(); + if (!backingStore) + return false; + return backingStore->contentsFrozen(); +#else + return false; +#endif +} + +void QGraphicsWebView::setTiledBackingStoreFrozen(bool frozen) +{ +#if ENABLE(TILED_BACKING_STORE) + WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore(); + if (!backingStore) + return; + backingStore->setContentsFrozen(frozen); +#else + UNUSED_PARAM(frozen); +#endif +} + +/*! \reimp +*/ +void QGraphicsWebView::hoverMoveEvent(QGraphicsSceneHoverEvent* ev) +{ + if (d->page) { + const bool accepted = ev->isAccepted(); + QMouseEvent me = QMouseEvent(QEvent::MouseMove, + ev->pos().toPoint(), Qt::NoButton, + Qt::NoButton, Qt::NoModifier); + d->page->event(&me); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::hoverMoveEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::hoverLeaveEvent(QGraphicsSceneHoverEvent* ev) +{ + Q_UNUSED(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mouseMoveEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mousePressEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mouseReleaseEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mouseDoubleClickEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::keyPressEvent(QKeyEvent* ev) +{ + if (d->page) + d->page->event(ev); + + if (!ev->isAccepted()) + QGraphicsItem::keyPressEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::keyReleaseEvent(QKeyEvent* ev) +{ + if (d->page) + d->page->event(ev); + + if (!ev->isAccepted()) + QGraphicsItem::keyReleaseEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::focusInEvent(QFocusEvent* ev) +{ + if (d->page) + d->page->event(ev); + else + QGraphicsItem::focusInEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::focusOutEvent(QFocusEvent* ev) +{ + if (d->page) + d->page->event(ev); + else + QGraphicsItem::focusOutEvent(ev); +} + +/*! \reimp +*/ +bool QGraphicsWebView::focusNextPrevChild(bool next) +{ + if (d->page) + return d->page->focusNextPrevChild(next); + + return QGraphicsWidget::focusNextPrevChild(next); +} + +/*! \reimp +*/ +void QGraphicsWebView::dragEnterEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + if (d->page) + d->page->event(ev); +#else + Q_UNUSED(ev); +#endif +} + +/*! \reimp +*/ +void QGraphicsWebView::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsWidget::dragLeaveEvent(ev); +#else + Q_UNUSED(ev); +#endif +} + +/*! \reimp +*/ +void QGraphicsWebView::dragMoveEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsWidget::dragMoveEvent(ev); +#else + Q_UNUSED(ev); +#endif +} + +/*! \reimp +*/ +void QGraphicsWebView::dropEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsWidget::dropEvent(ev); +#else + Q_UNUSED(ev); +#endif +} + +#ifndef QT_NO_CONTEXTMENU +/*! \reimp +*/ +void QGraphicsWebView::contextMenuEvent(QGraphicsSceneContextMenuEvent* 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 QGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent* ev) +{ + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::wheelEvent(ev); +} +#endif // QT_NO_WHEELEVENT + +/*! \reimp +*/ +void QGraphicsWebView::inputMethodEvent(QInputMethodEvent* ev) +{ + if (d->page) + d->page->event(ev); + + if (!ev->isAccepted()) + QGraphicsItem::inputMethodEvent(ev); +} + +/*! + \fn void QGraphicsWebView::statusBarMessage(const QString& text) + + This signal is emitted when the statusbar \a text is changed by the page. +*/ + +/*! + \fn void QGraphicsWebView::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 QGraphicsWebView::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() +*/ + +#endif // QT_NO_GRAPHICSVIEW + +#include "moc_qgraphicswebview.cpp" diff --git a/Source/WebKit/qt/Api/qgraphicswebview.h b/Source/WebKit/qt/Api/qgraphicswebview.h new file mode 100644 index 0000000..e08e895 --- /dev/null +++ b/Source/WebKit/qt/Api/qgraphicswebview.h @@ -0,0 +1,163 @@ +/* + 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. +*/ + +#ifndef QGraphicsWebView_h +#define QGraphicsWebView_h + +#include "qwebkitglobal.h" +#include "qwebpage.h" +#include <QtCore/qurl.h> +#include <QtGui/qevent.h> +#include <QtGui/qgraphicswidget.h> +#include <QtGui/qicon.h> +#include <QtGui/qpainter.h> +#include <QtNetwork/qnetworkaccessmanager.h> + +#if !defined(QT_NO_GRAPHICSVIEW) + +class QWebPage; +class QWebHistory; +class QWebSettings; + +class QGraphicsWebViewPrivate; + +class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget { + Q_OBJECT + + Q_PROPERTY(QString title READ title NOTIFY titleChanged) + Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) + Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) + + Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) + + Q_PROPERTY(bool modified READ isModified) + Q_PROPERTY(bool resizesToContents READ resizesToContents WRITE setResizesToContents) + Q_PROPERTY(bool tiledBackingStoreFrozen READ isTiledBackingStoreFrozen WRITE setTiledBackingStoreFrozen) + +public: + explicit QGraphicsWebView(QGraphicsItem* parent = 0); + ~QGraphicsWebView(); + + QWebPage* page() const; + void setPage(QWebPage*); + + QUrl url() const; + void setUrl(const QUrl&); + + QString title() const; + QIcon icon() const; + + qreal zoomFactor() const; + void setZoomFactor(qreal); + + bool isModified() const; + + void load(const QUrl& url); + void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray()); + + void setHtml(const QString& html, const QUrl& baseUrl = QUrl()); + // FIXME: Consider rename to setHtml? + void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl()); + + QWebHistory* history() const; + QWebSettings* settings() const; + + QAction* pageAction(QWebPage::WebAction action) const; + void triggerPageAction(QWebPage::WebAction action, bool checked = false); + + bool findText(const QString& subString, QWebPage::FindFlags options = 0); + + bool resizesToContents() const; + void setResizesToContents(bool enabled); + + bool isTiledBackingStoreFrozen() const; + void setTiledBackingStoreFrozen(bool frozen); + + virtual void setGeometry(const QRectF& rect); + virtual void updateGeometry(); + virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0); + virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value); + virtual bool event(QEvent*); + + virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF& constraint) const; + + virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + +public Q_SLOTS: + void stop(); + void back(); + void forward(); + void reload(); + +Q_SIGNALS: + void loadStarted(); + void loadFinished(bool); + + void loadProgress(int progress); + void urlChanged(const QUrl&); + void titleChanged(const QString&); + void iconChanged(); + void statusBarMessage(const QString& message); + void linkClicked(const QUrl&); + +protected: + virtual void mousePressEvent(QGraphicsSceneMouseEvent*); + virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*); + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*); + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*); + virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*); + virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*); +#ifndef QT_NO_WHEELEVENT + virtual void wheelEvent(QGraphicsSceneWheelEvent*); +#endif + virtual void keyPressEvent(QKeyEvent*); + virtual void keyReleaseEvent(QKeyEvent*); +#ifndef QT_NO_CONTEXTMENU + virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent*); +#endif + virtual void dragEnterEvent(QGraphicsSceneDragDropEvent*); + virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent*); + virtual void dragMoveEvent(QGraphicsSceneDragDropEvent*); + virtual void dropEvent(QGraphicsSceneDragDropEvent*); + virtual void focusInEvent(QFocusEvent*); + virtual void focusOutEvent(QFocusEvent*); + virtual void inputMethodEvent(QInputMethodEvent*); + virtual bool focusNextPrevChild(bool next); + + virtual bool sceneEvent(QEvent*); + +private: + Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success)) +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + Q_PRIVATE_SLOT(d, void _q_updateMicroFocus()) +#endif + Q_PRIVATE_SLOT(d, void _q_pageDestroyed()) + // we don't want to change the moc based on USE() macro, so this function is here + // but will be empty if ACCLERATED_COMPOSITING is disabled + Q_PRIVATE_SLOT(d, void syncLayers()) + Q_PRIVATE_SLOT(d, void _q_contentsSizeChanged(const QSize&)) + Q_PRIVATE_SLOT(d, void _q_scaleChanged()) + + QGraphicsWebViewPrivate* const d; + friend class QGraphicsWebViewPrivate; +}; + +#endif // QT_NO_GRAPHICSVIEW + +#endif // QGraphicsWebView_h diff --git a/Source/WebKit/qt/Api/qwebdatabase.cpp b/Source/WebKit/qt/Api/qwebdatabase.cpp new file mode 100644 index 0000000..ba039c7 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebdatabase.cpp @@ -0,0 +1,198 @@ +/* + 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. + + \inmodule QtWebKit + + 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. + + Databases are grouped together in security origins. To get access to all databases defined by + a security origin, use QWebSecurityOrigin::databases(). Each database has an internal name(), + as well as a user-friendly name, provided by displayName(). These names are specified when + creating the database in the JavaScript code. + + WebKit uses SQLite to create and access the local SQL databases. The location of the database + file in the local file system is returned by fileName(). You can access the database directly + through the QtSql database module. + + For each database the web site can define an expectedSize(). The current size of the database + in bytes is returned by size(). + + For more information refer to the \l{http://dev.w3.org/html5/webdatabase/}{HTML5 Web SQL Database 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 in a format that is suitable for display to the user. +*/ +QString QWebDatabase::displayName() const +{ +#if ENABLE(DATABASE) + DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get()); + return details.displayName(); +#else + return QString(); +#endif +} + +/*! + Returns the expected size of the database in bytes as defined by the web author. +*/ +qint64 QWebDatabase::expectedSize() const +{ +#if ENABLE(DATABASE) + DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get()); + return details.expectedUsage(); +#else + return 0; +#endif +} + +/*! + Returns the current size of the database in bytes. +*/ +qint64 QWebDatabase::size() const +{ +#if ENABLE(DATABASE) + DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get()); + return details.currentUsage(); +#else + return 0; +#endif +} + +/*! + \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 +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().fullPathForDatabase(d->origin.get(), d->name, false); +#else + return QString(); +#endif +} + +/*! + 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 the + database \a db will be destroyed. +*/ +void QWebDatabase::removeDatabase(const QWebDatabase& db) +{ +#if ENABLE(DATABASE) + DatabaseTracker::tracker().deleteDatabase(db.d->origin.get(), db.d->name); +#endif +} + +/*! + \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/Source/WebKit/qt/Api/qwebdatabase.h b/Source/WebKit/qt/Api/qwebdatabase.h new file mode 100644 index 0000000..875b2eb --- /dev/null +++ b/Source/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&); + static void removeAllDatabases(); + +private: + QWebDatabase(QWebDatabasePrivate* priv); + friend class QWebSecurityOrigin; + +private: + QExplicitlySharedDataPointer<QWebDatabasePrivate> d; +}; + +#endif + diff --git a/Source/WebKit/qt/Api/qwebdatabase_p.h b/Source/WebKit/qt/Api/qwebdatabase_p.h new file mode 100644 index 0000000..ec03ea5 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebdatabase_p.h @@ -0,0 +1,37 @@ +/* + 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: + WTF::String name; + WTF::RefPtr<WebCore::SecurityOrigin> origin; +}; + +#endif + diff --git a/Source/WebKit/qt/Api/qwebelement.cpp b/Source/WebKit/qt/Api/qwebelement.cpp new file mode 100644 index 0000000..60ae3a0 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebelement.cpp @@ -0,0 +1,2077 @@ +/* + 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. +*/ + +#include "config.h" +#include "qwebelement.h" + +#include "CSSComputedStyleDeclaration.h" +#include "CSSMutableStyleDeclaration.h" +#include "CSSParser.h" +#include "CSSRule.h" +#include "CSSRuleList.h" +#include "CSSStyleRule.h" +#include "CSSStyleSelector.h" +#include "Document.h" +#include "DocumentFragment.h" +#include "FrameView.h" +#include "GraphicsContext.h" +#include "HTMLElement.h" +#if USE(JSC) +#include "JSGlobalObject.h" +#include "JSHTMLElement.h" +#include "JSObject.h" +#include "PropertyNameArray.h" +#include <parser/SourceCode.h> +#include "qt_runtime.h" +#elif USE(V8) +#include "V8DOMWindow.h" +#include "V8Binding.h" +#include "NotImplemented.h" +#endif +#include "NodeList.h" +#include "RenderImage.h" +#include "StaticNodeList.h" +#include "qwebframe.h" +#include "qwebframe_p.h" +#include "runtime_root.h" +#include <wtf/Vector.h> +#include <wtf/text/CString.h> + +#include <QPainter> + +#if USE(V8) +using namespace V8::Bindings; +#endif + +using namespace WebCore; + +class QWebElementPrivate { +public: +}; + +/*! + \class QWebElement + \since 4.6 + \brief The QWebElement class provides convenient access to DOM elements in + a QWebFrame. + \inmodule QtWebKit + + A QWebElement object allows easy access to the document model, represented + by a tree-like structure of DOM elements. The root of the tree is called + the document element and can be accessed using + QWebFrame::documentElement(). + + Specific elements can be accessed using findAll() and findFirst(). These + elements are identified using CSS selectors. The code snippet below + demonstrates the use of findAll(). + + \snippet webkitsnippets/webelement/main.cpp FindAll + + The first list contains all \c span elements in the document. The second + list contains \c span elements that are children of \c p, classified with + \c intro. + + Using findFirst() is more efficient than calling findAll(), and extracting + the first element only in the list returned. + + Alternatively you can traverse the document manually using firstChild() and + nextSibling(): + + \snippet webkitsnippets/webelement/main.cpp Traversing with QWebElement + + Individual elements can be inspected or changed using methods such as attribute() + or setAttribute(). For examle, to capture the user's input in a text field for later + use (auto-completion), a browser could do something like this: + + \snippet webkitsnippets/webelement/main.cpp autocomplete1 + + When the same page is later revisited, the browser can fill in the text field automatically + by modifying the value attribute of the input element: + + \snippet webkitsnippets/webelement/main.cpp autocomplete2 + + Another use case is to emulate a click event on an element. The following + code snippet demonstrates how to call the JavaScript DOM method click() of + a submit button: + + \snippet webkitsnippets/webelement/main.cpp Calling a DOM element method + + The underlying content of QWebElement is explicitly shared. Creating a copy + of a QWebElement does not create a copy of the content. Instead, both + instances point to the same element. + + The contents of child elements can be converted to plain text with + toPlainText(); to XHTML using toInnerXml(). To include the element's tag in + the output, use toOuterXml(). + + It is possible to replace the contents of child elements using + setPlainText() and setInnerXml(). To replace the element itself and its + contents, use setOuterXml(). + + \section1 Examples + + The \l{DOM Traversal Example} shows one way to traverse documents in a running + example. + + The \l{Simple Selector Example} can be used to experiment with the searching + features of this class and provides sample code you can start working with. +*/ + +/*! + Constructs a null web element. +*/ +QWebElement::QWebElement() + : d(0) + , m_element(0) +{ +} + +/*! + \internal +*/ +QWebElement::QWebElement(WebCore::Element* domElement) + : d(0) + , m_element(domElement) +{ + if (m_element) + m_element->ref(); +} + +/*! + \internal +*/ +QWebElement::QWebElement(WebCore::Node* node) + : d(0) + , m_element(0) +{ + if (node && node->isHTMLElement()) { + m_element = static_cast<HTMLElement*>(node); + m_element->ref(); + } +} + +/*! + Constructs a copy of \a other. +*/ +QWebElement::QWebElement(const QWebElement &other) + : d(0) + , m_element(other.m_element) +{ + if (m_element) + m_element->ref(); +} + +/*! + Assigns \a other to this element and returns a reference to this element. +*/ +QWebElement &QWebElement::operator=(const QWebElement &other) +{ + // ### handle "d" assignment + if (this != &other) { + Element *otherElement = other.m_element; + if (otherElement) + otherElement->ref(); + if (m_element) + m_element->deref(); + m_element = otherElement; + } + return *this; +} + +/*! + Destroys the element. However, the underlying DOM element is not destroyed. +*/ +QWebElement::~QWebElement() +{ + delete d; + if (m_element) + m_element->deref(); +} + +bool QWebElement::operator==(const QWebElement& o) const +{ + return m_element == o.m_element; +} + +bool QWebElement::operator!=(const QWebElement& o) const +{ + return m_element != o.m_element; +} + +/*! + Returns true if the element is a null element; otherwise returns false. +*/ +bool QWebElement::isNull() const +{ + return !m_element; +} + +/*! + Returns a new list of child elements matching the given CSS selector + \a selectorQuery. If there are no matching elements, an empty list is + returned. + + \l{Standard CSS2 selector} syntax is used for the query. + + \note This search is performed recursively. + + \sa findFirst() +*/ +QWebElementCollection QWebElement::findAll(const QString &selectorQuery) const +{ + return QWebElementCollection(*this, selectorQuery); +} + +/*! + Returns the first child element that matches the given CSS selector + \a selectorQuery. + + \l{Standard CSS2 selector} syntax is used for the query. + + \note This search is performed recursively. + + \sa findAll() +*/ +QWebElement QWebElement::findFirst(const QString &selectorQuery) const +{ + if (!m_element) + return QWebElement(); + ExceptionCode exception = 0; // ### + return QWebElement(m_element->querySelector(selectorQuery, exception).get()); +} + +/*! + Replaces the existing content of this element with \a text. + + This is equivalent to setting the HTML innerText property. + + \sa toPlainText() +*/ +void QWebElement::setPlainText(const QString &text) +{ + if (!m_element || !m_element->isHTMLElement()) + return; + ExceptionCode exception = 0; + static_cast<HTMLElement*>(m_element)->setInnerText(text, exception); +} + +/*! + Returns the text between the start and the end tag of this + element. + + This is equivalent to reading the HTML innerText property. + + \sa setPlainText() +*/ +QString QWebElement::toPlainText() const +{ + if (!m_element || !m_element->isHTMLElement()) + return QString(); + return static_cast<HTMLElement*>(m_element)->innerText(); +} + +/*! + Replaces the contents of this element as well as its own tag with + \a markup. The string may contain HTML or XML tags, which is parsed and + formatted before insertion into the document. + + \note This is currently only implemented for (X)HTML elements. + + \sa toOuterXml(), toInnerXml(), setInnerXml() +*/ +void QWebElement::setOuterXml(const QString &markup) +{ + if (!m_element || !m_element->isHTMLElement()) + return; + + ExceptionCode exception = 0; + + static_cast<HTMLElement*>(m_element)->setOuterHTML(markup, exception); +} + +/*! + Returns this element converted to XML, including the start and the end + tags as well as its attributes. + + \note This is currently implemented for (X)HTML elements only. + + \note The format of the markup returned will obey the namespace of the + document containing the element. This means the return value will obey XML + formatting rules, such as self-closing tags, only if the document is + 'text/xhtml+xml'. + + \sa setOuterXml(), setInnerXml(), toInnerXml() +*/ +QString QWebElement::toOuterXml() const +{ + if (!m_element || !m_element->isHTMLElement()) + return QString(); + + return static_cast<HTMLElement*>(m_element)->outerHTML(); +} + +/*! + Replaces the contents of this element with \a markup. The string may + contain HTML or XML tags, which is parsed and formatted before insertion + into the document. + + \note This is currently implemented for (X)HTML elements only. + + \sa toInnerXml(), toOuterXml(), setOuterXml() +*/ +void QWebElement::setInnerXml(const QString &markup) +{ + if (!m_element || !m_element->isHTMLElement()) + return; + + ExceptionCode exception = 0; + + static_cast<HTMLElement*>(m_element)->setInnerHTML(markup, exception); +} + +/*! + Returns the XML content between the element's start and end tags. + + \note This is currently implemented for (X)HTML elements only. + + \note The format of the markup returned will obey the namespace of the + document containing the element. This means the return value will obey XML + formatting rules, such as self-closing tags, only if the document is + 'text/xhtml+xml'. + + \sa setInnerXml(), setOuterXml(), toOuterXml() +*/ +QString QWebElement::toInnerXml() const +{ + if (!m_element || !m_element->isHTMLElement()) + return QString(); + + return static_cast<HTMLElement*>(m_element)->innerHTML(); +} + +/*! + Adds an attribute with the given \a name and \a value. If an attribute with + the same name exists, its value is replaced by \a value. + + \sa attribute(), attributeNS(), setAttributeNS() +*/ +void QWebElement::setAttribute(const QString &name, const QString &value) +{ + if (!m_element) + return; + ExceptionCode exception = 0; + m_element->setAttribute(name, value, exception); +} + +/*! + Adds an attribute with the given \a name in \a namespaceUri with \a value. + If an attribute with the same name exists, its value is replaced by + \a value. + + \sa attributeNS(), attribute(), setAttribute() +*/ +void QWebElement::setAttributeNS(const QString &namespaceUri, const QString &name, const QString &value) +{ + if (!m_element) + return; + WebCore::ExceptionCode exception = 0; + m_element->setAttributeNS(namespaceUri, name, value, exception); +} + +/*! + Returns the attribute with the given \a name. If the attribute does not + exist, \a defaultValue is returned. + + \sa setAttribute(), setAttributeNS(), attributeNS() +*/ +QString QWebElement::attribute(const QString &name, const QString &defaultValue) const +{ + if (!m_element) + return QString(); + if (m_element->hasAttribute(name)) + return m_element->getAttribute(name); + else + return defaultValue; +} + +/*! + Returns the attribute with the given \a name in \a namespaceUri. If the + attribute does not exist, \a defaultValue is returned. + + \sa setAttributeNS(), setAttribute(), attribute() +*/ +QString QWebElement::attributeNS(const QString &namespaceUri, const QString &name, const QString &defaultValue) const +{ + if (!m_element) + return QString(); + if (m_element->hasAttributeNS(namespaceUri, name)) + return m_element->getAttributeNS(namespaceUri, name); + else + return defaultValue; +} + +/*! + Returns true if this element has an attribute with the given \a name; + otherwise returns false. + + \sa attribute(), setAttribute() +*/ +bool QWebElement::hasAttribute(const QString &name) const +{ + if (!m_element) + return false; + return m_element->hasAttribute(name); +} + +/*! + Returns true if this element has an attribute with the given \a name, in + \a namespaceUri; otherwise returns false. + + \sa attributeNS(), setAttributeNS() +*/ +bool QWebElement::hasAttributeNS(const QString &namespaceUri, const QString &name) const +{ + if (!m_element) + return false; + return m_element->hasAttributeNS(namespaceUri, name); +} + +/*! + Removes the attribute with the given \a name from this element. + + \sa attribute(), setAttribute(), hasAttribute() +*/ +void QWebElement::removeAttribute(const QString &name) +{ + if (!m_element) + return; + ExceptionCode exception = 0; + m_element->removeAttribute(name, exception); +} + +/*! + Removes the attribute with the given \a name, in \a namespaceUri, from this + element. + + \sa attributeNS(), setAttributeNS(), hasAttributeNS() +*/ +void QWebElement::removeAttributeNS(const QString &namespaceUri, const QString &name) +{ + if (!m_element) + return; + WebCore::ExceptionCode exception = 0; + m_element->removeAttributeNS(namespaceUri, name, exception); +} + +/*! + Returns true if the element has any attributes defined; otherwise returns + false; + + \sa attribute(), setAttribute() +*/ +bool QWebElement::hasAttributes() const +{ + if (!m_element) + return false; + return m_element->hasAttributes(); +} + +/*! + Return the list of attributes for the namespace given as \a namespaceUri. + + \sa attribute(), setAttribute() +*/ +QStringList QWebElement::attributeNames(const QString& namespaceUri) const +{ + if (!m_element) + return QStringList(); + + QStringList attributeNameList; + const NamedNodeMap* const attrs = m_element->attributes(/* read only = */ true); + if (attrs) { + const String namespaceUriString(namespaceUri); // convert QString -> String once + const unsigned attrsCount = attrs->length(); + for (unsigned i = 0; i < attrsCount; ++i) { + const Attribute* const attribute = attrs->attributeItem(i); + if (namespaceUriString == attribute->namespaceURI()) + attributeNameList.append(attribute->localName()); + } + } + return attributeNameList; +} + +/*! + Returns true if the element has keyboard input focus; otherwise, returns false + + \sa setFocus() +*/ +bool QWebElement::hasFocus() const +{ + if (!m_element) + return false; + if (m_element->document()) + return m_element == m_element->document()->focusedNode(); + return false; +} + +/*! + Gives keyboard input focus to this element + + \sa hasFocus() +*/ +void QWebElement::setFocus() +{ + if (!m_element) + return; + if (m_element->document() && m_element->isFocusable()) + m_element->document()->setFocusedNode(m_element); +} + +/*! + Returns the geometry of this element, relative to its containing frame. + + \sa tagName() +*/ +QRect QWebElement::geometry() const +{ + if (!m_element) + return QRect(); + return m_element->getRect(); +} + +/*! + Returns the tag name of this element. + + \sa geometry() +*/ +QString QWebElement::tagName() const +{ + if (!m_element) + return QString(); + return m_element->tagName(); +} + +/*! + Returns the namespace prefix of the element. If the element has no\ + namespace prefix, empty string is returned. +*/ +QString QWebElement::prefix() const +{ + if (!m_element) + return QString(); + return m_element->prefix(); +} + +/*! + Returns the local name of the element. If the element does not use + namespaces, an empty string is returned. +*/ +QString QWebElement::localName() const +{ + if (!m_element) + return QString(); + return m_element->localName(); +} + +/*! + Returns the namespace URI of this element. If the element has no namespace + URI, an empty string is returned. +*/ +QString QWebElement::namespaceUri() const +{ + if (!m_element) + return QString(); + return m_element->namespaceURI(); +} + +/*! + Returns the parent element of this elemen. If this element is the root + document element, a null element is returned. +*/ +QWebElement QWebElement::parent() const +{ + if (m_element) + return QWebElement(m_element->parentElement()); + return QWebElement(); +} + +/*! + Returns the element's first child. + + \sa lastChild(), previousSibling(), nextSibling() +*/ +QWebElement QWebElement::firstChild() const +{ + if (!m_element) + return QWebElement(); + for (Node* child = m_element->firstChild(); child; child = child->nextSibling()) { + if (!child->isElementNode()) + continue; + Element* e = static_cast<Element*>(child); + return QWebElement(e); + } + return QWebElement(); +} + +/*! + Returns the element's last child. + + \sa firstChild(), previousSibling(), nextSibling() +*/ +QWebElement QWebElement::lastChild() const +{ + if (!m_element) + return QWebElement(); + for (Node* child = m_element->lastChild(); child; child = child->previousSibling()) { + if (!child->isElementNode()) + continue; + Element* e = static_cast<Element*>(child); + return QWebElement(e); + } + return QWebElement(); +} + +/*! + Returns the element's next sibling. + + \sa firstChild(), previousSibling(), lastChild() +*/ +QWebElement QWebElement::nextSibling() const +{ + if (!m_element) + return QWebElement(); + for (Node* sib = m_element->nextSibling(); sib; sib = sib->nextSibling()) { + if (!sib->isElementNode()) + continue; + Element* e = static_cast<Element*>(sib); + return QWebElement(e); + } + return QWebElement(); +} + +/*! + Returns the element's previous sibling. + + \sa firstChild(), nextSibling(), lastChild() +*/ +QWebElement QWebElement::previousSibling() const +{ + if (!m_element) + return QWebElement(); + for (Node* sib = m_element->previousSibling(); sib; sib = sib->previousSibling()) { + if (!sib->isElementNode()) + continue; + Element* e = static_cast<Element*>(sib); + return QWebElement(e); + } + return QWebElement(); +} + +/*! + Returns the document which this element belongs to. +*/ +QWebElement QWebElement::document() const +{ + if (!m_element) + return QWebElement(); + Document* document = m_element->document(); + if (!document) + return QWebElement(); + return QWebElement(document->documentElement()); +} + +/*! + Returns the web frame which this element is a part of. If the element is a + null element, null is returned. +*/ +QWebFrame *QWebElement::webFrame() const +{ + if (!m_element) + return 0; + + Document* document = m_element->document(); + if (!document) + return 0; + + Frame* frame = document->frame(); + if (!frame) + return 0; + return QWebFramePrivate::kit(frame); +} + +#if USE(JSC) +static bool setupScriptContext(WebCore::Element* element, JSC::JSValue& thisValue, ScriptState*& state, ScriptController*& scriptController) +{ + if (!element) + return false; + + Document* document = element->document(); + if (!document) + return false; + + Frame* frame = document->frame(); + if (!frame) + return false; + + scriptController = frame->script(); + if (!scriptController) + return false; + + state = scriptController->globalObject(mainThreadNormalWorld())->globalExec(); + if (!state) + return false; + + thisValue = toJS(state, element); + if (!thisValue) + return false; + + return true; +} +#elif USE(V8) +static bool setupScriptContext(WebCore::Element* element, v8::Handle<v8::Value>& thisValue, ScriptState*& state, ScriptController*& scriptController) +{ + if (!element) + return false; + + Document* document = element->document(); + if (!document) + return false; + + Frame* frame = document->frame(); + if (!frame) + return false; + + state = mainWorldScriptState(frame); + // Get V8 wrapper for DOM element + thisValue = toV8(frame->domWindow()); + return true; +} +#endif + + +/*! + Executes \a scriptSource with this element as \c this object. +*/ +QVariant QWebElement::evaluateJavaScript(const QString& scriptSource) +{ + if (scriptSource.isEmpty()) + return QVariant(); + + ScriptState* state = 0; +#if USE(JSC) + JSC::JSValue thisValue; +#elif USE(V8) + v8::Handle<v8::Value> thisValue; +#endif + ScriptController* scriptController = 0; + + if (!setupScriptContext(m_element, thisValue, state, scriptController)) + return QVariant(); +#if USE(JSC) + JSC::ScopeChain& scopeChain = state->dynamicGlobalObject()->globalScopeChain(); + JSC::UString script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length()); + JSC::Completion completion = JSC::evaluate(state, scopeChain, JSC::makeSource(script), thisValue); + if ((completion.complType() != JSC::ReturnValue) && (completion.complType() != JSC::Normal)) + return QVariant(); + + JSC::JSValue result = completion.value(); + if (!result) + return QVariant(); + + int distance = 0; + return JSC::Bindings::convertValueToQVariant(state, result, QMetaType::Void, &distance); +#elif USE(V8) + notImplemented(); + return QVariant(); +#endif +} + +/*! + \enum QWebElement::StyleResolveStrategy + + This enum describes how QWebElement's styleProperty resolves the given + property name. + + \value InlineStyle Return the property value as it is defined in + the element, without respecting style inheritance and other CSS + rules. + \value CascadedStyle The property's value is determined using the + inheritance and importance rules defined in the document's + stylesheet. + \value ComputedStyle The property's value is the absolute value + of the style property resolved from the environment. +*/ + +/*! + Returns the value of the style with the given \a name using the specified + \a strategy. If a style with \a name does not exist, an empty string is + returned. + + In CSS, the cascading part depends on which CSS rule has priority and is + thus applied. Generally, the last defined rule has priority. Thus, an + inline style rule has priority over an embedded block style rule, which + in return has priority over an external style rule. + + If the "!important" declaration is set on one of those, the declaration + receives highest priority, unless other declarations also use the + "!important" declaration. Then, the last "!important" declaration takes + predecence. + + \sa setStyleProperty() +*/ + +QString QWebElement::styleProperty(const QString &name, StyleResolveStrategy strategy) const +{ + if (!m_element || !m_element->isStyledElement()) + return QString(); + + int propID = cssPropertyID(name); + + if (!propID) + return QString(); + + CSSStyleDeclaration* style = static_cast<StyledElement*>(m_element)->style(); + + if (strategy == InlineStyle) + return style->getPropertyValue(propID); + + if (strategy == CascadedStyle) { + if (style->getPropertyPriority(propID)) + return style->getPropertyValue(propID); + + // We are going to resolve the style property by walking through the + // list of non-inline matched CSS rules for the element, looking for + // the highest priority definition. + + // Get an array of matched CSS rules for the given element sorted + // by importance and inheritance order. This include external CSS + // declarations, as well as embedded and inline style declarations. + + Document* doc = m_element->document(); + if (RefPtr<CSSRuleList> rules = doc->styleSelector()->styleRulesForElement(m_element, /*authorOnly*/ true)) { + for (int i = rules->length(); i > 0; --i) { + CSSStyleRule* rule = static_cast<CSSStyleRule*>(rules->item(i - 1)); + + if (rule->style()->getPropertyPriority(propID)) + return rule->style()->getPropertyValue(propID); + + if (style->getPropertyValue(propID).isEmpty()) + style = rule->style(); + } + } + + return style->getPropertyValue(propID); + } + + if (strategy == ComputedStyle) { + if (!m_element || !m_element->isStyledElement()) + return QString(); + + int propID = cssPropertyID(name); + + RefPtr<CSSComputedStyleDeclaration> style = computedStyle(m_element, true); + if (!propID || !style) + return QString(); + + return style->getPropertyValue(propID); + } + + return QString(); +} + +/*! + Sets the value of the inline style with the given \a name to \a value. + + Setting a value, does not necessarily mean that it will become the applied + value, due to the fact that the style property's value might have been set + earlier with a higher priority in external or embedded style declarations. + + In order to ensure that the value will be applied, you may have to append + "!important" to the value. +*/ +void QWebElement::setStyleProperty(const QString &name, const QString &value) +{ + if (!m_element || !m_element->isStyledElement()) + return; + + int propID = cssPropertyID(name); + CSSStyleDeclaration* style = static_cast<StyledElement*>(m_element)->style(); + if (!propID || !style) + return; + + ExceptionCode exception = 0; + style->setProperty(name, value, exception); +} + +/*! + Returns the list of classes of this element. +*/ +QStringList QWebElement::classes() const +{ + if (!hasAttribute(QLatin1String("class"))) + return QStringList(); + + QStringList classes = attribute(QLatin1String("class")).simplified().split(QLatin1Char(' '), QString::SkipEmptyParts); + classes.removeDuplicates(); + return classes; +} + +/*! + Returns true if this element has a class with the given \a name; otherwise + returns false. +*/ +bool QWebElement::hasClass(const QString &name) const +{ + QStringList list = classes(); + return list.contains(name); +} + +/*! + Adds the specified class with the given \a name to the element. +*/ +void QWebElement::addClass(const QString &name) +{ + QStringList list = classes(); + if (!list.contains(name)) { + list.append(name); + QString value = list.join(QLatin1String(" ")); + setAttribute(QLatin1String("class"), value); + } +} + +/*! + Removes the specified class with the given \a name from the element. +*/ +void QWebElement::removeClass(const QString &name) +{ + QStringList list = classes(); + if (list.contains(name)) { + list.removeAll(name); + QString value = list.join(QLatin1String(" ")); + setAttribute(QLatin1String("class"), value); + } +} + +/*! + Adds the specified class with the given \a name if it is not present. If + the class is already present, it will be removed. +*/ +void QWebElement::toggleClass(const QString &name) +{ + QStringList list = classes(); + if (list.contains(name)) + list.removeAll(name); + else + list.append(name); + + QString value = list.join(QLatin1String(" ")); + setAttribute(QLatin1String("class"), value); +} + +/*! + Appends the given \a element as the element's last child. + + If \a element is the child of another element, it is re-parented to this + element. If \a element is a child of this element, then its position in + the list of children is changed. + + Calling this function on a null element does nothing. + + \sa prependInside(), prependOutside(), appendOutside() +*/ +void QWebElement::appendInside(const QWebElement &element) +{ + if (!m_element || element.isNull()) + return; + + ExceptionCode exception = 0; + m_element->appendChild(element.m_element, exception); +} + +/*! + Appends the result of parsing \a markup as the element's last child. + + Calling this function on a null element does nothing. + + \sa prependInside(), prependOutside(), appendOutside() +*/ +void QWebElement::appendInside(const QString &markup) +{ + if (!m_element) + return; + + if (!m_element->isHTMLElement()) + return; + + HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); + RefPtr<DocumentFragment> fragment = htmlElement->Element::deprecatedCreateContextualFragment(markup); + + ExceptionCode exception = 0; + m_element->appendChild(fragment, exception); +} + +/*! + Prepends \a element as the element's first child. + + If \a element is the child of another element, it is re-parented to this + element. If \a element is a child of this element, then its position in + the list of children is changed. + + Calling this function on a null element does nothing. + + \sa appendInside(), prependOutside(), appendOutside() +*/ +void QWebElement::prependInside(const QWebElement &element) +{ + if (!m_element || element.isNull()) + return; + + ExceptionCode exception = 0; + + if (m_element->hasChildNodes()) + m_element->insertBefore(element.m_element, m_element->firstChild(), exception); + else + m_element->appendChild(element.m_element, exception); +} + +/*! + Prepends the result of parsing \a markup as the element's first child. + + Calling this function on a null element does nothing. + + \sa appendInside(), prependOutside(), appendOutside() +*/ +void QWebElement::prependInside(const QString &markup) +{ + if (!m_element) + return; + + if (!m_element->isHTMLElement()) + return; + + HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); + + ExceptionCode exception = 0; + + if (m_element->hasChildNodes()) + m_element->insertBefore(fragment, m_element->firstChild(), exception); + else + m_element->appendChild(fragment, exception); +} + + +/*! + Inserts the given \a element before this element. + + If \a element is the child of another element, it is re-parented to the + parent of this element. + + Calling this function on a null element does nothing. + + \sa appendInside(), prependInside(), appendOutside() +*/ +void QWebElement::prependOutside(const QWebElement &element) +{ + if (!m_element || element.isNull()) + return; + + if (!m_element->parentNode()) + return; + + ExceptionCode exception = 0; + m_element->parentNode()->insertBefore(element.m_element, m_element, exception); +} + +/*! + Inserts the result of parsing \a markup before this element. + + Calling this function on a null element does nothing. + + \sa appendInside(), prependInside(), appendOutside() +*/ +void QWebElement::prependOutside(const QString &markup) +{ + if (!m_element) + return; + + if (!m_element->parentNode()) + return; + + if (!m_element->isHTMLElement()) + return; + + HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); + + ExceptionCode exception = 0; + m_element->parentNode()->insertBefore(fragment, m_element, exception); +} + +/*! + Inserts the given \a element after this element. + + If \a element is the child of another element, it is re-parented to the + parent of this element. + + Calling this function on a null element does nothing. + + \sa appendInside(), prependInside(), prependOutside() +*/ +void QWebElement::appendOutside(const QWebElement &element) +{ + if (!m_element || element.isNull()) + return; + + if (!m_element->parentNode()) + return; + + ExceptionCode exception = 0; + if (!m_element->nextSibling()) + m_element->parentNode()->appendChild(element.m_element, exception); + else + m_element->parentNode()->insertBefore(element.m_element, m_element->nextSibling(), exception); +} + +/*! + Inserts the result of parsing \a markup after this element. + + Calling this function on a null element does nothing. + + \sa appendInside(), prependInside(), prependOutside() +*/ +void QWebElement::appendOutside(const QString &markup) +{ + if (!m_element) + return; + + if (!m_element->parentNode()) + return; + + if (!m_element->isHTMLElement()) + return; + + HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); + + ExceptionCode exception = 0; + if (!m_element->nextSibling()) + m_element->parentNode()->appendChild(fragment, exception); + else + m_element->parentNode()->insertBefore(fragment, m_element->nextSibling(), exception); +} + +/*! + Returns a clone of this element. + + The clone may be inserted at any point in the document. + + \sa appendInside(), prependInside(), prependOutside(), appendOutside() +*/ +QWebElement QWebElement::clone() const +{ + if (!m_element) + return QWebElement(); + + return QWebElement(m_element->cloneElementWithChildren().get()); +} + +/*! + Removes this element from the document and returns a reference to it. + + The element is still valid after removal, and can be inserted into other + parts of the document. + + \sa removeAllChildren(), removeFromDocument() +*/ +QWebElement &QWebElement::takeFromDocument() +{ + if (!m_element) + return *this; + + ExceptionCode exception = 0; + m_element->remove(exception); + + return *this; +} + +/*! + Removes this element from the document and makes it a null element. + + \sa removeAllChildren(), takeFromDocument() +*/ +void QWebElement::removeFromDocument() +{ + if (!m_element) + return; + + ExceptionCode exception = 0; + m_element->remove(exception); + m_element->deref(); + m_element = 0; +} + +/*! + Removes all children from this element. + + \sa removeFromDocument(), takeFromDocument() +*/ +void QWebElement::removeAllChildren() +{ + if (!m_element) + return; + + m_element->removeAllChildren(); +} + +// FIXME: This code, and all callers are wrong, and have no place in a +// WebKit implementation. These should be replaced with WebCore implementations. +static RefPtr<Node> findInsertionPoint(PassRefPtr<Node> root) +{ + RefPtr<Node> node = root; + + // Go as far down the tree as possible. + while (node->hasChildNodes() && node->firstChild()->isElementNode()) + node = node->firstChild(); + + // TODO: Implement SVG support + if (node->isHTMLElement()) { + HTMLElement* element = static_cast<HTMLElement*>(node.get()); + + // The insert point could be a non-enclosable tag and it can thus + // never have children, so go one up. Get the parent element, and not + // note as a root note will always exist. + if (element->ieForbidsInsertHTML()) + node = node->parentElement(); + } + + return node; +} + +/*! + Encloses the contents of this element with \a element. This element becomes + the child of the deepest descendant within \a element. + + ### illustration + + \sa encloseWith() +*/ +void QWebElement::encloseContentsWith(const QWebElement &element) +{ + if (!m_element || element.isNull()) + return; + + RefPtr<Node> insertionPoint = findInsertionPoint(element.m_element); + + if (!insertionPoint) + return; + + ExceptionCode exception = 0; + + // reparent children + for (RefPtr<Node> child = m_element->firstChild(); child;) { + RefPtr<Node> next = child->nextSibling(); + insertionPoint->appendChild(child, exception); + child = next; + } + + if (m_element->hasChildNodes()) + m_element->insertBefore(element.m_element, m_element->firstChild(), exception); + else + m_element->appendChild(element.m_element, exception); +} + +/*! + Encloses the contents of this element with the result of parsing \a markup. + This element becomes the child of the deepest descendant within \a markup. + + \sa encloseWith() +*/ +void QWebElement::encloseContentsWith(const QString &markup) +{ + if (!m_element) + return; + + if (!m_element->parentNode()) + return; + + if (!m_element->isHTMLElement()) + return; + + HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); + + if (!fragment || !fragment->firstChild()) + return; + + RefPtr<Node> insertionPoint = findInsertionPoint(fragment->firstChild()); + + if (!insertionPoint) + return; + + ExceptionCode exception = 0; + + // reparent children + for (RefPtr<Node> child = m_element->firstChild(); child;) { + RefPtr<Node> next = child->nextSibling(); + insertionPoint->appendChild(child, exception); + child = next; + } + + if (m_element->hasChildNodes()) + m_element->insertBefore(fragment, m_element->firstChild(), exception); + else + m_element->appendChild(fragment, exception); +} + +/*! + Encloses this element with \a element. This element becomes the child of + the deepest descendant within \a element. + + \sa replace() +*/ +void QWebElement::encloseWith(const QWebElement &element) +{ + if (!m_element || element.isNull()) + return; + + RefPtr<Node> insertionPoint = findInsertionPoint(element.m_element); + + if (!insertionPoint) + return; + + // Keep reference to these two nodes before pulling out this element and + // wrapping it in the fragment. The reason for doing it in this order is + // that once the fragment has been added to the document it is empty, so + // we no longer have access to the nodes it contained. + Node* parent = m_element->parentNode(); + Node* siblingNode = m_element->nextSibling(); + + ExceptionCode exception = 0; + insertionPoint->appendChild(m_element, exception); + + if (!siblingNode) + parent->appendChild(element.m_element, exception); + else + parent->insertBefore(element.m_element, siblingNode, exception); +} + +/*! + Encloses this element with the result of parsing \a markup. This element + becomes the child of the deepest descendant within \a markup. + + \sa replace() +*/ +void QWebElement::encloseWith(const QString &markup) +{ + if (!m_element) + return; + + if (!m_element->parentNode()) + return; + + if (!m_element->isHTMLElement()) + return; + + HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); + + if (!fragment || !fragment->firstChild()) + return; + + RefPtr<Node> insertionPoint = findInsertionPoint(fragment->firstChild()); + + if (!insertionPoint) + return; + + // Keep reference to these two nodes before pulling out this element and + // wrapping it in the fragment. The reason for doing it in this order is + // that once the fragment has been added to the document it is empty, so + // we no longer have access to the nodes it contained. + Node* parent = m_element->parentNode(); + Node* siblingNode = m_element->nextSibling(); + + ExceptionCode exception = 0; + insertionPoint->appendChild(m_element, exception); + + if (!siblingNode) + parent->appendChild(fragment, exception); + else + parent->insertBefore(fragment, siblingNode, exception); +} + +/*! + Replaces this element with \a element. + + This method will not replace the <html>, <head> or <body> elements. + + \sa encloseWith() +*/ +void QWebElement::replace(const QWebElement &element) +{ + if (!m_element || element.isNull()) + return; + + appendOutside(element); + takeFromDocument(); +} + +/*! + Replaces this element with the result of parsing \a markup. + + This method will not replace the <html>, <head> or <body> elements. + + \sa encloseWith() +*/ +void QWebElement::replace(const QString &markup) +{ + if (!m_element) + return; + + appendOutside(markup); + takeFromDocument(); +} + +/*! + \internal + Walk \a node's parents until a valid QWebElement is found. + For example, a WebCore::Text node is not a valid Html QWebElement, but its + enclosing p tag is. +*/ +QWebElement QWebElement::enclosingElement(WebCore::Node* node) +{ + QWebElement element(node); + + while (element.isNull() && node) { + node = node->parentNode(); + element = QWebElement(node); + } + return element; +} + +/*! + \fn inline bool QWebElement::operator==(const QWebElement& o) const; + + Returns true if this element points to the same underlying DOM object as + \a o; otherwise returns false. +*/ + +/*! + \fn inline bool QWebElement::operator!=(const QWebElement& o) const; + + Returns true if this element points to a different underlying DOM object + than \a o; otherwise returns false. +*/ + + +/*! + Render the element into \a painter . +*/ +void QWebElement::render(QPainter* painter) +{ + WebCore::Element* e = m_element; + Document* doc = e ? e->document() : 0; + if (!doc) + return; + + Frame* frame = doc->frame(); + if (!frame || !frame->view() || !frame->contentRenderer()) + return; + + FrameView* view = frame->view(); + + view->updateLayoutAndStyleIfNeededRecursive(); + + IntRect rect = e->getRect(); + + if (rect.size().isEmpty()) + return; + + GraphicsContext context(painter); + + context.save(); + context.translate(-rect.x(), -rect.y()); + view->setNodeToDraw(e); + view->paintContents(&context, rect); + view->setNodeToDraw(0); + context.restore(); +} + +class QWebElementCollectionPrivate : public QSharedData +{ +public: + static QWebElementCollectionPrivate* create(const PassRefPtr<Node> &context, const QString &query); + + RefPtr<NodeList> m_result; + +private: + inline QWebElementCollectionPrivate() {} +}; + +QWebElementCollectionPrivate* QWebElementCollectionPrivate::create(const PassRefPtr<Node> &context, const QString &query) +{ + if (!context) + return 0; + + // Let WebKit do the hard work hehehe + ExceptionCode exception = 0; // ### + RefPtr<NodeList> nodes = context->querySelectorAll(query, exception); + if (!nodes) + return 0; + + QWebElementCollectionPrivate* priv = new QWebElementCollectionPrivate; + priv->m_result = nodes; + return priv; +} + +/*! + \class QWebElementCollection + \since 4.6 + \brief The QWebElementCollection class represents a collection of web elements. + \preliminary + + Elements in a document can be selected using QWebElement::findAll() or using the + QWebElement constructor. The collection is composed by choosing all elements in the + document that match a specified CSS selector expression. + + The number of selected elements is provided through the count() property. Individual + elements can be retrieved by index using at(). + + It is also possible to iterate through all elements in the collection using Qt's foreach + macro: + + \code + QWebElementCollection collection = document.findAll("p"); + foreach (QWebElement paraElement, collection) { + ... + } + \endcode +*/ + +/*! + Constructs an empty collection. +*/ +QWebElementCollection::QWebElementCollection() +{ +} + +/*! + Constructs a copy of \a other. +*/ +QWebElementCollection::QWebElementCollection(const QWebElementCollection &other) + : d(other.d) +{ +} + +/*! + Constructs a collection of elements from the list of child elements of \a contextElement that + match the specified CSS selector \a query. +*/ +QWebElementCollection::QWebElementCollection(const QWebElement &contextElement, const QString &query) +{ + d = QExplicitlySharedDataPointer<QWebElementCollectionPrivate>(QWebElementCollectionPrivate::create(contextElement.m_element, query)); +} + +/*! + Assigns \a other to this collection and returns a reference to this collection. +*/ +QWebElementCollection &QWebElementCollection::operator=(const QWebElementCollection &other) +{ + d = other.d; + return *this; +} + +/*! + Destroys the collection. +*/ +QWebElementCollection::~QWebElementCollection() +{ +} + +/*! \fn QWebElementCollection &QWebElementCollection::operator+=(const QWebElementCollection &other) + + Appends the items of the \a other list to this list and returns a + reference to this list. + + \sa operator+(), append() +*/ + +/*! + Returns a collection that contains all the elements of this collection followed + by all the elements in the \a other collection. Duplicates may occur in the result. + + \sa operator+=() +*/ +QWebElementCollection QWebElementCollection::operator+(const QWebElementCollection &other) const +{ + QWebElementCollection n = *this; n.d.detach(); n += other; return n; +} + +/*! + Extends the collection by appending all items of \a other. + + The resulting collection may include duplicate elements. + + \sa operator+=() +*/ +void QWebElementCollection::append(const QWebElementCollection &other) +{ + if (!d) { + *this = other; + return; + } + if (!other.d) + return; + Vector<RefPtr<Node> > nodes; + RefPtr<NodeList> results[] = { d->m_result, other.d->m_result }; + nodes.reserveInitialCapacity(results[0]->length() + results[1]->length()); + + for (int i = 0; i < 2; ++i) { + int j = 0; + Node* n = results[i]->item(j); + while (n) { + nodes.append(n); + n = results[i]->item(++j); + } + } + + d->m_result = StaticNodeList::adopt(nodes); +} + +/*! + Returns the number of elements in the collection. +*/ +int QWebElementCollection::count() const +{ + if (!d) + return 0; + return d->m_result->length(); +} + +/*! + Returns the element at index position \a i in the collection. +*/ +QWebElement QWebElementCollection::at(int i) const +{ + if (!d) + return QWebElement(); + Node* n = d->m_result->item(i); + return QWebElement(static_cast<Element*>(n)); +} + +/*! + \fn const QWebElement QWebElementCollection::operator[](int position) const + + Returns the element at the specified \a position in the collection. +*/ + +/*! \fn QWebElement QWebElementCollection::first() const + + Returns the first element in the collection. + + \sa last(), operator[](), at(), count() +*/ + +/*! \fn QWebElement QWebElementCollection::last() const + + Returns the last element in the collection. + + \sa first(), operator[](), at(), count() +*/ + +/*! + Returns a QList object with the elements contained in this collection. +*/ +QList<QWebElement> QWebElementCollection::toList() const +{ + if (!d) + return QList<QWebElement>(); + QList<QWebElement> elements; + int i = 0; + Node* n = d->m_result->item(i); + while (n) { + if (n->isElementNode()) + elements.append(QWebElement(static_cast<Element*>(n))); + n = d->m_result->item(++i); + } + return elements; +} + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::begin() const + + Returns an STL-style iterator pointing to the first element in the collection. + + \sa end() +*/ + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::end() const + + Returns an STL-style iterator pointing to the imaginary element after the + last element in the list. + + \sa begin() +*/ + +/*! + \class QWebElementCollection::const_iterator + \since 4.6 + \brief The QWebElementCollection::const_iterator class provides an STL-style const iterator for QWebElementCollection. + + QWebElementCollection provides STL style const iterators for fast low-level access to the elements. + + QWebElementCollection::const_iterator allows you to iterate over a QWebElementCollection. +*/ + +/*! + \fn QWebElementCollection::const_iterator::const_iterator(const const_iterator &other) + + Constructs a copy of \a other. +*/ + +/*! + \fn QWebElementCollection::const_iterator::const_iterator(const QWebElementCollection *collection, int index) + \internal +*/ + +/*! + \fn const QWebElement QWebElementCollection::const_iterator::operator*() const + + Returns the current element. +*/ + +/*! + \fn bool QWebElementCollection::const_iterator::operator==(const const_iterator &other) const + + Returns true if \a other points to the same item as this iterator; + otherwise returns false. + + \sa operator!=() +*/ + +/*! + \fn bool QWebElementCollection::const_iterator::operator!=(const const_iterator &other) const + + Returns true if \a other points to a different element than this; + iterator; otherwise returns false. + + \sa operator==() +*/ + +/*! + \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator++() + + The prefix ++ operator (\c{++it}) advances the iterator to the next element in the collection + and returns an iterator to the new current element. + + Calling this function on QWebElementCollection::end() leads to undefined results. + + \sa operator--() +*/ + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator++(int) + + \overload + + The postfix ++ operator (\c{it++}) advances the iterator to the next element in the collection + and returns an iterator to the previously current element. + + Calling this function on QWebElementCollection::end() leads to undefined results. +*/ + +/*! + \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator--() + + The prefix -- operator (\c{--it}) makes the preceding element current and returns an + iterator to the new current element. + + Calling this function on QWebElementCollection::begin() leads to undefined results. + + \sa operator++() +*/ + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator--(int) + + \overload + + The postfix -- operator (\c{it--}) makes the preceding element current and returns + an iterator to the previously current element. +*/ + +/*! + \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator+=(int j) + + Advances the iterator by \a j elements. If \a j is negative, the iterator goes backward. + + \sa operator-=(), operator+() +*/ + +/*! + \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator-=(int j) + + Makes the iterator go back by \a j elements. If \a j is negative, the iterator goes forward. + + \sa operator+=(), operator-() +*/ + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator+(int j) const + + Returns an iterator to the element at \a j positions forward from this iterator. If \a j + is negative, the iterator goes backward. + + \sa operator-(), operator+=() +*/ + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator-(int j) const + + Returns an iterator to the element at \a j positiosn backward from this iterator. + If \a j is negative, the iterator goes forward. + + \sa operator+(), operator-=() +*/ + +/*! + \fn int QWebElementCollection::const_iterator::operator-(const_iterator other) const + + Returns the number of elements between the item point to by \a other + and the element pointed to by this iterator. +*/ + +/*! + \fn bool QWebElementCollection::const_iterator::operator<(const const_iterator &other) const + + Returns true if the element pointed to by this iterator is less than the element pointed to + by the \a other iterator. +*/ + +/*! + \fn bool QWebElementCollection::const_iterator::operator<=(const const_iterator &other) const + + Returns true if the element pointed to by this iterator is less than or equal to the + element pointed to by the \a other iterator. +*/ + +/*! + \fn bool QWebElementCollection::const_iterator::operator>(const const_iterator &other) const + + Returns true if the element pointed to by this iterator is greater than the element pointed to + by the \a other iterator. +*/ + +/*! + \fn bool QWebElementCollection::const_iterator::operator>=(const const_iterator &other) const + + Returns true if the element pointed to by this iterator is greater than or equal to the + element pointed to by the \a other iterator. +*/ + +/*! + \fn QWebElementCollection::iterator QWebElementCollection::begin() + + Returns an STL-style iterator pointing to the first element in the collection. + + \sa end() +*/ + +/*! + \fn QWebElementCollection::iterator QWebElementCollection::end() + + Returns an STL-style iterator pointing to the imaginary element after the + last element in the list. + + \sa begin() +*/ + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::constBegin() const + + Returns an STL-style iterator pointing to the first element in the collection. + + \sa end() +*/ + +/*! + \fn QWebElementCollection::const_iterator QWebElementCollection::constEnd() const + + Returns an STL-style iterator pointing to the imaginary element after the + last element in the list. + + \sa begin() +*/ + +/*! + \class QWebElementCollection::iterator + \since 4.6 + \brief The QWebElementCollection::iterator class provides an STL-style iterator for QWebElementCollection. + + QWebElementCollection provides STL style iterators for fast low-level access to the elements. + + QWebElementCollection::iterator allows you to iterate over a QWebElementCollection. +*/ + +/*! + \fn QWebElementCollection::iterator::iterator(const iterator &other) + + Constructs a copy of \a other. +*/ + +/*! + \fn QWebElementCollection::iterator::iterator(const QWebElementCollection *collection, int index) + \internal +*/ + +/*! + \fn const QWebElement QWebElementCollection::iterator::operator*() const + + Returns the current element. +*/ + +/*! + \fn bool QWebElementCollection::iterator::operator==(const iterator &other) const + + Returns true if \a other points to the same item as this iterator; + otherwise returns false. + + \sa operator!=() +*/ + +/*! + \fn bool QWebElementCollection::iterator::operator!=(const iterator &other) const + + Returns true if \a other points to a different element than this; + iterator; otherwise returns false. + + \sa operator==() +*/ + +/*! + \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator++() + + The prefix ++ operator (\c{++it}) advances the iterator to the next element in the collection + and returns an iterator to the new current element. + + Calling this function on QWebElementCollection::end() leads to undefined results. + + \sa operator--() +*/ + +/*! + \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator++(int) + + \overload + + The postfix ++ operator (\c{it++}) advances the iterator to the next element in the collection + and returns an iterator to the previously current element. + + Calling this function on QWebElementCollection::end() leads to undefined results. +*/ + +/*! + \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator--() + + The prefix -- operator (\c{--it}) makes the preceding element current and returns an + iterator to the new current element. + + Calling this function on QWebElementCollection::begin() leads to undefined results. + + \sa operator++() +*/ + +/*! + \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator--(int) + + \overload + + The postfix -- operator (\c{it--}) makes the preceding element current and returns + an iterator to the previously current element. +*/ + +/*! + \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator+=(int j) + + Advances the iterator by \a j elements. If \a j is negative, the iterator goes backward. + + \sa operator-=(), operator+() +*/ + +/*! + \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator-=(int j) + + Makes the iterator go back by \a j elements. If \a j is negative, the iterator goes forward. + + \sa operator+=(), operator-() +*/ + +/*! + \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator+(int j) const + + Returns an iterator to the element at \a j positions forward from this iterator. If \a j + is negative, the iterator goes backward. + + \sa operator-(), operator+=() +*/ + +/*! + \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator-(int j) const + + Returns an iterator to the element at \a j positiosn backward from this iterator. + If \a j is negative, the iterator goes forward. + + \sa operator+(), operator-=() +*/ + +/*! + \fn int QWebElementCollection::iterator::operator-(iterator other) const + + Returns the number of elements between the item point to by \a other + and the element pointed to by this iterator. +*/ + +/*! + \fn bool QWebElementCollection::iterator::operator<(const iterator &other) const + + Returns true if the element pointed to by this iterator is less than the element pointed to + by the \a other iterator. +*/ + +/*! + \fn bool QWebElementCollection::iterator::operator<=(const iterator &other) const + + Returns true if the element pointed to by this iterator is less than or equal to the + element pointed to by the \a other iterator. +*/ + +/*! + \fn bool QWebElementCollection::iterator::operator>(const iterator &other) const + + Returns true if the element pointed to by this iterator is greater than the element pointed to + by the \a other iterator. +*/ + +/*! + \fn bool QWebElementCollection::iterator::operator>=(const iterator &other) const + + Returns true if the element pointed to by this iterator is greater than or equal to the + element pointed to by the \a other iterator. +*/ diff --git a/Source/WebKit/qt/Api/qwebelement.h b/Source/WebKit/qt/Api/qwebelement.h new file mode 100644 index 0000000..b94c372 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebelement.h @@ -0,0 +1,282 @@ +/* + 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. +*/ + +#ifndef QWEBELEMENT_H +#define QWEBELEMENT_H + +#include <QtCore/qstring.h> +#include <QtCore/qstringlist.h> +#include <QtCore/qrect.h> +#include <QtCore/qvariant.h> +#include <QtCore/qshareddata.h> + +#include "qwebkitglobal.h" +namespace WebCore { + class Element; + class Node; +} + + +#if defined(WTF_USE_V8) && WTF_USE_V8 +namespace V8 { + namespace Bindings { + class QtWebElementRuntime; + } +} +#else +namespace JSC { + namespace Bindings { + class QtWebElementRuntime; + } +} +#endif + +QT_BEGIN_NAMESPACE +class QPainter; +QT_END_NAMESPACE + +class QWebFrame; +class QWebElementCollection; +class QWebElementPrivate; + +class QWEBKIT_EXPORT QWebElement { +public: + QWebElement(); + QWebElement(const QWebElement&); + QWebElement &operator=(const QWebElement&); + ~QWebElement(); + + bool operator==(const QWebElement& o) const; + bool operator!=(const QWebElement& o) const; + + bool isNull() const; + + QWebElementCollection findAll(const QString &selectorQuery) const; + QWebElement findFirst(const QString &selectorQuery) const; + + void setPlainText(const QString& text); + QString toPlainText() const; + + void setOuterXml(const QString& markup); + QString toOuterXml() const; + + void setInnerXml(const QString& markup); + QString toInnerXml() const; + + void setAttribute(const QString& name, const QString& value); + void setAttributeNS(const QString& namespaceUri, const QString& name, const QString& value); + QString attribute(const QString& name, const QString& defaultValue = QString()) const; + QString attributeNS(const QString& namespaceUri, const QString& name, const QString& defaultValue = QString()) const; + bool hasAttribute(const QString& name) const; + bool hasAttributeNS(const QString& namespaceUri, const QString& name) const; + void removeAttribute(const QString& name); + void removeAttributeNS(const QString& namespaceUri, const QString& name); + bool hasAttributes() const; + QStringList attributeNames(const QString& namespaceUri = QString()) const; + + QStringList classes() const; + bool hasClass(const QString& name) const; + void addClass(const QString& name); + void removeClass(const QString& name); + void toggleClass(const QString& name); + + bool hasFocus() const; + void setFocus(); + + QRect geometry() const; + + QString tagName() const; + QString prefix() const; + QString localName() const; + QString namespaceUri() const; + + QWebElement parent() const; + QWebElement firstChild() const; + QWebElement lastChild() const; + QWebElement nextSibling() const; + QWebElement previousSibling() const; + QWebElement document() const; + QWebFrame *webFrame() const; + + // TODO: Add QWebElementCollection overloads + // docs need example snippet + void appendInside(const QString& markup); + void appendInside(const QWebElement& element); + + // docs need example snippet + void prependInside(const QString& markup); + void prependInside(const QWebElement& element); + + // docs need example snippet + void appendOutside(const QString& markup); + void appendOutside(const QWebElement& element); + + // docs need example snippet + void prependOutside(const QString& markup); + void prependOutside(const QWebElement& element); + + // docs need example snippet + void encloseContentsWith(const QWebElement& element); + void encloseContentsWith(const QString& markup); + void encloseWith(const QString& markup); + void encloseWith(const QWebElement& element); + + void replace(const QString& markup); + void replace(const QWebElement& element); + + QWebElement clone() const; + QWebElement& takeFromDocument(); + void removeFromDocument(); + void removeAllChildren(); + + QVariant evaluateJavaScript(const QString& scriptSource); + + enum StyleResolveStrategy { + InlineStyle, + CascadedStyle, + ComputedStyle, + }; + QString styleProperty(const QString& name, StyleResolveStrategy strategy) const; + void setStyleProperty(const QString& name, const QString& value); + + void render(QPainter* painter); + +private: + explicit QWebElement(WebCore::Element*); + explicit QWebElement(WebCore::Node*); + + static QWebElement enclosingElement(WebCore::Node*); + + friend class DumpRenderTreeSupportQt; + friend class QWebFrame; + friend class QWebElementCollection; + friend class QWebHitTestResult; + friend class QWebHitTestResultPrivate; + friend class QWebPage; + +#if defined(WTF_USE_V8) && WTF_USE_V8 + friend class V8::Bindings::QtWebElementRuntime; +#else + friend class JSC::Bindings::QtWebElementRuntime; +#endif + + QWebElementPrivate* d; + WebCore::Element* m_element; +}; + +class QWebElementCollectionPrivate; + +class QWEBKIT_EXPORT QWebElementCollection +{ +public: + QWebElementCollection(); + QWebElementCollection(const QWebElement &contextElement, const QString &query); + QWebElementCollection(const QWebElementCollection &); + QWebElementCollection &operator=(const QWebElementCollection &); + ~QWebElementCollection(); + + QWebElementCollection operator+(const QWebElementCollection &other) const; + inline QWebElementCollection &operator+=(const QWebElementCollection &other) + { + append(other); return *this; + } + + void append(const QWebElementCollection &collection); + + int count() const; + QWebElement at(int i) const; + inline QWebElement operator[](int i) const { return at(i); } + + inline QWebElement first() const { return at(0); } + inline QWebElement last() const { return at(count() - 1); } + + QList<QWebElement> toList() const; + + class const_iterator { + public: + inline const_iterator(const QWebElementCollection* collection, int index) : i(index), collection(collection) {} + inline const_iterator(const const_iterator& o) : i(o.i), collection(o.collection) {} + + inline const QWebElement operator*() const { return collection->at(i); } + + inline bool operator==(const const_iterator& o) const { return i == o.i && collection == o.collection; } + inline bool operator!=(const const_iterator& o) const { return i != o.i || collection != o.collection; } + inline bool operator<(const const_iterator& o) const { return i < o.i; } + inline bool operator<=(const const_iterator& o) const { return i <= o.i; } + inline bool operator>(const const_iterator& o) const { return i > o.i; } + inline bool operator>=(const const_iterator& o) const { return i >= o.i; } + + inline const_iterator& operator++() { ++i; return *this; } + inline const_iterator operator++(int) { const_iterator n(collection, i); ++i; return n; } + inline const_iterator& operator--() { i--; return *this; } + inline const_iterator operator--(int) { const_iterator n(collection, i); i--; return n; } + inline const_iterator& operator+=(int j) { i += j; return *this; } + inline const_iterator& operator-=(int j) { i -= j; return *this; } + inline const_iterator operator+(int j) const { return const_iterator(collection, i + j); } + inline const_iterator operator-(int j) const { return const_iterator(collection, i - j); } + inline int operator-(const_iterator j) const { return i - j.i; } + private: + int i; + const QWebElementCollection* const collection; + }; + friend class const_iterator; + + inline const_iterator begin() const { return constBegin(); } + inline const_iterator end() const { return constEnd(); } + inline const_iterator constBegin() const { return const_iterator(this, 0); } + inline const_iterator constEnd() const { return const_iterator(this, count()); }; + + class iterator { + public: + inline iterator(const QWebElementCollection* collection, int index) : i(index), collection(collection) {} + inline iterator(const iterator& o) : i(o.i), collection(o.collection) {} + + inline QWebElement operator*() const { return collection->at(i); } + + inline bool operator==(const iterator& o) const { return i == o.i && collection == o.collection; } + inline bool operator!=(const iterator& o) const { return i != o.i || collection != o.collection; } + inline bool operator<(const iterator& o) const { return i < o.i; } + inline bool operator<=(const iterator& o) const { return i <= o.i; } + inline bool operator>(const iterator& o) const { return i > o.i; } + inline bool operator>=(const iterator& o) const { return i >= o.i; } + + inline iterator& operator++() { ++i; return *this; } + inline iterator operator++(int) { iterator n(collection, i); ++i; return n; } + inline iterator& operator--() { i--; return *this; } + inline iterator operator--(int) { iterator n(collection, i); i--; return n; } + inline iterator& operator+=(int j) { i += j; return *this; } + inline iterator& operator-=(int j) { i -= j; return *this; } + inline iterator operator+(int j) const { return iterator(collection, i + j); } + inline iterator operator-(int j) const { return iterator(collection, i - j); } + inline int operator-(iterator j) const { return i - j.i; } + private: + int i; + const QWebElementCollection* const collection; + }; + friend class iterator; + + inline iterator begin() { return iterator(this, 0); } + inline iterator end() { return iterator(this, count()); } +private: + QExplicitlySharedDataPointer<QWebElementCollectionPrivate> d; +}; + +Q_DECLARE_METATYPE(QWebElement) + +#endif // QWEBELEMENT_H diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp new file mode 100644 index 0000000..9c89a4c --- /dev/null +++ b/Source/WebKit/qt/Api/qwebframe.cpp @@ -0,0 +1,1931 @@ +/* + 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" + +#if USE(JSC) +#include "Bridge.h" +#include "CallFrame.h" +#elif USE(V8) +#include "V8Binding.h" +#endif +#include "Document.h" +#include "DocumentLoader.h" +#include "DragData.h" +#include "Element.h" +#include "FocusController.h" +#include "Frame.h" +#include "FrameLoaderClientQt.h" +#include "FrameTree.h" +#include "FrameView.h" +#if USE(JSC) +#include "GCController.h" +#elif USE(V8) +#include "V8GCController.h" +#endif +#include "GraphicsContext.h" +#include "HTMLMetaElement.h" +#include "HitTestResult.h" +#include "HTTPParsers.h" +#include "IconDatabase.h" +#include "InspectorController.h" +#if USE(JSC) +#include "JSDOMBinding.h" +#include "JSDOMWindowBase.h" +#include "JSLock.h" +#include "JSObject.h" +#elif USE(V8) +#include "V8DOMWrapper.h" +#include "V8DOMWindowShell.h" +#endif +#include "NetworkingContext.h" +#include "NodeList.h" +#include "Page.h" +#include "PlatformMouseEvent.h" +#include "PlatformWheelEvent.h" +#include "PrintContext.h" +#if USE(JSC) +#include "PutPropertySlot.h" +#endif +#include "RenderLayer.h" +#include "RenderTreeAsText.h" +#include "RenderView.h" +#include "ResourceRequest.h" +#include "ScriptController.h" +#include "ScriptSourceCode.h" +#include "ScriptValue.h" +#include "Scrollbar.h" +#include "Settings.h" +#include "SelectionController.h" +#include "SubstituteData.h" +#include "SVGSMILElement.h" +#include "TiledBackingStore.h" +#include "htmlediting.h" +#include "markup.h" +#if USE(JSC) +#include "qt_instance.h" +#include "qt_runtime.h" +#endif +#include "qwebelement.h" +#include "qwebframe_p.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include "qwebsecurityorigin.h" +#include "qwebsecurityorigin_p.h" +#include "qwebscriptworld.h" +#include "qwebscriptworld_p.h" +#if USE(JSC) +#include "runtime_object.h" +#include "runtime_root.h" +#endif +#if USE(TEXTURE_MAPPER) +#include "texmap/TextureMapper.h" +#include "texmap/TextureMapperPlatformLayer.h" +#endif +#include "wtf/HashMap.h" +#include <QMultiMap> +#include <qdebug.h> +#include <qevent.h> +#include <qfileinfo.h> +#include <qpainter.h> +#include <qprinter.h> +#include <qregion.h> +#include <qnetworkrequest.h> + +using namespace WebCore; + +// from text/qfont.cpp +QT_BEGIN_NAMESPACE +extern Q_GUI_EXPORT int qt_defaultDpi(); +QT_END_NAMESPACE + +bool QWEBKIT_EXPORT qtwebkit_webframe_scrollOverflow(QWebFrame* qFrame, int dx, int dy, const QPoint& pos) +{ + WebCore::Frame* frame = QWebFramePrivate::core(qFrame); + if (!frame || !frame->document() || !frame->view() || !frame->eventHandler()) + return false; + + QPoint contentsPos = frame->view()->windowToContents(pos); + Node* node = frame->document()->elementFromPoint(contentsPos.x(), contentsPos.y()); + if (!node) + return false; + + RenderObject* renderer = node->renderer(); + if (!renderer) + return false; + + if (renderer->isListBox()) + return false; + + RenderLayer* renderLayer = renderer->enclosingLayer(); + if (!renderLayer) + return false; + + bool scrolledHorizontal = false; + bool scrolledVertical = false; + + do { + if (dx > 0) + scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx); + else if (dx < 0) + scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx)); + + if (dy > 0) + scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy); + else if (dy < 0) + scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy)); + + if (scrolledHorizontal || scrolledVertical) + return true; + + renderLayer = renderLayer->parent(); + } while (renderLayer); + + return false; +} + + +/*! + \internal + Scrolls nested frames starting at this frame, \a dx pixels to the right + and \a dy pixels downward. Both \a dx and \a dy may be negative. First attempts + to scroll elements with CSS overflow at position pos, followed by this frame. If this + frame doesn't scroll, attempts to scroll the parent +*/ +void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy, const QPoint& pos) +{ + if (!qFrame) + return; + + if (qtwebkit_webframe_scrollOverflow(qFrame, dx, dy, pos)) + return; + + bool scrollHorizontal = false; + bool scrollVertical = false; + + do { + if (dx > 0) // scroll right + scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) < qFrame->scrollBarMaximum(Qt::Horizontal); + else if (dx < 0) // scroll left + scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) > qFrame->scrollBarMinimum(Qt::Horizontal); + + if (dy > 0) // scroll down + scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical); + else if (dy < 0) //scroll up + scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical); + + if (scrollHorizontal || scrollVertical) { + qFrame->scroll(dx, dy); + return; + } + + qFrame = qFrame->parentFrame(); + } while (qFrame); +} + +static inline ResourceRequestCachePolicy cacheLoadControlToCachePolicy(uint cacheLoadControl) +{ + switch (cacheLoadControl) { + case QNetworkRequest::AlwaysNetwork: + return WebCore::ReloadIgnoringCacheData; + case QNetworkRequest::PreferCache: + return WebCore::ReturnCacheDataElseLoad; + case QNetworkRequest::AlwaysCache: + return WebCore::ReturnCacheDataDontLoad; + default: + break; + } + return WebCore::UseProtocolCachePolicy; +} + +QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame, + WebCore::HTMLFrameOwnerElement* ownerFrameElement, + const WTF::String& frameName) + : name(frameName) + , ownerElement(ownerFrameElement) + , page(parentPage) + , allowsScrolling(true) + , marginWidth(0) + , marginHeight(0) +{ + frameLoaderClient = new FrameLoaderClientQt(); + frame = Frame::create(page, ownerElement, frameLoaderClient); + + // FIXME: All of the below should probably be moved over into WebCore + frame->tree()->setName(name); + if (parentFrame) + parentFrame->tree()->appendChild(frame); +} + +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(); +} + +void QWebFramePrivate::setPage(QWebPage* newPage) +{ + if (page == newPage) + return; + + // The QWebFrame is created as a child of QWebPage or a parent QWebFrame. + // That adds it to QObject's internal children list and ensures it will be + // deleted when parent QWebPage is deleted. Reparent if needed. + if (q->parent() == qobject_cast<QObject*>(page)) + q->setParent(newPage); + + page = newPage; + emit q->pageChanged(); +} + +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(); +} + +#if ENABLE(TILED_BACKING_STORE) +void QWebFramePrivate::renderFromTiledBackingStore(GraphicsContext* context, const QRegion& clip) +{ + ASSERT(frame->tiledBackingStore()); + + if (!frame->view() || !frame->contentRenderer()) + return; + + QVector<QRect> vector = clip.rects(); + if (vector.isEmpty()) + return; + + QPainter* painter = context->platformContext(); + + WebCore::FrameView* view = frame->view(); + + int scrollX = view->scrollX(); + int scrollY = view->scrollY(); + context->translate(-scrollX, -scrollY); + + for (int i = 0; i < vector.size(); ++i) { + const QRect& clipRect = vector.at(i); + + painter->save(); + + QRect rect = clipRect.translated(scrollX, scrollY); + painter->setClipRect(rect, Qt::IntersectClip); + + frame->tiledBackingStore()->paint(context, rect); + + painter->restore(); + } + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + renderCompositedLayers(context, IntRect(clip.boundingRect())); + renderRelativeCoords(context, (QWebFrame::RenderLayer)(QWebFrame::ScrollBarLayer | QWebFrame::PanIconLayer), clip); +#endif +} +#endif + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) +void QWebFramePrivate::renderCompositedLayers(GraphicsContext* context, const IntRect& clip) +{ + if (!rootGraphicsLayer) + return; + + textureMapper->setGraphicsContext(context); + textureMapper->setImageInterpolationQuality(context->imageInterpolationQuality()); + textureMapper->setTextDrawingMode(context->textDrawingMode()); + QPainter* painter = context->platformContext(); + FrameView* view = frame->view(); + painter->save(); + painter->beginNativePainting(); + TextureMapperContentLayer::PaintOptions options; + options.visibleRect = clip; + options.targetRect = view->frameRect(); + options.viewportSize = view->size(); + options.opacity = painter->opacity(); + rootGraphicsLayer->paint(textureMapper.get(), options); + painter->endNativePainting(); + painter->restore(); +} +#endif + +void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame::RenderLayer layer, const QRegion& clip) +{ + if (!frame->view() || !frame->contentRenderer()) + return; + + QVector<QRect> vector = clip.rects(); + if (vector.isEmpty()) + return; + + QPainter* painter = context->platformContext(); + + WebCore::FrameView* view = frame->view(); + view->updateLayoutAndStyleIfNeededRecursive(); + + if (layer & QWebFrame::ContentsLayer) { + painter->save(); + for (int i = 0; i < vector.size(); ++i) { + const QRect& clipRect = vector.at(i); + + QRect intersectedRect = clipRect.intersected(view->frameRect()); + + context->save(); + painter->setClipRect(clipRect, Qt::IntersectClip); + + int x = view->x(); + int y = view->y(); + + int scrollX = view->scrollX(); + int scrollY = view->scrollY(); + + QRect rect = intersectedRect; + context->translate(x, y); + rect.translate(-x, -y); + context->translate(-scrollX, -scrollY); + rect.translate(scrollX, scrollY); + context->clip(view->visibleContentRect()); + + view->paintContents(context, rect); + + context->restore(); + } + painter->restore(); +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + renderCompositedLayers(context, IntRect(clip.boundingRect())); +#endif + } + if (layer & (QWebFrame::PanIconLayer | QWebFrame::ScrollBarLayer)) { + for (int i = 0; i < vector.size(); ++i) { + const QRect& clipRect = vector.at(i); + + QRect intersectedRect = clipRect.intersected(view->frameRect()); + + painter->save(); + painter->setClipRect(clipRect, Qt::IntersectClip); + + int x = view->x(); + int y = view->y(); + + if (layer & QWebFrame::ScrollBarLayer + && !view->scrollbarsSuppressed() + && (view->horizontalScrollbar() || view->verticalScrollbar())) { + context->save(); + + QRect rect = intersectedRect; + context->translate(x, y); + rect.translate(-x, -y); + + view->paintScrollbars(context, rect); + + context->restore(); + } + +#if ENABLE(PAN_SCROLLING) + if (layer & QWebFrame::PanIconLayer) + view->paintPanScrollIcon(context); +#endif + + painter->restore(); + } + } +} + +void QWebFrame::orientationChanged() +{ +#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) + int orientation; + WebCore::Frame* frame = QWebFramePrivate::core(this); + + switch (d->m_orientation.reading()->orientation()) { + case QtMobility::QOrientationReading::TopUp: + orientation = 0; + break; + case QtMobility::QOrientationReading::TopDown: + orientation = 180; + break; + case QtMobility::QOrientationReading::LeftUp: + orientation = -90; + break; + case QtMobility::QOrientationReading::RightUp: + orientation = 90; + break; + case QtMobility::QOrientationReading::FaceUp: + case QtMobility::QOrientationReading::FaceDown: + // WebCore unable to handle it + default: + return; + } + frame->sendOrientationChangeEvent(orientation); +#endif +} +/*! + \class QWebFrame + \since 4.4 + \brief The QWebFrame class represents a frame in a web page. + + \inmodule QtWebKit + + 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{QWebView}{Elements of QWebView} for an explanation of how web + frames are related to a web page and web view. + + The QWebFrame class also offers methods to retrieve both the URL currently + loaded by the frame (see url()) as well as the URL originally requested + to be loaded (see requestedUrl()). These methods make possible the retrieval + of the URL before and after a DNS resolution or a redirection occurs during + the load process. The requestedUrl() also matches to the URL added to the + frame history (\l{QWebHistory}) if load is successful. + + 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. + + There are multiple ways to programmatically examine the contents of a frame. + The hitTestContent() function can be used to find elements by coordinate. + For access to the underlying DOM tree, there is documentElement(), + findAllElements() and findFirstElement(). + + 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 +*/ + +/*! + \enum QWebFrame::RenderLayer + + This enum describes the layers available for rendering using \l{QWebFrame::}{render()}. + The layers can be OR-ed together from the following list: + + \value ContentsLayer The web content of the frame + \value ScrollBarLayer The scrollbars of the frame + \value PanIconLayer The icon used when panning the frame + + \value AllLayers Includes all the above layers +*/ + +QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData) + : QObject(parent) + , d(new QWebFramePrivate) +{ + d->page = parent; + d->init(this, frameData); + + if (!frameData->url.isEmpty()) { + WebCore::ResourceRequest request(frameData->url, frameData->referrer); + d->frame->loader()->load(request, frameData->name, false); + } +#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) + connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged())); + d->m_orientation.start(); +#endif +} + +QWebFrame::QWebFrame(QWebFrame *parent, QWebFrameData *frameData) + : QObject(parent) + , d(new QWebFramePrivate) +{ + d->page = parent->d->page; + d->init(this, frameData); +#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) + connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged())); + d->m_orientation.start(); +#endif +} + +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. + + 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) +{ + 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. + + 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; +#if USE(JSC) + JSC::JSLock lock(JSC::SilenceAssertionsOnly); + JSDOMWindow* window = toJSDOMWindow(d->frame, mainThreadNormalWorld()); + JSC::Bindings::RootObject* root; + if (ownership == QScriptEngine::QtOwnership) + root = d->frame->script()->cacheableBindingRootObject(); + else + root = d->frame->script()->bindingRootObject(); + + if (!window) { + qDebug() << "Warning: couldn't get window object"; + return; + } + if (!root) { + qDebug() << "Warning: couldn't get root object"; + return; + } + + JSC::ExecState* exec = window->globalExec(); + + JSC::JSObject* runtimeObject = + JSC::Bindings::QtInstance::getQtInstance(object, root, ownership)->createRuntimeObject(exec); + + JSC::PutPropertySlot slot; + window->put(exec, JSC::Identifier(exec, reinterpret_cast_ptr<const UChar*>(name.constData()), name.length()), runtimeObject, slot); +#elif USE(V8) + QScriptEngine* engine = d->frame->script()->qtScriptEngine(); + if (!engine) + return; + QScriptValue v = engine->newQObject(object, ownership); + engine->globalObject().property("window").setProperty(name, v); +#endif +} + +/*! + Returns the frame's content as HTML, enclosed in HTML and BODY tags. + + \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, completely + stripped of all HTML formatting. + + \sa toHtml() +*/ +QString QWebFrame::toPlainText() const +{ + if (d->frame->view() && d->frame->view()->layoutPending()) + d->frame->view()->layout(); + + Element *documentElement = d->frame->document()->documentElement(); + if (documentElement) + return documentElement->innerText(); + return QString(); +} + +/*! + 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); +} + +/*! + \property QWebFrame::title + \brief the title of the frame as defined by the HTML <title> element + + \sa titleChanged() +*/ + +QString QWebFrame::title() const +{ + if (d->frame->document()) + return d->frame->loader()->documentLoader()->title(); + 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 + + Setting this property clears the view and loads the URL. + + By default, this property contains an empty, invalid URL. + + \sa urlChanged() +*/ + +void QWebFrame::setUrl(const QUrl &url) +{ + const QUrl absolute = ensureAbsoluteUrl(url); + d->frame->loader()->writer()->begin(absolute); + d->frame->loader()->writer()->end(); + load(absolute); +} + +QUrl QWebFrame::url() const +{ + return d->frame->loader()->url(); +} + +/*! + \since 4.6 + \property QWebFrame::requestedUrl + + The URL requested to loaded by the frame currently viewed. The URL may differ from + the one returned by url() if a DNS resolution or a redirection occurs. + + \sa url(), setUrl() +*/ +QUrl QWebFrame::requestedUrl() const +{ + // There are some possible edge cases to be handled here, + // apart from checking if activeDocumentLoader is valid: + // + // * Method can be called while processing an unsucessful load. + // In this case, frameLoaderClient will hold the current error + // (m_loadError), and we will make use of it to recover the 'failingURL'. + // * If the 'failingURL' holds a null'ed string though, we fallback + // to 'outgoingReferrer' (it yet is safer than originalRequest). + FrameLoader* loader = d->frame->loader(); + FrameLoaderClientQt* loaderClient = d->frameLoaderClient; + + if (!loader->activeDocumentLoader() + || !loaderClient->m_loadError.isNull()) { + if (!loaderClient->m_loadError.failingURL().isNull()) + return QUrl(loaderClient->m_loadError.failingURL()); + else if (!loader->outgoingReferrer().isEmpty()) + return QUrl(loader->outgoingReferrer()); + } + + return loader->originalRequest().url(); +} +/*! + \since 4.6 + \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 + + \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()->uniqueName(); +} + +/*! + The web page that contains this frame. + + \sa pageChanged() +*/ +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) +{ + // The load() overload ensures that the url is absolute. + load(QNetworkRequest(url)); +} + +/*! + 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 content. + + \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::DeleteOperation: + request.setHTTPMethod("DELETE"); + break; +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) + case QNetworkAccessManager::CustomOperation: + request.setHTTPMethod(req.attribute(QNetworkRequest::CustomVerbAttribute).toByteArray().constData()); + break; +#endif + case QNetworkAccessManager::UnknownOperation: + // eh? + break; + } + + QVariant cacheLoad = req.attribute(QNetworkRequest::CacheLoadControlAttribute); + if (cacheLoad.isValid()) { + bool ok; + uint cacheLoadValue = cacheLoad.toUInt(&ok); + if (ok) + request.setCachePolicy(cacheLoadControlToCachePolicy(cacheLoadValue)); + } + + 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, false); + + if (d->parentFrame()) + d->page->d->insideOpenCall = false; +} + +/*! + 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. + + The \a html is loaded immediately; external objects are loaded asynchronously. + + If a script in the \a html runs longer than the default script timeout (currently 10 seconds), + for example due to being blocked by a modal JavaScript alert dialog, this method will return + as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously. + + 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. + + This is a convenience function equivalent to setContent(html, "text/html", baseUrl). + + \note This method will not affect session or global history for the frame. + + \warning This function works only for HTML, for other mime types (i.e. XHTML, SVG) + setContent() should be used instead. + + \sa toHtml(), setContent(), load() +*/ +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, WTF::String("text/html"), WTF::String("utf-8"), KURL()); + d->frame->loader()->load(request, substituteData, false); +} + +/*! + 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. + + The \a data is loaded immediately; external objects are loaded asynchronously. + + \note This method will not affect session or global history for the frame. + + \sa toHtml(), setHtml() +*/ +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; + WTF::String encoding; + if (mimeType.isEmpty()) + actualMimeType = QLatin1String("text/html"); + else { + actualMimeType = extractMIMETypeFromMediaType(mimeType); + encoding = extractCharsetFromMediaType(mimeType); + } + WebCore::SubstituteData substituteData(buffer, WTF::String(actualMimeType), encoding, KURL()); + d->frame->loader()->load(request, substituteData, false); +} + +/*! + 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(); + QWebFrame* webFrame = qobject_cast<QWebFrame*>(loader->networkingContext()->originatingObject()); + if (webFrame) + rc.append(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, policy != Qt::ScrollBarAsNeeded /* lock */); + d->frame->view()->updateCanHaveScrollbars(); + } + } else { + d->verticalScrollBarPolicy = policy; + if (d->frame->view()) { + d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy, policy != Qt::ScrollBarAsNeeded /* lock */); + d->frame->view()->updateCanHaveScrollbars(); + } + } +} + +/*! + 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, Scrollbar::NotFromScrollAnimator); + } +} + +/*! + 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 +{ + Q_UNUSED(orientation) + return 0; +} + +/*! + \since 4.6 + Returns the geometry for the scrollbar with orientation \a orientation. + + If the scrollbar does not exist an empty rect is returned. +*/ +QRect QWebFrame::scrollBarGeometry(Qt::Orientation orientation) const +{ + Scrollbar *sb; + sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar(); + if (sb) + return sb->frameRect(); + return QRect(); +} + +/*! + \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); +} + +/*! + \since 4.7 + Scrolls the frame to the given \a anchor name. +*/ +void QWebFrame::scrollToAnchor(const QString& anchor) +{ + FrameView *view = d->frame->view(); + if (view) + view->scrollToAnchor(anchor); +} + +/*! + \since 4.6 + Render the \a layer of the frame using \a painter clipping to \a clip. + + \sa print() +*/ + +void QWebFrame::render(QPainter* painter, RenderLayer layer, const QRegion& clip) +{ + GraphicsContext context(painter); + if (context.paintingDisabled() && !context.updatingControlTints()) + return; + + if (!clip.isEmpty()) + d->renderRelativeCoords(&context, layer, clip); + else if (d->frame->view()) + d->renderRelativeCoords(&context, layer, QRegion(d->frame->view()->frameRect())); +} + +/*! + Render the frame into \a painter clipping to \a clip. +*/ +void QWebFrame::render(QPainter* painter, const QRegion& clip) +{ + GraphicsContext context(painter); + if (context.paintingDisabled() && !context.updatingControlTints()) + return; + + d->renderRelativeCoords(&context, AllLayers, clip); +} + +/*! + Render the frame into \a painter. +*/ +void QWebFrame::render(QPainter* painter) +{ + if (!d->frame->view()) + return; + + GraphicsContext context(painter); + if (context.paintingDisabled() && !context.updatingControlTints()) + return; + + d->renderRelativeCoords(&context, AllLayers, QRegion(d->frame->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) +{ + page()->settings()->setAttribute(QWebSettings::ZoomTextOnly, true); + + d->frame->setPageAndTextZoomFactors(1, factor); +} + +/*! + Returns the value of the multiplier used to scale the text in a Web frame. +*/ +qreal QWebFrame::textSizeMultiplier() const +{ + return page()->settings()->testAttribute(QWebSettings::ZoomTextOnly) ? d->frame->textZoomFactor() : d->frame->pageZoomFactor(); +} + +/*! + \property QWebFrame::zoomFactor + \since 4.5 + \brief the zoom factor for the frame +*/ + +void QWebFrame::setZoomFactor(qreal factor) +{ + if (page()->settings()->testAttribute(QWebSettings::ZoomTextOnly)) + d->frame->setTextZoomFactor(factor); + else + d->frame->setPageZoomFactor(factor); +} + +qreal QWebFrame::zoomFactor() const +{ + return page()->settings()->testAttribute(QWebSettings::ZoomTextOnly) ? d->frame->textZoomFactor() : d->frame->pageZoomFactor(); +} + +/*! + \property QWebFrame::focus + \since 4.6 + + Returns true if this frame has keyboard input focus; otherwise, returns false. +*/ +bool QWebFrame::hasFocus() const +{ + WebCore::Frame* ff = d->frame->page()->focusController()->focusedFrame(); + return ff && QWebFramePrivate::kit(ff) == 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 +{ + 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 + + \sa contentsSizeChanged() +*/ +QSize QWebFrame::contentsSize() const +{ + FrameView *view = d->frame->view(); + if (!view) + return QSize(); + return QSize(view->contentsWidth(), view->contentsHeight()); +} + +/*! + \since 4.6 + + Returns the document element of this frame. + + The document element provides access to the entire structured + content of the frame. +*/ +QWebElement QWebFrame::documentElement() const +{ + WebCore::Document *doc = d->frame->document(); + if (!doc) + return QWebElement(); + return QWebElement(doc->documentElement()); +} + +/*! + \since 4.6 + Returns a new list of elements matching the given CSS selector \a selectorQuery. + If there are no matching elements, an empty list is returned. + + \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is + used for the query. + + \sa QWebElement::findAll() +*/ +QWebElementCollection QWebFrame::findAllElements(const QString &selectorQuery) const +{ + return documentElement().findAll(selectorQuery); +} + +/*! + \since 4.6 + Returns the first element in the frame's document that matches the + given CSS selector \a selectorQuery. If there is no matching element, a + null element is returned. + + \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is + used for the query. + + \sa QWebElement::findFirst() +*/ +QWebElement QWebFrame::findFirstElement(const QString &selectorQuery) const +{ + return documentElement().findFirst(selectorQuery); +} + +/*! + 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, /*ignoreClipping*/ true); + + if (result.scrollbar()) + return QWebHitTestResult(); + + 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 = (qreal)printer->logicalDpiX() / qt_defaultDpi(); + const qreal zoomFactorY = (qreal)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()) { + 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(static_cast<int>(printContext.pageCount()), toPage); + if (toPage < fromPage) { + // if the user entered a page range outside the actual number + // of printable pages, just return + return; + } + + 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) { +#if USE(JSC) + int distance = 0; + JSC::JSValue v = d->frame->script()->executeScript(ScriptSourceCode(scriptSource)).jsValue(); + + rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance); +#elif USE(V8) + QScriptEngine* engine = d->frame->script()->qtScriptEngine(); + if (!engine) + return rc; + rc = engine->evaluate(scriptSource).toVariant(); +#endif + } + 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(const QWebFrame* webFrame) +{ + return webFrame->d->frame; +} + +QWebFrame* QWebFramePrivate::kit(const WebCore::Frame* coreFrame) +{ + return qobject_cast<QWebFrame*>(coreFrame->loader()->networkingContext()->originatingObject()); +} + + +/*! + \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() +*/ + +/*! + \fn void QWebFrame::contentsSizeChanged(const QSize &size) + \since 4.6 + + This signal is emitted when the frame's contents size changes + to \a size. + + \sa contentsSize() +*/ + +/*! + \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() +*/ + +/*! + \fn void QWebFrame::pageChanged() + \since 4.7 + + This signal is emitted when this frame has been moved to a different QWebPage. + + \sa page() +*/ + +/*! + \class QWebHitTestResult + \since 4.4 + \brief The QWebHitTestResult class provides information about the web + page content after a hit test. + + \inmodule QtWebKit + + 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) + , isScrollBar(false) +{ + if (!hitTest.innerNode()) + return; + pos = hitTest.point(); + WebCore::TextDirection dir; + title = hitTest.title(dir); + linkText = hitTest.textContent(); + linkUrl = hitTest.absoluteLinkURL(); + linkTitle = hitTest.titleDisplayString(); + alternateText = hitTest.altDisplayString(); + imageUrl = hitTest.absoluteImageURL(); + innerNode = hitTest.innerNode(); + innerNonSharedNode = hitTest.innerNonSharedNode(); + boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect(true) : IntRect(); + 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); + linkElement = QWebElement(hitTest.URLElement()); + + isContentEditable = hitTest.isContentEditable(); + isContentSelected = hitTest.isSelected(); + isScrollBar = hitTest.scrollbar(); + + if (innerNonSharedNode && innerNonSharedNode->document() + && innerNonSharedNode->document()->frame()) + frame = QWebFramePrivate::kit(innerNonSharedNode->document()->frame()); + + enclosingBlock = QWebElement(WebCore::enclosingBlock(innerNode.get())); +} + +/*! + 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; +} + +/*! + \since 4.6 + Returns the block element that encloses the element hit. + + A block element is an element that is rendered using the + CSS "block" style. This includes for example text + paragraphs. +*/ +QWebElement QWebHitTestResult::enclosingBlockElement() const +{ + if (!d) + return QWebElement(); + return d->enclosingBlock; +} + +/*! + 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; +} + +/*! + \since 4.6 + Returns the element that represents the link. + + \sa linkTargetFrame() +*/ +QWebElement QWebHitTestResult::linkElement() const +{ + if (!d) + return QWebElement(); + return d->linkElement; +} + +/*! + Returns the frame that will load the link if it is activated. + + \sa linkElement() +*/ +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; +} + +/*! + \since 4.6 + Returns the underlying DOM element as QWebElement. +*/ +QWebElement QWebHitTestResult::element() const +{ + if (!d || !d->innerNonSharedNode || !d->innerNonSharedNode->isElementNode()) + return QWebElement(); + + return QWebElement(static_cast<WebCore::Element*>(d->innerNonSharedNode.get())); +} + +/*! + Returns the frame the hit test was executed in. +*/ +QWebFrame *QWebHitTestResult::frame() const +{ + if (!d) + return 0; + return d->frame; +} diff --git a/Source/WebKit/qt/Api/qwebframe.h b/Source/WebKit/qt/Api/qwebframe.h new file mode 100644 index 0000000..8410962 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebframe.h @@ -0,0 +1,242 @@ +/* + 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. +*/ + +#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> +#include <QtNetwork/qnetworkaccessmanager.h> +#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; +class QWebElement; +class QWebElementCollection; +class QWebScriptWorld; + +class DumpRenderTreeSupportQt; +namespace WebCore { + class WidgetPrivate; + class FrameLoaderClientQt; + class ChromeClientQt; + class PlatformLayerProxyQt; +} +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; + QWebElement enclosingBlockElement() const; + QString title() const; + + QString linkText() const; + QUrl linkUrl() const; + QUrl linkTitle() const; + QWebFrame *linkTargetFrame() const; + QWebElement linkElement() const; + + QString alternateText() const; // for img, area, input and applet + + QUrl imageUrl() const; + QPixmap pixmap() const; + + bool isContentEditable() const; + bool isContentSelected() const; + + QWebElement element() 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(QUrl requestedUrl READ requestedUrl) + 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); + ~QWebFrame(); + +public: + QWebPage *page() const; + + void load(const QUrl &url); + void load(const QNetworkRequest &request, + QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, + const QByteArray &body = QByteArray()); + 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; + QUrl requestedUrl() const; + QUrl baseUrl() 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; + QRect scrollBarGeometry(Qt::Orientation orientation) const; + + void scroll(int, int); + QPoint scrollPosition() const; + void setScrollPosition(const QPoint &pos); + + void scrollToAnchor(const QString& anchor); + + enum RenderLayer { + ContentsLayer = 0x10, + ScrollBarLayer = 0x20, + PanIconLayer = 0x40, + + AllLayers = 0xff + }; + + void render(QPainter*); + void render(QPainter*, const QRegion& clip); + void render(QPainter*, RenderLayer layer, const QRegion& clip = QRegion()); + + void setTextSizeMultiplier(qreal factor); + qreal textSizeMultiplier() const; + + qreal zoomFactor() const; + void setZoomFactor(qreal factor); + + bool hasFocus() const; + void setFocus(); + + QPoint pos() const; + QRect geometry() const; + QSize contentsSize() const; + + QWebElement documentElement() const; + QWebElementCollection findAllElements(const QString &selectorQuery) const; + QWebElement findFirstElement(const QString &selectorQuery) 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 + +private Q_SLOTS: + void orientationChanged(); + +Q_SIGNALS: + void javaScriptWindowObjectCleared(); + + void provisionalLoad(); + void titleChanged(const QString &title); + void urlChanged(const QUrl &url); + + void initialLayoutCompleted(); + + void iconChanged(); + + void contentsSizeChanged(const QSize &size); + + void loadStarted(); + void loadFinished(bool ok); + + void pageChanged(); + +private: + friend class QGraphicsWebView; + friend class QWebPage; + friend class QWebPagePrivate; + friend class QWebFramePrivate; + friend class DumpRenderTreeSupportQt; + friend class WebCore::WidgetPrivate; + friend class WebCore::FrameLoaderClientQt; + friend class WebCore::ChromeClientQt; + friend class WebCore::PlatformLayerProxyQt; + QWebFramePrivate *d; +}; + +#endif diff --git a/Source/WebKit/qt/Api/qwebframe_p.h b/Source/WebKit/qt/Api/qwebframe_p.h new file mode 100644 index 0000000..ee8c463 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebframe_p.h @@ -0,0 +1,152 @@ +/* + 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 "GraphicsContext.h" +#include "KURL.h" +#include "PlatformString.h" +#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) +#include "qorientationsensor.h" +#endif +#include "qwebelement.h" +#include "wtf/RefPtr.h" +#include "Frame.h" +#include "ViewportArguments.h" + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) +#include "texmap/TextureMapper.h" +#endif + + +namespace WebCore { + class FrameLoaderClientQt; + class FrameView; + class HTMLFrameOwnerElement; + class Scrollbar; + class TextureMapperContentLayer; +} +class QWebPage; + +class QWebFrameData { +public: + QWebFrameData(WebCore::Page*, WebCore::Frame* parentFrame = 0, + WebCore::HTMLFrameOwnerElement* = 0, + const WTF::String& frameName = WTF::String()); + + WebCore::KURL url; + WTF::String name; + WebCore::HTMLFrameOwnerElement* ownerElement; + WebCore::Page* page; + RefPtr<WebCore::Frame> frame; + WebCore::FrameLoaderClientQt* frameLoaderClient; + + WTF::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) +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + , rootGraphicsLayer(0) +#endif + {} + void init(QWebFrame* qframe, QWebFrameData* frameData); + void setPage(QWebPage*); + + inline QWebFrame *parentFrame() { return qobject_cast<QWebFrame*>(q->parent()); } + + WebCore::Scrollbar* horizontalScrollBar() const; + WebCore::Scrollbar* verticalScrollBar() const; + + static WebCore::Frame* core(const QWebFrame*); + static QWebFrame* kit(const WebCore::Frame*); + + void renderRelativeCoords(WebCore::GraphicsContext*, QWebFrame::RenderLayer, const QRegion& clip); +#if ENABLE(TILED_BACKING_STORE) + void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip); +#endif + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + void renderCompositedLayers(WebCore::GraphicsContext* context, const WebCore::IntRect& clip); +#endif + QWebFrame *q; + Qt::ScrollBarPolicy horizontalScrollBarPolicy; + Qt::ScrollBarPolicy verticalScrollBarPolicy; + WebCore::FrameLoaderClientQt *frameLoaderClient; + WebCore::Frame *frame; + QWebPage *page; + + bool allowsScrolling; + int marginWidth; + int marginHeight; +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + WebCore::TextureMapperContentLayer* rootGraphicsLayer; + OwnPtr<WebCore::TextureMapper> textureMapper; +#endif + +#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) + QtMobility::QOrientationSensor m_orientation; +#endif +}; + +class QWebHitTestResultPrivate { +public: + QWebHitTestResultPrivate() : isContentEditable(false), isContentSelected(false), isScrollBar(false) {} + QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest); + + QPoint pos; + QRect boundingRect; + QWebElement enclosingBlock; + QString title; + QString linkText; + QUrl linkUrl; + QString linkTitle; + QPointer<QWebFrame> linkTargetFrame; + QWebElement linkElement; + QString alternateText; + QUrl imageUrl; + QPixmap pixmap; + bool isContentEditable; + bool isContentSelected; + bool isScrollBar; + QPointer<QWebFrame> frame; + RefPtr<WebCore::Node> innerNode; + RefPtr<WebCore::Node> innerNonSharedNode; +}; + +#endif diff --git a/Source/WebKit/qt/Api/qwebhistory.cpp b/Source/WebKit/qt/Api/qwebhistory.cpp new file mode 100644 index 0000000..a9761de --- /dev/null +++ b/Source/WebKit/qt/Api/qwebhistory.cpp @@ -0,0 +1,560 @@ +/* + 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 "qwebframe_p.h" + +#include "BackForwardListImpl.h" +#include "PlatformString.h" +#include "Image.h" +#include "KURL.h" +#include "Page.h" +#include "PageGroup.h" + +#include <QSharedData> +#include <QDebug> + +enum { + InitialHistoryVersion = 1, + DefaultHistoryVersion = InitialHistoryVersion +}; + +/*! + \class QWebHistoryItem + \since 4.4 + \brief The QWebHistoryItem class represents one item in the history of a QWebPage + + \inmodule QtWebKit + + 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, but \e{explicitly shared}. Changing + a QWebHistoryItem instance by calling setUserData() will change all copies of that + instance. + + \sa QWebHistory, QWebPage::history(), QWebHistoryInterface +*/ + +/*! + Constructs a history item from \a other. The new item and \a other + will share their data, and modifying either this item or \a other will + modify both instances. +*/ +QWebHistoryItem::QWebHistoryItem(const QWebHistoryItem &other) + : d(other.d) +{ +} + +/*! + Assigns the \a other history item to this. This item and \a other + will share their data, and modifying either this item or \a other will + modify both instances. +*/ +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 d->item->originalURL(); + return QUrl(); +} + + +/*! + Returns the URL associated with the history item. + + \sa originalUrl(), title(), lastVisited() +*/ +QUrl QWebHistoryItem::url() const +{ + if (d->item) + return d->item->url(); + 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. + + \note All copies of this item will be modified. + + \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 + + \inmodule QtWebKit + + 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. + + QWebHistory's state can be saved to a QDataStream using the >> operator and loaded + by using the << operator. + + \sa QWebHistoryItem, QWebHistoryInterface, QWebPage +*/ + + +QWebHistory::QWebHistory() + : d(0) +{ +} + +QWebHistory::~QWebHistory() +{ + delete d; +} + +/*! + Clears the history. + + \sa count(), items() +*/ +void QWebHistory::clear() +{ + //shortcut to private BackForwardListImpl + WebCore::BackForwardListImpl* lst = d->lst; + + //clear visited links + WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(lst)->page(); + if (page && page->groupPtr()) + page->groupPtr()->removeVisitedLinks(); + + //if count() == 0 then just return + if (!lst->entries().size()) + return; + + RefPtr<WebCore::HistoryItem> current = lst->currentItem(); + int capacity = lst->capacity(); + lst->setCapacity(0); + + lst->setCapacity(capacity); //revert capacity + lst->addItem(current.get()); //insert old current item + lst->goToItem(current.get()); //and set it as current again + + d->page()->updateNavigationActions(); +} + +/*! + 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 (unsigned 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 (unsigned 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 (unsigned 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() +{ + if (canGoBack()) { + WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page(); + page->goToItem(d->lst->backItem(), 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() +{ + if (canGoForward()) { + WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page(); + page->goToItem(d->lst->forwardItem(), 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) +{ + WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(d->lst)->page(); + page->goToItem(item.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 +{ + QWebHistoryItemPrivate *priv; + if (i < 0 || i >= count()) + priv = new QWebHistoryItemPrivate(0); + else { + WebCore::HistoryItem *item = d->lst->entries()[i].get(); + 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); +} + +/*! + \since 4.6 + \fn QDataStream& operator<<(QDataStream& stream, const QWebHistory& history) + \relates QWebHistory + + \brief The operator<< function streams a history into a data stream. + + It saves the \a history into the specified \a stream. +*/ + +QDataStream& operator<<(QDataStream& target, const QWebHistory& history) +{ + QWebHistoryPrivate* d = history.d; + + int version = DefaultHistoryVersion; + + target << version; + target << history.count() << history.currentItemIndex(); + + const WebCore::HistoryItemVector &items = d->lst->entries(); + for (unsigned i = 0; i < items.size(); i++) + items[i].get()->saveState(target, version); + + return target; +} + +/*! + \fn QDataStream& operator>>(QDataStream& stream, QWebHistory& history) + \relates QWebHistory + \since 4.6 + + \brief The operator>> function loads a history from a data stream. + + Loads a QWebHistory from the specified \a stream into the given \a history. +*/ + +QDataStream& operator>>(QDataStream& source, QWebHistory& history) +{ + QWebHistoryPrivate* d = history.d; + + int version; + + source >> version; + + if (version == 1) { + int count; + int currentIndex; + source >> count >> currentIndex; + + history.clear(); + // only if there are elements + if (count) { + // after clear() is new clear HistoryItem (at the end we had to remove it) + WebCore::HistoryItem* nullItem = d->lst->currentItem(); + for (int i = 0; i < count; i++) { + WTF::PassRefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create(); + item->restoreState(source, version); + d->lst->addItem(item); + } + d->lst->removeItem(nullItem); + // Update the HistoryController. + static_cast<WebCore::BackForwardListImpl*>(history.d->lst)->page()->mainFrame()->loader()->history()->setCurrentItem(history.d->lst->entries()[currentIndex].get()); + history.goToItem(history.itemAt(currentIndex)); + } + } + + d->page()->updateNavigationActions(); + + return source; +} + +QWebPagePrivate* QWebHistoryPrivate::page() +{ + return QWebFramePrivate::kit(static_cast<WebCore::BackForwardListImpl*>(lst)->page()->mainFrame())->page()->handle(); +} + +WebCore::HistoryItem* QWebHistoryItemPrivate::core(const QWebHistoryItem* q) +{ + return q->d->item; +} diff --git a/Source/WebKit/qt/Api/qwebhistory.h b/Source/WebKit/qt/Api/qwebhistory.h new file mode 100644 index 0000000..3456784 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebhistory.h @@ -0,0 +1,116 @@ +/* + 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; + friend class QWebHistoryItemPrivate; + friend class DumpRenderTreeSupportQt; + //friend QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist); + //friend QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist); + 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; + friend QWEBKIT_EXPORT QDataStream& operator>>(QDataStream&, QWebHistory&); + friend QWEBKIT_EXPORT QDataStream& operator<<(QDataStream&, const QWebHistory&); + + Q_DISABLE_COPY(QWebHistory) + + QWebHistoryPrivate *d; +}; + +QWEBKIT_EXPORT QDataStream& operator<<(QDataStream& stream, const QWebHistory& history); +QWEBKIT_EXPORT QDataStream& operator>>(QDataStream& stream, QWebHistory& history); + +#endif diff --git a/Source/WebKit/qt/Api/qwebhistory_p.h b/Source/WebKit/qt/Api/qwebhistory_p.h new file mode 100644 index 0000000..44793b9 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebhistory_p.h @@ -0,0 +1,71 @@ +/* + 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 "BackForwardListImpl.h" +#include "HistoryItem.h" +#include <QtCore/qglobal.h> +#include <QtCore/qshareddata.h> + +class QWebPagePrivate; + +class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData { +public: + static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem* q) + { + return q->d; + } + QWebHistoryItemPrivate(WebCore::HistoryItem* i) + { + if (i) + i->ref(); + item = i; + } + ~QWebHistoryItemPrivate() + { + if (item) + item->deref(); + } + + static WebCore::HistoryItem* core(const QWebHistoryItem* q); + + WebCore::HistoryItem* item; +}; + +class QWebHistoryPrivate : public QSharedData { +public: + QWebHistoryPrivate(WebCore::BackForwardListImpl* l) + { + l->ref(); + lst = l; + } + ~QWebHistoryPrivate() + { + lst->deref(); + } + + QWebPagePrivate* page(); + + WebCore::BackForwardListImpl* lst; +}; + + +#endif diff --git a/Source/WebKit/qt/Api/qwebhistoryinterface.cpp b/Source/WebKit/qt/Api/qwebhistoryinterface.cpp new file mode 100644 index 0000000..61cf5af --- /dev/null +++ b/Source/WebKit/qt/Api/qwebhistoryinterface.cpp @@ -0,0 +1,127 @@ +/* + 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()) + delete default_interface; + default_interface = 0; +} + +/*! + Sets a new default interface, \a defaultInterface, that will be used by all of WebKit + to keep track of visited links. + + 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()) + 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, + Webkit will not keep track of visited links and a null pointer will be returned. + \sa setDefaultInterface +*/ +QWebHistoryInterface* QWebHistoryInterface::defaultInterface() +{ + return default_interface; +} + +/*! + \class QWebHistoryInterface + \since 4.4 + \brief The QWebHistoryInterface class provides an interface to implement link history. + + \inmodule QtWebKit + + The QWebHistoryInterface is an interface that can be used to + keep track of visited links. It contains two pure virtual methods that + are called by the WebKit engine: addHistoryEntry() is used to add + urls that have been visited to the interface, while + historyContains() is used to query whether the given url has been + visited by the user. By default the QWebHistoryInterface is not set, so WebKit does not keep + track of visited links. + + \note The history tracked by QWebHistoryInterface is not specific to an instance of QWebPage + but applies to all pages. +*/ + +/*! + Constructs a new QWebHistoryInterface with parent \a parent. +*/ +QWebHistoryInterface::QWebHistoryInterface(QObject* parent) + : QObject(parent) +{ +} + +/*! + Destroys the interface. 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/Source/WebKit/qt/Api/qwebhistoryinterface.h b/Source/WebKit/qt/Api/qwebhistoryinterface.h new file mode 100644 index 0000000..a49c586 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebhistoryinterface.h @@ -0,0 +1,42 @@ +/* + 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/Source/WebKit/qt/Api/qwebinspector.cpp b/Source/WebKit/qt/Api/qwebinspector.cpp new file mode 100644 index 0000000..6706f2a --- /dev/null +++ b/Source/WebKit/qt/Api/qwebinspector.cpp @@ -0,0 +1,231 @@ +/* + 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. +*/ + +#include "config.h" +#include "qwebinspector.h" + +#include "Element.h" +#include "InspectorController.h" +#include "qwebelement.h" +#include "qwebinspector_p.h" +#include "qwebpage_p.h" + +#include <QResizeEvent> + +/*! + \class QWebInspector + \since 4.6 + \inmodule QtWebKit + \brief The QWebInspector class allows the placement and control of a + QWebPage's inspector. + The inspector can display a page's hierarchy, its loading statistics and + the current state of its individual elements. It is mostly used by web + developers. + + The QWebPage to be inspected must be specified using the setPage() method. + + A typical use of QWebInspector follows: + + \snippet webkitsnippets/qtwebkit_qwebinspector_snippet.cpp 0 + + A QWebInspector can be made visible either programmatically using + setVisible(), or by the user through the attached QWebPage's context + menu. + + \note A QWebInspector will display a blank widget if either: + \list + \o page() is null + \o QWebSettings::DeveloperExtrasEnabled is false + \endlist + + \section1 Resources + + This class acts mostly as a container and a controller for the inspector. + Most of the resources needed by the inspector are owned by the associated + QWebPage and are allocated the first time that: + \list + \o an element is inspected + \o the QWebInspector is shown. + \endlist + + \section1 Inspector configuration persistence + + The inspector allows the user to configure some options through its + user interface (e.g. the resource tracking "Always enable" option). + These settings will be persisted automatically by QtWebKit only if + your application previously called QCoreApplication::setOrganizationName() + and QCoreApplication::setApplicationName(). + See QSettings's default constructor documentation for an explanation + of why this is necessary. +*/ + +/*! + Constructs an unbound QWebInspector with \a parent as its parent. +*/ +QWebInspector::QWebInspector(QWidget* parent) + : QWidget(parent) + , d(new QWebInspectorPrivate(this)) +{ +} + +/*! + Destroys the inspector. +*/ +QWebInspector::~QWebInspector() +{ + // Remove association principally to prevent deleting a child frontend + setPage(0); + delete d; + d = 0; +} + +/*! + Bind this inspector to the QWebPage to be inspected. + + \bold {Notes:} + \list + \o There can only be one QWebInspector associated with a QWebPage + and vice versa. + \o Calling this method with a null \a page will break the current association, if any. + \o If \a page is already associated to another QWebInspector, the association + will be replaced and the previous QWebInspector will become unbound + \endlist + + \sa page() +*/ +void QWebInspector::setPage(QWebPage* page) +{ + if (d->page) { + // Break currentPage-->this + d->page->d->setInspector(0); + } + if (page && page->d->inspector && page->d->inspector != this) { + // Break newPage<->newPageCurrentInspector + page->d->inspector->setPage(0); + } + + d->page = page; + + if (page) { + // Setup the reciprocal association + page->d->setInspector(this); + } +} + +/*! + Returns the inspected QWebPage. + If no web page is currently associated, a null pointer is returned. +*/ +QWebPage* QWebInspector::page() const +{ + return d->page; +} + +/*! \reimp */ +QSize QWebInspector::sizeHint() const +{ + return QSize(450, 300); +} + +/*! \reimp */ +bool QWebInspector::event(QEvent* ev) +{ + return QWidget::event(ev); +} + +/*! \reimp */ +void QWebInspector::resizeEvent(QResizeEvent* event) +{ + d->adjustFrontendSize(event->size()); +} + +/*! \reimp */ +void QWebInspector::showEvent(QShowEvent* event) +{ +#if ENABLE(INSPECTOR) + // Allows QWebInspector::show() to init the inspector. + if (d->page) + d->page->d->inspectorController()->show(); +#endif +} + +/*! \reimp */ +void QWebInspector::hideEvent(QHideEvent* event) +{ +#if ENABLE(INSPECTOR) + if (d->page) + d->page->d->inspectorController()->close(); +#endif +} + +/*! \reimp */ +void QWebInspector::closeEvent(QCloseEvent* event) +{ +#if ENABLE(INSPECTOR) + if (d->page) + d->page->d->inspectorController()->close(); +#endif +} + +/*! \internal */ +void QWebInspectorPrivate::setFrontend(QWidget* newFrontend) +{ + if (frontend) + frontend->setParent(0); + + frontend = newFrontend; + + if (frontend) { + frontend->setParent(q); + frontend->show(); + adjustFrontendSize(q->size()); + } +} + +/*! + * \internal + */ +void QWebInspectorPrivate::attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend) +{ + if (remoteFrontend) + remoteFrontend->setParent(0); + + remoteFrontend = newRemoteFrontend; + + if (remoteFrontend) + remoteFrontend->setParent(q); +} + +/*! + * \internal + */ +void QWebInspectorPrivate::detachRemoteFrontend() +{ + if (remoteFrontend) { + remoteFrontend->deleteLater(); + remoteFrontend = 0; + } +} + +void QWebInspectorPrivate::adjustFrontendSize(const QSize& size) +{ + if (frontend) + frontend->resize(size); +} + diff --git a/Source/WebKit/qt/Api/qwebinspector.h b/Source/WebKit/qt/Api/qwebinspector.h new file mode 100644 index 0000000..f192e92 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebinspector.h @@ -0,0 +1,57 @@ +/* + 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. +*/ + +#ifndef QWEBINSPECTOR_H +#define QWEBINSPECTOR_H + +#include "qwebkitglobal.h" +#include "qwebpage.h" + +#include "qwebview.h" + +class QWebInspectorPrivate; + +class QWEBKIT_EXPORT QWebInspector : public QWidget { + Q_OBJECT +public: + QWebInspector(QWidget* parent = 0); + ~QWebInspector(); + + void setPage(QWebPage* page); + QWebPage* page() const; + + QSize sizeHint() const; + bool event(QEvent*); + +protected: + void resizeEvent(QResizeEvent* event); + void showEvent(QShowEvent* event); + void hideEvent(QHideEvent* event); + void closeEvent(QCloseEvent* event); + +private: + QWebInspectorPrivate* d; + + friend class QWebInspectorPrivate; + friend class QWebPage; + friend class QWebPagePrivate; + friend class WebCore::InspectorClientQt; + friend class WebCore::InspectorFrontendClientQt; +}; +#endif diff --git a/Source/WebKit/qt/Api/qwebinspector_p.h b/Source/WebKit/qt/Api/qwebinspector_p.h new file mode 100644 index 0000000..3099eb1 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebinspector_p.h @@ -0,0 +1,50 @@ +/* + 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. +*/ + +#ifndef QWEBINSPECTOR_P_H +#define QWEBINSPECTOR_P_H + +QT_BEGIN_NAMESPACE +class QSize; +class QWidget; +QT_END_NAMESPACE +class QWebInspector; +class QWebPage; + +class QWebInspectorPrivate { +public: + QWebInspectorPrivate(QWebInspector* qq) + : q(qq) + , page(0) + , frontend(0) + , remoteFrontend(0) + {} + + void setFrontend(QWidget* newFrontend); + void attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend); + void detachRemoteFrontend(); + void adjustFrontendSize(const QSize& size); + + QWebInspector* q; + QWebPage* page; + QWidget* frontend; + QObject* remoteFrontend; +}; + +#endif diff --git a/Source/WebKit/qt/Api/qwebkitglobal.h b/Source/WebKit/qt/Api/qwebkitglobal.h new file mode 100644 index 0000000..7ee56de --- /dev/null +++ b/Source/WebKit/qt/Api/qwebkitglobal.h @@ -0,0 +1,49 @@ +/* + 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> + +#define QTWEBKIT_VERSION_STR "2.2.0" +// QTWEBKIT_VERSION is (major << 16) + (minor << 8) + patch. Similar to Qt. +#define QTWEBKIT_VERSION 0x020200 +// Use: #if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 0, 0)). Similar to Qt. +#define QTWEBKIT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) + +#if defined(QT_MAKEDLL) /* create a Qt DLL library */ +# if defined(BUILDING_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 + +#if !defined(QWEBKIT_EXPORT) +# if defined(QT_SHARED) +# define QWEBKIT_EXPORT Q_DECL_EXPORT +# else +# define QWEBKIT_EXPORT +# endif +#endif + +#endif // QWEBKITGLOBAL_H diff --git a/Source/WebKit/qt/Api/qwebkitplatformplugin.h b/Source/WebKit/qt/Api/qwebkitplatformplugin.h new file mode 100644 index 0000000..2a94e0c --- /dev/null +++ b/Source/WebKit/qt/Api/qwebkitplatformplugin.h @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2010 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 QWEBKITPLATFORMPLUGIN_H +#define QWEBKITPLATFORMPLUGIN_H + +/* + * Warning: The contents of this file is not part of the public QtWebKit API + * and may be changed from version to version or even be completely removed. +*/ + +#include <QObject> +#include <QUrl> +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#include <QMediaPlayer> +#endif + +class QWebSelectData +{ +public: + virtual ~QWebSelectData() {} + + enum ItemType { Option, Group, Separator }; + + virtual ItemType itemType(int) const = 0; + virtual QString itemText(int index) const = 0; + virtual QString itemToolTip(int index) const = 0; + virtual bool itemIsEnabled(int index) const = 0; + virtual bool itemIsSelected(int index) const = 0; + virtual int itemCount() const = 0; + virtual bool multiple() const = 0; +}; + +class QWebSelectMethod : public QObject +{ + Q_OBJECT +public: + virtual ~QWebSelectMethod() {} + + virtual void show(const QWebSelectData&) = 0; + virtual void hide() = 0; + +Q_SIGNALS: + void selectItem(int index, bool allowMultiplySelections, bool shift); + void didHide(); +}; + +class QWebNotificationData +{ +public: + virtual ~QWebNotificationData() {} + + virtual const QString title() const = 0; + virtual const QString message() const = 0; + virtual const QByteArray iconData() const = 0; + virtual const QUrl openerPageUrl() const = 0; +}; + +class QWebNotificationPresenter : public QObject +{ + Q_OBJECT +public: + QWebNotificationPresenter() {} + virtual ~QWebNotificationPresenter() {} + + virtual void showNotification(const QWebNotificationData*) = 0; + +Q_SIGNALS: + void notificationClosed(); + void notificationClicked(); +}; + +class QWebHapticFeedbackPlayer: public QObject +{ + Q_OBJECT +public: + QWebHapticFeedbackPlayer() {} + virtual ~QWebHapticFeedbackPlayer() {} + + enum HapticStrength { + None, Weak, Medium, Strong + }; + + enum HapticEvent { + Press, Release + }; + + virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0; +}; + +class QWebTouchModifier : public QObject +{ + Q_OBJECT +public: + virtual ~QWebTouchModifier() {} + + enum PaddingDirection { + Up, Right, Down, Left + }; + + virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0; +}; + +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +class QWebFullScreenVideoHandler : public QObject { + Q_OBJECT +public: + QWebFullScreenVideoHandler() {} + virtual ~QWebFullScreenVideoHandler() {} + virtual bool requiresFullScreenForVideoPlayback() const = 0; + +Q_SIGNALS: + void fullScreenClosed(); + +public Q_SLOTS: + virtual void enterFullScreen(QMediaPlayer*) = 0; + virtual void exitFullScreen() = 0; +}; +#endif + +class QWebKitPlatformPlugin +{ +public: + virtual ~QWebKitPlatformPlugin() {} + + enum Extension { + MultipleSelections, + Notifications, + Haptics, + TouchInteraction, + FullScreenVideoPlayer + }; + + virtual bool supportsExtension(Extension extension) const = 0; + virtual QObject* createExtension(Extension extension) const = 0; +}; + +QT_BEGIN_NAMESPACE +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.7"); +QT_END_NAMESPACE + +#endif // QWEBKITPLATFORMPLUGIN_H diff --git a/Source/WebKit/qt/Api/qwebkitversion.cpp b/Source/WebKit/qt/Api/qwebkitversion.cpp new file mode 100644 index 0000000..181913b --- /dev/null +++ b/Source/WebKit/qt/Api/qwebkitversion.cpp @@ -0,0 +1,114 @@ +/* + Copyright (C) 2009 Robert Hogan <robert@roberthogan.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. +*/ + +#include "config.h" +#include <qwebkitversion.h> +#include <WebKitVersion.h> + +/*! + \relates QWebPage + \since 4.6 + Returns the version number of WebKit at run-time as a string (for + example, "531.3"). + + This version is commonly used in WebKit based browsers as part + of the user agent string. Web servers and JavaScript might use + it to identify the presence of certain WebKit engine features + and behaviour. + + The evolution of this version is bound to the releases of Apple's + Safari browser. For a version specific to the QtWebKit library, + see QTWEBKIT_VERSION + + \sa QWebPage::userAgentForUrl() +*/ +QString qWebKitVersion() +{ + return QString("%1.%2").arg(WEBKIT_MAJOR_VERSION).arg(WEBKIT_MINOR_VERSION); +} + +/*! + \relates QWebPage + \since 4.6 + Returns the 'major' version number of WebKit at run-time as an integer + (for example, 531). This is the version of WebKit the application + was compiled against. + + \sa qWebKitVersion() +*/ +int qWebKitMajorVersion() +{ + return WEBKIT_MAJOR_VERSION; +} + +/*! + \relates QWebPage + \since 4.6 + Returns the 'minor' version number of WebKit at run-time as an integer + (for example, 3). This is the version of WebKit the application + was compiled against. + + \sa qWebKitVersion() +*/ +int qWebKitMinorVersion() +{ + return WEBKIT_MINOR_VERSION; +} + +/*! + \macro QTWEBKIT_VERSION + \relates QWebPage + + This macro expands a numeric value of the form 0xMMNNPP (MM = + major, NN = minor, PP = patch) that specifies QtWebKit's version + number. For example, if you compile your application against QtWebKit + 2.1.2, the QTWEBKIT_VERSION macro will expand to 0x020102. + + You can use QTWEBKIT_VERSION to use the latest QtWebKit API where + available. + + \sa QT_VERSION +*/ + +/*! + \macro QTWEBKIT_VERSION_STR + \relates QWebPage + + This macro expands to a string that specifies QtWebKit's version number + (for example, "2.1.2"). This is the version against which the + application is compiled. + + \sa QTWEBKIT_VERSION +*/ + +/*! + \macro QTWEBKIT_VERSION_CHECK + \relates QWebPage + + Turns the major, minor and patch numbers of a version into an + integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can + be compared with another similarly processed version id, for example + in a preprocessor statement: + + \code + #if QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 1, 0) + // code to use API new in QtWebKit 2.1.0 + #endif + \endcode +*/ diff --git a/Source/WebKit/qt/Api/qwebkitversion.h b/Source/WebKit/qt/Api/qwebkitversion.h new file mode 100644 index 0000000..de79dd1 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebkitversion.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2009 Robert Hogan <robert@roberthogan.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. +*/ + +#include <QtCore/qstring.h> + +#ifndef qwebkitversion_h +#define qwebkitversion_h + +#include <QtCore/qstring.h> +#include "qwebkitglobal.h" + +QWEBKIT_EXPORT QString qWebKitVersion(); +QWEBKIT_EXPORT int qWebKitMajorVersion(); +QWEBKIT_EXPORT int qWebKitMinorVersion(); + +#endif // qwebkitversion_h diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp new file mode 100644 index 0000000..e80aac5 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebpage.cpp @@ -0,0 +1,4210 @@ +/* + 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 "qwebinspector.h" +#include "qwebinspector_p.h" +#include "qwebsettings.h" +#include "qwebkitplatformplugin.h" +#include "qwebkitversion.h" + +#include "CSSComputedStyleDeclaration.h" +#include "CSSParser.h" +#include "ApplicationCacheStorage.h" +#include "BackForwardListImpl.h" +#include "MemoryCache.h" +#include "Chrome.h" +#include "ChromeClientQt.h" +#include "ClientRect.h" +#include "ContextMenu.h" +#include "ContextMenuClientQt.h" +#include "ContextMenuController.h" +#include "DeviceMotionClientQt.h" +#include "DeviceOrientationClientQt.h" +#include "DocumentLoader.h" +#include "DragClientQt.h" +#include "DragController.h" +#include "DragData.h" +#include "Editor.h" +#include "EditorClientQt.h" +#include "FocusController.h" +#include "FormState.h" +#include "Frame.h" +#include "FrameLoadRequest.h" +#include "FrameLoader.h" +#include "FrameLoader.h" +#include "FrameLoaderClientQt.h" +#include "FrameTree.h" +#include "FrameView.h" +#include "GeolocationPermissionClientQt.h" +#include "HTMLFormElement.h" +#include "HTMLFrameOwnerElement.h" +#include "HTMLInputElement.h" +#include "HTMLNames.h" +#include "HashMap.h" +#include "HitTestResult.h" +#include "Image.h" +#include "InspectorClientQt.h" +#include "InspectorController.h" +#include "InspectorServerQt.h" +#include "KURL.h" +#include "LocalizedStrings.h" +#include "Logging.h" +#include "MIMETypeRegistry.h" +#include "NavigationAction.h" +#include "NetworkingContext.h" +#include "NodeList.h" +#include "NotificationPresenterClientQt.h" +#include "NotImplemented.h" +#include "Page.h" +#include "PageClientQt.h" +#include "PageGroup.h" +#include "Pasteboard.h" +#include "PlatformKeyboardEvent.h" +#include "PlatformTouchEvent.h" +#include "PlatformWheelEvent.h" +#include "PluginDatabase.h" +#include "PluginDatabase.h" +#include "PluginPackage.h" +#include "ProgressTracker.h" +#include "QtPlatformPlugin.h" +#include "RefPtr.h" +#include "RenderTextControl.h" +#include "SchemeRegistry.h" +#include "Scrollbar.h" +#include "SecurityOrigin.h" +#include "Settings.h" +#include "TextIterator.h" +#include "WebPlatformStrategies.h" +#include "WindowFeatures.h" +#include "WorkerThread.h" +#include "runtime/InitializeThreading.h" +#include "wtf/Threading.h" + +#include <QApplication> +#include <QBasicTimer> +#include <QBitArray> +#include <QDebug> +#include <QDesktopWidget> +#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> +#include <QTextCharFormat> +#include <QTextDocument> +#include <QTouchEvent> +#include <QNetworkAccessManager> +#include <QNetworkRequest> +#if defined(Q_WS_X11) +#include <QX11Info> +#endif + + +using namespace WebCore; + +// from text/qfont.cpp +QT_BEGIN_NAMESPACE +extern Q_GUI_EXPORT int qt_defaultDpi(); +QT_END_NAMESPACE + +bool QWebPagePrivate::drtRun = false; + +// 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, // ReloadAndBypassCache, + + "PasteAndMatchStyle", // PasteAndMatchStyle + "RemoveFormat", // RemoveFormat + "Strikethrough", // ToggleStrikethrough, + "Subscript", // ToggleSubscript + "Superscript", // ToggleSuperscript + "InsertUnorderedList", // InsertUnorderedList + "InsertOrderedList", // InsertOrderedList + "Indent", // Indent + "Outdent", // Outdent, + + "AlignCenter", // AlignCenter, + "AlignJustified", // AlignJustified, + "AlignLeft", // AlignLeft, + "AlignRight", // AlignRight, + + 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; +} + +static inline DragOperation dropActionToDragOp(Qt::DropActions actions) +{ + unsigned result = 0; + if (actions & Qt::CopyAction) + result |= DragOperationCopy; + // DragOperationgeneric represents InternetExplorer's equivalent of Move operation, + // hence it should be considered as "move" + if (actions & Qt::MoveAction) + result |= (DragOperationMove | DragOperationGeneric); + 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; + // DragOperationgeneric represents InternetExplorer's equivalent of Move operation, + // hence it should be considered as "move" + else if (actions & DragOperationGeneric) + result = Qt::MoveAction; + else if (actions & DragOperationLink) + result = Qt::LinkAction; + return result; +} + +QWebPagePrivate::QWebPagePrivate(QWebPage *qq) + : q(qq) + , page(0) + , client(0) + , mainFrame(0) +#ifndef QT_NO_UNDOSTACK + , undoStack(0) +#endif + , insideOpenCall(false) + , m_totalBytes(0) + , m_bytesReceived() + , clickCausedFocus(false) + , networkManager(0) + , forwardUnsupportedContent(false) + , smartInsertDeleteEnabled(true) + , selectTrailingWhitespaceEnabled(false) + , linkPolicy(QWebPage::DontDelegateLinks) + , viewportSize(QSize(0, 0)) + , pixelRatio(1) +#ifndef QT_NO_CONTEXTMENU + , currentContextMenu(0) +#endif + , settings(0) + , editable(false) + , useFixedLayout(false) + , pluginFactory(0) + , inspectorFrontend(0) + , inspector(0) + , inspectorIsInternalOnly(false) +{ + WebCore::InitializeLoggingChannelsIfNecessary(); + ScriptController::initializeThreading(); + WTF::initializeMainThread(); + WebCore::SecurityOrigin::setLocalLoadPolicy(WebCore::SecurityOrigin::AllowLocalLoadsForLocalAndSubstituteData); +#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0) + WebCore::Font::setCodePath(WebCore::Font::Complex); +#endif + + WebPlatformStrategies::initialize(); + + Page::PageClients pageClients; + pageClients.chromeClient = new ChromeClientQt(q); + pageClients.contextMenuClient = new ContextMenuClientQt(); + pageClients.editorClient = new EditorClientQt(q); + pageClients.dragClient = new DragClientQt(q); + pageClients.inspectorClient = new InspectorClientQt(q); +#if ENABLE(DEVICE_ORIENTATION) + pageClients.deviceOrientationClient = new DeviceOrientationClientQt(q); + pageClients.deviceMotionClient = new DeviceMotionClientQt(q); +#endif + page = new Page(pageClients); + + settings = new QWebSettings(page->settings()); + + history.d = new QWebHistoryPrivate(static_cast<WebCore::BackForwardListImpl*>(page->backForwardList())); + memset(actions, 0, sizeof(actions)); + + PageGroup::setShouldTrackVisitedLinks(true); + +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::notificationPresenter()->addClient(); +#endif +} + +QWebPagePrivate::~QWebPagePrivate() +{ + if (inspector && inspectorIsInternalOnly) { + // Since we have to delete an internal inspector, + // call setInspector(0) directly to prevent potential crashes + setInspector(0); + } +#ifndef QT_NO_CONTEXTMENU + delete currentContextMenu; +#endif +#ifndef QT_NO_UNDOSTACK + delete undoStack; +#endif + delete settings; + delete page; + + if (inspector) + inspector->setPage(0); + +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::notificationPresenter()->removeClient(); +#endif +} + +WebCore::ViewportArguments QWebPagePrivate::viewportArguments() +{ + return page ? page->viewportArguments() : WebCore::ViewportArguments(); +} + +WebCore::Page* QWebPagePrivate::core(const QWebPage* page) +{ + return page->d->page; +} + +QWebPagePrivate* QWebPagePrivate::priv(QWebPage* page) +{ + return page->d; +} + +bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type) +{ + if (insideOpenCall + && frame == mainFrame) + return true; + return q->acceptNavigationRequest(frame, request, type); +} + +void QWebPagePrivate::createMainFrame() +{ + if (!mainFrame) { + QWebFrameData frameData(page); + 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::ContextMenuItemTagSelectAll: return QWebPage::SelectAll; +#if ENABLE(INSPECTOR) + case WebCore::ContextMenuItemTagInspectElement: return QWebPage::InspectElement; +#endif + default: break; + } + return QWebPage::NoWebAction; +} + +#ifndef QT_NO_CONTEXTMENU +QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMenu, + const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions) +{ + if (!client) + return 0; + + QMenu* menu = new QMenu(client->ownerWidget()); + 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); + page->contextMenuController()->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 + +#ifndef QT_NO_ACTION +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); +} +#endif // QT_NO_ACTION + +void QWebPagePrivate::_q_cleanupLeakMessages() +{ +#ifndef NDEBUG + // Need this to make leak messages accurate. + memoryCache()->setCapacities(0, 0, 0); +#endif +} + +void QWebPagePrivate::updateAction(QWebPage::WebAction action) +{ +#ifdef QT_NO_ACTION + Q_UNUSED(action) +#else + 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 = page->canGoBackOrForward(-1); + break; + case QWebPage::Forward: + enabled = page->canGoBackOrForward(1); + break; + case QWebPage::Stop: + enabled = loader->isLoading(); + break; + case QWebPage::Reload: + case QWebPage::ReloadAndBypassCache: + enabled = !loader->isLoading(); + break; +#ifndef QT_NO_UNDOSTACK + case QWebPage::Undo: + case QWebPage::Redo: + // those two are handled by QUndoStack + break; +#endif // QT_NO_UNDOSTACK + case QWebPage::SelectAll: // editor command is always enabled + break; + case QWebPage::SetTextDirectionDefault: + case QWebPage::SetTextDirectionLeftToRight: + case QWebPage::SetTextDirectionRightToLeft: + enabled = editor->canEdit(); + checked = false; + break; + default: { + // see if it's an editor command + const char* commandName = editorCommandForWebActions(action); + + // if it's an editor command, let it's logic determine state + if (commandName) { + Editor::Command command = editor->command(commandName); + enabled = command.isEnabled(); + if (enabled) + checked = command.state() != FalseTriState; + else + checked = false; + } + break; + } + } + + a->setEnabled(enabled); + + if (a->isCheckable()) + a->setChecked(checked); +#endif // QT_NO_ACTION +} + +void QWebPagePrivate::updateNavigationActions() +{ + updateAction(QWebPage::Back); + updateAction(QWebPage::Forward); + updateAction(QWebPage::Stop); + updateAction(QWebPage::Reload); + updateAction(QWebPage::ReloadAndBypassCache); +} + +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); + updateAction(QWebPage::InsertParagraphSeparator); + updateAction(QWebPage::InsertLineSeparator); + updateAction(QWebPage::PasteAndMatchStyle); + updateAction(QWebPage::RemoveFormat); + updateAction(QWebPage::ToggleStrikethrough); + updateAction(QWebPage::ToggleSubscript); + updateAction(QWebPage::ToggleSuperscript); + updateAction(QWebPage::InsertUnorderedList); + updateAction(QWebPage::InsertOrderedList); + updateAction(QWebPage::Indent); + updateAction(QWebPage::Outdent); + updateAction(QWebPage::AlignCenter); + updateAction(QWebPage::AlignJustified); + updateAction(QWebPage::AlignLeft); + updateAction(QWebPage::AlignRight); +} + +void QWebPagePrivate::timerEvent(QTimerEvent *ev) +{ + int timerId = ev->timerId(); + if (timerId == tripleClickTimer.timerId()) + tripleClickTimer.stop(); + else + q->timerEvent(ev); +} + +template<class T> +void QWebPagePrivate::mouseMoveEvent(T* ev) +{ + WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); + if (!frame->view()) + return; + + bool accepted = frame->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0)); + ev->setAccepted(accepted); +} + +template<class T> +void QWebPagePrivate::mousePressEvent(T* ev) +{ + WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); + if (!frame->view()) + return; + + RefPtr<WebCore::Node> oldNode; + Frame* focusedFrame = page->focusController()->focusedFrame(); + if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0) + oldNode = focusedDocument->focusedNode(); + + if (tripleClickTimer.isActive() + && (ev->pos() - tripleClick).manhattanLength() + < QApplication::startDragDistance()) { + mouseTripleClickEvent(ev); + return; + } + + bool accepted = false; + adjustPointForClicking(ev); + 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); + + RefPtr<WebCore::Node> newNode; + focusedFrame = page->focusController()->focusedFrame(); + if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0) + newNode = focusedDocument->focusedNode(); + + if (newNode && oldNode != newNode) + clickCausedFocus = true; +} + +template<class T> +void QWebPagePrivate::mouseDoubleClickEvent(T *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 = QPointF(ev->pos()).toPoint(); +} + +template<class T> +void QWebPagePrivate::mouseTripleClickEvent(T *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::handleClipboard(QEvent* ev, Qt::MouseButton button) +{ +#ifndef QT_NO_CLIPBOARD + if (QApplication::clipboard()->supportsSelection()) { + bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); + Pasteboard::generalPasteboard()->setSelectionMode(true); + WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame(); + if (button == Qt::LeftButton) { + if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) { + focusFrame->editor()->copy(); + ev->setAccepted(true); + } + } else if (button == Qt::MidButton) { + if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) { + focusFrame->editor()->paste(); + ev->setAccepted(true); + } + } + Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); + } +#endif +} + +template<class T> +void QWebPagePrivate::mouseReleaseEvent(T *ev) +{ + WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); + if (!frame->view()) + return; + + bool accepted = false; + adjustPointForClicking(ev); + 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); + + handleClipboard(ev, ev->button()); + handleSoftwareInputPanel(ev->button(), QPointF(ev->pos()).toPoint()); +} + +void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button, const QPoint& pos) +{ + Frame* frame = page->focusController()->focusedFrame(); + if (!frame) + return; + + if (client && client->inputMethodEnabled() + && frame->document()->focusedNode() + && button == Qt::LeftButton && qApp->autoSipEnabled()) { + QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( + client->ownerWidget()->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); + if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { + HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(pos), false); + if (result.isContentEditable()) { + QEvent event(QEvent::RequestSoftwareInputPanel); + QApplication::sendEvent(client->ownerWidget(), &event); + } + } + } + + clickCausedFocus = false; +} + +#ifndef QT_NO_CONTEXTMENU +void QWebPagePrivate::contextMenuEvent(const QPoint& globalPos) +{ + QMenu *menu = q->createStandardContextMenu(); + if (menu) { + menu->exec(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 +template<class T> +void QWebPagePrivate::wheelEvent(T *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 }, + { QKeySequence::InsertParagraphSeparator, QWebPage::InsertParagraphSeparator }, + { QKeySequence::InsertLineSeparator, QWebPage::InsertLineSeparator }, + { 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(); + // 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; + if (!handleScrolling(ev, frame)) { + switch (ev->key()) { + case Qt::Key_Back: + q->triggerAction(QWebPage::Back); + break; + case Qt::Key_Forward: + q->triggerAction(QWebPage::Forward); + break; + case Qt::Key_Stop: + q->triggerAction(QWebPage::Stop); + break; + case Qt::Key_Refresh: + q->triggerAction(QWebPage::Reload); + break; + case Qt::Key_Backspace: + if (ev->modifiers() == Qt::ShiftModifier) + q->triggerAction(QWebPage::Forward); + else + q->triggerAction(QWebPage::Back); + break; + 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*) +{ + FocusController *focusController = page->focusController(); + focusController->setActive(true); + focusController->setFocused(true); + if (!focusController->focusedFrame()) + focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame)); +} + +void QWebPagePrivate::focusOutEvent(QFocusEvent*) +{ + // 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(); + // Call setFocused first so that window.onblur doesn't get called twice + focusController->setFocused(false); + focusController->setActive(false); +} + +template<class T> +void QWebPagePrivate::dragEnterEvent(T* ev) +{ +#ifndef QT_NO_DRAGANDDROP + DragData dragData(ev->mimeData(), QPointF(ev->pos()).toPoint(), + QCursor::pos(), dropActionToDragOp(ev->possibleActions())); + Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData)); + ev->setDropAction(action); + if (action != Qt::IgnoreAction) + ev->acceptProposedAction(); +#endif +} + +template<class T> +void QWebPagePrivate::dragLeaveEvent(T *ev) +{ +#ifndef QT_NO_DRAGANDDROP + DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); + page->dragController()->dragExited(&dragData); + ev->accept(); +#endif +} + +template<class T> +void QWebPagePrivate::dragMoveEvent(T *ev) +{ +#ifndef QT_NO_DRAGANDDROP + DragData dragData(ev->mimeData(), QPointF(ev->pos()).toPoint(), + QCursor::pos(), dropActionToDragOp(ev->possibleActions())); + Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData)); + ev->setDropAction(action); + if (action != Qt::IgnoreAction) + ev->acceptProposedAction(); +#endif +} + +template<class T> +void QWebPagePrivate::dropEvent(T *ev) +{ +#ifndef QT_NO_DRAGANDDROP + DragData dragData(ev->mimeData(), QPointF(ev->pos()).toPoint(), + QCursor::pos(), dropActionToDragOp(ev->possibleActions())); + if (page->dragController()->performDrag(&dragData)) + ev->acceptProposedAction(); +#endif +} + +void QWebPagePrivate::leaveEvent(QEvent*) +{ + // 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; + } + + Node* node = 0; + if (frame->selection()->rootEditableElement()) + node = frame->selection()->rootEditableElement()->shadowAncestorNode(); + + Vector<CompositionUnderline> underlines; + bool hasSelection = false; + + for (int i = 0; i < ev->attributes().size(); ++i) { + const QInputMethodEvent::Attribute& a = ev->attributes().at(i); + switch (a.type) { + case QInputMethodEvent::TextFormat: { + QTextCharFormat textCharFormat = a.value.value<QTextFormat>().toCharFormat(); + QColor qcolor = textCharFormat.underlineColor(); + underlines.append(CompositionUnderline(qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length)), Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())), false)); + break; + } + case QInputMethodEvent::Cursor: { + frame->selection()->setCaretVisible(a.length); //if length is 0 cursor is invisible + if (a.length > 0) { + RenderObject* caretRenderer = frame->selection()->caretRenderer(); + if (caretRenderer) { + QColor qcolor = a.value.value<QColor>(); + caretRenderer->style()->setColor(Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha()))); + } + } + break; + } + case QInputMethodEvent::Selection: { + hasSelection = true; + // A selection in the inputMethodEvent is always reflected in the visible text + if (node) + setSelectionRange(node, qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length))); + + if (!ev->preeditString().isEmpty()) + editor->setComposition(ev->preeditString(), underlines, qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length))); + else { + // If we are in the middle of a composition, an empty pre-edit string and a selection of zero + // cancels the current composition + if (editor->hasComposition() && (a.start + a.length == 0)) + editor->setComposition(QString(), underlines, 0, 0); + } + break; + } + } + } + + if (node && ev->replacementLength() > 0) { + int cursorPos = frame->selection()->extent().offsetInContainerNode(); + int start = cursorPos + ev->replacementStart(); + setSelectionRange(node, start, start + ev->replacementLength()); + // Commit regardless of whether commitString is empty, to get rid of selection. + editor->confirmComposition(ev->commitString()); + } else if (!ev->commitString().isEmpty()) { + if (editor->hasComposition()) + editor->confirmComposition(ev->commitString()); + else + editor->insertText(ev->commitString(), 0); + } else if (!hasSelection && !ev->preeditString().isEmpty()) + editor->setComposition(ev->preeditString(), underlines, 0, 0); + else if (ev->preeditString().isEmpty() && editor->hasComposition()) + editor->confirmComposition(String()); + + ev->accept(); +} + +#ifndef QT_NO_PROPERTIES +typedef struct { + const char* name; + double deferredRepaintDelay; + double initialDeferredRepaintDelayDuringLoading; + double maxDeferredRepaintDelayDuringLoading; + double deferredRepaintDelayIncrementDuringLoading; +} QRepaintThrottlingPreset; + +void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event) +{ + if (event->propertyName() == "_q_viewMode") { + page->setViewMode(Page::stringToViewMode(q->property("_q_viewMode").toString())); + } else if (event->propertyName() == "_q_HTMLTokenizerChunkSize") { + int chunkSize = q->property("_q_HTMLTokenizerChunkSize").toInt(); + q->handle()->page->setCustomHTMLTokenizerChunkSize(chunkSize); + } else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") { + double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble(); + q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay); + } else if (event->propertyName() == "_q_RepaintThrottlingDeferredRepaintDelay") { + double p = q->property("_q_RepaintThrottlingDeferredRepaintDelay").toDouble(); + FrameView::setRepaintThrottlingDeferredRepaintDelay(p); + } else if (event->propertyName() == "_q_RepaintThrottlingnInitialDeferredRepaintDelayDuringLoading") { + double p = q->property("_q_RepaintThrottlingnInitialDeferredRepaintDelayDuringLoading").toDouble(); + FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(p); + } else if (event->propertyName() == "_q_RepaintThrottlingMaxDeferredRepaintDelayDuringLoading") { + double p = q->property("_q_RepaintThrottlingMaxDeferredRepaintDelayDuringLoading").toDouble(); + FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(p); + } else if (event->propertyName() == "_q_RepaintThrottlingDeferredRepaintDelayIncrementDuringLoading") { + double p = q->property("_q_RepaintThrottlingDeferredRepaintDelayIncrementDuringLoading").toDouble(); + FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(p); + } else if (event->propertyName() == "_q_RepaintThrottlingPreset") { + static const QRepaintThrottlingPreset presets[] = { + { "NoThrottling", 0, 0, 0, 0 }, + { "Legacy", 0.025, 0, 2.5, 0.5 }, + { "Minimal", 0.01, 0, 1, 0.2 }, + { "Medium", 0.025, 1, 5, 0.5 }, + { "Heavy", 0.1, 2, 10, 1 } + }; + + QString p = q->property("_q_RepaintThrottlingPreset").toString(); + for(int i = 0; i < sizeof(presets) / sizeof(presets[0]); i++) { + if(p == presets[i].name) { + FrameView::setRepaintThrottlingDeferredRepaintDelay( + presets[i].deferredRepaintDelay); + FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading( + presets[i].initialDeferredRepaintDelayDuringLoading); + FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading( + presets[i].maxDeferredRepaintDelayDuringLoading); + FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading( + presets[i].deferredRepaintDelayIncrementDuringLoading); + break; + } + } + } +#if ENABLE(TILED_BACKING_STORE) + else if (event->propertyName() == "_q_TiledBackingStoreTileSize") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + QSize tileSize = q->property("_q_TiledBackingStoreTileSize").toSize(); + frame->tiledBackingStore()->setTileSize(tileSize); + } else if (event->propertyName() == "_q_TiledBackingStoreTileCreationDelay") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + int tileCreationDelay = q->property("_q_TiledBackingStoreTileCreationDelay").toInt(); + frame->tiledBackingStore()->setTileCreationDelay(static_cast<double>(tileCreationDelay) / 1000.); + } else if (event->propertyName() == "_q_TiledBackingStoreKeepAreaMultiplier") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + FloatSize keepMultiplier; + FloatSize coverMultiplier; + frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); + QSizeF qSize = q->property("_q_TiledBackingStoreKeepAreaMultiplier").toSizeF(); + keepMultiplier = FloatSize(qSize.width(), qSize.height()); + frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); + } else if (event->propertyName() == "_q_TiledBackingStoreCoverAreaMultiplier") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + FloatSize keepMultiplier; + FloatSize coverMultiplier; + frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); + QSizeF qSize = q->property("_q_TiledBackingStoreCoverAreaMultiplier").toSizeF(); + coverMultiplier = FloatSize(qSize.width(), qSize.height()); + frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); + } +#endif + else if (event->propertyName() == "_q_webInspectorServerPort") { + InspectorServerQt* inspectorServer = InspectorServerQt::server(); + inspectorServer->listen(inspectorServerPort()); + } +} +#endif + +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, Frame *frame) +{ + 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; + } + } + + return frame->eventHandler()->scrollRecursively(direction, granularity); +} + +void QWebPagePrivate::adjustPointForClicking(QMouseEvent*) +{ + notImplemented(); +} + +#if !defined(QT_NO_GRAPHICSVIEW) +void QWebPagePrivate::adjustPointForClicking(QGraphicsSceneMouseEvent* ev) +{ + QtPlatformPlugin platformPlugin; + QWebTouchModifier* touchModifier = platformPlugin.createTouchModifier(); + if (!touchModifier) + return; + + unsigned topPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Up); + unsigned rightPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Right); + unsigned bottomPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Down); + unsigned leftPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Left); + + delete touchModifier; + touchModifier = 0; + + if (!topPadding && !rightPadding && !bottomPadding && !leftPadding) + return; + + Document* startingDocument = page->mainFrame()->document(); + if (!startingDocument) + return; + + IntPoint originalPoint(QPointF(ev->pos()).toPoint()); + TouchAdjuster touchAdjuster(topPadding, rightPadding, bottomPadding, leftPadding); + IntPoint adjustedPoint = touchAdjuster.findCandidatePointForTouch(originalPoint, startingDocument); + if (adjustedPoint == IntPoint::zero()) + return; + + ev->setPos(QPointF(adjustedPoint)); +} +#endif + +bool QWebPagePrivate::touchEvent(QTouchEvent* event) +{ +#if ENABLE(TOUCH_EVENTS) + WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); + if (!frame->view()) + return false; + + // Always accept the QTouchEvent so that we'll receive also TouchUpdate and TouchEnd events + event->setAccepted(true); + + // Return whether the default action was cancelled in the JS event handler + return frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event)); +#else + event->ignore(); + return false; +#endif +} + +/*! + 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 +{ + Frame* frame = d->page->focusController()->focusedFrame(); + if (!frame) + return QVariant(); + + WebCore::Editor* editor = frame->editor(); + + RenderObject* renderer = 0; + RenderTextControl* renderTextControl = 0; + + if (frame->selection()->rootEditableElement()) + renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); + + if (renderer && renderer->isTextControl()) + renderTextControl = toRenderTextControl(renderer); + + switch (property) { + case Qt::ImMicroFocus: { + WebCore::FrameView* view = frame->view(); + if (view && view->needsLayout()) { + // We can't access absoluteCaretBounds() while the view needs to layout. + return QVariant(); + } + return QVariant(view->contentsToWindow(frame->selection()->absoluteCaretBounds())); + } + case Qt::ImFont: { + if (renderTextControl) { + RenderStyle* renderStyle = renderTextControl->style(); + return QVariant(QFont(renderStyle->font().font())); + } + return QVariant(QFont()); + } + case Qt::ImCursorPosition: { + if (editor->hasComposition()) + return QVariant(frame->selection()->end().offsetInContainerNode()); + return QVariant(frame->selection()->extent().offsetInContainerNode()); + } + case Qt::ImSurroundingText: { + if (renderTextControl) { + QString text = renderTextControl->text(); + RefPtr<Range> range = editor->compositionRange(); + if (range) + text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get())); + return QVariant(text); + } + return QVariant(); + } + case Qt::ImCurrentSelection: { + if (!editor->hasComposition() && renderTextControl) { + int start = frame->selection()->start().offsetInContainerNode(); + int end = frame->selection()->end().offsetInContainerNode(); + if (end > start) + return QVariant(QString(renderTextControl->text()).mid(start, end - start)); + } + return QVariant(); + + } + case Qt::ImAnchorPosition: { + if (editor->hasComposition()) + return QVariant(frame->selection()->start().offsetInContainerNode()); + return QVariant(frame->selection()->base().offsetInContainerNode()); + } + case Qt::ImMaximumTextLength: { + if (frame->selection()->isContentEditable()) { + if (frame->document() && frame->document()->focusedNode()) { + if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) { + HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode()); + return QVariant(inputElement->maxLength()); + } + } + return QVariant(InputElement::s_maximumLength); + } + return QVariant(0); + } + default: + return QVariant(); + } +} + +/*! + \internal +*/ +void QWebPagePrivate::setInspector(QWebInspector* insp) +{ + if (inspector) + inspector->d->setFrontend(0); + + if (inspectorIsInternalOnly) { + QWebInspector* inspToDelete = inspector; + inspector = 0; + inspectorIsInternalOnly = false; + delete inspToDelete; // Delete after to prevent infinite recursion + } + + inspector = insp; + + // Give inspector frontend web view if previously created + if (inspector && inspectorFrontend) + inspector->d->setFrontend(inspectorFrontend); +} + +/*! + \internal + Returns the inspector and creates it if it wasn't created yet. + The instance created here will not be available through QWebPage's API. +*/ +QWebInspector* QWebPagePrivate::getOrCreateInspector() +{ +#if ENABLE(INSPECTOR) + if (!inspector) { + QWebInspector* insp = new QWebInspector; + insp->setPage(q); + inspectorIsInternalOnly = true; + + Q_ASSERT(inspector); // Associated through QWebInspector::setPage(q) + } +#endif + return inspector; +} + +/*! \internal */ +InspectorController* QWebPagePrivate::inspectorController() +{ +#if ENABLE(INSPECTOR) + return page->inspectorController(); +#else + return 0; +#endif +} + +quint16 QWebPagePrivate::inspectorServerPort() +{ +#if ENABLE(INSPECTOR) && !defined(QT_NO_PROPERTIES) + if (q && q->property("_q_webInspectorServerPort").isValid()) + return q->property("_q_webInspectorServerPort").toInt(); +#endif + return 0; +} + +static bool hasMouseListener(Element* element) +{ + ASSERT(element); + return element->hasEventListeners(eventNames().clickEvent) + || element->hasEventListeners(eventNames().mousedownEvent) + || element->hasEventListeners(eventNames().mouseupEvent); +} + +static bool isClickableElement(Element* element, RefPtr<NodeList> list) +{ + ASSERT(element); + bool isClickable = hasMouseListener(element); + if (!isClickable && list) { + Element* parent = element->parentElement(); + unsigned count = list->length(); + for (unsigned i = 0; i < count && parent; i++) { + if (list->item(i) != parent) + continue; + + isClickable = hasMouseListener(parent); + if (isClickable) + break; + + parent = parent->parentElement(); + } + } + + ExceptionCode ec = 0; + return isClickable + || element->webkitMatchesSelector("a,*:link,*:visited,*[role=button],button,input,select,label", ec) + || computedStyle(element)->getPropertyValue(cssPropertyID("cursor")) == "pointer"; +} + +static bool isValidFrameOwner(Element* element) +{ + ASSERT(element); + return element->isFrameOwnerElement() && static_cast<HTMLFrameOwnerElement*>(element)->contentFrame(); +} + +static Element* nodeToElement(Node* node) +{ + if (node && node->isElementNode()) + return static_cast<Element*>(node); + return 0; +} + +QWebPagePrivate::TouchAdjuster::TouchAdjuster(unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding) + : m_topPadding(topPadding) + , m_rightPadding(rightPadding) + , m_bottomPadding(bottomPadding) + , m_leftPadding(leftPadding) +{ +} + +IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoint& touchPoint, Document* document) const +{ + if (!document) + return IntPoint(); + + int x = touchPoint.x(); + int y = touchPoint.y(); + + RefPtr<NodeList> intersectedNodes = document->nodesFromRect(x, y, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding, false); + if (!intersectedNodes) + return IntPoint(); + + Element* closestClickableElement = 0; + IntRect largestIntersectionRect; + FrameView* view = document->frame()->view(); + + // Touch rect in contents coordinates. + IntRect touchRect(HitTestResult::rectForPoint(view->windowToContents(IntPoint(x, y)), m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding)); + + // Iterate over the list of nodes hit looking for the one whose bounding area + // has largest intersection with the touch area (point + padding). + for (unsigned i = 0; i < intersectedNodes->length(); i++) { + Node* currentNode = intersectedNodes->item(i); + + Element* currentElement = nodeToElement(currentNode); + if (!currentElement || (!isClickableElement(currentElement, 0) && !isValidFrameOwner(currentElement))) + continue; + + IntRect currentElementBoundingRect = currentElement->getRect(); + currentElementBoundingRect.intersect(touchRect); + + if (currentElementBoundingRect.isEmpty()) + continue; + + int currentIntersectionRectArea = currentElementBoundingRect.width() * currentElementBoundingRect.height(); + int largestIntersectionRectArea = largestIntersectionRect.width() * largestIntersectionRect.height(); + if (currentIntersectionRectArea > largestIntersectionRectArea) { + closestClickableElement = currentElement; + largestIntersectionRect = currentElementBoundingRect; + } + } + + if (largestIntersectionRect.isEmpty()) + return IntPoint(); + + // Handle the case when user taps a inner frame. It is done in three steps: + // 1) Transform the original touch point to the inner document coordinates; + // 1) Call nodesFromRect for the inner document in case; + // 3) Re-add the inner frame offset (location) before passing the new clicking + // position to WebCore. + if (closestClickableElement->isFrameOwnerElement()) { + // Adjust client coordinates' origin to be top left of inner frame viewport. + PassRefPtr<ClientRect> rect = closestClickableElement->getBoundingClientRect(); + IntPoint newTouchPoint = touchPoint; + IntSize offset = IntSize(rect->left(), rect->top()); + newTouchPoint -= offset; + + HTMLFrameOwnerElement* owner = static_cast<HTMLFrameOwnerElement*>(closestClickableElement); + Document* childDocument = owner->contentFrame()->document(); + return findCandidatePointForTouch(newTouchPoint, childDocument); + } + return view->contentsToWindow(largestIntersectionRect).center(); +} + +/*! + \enum QWebPage::FindFlag + + This enum describes the options available to the 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. + \value HighlightAllOccurrences Highlights all existing occurrences of a specific string. +*/ + +/*! + \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. + + \sa QWebPage::linkDelegationPolicy +*/ + +/*! + \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. + + \sa acceptNavigationRequest() +*/ + +/*! + \enum QWebPage::WebAction + + This enum describes the types of action which can be performed on the web page. + + Actions only have an effect when they are applicable. The availability of + actions can be be determined by checking \l{QAction::}{isEnabled()} on the + action returned by action(). + + One method of enabling the text editing, cursor movement, and text selection actions + is by setting \l contentEditable to 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 StopScheduledPageRefresh Stop all pending page refresh/redirect requests. + \value Reload Reload the current page. + \value ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6) + \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. + \value PasteAndMatchStyle Paste content from the clipboard with current style. + \value RemoveFormat Removes formatting and style. + \value ToggleStrikethrough Toggle the formatting between strikethrough and normal style. + \value ToggleSubscript Toggle the formatting between subscript and baseline. + \value ToggleSuperscript Toggle the formatting between supercript and baseline. + \value InsertUnorderedList Toggles the selection between an ordered list and a normal block. + \value InsertOrderedList Toggles the selection between an ordered list and a normal block. + \value Indent Increases the indentation of the currently selected format block by one increment. + \value Outdent Decreases the indentation of the currently selected format block by one increment. + \value AlignCenter Applies center alignment to content. + \value AlignJustified Applies full justification to content. + \value AlignLeft Applies left justification to content. + \value AlignRight Applies right justification to content. + + + \omitvalue WebActionCount + +*/ + +/*! + \enum QWebPage::WebWindowType + + This enum describes the types of window that can be created by the createWindow() function. + + \value WebBrowserWindow The window is a regular web browser window. + \value WebModalDialog The window acts as modal dialog. +*/ + + +/*! + \class QWebPage::ViewportAttributes + \since 4.7 + \brief The QWebPage::ViewportAttributes class describes hints that can be applied to a viewport. + + QWebPage::ViewportAttributes provides a description of a viewport, such as viewport geometry, + initial scale factor with limits, plus information about whether a user should be able + to scale the contents in the viewport or not, ie. by zooming. + + ViewportAttributes can be set by a web author using the viewport meta tag extension, documented + at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}. + + All values might not be set, as such when dealing with the hints, the developer needs to + check whether the values are valid. Negative values denote an invalid qreal value. + + \inmodule QtWebKit +*/ + +/*! + Constructs an empty QWebPage::ViewportAttributes. +*/ +QWebPage::ViewportAttributes::ViewportAttributes() + : d(0) + , m_initialScaleFactor(-1.0) + , m_minimumScaleFactor(-1.0) + , m_maximumScaleFactor(-1.0) + , m_devicePixelRatio(-1.0) + , m_isUserScalable(true) + , m_isValid(false) +{ + +} + +/*! + Constructs a QWebPage::ViewportAttributes which is a copy from \a other . +*/ +QWebPage::ViewportAttributes::ViewportAttributes(const QWebPage::ViewportAttributes& other) + : d(other.d) + , m_initialScaleFactor(other.m_initialScaleFactor) + , m_minimumScaleFactor(other.m_minimumScaleFactor) + , m_maximumScaleFactor(other.m_maximumScaleFactor) + , m_devicePixelRatio(other.m_devicePixelRatio) + , m_isUserScalable(other.m_isUserScalable) + , m_isValid(other.m_isValid) + , m_size(other.m_size) +{ + +} + +/*! + Destroys the QWebPage::ViewportAttributes. +*/ +QWebPage::ViewportAttributes::~ViewportAttributes() +{ + +} + +/*! + Assigns the given QWebPage::ViewportAttributes to this viewport hints and returns a + reference to this. +*/ +QWebPage::ViewportAttributes& QWebPage::ViewportAttributes::operator=(const QWebPage::ViewportAttributes& other) +{ + if (this != &other) { + d = other.d; + m_initialScaleFactor = other.m_initialScaleFactor; + m_minimumScaleFactor = other.m_minimumScaleFactor; + m_maximumScaleFactor = other.m_maximumScaleFactor; + m_isUserScalable = other.m_isUserScalable; + m_isValid = other.m_isValid; + m_size = other.m_size; + } + + return *this; +} + +/*! \fn inline bool QWebPage::ViewportAttributes::isValid() const + Returns whether this is a valid ViewportAttributes or not. + + An invalid ViewportAttributes will have an empty QSize, negative values for scale factors and + true for the boolean isUserScalable. +*/ + +/*! \fn inline QSize QWebPage::ViewportAttributes::size() const + Returns the size of the viewport. +*/ + +/*! \fn inline qreal QWebPage::ViewportAttributes::initialScaleFactor() const + Returns the initial scale of the viewport as a multiplier. +*/ + +/*! \fn inline qreal QWebPage::ViewportAttributes::minimumScaleFactor() const + Returns the minimum scale value of the viewport as a multiplier. +*/ + +/*! \fn inline qreal QWebPage::ViewportAttributes::maximumScaleFactor() const + Returns the maximum scale value of the viewport as a multiplier. +*/ + +/*! \fn inline bool QWebPage::ViewportAttributes::isUserScalable() const + Determines whether or not the scale can be modified by the user. +*/ + + +/*! + \class QWebPage + \since 4.4 + \brief The QWebPage class provides an object to view and edit web documents. + + \inmodule QtWebKit + + 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()}{pageAction}() in QWebView), triggerAction(), + findText() and settings(). More QWebView-like functions can be found in the + main frame of QWebPage, obtained via the mainFrame() function. For example, + the \l{QWebFrame::load()}{load}(), \l{QWebFrame::setUrl()}{setUrl}() and + \l{QWebFrame::setHtml()}{setHtml}() functions 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 webkitsnippets/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 webkitsnippets/webpage/main.cpp 1 + + The \c render() function shows how we can paint a thumbnail using a + QWebPage object. + + \snippet webkitsnippets/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 QWebPage 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))); +#ifndef NDEBUG + connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(_q_cleanupLeakMessages())); +#endif +} + +/*! + Destroys the web page. +*/ +QWebPage::~QWebPage() +{ + d->createMainFrame(); + 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 +{ + d->createMainFrame(); + WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame(); + return qobject_cast<QWebFrame*>(frame->loader()->networkingContext()->originatingObject()); +} + + +/*! + \since 4.6 + + Returns the frame at the given point \a pos, or 0 if there is no frame at + that position. + + \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. +*/ +QWebHistory *QWebPage::history() const +{ + d->createMainFrame(); + return &d->history; +} + +/*! + Sets the \a view that is associated with the web page. + + \sa view() +*/ +void QWebPage::setView(QWidget* view) +{ + if (this->view() == view) + return; + + d->view = view; + setViewportSize(view ? view->size() : QSize(0, 0)); + + // If we have no client, we install a special client delegating + // the responsibility to the QWidget. This is the code path + // handling a.o. the "legacy" QWebView. + // + // If such a special delegate already exist, we substitute the view. + + if (d->client) { + if (d->client->isQWidgetClient()) + static_cast<PageClientQWidget*>(d->client.get())->view = view; + return; + } + + if (view) + d->client = new PageClientQWidget(view, this); +} + +/*! + Returns the view widget that is associated with the web page. + + \sa setView() +*/ +QWidget *QWebPage::view() const +{ + return d->view.data(); +} + +/*! + 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(sourceID) + + // Catch plugin logDestroy message for LayoutTests/plugins/open-and-close-window-with-plugin.html + // At this point DRT's WebPage has already been destroyed + if (QWebPagePrivate::drtRun) { + if (message == "PLUGIN: NPP_Destroy") + fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.toUtf8().constData()); + } +} + +/*! + 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) +{ + Q_UNUSED(frame) +#ifndef QT_NO_MESSAGEBOX + QWidget* parent = (d->client) ? d->client->ownerWidget() : 0; + QMessageBox::information(parent, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), Qt::escape(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) +{ + Q_UNUSED(frame) +#ifdef QT_NO_MESSAGEBOX + return true; +#else + QWidget* parent = (d->client) ? d->client->ownerWidget() : 0; + return QMessageBox::Yes == QMessageBox::information(parent, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), Qt::escape(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. If the prompt was not cancelled by the + user, the implementation should return true and the result string must not be null. + + The default implementation uses QInputDialog::getText(). +*/ +bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result) +{ + Q_UNUSED(frame) + bool ok = false; +#ifndef QT_NO_INPUTDIALOG + QWidget* parent = (d->client) ? d->client->ownerWidget() : 0; + QString x = QInputDialog::getText(parent, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QLineEdit::Normal, defaultValue, &ok); + if (ok && result) + *result = x; +#endif + return ok; +} + +/*! + \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 + QWidget* parent = (d->client) ? d->client->ownerWidget() : 0; + return QMessageBox::Yes == QMessageBox::information(parent, 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 +} + +void QWebPage::setFeaturePermission(QWebFrame* frame, Feature feature, PermissionPolicy policy) +{ + switch (feature) { + case Notifications: +#if ENABLE(NOTIFICATIONS) + if (policy == PermissionGrantedByUser) + NotificationPresenterClientQt::notificationPresenter()->allowNotificationForFrame(frame->d->frame); +#endif + break; + case Geolocation: +#if ENABLE(GEOLOCATION) + GeolocationPermissionClientQt::geolocationPermissionClient()->setPermission(frame, policy); +#endif + break; + + default: + break; + } +} + +/*! + 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. + + If \a type is WebModalDialog, the application must call setWindowModality(Qt::ApplicationModal) on the new window. + + \note In the cases when the window creation is being triggered by JavaScript, apart from + reimplementing this method application must also set the JavaScriptCanOpenWindows attribute + of QWebSettings to true in order for it to get called. + + \sa acceptNavigationRequest(), QWebView::createWindow() +*/ +QWebPage *QWebPage::createWindow(WebWindowType type) +{ + QWebView *webView = qobject_cast<QWebView*>(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". It is + called regardless of the value of QWebSettings::PluginsEnabled. 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 ¶mNames, const QStringList ¶mValues) +{ + Q_UNUSED(classid) + Q_UNUSED(url) + Q_UNUSED(paramNames) + Q_UNUSED(paramValues) + return 0; +} + +static void extractContentTypeFromHash(const HashSet<String>& types, QStringList* list) +{ + if (!list) + return; + + HashSet<String>::const_iterator endIt = types.end(); + for (HashSet<String>::const_iterator it = types.begin(); it != endIt; ++it) + *list << *it; +} + +static void extractContentTypeFromPluginVector(const Vector<PluginPackage*>& plugins, QStringList* list) +{ + if (!list) + return; + + for (unsigned int i = 0; i < plugins.size(); ++i) { + MIMEToDescriptionsMap::const_iterator map_it = plugins[i]->mimeToDescriptions().begin(); + MIMEToDescriptionsMap::const_iterator map_end = plugins[i]->mimeToDescriptions().end(); + for (; map_it != map_end; ++map_it) + *list << map_it->first; + } +} + +/*! + * Returns the list of all content types supported by QWebPage. + */ +QStringList QWebPage::supportedContentTypes() const +{ + QStringList mimeTypes; + + extractContentTypeFromHash(MIMETypeRegistry::getSupportedImageMIMETypes(), &mimeTypes); + extractContentTypeFromHash(MIMETypeRegistry::getSupportedNonImageMIMETypes(), &mimeTypes); + if (d->page->settings() && d->page->settings()->arePluginsEnabled()) + extractContentTypeFromPluginVector(PluginDatabase::installedPlugins()->plugins(), &mimeTypes); + + return mimeTypes; +} + +/*! + * Returns true if QWebPage can handle the given \a mimeType; otherwise, returns false. + */ +bool QWebPage::supportsContentType(const QString& mimeType) const +{ + const String type = mimeType.toLower(); + if (MIMETypeRegistry::isSupportedImageMIMEType(type)) + return true; + + if (MIMETypeRegistry::isSupportedNonImageMIMEType(type)) + return true; + + if (d->page->settings() && d->page->settings()->arePluginsEnabled() + && PluginDatabase::installedPlugins()->isMIMETypeRegistered(type)) + return true; + + return false; +} + +static WebCore::FrameLoadRequest frameLoadRequest(const QUrl &url, WebCore::Frame *frame) +{ + return WebCore::FrameLoadRequest(frame->document()->securityOrigin(), + WebCore::ResourceRequest(url, frame->loader()->outgoingReferrer())); +} + +static void openNewWindow(const QUrl& url, WebCore::Frame* frame) +{ + if (Page* oldPage = frame->page()) { + WindowFeatures features; + NavigationAction action; + FrameLoadRequest request = frameLoadRequest(url, frame); + if (Page* newPage = oldPage->chrome()->createWindow(frame, request, features, action)) { + newPage->mainFrame()->loader()->loadFrameRequest(request, false, false, 0, 0, SendReferrer); + newPage->chrome()->show(); + } + } +} + +static void collectChildFrames(QWebFrame* frame, QList<QWebFrame*>& list) +{ + list << frame->childFrames(); + QListIterator<QWebFrame*> it(frame->childFrames()); + while (it.hasNext()) { + collectChildFrames(it.next(), list); + } +} + +/*! + 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) +{ + 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()->loadFrameRequest(frameLoadRequest(d->hitTestResult.linkUrl(), wcFrame.get()), + /*lockHistory*/ false, /*lockBackForwardList*/ false, /*event*/ 0, + /*FormState*/ 0, SendReferrer); + 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: { +#if defined(Q_WS_X11) + bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); + Pasteboard::generalPasteboard()->setSelectionMode(true); + editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText()); + Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); +#endif + 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(); + d->updateNavigationActions(); + break; + case Reload: + mainFrame()->d->frame->loader()->reload(/*endtoendreload*/false); + break; + case ReloadAndBypassCache: + mainFrame()->d->frame->loader()->reload(/*endtoendreload*/true); + break; + case SetTextDirectionDefault: + editor->setBaseWritingDirection(NaturalWritingDirection); + break; + case SetTextDirectionLeftToRight: + editor->setBaseWritingDirection(LeftToRightWritingDirection); + break; + case SetTextDirectionRightToLeft: + editor->setBaseWritingDirection(RightToLeftWritingDirection); + break; + case InspectElement: { +#if ENABLE(INSPECTOR) + if (!d->hitTestResult.isNull()) { + d->getOrCreateInspector(); // Make sure the inspector is created + d->inspector->show(); // The inspector is expected to be shown on inspection + d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get()); + } +#endif + break; + } + case StopScheduledPageRefresh: { + QWebFrame* topFrame = mainFrame(); + topFrame->d->frame->navigationScheduler()->cancel(); + QList<QWebFrame*> childFrames; + collectChildFrames(topFrame, childFrames); + QListIterator<QWebFrame*> it(childFrames); + while (it.hasNext()) + it.next()->d->frame->navigationScheduler()->cancel(); + 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. + + \sa QWebFrame::render(), preferredContentsSize +*/ +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)); + view->adjustViewSize(); + } +} + +static int getintenv(const char* variable) +{ + bool ok; + int value = qgetenv(variable).toInt(&ok); + return (ok) ? value : -1; +} + +static QSize queryDeviceSizeForScreenContainingWidget(const QWidget* widget) +{ + QDesktopWidget* desktop = QApplication::desktop(); + if (!desktop) + return QSize(); + + QSize size; + + if (widget) { + // Returns the available geometry of the screen which contains widget. + // NOTE: this must be the the full screen size including any fixed status areas etc. + size = desktop->availableGeometry(widget).size(); + } else + size = desktop->availableGeometry().size(); + + // This must be in portrait mode, adjust if not. + if (size.width() > size.height()) { + int width = size.width(); + size.setWidth(size.height()); + size.setHeight(width); + } + + return size; +} + +/*! + Computes the optimal viewport configuration given the \a availableSize, when + user interface components are disregarded. + + The configuration is also dependent on the device screen size which is obtained + automatically. For testing purposes the size can be overridden by setting two + environment variables QTWEBKIT_DEVICE_WIDTH and QTWEBKIT_DEVICE_HEIGHT, which + both needs to be set. + + The ViewportAttributes includes a pixel density ratio, which will also be exposed to + the web author though the -webkit-pixel-ratio media feature. This is the ratio + between 1 density-independent pixel (DPI) and physical pixels. + + A density-independent pixel is equivalent to one physical pixel on a 160 DPI screen, + so on our platform assumes that as the baseline density. + + The conversion of DIP units to screen pixels is quite simple: + + pixels = DIPs * (density / 160). + + Thus, on a 240 DPI screen, 1 DIPs would equal 1.5 physical pixels. + + An invalid instance will be returned in the case an empty size is passed to the + method. + + \note The density is automatically obtained from the DPI of the screen where the page + is being shown, but as many X11 servers are reporting wrong DPI, it is possible to + override it using QX11Info::setAppDpiY(). +*/ + +QWebPage::ViewportAttributes QWebPage::viewportAttributesForSize(const QSize& availableSize) const +{ + static int desktopWidth = 980; + + ViewportAttributes result; + + if (availableSize.isEmpty()) + return result; // Returns an invalid instance. + + int deviceWidth = getintenv("QTWEBKIT_DEVICE_WIDTH"); + int deviceHeight = getintenv("QTWEBKIT_DEVICE_HEIGHT"); + + // Both environment variables need to be set - or they will be ignored. + if (deviceWidth < 0 && deviceHeight < 0) { + QSize size = queryDeviceSizeForScreenContainingWidget((d->client) ? d->client->ownerWidget() : 0); + deviceWidth = size.width(); + deviceHeight = size.height(); + } + + WebCore::ViewportAttributes conf = WebCore::computeViewportAttributes(d->viewportArguments(), desktopWidth, deviceWidth, deviceHeight, qt_defaultDpi(), availableSize); + + result.m_isValid = true; + result.m_size = conf.layoutSize; + result.m_initialScaleFactor = conf.initialScale; + result.m_minimumScaleFactor = conf.minimumScale; + result.m_maximumScaleFactor = conf.maximumScale; + result.m_devicePixelRatio = conf.devicePixelRatio; + result.m_isUserScalable = conf.userScalable; + + d->pixelRatio = conf.devicePixelRatio; + + return result; +} + +QSize QWebPage::preferredContentsSize() const +{ + QWebFrame* frame = d->mainFrame; + if (frame) { + WebCore::FrameView* view = frame->d->frame->view(); + if (view && view->useFixedLayout()) + return d->mainFrame->d->frame->view()->fixedLayoutSize(); + } + + return d->fixedLayoutSize; +} + +/*! + \property QWebPage::preferredContentsSize + \since 4.6 + \brief a custom size used for laying out the page contents. + + By default all pages are laid out using the viewport of the page as the base. + + As pages mostly are designed for desktop usage, they often do not layout properly + on small devices as the contents require a certain view width. For this reason + it is common to use a different layout size and then scale the contents to fit + within the actual view. + + If this property is set to a valid size, this size is used for all layout needs + instead of the size of the viewport. + + Setting an invalid size, makes the page fall back to using the viewport size for layout. + + \sa viewportSize +*/ +void QWebPage::setPreferredContentsSize(const QSize& size) const +{ + // FIXME: Rename this method to setCustomLayoutSize + + d->fixedLayoutSize = size; + + QWebFrame* frame = mainFrame(); + if (!frame->d->frame || !frame->d->frame->view()) + return; + + WebCore::FrameView* view = frame->d->frame->view(); + + if (size.isValid()) { + view->setUseFixedLayout(true); + view->setFixedLayoutSize(size); + } else if (view->useFixedLayout()) + view->setUseFixedLayout(false); + + view->layout(); +} + +/* + This function is to be called after any (animated) scroll/pan has ended, in the case the application handles the + scrolling/panning of the web contents. This is commonly used in combination with tiling where is it common for + the application to pan the actual view, which then resizes itself to the size of the contents. + + \note Calling this function makes WebKit stop trying to calculate the visibleContentRect. To turn that on + again, call this method with an empty rect. + + \sa QGraphicsWebView::resizesToContents, QWebSettings::TiledBackingStoreEnabled +*/ +void QWebPage::setActualVisibleContentRect(const QRect& rect) const +{ + QWebFrame* frame = mainFrame(); + if (!frame->d->frame || !frame->d->frame->view()) + return; + + WebCore::FrameView* view = frame->d->frame->view(); + view->setActualVisibleContentRect(rect); +} + +/*! + \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() +*/ +bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type) +{ + Q_UNUSED(frame) + if (type == NavigationTypeLinkClicked) { + switch (d->linkPolicy) { + case DontDelegateLinks: + return true; + + case DelegateExternalLinks: + if (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(request.url().scheme())) + return true; + emit linkClicked(request.url()); + return false; + + case DelegateAllLinks: + emit linkClicked(request.url()); + return false; + } + } + return true; +} + +/*! + \property QWebPage::hasSelection + \brief whether this page contains selected content or not. + + \sa selectionChanged() +*/ +bool QWebPage::hasSelection() const +{ + d->createMainFrame(); + WebCore::Frame* frame = d->page->focusController()->focusedOrMainFrame(); + if (frame) + return (frame->selection()->selection().selectionType() != VisibleSelection::NoSelection); + return false; +} + +/*! + \property QWebPage::selectedText + \brief the text currently selected + + By default, this property contains an empty string. + + \sa selectionChanged(), selectedHtml() +*/ +QString QWebPage::selectedText() const +{ + d->createMainFrame(); + WebCore::Frame* frame = d->page->focusController()->focusedOrMainFrame(); + if (frame->selection()->selection().selectionType() == VisibleSelection::NoSelection) + return QString(); + return frame->editor()->selectedText(); +} + +/*! + \since 4.8 + \property QWebPage::selectedHtml + \brief the HTML currently selected + + By default, this property contains an empty string. + + \sa selectionChanged(), selectedText() +*/ +QString QWebPage::selectedHtml() const +{ + d->createMainFrame(); + return d->page->focusController()->focusedOrMainFrame()->editor()->selectedRange()->toHTML(); +} + +#ifndef QT_NO_ACTION +/*! + 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 = d->client ? d->client->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(); + icon = style->standardIcon(QStyle::SP_ArrowBack); + break; + case Forward: + text = contextMenuItemTagGoForward(); + icon = style->standardIcon(QStyle::SP_ArrowForward); + break; + case Stop: + text = contextMenuItemTagStop(); + icon = style->standardIcon(QStyle::SP_BrowserStop); + break; + case Reload: + text = contextMenuItemTagReload(); + icon = style->standardIcon(QStyle::SP_BrowserReload); + break; + + case Cut: + text = contextMenuItemTagCut(); + break; + case Copy: + text = contextMenuItemTagCopy(); + break; + case Paste: + text = contextMenuItemTagPaste(); + break; + case SelectAll: + text = contextMenuItemTagSelectAll(); + 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 InsertParagraphSeparator: + text = tr("Insert a new paragraph"); + break; + case InsertLineSeparator: + text = tr("Insert a new line"); + break; + + case PasteAndMatchStyle: + text = tr("Paste and Match Style"); + break; + case RemoveFormat: + text = tr("Remove formatting"); + break; + + case ToggleStrikethrough: + text = tr("Strikethrough"); + checkable = true; + break; + case ToggleSubscript: + text = tr("Subscript"); + checkable = true; + break; + case ToggleSuperscript: + text = tr("Superscript"); + checkable = true; + break; + case InsertUnorderedList: + text = tr("Insert Bulleted List"); + checkable = true; + break; + case InsertOrderedList: + text = tr("Insert Numbered List"); + checkable = true; + break; + case Indent: + text = tr("Indent"); + break; + case Outdent: + text = tr("Outdent"); + break; + case AlignCenter: + text = tr("Center"); + break; + case AlignJustified: + text = tr("Justify"); + break; + case AlignLeft: + text = tr("Align Left"); + break; + case AlignRight: + text = tr("Align Right"); + 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; +} +#endif // QT_NO_ACTION + +/*! + \property QWebPage::modified + \brief whether the page contains unsubmitted form data, or the contents have been changed. + + By default, this property is false. + + \sa contentsChanged(), contentEditable, undoStack() +*/ +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. + + \sa modified +*/ +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; +#if !defined(QT_NO_GRAPHICSVIEW) + case QEvent::GraphicsSceneMouseMove: + d->mouseMoveEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); + break; + case QEvent::GraphicsSceneMousePress: + d->mousePressEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); + break; + case QEvent::GraphicsSceneMouseDoubleClick: + d->mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); + break; + case QEvent::GraphicsSceneMouseRelease: + d->mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); + break; +#endif +#ifndef QT_NO_CONTEXTMENU + case QEvent::ContextMenu: + d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev)->globalPos()); + break; +#if !defined(QT_NO_GRAPHICSVIEW) + case QEvent::GraphicsSceneContextMenu: + d->contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(ev)->screenPos()); + break; +#endif +#endif +#ifndef QT_NO_WHEELEVENT + case QEvent::Wheel: + d->wheelEvent(static_cast<QWheelEvent*>(ev)); + break; +#if !defined(QT_NO_GRAPHICSVIEW) + case QEvent::GraphicsSceneWheel: + d->wheelEvent(static_cast<QGraphicsSceneWheelEvent*>(ev)); + break; +#endif +#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; +#if !defined(QT_NO_GRAPHICSVIEW) + case QEvent::GraphicsSceneDragEnter: + d->dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); + break; + case QEvent::GraphicsSceneDragMove: + d->dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); + break; + case QEvent::GraphicsSceneDragLeave: + d->dragLeaveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); + break; + case QEvent::GraphicsSceneDrop: + d->dropEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); + break; +#endif + +#endif + case QEvent::InputMethod: + d->inputMethodEvent(static_cast<QInputMethodEvent*>(ev)); + break; + case QEvent::ShortcutOverride: + d->shortcutOverrideEvent(static_cast<QKeyEvent*>(ev)); + break; + case QEvent::Leave: + d->leaveEvent(ev); + break; + case QEvent::TouchBegin: + case QEvent::TouchUpdate: + case QEvent::TouchEnd: + // Return whether the default action was cancelled in the JS event handler + return d->touchEvent(static_cast<QTouchEvent*>(ev)); +#ifndef QT_NO_PROPERTIES + case QEvent::DynamicPropertyChange: + d->dynamicPropertyChangeEvent(static_cast<QDynamicPropertyChangeEvent*>(ev)); + break; +#endif + 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. + + \sa modified, contentsChanged(), WebAction +*/ +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->editor()->applyEditingStyleToBodyElement(); + // FIXME: mac port calls this if there is no selectedDOMRange + //frame->setSelectionFromNone(); + } + } + + d->updateEditorActions(); + } +} + +bool QWebPage::isContentEditable() const +{ + return d->editable; +} + +/*! + \property QWebPage::forwardUnsupportedContent + \brief whether QWebPage should forward unsupported content + + If enabled, the unsupportedContent() signal is emitted with a network reply that + can be used to read the content. + + 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 = frameAt(event->pos())) { + Frame* frame = QWebFramePrivate::core(webFrame); + if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos())) + 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) +{ +#ifndef QT_NO_ACTION + // 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); + } + } +#endif // QT_NO_ACTION + + d->createMainFrame(); + WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame(); + HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false); + + if (result.scrollbar()) + d->hitTestResult = QWebHitTestResult(); + else + d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result)); + + d->page->contextMenuController()->setHitTestResult(result); + d->page->contextMenuController()->populate(); + +#if ENABLE(INSPECTOR) + if (d->page->inspectorController()->enabled()) + d->page->contextMenuController()->addInspectElementItem(); +#endif + + 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(d->page->contextMenuController()->contextMenu(), d->page->contextMenuController()->contextMenu()->platformDescription(), &visitedWebActions); +#endif // QT_NO_CONTEXTMENU + +#ifndef QT_NO_ACTION + // 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); + } + } +#endif // QT_NO_ACTION + + // 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. + + \value ErrorPageExtension Whether the web page can provide an error page when loading fails. + (introduced in Qt 4.6) + + \sa ChooseMultipleFilesExtensionOption, ChooseMultipleFilesExtensionReturn, ErrorPageExtensionOption, ErrorPageExtensionReturn +*/ + +/*! + \enum QWebPage::ErrorDomain + \since 4.6 + + This enum describes the domain of an ErrorPageExtensionOption object (i.e. the layer in which the error occurred). + + \value QtNetwork The error occurred in the QtNetwork layer; the error code is of type QNetworkReply::NetworkError. + \value Http The error occurred in the HTTP layer; the error code is a HTTP status code (see QNetworkRequest::HttpStatusCodeAttribute). + \value WebKit The error is an internal WebKit error. +*/ + +/*! + \class QWebPage::ExtensionOption + \since 4.4 + \brief The ExtensionOption class provides an extended input argument to QWebPage's extension support. + + \inmodule QtWebKit + + \sa QWebPage::extension() QWebPage::ExtensionReturn +*/ + + +/*! + \class QWebPage::ExtensionReturn + \since 4.4 + \brief The ExtensionReturn class provides an output result from a QWebPage's extension. + + \inmodule QtWebKit + + \sa QWebPage::extension() QWebPage::ExtensionOption +*/ + +/*! + \class QWebPage::ErrorPageExtensionOption + \since 4.6 + \brief The ErrorPageExtensionOption class describes the option + for the error page extension. + + \inmodule QtWebKit + + The ErrorPageExtensionOption class holds the \a url for which an error occurred as well as + the associated \a frame. + + The error itself is reported by an error \a domain, the \a error code as well as \a errorString. + + \sa QWebPage::extension() QWebPage::ErrorPageExtensionReturn +*/ + +/*! + \variable QWebPage::ErrorPageExtensionOption::url + \brief the url for which an error occurred +*/ + +/*! + \variable QWebPage::ErrorPageExtensionOption::frame + \brief the frame associated with the error +*/ + +/*! + \variable QWebPage::ErrorPageExtensionOption::domain + \brief the domain that reported the error +*/ + +/*! + \variable QWebPage::ErrorPageExtensionOption::error + \brief the error code. Interpretation of the value depends on the \a domain + \sa QWebPage::ErrorDomain +*/ + +/*! + \variable QWebPage::ErrorPageExtensionOption::errorString + \brief a string that describes the error +*/ + +/*! + \class QWebPage::ErrorPageExtensionReturn + \since 4.6 + \brief The ErrorPageExtensionReturn describes the error page, which will be shown for the + frame for which the error occured. + + \inmodule QtWebKit + + The ErrorPageExtensionReturn class holds the data needed for creating an error page. Some are + optional such as \a contentType, which defaults to "text/html", as well as the \a encoding, which + is assumed to be UTF-8 if not indicated otherwise. + + The error page is stored in the \a content byte array, as HTML content. In order to convert a + QString to a byte array, the QString::toUtf8() method can be used. + + External objects such as stylesheets or images referenced in the HTML are located relative to + \a baseUrl. + + \sa QWebPage::extension() QWebPage::ErrorPageExtensionOption, QString::toUtf8() +*/ + +/*! + \fn QWebPage::ErrorPageExtensionReturn::ErrorPageExtensionReturn() + + Constructs a new error page object. +*/ + + +/*! + \variable QWebPage::ErrorPageExtensionReturn::contentType + \brief the error page's content type +*/ + +/*! + \variable QWebPage::ErrorPageExtensionReturn::encoding + \brief the error page encoding +*/ + +/*! + \variable QWebPage::ErrorPageExtensionReturn::baseUrl + \brief the base url + + External objects such as stylesheets or images referenced in the HTML are located relative to this url. +*/ + +/*! + \variable QWebPage::ErrorPageExtensionReturn::content + \brief the HTML content of the error page +*/ + +/*! + \class QWebPage::ChooseMultipleFilesExtensionOption + \since 4.5 + \brief The ChooseMultipleFilesExtensionOption class describes the option + for the multiple files selection extension. + + \inmodule QtWebKit + + The ChooseMultipleFilesExtensionOption class holds the frame originating the request + and the suggested filenames which might be provided. + + \sa QWebPage::extension() QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn +*/ + +/*! + \variable QWebPage::ChooseMultipleFilesExtensionOption::parentFrame + \brief The frame in which the request originated +*/ + +/*! + \variable QWebPage::ChooseMultipleFilesExtensionOption::suggestedFileNames + \brief The suggested filenames +*/ + +/*! + \variable QWebPage::ChooseMultipleFilesExtensionReturn::fileNames + \brief The selected filenames +*/ + +/*! + \class QWebPage::ChooseMultipleFilesExtensionReturn + \since 4.5 + \brief The ChooseMultipleFilesExtensionReturn describes the return value + for the multiple files selection extension. + + \inmodule QtWebKit + + The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user + when the extension is invoked. + + \sa QWebPage::extension() 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. The \a option + and \a output values are typically casted to the corresponding types (for + example, ChooseMultipleFilesExtensionOption and + ChooseMultipleFilesExtensionReturn for ChooseMultipleFilesExtension). + + 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; + QWidget* parent = (d->client) ? d->client->ownerWidget() : 0; + QStringList names = QFileDialog::getOpenFileNames(parent, 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 specified string, \a subString, in the page, using the given \a options. + + If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences + that exist in the page. All subsequent calls will extend the highlight, rather than + replace it, with occurrences of the new string. + + If the HighlightAllOccurrences flag is not passed, the function will select an occurrence + and all subsequent calls will replace the current occurrence with the next one. + + To clear the selection, just pass an empty string. + + Returns true if \a subString was found; otherwise returns false. +*/ +bool QWebPage::findText(const QString &subString, FindFlags options) +{ + ::TextCaseSensitivity caseSensitivity = ::TextCaseInsensitive; + if (options & FindCaseSensitively) + caseSensitivity = ::TextCaseSensitive; + + if (options & HighlightAllOccurrences) { + if (subString.isEmpty()) { + d->page->unmarkAllTextMatches(); + return true; + } else + return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0); + } else { + if (subString.isEmpty()) { + d->page->mainFrame()->selection()->clear(); + Frame* frame = d->page->mainFrame()->tree()->firstChild(); + while (frame) { + frame->selection()->clear(); + frame = frame->tree()->traverseNextWithWrap(false); + } + } + ::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. + + \sa ChooseMultipleFilesExtension +*/ +QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile) +{ + Q_UNUSED(parentFrame) +#ifndef QT_NO_FILEDIALOG + QWidget* parent = (d->client) ? d->client->ownerWidget() : 0; + return QFileDialog::getOpenFileName(parent, QString::null, suggestedFile); +#else + return QString::null; +#endif +} + +/*! + Sets the QNetworkAccessManager \a manager responsible for serving network requests for this + QWebPage. + + \note It is currently not supported to change the network access manager after the + QWebPage has used it. The results of doing this are undefined. + + \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; +} + +/*! + 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) %AppVersion Safari/%WebKitVersion%" + + On mobile platforms such as Symbian S60 and Maemo, "Mobile Safari" is used instead of "Safari". + + 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(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage, + then a default constructed QLocale is used instead. + \o %WebKitVersion% is the version of WebKit the application was compiled against. + \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&) const +{ + // splitting the string in three and user QStringBuilder is better than using QString::arg() + static QString firstPart; + static QString secondPart; + static QString thirdPart; + + if (firstPart.isNull() || secondPart.isNull() || thirdPart.isNull()) { + QString firstPartTemp; + firstPartTemp.reserve(150); + firstPartTemp += QString::fromLatin1("Mozilla/5.0 (" + + // Platform +#ifdef Q_WS_MAC + "Macintosh" +#elif defined Q_WS_QWS + "QtEmbedded" +#elif defined Q_WS_WIN + "Windows" +#elif defined Q_WS_X11 + "X11" +#elif defined Q_OS_SYMBIAN + "Symbian" +#else + "Unknown" +#endif + ); + +#if defined Q_OS_SYMBIAN + QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion(); + switch (symbianVersion) { + case QSysInfo::SV_9_2: + firstPartTemp += QString::fromLatin1("OS/9.2"); + break; + case QSysInfo::SV_9_3: + firstPartTemp += QString::fromLatin1("OS/9.3"); + break; + case QSysInfo::SV_9_4: + firstPartTemp += QString::fromLatin1("OS/9.4"); + break; + case QSysInfo::SV_SF_2: + firstPartTemp += QString::fromLatin1("/2"); + break; + case QSysInfo::SV_SF_3: + firstPartTemp += QString::fromLatin1("/3"); + break; + case QSysInfo::SV_SF_4: + firstPartTemp += QString::fromLatin1("/4"); + default: + break; + } +#endif + + firstPartTemp += QString::fromLatin1("; "); + + // SSL support +#if !defined(QT_NO_OPENSSL) + // we could check QSslSocket::supportsSsl() here, but this makes + // OpenSSL, certificates etc being loaded in all cases were QWebPage + // is used. This loading is not needed for non-https. + firstPartTemp += QString::fromLatin1("U; "); + // this may lead to a false positive: We indicate SSL since it is + // compiled in even though supportsSsl() might return false +#else + firstPartTemp += QString::fromLatin1("N; "); +#endif + + // Operating system +#ifdef Q_OS_AIX + firstPartTemp += QString::fromLatin1("AIX"); +#elif defined Q_OS_WIN32 + + switch (QSysInfo::WindowsVersion) { + case QSysInfo::WV_32s: + firstPartTemp += QString::fromLatin1("Windows 3.1"); + break; + case QSysInfo::WV_95: + firstPartTemp += QString::fromLatin1("Windows 95"); + break; + case QSysInfo::WV_98: + firstPartTemp += QString::fromLatin1("Windows 98"); + break; + case QSysInfo::WV_Me: + firstPartTemp += QString::fromLatin1("Windows 98; Win 9x 4.90"); + break; + case QSysInfo::WV_NT: + firstPartTemp += QString::fromLatin1("WinNT4.0"); + break; + case QSysInfo::WV_2000: + firstPartTemp += QString::fromLatin1("Windows NT 5.0"); + break; + case QSysInfo::WV_XP: + firstPartTemp += QString::fromLatin1("Windows NT 5.1"); + break; + case QSysInfo::WV_2003: + firstPartTemp += QString::fromLatin1("Windows NT 5.2"); + break; + case QSysInfo::WV_VISTA: + firstPartTemp += QString::fromLatin1("Windows NT 6.0"); + break; + case QSysInfo::WV_WINDOWS7: + firstPartTemp += QString::fromLatin1("Windows NT 6.1"); + break; + case QSysInfo::WV_CE: + firstPartTemp += QString::fromLatin1("Windows CE"); + break; + case QSysInfo::WV_CENET: + firstPartTemp += QString::fromLatin1("Windows CE .NET"); + break; + case QSysInfo::WV_CE_5: + firstPartTemp += QString::fromLatin1("Windows CE 5.x"); + break; + case QSysInfo::WV_CE_6: + firstPartTemp += QString::fromLatin1("Windows CE 6.x"); + break; + } + +#elif defined Q_OS_DARWIN +#ifdef __i386__ || __x86_64__ + firstPartTemp += QString::fromLatin1("Intel Mac OS X"); +#else + firstPartTemp += QString::fromLatin1("PPC Mac OS X"); +#endif + +#elif defined Q_OS_BSDI + firstPartTemp += QString::fromLatin1("BSD"); +#elif defined Q_OS_BSD4 + firstPartTemp += QString::fromLatin1("BSD Four"); +#elif defined Q_OS_CYGWIN + firstPartTemp += QString::fromLatin1("Cygwin"); +#elif defined Q_OS_DGUX + firstPartTemp += QString::fromLatin1("DG/UX"); +#elif defined Q_OS_DYNIX + firstPartTemp += QString::fromLatin1("DYNIX/ptx"); +#elif defined Q_OS_FREEBSD + firstPartTemp += QString::fromLatin1("FreeBSD"); +#elif defined Q_OS_HPUX + firstPartTemp += QString::fromLatin1("HP-UX"); +#elif defined Q_OS_HURD + firstPartTemp += QString::fromLatin1("GNU Hurd"); +#elif defined Q_OS_IRIX + firstPartTemp += QString::fromLatin1("SGI Irix"); +#elif defined Q_OS_LINUX + +#if defined(__x86_64__) + firstPartTemp += QString::fromLatin1("Linux x86_64"); +#elif defined(__i386__) + firstPartTemp += QString::fromLatin1("Linux i686"); +#else + firstPartTemp += QString::fromLatin1("Linux"); +#endif + +#elif defined Q_OS_LYNX + firstPartTemp += QString::fromLatin1("LynxOS"); +#elif defined Q_OS_NETBSD + firstPartTemp += QString::fromLatin1("NetBSD"); +#elif defined Q_OS_OS2 + firstPartTemp += QString::fromLatin1("OS/2"); +#elif defined Q_OS_OPENBSD + firstPartTemp += QString::fromLatin1("OpenBSD"); +#elif defined Q_OS_OS2EMX + firstPartTemp += QString::fromLatin1("OS/2"); +#elif defined Q_OS_OSF + firstPartTemp += QString::fromLatin1("HP Tru64 UNIX"); +#elif defined Q_OS_QNX6 + firstPartTemp += QString::fromLatin1("QNX RTP Six"); +#elif defined Q_OS_QNX + firstPartTemp += QString::fromLatin1("QNX"); +#elif defined Q_OS_RELIANT + firstPartTemp += QString::fromLatin1("Reliant UNIX"); +#elif defined Q_OS_SCO + firstPartTemp += QString::fromLatin1("SCO OpenServer"); +#elif defined Q_OS_SOLARIS + firstPartTemp += QString::fromLatin1("Sun Solaris"); +#elif defined Q_OS_ULTRIX + firstPartTemp += QString::fromLatin1("DEC Ultrix"); +#elif defined Q_OS_SYMBIAN + firstPartTemp += QLatin1Char(' '); + QSysInfo::S60Version s60Version = QSysInfo::s60Version(); + switch (s60Version) { + case QSysInfo::SV_S60_3_1: + firstPartTemp += QString::fromLatin1("Series60/3.1"); + break; + case QSysInfo::SV_S60_3_2: + firstPartTemp += QString::fromLatin1("Series60/3.2"); + break; + case QSysInfo::SV_S60_5_0: + firstPartTemp += QString::fromLatin1("Series60/5.0"); + break; + default: + break; + } +#elif defined Q_OS_UNIX + firstPartTemp += QString::fromLatin1("UNIX BSD/SYSV system"); +#elif defined Q_OS_UNIXWARE + firstPartTemp += QString::fromLatin1("UnixWare Seven, Open UNIX Eight"); +#else + firstPartTemp += QString::fromLatin1("Unknown"); +#endif + + // language is the split + firstPartTemp += QString::fromLatin1("; "); + firstPartTemp.squeeze(); + firstPart = firstPartTemp; + + QString secondPartTemp; + secondPartTemp.reserve(150); + secondPartTemp += QString::fromLatin1(") "); + + // webkit/qt version + secondPartTemp += QString::fromLatin1("AppleWebKit/"); + secondPartTemp += qWebKitVersion(); + secondPartTemp += QString::fromLatin1(" (KHTML, like Gecko) "); + + + // Application name split the third part + secondPartTemp.squeeze(); + secondPart = secondPartTemp; + + QString thirdPartTemp; + thirdPartTemp.reserve(150); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + thirdPartTemp += QLatin1String(" Mobile Safari/"); +#else + thirdPartTemp += QLatin1String(" Safari/"); +#endif + thirdPartTemp += qWebKitVersion(); + thirdPartTemp.squeeze(); + thirdPart = thirdPartTemp; + Q_ASSERT(!firstPart.isNull()); + Q_ASSERT(!secondPart.isNull()); + Q_ASSERT(!thirdPart.isNull()); + } + + // Language + QString languageName; + if (d->client && d->client->ownerWidget()) + languageName = d->client->ownerWidget()->locale().name(); + else + languageName = QLocale().name(); + languageName.replace(QLatin1Char('_'), QLatin1Char('-')); + + // Application name/version + QString appName = QCoreApplication::applicationName(); + if (!appName.isEmpty()) { + QString appVer = QCoreApplication::applicationVersion(); + if (!appVer.isEmpty()) + appName.append(QLatin1Char('/') + appVer); + } else { + // Qt version + appName = QString::fromLatin1("Qt/") + QString::fromLatin1(qVersion()); + } + + return firstPart + languageName + secondPart + appName + thirdPart; +} + + +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_totalBytes; +} + + +/*! + Returns the number of bytes that were received from the network to render the current page. + + \sa totalBytes(), loadProgress() +*/ +quint64 QWebPage::bytesReceived() const +{ + return d->m_bytesReceived; +} + +/*! + \since 4.7 + \fn void QWebPage::viewportChangeRequested() + + Page authors can provide the supplied values by using the viewport meta tag. More information + about this can be found at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}. + + \sa QWebPage::ViewportAttributes, setPreferredContentsSize(), QGraphicsWebView::setScale() +*/ + +/*! + \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(), ErrorPageExtension +*/ + +/*! + \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. + + \sa currentFrame() +*/ + +/*! + \fn void QWebPage::selectionChanged() + + This signal is emitted whenever the selection changes, either interactively + or programmatically (e.g. by calling triggerAction() with a selection action). + + \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, modified, 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 signal is emitted when WebKit cannot handle a link the user navigated to or a + web server's response includes a "Content-Disposition" header with the 'attachment' + directive. If "Content-Disposition" is present in \a reply, the web server is indicating + that the client should prompt the user to save the content regardless of content-type. + See RFC 2616 sections 19.5.1 for details about Content-Disposition. + + At signal emission 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 to inform input methods about the new on-screen position where + the user is able to enter text. This signal is usually connected to the + QWidget::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. + + \note This signal possibly won't be emitted for clicked links which use + JavaScript to trigger navigation. + + \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. + + \sa QWebDatabase +*/ +/*! + \fn void QWebPage::applicationCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 defaultOriginQuota); + + This signal is emitted whenever the web site is asking to store data to the application cache + database 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/Source/WebKit/qt/Api/qwebpage.h b/Source/WebKit/qt/Api/qwebpage.h new file mode 100644 index 0000000..b66adb2 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebpage.h @@ -0,0 +1,449 @@ +/* + 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 <QtCore/qurl.h> +#include <QtGui/qwidget.h> + +QT_BEGIN_NAMESPACE +class QNetworkProxy; +class QUndoStack; +class QMenu; +class QNetworkRequest; +class QNetworkReply; +class QNetworkAccessManager; +QT_END_NAMESPACE + +class QWebElement; +class QWebFrame; +class QWebNetworkRequest; +class QWebHistory; + +class QWebFrameData; +class QWebHistoryItem; +class QWebHitTestResult; +class QWebNetworkInterface; +class QWebPagePrivate; +class QWebPluginFactory; +class QWebSecurityOrigin; +class QtViewportAttributesPrivate; + +namespace WebCore { + class ChromeClientQt; + class EditorClientQt; + class FrameLoaderClientQt; + class InspectorClientQt; + class InspectorServerRequestHandlerQt; + class InspectorFrontendClientQt; + class NotificationPresenterClientQt; + class GeolocationPermissionClientQt; + class ResourceHandle; + class HitTestResult; + class QNetworkReplyHandler; + + struct FrameLoadRequest; +} + +class QWEBKIT_EXPORT QWebPage : public QObject { + Q_OBJECT + + Q_PROPERTY(bool modified READ isModified) + Q_PROPERTY(QString selectedText READ selectedText) + Q_PROPERTY(QString selectedHtml READ selectedHtml) + Q_PROPERTY(bool hasSelection READ hasSelection) + Q_PROPERTY(QSize viewportSize READ viewportSize WRITE setViewportSize) + Q_PROPERTY(QSize preferredContentsSize READ preferredContentsSize WRITE setPreferredContentsSize) + 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, + ReloadAndBypassCache, + + PasteAndMatchStyle, + RemoveFormat, + + ToggleStrikethrough, + ToggleSubscript, + ToggleSuperscript, + InsertUnorderedList, + InsertOrderedList, + Indent, + Outdent, + + AlignCenter, + AlignJustified, + AlignLeft, + AlignRight, + + StopScheduledPageRefresh, + + WebActionCount + }; + + enum FindFlag { + FindBackward = 1, + FindCaseSensitively = 2, + FindWrapsAroundDocument = 4, + HighlightAllOccurrences = 8 + }; + Q_DECLARE_FLAGS(FindFlags, FindFlag) + + enum LinkDelegationPolicy { + DontDelegateLinks, + DelegateExternalLinks, + DelegateAllLinks + }; + + enum WebWindowType { + WebBrowserWindow, + WebModalDialog + }; + + enum PermissionPolicy { + PermissionUnknown, + PermissionGrantedByUser, + PermissionDeniedByUser + }; + + enum Feature { + Notifications, + Geolocation + }; + + class QWEBKIT_EXPORT ViewportAttributes { + public: + ViewportAttributes(); + ViewportAttributes(const QWebPage::ViewportAttributes& other); + + ~ViewportAttributes(); + + QWebPage::ViewportAttributes& operator=(const QWebPage::ViewportAttributes& other); + + inline qreal initialScaleFactor() const { return m_initialScaleFactor; } + inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; } + inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; } + inline qreal devicePixelRatio() const { return m_devicePixelRatio; } + inline bool isUserScalable() const { return m_isUserScalable; } + inline bool isValid() const { return m_isValid; } + inline QSize size() const { return m_size; } + + private: + QSharedDataPointer<QtViewportAttributesPrivate> d; + qreal m_initialScaleFactor; + qreal m_minimumScaleFactor; + qreal m_maximumScaleFactor; + qreal m_devicePixelRatio; + bool m_isUserScalable; + bool m_isValid; + QSize m_size; + + friend class WebCore::ChromeClientQt; + friend class QWebPage; + }; + + + explicit QWebPage(QObject *parent = 0); + ~QWebPage(); + + QWebFrame *mainFrame() const; + QWebFrame *currentFrame() const; + QWebFrame* frameAt(const QPoint& pos) 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 + + void setNetworkAccessManager(QNetworkAccessManager *manager); + QNetworkAccessManager *networkAccessManager() const; + + void setPluginFactory(QWebPluginFactory *factory); + QWebPluginFactory *pluginFactory() const; + + quint64 totalBytes() const; + quint64 bytesReceived() const; + + bool hasSelection() const; + QString selectedText() const; + QString selectedHtml() const; + +#ifndef QT_NO_ACTION + QAction *action(WebAction action) const; +#endif + virtual void triggerAction(WebAction action, bool checked = false); + + QSize viewportSize() const; + void setViewportSize(const QSize &size) const; + ViewportAttributes viewportAttributesForSize(const QSize& availableSize) const; + + QSize preferredContentsSize() const; + void setPreferredContentsSize(const QSize &size) const; + void setActualVisibleContentRect(const QRect& rect) 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(); + + void setFeaturePermission(QWebFrame* frame, Feature feature, PermissionPolicy policy); + + QStringList supportedContentTypes() const; + bool supportsContentType(const QString& mimeType) const; + + enum Extension { + ChooseMultipleFilesExtension, + ErrorPageExtension + }; + class ExtensionOption + {}; + class ExtensionReturn + {}; + + class ChooseMultipleFilesExtensionOption : public ExtensionOption { + public: + QWebFrame *parentFrame; + QStringList suggestedFileNames; + }; + + class ChooseMultipleFilesExtensionReturn : public ExtensionReturn { + public: + QStringList fileNames; + }; + + enum ErrorDomain { QtNetwork, Http, WebKit }; + class ErrorPageExtensionOption : public ExtensionOption { + public: + QUrl url; + QWebFrame* frame; + ErrorDomain domain; + int error; + QString errorString; + }; + + class ErrorPageExtensionReturn : public ExtensionReturn { + public: + ErrorPageExtensionReturn() : contentType(QLatin1String("text/html")), encoding(QLatin1String("utf-8")) {}; + QString contentType; + QString encoding; + QUrl baseUrl; + QByteArray content; + }; + + + virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0); + virtual bool supportsExtension(Extension extension) const; + + inline QWebPagePrivate* handle() const { return d; } + +public Q_SLOTS: + bool shouldInterruptJavaScript(); + +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); + + void unsupportedContent(QNetworkReply *reply); + void downloadRequested(const QNetworkRequest &request); + + void microFocusChanged(); + void contentsChanged(); + void databaseQuotaExceeded(QWebFrame* frame, QString databaseName); + void applicationCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 defaultOriginQuota); + + void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item); + void restoreFrameStateRequested(QWebFrame* frame); + + void viewportChangeRequested(); + + void featurePermissionRequested(QWebFrame* frame, QWebPage::Feature feature); + void featurePermissionRequestCanceled(QWebFrame* frame, QWebPage::Feature feature); + +protected: + virtual QWebPage *createWindow(WebWindowType type); + virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues); + + virtual bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type); + 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)) +#ifndef QT_NO_ACTION + Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked)) +#endif + Q_PRIVATE_SLOT(d, void _q_cleanupLeakMessages()) + + QWebPagePrivate *d; + + friend class QWebFrame; + friend class QWebPagePrivate; + friend class QWebView; + friend class QWebViewPrivate; + friend class QGraphicsWebView; + friend class QGraphicsWebViewPrivate; + friend class QWebInspector; + friend class WebCore::ChromeClientQt; + friend class WebCore::EditorClientQt; + friend class WebCore::FrameLoaderClientQt; + friend class WebCore::InspectorClientQt; + friend class WebCore::InspectorServerRequestHandlerQt; + friend class WebCore::InspectorFrontendClientQt; + friend class WebCore::NotificationPresenterClientQt; + friend class WebCore::GeolocationPermissionClientQt; + friend class WebCore::ResourceHandle; + friend class WebCore::QNetworkReplyHandler; + friend class DumpRenderTreeSupportQt; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QWebPage::FindFlags) + +#endif diff --git a/Source/WebKit/qt/Api/qwebpage_p.h b/Source/WebKit/qt/Api/qwebpage_p.h new file mode 100644 index 0000000..7bd1252 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebpage_p.h @@ -0,0 +1,218 @@ +/* + 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 <qgraphicssceneevent.h> + +#include "qwebpage.h" +#include "qwebhistory.h" +#include "qwebframe.h" + +#include "IntPoint.h" +#include "KURL.h" +#include "PlatformString.h" + +#include <wtf/OwnPtr.h> +#include <wtf/RefPtr.h> + +#include "ViewportArguments.h" + +namespace WebCore { + class ChromeClientQt; + class ContextMenuClientQt; + class ContextMenuItem; + class ContextMenu; + class Document; + class EditorClientQt; + class Element; + class InspectorController; + class IntRect; + class Node; + class NodeList; + class Page; + class Frame; +} + +QT_BEGIN_NAMESPACE +class QUndoStack; +class QMenu; +class QBitArray; +QT_END_NAMESPACE + +class QWebInspector; +class QWebPageClient; + +class QtViewportAttributesPrivate : public QSharedData { +public: + QtViewportAttributesPrivate(QWebPage::ViewportAttributes* qq) + : q(qq) + { } + + QWebPage::ViewportAttributes* q; +}; + +class QWebPagePrivate { +public: + QWebPagePrivate(QWebPage*); + ~QWebPagePrivate(); + + static WebCore::Page* core(const QWebPage*); + static QWebPagePrivate* priv(QWebPage*); + + void createMainFrame(); +#ifndef QT_NO_CONTEXTMENU + QMenu* createContextMenu(const WebCore::ContextMenu* webcoreMenu, const QList<WebCore::ContextMenuItem>* items, QBitArray* visitedWebActions); +#endif + void _q_onLoadProgressChanged(int); + void _q_webActionTriggered(bool checked); + void _q_cleanupLeakMessages(); + void updateAction(QWebPage::WebAction action); + void updateNavigationActions(); + void updateEditorActions(); + + void timerEvent(QTimerEvent*); + + template<class T> void mouseMoveEvent(T*); + template<class T> void mousePressEvent(T*); + template<class T> void mouseDoubleClickEvent(T*); + template<class T> void mouseTripleClickEvent(T*); + template<class T> void mouseReleaseEvent(T*); +#ifndef QT_NO_CONTEXTMENU + void contextMenuEvent(const QPoint& globalPos); +#endif +#ifndef QT_NO_WHEELEVENT + template<class T> void wheelEvent(T*); +#endif + void keyPressEvent(QKeyEvent*); + void keyReleaseEvent(QKeyEvent*); + void focusInEvent(QFocusEvent*); + void focusOutEvent(QFocusEvent*); + + template<class T> void dragEnterEvent(T*); + template<class T> void dragLeaveEvent(T*); + template<class T> void dragMoveEvent(T*); + template<class T> void dropEvent(T*); + + void inputMethodEvent(QInputMethodEvent*); + +#ifndef QT_NO_PROPERTIES + void dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent*); +#endif + + void shortcutOverrideEvent(QKeyEvent*); + void leaveEvent(QEvent*); + void handleClipboard(QEvent*, Qt::MouseButton); + void handleSoftwareInputPanel(Qt::MouseButton, const QPoint&); + bool handleScrolling(QKeyEvent*, WebCore::Frame*); + + // Returns whether the default action was cancelled in the JS event handler + bool touchEvent(QTouchEvent*); + + class TouchAdjuster { + public: + TouchAdjuster(unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding); + + WebCore::IntPoint findCandidatePointForTouch(const WebCore::IntPoint&, WebCore::Document*) const; + + private: + unsigned m_topPadding; + unsigned m_rightPadding; + unsigned m_bottomPadding; + unsigned m_leftPadding; + }; + + void adjustPointForClicking(QMouseEvent*); +#if !defined(QT_NO_GRAPHICSVIEW) + void adjustPointForClicking(QGraphicsSceneMouseEvent*); +#endif + + void setInspector(QWebInspector*); + QWebInspector* getOrCreateInspector(); + WebCore::InspectorController* inspectorController(); + quint16 inspectorServerPort(); + + WebCore::ViewportArguments viewportArguments(); + +#ifndef QT_NO_SHORTCUT + static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event); +#endif + static const char* editorCommandForWebActions(QWebPage::WebAction action); + + QWebPage *q; + WebCore::Page *page; + OwnPtr<QWebPageClient> client; + QPointer<QWebFrame> mainFrame; + +#ifndef QT_NO_UNDOSTACK + QUndoStack *undoStack; +#endif + + QWeakPointer<QWidget> view; + + bool insideOpenCall; + quint64 m_totalBytes; + quint64 m_bytesReceived; + + QPoint tripleClick; + QBasicTimer tripleClickTimer; + + bool clickCausedFocus; + + bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type); + QNetworkAccessManager *networkManager; + + bool forwardUnsupportedContent; + bool smartInsertDeleteEnabled; + bool selectTrailingWhitespaceEnabled; + QWebPage::LinkDelegationPolicy linkPolicy; + + QSize viewportSize; + QSize fixedLayoutSize; + qreal pixelRatio; + + QWebHistory history; + QWebHitTestResult hitTestResult; +#ifndef QT_NO_CONTEXTMENU + QPointer<QMenu> currentContextMenu; +#endif + QWebSettings *settings; + QPalette palette; + bool editable; + bool useFixedLayout; + + QAction *actions[QWebPage::WebActionCount]; + + QWebPluginFactory *pluginFactory; + + QWidget* inspectorFrontend; + QWebInspector* inspector; + bool inspectorIsInternalOnly; // True if created through the Inspect context menu action + Qt::DropAction m_lastDropAction; + + static bool drtRun; +}; + +#endif diff --git a/Source/WebKit/qt/Api/qwebplugindatabase.cpp b/Source/WebKit/qt/Api/qwebplugindatabase.cpp new file mode 100644 index 0000000..a7a3b5f --- /dev/null +++ b/Source/WebKit/qt/Api/qwebplugindatabase.cpp @@ -0,0 +1,393 @@ +/* + Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com> + + 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 "qwebplugindatabase_p.h" + +#include "PluginDatabase.h" +#include "PluginPackage.h" + +using namespace WebCore; + +/*! + \internal + \typedef QWebPluginInfo::MimeType + \since 4.6 + \brief Represents a single MIME type supported by a plugin. +*/ + +/*! + \class QWebPluginInfo + \internal + \since 4.6 + \brief The QWebPluginInfo class represents a single Netscape plugin. + + A QWebPluginInfo object represents a Netscape plugin picked up by WebKit + and included in the plugin database. This class contains information about + the plugin, such as its name(), description(), a list of MIME types that it + supports (can be accessed with mimeTypes()) and the path of the plugin + file. + + Plugins can be enabled and disabled with setEnabled(). If a plugin is + disabled, it will not be used by WebKit to handle supported MIME types. To + check if a plugin is enabled or not, use enabled(). + + \sa QWebPluginDatabase +*/ + +/*! + Constructs a null QWebPluginInfo. +*/ +QWebPluginInfo::QWebPluginInfo() + : m_package(0) +{ +} + +QWebPluginInfo::QWebPluginInfo(PluginPackage* package) + : m_package(package) +{ + if (m_package) + m_package->ref(); +} + +/*! + Contructs a copy of \a other. +*/ +QWebPluginInfo::QWebPluginInfo(const QWebPluginInfo& other) + : m_package(other.m_package) +{ + if (m_package) + m_package->ref(); +} + +/*! + Destroys the plugin info. +*/ +QWebPluginInfo::~QWebPluginInfo() +{ + if (m_package) + m_package->deref(); +} + +/*! + Returns the name of the plugin. + + \sa description() +*/ +QString QWebPluginInfo::name() const +{ + if (!m_package) + return QString(); + return m_package->name(); +} + +/*! + Returns the description of the plugin. + + \sa name() +*/ +QString QWebPluginInfo::description() const +{ + if (!m_package) + return QString(); + return m_package->description(); +} + +/*! + Returns a list of MIME types supported by the plugin. + + \sa supportsMimeType() +*/ +QList<QWebPluginInfo::MimeType> QWebPluginInfo::mimeTypes() const +{ + if (m_package && m_mimeTypes.isEmpty()) { + const MIMEToDescriptionsMap& mimeToDescriptions = m_package->mimeToDescriptions(); + MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end(); + + for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) { + MimeType mimeType; + mimeType.name = it->first; + mimeType.description = it->second; + + QStringList fileExtensions; + Vector<String> extensions = m_package->mimeToExtensions().get(mimeType.name); + + for (unsigned i = 0; i < extensions.size(); ++i) + fileExtensions.append(extensions[i]); + + mimeType.fileExtensions = fileExtensions; + m_mimeTypes.append(mimeType); + } + } + + return m_mimeTypes; +} + +/*! + Returns true if the plugin supports a specific \a mimeType; otherwise + returns false. + + \sa mimeTypes() +*/ +bool QWebPluginInfo::supportsMimeType(const QString& mimeType) const +{ + if (!m_package) + return false; + return m_package->mimeToDescriptions().contains(mimeType); +} + +/*! + Returns an absolute path to the plugin file. +*/ +QString QWebPluginInfo::path() const +{ + if (!m_package) + return QString(); + return m_package->path(); +} + +/*! + Returns true if the plugin is a null plugin; otherwise returns false. +*/ +bool QWebPluginInfo::isNull() const +{ + return !m_package; +} + +/*! + Enables or disables the plugin, depending on the \a enabled parameter. + + Disabled plugins will not be picked up by WebKit when looking for a plugin + supporting a particular MIME type. + + \sa isEnabled() +*/ +void QWebPluginInfo::setEnabled(bool enabled) +{ + if (!m_package) + return; + m_package->setEnabled(enabled); +} + +/*! + Returns true if the plugin is enabled; otherwise returns false. + + \sa setEnabled() +*/ +bool QWebPluginInfo::isEnabled() const +{ + if (!m_package) + return false; + return m_package->isEnabled(); +} + +/*! + Returns true if this plugin info is the same as the \a other plugin info. +*/ +bool QWebPluginInfo::operator==(const QWebPluginInfo& other) const +{ + return m_package == other.m_package; +} + +/*! + Returns true if this plugin info is different from the \a other plugin info. +*/ +bool QWebPluginInfo::operator!=(const QWebPluginInfo& other) const +{ + return m_package != other.m_package; +} + +/*! + Assigns the \a other plugin info to this plugin info, and returns a reference + to this plugin info. +*/ +QWebPluginInfo &QWebPluginInfo::operator=(const QWebPluginInfo& other) +{ + if (this == &other) + return *this; + + if (m_package) + m_package->deref(); + m_package = other.m_package; + if (m_package) + m_package->ref(); + m_mimeTypes = other.m_mimeTypes; + + return *this; +} + +/*! + \class QWebPluginDatabase + \internal + \since 4.6 + \brief The QWebPluginDatabase class provides an interface for managing + Netscape plugins used by WebKit in QWebPages. + + The QWebPluginDatabase class is a database of Netscape plugins that are used + by WebKit. The plugins are picked up by WebKit by looking up a set of search paths. + The default set can be accessed using defaultSearchPaths(). The search paths + can be changed, see searchPaths() and setSearchPaths(). Additional search paths + can also be added using addSearchPath(). + + The plugins that have been detected are exposed by the plugins() method. + The list contains QWebPlugin objects that hold both the metadata and the MIME + types that are supported by particular plugins. + + WebKit specifies a plugin for a MIME type by looking for the first plugin that + supports the specific MIME type. To get a plugin, that is used by WebKit to + handle a specific MIME type, you can use the pluginForMimeType() function. + + To change the way of resolving MIME types ambiguity, you can explicitly set + a preferred plugin for a specific MIME type, using setPreferredPluginForMimeType(). + + \sa QWebPluginInfo, QWebSettings::pluginDatabase() +*/ + +QWebPluginDatabase::QWebPluginDatabase(QObject* parent) + : QObject(parent) + , m_database(PluginDatabase::installedPlugins()) +{ +} + +QWebPluginDatabase::~QWebPluginDatabase() +{ +} + +/*! + Returns a list of plugins installed in the search paths. + + This list will contain disabled plugins, although they will not be used by + WebKit. + + \sa pluginForMimeType() +*/ +QList<QWebPluginInfo> QWebPluginDatabase::plugins() const +{ + QList<QWebPluginInfo> qwebplugins; + const Vector<PluginPackage*>& plugins = m_database->plugins(); + + for (unsigned int i = 0; i < plugins.size(); ++i) { + PluginPackage* plugin = plugins[i]; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + if (!plugin->ensurePluginLoaded()) + continue; +#endif + qwebplugins.append(QWebPluginInfo(plugin)); + } + + return qwebplugins; +} + +/*! + Returns a default set of search paths. + + \sa searchPaths(), setSearchPaths() +*/ +QStringList QWebPluginDatabase::defaultSearchPaths() +{ + QStringList paths; + + const Vector<String>& directories = PluginDatabase::defaultPluginDirectories(); + for (unsigned int i = 0; i < directories.size(); ++i) + paths.append(directories[i]); + + return paths; +} + +/*! + Returns a list of search paths that are used by WebKit to look for plugins. + + \sa defaultSearchPaths(), setSearchPaths() +*/ +QStringList QWebPluginDatabase::searchPaths() const +{ + QStringList paths; + + const Vector<String>& directories = m_database->pluginDirectories(); + for (unsigned int i = 0; i < directories.size(); ++i) + paths.append(directories[i]); + + return paths; +} + +/*! + Changes the search paths to \a paths. + The database is automatically refreshed. + + \sa searchPaths(), defaultSearchPaths() +*/ +void QWebPluginDatabase::setSearchPaths(const QStringList& paths) +{ + Vector<String> directories; + + for (int i = 0; i < paths.count(); ++i) + directories.append(paths.at(i)); + + m_database->setPluginDirectories(directories); + // PluginDatabase::setPluginDirectories() does not refresh the database. + m_database->refresh(); +} + +/*! + Adds an additional \a path to the current set. + The database is automatically refreshed. + + \sa searchPaths(), setSearchPaths() +*/ +void QWebPluginDatabase::addSearchPath(const QString& path) +{ + m_database->addExtraPluginDirectory(path); + // PluginDatabase::addExtraPluginDirectory() does refresh the database. +} + +/*! + Refreshes the plugin database, adds new plugins that have been found and removes + the ones that are no longer available in the search paths. + + You can call this function when the set of plugins installed in the search paths + changes. You do not need to call this function when changing search paths, + in that case WebKit automatically refreshes the database. +*/ +void QWebPluginDatabase::refresh() +{ + m_database->refresh(); +} + +/*! + Returns the plugin that is currently used by WebKit for a given \a mimeType. + + \sa setPreferredPluginForMimeType() +*/ +QWebPluginInfo QWebPluginDatabase::pluginForMimeType(const QString& mimeType) +{ + return QWebPluginInfo(m_database->pluginForMIMEType(mimeType)); +} + +/*! + Changes the preferred plugin for a given \a mimeType to \a plugin. The \a plugin + has to support the given \a mimeType, otherwise the setting will have no effect. + + Calling the function with a null \a plugin resets the setting. + + \sa pluginForMimeType() +*/ +void QWebPluginDatabase::setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin) +{ + m_database->setPreferredPluginForMIMEType(mimeType, plugin.m_package); +} diff --git a/Source/WebKit/qt/Api/qwebplugindatabase_p.h b/Source/WebKit/qt/Api/qwebplugindatabase_p.h new file mode 100644 index 0000000..b22c3de --- /dev/null +++ b/Source/WebKit/qt/Api/qwebplugindatabase_p.h @@ -0,0 +1,98 @@ +/* + Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com> + + 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 QWEBPLUGINDATABASE_H +#define QWEBPLUGINDATABASE_H + +#include "qwebkitglobal.h" +#include "qwebpluginfactory.h" + +#include <QtCore/qobject.h> +#include <QtCore/qstringlist.h> + +namespace WebCore { + class PluginDatabase; + class PluginPackage; +} + +class QWebPluginInfoPrivate; +class QWEBKIT_EXPORT QWebPluginInfo { +public: + QWebPluginInfo(); + QWebPluginInfo(const QWebPluginInfo& other); + QWebPluginInfo &operator=(const QWebPluginInfo& other); + ~QWebPluginInfo(); + +private: + QWebPluginInfo(WebCore::PluginPackage* package); + +public: + typedef QWebPluginFactory::MimeType MimeType; + + QString name() const; + QString description() const; + QList<MimeType> mimeTypes() const; + bool supportsMimeType(const QString& mimeType) const; + QString path() const; + + bool isNull() const; + + void setEnabled(bool enabled); + bool isEnabled() const; + + bool operator==(const QWebPluginInfo& other) const; + bool operator!=(const QWebPluginInfo& other) const; + + friend class QWebPluginDatabase; + +private: + QWebPluginInfoPrivate* d; + WebCore::PluginPackage* m_package; + mutable QList<MimeType> m_mimeTypes; +}; + +class QWebPluginDatabasePrivate; +class QWEBKIT_EXPORT QWebPluginDatabase : public QObject { + Q_OBJECT + +private: + QWebPluginDatabase(QObject* parent = 0); + ~QWebPluginDatabase(); + +public: + QList<QWebPluginInfo> plugins() const; + + static QStringList defaultSearchPaths(); + QStringList searchPaths() const; + void setSearchPaths(const QStringList& paths); + void addSearchPath(const QString& path); + + void refresh(); + + QWebPluginInfo pluginForMimeType(const QString& mimeType); + void setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin); + + friend class QWebSettings; + +private: + QWebPluginDatabasePrivate* d; + WebCore::PluginDatabase* m_database; +}; + +#endif // QWEBPLUGINDATABASE_H diff --git a/Source/WebKit/qt/Api/qwebpluginfactory.cpp b/Source/WebKit/qt/Api/qwebpluginfactory.cpp new file mode 100644 index 0000000..b9180be --- /dev/null +++ b/Source/WebKit/qt/Api/qwebpluginfactory.cpp @@ -0,0 +1,264 @@ +/* + 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 is used to embed custom data types in web pages. + + \inmodule QtWebKit + + The HTML \c{<object>} tag is used to embed arbitrary content into a web page, + for example: + + \code + <object type="application/x-pdf" data="http://qt.nokia.com/document.pdf" width="500" height="400"></object> + \endcode + + QtWebkit will natively handle the most basic data types like \c{text/html} and + \c{image/jpeg}, but for any advanced or custom data types you will need to + provide a handler yourself. + + QWebPluginFactory is a factory for creating plugins for QWebPage, where each + plugin provides support for one or more data types. 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 provide a QWebPluginFactory by implementing the plugins() and the + create() methods. 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 of your content. + + 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. + + The plugins themselves are subclasses of QObject, but currently only plugins + based on either QWidget or QGraphicsWidget are supported. + +*/ + + +/*! + \class QWebPluginFactory::Plugin + \since 4.4 + \brief The QWebPluginFactory::Plugin structure describes the properties of a plugin a QWebPluginFactory can create. + + \inmodule QtWebKit +*/ + +/*! + \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. + + \inmodule QtWebKit +*/ + +/*! + Returns true if this mimetype is the same as the \a other mime type. +*/ +bool QWebPluginFactory::MimeType::operator==(const MimeType& other) const +{ + return name == other.name + && description == other.description + && fileExtensions == other.fileExtensions; +} + +/*! + \fn bool QWebPluginFactory::MimeType::operator!=(const MimeType& other) const + + Returns true if this mimetype is different from the \a other mime type. +*/ + +/*! + \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://qt.nokia.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://qt.nokia.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 + \internal + + 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 + \internal + \since 4.4 + \brief The ExtensionOption class provides an extended input argument to QWebPluginFactory's extension support. + + \inmodule QtWebKit + + \sa QWebPluginFactory::extension() +*/ + +/*! + \class QWebPluginFactory::ExtensionReturn + \internal + \since 4.4 + \brief The ExtensionOption class provides an extended output argument to QWebPluginFactory's extension support. + + \inmodule QtWebKit + + \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. + + \internal + + 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. + + \internal + + \sa extension() +*/ +bool QWebPluginFactory::supportsExtension(Extension extension) const +{ + Q_UNUSED(extension) + return false; +} diff --git a/Source/WebKit/qt/Api/qwebpluginfactory.h b/Source/WebKit/qt/Api/qwebpluginfactory.h new file mode 100644 index 0000000..4a06b59 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebpluginfactory.h @@ -0,0 +1,75 @@ +/* + 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 QWEBKIT_EXPORT MimeType { + QString name; + QString description; + QStringList fileExtensions; + bool operator==(const MimeType& other) const; + inline bool operator!=(const MimeType& other) const { return !operator==(other); } + }; + + 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&, + 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/Source/WebKit/qt/Api/qwebscriptworld.cpp b/Source/WebKit/qt/Api/qwebscriptworld.cpp new file mode 100644 index 0000000..7a44813 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebscriptworld.cpp @@ -0,0 +1,62 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.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. +*/ + +#include "config.h" +#include "qwebscriptworld.h" +#include "qwebscriptworld_p.h" + +#include "KURL.h" +#include "ScriptController.h" +#include <QStringList> + +using namespace WebCore; + +/*! + Constructs a security origin from \a other. +*/ +QWebScriptWorld::QWebScriptWorld() +{ +#if USE(JSC) + d = new QWebScriptWorldPrivate(ScriptController::createWorld()); +#endif +} + +QWebScriptWorld::QWebScriptWorld(const QWebScriptWorld& other) + : d(other.d) +{ +} + +QWebScriptWorld &QWebScriptWorld::operator=(const QWebScriptWorld& other) +{ + d = other.d; + return *this; +} + +DOMWrapperWorld* QWebScriptWorld::world() const +{ + return d ? d->world.get() : 0; +} + +/*! + Destroys the security origin. +*/ +QWebScriptWorld::~QWebScriptWorld() +{ +} + diff --git a/Source/WebKit/qt/Api/qwebscriptworld.h b/Source/WebKit/qt/Api/qwebscriptworld.h new file mode 100644 index 0000000..6a9d6e0 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebscriptworld.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.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. +*/ + +#ifndef QWebScriptWorld_h_ +#define QWebScriptWorld_h_ + +#include <QtCore/qurl.h> +#include <QtCore/qshareddata.h> + +#include "qwebkitglobal.h" + +namespace WebCore { + class DOMWrapperWorld; +} + +class QWebScriptWorldPrivate; +class QWebFrame; + +class QWEBKIT_EXPORT QWebScriptWorld { +public: + QWebScriptWorld(); + QWebScriptWorld(const QWebScriptWorld&); + QWebScriptWorld &operator=(const QWebScriptWorld&); + ~QWebScriptWorld(); + + WebCore::DOMWrapperWorld* world() const; + +private: + QExplicitlySharedDataPointer<QWebScriptWorldPrivate> d; + + friend class QWebFrame; +}; + +#endif diff --git a/Source/WebKit/qt/Api/qwebscriptworld_p.h b/Source/WebKit/qt/Api/qwebscriptworld_p.h new file mode 100644 index 0000000..7115eb2 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebscriptworld_p.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.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. +*/ + +#ifndef _QWEBSCRIPTWORLD_P_H_ +#define _QWEBSCRIPTWORLD_P_H_ + +#include "RefPtr.h" + +namespace WebCore { + class DOMWrapperWorld; +} + +class QWebScriptWorldPrivate : public QSharedData { +public: + QWebScriptWorldPrivate(WTF::PassRefPtr<WebCore::DOMWrapperWorld> o) + { + Q_ASSERT(o); + world = o; + } + + ~QWebScriptWorldPrivate() + { + } + + WTF::RefPtr<WebCore::DOMWrapperWorld> world; +}; + +#endif diff --git a/Source/WebKit/qt/Api/qwebsecurityorigin.cpp b/Source/WebKit/qt/Api/qwebsecurityorigin.cpp new file mode 100644 index 0000000..97f887a --- /dev/null +++ b/Source/WebKit/qt/Api/qwebsecurityorigin.cpp @@ -0,0 +1,269 @@ +/* + 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 "ApplicationCacheStorage.h" +#include "DatabaseTracker.h" +#include "KURL.h" +#include "SchemeRegistry.h" +#include "SecurityOrigin.h" +#include "qwebdatabase.h" +#include "qwebdatabase_p.h" +#include "qwebsecurityorigin_p.h" +#include <QStringList> + +using namespace WebCore; + +/*! + \class QWebSecurityOrigin + \since 4.5 + \brief The QWebSecurityOrigin class defines a security boundary for web sites. + + \inmodule QtWebKit + + 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. + + 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. + + By default local schemes like \c{file://} and \c{qrc://} are concidered to be in the same + security origin, and can access each other's resources. You can add additional local schemes + by using QWebSecurityOrigin::addLocalScheme(), or override the default same-origin behavior + by setting QWebSettings::LocalContentCanAccessFileUrls to \c{false}. + + \note Local resources are by default restricted from accessing remote content, which + means your \c{file://} will not be able to access \c{http://domain.com/foo.html}. You + can relax this restriction by setting QWebSettings::LocalContentCanAccessRemoteUrls to + \c{true}. + + Call QWebFrame::securityOrigin() to get the QWebSecurityOrigin for a frame in a + web page, and use host(), scheme() and port() to identify the security origin. + + Use databases() to access the databases defined within a security origin. The + disk usage of the origin's databases can be limited with setDatabaseQuota(). + databaseQuota() and databaseUsage() report the current limit as well as the + current usage. + + 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 +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().usageForOrigin(d->origin.get()); +#else + return 0; +#endif +} + +/*! + Returns the quota for the databases in the security origin. +*/ +qint64 QWebSecurityOrigin::databaseQuota() const +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().quotaForOrigin(d->origin.get()); +#else + return 0; +#endif +} + +/*! + 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) +{ +#if ENABLE(DATABASE) + DatabaseTracker::tracker().setQuota(d->origin.get(), quota); +#endif +} + +void QWebSecurityOrigin::setApplicationCacheQuota(qint64 quota) +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + WebCore::cacheStorage().storeUpdatedQuotaForOrigin(d->origin.get(), quota); +#endif +} +/*! + 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() +{ + QList<QWebSecurityOrigin> webOrigins; + +#if ENABLE(DATABASE) + Vector<RefPtr<SecurityOrigin> > coreOrigins; + DatabaseTracker::tracker().origins(coreOrigins); + + for (unsigned i = 0; i < coreOrigins.size(); ++i) { + QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(coreOrigins[i].get()); + webOrigins.append(priv); + } +#endif + + return webOrigins; +} + +/*! + Returns a list of all databases defined in the security origin. +*/ +QList<QWebDatabase> QWebSecurityOrigin::databases() const +{ + QList<QWebDatabase> databases; + +#if ENABLE(DATABASE) + Vector<String> nameVector; + + 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); + } +#endif + + return databases; +} + +/*! + \since 4.6 + + Adds the given \a scheme to the list of schemes that are considered equivalent + to the \c file: scheme. + + Cross domain restrictions depend on the two web settings QWebSettings::LocalContentCanAccessFileUrls + and QWebSettings::LocalContentCanAccessFileUrls. By default all local schemes are concidered to be + in the same security origin, and local schemes can not access remote content. +*/ +void QWebSecurityOrigin::addLocalScheme(const QString& scheme) +{ + SchemeRegistry::registerURLSchemeAsLocal(scheme); +} + +/*! + \since 4.6 + + Removes the given \a scheme from the list of local schemes. + + \note You can not remove the \c{file://} scheme from the list + of local schemes. + + \sa addLocalScheme() +*/ +void QWebSecurityOrigin::removeLocalScheme(const QString& scheme) +{ + SchemeRegistry::removeURLSchemeRegisteredAsLocal(scheme); +} + +/*! + \since 4.6 + Returns a list of all the schemes concidered to be local. + + By default this is \c{file://} and \c{qrc://}. + + \sa addLocalScheme(), removeLocalScheme() +*/ +QStringList QWebSecurityOrigin::localSchemes() +{ + QStringList list; + const URLSchemesMap& map = SchemeRegistry::localSchemes(); + URLSchemesMap::const_iterator end = map.end(); + for (URLSchemesMap::const_iterator i = map.begin(); i != end; ++i) { + const QString scheme = *i; + list.append(scheme); + } + return list; +} diff --git a/Source/WebKit/qt/Api/qwebsecurityorigin.h b/Source/WebKit/qt/Api/qwebsecurityorigin.h new file mode 100644 index 0000000..7328680 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebsecurityorigin.h @@ -0,0 +1,70 @@ +/* + 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(); + static void addLocalScheme(const QString& scheme); + static void removeLocalScheme(const QString& scheme); + static QStringList localSchemes(); + + ~QWebSecurityOrigin(); + + QString scheme() const; + QString host() const; + int port() const; + + qint64 databaseUsage() const; + qint64 databaseQuota() const; + + void setDatabaseQuota(qint64 quota); + void setApplicationCacheQuota(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/Source/WebKit/qt/Api/qwebsecurityorigin_p.h b/Source/WebKit/qt/Api/qwebsecurityorigin_p.h new file mode 100644 index 0000000..cdc93bd --- /dev/null +++ b/Source/WebKit/qt/Api/qwebsecurityorigin_p.h @@ -0,0 +1,39 @@ +/* + 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/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp new file mode 100644 index 0000000..9bb187e --- /dev/null +++ b/Source/WebKit/qt/Api/qwebsettings.cpp @@ -0,0 +1,1130 @@ +/* + 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 "qwebplugindatabase_p.h" + +#include "AbstractDatabase.h" +#include "MemoryCache.h" +#include "CrossOriginPreflightResultCache.h" +#include "FontCache.h" +#include "Page.h" +#include "PageCache.h" +#include "Settings.h" +#include "KURL.h" +#include "PlatformString.h" +#include "IconDatabase.h" +#include "PluginDatabase.h" +#include "Image.h" +#include "IntSize.h" +#include "ApplicationCacheStorage.h" +#include "DatabaseTracker.h" +#include "FileSystem.h" + +#include <QApplication> +#include <QDesktopServices> +#include <QDir> +#include <QHash> +#include <QSharedData> +#include <QUrl> +#include <QFileInfo> +#include <QStyle> + +#include "NetworkStateNotifier.h" + +void QWEBKIT_EXPORT qt_networkAccessAllowed(bool isAllowed) +{ +#if ENABLE(QT_BEARER) + WebCore::networkStateNotifier().setNetworkAccessAllowed(isAllowed); +#endif +} + +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 defaultTextEncoding; + QString localStoragePath; + QString offlineWebApplicationCachePath; + qint64 offlineStorageDefaultQuota; + + void apply(); + WebCore::Settings* settings; +}; + +typedef QHash<int, QPixmap> WebGraphicHash; +Q_GLOBAL_STATIC(WebGraphicHash, _graphics) + +static void earlyClearGraphics() +{ + _graphics()->clear(); +} + +static WebGraphicHash* graphics() +{ + WebGraphicHash* hash = _graphics(); + + if (hash->isEmpty()) { + + // prevent ~QPixmap running after ~QApplication (leaks native pixmaps) + qAddPostRoutine(earlyClearGraphics); + + 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"))); + hash->insert(QWebSettings::DeleteButtonGraphic, QPixmap(QLatin1String(":webkit/resources/deleteButton.png"))); + hash->insert(QWebSettings::InputSpeechButtonGraphic, QPixmap(QLatin1String(":webkit/resources/inputSpeech.png"))); + hash->insert(QWebSettings::SearchCancelButtonGraphic, QApplication::style()->standardPixmap(QStyle::SP_DialogCloseButton)); + hash->insert(QWebSettings::SearchCancelButtonPressedGraphic, QApplication::style()->standardPixmap(QStyle::SP_DialogCloseButton)); + } + + 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); +#if USE(ACCELERATED_COMPOSITING) + value = attributes.value(QWebSettings::AcceleratedCompositingEnabled, + global->attributes.value(QWebSettings::AcceleratedCompositingEnabled)); + + settings->setAcceleratedCompositingEnabled(value); +#endif +#if ENABLE(3D_CANVAS) + value = attributes.value(QWebSettings::WebGLEnabled, + global->attributes.value(QWebSettings::WebGLEnabled)); + + settings->setWebGLEnabled(value); +#endif + + value = attributes.value(QWebSettings::HyperlinkAuditingEnabled, + global->attributes.value(QWebSettings::HyperlinkAuditingEnabled)); + + settings->setHyperlinkAuditingEnabled(value); + + value = attributes.value(QWebSettings::JavascriptCanOpenWindows, + global->attributes.value(QWebSettings::JavascriptCanOpenWindows)); + settings->setJavaScriptCanOpenWindowsAutomatically(value); + + value = attributes.value(QWebSettings::JavascriptCanCloseWindows, + global->attributes.value(QWebSettings::JavascriptCanCloseWindows)); + settings->setAllowScriptsToCloseWindows(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::SpatialNavigationEnabled, + global->attributes.value(QWebSettings::SpatialNavigationEnabled)); + settings->setSpatialNavigationEnabled(value); + + value = attributes.value(QWebSettings::JavascriptCanAccessClipboard, + global->attributes.value(QWebSettings::JavascriptCanAccessClipboard)); + settings->setDOMPasteAllowed(value); + settings->setJavaScriptCanAccessClipboard(value); + + value = attributes.value(QWebSettings::DeveloperExtrasEnabled, + global->attributes.value(QWebSettings::DeveloperExtrasEnabled)); + settings->setDeveloperExtrasEnabled(value); + + value = attributes.value(QWebSettings::FrameFlatteningEnabled, + global->attributes.value(QWebSettings::FrameFlatteningEnabled)); + settings->setFrameFlatteningEnabled(value); + + QUrl location = !userStyleSheetLocation.isEmpty() ? userStyleSheetLocation : global->userStyleSheetLocation; + settings->setUserStyleSheetLocation(WebCore::KURL(location)); + + QString encoding = !defaultTextEncoding.isEmpty() ? defaultTextEncoding: global->defaultTextEncoding; + settings->setDefaultTextEncodingName(encoding); + + QString storagePath = !localStoragePath.isEmpty() ? localStoragePath : global->localStoragePath; + settings->setLocalStorageDatabasePath(storagePath); + + value = attributes.value(QWebSettings::PrintElementBackgrounds, + global->attributes.value(QWebSettings::PrintElementBackgrounds)); + settings->setShouldPrintBackgrounds(value); + +#if ENABLE(DATABASE) + value = attributes.value(QWebSettings::OfflineStorageDatabaseEnabled, + global->attributes.value(QWebSettings::OfflineStorageDatabaseEnabled)); + WebCore::AbstractDatabase::setIsAvailable(value); +#endif + + value = attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled, + global->attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled)); + settings->setOfflineWebApplicationCacheEnabled(value); + + value = attributes.value(QWebSettings::LocalStorageEnabled, + global->attributes.value(QWebSettings::LocalStorageEnabled)); + settings->setLocalStorageEnabled(value); + + value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls, + global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls)); + settings->setAllowUniversalAccessFromFileURLs(value); + + value = attributes.value(QWebSettings::LocalContentCanAccessFileUrls, + global->attributes.value(QWebSettings::LocalContentCanAccessFileUrls)); + settings->setAllowFileAccessFromFileURLs(value); + + value = attributes.value(QWebSettings::XSSAuditingEnabled, + global->attributes.value(QWebSettings::XSSAuditingEnabled)); + settings->setXSSAuditorEnabled(value); + +#if ENABLE(TILED_BACKING_STORE) + value = attributes.value(QWebSettings::TiledBackingStoreEnabled, + global->attributes.value(QWebSettings::TiledBackingStoreEnabled)); + settings->setTiledBackingStoreEnabled(value); +#endif + + value = attributes.value(QWebSettings::SiteSpecificQuirksEnabled, + global->attributes.value(QWebSettings::SiteSpecificQuirksEnabled)); + settings->setNeedsSiteSpecificQuirks(value); + + settings->setUsesPageCache(WebCore::pageCache()->capacity()); + } 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. + + \inmodule QtWebKit + + 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 + globalSettings(). + + QWebSettings allows configuration of browser properties, such as font sizes and + families, the location of a custom style sheet, and generic attributes like + JavaScript and plugins. Individual attributes are set using the setAttribute() + function. The \l{QWebSettings::WebAttribute}{WebAttribute} enum further describes + each attribute. + + QWebSettings also configures global properties such as the web page memory + cache, icon database, local database storage and offline + applications storage. + + \section1 Enabling Plugins + + Support for browser plugins can enabled by setting the + \l{QWebSettings::PluginsEnabled}{PluginsEnabled} attribute. For many applications, + this attribute is enabled for all pages by setting it on the + \l{globalSettings()}{global settings object}. QtWebKit will always ignore this setting + when processing Qt plugins. The decision to allow a Qt plugin is made by the client + in its reimplementation of QWebPage::createPlugin(). + + \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(), {Web 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 + when zooming out with QWebFrame::setTextSizeMultiplier(). + \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. + \value DeleteButtonGraphic The graphic shown for the WebKit-Editing-Delete-Button in Deletion UI. + \value InputSpeechButtonGraphic The graphic shown in input fields that support speech recognition. + \value SearchCancelButtonGraphic The graphic shown for clearing the text in a search field. + \value SearchCancelButtonPressedGraphic The graphic shown when SearchCancelButtonGraphic is pressed. +*/ + +/*! + \enum QWebSettings::WebAttribute + + This enum describes various attributes that are configurable through QWebSettings. + + \value AutoLoadImages Specifies whether images are automatically loaded in + web pages. This is enabled by default. + \value DnsPrefetchEnabled Specifies whether QtWebkit will try to pre-fetch DNS entries to + speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later. This is disabled by default. + \value JavascriptEnabled Enables or disables the running of JavaScript + programs. This is enabled by default + \value JavaEnabled Enables or disables Java applets. + Currently Java applets are not supported. + \value PluginsEnabled Enables or disables plugins in Web pages (e.g. using NPAPI). Qt plugins + with a mimetype such as "application/x-qt-plugin" are not affected by this setting. This is disabled by default. + \value PrivateBrowsingEnabled Private browsing prevents WebKit from + recording visited pages in the history and storing web page icons. This is disabled by default. + \value JavascriptCanOpenWindows Specifies whether JavaScript programs + can open new windows. This is disabled by default. + \value JavascriptCanCloseWindows Specifies whether JavaScript programs + can close windows. This is disabled by default. + \value JavascriptCanAccessClipboard Specifies whether JavaScript programs + can read or write to the clipboard. This is disabled by default. + \value DeveloperExtrasEnabled Enables extra tools for Web developers. + Currently this enables the "Inspect" element in the context menu as + well as the use of QWebInspector which controls the web inspector + for web site debugging. This is disabled by default. + \value SpatialNavigationEnabled Enables or disables the Spatial Navigation + feature, which consists in the ability to navigate between focusable + elements in a Web page, such as hyperlinks and form controls, by using + Left, Right, Up and Down arrow keys. For example, if a user presses the + Right key, heuristics determine whether there is an element he might be + trying to reach towards the right and which element he probably wants. + This is disabled by default. + \value LinksIncludedInFocusChain Specifies whether hyperlinks should be + included in the keyboard focus chain. This is enabled by default. + \value ZoomTextOnly Specifies whether the zoom factor on a frame applies + only to the text or to all content. This is disabled by default. + \value PrintElementBackgrounds Specifies whether the background color and images + are also drawn when the page is printed. This is enabled by default. + \value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5 + offline storage feature is enabled or not. This is disabled by default. + \value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5 + web application cache feature is enabled or not. This is disabled by default. + \value LocalStorageEnabled Specifies whether support for the HTML 5 + local storage feature is enabled or not. This is disabled by default. + \value LocalStorageDatabaseEnabled \e{This enum value is deprecated.} Use + QWebSettings::LocalStorageEnabled instead. + \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are + allowed to access remote urls. This is disabled by default. For more information + about security origins and local vs. remote content see QWebSecurityOrigin. + \value LocalContentCanAccessFileUrls Specifies whether locally loaded documents are + allowed to access other local urls. This is enabled by default. For more information + about security origins and local vs. remote content see QWebSecurityOrigin. + \value XSSAuditingEnabled Specifies whether load requests should be monitored for cross-site + scripting attempts. Suspicious scripts will be blocked and reported in the inspector's + JavaScript console. Enabling this feature might have an impact on performance + and it is disabled by default. + \value AcceleratedCompositingEnabled This feature, when used in conjunction with + QGraphicsWebView, accelerates animations of web content. CSS animations of the transform and + opacity properties will be rendered by composing the cached content of the animated elements. + This is enabled by default. + \value TiledBackingStoreEnabled This setting enables the tiled backing store feature + for a QGraphicsWebView. With the tiled backing store enabled, the web page contents in and around + the current visible area is speculatively cached to bitmap tiles. The tiles are automatically kept + in sync with the web page as it changes. Enabling tiling can significantly speed up painting heavy + operations like scrolling. Enabling the feature increases memory consumption. It does not work well + with contents using CSS fixed positioning (see also \l{QGraphicsWebView::}{resizesToContents} property). + \l{QGraphicsWebView::}{tiledBackingStoreFrozen} property allows application to temporarily + freeze the contents of the backing store. This is disabled by default. + \value FrameFlatteningEnabled With this setting each subframe is expanded to its contents. + On touch devices, it is desired to not have any scrollable sub parts of the page + as it results in a confusing user experience, with scrolling sometimes scrolling sub parts + and at other times scrolling the page itself. For this reason iframes and framesets are + barely usable on touch devices. This will flatten all the frames to become one scrollable page. + This is disabled by default. + \value SiteSpecificQuirksEnabled This setting enables WebKit's workaround for broken sites. It is + enabled by default. +*/ + +/*! + \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, 16); + d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 13); + + QFont defaultFont; + defaultFont.setStyleHint(QFont::Serif); + d->fontFamilies.insert(QWebSettings::StandardFont, defaultFont.defaultFamily()); + d->fontFamilies.insert(QWebSettings::SerifFont, defaultFont.defaultFamily()); + +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) + defaultFont.setStyleHint(QFont::Fantasy); + d->fontFamilies.insert(QWebSettings::FantasyFont, defaultFont.defaultFamily()); + + defaultFont.setStyleHint(QFont::Cursive); + d->fontFamilies.insert(QWebSettings::CursiveFont, defaultFont.defaultFamily()); +#else + d->fontFamilies.insert(QWebSettings::FantasyFont, defaultFont.defaultFamily()); + d->fontFamilies.insert(QWebSettings::CursiveFont, defaultFont.defaultFamily()); +#endif + + defaultFont.setStyleHint(QFont::SansSerif); + d->fontFamilies.insert(QWebSettings::SansSerifFont, defaultFont.defaultFamily()); + +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) + defaultFont.setStyleHint(QFont::Monospace); +#else + defaultFont.setStyleHint(QFont::TypeWriter); +#endif + d->fontFamilies.insert(QWebSettings::FixedFont, defaultFont.defaultFamily()); + + d->attributes.insert(QWebSettings::AutoLoadImages, true); + d->attributes.insert(QWebSettings::DnsPrefetchEnabled, false); + d->attributes.insert(QWebSettings::JavascriptEnabled, true); + d->attributes.insert(QWebSettings::SpatialNavigationEnabled, false); + d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true); + d->attributes.insert(QWebSettings::ZoomTextOnly, false); + d->attributes.insert(QWebSettings::PrintElementBackgrounds, true); + d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, false); + d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, false); + d->attributes.insert(QWebSettings::LocalStorageEnabled, false); + d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false); + d->attributes.insert(QWebSettings::LocalContentCanAccessFileUrls, true); + d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, true); + d->attributes.insert(QWebSettings::WebGLEnabled, false); + d->attributes.insert(QWebSettings::HyperlinkAuditingEnabled, false); + d->attributes.insert(QWebSettings::TiledBackingStoreEnabled, false); + d->attributes.insert(QWebSettings::FrameFlatteningEnabled, false); + d->attributes.insert(QWebSettings::SiteSpecificQuirksEnabled, true); + d->offlineStorageDefaultQuota = 5 * 1024 * 1024; + d->defaultTextEncoding = QLatin1String("iso-8859-1"); +} + +/*! + \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 must be either a path on the local filesystem, or a data URL + with UTF-8 and Base64 encoded data, such as: + + "data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow==" + + \note If the base64 data is not valid, the style will not be applied. + + \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; +} + +/*! + \since 4.6 + Specifies the default text encoding system. + + The \a encoding, must be a string describing an encoding such as "utf-8", + "iso-8859-1", etc. If left empty a default value will be used. For a more + extensive list of encoding names see \l{QTextCodec} + + \sa defaultTextEncoding() +*/ +void QWebSettings::setDefaultTextEncoding(const QString& encoding) +{ + d->defaultTextEncoding = encoding; + d->apply(); +} + +/*! + \since 4.6 + Returns the default text encoding. + + \sa setDefaultTextEncoding() +*/ +QString QWebSettings::defaultTextEncoding() const +{ + return d->defaultTextEncoding; +} + +/*! + 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. + + Setting an empty path disables the icon database. + + \sa iconDatabasePath(), clearIconDatabase() +*/ +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 \bold OR if 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; +} + +/* + Returns the plugin database object. + +QWebPluginDatabase *QWebSettings::pluginDatabase() +{ + static QWebPluginDatabase* database = 0; + if (!database) + database = new QWebPluginDatabase(); + return database; +} +*/ + +/*! + 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. + + \sa setWebGraphic() +*/ +QPixmap QWebSettings::webGraphic(WebGraphic type) +{ + return graphics()->value(type); +} + +/*! + Frees up as much memory as possible by cleaning all memory caches such + as page, object and font cache. + + \since 4.6 + */ +void QWebSettings::clearMemoryCaches() +{ + // Turn the cache on and off. Disabling the object cache will remove all + // resources from the cache. They may still live on if they are referenced + // by some Web page though. + if (!WebCore::memoryCache()->disabled()) { + WebCore::memoryCache()->setDisabled(true); + WebCore::memoryCache()->setDisabled(false); + } + + int pageCapacity = WebCore::pageCache()->capacity(); + // Setting size to 0, makes all pages be released. + WebCore::pageCache()->setCapacity(0); + WebCore::pageCache()->releaseAutoreleasedPagesNow(); + WebCore::pageCache()->setCapacity(pageCapacity); + + // Invalidating the font cache and freeing all inactive font data. + WebCore::fontCache()->invalidate(); + + // Empty the Cross-Origin Preflight cache + WebCore::CrossOriginPreflightResultCache::shared().empty(); +} + +/*! + Sets the maximum number of pages to hold in the memory page cache to \a pages. + + The Page Cache allows for a nicer user experience when navigating forth or back + to pages in the forward/back history, by pausing and resuming up to \a pages. + + For more information about the feature, please refer to: + + http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ +*/ +void QWebSettings::setMaximumPagesInCache(int pages) +{ + QWebSettingsPrivate* global = QWebSettings::globalSettings()->d; + WebCore::pageCache()->setCapacity(qMax(0, pages)); + global->apply(); +} + +/*! + 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 && !cacheMaxDead && !totalCapacity; + WebCore::memoryCache()->setDisabled(disableCache); + + WebCore::memoryCache()->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 specified by \a which to the one set + in the global QWebSettings instance. + + 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 to the value specified in the + global QWebSettings instance. + + 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 \a path as the save location for HTML5 client-side database storage data. + + \a path must point to an existing directory. + + Setting an empty path disables the feature. + + Support for client-side databases can enabled by setting the + \l{QWebSettings::OfflineStorageDatabaseEnabled}{OfflineStorageDatabaseEnabled} attribute. + + \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 client-side database 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; +} + +/*! + \since 4.6 + + Sets the path for HTML5 offline web application cache storage to \a path. + + An application cache acts like an HTTP cache in some sense. For documents + that use the application cache via JavaScript, the loader engine will + first ask the application cache for the contents, before hitting the + network. + + The feature is described in details at: + http://dev.w3.org/html5/spec/Overview.html#appcache + + \a path must point to an existing directory. + + Setting an empty path disables the feature. + + Support for offline web application cache storage can enabled by setting the + \l{QWebSettings::OfflineWebApplicationCacheEnabled}{OfflineWebApplicationCacheEnabled} attribute. + + \sa offlineWebApplicationCachePath() +*/ +void QWebSettings::setOfflineWebApplicationCachePath(const QString& path) +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + WebCore::cacheStorage().setCacheDirectory(path); +#endif +} + +/*! + \since 4.6 + + Returns the path of the HTML5 offline web application cache storage + or an empty string if the feature is disabled. + + \sa setOfflineWebApplicationCachePath() +*/ +QString QWebSettings::offlineWebApplicationCachePath() +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + return WebCore::cacheStorage().cacheDirectory(); +#else + return QString(); +#endif +} + +/*! + \since 4.6 + + Sets the value of the quota for the offline web application cache + to \a maximumSize. +*/ +void QWebSettings::setOfflineWebApplicationCacheQuota(qint64 maximumSize) +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + WebCore::cacheStorage().empty(); + WebCore::cacheStorage().vacuumDatabaseFile(); + WebCore::cacheStorage().setMaximumSize(maximumSize); +#endif +} + +/*! + \since 4.6 + + Returns the value of the quota for the offline web application cache. +*/ +qint64 QWebSettings::offlineWebApplicationCacheQuota() +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + return WebCore::cacheStorage().maximumSize(); +#else + return 0; +#endif +} + +/*! + \since 4.6 + + Sets the path for HTML5 local storage to \a path. + + For more information on HTML5 local storage see the + \l{http://www.w3.org/TR/webstorage/#the-localstorage-attribute}{Web Storage standard}. + + Support for local storage can enabled by setting the + \l{QWebSettings::LocalStorageEnabled}{LocalStorageEnabled} attribute. + + \sa localStoragePath() +*/ +void QWebSettings::setLocalStoragePath(const QString& path) +{ + d->localStoragePath = path; + d->apply(); +} + +/*! + \since 4.6 + + Returns the path for HTML5 local storage. + + \sa setLocalStoragePath() +*/ +QString QWebSettings::localStoragePath() const +{ + return d->localStoragePath; +} + +/*! + \since 4.6 + + Enables WebKit data persistence and sets the path to \a path. + If \a path is empty, the user-specific data location specified by + \l{QDesktopServices::DataLocation}{DataLocation} will be used instead. + + This method will simultaneously set and enable the iconDatabasePath(), + localStoragePath(), offlineStoragePath() and offlineWebApplicationCachePath(). + + \sa localStoragePath() +*/ +void QWebSettings::enablePersistentStorage(const QString& path) +{ +#ifndef QT_NO_DESKTOPSERVICES + QString storagePath; + + if (path.isEmpty()) { + + storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation); + if (storagePath.isEmpty()) + storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName()); + } else + storagePath = path; + + WebCore::makeAllDirectories(storagePath); + + QWebSettings::setIconDatabasePath(storagePath); + QWebSettings::setOfflineWebApplicationCachePath(storagePath); + QWebSettings::setOfflineStoragePath(WebCore::pathByAppendingComponent(storagePath, "Databases")); + QWebSettings::globalSettings()->setLocalStoragePath(WebCore::pathByAppendingComponent(storagePath, "LocalStorage")); + QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true); + QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); + QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true); + +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + // All applications can share the common QtWebkit cache file(s). + // Path is not configurable and uses QDesktopServices::CacheLocation by default. + QString cachePath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation); + WebCore::makeAllDirectories(cachePath); + + QFileInfo info(cachePath); + if (info.isDir() && info.isWritable()) { + WebCore::PluginDatabase::setPersistentMetadataCacheEnabled(true); + WebCore::PluginDatabase::setPersistentMetadataCachePath(cachePath); + } +#endif +#endif +} + +/*! + \fn QWebSettingsPrivate* QWebSettings::handle() const + \internal +*/ diff --git a/Source/WebKit/qt/Api/qwebsettings.h b/Source/WebKit/qt/Api/qwebsettings.h new file mode 100644 index 0000000..008035b --- /dev/null +++ b/Source/WebKit/qt/Api/qwebsettings.h @@ -0,0 +1,165 @@ +/* + 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 QWebPluginDatabase; +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, + LocalStorageEnabled, +#if defined(QT_DEPRECATED) || defined(qdoc) + LocalStorageDatabaseEnabled = LocalStorageEnabled, +#endif + LocalContentCanAccessRemoteUrls, + DnsPrefetchEnabled, + XSSAuditingEnabled, + AcceleratedCompositingEnabled, + SpatialNavigationEnabled, + LocalContentCanAccessFileUrls, + TiledBackingStoreEnabled, + FrameFlatteningEnabled, + SiteSpecificQuirksEnabled, + JavascriptCanCloseWindows, + WebGLEnabled, + HyperlinkAuditingEnabled + }; + enum WebGraphic { + MissingImageGraphic, + MissingPluginGraphic, + DefaultFrameIconGraphic, + TextAreaSizeGripCornerGraphic, + DeleteButtonGraphic, + InputSpeechButtonGraphic, + SearchCancelButtonGraphic, + SearchCancelButtonPressedGraphic + }; + 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; + + void setDefaultTextEncoding(const QString &encoding); + QString defaultTextEncoding() const; + + static void setIconDatabasePath(const QString &location); + static QString iconDatabasePath(); + static void clearIconDatabase(); + static QIcon iconForUrl(const QUrl &url); + + //static QWebPluginDatabase *pluginDatabase(); + + 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(); + + static void setOfflineWebApplicationCachePath(const QString& path); + static QString offlineWebApplicationCachePath(); + static void setOfflineWebApplicationCacheQuota(qint64 maximumSize); + static qint64 offlineWebApplicationCacheQuota(); + + void setLocalStoragePath(const QString& path); + QString localStoragePath() const; + + static void clearMemoryCaches(); + + static void enablePersistentStorage(const QString& path = QString()); + + 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/Source/WebKit/qt/Api/qwebview.cpp b/Source/WebKit/qt/Api/qwebview.cpp new file mode 100644 index 0000000..f4b23f3 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebview.cpp @@ -0,0 +1,1256 @@ +/* + Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) + Copyright (C) 2008 Holger Hans Peter Freyther + Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> + + 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 "Page.h" +#include "QWebPageClient.h" +#include "Settings.h" +#include "qwebframe.h" +#include "qwebpage_p.h" +#include "qbitmap.h" +#include "qevent.h" +#include "qpainter.h" +#include "qprinter.h" +#include "qdir.h" +#include "qfile.h" + +class QWebViewPrivate { +public: + QWebViewPrivate(QWebView *view) + : view(view) + , page(0) + , renderHints(QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform) + { + Q_ASSERT(view); + } + + virtual ~QWebViewPrivate(); + + void _q_pageDestroyed(); + void detachCurrentPage(); + + QWebView *view; + QWebPage *page; + + QPainter::RenderHints renderHints; +}; + +QWebViewPrivate::~QWebViewPrivate() +{ + detachCurrentPage(); +} + +void QWebViewPrivate::_q_pageDestroyed() +{ + page = 0; + view->setPage(0); +} + +#ifdef Q_WS_MAEMO_5 +#include "qabstractkineticscroller.h" +#include "qapplication.h" + +// QCoreApplication::sendSpontaneousEvent() is private, hence this friend wrapper +bool qt_sendSpontaneousEvent(QObject* receiver, QEvent* ev) +{ + return QCoreApplication::sendSpontaneousEvent(receiver, ev); +} + +class QWebViewKineticScroller : public QObject, public QAbstractKineticScroller { +public: + QWebViewKineticScroller() + : QObject() + , QAbstractKineticScroller() + , m_view(0) + , m_ignoreEvents(false) + { + } + + void setWidget(QWebView* widget) + { + if (m_view) { + m_view->removeEventFilter(this); + QWebFrame* frame = m_view->page()->mainFrame(); + frame->setScrollBarPolicy(Qt::Vertical, m_oldVerticalScrollBarPolicy); + frame->setScrollBarPolicy(Qt::Horizontal, m_oldHorizontalScrollBarPolicy); + } + + m_view = widget; + setParent(m_view); + if (m_view) { + QWebFrame* frame = m_view->page()->mainFrame(); + m_oldHorizontalScrollBarPolicy = frame->scrollBarPolicy(Qt::Horizontal); + m_oldVerticalScrollBarPolicy = frame->scrollBarPolicy(Qt::Vertical); + frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); + frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); + m_view->installEventFilter(this); + } + } + +protected: + bool eventFilter(QObject* o, QEvent* ev) + { + if (!o || m_view != o || m_ignoreEvents || !m_view->isEnabled()) + return QObject::eventFilter(o, ev); + + bool res = false; + + switch (ev->type()) { + case QEvent::MouseButtonPress: { + // remember the frame where the button was pressed + QWebFrame* hitFrame = scrollingFrameAt(static_cast<QMouseEvent*>(ev)->pos()); + if (hitFrame) + m_frame = hitFrame; + // fall through + } + case QEvent::MouseMove: + case QEvent::MouseButtonRelease: + case QEvent::MouseButtonDblClick: + res = handleMouseEvent(static_cast<QMouseEvent*>(ev)); + break; + default: + break; + } + return res ? true : QObject::eventFilter(o, ev); + } + + void cancelLeftMouseButtonPress(const QPoint& /* globalPressPos */) + { + QMouseEvent cmem(QEvent::MouseMove, QPoint(-INT_MAX, -INT_MAX), Qt::LeftButton, QApplication::mouseButtons() | Qt::LeftButton, QApplication::keyboardModifiers()); + sendEvent(m_view, &cmem); + QMouseEvent cmer(QEvent::MouseButtonRelease, QPoint(-INT_MAX, -INT_MAX), Qt::LeftButton, QApplication::mouseButtons() & ~Qt::LeftButton, QApplication::keyboardModifiers()); + sendEvent(m_view, &cmer); + } + + QWebFrame* currentFrame() const + { + if (m_frame) + return m_frame; + + if (m_view) + return m_view->page()->mainFrame(); + + return 0; + } + + // Returns the innermost frame at the given position that can scroll. + QWebFrame* scrollingFrameAt(const QPoint& pos) const + { + QWebFrame* hitFrame = 0; + if (m_view) { + QWebFrame* frame = m_view->page()->mainFrame(); + hitFrame = frame->hitTestContent(pos).frame(); + QSize range = hitFrame->contentsSize() - hitFrame->geometry().size(); + + while (hitFrame && range.width() <= 1 && range.height() <= 1) + hitFrame = hitFrame->parentFrame(); + + return hitFrame; + } + } + + QPoint maximumScrollPosition() const + { + QWebFrame* frame = currentFrame(); + QSize s = frame ? frame->contentsSize() - frame->geometry().size() : QSize(0, 0); + return QPoint(qMax(0, s.width()), qMax(0, s.height())); + } + + QPoint scrollPosition() const + { + QWebFrame* frame = currentFrame(); + return frame ? frame->scrollPosition() : QPoint(); + } + + QSize viewportSize() const + { + return m_view ? m_view->page()->viewportSize() : QSize(); + } + + void setScrollPosition(const QPoint& point, const QPoint& /* overShootDelta */) + { + QWebFrame* frame = currentFrame(); + if (frame) + frame->setScrollPosition(point); + } + + void sendEvent(QWidget* w, QEvent* ev) + { + m_ignoreEvents = true; + qt_sendSpontaneousEvent(w, ev); + m_ignoreEvents = false; + } + + QWebView* m_view; + bool m_ignoreEvents; + QPointer<QWebFrame> m_frame; + Qt::ScrollBarPolicy m_oldVerticalScrollBarPolicy; + Qt::ScrollBarPolicy m_oldHorizontalScrollBarPolicy; +}; + +#endif // Q_WS_MAEMO_5 + + +/*! + \class QWebView + \since 4.4 + \brief The QWebView class provides a widget that is used to view and edit + web documents. + \ingroup advanced + + \inmodule QtWebKit + + 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 a Nokia 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 webkitsnippets/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}, {Web Browser}, {Form Extractor Example}, + {Google Chat Example}, {Fancy Browser Example} +*/ + +/*! + 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) && !defined(Q_OS_SYMBIAN) + setAttribute(Qt::WA_InputMethodEnabled); +#endif + + setAttribute(Qt::WA_AcceptTouchEvents); +#if defined(Q_WS_MAEMO_5) + QAbstractKineticScroller* scroller = new QWebViewKineticScroller(); + static_cast<QWebViewKineticScroller*>(scroller)->setWidget(this); + setProperty("kineticScroller", QVariant::fromValue(scroller)); +#endif + setAcceptDrops(true); + + setMouseTracking(true); + setFocusPolicy(Qt::WheelFocus); +} + +/*! + Destroys the web view. +*/ +QWebView::~QWebView() +{ + 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; +} + +void QWebViewPrivate::detachCurrentPage() +{ + if (!page) + return; + + page->d->view.clear(); + + // if the page client is the special client constructed for + // delegating the responsibilities to a QWidget, we need + // to destroy it. + + if (page->d->client && page->d->client->isQWidgetClient()) + page->d->client.clear(); + + page->d->client.release(); + + // if the page was created by us, we own it and need to + // destroy it as well. + + if (page->parent() == view) + delete page; + else + page->disconnect(view); + + page = 0; +} + +/*! + 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; + + d->detachCurrentPage(); + 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(QString)), + this, SIGNAL(titleChanged(QString))); + connect(mainFrame, SIGNAL(iconChanged()), + this, SIGNAL(iconChanged())); + connect(mainFrame, SIGNAL(urlChanged(QUrl)), + this, SIGNAL(urlChanged(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(QString)), + this, SIGNAL(statusBarMessage(QString))); + connect(d->page, SIGNAL(linkClicked(QUrl)), + this, SIGNAL(linkClicked(QUrl))); + connect(d->page, SIGNAL(selectionChanged()), + this, SIGNAL(selectionChanged())); + + connect(d->page, SIGNAL(microFocusChanged()), + this, SLOT(updateMicroFocus())); + connect(d->page, SIGNAL(destroyed()), + this, SLOT(_q_pageDestroyed())); + } + 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(), QUrl::fromUserInput() +*/ +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() +*/ + +void QWebView::load(const QNetworkRequest &request, + QNetworkAccessManager::Operation operation, + const QByteArray &body) +{ + page()->mainFrame()->load(request, operation, body); +} + +/*! + 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. + + The \a html is loaded immediately; external objects are loaded asynchronously. + + 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. + + This is a convenience function equivalent to setContent(html, "text/html", baseUrl). + + \warning This function works only for HTML, for other mime types (i.e. XHTML, SVG) + setContent() should be used instead. + + \sa load(), setContent(), QWebFrame::toHtml(), QWebFrame::setContent() +*/ +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. + + The \a data is loaded immediately; external objects are loaded asynchronously. + + \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 webkitsnippets/qtwebkit_qwebview_snippet.cpp 0 +*/ +QWebHistory *QWebView::history() const +{ + return page()->history(); +} + +/*! + Returns a pointer to the view/page specific settings object. + + It is equivalent to + + \snippet webkitsnippets/qtwebkit_qwebview_snippet.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::hasSelection + \brief whether this page contains selected content or not. + + By default, this property is false. + + \sa selectionChanged() +*/ +bool QWebView::hasSelection() const +{ + if (d->page) + return d->page->hasSelection(); + return false; +} + +/*! + \property QWebView::selectedText + \brief the text currently selected + + By default, this property contains an empty string. + + \sa findText(), selectionChanged(), selectedHtml() +*/ +QString QWebView::selectedText() const +{ + if (d->page) + return d->page->selectedText(); + return QString(); +} + +/*! + \since 4.8 + \property QWebView::selectedHtml + \brief the HTML currently selected + + By default, this property contains an empty string. + + \sa findText(), selectionChanged(), selectedText() +*/ +QString QWebView::selectedHtml() const +{ + if (d->page) + return d->page->selectedHtml(); + return QString(); +} + +#ifndef QT_NO_ACTION +/*! + 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); +} +#endif + +/*! + 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 webkitsnippets/qtwebkit_qwebview_snippet.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(); +} + +/*! + \property QWebView::renderHints + \since 4.6 + \brief the default render hints for the view + + These hints are used to initialize QPainter before painting the Web page. + + QPainter::TextAntialiasing and QPainter::SmoothPixmapTransform are enabled by default. + + \note This property is not available on Symbian. However, the getter and + setter functions can still be used directly. + + \sa QPainter::renderHints() +*/ + +/*! + \since 4.6 + Returns the render hints used by the view to render content. + + \sa QPainter::renderHints() +*/ +QPainter::RenderHints QWebView::renderHints() const +{ + return d->renderHints; +} + +/*! + \since 4.6 + Sets the render hints used by the view to the specified \a hints. + + \sa QPainter::setRenderHints() +*/ +void QWebView::setRenderHints(QPainter::RenderHints hints) +{ + if (hints == d->renderHints) + return; + d->renderHints = hints; + update(); +} + +/*! + \since 4.6 + If \a enabled is true, enables the specified render \a hint; otherwise + disables it. + + \sa renderHints, QPainter::renderHints() +*/ +void QWebView::setRenderHint(QPainter::RenderHint hint, bool enabled) +{ + QPainter::RenderHints oldHints = d->renderHints; + if (enabled) + d->renderHints |= hint; + else + d->renderHints &= ~hint; + if (oldHints != d->renderHints) + update(); +} + + +/*! + Finds the specified string, \a subString, in the page, using the given \a options. + + If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences + that exist in the page. All subsequent calls will extend the highlight, rather than + replace it, with occurrences of the new string. + + If the HighlightAllOccurrences flag is not passed, the function will select an occurrence + and all subsequent calls will replace the current occurrence with the next one. + + To clear the selection, just pass an empty string. + + Returns true if \a subString was found; 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() == QEvent::CursorChange) { + // An unsetCursor will set the cursor to Qt::ArrowCursor. + // Thus this cursor change might be a QWidget::unsetCursor() + // If this is not the case and it came from WebCore, the + // QWebPageClient already has set its cursor internally + // to Qt::ArrowCursor, so updating the cursor is always + // right, as it falls back to the last cursor set by + // WebCore. + // FIXME: Add a QEvent::CursorUnset or similar to Qt. + if (cursor().shape() == Qt::ArrowCursor) + d->page->d->client->resetCursor(); +#endif + } else if (e->type() == QEvent::TouchBegin + || e->type() == QEvent::TouchEnd + || e->type() == QEvent::TouchUpdate) { + d->page->event(e); + + // Always return true so that we'll receive also TouchUpdate and TouchEnd events + return true; + } 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 webkitsnippets/qtwebkit_qwebview_snippet.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 webkitsnippets/qtwebkit_qwebview_snippet.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 webkitsnippets/qtwebkit_qwebview_snippet.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); + p.setRenderHints(d->renderHints); + + 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 from the createWindow() method of the associated QWebPage, + each time the page wants to create a new window of the given \a type. This might + be the result, for example, of a JavaScript request to open a document in a new window. + + \note If the createWindow() method of the associated page is reimplemented, this + method is not called, unless explicitly done so in the reimplementation. + + \note In the cases when the window creation is being triggered by JavaScript, apart from + reimplementing this method application must also set the JavaScriptCanOpenWindows attribute + of QWebSettings to true in order for it to get called. + + \sa QWebPage::createWindow(), QWebPage::acceptNavigationRequest() +*/ +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 status bar \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. + + In order for icons to be loaded, you will need to set an icon database path + using QWebSettings::setIconDatabasePath(). + + \sa icon(), QWebSettings::setIconDatabasePath() +*/ + +/*! + \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() +*/ + +#include "moc_qwebview.cpp" + diff --git a/Source/WebKit/qt/Api/qwebview.h b/Source/WebKit/qt/Api/qwebview.h new file mode 100644 index 0000000..8b28f62 --- /dev/null +++ b/Source/WebKit/qt/Api/qwebview.h @@ -0,0 +1,167 @@ +/* + 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 <QtGui/qpainter.h> +#include <QtCore/qurl.h> +#include <QtNetwork/qnetworkaccessmanager.h> + +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(QString selectedHtml READ selectedHtml) + Q_PROPERTY(bool hasSelection READ hasSelection) + 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) + + Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints) + Q_FLAGS(QPainter::RenderHints) +public: + explicit QWebView(QWidget* parent = 0); + virtual ~QWebView(); + + QWebPage* page() const; + void setPage(QWebPage* page); + + void load(const QUrl& url); + void load(const QNetworkRequest& request, + QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, + const QByteArray &body = QByteArray()); + 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; + + bool hasSelection() const; + QString selectedText() const; + QString selectedHtml() const; + +#ifndef QT_NO_ACTION + QAction* pageAction(QWebPage::WebAction action) const; +#endif + 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; + + QPainter::RenderHints renderHints() const; + void setRenderHints(QPainter::RenderHints hints); + void setRenderHint(QPainter::RenderHint hint, bool enabled = true); + + 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*) 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&); + void selectionChanged(); + void iconChanged(); + void urlChanged(const QUrl&); + +protected: + void resizeEvent(QResizeEvent*); + void paintEvent(QPaintEvent*); + + 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; + Q_PRIVATE_SLOT(d, void _q_pageDestroyed()) +}; + +#endif // QWEBVIEW_H diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog new file mode 100644 index 0000000..06fb368 --- /dev/null +++ b/Source/WebKit/qt/ChangeLog @@ -0,0 +1,29313 @@ +2011-01-17 Alexey Proskuryakov <ap@apple.com> + + https://bugs.webkit.org/show_bug.cgi?id=52495 + + * Api/qwebframe.cpp: (QWebFrame::print): Avoid breaking the build due to type mismatch. + Longer term, this code should be changed to use an unsigned type for page count. + +2011-01-17 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Extend the Platform Plugin to support full screen video handler + https://bugs.webkit.org/show_bug.cgi?id=51249 + + Add a new webkit platform plugin interface to support full screen video handler. + + * Api/qwebkitplatformplugin.h: + (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler): + (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::ChromeClientQt): + (WebCore::ChromeClientQt::~ChromeClientQt): + (WebCore::ChromeClientQt::fullScreenVideo): + (WebCore::ChromeClientQt::supportsFullscreenForNode): + (WebCore::ChromeClientQt::requiresFullscreenForVideoPlayback): + (WebCore::ChromeClientQt::enterFullscreenForNode): + (WebCore::ChromeClientQt::exitFullscreenForNode): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/FullScreenVideoQt.cpp: Added. + (WebCore::FullScreenVideoQt::FullScreenVideoQt): + (WebCore::FullScreenVideoQt::~FullScreenVideoQt): + (WebCore::FullScreenVideoQt::enterFullScreenForNode): + (WebCore::FullScreenVideoQt::exitFullScreenForNode): + (WebCore::FullScreenVideoQt::aboutToClose): + (WebCore::FullScreenVideoQt::mediaPlayer): + (WebCore::FullScreenVideoQt::mediaPlayerForNode): + (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback): + * WebCoreSupport/FullScreenVideoQt.h: Added. + (WebCore::FullScreenVideoQt::isValid): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createFullScreenVideoHandler): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + (FullScreenVideoWidget::FullScreenVideoWidget): + (FullScreenVideoWidget::event): + (FullScreenVideoWidget::keyPressEvent): + (FullScreenVideoHandler::FullScreenVideoHandler): + (FullScreenVideoHandler::~FullScreenVideoHandler): + (FullScreenVideoHandler::requiresFullScreenForVideoPlayback): + (FullScreenVideoHandler::enterFullScreen): + (FullScreenVideoHandler::exitFullScreen): + (WebPlugin::supportsExtension): + (WebPlugin::createExtension): + * examples/platformplugin/WebPlugin.h: + (FullScreenVideoWidget::~FullScreenVideoWidget): + * examples/platformplugin/platformplugin.pro: + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler): + (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler): + +2011-01-16 Adam Barth <abarth@webkit.org> + + Rubber-stamped by Eric Seidel. + + Move WebKit into Source + https://bugs.webkit.org/show_bug.cgi?id=52530 + + * Api/DerivedSources.pro: + * declarative/declarative.pro: + * docs/docs.pri: + * tests/tests.pri: + +2011-01-15 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r75708. + http://trac.webkit.org/changeset/75708 + https://bugs.webkit.org/show_bug.cgi?id=52521 + + Breaks Qt build if mobility is not installed. (Requested by + benjaminp on #webkit). + + * Api/qwebkitplatformplugin.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::ChromeClientQt): + (WebCore::ChromeClientQt::~ChromeClientQt): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/FullScreenVideoQt.cpp: Removed. + * WebCoreSupport/FullScreenVideoQt.h: Removed. + * WebCoreSupport/QtPlatformPlugin.cpp: + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + (WebPlugin::supportsExtension): + (WebPlugin::createExtension): + * examples/platformplugin/WebPlugin.h: + * examples/platformplugin/platformplugin.pro: + * examples/platformplugin/qwebkitplatformplugin.h: + +2011-01-15 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] plugins/no-mime-with-valid-extension.html fails + Check extension of resource against installed + plugins when determining mime-type. + + https://bugs.webkit.org/show_bug.cgi?id=52288 + https://bugs.webkit.org/show_bug.cgi?id=50657 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::objectContentType): + +2011-01-14 Sam Magnuson <smagnuso@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Compile with QT_NO_GRAPHICSVIEW + https://bugs.webkit.org/show_bug.cgi?id=49750 + + * Api/qgraphicswebview.cpp: + * Api/qgraphicswebview.h: + * Api/qwebpage.cpp: + (QWebPage::event): + * Api/qwebpage_p.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + * WebCoreSupport/PageClientQt.cpp: + * WebCoreSupport/PageClientQt.h: + +2011-01-14 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Antti Koivisto. + + Rename cache() to memoryCache() + https://bugs.webkit.org/show_bug.cgi?id=52433 + + * Api/qwebpage.cpp: + (QWebPagePrivate::_q_cleanupLeakMessages): + * Api/qwebsettings.cpp: + (QWebSettings::clearMemoryCaches): + (QWebSettings::setObjectCacheCapacities): + +2011-01-14 Konstantin Tokarev <annulen@yandex.ru> + + Reviewed by Laszlo Gombos. + + [Qt] Fixed compilation when QT_NO_SHORTCUT is defined + https://bugs.webkit.org/show_bug.cgi?id=52460 + + This patch fixes compilation when QT_NO_SHORTCUT is defined in Qt + configuration. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): Added QT_NO_SHORTCUT guards + +2011-01-13 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Need a way to inform the application when a Netscape plugin is created. + https://bugs.webkit.org/show_bug.cgi?id=30179 + + Added "c" style static method for the application to hook up for + receiving notifications when a plugin is created. + + * symbian/bwins/QtWebKitu.def: + * symbian/eabi/QtWebKitu.def: + +2011-01-13 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Extend the Platform Plugin to support full screen video handler + https://bugs.webkit.org/show_bug.cgi?id=51249 + + Add a new webkit platform plugin interface to support full screen video handler. + + * Api/qwebkitplatformplugin.h: + (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler): + (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::ChromeClientQt): + (WebCore::ChromeClientQt::~ChromeClientQt): + (WebCore::ChromeClientQt::fullScreenVideo): + (WebCore::ChromeClientQt::supportsFullscreenForNode): + (WebCore::ChromeClientQt::requiresFullscreenForVideoPlayback): + (WebCore::ChromeClientQt::enterFullscreenForNode): + (WebCore::ChromeClientQt::exitFullscreenForNode): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/FullScreenVideoQt.cpp: Added. + (WebCore::FullScreenVideoQt::FullScreenVideoQt): + (WebCore::FullScreenVideoQt::~FullScreenVideoQt): + (WebCore::FullScreenVideoQt::enterFullScreenForNode): + (WebCore::FullScreenVideoQt::exitFullScreenForNode): + (WebCore::FullScreenVideoQt::aboutToClose): + (WebCore::FullScreenVideoQt::mediaPlayer): + (WebCore::FullScreenVideoQt::mediaPlayerForNode): + (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback): + * WebCoreSupport/FullScreenVideoQt.h: Added. + (WebCore::FullScreenVideoQt::isValid): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createFullScreenVideoHandler): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + (FullScreenVideoWidget::FullScreenVideoWidget): + (FullScreenVideoWidget::event): + (FullScreenVideoWidget::keyPressEvent): + (FullScreenVideoHandler::FullScreenVideoHandler): + (FullScreenVideoHandler::~FullScreenVideoHandler): + (FullScreenVideoHandler::requiresFullScreenForVideoPlayback): + (FullScreenVideoHandler::enterFullScreen): + (FullScreenVideoHandler::exitFullScreen): + (WebPlugin::supportsExtension): + (WebPlugin::createExtension): + * examples/platformplugin/WebPlugin.h: + (FullScreenVideoWidget::~FullScreenVideoWidget): + * examples/platformplugin/platformplugin.pro: + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler): + (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler): + +2011-01-12 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Search input field doesn't have cancel button + + Add a cancel button to the search field and make it customizable + by the client. For now, use the close dialog button associated + with the application's style as the default. + + https://bugs.webkit.org/show_bug.cgi?id=42887 + + * Api/qwebsettings.cpp: + (graphics): + * Api/qwebsettings.h: + +2011-01-12 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r74344. + http://trac.webkit.org/changeset/74344 + https://bugs.webkit.org/show_bug.cgi?id=52290 + + broke QWebPluginFactory for unusual mime-types (Requested by + kling on #webkit). + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2011-01-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove uses of QFuture since it isn't supported on all platforms. + https://bugs.webkit.org/show_bug.cgi?id=51204 + + * tests/qwebpage/tst_qwebpage.cpp: + (QtNAMThread::QtNAMThread): + (QtNAMThread::networkAccessManager): + (QtNAMThread::run): + +2011-01-11 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix tst_QWebPage::geolocationRequestJS() + https://bugs.webkit.org/show_bug.cgi?id=46814 + + Skip the test when WebKit is compiled without geolocation. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::geolocationRequestJS): + +2011-01-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Csaba Osztrogonác. + + [Qt] Baseline qt_minimal configuration + https://bugs.webkit.org/show_bug.cgi?id=51313 + + * WebCoreSupport/PopupMenuQt.cpp: + (WebCore::PopupMenuQt::show): Add QT_NO_COMBOBOX guard. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::populate): Add QT_NO_TOOLTIP guard. + + * tests/qwebframe/tst_qwebframe.cpp: Add QT_NO_COMBOBOX guard. + * tests/qwebpage/tst_qwebpage.cpp: + (PluginPage::createPlugin): Add QT_NO_INPUTDIALOG guard. + +2011-01-10 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Adler. + + Introduce the notion of a "display-isolated" URL scheme for use by + Chrome-internal URLs + https://bugs.webkit.org/show_bug.cgi?id=50182 + + Update to new function name. + + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::localSchemes): + +2011-01-10 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Navigator.cookiesEnabled return true for Qt even if there is no cookie jar + https://bugs.webkit.org/show_bug.cgi?id=52081 + + Add an autotest for checking the result of Navigator.cookiesEnabled depending + on the status of the cookie jar. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::navigatorCookieEnabled): + +2011-01-09 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r75337. + http://trac.webkit.org/changeset/75337 + https://bugs.webkit.org/show_bug.cgi?id=52137 + + It made fast/dom/navigator-detached-no-crash.html crash + (Requested by Ossy on #webkit). + + * tests/qwebpage/tst_qwebpage.cpp: + +2011-01-09 Xianzhu Wang <phnixwxz@gmail.com> + + Reviewed by Darin Fisher. + + https://bugs.webkit.org/show_bug.cgi?id=41441 + createWindow method should only do window-creating without URL navigation + + * Api/qwebpage.cpp: + (openNewWindow): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createWindow): + +2011-01-08 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Navigator.cookiesEnabled return true for Qt even if there is no cookie jar + https://bugs.webkit.org/show_bug.cgi?id=52081 + + Add an autotest for checking the result of Navigator.cookiesEnabled depending + on the status of the cookie jar. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::navigatorCookieEnabled): + +2011-01-07 Adam Barth <abarth@webkit.org> + + Rubber-stamped by Eric Seidel. + + Move WebCore to Source + https://bugs.webkit.org/show_bug.cgi?id=52050 + + Update documentation to reference new location of WebCore. + + * docs/qtwebkit.qdoc: + +2011-01-07 Andreas Kling <kling@webkit.org> + + Reviewed by Adam Barth. + + [Qt] Add selectedHtml function to QWebView + https://bugs.webkit.org/show_bug.cgi?id=35028 + + Add QWebView::selectedHtml() and QWebPage::selectedHtml() + which return the current selection range's HTML representation. + + * Api/qwebpage.cpp: + (QWebPage::selectedHtml): + * Api/qwebpage.h: + * Api/qwebview.cpp: + (QWebView::selectedText): + (QWebView::selectedHtml): + * Api/qwebview.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::cursorMovements): + (tst_QWebPage::textSelection): + (tst_QWebPage::crashTests_LazyInitializationOfMainFrame): + (tst_QWebPage::findText): + +2011-01-06 Robert Hogan <robert@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Introduce QDRTNode for passing WebCore::Node across JS bridge + + This allows LayoutTestController to pass WebCore::Node back to + layout tests. + + Also amend nodesFromRect-links-and-text.html and + nodesFromRect-inner-documents.html so that they do not produce + platform-specific results. + + Unskip: + fast/dom/nodesFromRect-links-and-text.html + fast/dom/nodesFromRect-inner-documents.html + + https://bugs.webkit.org/show_bug.cgi?id=48957 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (QDRTNode::QDRTNode): + (QDRTNode::~QDRTNode): + (DumpRenderTreeSupportQt::nodesFromRect): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2011-01-04 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + Acked by Aaron Kennedy <aaron.kennedy@nokia.com> + + [Qt] QML WebView does not transfer focus to underlying QGraphicsWebView + + QML WebView creates QGraphicsWebView as it's child. The WebView is not + setup as a focus proxy of the QGraphicsWebView. Thus, even though the + WebView gets focus, the QGraphicsWebView does not get focus. + In QML, focus proxies or "focus scopes" are created using FocusScope. + This change makes WebView a FocusScope and sets the focus on the + QGraphicsWebView. + + https://bugs.webkit.org/show_bug.cgi?id=51094 + + * declarative/qdeclarativewebview.cpp: + (QDeclarativeWebView::init): + +2011-01-05 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Sync qwebkitplatformplugin.h in the plugin example + https://bugs.webkit.org/show_bug.cgi?id=51882 + + Make examples/platformplugin/qwebkitplatformplugin.h exactly the same + as the one in the Api folder. + + * examples/platformplugin/qwebkitplatformplugin.h: + +2011-01-04 Zhe Su <suzhe@chromium.org> + + Reviewed by Kenneth Russell. + + Fix test LayoutTests/fast/events/ime-composition-events-001.html. + + https://bugs.webkit.org/show_bug.cgi?id=51693 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): Calls editor->insertText() to + insert the commit string when no composition text is available. + +2011-01-03 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Adam Barth. + + [Qt] Add SelectAll option to the context menu for the editor + https://bugs.webkit.org/show_bug.cgi?id=50049 + + Enable SelectAll for the Qt context menu. + + * Api/qwebpage.cpp: + (webActionForContextMenuAction): + (QWebPage::action): + * WebCoreSupport/WebPlatformStrategies.cpp: + (WebPlatformStrategies::contextMenuItemTagSelectAll): + * WebCoreSupport/WebPlatformStrategies.h: + +2011-01-03 Antonio Gomes <agomes@rim.com> + + Unreviewed crash fix. + + Follow up of r74891: potential crash fix (bogus assertion). + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::editorCommandForKeyDownEvent): + +2011-01-03 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] document.getElementById(...) doesn't return the right object in combination with QGraphicsWidget + https://bugs.webkit.org/show_bug.cgi?id=51464 + + Added a way to bind any QObject created as a plugin to JavaScript, + by adding a custom membe to WebCore::Widget. + Added a test to make sure plugins created as QGraphicsWidget are + accessible through JavaScript. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + * tests/qwebpage/tst_qwebpage.cpp: + (PluginPage::createPlugin): + (tst_QWebPage::graphicsWidgetPlugin): + +2011-01-02 Antonio Gomes <agomes@rim.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Refactor EditorClientQt::handleKeyboardEvent + https://bugs.webkit.org/show_bug.cgi?id=51306 + + EditorClientQt::handleKeyboardEvent relies on QWebPagePrivate::editorActionForKeyEvent() + to handle all editor commands that have a QAction associted with it. + In practice, that covers most of editor commands (as one can see in editorCommandWebActions, + in qwebpage.cpp). However, there are some key down events that are associated to no QAction + or need special handling when features like spatial navigation or + caret browsing are enabled. Currently, these cases are being handled with confusing + and nested if/else switch's statements in EditorClientQt::handleKeyboardEvent(), + and the code is hardly readable. + + This patch introduces a mapping hash for those cases, simplifying much + the code. Basically, nested switches statements mixed with if/else's were + refactored, and early returns were added right after an event gets consumed + by the Editor. + + Since it is a refactor only patch, there is no funcionality change at + all, and then no new tests are being added. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::interpretKeyEvent): + (WebCore::EditorClientQt::handleKeyboardEvent): + +2011-01-01 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Move JavaScriptCore to Source + https://bugs.webkit.org/show_bug.cgi?id=51604 + + * WebKit_pch.h: + * docs/qtwebkit.qdocconf: + - Point to JavaScriptCore in its new location. + +2010-12-29 Kent Hansen <kent.hansen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix compilation with Qt in namespace + https://bugs.webkit.org/show_bug.cgi?id=51701 + + * Api/qwebkitplatformplugin.h: + * WebCoreSupport/InspectorServerQt.h: + * tests/hybridPixmap/widget.h: + +2010-12-23 Jan Erik Hanssen <jhanssen@sencha.com> + + Reviewed by Alexey Proskuryakov. + + [Qt] Composition text is not removed from the editor when composition is cancelled + https://bugs.webkit.org/show_bug.cgi?id=29391 + + Ensure that the composition text is cleared when an empty QInputMethodEvent + is received and the editor is in composition mode. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + +2010-12-23 Jan Erik Hanssen <jhanssen@sencha.com> + + Reviewed by Andreas Kling. + + [Qt] copy and paste greek symbols to Word, TextEdit results in ?'s being shown + https://bugs.webkit.org/show_bug.cgi?id=35635 + + Test that QClipboard contains the charset information and unicode data + after copying unicode text. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::macCopyUnicodeToClipboard): + +2010-12-22 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + WebKit2 needs to mirror the frame tree in the UIProcess + https://bugs.webkit.org/show_bug.cgi?id=51546 + + - Add client functions to notify that a frame has been added or + removed from the page cache. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::didSaveToPageCache): + (WebCore::FrameLoaderClientQt::didRestoreFromPageCache): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-12-22 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Eric Seidel. + + Editor.h doesn't need to include SelectionController.h + https://bugs.webkit.org/show_bug.cgi?id=51441 + + Renamed SelectionController::EDirection to SelectionDirection. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-12-23 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Add a 'hasSelection' function to QWebView and QWebPage. + https://bugs.webkit.org/show_bug.cgi?id=48722 + + This is a convenience API that optimizes the case where checking for + the presence of selected content and accessing the selected content + are two separate actions in the client. See comment #12 in the above + bug report link for details. + + * Api/qwebpage.cpp: + (QWebPage::hasSelection): + * Api/qwebpage.h: + * Api/qwebview.cpp: + (QWebView::hasSelection): + * Api/qwebview.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textSelection): + +2010-12-20 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Improve the readability of FrameLoaderClientQt::createPlugin() + https://bugs.webkit.org/show_bug.cgi?id=51330 + + Redefine the scopes to improve readability. Objects are now created in + the scope they are used in. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-12-17 Ariya Hidayat <ariya@sencha.com> + + Reviewed by Antonio Gomes. + + [Qt] GraphicsContext should respect QWebView render hints + https://bugs.webkit.org/show_bug.cgi?id=51208 + + Adjust the test since SmoothPixmapTransform is set by default. + + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::renderHints): + +2010-12-05 Antonio Gomes <agomes@rim.com> + + Reviewed by Ariya Hidayat. + + [Qt] Fix caret browsing navigation mode + https://bugs.webkit.org/show_bug.cgi?id=50536 + + Caret browsing can consume editing commands even when the start + of current selection is not a editable content. r69582 missed this + case because caret browsing feature testing is very poor today. + + This commit reintroduces part of the removed code in r69582 but + guarded by a isCaretBrowsingEnabled() check. No regression found. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-12-17 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage sends out a RequestSoftwareInputPanel event + incorrectly in particular case + https://bugs.webkit.org/show_bug.cgi?id=50419 + + Add HitTestResult check before firing RequestSoftwareInputPanel event. + + * Api/qwebpage.cpp: + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::handleSoftwareInputPanel): + * Api/qwebpage_p.h: + * tests/qwebpage/tst_qwebpage.cpp: + (clickOnPage): + (tst_QWebPage::inputMethods): + +2010-12-17 Eric Seidel <eric@webkit.org> + + Unreviewed, rolling out r74229. + http://trac.webkit.org/changeset/74229 + https://bugs.webkit.org/show_bug.cgi?id=50536 + + Broken on Snow Leopard and possibly other platforms + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-12-05 Antonio Gomes <agomes@rim.com> + + Reviewed by Ariya Hidayat. + + [Qt] Fix caret browsing navigation mode + https://bugs.webkit.org/show_bug.cgi?id=50536 + + Caret browsing can consume editing commands even when the start + of current selection is not a editable content. r69582 missed this + case because caret browsing feature testing is very poor today. + + This commit reintroduces part of the removed code in r69582 but + guarded by a isCaretBrowsingEnabled() check. No regression found. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-12-16 Ariya Hidayat <ariya@sencha.com> + + Reviewed by Andreas Kling. + + [Qt] GraphicsContext should respect QWebView render hints + https://bugs.webkit.org/show_bug.cgi?id=51208 + + Add some checks to ensure that GraphicsContext (via QWebFrame) + does not clobber the render hints. + + * Api/qwebview.cpp: + (QWebViewPrivate::QWebViewPrivate): + * tests/qwebframe/tst_qwebframe.cpp: + +2010-12-15 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] Fix tst_QWebPage::geolocationRequestJS() + https://bugs.webkit.org/show_bug.cgi?id=46814 + + Change the test case according to the changes introduced by + r72603 and enable the test case. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::geolocationRequestJS): + +2010-12-14 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Flash plugins should be windowless on QGraphicsWebView on Symbian + Remove #idef SYMBIAN introduced by r69396. + https://bugs.webkit.org/show_bug.cgi?id=50487 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-10-28 MORITA Hajime <morrita@google.com> + + Reviewed by Ojan Vafai. + + spellcheck does not check pasted text + https://bugs.webkit.org/show_bug.cgi?id=40092 + + Added a stub implememntation. + + * WebCoreSupport/EditorClientQt.h: + (WebCore::EditorClientQt::requestCheckingOfString): + +2010-12-11 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Memory leaks for QWebPageClient + https://bugs.webkit.org/show_bug.cgi?id=50267 + + Use OwnPtr to solve this memory leak issue. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::overlay): + (QGraphicsWebViewPrivate::QWebViewPrivate::pageClient): + (QGraphicsWebViewPrivate::syncLayers): + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + (QGraphicsWebViewPrivate::_q_scaleChanged): + (QGraphicsWebViewPrivate::detachCurrentPage): + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebViewPrivate::detachCurrentPage): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::platformPageClient): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-12-11 Jan Erik Hanssen <jhanssen@sencha.com> + + Reviewed by Andreas Kling. + + [Qt] QWebFrame does not support QNetworkRequest::CacheLoadControl + https://bugs.webkit.org/show_bug.cgi?id=35671 + + Make QWebFrame respect the QNetworkRequest::CacheLoadControl attribute + set on the request, if any. + + * Api/qwebframe.cpp: + (cacheLoadControlToCachePolicy): + (QWebFrame::load): + * tests/qwebframe/tst_qwebframe.cpp: + +2010-10-11 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Mock DeviceOrientation client for DRT + https://bugs.webkit.org/show_bug.cgi?id=47490 + + * WebCoreSupport/DeviceOrientationClientMockQt.cpp: Added. + (WebCore::DeviceOrientationClientMockQt::client): + (WebCore::DeviceOrientationClientMockQt::DeviceOrientationClientMockQt): + (WebCore::DeviceOrientationClientMockQt::~DeviceOrientationClientMockQt): + (WebCore::DeviceOrientationClientMockQt::setController): + (WebCore::DeviceOrientationClientMockQt::startUpdating): + (WebCore::DeviceOrientationClientMockQt::stopUpdating): + (WebCore::DeviceOrientationClientMockQt::lastOrientation): + (WebCore::DeviceOrientationClientMockQt::deviceOrientationControllerDestroyed): + (WebCore::DeviceOrientationClientMockQt::setOrientation): + * WebCoreSupport/DeviceOrientationClientMockQt.h: Added. + * WebCoreSupport/DeviceOrientationClientQt.cpp: + * WebCoreSupport/DeviceOrientationProviderQt.cpp: + (WebCore::DeviceOrientationProviderQt::DeviceOrientationProviderQt): + (WebCore::DeviceOrientationProviderQt::~DeviceOrientationProviderQt): + (WebCore::DeviceOrientationProviderQt::changeDeviceOrientation): + * WebCoreSupport/DeviceOrientationProviderQt.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::activeMockDeviceOrientationClient): + (DumpRenderTreeSupportQt::removeMockDeviceOrientation): + (DumpRenderTreeSupportQt::setMockDeviceOrientation): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-12-10 Krithigassree Sambamurthy <krithigassree.sambamurthy@nokia.com> + + Reviewed by Joseph Pecoraro. + + Bug 43455 - [Qt]: Implement Application Cache Quotas + https://bugs.webkit.org/show_bug.cgi?id=43455 + + Added new signal to report ApplicationCache Database + quota. + + * Api/qwebpage.cpp: + * Api/qwebpage.h: + + Added new functions to accomodate new appcache layout + test origin-quota.html. + + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::setApplicationCacheQuota): + * Api/qwebsecurityorigin.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::clearAllApplicationCaches): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-12-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Support a QNetworkAccessManager affined to a different thread. + https://bugs.webkit.org/show_bug.cgi?id=50080 + + This patch introduce thread safe proxy classes for QNetworkAccessManager + and QNetworkReply. + If run in the same thread, these objects will forward the calls with + Qt::DirectConnection bindings, while in the other case they will use + Qt::QueuedConnection to carry requests accross threads. + + This patch basically: + - Makes sure that all access goes through these objects + - Reorders signal connections to make sure we are connected when the + signal comes + - Makes sure that no QObject in the WebCore thread is a child of the + reply which might be in a different thread. + - Forward the data directly in QByteArrays in signals instead of collecting + the data when the signal is handled. + + New test: tst_QWebPage::networkAccessManagerOnDifferentThread + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::download): + * tests/qwebpage/tst_qwebpage.cpp: + (QtNAMThread::QtNAMThread): + (QtNAMThread::~QtNAMThread): + (QtNAMThread::networkAccessManager): + (QtNAMThread::run): + (tst_QWebPage::networkAccessManagerOnDifferentThread): + +2010-12-09 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r73635. + http://trac.webkit.org/changeset/73635 + https://bugs.webkit.org/show_bug.cgi?id=50778 + + 'Side-effects on 3 css tests needs closer review' (Requested + by mwenge on #webkit). + + * Api/qwebsettings.cpp: + (graphics): + * Api/qwebsettings.h: + +2010-12-09 Robert Hogan <robert@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] Search input field doesn't have cancel button + + Add a cancel button to the search field and make it customizable + by the client. For now, use the close dialog button associated + with the application's style as the default. + + https://bugs.webkit.org/show_bug.cgi?id=42887 + + * Api/qwebsettings.cpp: + (graphics): + * Api/qwebsettings.h: + +2010-12-09 Siddharth Mathur <siddharth.mathur@nokia.com> + + Reviewed by Laszlo Gombos. + + Use BUILDING_WEBKIT like other ports + https://bugs.webkit.org/show_bug.cgi?id=50713 + + * Api/qwebkitglobal.h: change BUILD_WEBKIT to BUILDING_WEBKIT + +2010-12-08 Qi Zhang <qi.2.zhang@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Support OrientationChange event + https://bugs.webkit.org/show_bug.cgi?id=50685 + + Get OrientationChange event from qtmobility then send to webkit. + + * Api/qwebframe.cpp: + (QWebFrame::orientationChanged): + (QWebFrame::QWebFrame): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + +2010-12-07 Brian Weinstein <bweinstein@apple.com> + + Reviewed by John Sullivan. + + Layering Violation in ContextMenu - member variable of type HitTestResult + https://bugs.webkit.org/show_bug.cgi?id=50586 + + Update users of ContextMenu and ContextMenuController to match where the new functions + are located. + + * Api/qwebpage.cpp: + (QWebPagePrivate::createContextMenu): + (QWebPage::updatePositionDependentActions): + +2010-12-07 Darin Adler <darin@apple.com> + + Try to fix build. + + * Api/qwebpage.cpp: + (frameLoadRequest): Added missing parentheses. + +2010-12-06 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Pass security origin to make local file decision correctly + https://bugs.webkit.org/show_bug.cgi?id=48603 + + * Api/qwebpage.cpp: + (frameLoadRequest): Pass security origin. + +2010-12-07 Martin Robinson <mrobinson@igalia.com> + + Unreviewed, rolling out r73392. + http://trac.webkit.org/changeset/73392 + https://bugs.webkit.org/show_bug.cgi?id=50489 + + This commit caused crashes on the GTK+ bots + + * Api/qwebframe.cpp: + (QWebFrame::setUrl): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::finishedLoading): + +2010-12-06 Nate Chapin <japhet@chromium.org> + + Reviewed by Adam Barth. + + Update calls to DocumentWriter. + https://bugs.webkit.org/show_bug.cgi?id=50489 + + * Api/qwebframe.cpp: + (QWebFrame::setUrl): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::finishedLoading): + +2010-12-01 Jia Pu <jpu@apple.com> + + Reviewed by Darin Adler. + + Support multiple correction candidates panel for misspelled word on Mac OS X. + https://bugs.webkit.org/show_bug.cgi?id=50137 + <rdar://problem/8568059> + + Adopted new function signature defined in base class. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::getGuessesForWord): + * WebCoreSupport/EditorClientQt.h: + +2010-11-30 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Implement layoutTestController.findString + https://bugs.webkit.org/show_bug.cgi?id=50236 + + Add support for the new advanced findString(). + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::findString): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-11-30 Ojan Vafai <ojan@chromium.org> + + Revert r72876. It caused a ~30% perf regression in chromium's bloat-http test + https://bugs.webkit.org/show_bug.cgi?id=50288 + + 2010-11-29 Adam Barth <abarth@webkit.org (:abarth) (r)> + Reviewed by Darin Adler. + Introduce the notion of a "display-isolated" URL scheme for use by Chrome-internal URLs + https://bugs.webkit.org/show_bug.cgi?id=50182 + A display-isolated URL can only be displayed (e.g., put in an iframe, + hyperlinked to) by documents from that scheme. In a sense, this is a + generalization of some of the protections we give file URLs, but + instead of lumping them all together into one "local" bucket, this + patch creates a separate bucket for each scheme. + For a while, I tried using a separate bucket for each origin. That + would have played nicely with what Blob URLs are trying to do, but some + "chrome" URL pages rely on being able to display other chrome URL + pages, even in different origins. For example, the New Tab Page shows + thumbnails from the "thumbnail" host. + This patch also removes a bunch of unused code. I've also propagated + the "deprecated" status of deprecatedCanDisplay to + deprecatedShouldTreatURLAsLocal because that method has no other + callers and is really asking for uppercase/lowercase bugs. I dream of + someday removing these functions. + 2010-11-29 Adam Barth <abarth@webkit.org (:abarth) (r)> + Reviewed by Darin Adler. + Introduce the notion of a "display-isolated" URL scheme for use by Chrome-internal URLs + https://bugs.webkit.org/show_bug.cgi?id=50182 + This patch adds a Chromium API for registering schemes as + display-isolated. In a subsequent patch, I'll change the "chrome" + scheme in Chrome to be display isolated instead of local. That will + prevent file URLs from linking to chrome URLs. + + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::localSchemes): + +2010-11-29 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Simon Fraser. + + Provide more fine grained control to ports over when to turn on accelerated + compositing. + https://bugs.webkit.org/show_bug.cgi?id=49998 + + As part of this change, the old hasAcceleratedCompositing method on the ChromeClient + has now been replaced by allowedCompositingTriggers which returns a bitfield of + all the features which can trigger the compositor. + + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::allowedCompositingTriggers): + * WebCoreSupport/ChromeClientQt.h: + +2010-11-30 Thiago Macieira <thiago.macieira@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] QWebFrame::load(QNetworkRequest) should respect the CustomVerbAttribute + + For CustomOperation requests, pass the CustomVerbAttribute on to + the WebCore::ResourceRequest. + + * Api/qwebframe.cpp: + (QWebFrame::load): + +2010-11-25 Norbert Leser <norbert.leser@nokia.com> + + Reviewed by Laszlo Gombos. + + Updated Symbian DEF file for ARM target due to API changes + via committs r72600-72603 (see bug# 46810) + + * symbian/eabi/QtWebKitu.def: + +2010-11-25 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Andreas Kling and Simon Hausmann. + + [Qt] Calculate the -webkit-pixel-radio using the device DPI. + http://webkit.org/b/50059 + + Also, update the documentation on what a DIP is and how to override + the device DPI in the case the system reports the wrong one (which + unfortunately is common on X11). + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPage::viewportAttributesForSize): + * Api/qwebpage_p.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::scaleFactor): + +2010-11-24 Kristian Amlie <kristian.amlie@nokia.com> + + Reviewed by Andreas Kling. + + Fixed handling of QInputMethodEvents with nonzero replacementLength. + + These types of events replace text that is already in the widget, but + WebKit did not check for replacementLength at all. + + https://bugs.webkit.org/show_bug.cgi?id=49787 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-11-24 Andras Becsi <abecsi@inf.u-szeged.hu> + + Reviewed by Kenneth Rohde Christiansen. + + Make WebKit2 compile with !ENABLE(INSPECTOR). + https://bugs.webkit.org/show_bug.cgi?id=49973 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled): + +2010-11-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r72650. + http://trac.webkit.org/changeset/72650 + https://bugs.webkit.org/show_bug.cgi?id=50010 + + breaks focus in scenes focus item other than graphicswebiview + (Requested by tronical_ on #webkit). + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebView::itemChange): + * Api/qgraphicswebview.h: + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + +2010-11-24 Jan Erik Hanssen <jhanssen@sencha.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Html autofocus not working with QGraphicsWebView + https://bugs.webkit.org/show_bug.cgi?id=43169 + + QGraphicsScene does not propagate Qt::ActivateWindowFocusReason focus + events when there are no active items. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebView::eventFilter): + (QGraphicsWebView::itemChange): + * Api/qgraphicswebview.h: + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (FocusPage::FocusPage): + (FocusPage::event): + (FocusPage::gotFocus): + (tst_QGraphicsWebView::receivesFocusInOnShow): + +2010-11-23 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Andreas Kling. + + Adapt to setShouldDelegateScrolling not being a real setting anymore. + We now similarily to setUseFixedLayout and setPaintEntireContents + set it on the FrameView wen transitioning to a new page. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2010-11-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix compilation with !ENABLE(INSPECTOR) + https://bugs.webkit.org/show_bug.cgi?id=49942 + + Add ENABLE(INSPECTOR) to the Qt specific files following r71981. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::inspectorDestroyed): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorClientQt::sendMessageToFrontend): + * WebCoreSupport/InspectorServerQt.cpp: + (WebCore::InspectorServerRequestHandlerQt::webSocketReadyRead): + +2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Restore binary compatibility with the QtWebKit 2.1 branch + + Re-order the enums by adding new enum entries to the end. + + * Api/qwebsettings.h: + +2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Review the setUserPermission & friends API + https://bugs.webkit.org/show_bug.cgi?id=46810 + + Renamed requestPermissionFromUser to featurePermissionRequested + and cancelRequestsForPermission to featurePermissionRequestCanceled. + + * Api/qwebpage.h: + * WebCoreSupport/GeolocationPermissionClientQt.cpp: + (WebCore::GeolocationPermissionClientQt::requestGeolocationPermissionForFrame): + (WebCore::GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame): + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::requestPermission): + (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission): + +2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Review the setUserPermission & friends API + https://bugs.webkit.org/show_bug.cgi?id=46810 + + Rename setUserPermission to setFeaturePermission + + * Api/qwebpage.cpp: + (QWebPage::setFeaturePermission): + * Api/qwebpage.h: + * tests/qwebpage/tst_qwebpage.cpp: + (JSTestPage::requestPermission): + +2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Review the setUserPermission & friends API + https://bugs.webkit.org/show_bug.cgi?id=46810 + + Rename PermissionDomain to Feature, NotificationsPermissionDomain to Notifications + and GeolocationPermissionDomain to Geolocation. + + * Api/qwebpage.cpp: + (QWebPage::setUserPermission): + * Api/qwebpage.h: + * WebCoreSupport/GeolocationPermissionClientQt.cpp: + (WebCore::GeolocationPermissionClientQt::requestGeolocationPermissionForFrame): + (WebCore::GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame): + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::requestPermission): + (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission): + * tests/qwebpage/tst_qwebpage.cpp: + (JSTestPage::requestPermission): + (tst_QWebPage::geolocationRequestJS): + +2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Review the setUserPermission & friends API + https://bugs.webkit.org/show_bug.cgi?id=46810 + + Add a ByUser suffix to PermissionGranted/Denied. In the future + we can add PermissionGrantedByDefault. + + * Api/qwebpage.cpp: + (QWebPage::setUserPermission): + * Api/qwebpage.h: + * WebCoreSupport/GeolocationPermissionClientQt.cpp: + (WebCore::GeolocationPermissionClientQt::setPermission): + * tests/qwebpage/tst_qwebpage.cpp: + (JSTestPage::requestPermission): + +2010-11-22 Jan Erik Hanssen <jhanssen@sencha.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebElement::appendInside() doesn't work on head elements + https://bugs.webkit.org/show_bug.cgi?id=49166 + + Make QWebElement::appendInside() call + Element::deprecatedCreateContextualFragment(), bypassing the check for + the HEAD tag in the HTMLElement implementation of this function. + + * Api/qwebelement.cpp: + (QWebElement::appendInside): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::addElementToHead): + +2010-11-20 Andreas Kling <kling@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Dragging a selection should use a rendering of the selection as "cursor" for the drag + https://bugs.webkit.org/show_bug.cgi?id=49870 + + * WebCoreSupport/DragClientQt.cpp: + (WebCore::DragClientQt::startDrag): Pass the DragImage to QDrag::setPixmap() + +2010-11-20 Sam Magnuson <smagnuso@gmail.com> + + Reviewed by Andreas Kling. + + [Qt] crash when attempting to add a JS object + https://bugs.webkit.org/show_bug.cgi?id=49287 + + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): + + Test: LayoutTests/fast/frames/sandboxed-iframe-plugins.html + +2010-11-20 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r72471. + http://trac.webkit.org/changeset/72471 + https://bugs.webkit.org/show_bug.cgi?id=49865 + + broke two IME tests on Qt (Requested by kling on #webkit). + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-11-19 Kristian Amlie <kristian.amlie@nokia.com> + + Reviewed by Andreas Kling. + + Fixed handling of QInputMethodEvents with nonzero replacementLength. + + These types of events replace text that is already in the widget, but + WebKit did not check for replacementLength at all. + + Also made sure that the preeditString is always respected, even if + there is committed text. This is how QLineEdit does it. + + https://bugs.webkit.org/show_bug.cgi?id=49787 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-11-19 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Transition and animation do not work with QWebView anymore + https://bugs.webkit.org/show_bug.cgi?id=49797 + + Accelerated compositing should not be enabled on QWebView without + texture mapper. + + * WebCoreSupport/PageClientQt.h: + (WebCore::PageClientQWidget::allowsAcceleratedCompositing): + +2010-11-19 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Memory leak in QWebInspector + https://bugs.webkit.org/show_bug.cgi?id=49765 + + Delete QWebInspectorPrivate in ~QWebInspector() + + * Api/qwebinspector.cpp: + (QWebInspector::~QWebInspector): + +2010-11-19 Sam Magnuson <smagnuso@gmail.com> + + Reviewed by Andreas Kling. + + [Qt] Compile with QT_NO_UNDOCOMMAND + https://bugs.webkit.org/show_bug.cgi?id=49752 + + * WebCoreSupport/EditCommandQt.cpp: + (EditCommandQt::EditCommandQt): + * WebCoreSupport/EditCommandQt.h: + +2010-11-19 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Andreas Kling. + + https://bugs.webkit.org/show_bug.cgi?id=49200 + [Qt] bugs in Composition mode for QWebPage::inputMethodEvent & inputMethodQuery() + + Make QWebPage work as following when editor is in composition mode: + 1. anchor position and cursor position are the same and always >= 0 + 2. current selection is always null + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-11-18 Gavin Barraclough <barraclough@apple.com> + + Build fix - update error messages folllowing r72360. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-11-12 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Andreas Kling. + + [Qt] Static platform plugin support + https://bugs.webkit.org/show_bug.cgi?id=49470 + + Adding support for statically linked platform plugins. + + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::loadStaticallyLinkedPlugin): + (WebCore::QtPlatformPlugin::plugin): + * WebCoreSupport/QtPlatformPlugin.h: + +2010-11-17 Andreas Kling <kling@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + Reuse the size of the actualVisibleContentRect when loading a new page + or navigating session history. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2010-11-17 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Darin Adler. + + Converge means of querying a parent node into one way, which is Node::parentNode. + https://bugs.webkit.org/show_bug.cgi?id=49686 + + * Api/qwebelement.cpp: + (QWebElement::prependOutside): Changed to use parentNode. + (QWebElement::appendOutside): Ditto. + (QWebElement::encloseContentsWith): Ditto. + (QWebElement::encloseWith): Ditto. + +2010-11-16 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Remove synchronous QWebPage::checkPermissions signal + https://bugs.webkit.org/show_bug.cgi?id=46810 + + As decided in the API review, we remove this signal and replace its only use currently + with cached credentials. + + * Api/qwebpage.cpp: + (QWebPage::setUserPermission): Pass the WebCore frame instead of the QWebFrame. + * Api/qwebpage.h: + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::checkPermission): Replaced explicit + signal emission with hash lookup of previously granted permission (or not). + (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission): Remove + any previously cached/granted permission for the given script execution context. + (WebCore::NotificationPresenterClientQt::allowNotificationForFrame): Do not + only serve pending permission requests but before calling the JS callbacks, remember + the permission for subsequent synchronous checkPermission() calls. + * WebCoreSupport/NotificationPresenterClientQt.h: Add cache for permissions. + +2010-11-15 Gavin Barraclough <barraclough@apple.com> + + Reviewed by NOBODY build fix. + + Fix test broken by earlier patch. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-11-15 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] ZoomTextOnly doesn't work + https://bugs.webkit.org/show_bug.cgi?id=49568 + + Check QWebSettings::ZoomTextOnly attribute before applying zoom + + * Api/qwebframe.cpp: + (QWebFrame::textSizeMultiplier): + (QWebFrame::setZoomFactor): + (QWebFrame::zoomFactor): + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + +2010-11-14 Andreas Kling <kling@webkit.org> + + Reviewed by Antonio Gomes. + + REGRESSION(r71895): API test javaScriptWindowObjectCleared fails + https://bugs.webkit.org/show_bug.cgi?id=49466 + + As of r71895 empty inline scripts are no longer executed and so + the javaScriptWindowObjectCleared() signal is no longer triggered + by <script></script>. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-11-12 Jacob Dinu <dinu.jacob@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Update .def file for Symbian + https://bugs.webkit.org/show_bug.cgi?id=49456 + + Added missing symbols from revisions r69825, r70470, r71806 + + * symbian/eabi/QtWebKitu.def: + +2010-11-12 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Need to implement WebKit::pluginWillHandleLoadError for WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=48764 + + Add the missing error. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::pluginWillHandleLoadError): + +2010-11-11 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] QWebScriptWorld::world() may crash + https://bugs.webkit.org/show_bug.cgi?id=49342 + + * Api/qwebscriptworld.cpp: + (QWebScriptWorld::world): + +2010-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] Add an API for overriding the actual visible content rect in WebCore + https://bugs.webkit.org/show_bug.cgi?id=49373 + + * Api/qwebpage.cpp: + (QWebPage::setActualVisibleContentRect): + * Api/qwebpage.h: + +2010-11-11 Andreas Kling <kling@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + FrameView: Don't clip to visibleContentRect in paintEntireContents mode + https://bugs.webkit.org/show_bug.cgi?id=49375 + + Use paintEntireContents in combination with tiling, allowing to + actually set visibleContentRect to something different from + the actual contents size. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2010-11-10 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r71733. + http://trac.webkit.org/changeset/71733 + https://bugs.webkit.org/show_bug.cgi?id=49319 + + made qt bot crashy and sad (Requested by kling on #webkit). + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2010-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Andreas Kling. + + Use paintEntireContents in combination with tiling, allowing to + actually set visibleContentRect to something different from + the actual contents size. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2010-11-08 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] build error in WebKit/qt/Api/qwebpage.cpp in Qt 4.7.0 + https://bugs.webkit.org/show_bug.cgi?id=47427 + + Add a missing guard in order to be able to compile when + ENABLE(TOUCH_EVENTS) is not defined. + + * Api/qwebpage.cpp: + (QWebPagePrivate::touchEvent): + +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::focusedNodeChanged): Removed unneeded namespace prefix. + (WebCore::ChromeClientQt::focusedFrameChanged): + * WebCoreSupport/ChromeClientQt.h: + +2010-11-08 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Texmap] [Qt] Texture mapper initial implementation + https://bugs.webkit.org/show_bug.cgi?id=47070 + + Reorganized the textureMapper to be a member of QWebFramePrivate, to help with making + TextureMapper thread-safe. + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderCompositedLayers): + * Api/qwebframe_p.h: + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PlatformLayerProxyQt::setTextureMapper): + (WebCore::PlatformLayerProxyQt::textureMapper): + (WebCore::PlatformLayerProxyQWidget::PlatformLayerProxyQWidget): + (WebCore::PlatformLayerProxyQGraphicsObject::PlatformLayerProxyQGraphicsObject): + +2010-11-07 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename Cache to MemoryCache + https://bugs.webkit.org/show_bug.cgi?id=49159 + + * Api/qwebpage.cpp: + * Api/qwebsettings.cpp: + +2010-11-07 Chang Shu <chang.shu@nokia.com> + + Reviewed by Antonio Gomes. + + Add a helper function to avoid duplicated code. + https://bugs.webkit.org/show_bug.cgi?id=49085 + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Move resumeAnimations/suspendAnimations from Frame to AnimationController. + https://bugs.webkit.org/show_bug.cgi?id=49073 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::suspendAnimations): + (DumpRenderTreeSupportQt::resumeAnimations): + +2010-11-03 Antonio Gomes <tonikitoo@webkit.org>, Andre Pedralho <andre.pedralho@gmail.com> + + Reviewed by Kenneth Rohde Christiansen and Antti Koivisto. + + [Qt] Making effective use of nodesFromRect. + https://bugs.webkit.org/show_bug.cgi?id=44089 + + Patch adds a helper class (named TouchAdjuster) to improve tap actions + on mobile touch devices. TouchAdjuster makes use of the newly added rect + based hit test extension through the Document::nodesFromRect method. + Given a rectangle as input, nodesFromRect returns a z-index ordered list + of nodes whose boundaries intersect the rectangle. + + Basically the TouchAdjuster class intercepts the QGraphicsSceneMouseEvent + passed to both QWebPagePrivate::mouse{Press,Release}Event methods before + they are passed down to WebCore. The goal is to infer the target click position. + For that, a rectangle is built up using the event position as a center point and + expanding it based on the values and directions set in the Platform Plugin + QWebTouchModifier::hitTestPadding. + + TouchAdjuster iterates over the list of nodes returned by nodesFromRect and + picks the clickable one that has the largest intersection area with the hit + test rectangle. The target position is then the center point of this intersection + area. + + In case of no clickable node intersects the hit test area, the click position + is not altered. + + TouchAdjuster is *only* working for QGraphicsWebView based views. + + * Api/qwebpage.cpp: + (QWebPagePrivate::mousePressEvent): + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::adjustPointForClicking): + (QWebPagePrivate::TouchAdjuster::TouchAdjuster): + (QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch): + (isClickableElement): + (hasMouseListener): + (isValidFrameOwner): + (nodeToElement): + * Api/qwebpage_p.h: + +2010-10-20 Chang Shu <chang.shu@nokia.com>, Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Fraser. + + [Qt] Makes <input type=text> and <textarea> functional with + Spatial Navigation enabled. Before this patch, the focus cannot + move away from input box once it is in. This patch allows focus + move to neighbor nodes when the caret reaches the edge of the texts. + This patch does not support yet cases where the focused <input> + has a JS handler for the arrow keys. + https://bugs.webkit.org/show_bug.cgi?id=37153 + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-11-04 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by David Hyatt. + + Delegate scrolling via a separate method + https://bugs.webkit.org/show_bug.cgi?id=48988 + + Implement delegatedScrollRequested and make it emit the + scrollRequested signal for Qt. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::delegatedScrollRequested): + * WebCoreSupport/ChromeClientQt.h: + +2010-11-04 Robert Hogan <robert@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] Clarify expected return values of innerXml(), outerXml() + + If you put HTML in (e.g. using setHTML()) you will get HTML out, + even if you marked it up as XML. + + https://bugs.webkit.org/show_bug.cgi?id=44876 + + * Api/qwebelement.cpp: + +2010-11-03 Andre Pedralho <andre.pedralho@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + Using the Platform Plugin to define the default values for the padding of HitTestResult. + https://bugs.webkit.org/show_bug.cgi?id=48450 + + * Api/qwebkitplatformplugin.h: + (QWebTouchModifier::~QWebTouchModifier): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createTouchModifier): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + (WebPlugin::supportsExtension): + (WebPlugin::createExtension): + * examples/platformplugin/WebPlugin.h: + (TouchModifier::hitTestPaddingForTouch): + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebTouchModifier::~QWebTouchModifier): + +2010-11-03 Andreas Kling <kling@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QGWV: Keep the scrolling delegation intact when switching pages + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): Turn on/off + scrolling delegation depending on the resizeToContents mode. + (QGraphicsWebViewPrivate::detachCurrentPage): Turn off scrolling delegation. + (QGraphicsWebView::setResizesToContents): + +2010-11-03 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Andreas Kling. + + Make it possible to delegate scrolling to the UI + https://bugs.webkit.org/show_bug.cgi?id=48907 + + Enable scrolling delegation when setResizesToContents is active. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::setResizesToContents): + +2010-11-03 Daniel Bates <dbates@rim.com> + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Part 1 of 2. + + Substitute FrameTree::uniqueName() for FrameTree::name() in the Qt port. + + * Api/qwebframe.cpp: + (QWebFrame::frameName): + +2010-11-02 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Some refactor for texmap to enable WebKit2: remove globals, and allow TextureMapper to exist without a GraphicsContext. + This will allow rendering the TextureMapperNode tree without an active QPainter, into the current GL context. + Most of the changes simply move the globas in TextureMapperGL into members of that class. + + [Texmap] [Qt] Texture mapper initial implementation + https://bugs.webkit.org/show_bug.cgi?id=47070 + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderFromTiledBackingStore): + (QWebFramePrivate::renderCompositedLayers): + (QWebFramePrivate::renderRelativeCoords): + * Api/qwebframe_p.h: + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::showContextMenu): + +2010-10-31 Robert Hogan <robert@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Support nodesFromRect in DRT + + https://bugs.webkit.org/show_bug.cgi?id=48716 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::nodesFromRect): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-10-31 Andreas Kling <kling@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Short-circuit QWebPage::selectedText() if frame has no selection + https://bugs.webkit.org/show_bug.cgi?id=48736 + + Do an early return if the selection is empty. + + No new tests, this is covered by tst_QWebPage::findText(). + + * Api/qwebpage.cpp: + (QWebPage::selectedText): + +2010-10-30 Andreas Kling <kling@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] IM: Don't manipulate selection via RenderTextControl + https://bugs.webkit.org/show_bug.cgi?id=48700 + + Go directly through the Frame's SelectionController instead. + + No new tests, this is covered by tst_QWebPage::inputMethods. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + +2010-10-29 Daniel Bates <dbates@rim.com> + + No review, rolling out 70971. + http://trac.webkit.org/changeset/70971 + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Rolling out changeset 70971 <http://trac.webkit.org/changeset/70971> since + it caused layout test failures on all bots. In particular, the + child count in a generated frame name differs after this patch. We need + to look into this further. + + * Api/qwebframe.cpp: + (QWebFrame::frameName): + +2010-10-28 Antonio Gomes <agomes@rim.com> + + Reviewed by Ojan Vafai. + + Needs a "LinuxEditingBehavior", perhaps with a better name + https://bugs.webkit.org/show_bug.cgi?id=36627 + + Adding support to Qt's DRTSupport class to test the newly introduced Unix editing behavior. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setEditingBehavior): + +2010-10-29 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Modified Qt-port to use FrameTree::uniqueName(). + + * Api/qwebframe.cpp: + (QWebFrame::frameName): + +2010-10-29 Andreas Kling <kling@webkit.org> + + Reviewed by Ariya Hidayat. + + [Qt] QWebPage's InputMethod event handling calls ShortcutOverride handler too + https://bugs.webkit.org/show_bug.cgi?id=48692 + + * Api/qwebpage.cpp: + (QWebPage::event): Add missing break statement. + +2010-10-29 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + Remove RenderTextControl::setSelectionRange + https://bugs.webkit.org/show_bug.cgi?id=47870 + + Converted RenderTextControll::setSelectionRange to a global function. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): Calls setSelectionRange. + +2010-10-29 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring + https://bugs.webkit.org/show_bug.cgi?id=48574 + + * Api/qwebhistory.cpp: + (QWebHistory::clear): + * Api/qwebhistory_p.h: + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + Use BackForwardListImpl. + +2010-10-29 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48576 + Let WebKit2 client know when a frame is a frameset + + Added a blank implementation of the new FrameLoaderClient method. + + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidBecomeFrameset): + +2010-10-29 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Fix tst_QWebFrame on XVFB. + https://bugs.webkit.org/show_bug.cgi?id=48637 + + These tests relied on a window manager to activate the window. + + Fixes: + - tst_QWebFrame::popupFocus() + - tst_QwebFrame::inputFieldFocus() + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-10-28 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Ariya Hidayat. + + [Texmap] [Qt] Texture mapper initial implementation + https://bugs.webkit.org/show_bug.cgi?id=47070 + + Build fix, + + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PlatformLayerProxyQGraphicsObject::PlatformLayerProxyQGraphicsObject): + (WebCore::PageClientQGraphicsWidget::~PageClientQGraphicsWidget): + (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer): + * WebCoreSupport/PageClientQt.h: + +2010-10-28 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] QWebElement: Don't retrieve CSS rules through DOMWindow. + https://bugs.webkit.org/show_bug.cgi?id=48519 + + JavaScript is prevented from retrieving cross-domain CSS rules since r70335. + This patch allow QWebElement to retrive style without this limitation + by asking the Document directly instead of going through DOMWindow. + + Fixes: + - tst_QWebFrame::setHtmlWithResource() + - tst_QWebElement::style() + + * Api/qwebelement.cpp: + (QWebElement::styleProperty): + +2010-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Andreas Kling. + + Make Qt viewportAttributesForSize not assert on (0, 0) size + https://bugs.webkit.org/show_bug.cgi?id=48524 + + We now return an invalid (isValid() == false) ViewportAttributes + instance when the supplied size is (0, 0). + + * Api/qwebpage.cpp: + (QWebPage::viewportAttributesForSize): + +2010-10-27 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix tst_QWebFrame::popupFocus(). + https://bugs.webkit.org/show_bug.cgi?id=48432 + + - Call setFocus() before show() to work around a but in Qt. + - Remove the check on combo at the end since hidePopup() leads + indirectly to its destruction and segfault. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-10-26 Jenn Braithwaite <jennb@chromium.org> + + Reviewed by Dmitry Titov. + + Resource tracking failure when trying to move a frame between documents + https://bugs.webkit.org/show_bug.cgi?id=44713 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transferLoadingResourceFromPage): + Emtpy method. + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-10-26 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Skipping popup focus test for symbian + https://bugs.webkit.org/show_bug.cgi?id=48324 + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-10-26 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Unit tests: setHtml("data:text/html,...") -> load(QUrl("data:text/html,...")) + https://bugs.webkit.org/show_bug.cgi?id=48319 + + These tests were failing since the new HTML parser. + This patch removes the content type from the error page as well. + + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::crashOnViewlessWebPages): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::frame): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::loadFinished): + (ErrorPage::extension): + (tst_QWebPage::errorPageExtension): + (tst_QWebPage::errorPageExtensionInIFrames): + (tst_QWebPage::errorPageExtensionInFrameset): + +2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Texmap] [Qt] Texture mapper initial implementation + https://bugs.webkit.org/show_bug.cgi?id=47070 + + Glue layer (WebCoreSupport) changes to allow connecting TextureMapper to a Qt PageClient, i.e. + a QWebView or a QGraphicsWebView. This enables the new type, TextureMapperPlatformLayer, to be recognized both by + the compositor and by the page client. + Note that this is temporarily an opt-in, under USE(TEXTURE_MAPPER) + + * Api/qwebframe.h: + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + * Api/qwebpage.cpp: + (QWebPage::setView): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::attachRootGraphicsLayer): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PlatformLayerProxyQt::PlatformLayerProxyQt): + (WebCore::PlatformLayerProxyQt::~PlatformLayerProxyQt): + (WebCore::PlatformLayerProxyQt::setSizeChanged): + (WebCore::PlatformLayerProxyQWidget::PlatformLayerProxyQWidget): + (WebCore::PlatformLayerProxyQWidget::eventFilter): + (WebCore::PlatformLayerProxyQWidget::setNeedsDisplay): + (WebCore::PlatformLayerProxyQWidget::setNeedsDisplayInRect): + (WebCore::PlatformLayerProxyQGraphicsObject::PlatformLayerProxyQGraphicsWidget): + (WebCore::PlatformLayerProxyQGraphicsObject::setNeedsDisplay): + (WebCore::PlatformLayerProxyQGraphicsObject::setNeedsDisplayInRect): + (WebCore::PageClientQWidget::setRootGraphicsLayer): + (WebCore::PageClientQWidget::markForSync): + (WebCore::PageClientQWidget::syncLayers): + (WebCore::PageClientQGraphicsWidget::updateCompositingScrollPosition): + (WebCore::PageClientQGraphicsWidget::createOrDeleteOverlay): + (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer): + * WebCoreSupport/PageClientQt.h: + (WebCore::PageClientQWidget::PageClientQWidget): + (WebCore::PageClientQWidget::allowsAcceleratedCompositing): + (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget): + +2010-10-25 Johnny Ding <jnd@chromium.org> + + Reviewed by Tony Chang. + + Dump the gesture status of frame in frame load callbacks in DumpRenderTree + by adding a new method dumpUserGestureInFrameLoadCallbacks. + Now only dump the gesture status in "DidStartProvisionalLoad" callback. + https://bugs.webkit.org/show_bug.cgi?id=47849 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (drtPrintFrameUserGestureStatus): + (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents): + (WebCore::FrameLoaderClientQt::dispatchDidPushStateWithinPage): + (WebCore::FrameLoaderClientQt::dispatchDidReplaceStateWithinPage): + (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage): + (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-10-22 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + WebKit2 needs to pass the current event modifier flags when requesting a new window + https://bugs.webkit.org/show_bug.cgi?id=48140 + + * Api/qwebpage.cpp: + (openNewWindow): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createWindow): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchCreatePage): + * WebCoreSupport/FrameLoaderClientQt.h: + Add NavigationAction parameter. + +2010-10-22 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] InspectorClientQt crashes when deleting a qwebpage which has an inspector + https://bugs.webkit.org/show_bug.cgi?id=48079 + + * Api/qwebpage.cpp: + (QWebPagePrivate::~QWebPagePrivate): + (QWebPage::~QWebPage): + +2010-10-22 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] All widgets are rendered incorrectly when rendered through a cache + https://bugs.webkit.org/show_bug.cgi?id=47767 + + Add a new test for rendering with tiling. + + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::widgetsRenderingThroughCache): + +2010-10-21 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Sending a QInputMethodEvent::Selection event forces the + Editor to go into Composition mode + + Improve QWebPage handling of input method events: + - Selections don't trigger entering composition mode. + - Handle multiple selections + + Also remove redundant cancellation of composition in tst_qwebpage. + There is no composition in progress at that point. + + Finally, move infiniteLoopJS() to the end of the tst_qwebpage unit + tests - so you don't have to wait for it to complete when running + other tests. + + https://bugs.webkit.org/show_bug.cgi?id=39625 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-10-20 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Antonio Gomes. + + [Qt] Wrong null check in PopupMenuQt + https://bugs.webkit.org/show_bug.cgi?id=47945 + + Wrong null check in PopupMenuQt. + + * WebCoreSupport/PopupMenuQt.cpp: + (WebCore::PopupMenuQt::hide): + +2010-10-18 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Export QWebPage::ViewportAttributes class. + https://bugs.webkit.org/show_bug.cgi?id=47845 + + * Api/qwebpage.h: + * symbian/eabi/QtWebKitu.def: + +2010-10-18 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Simon Fraser. + + Web Inspector: [crash] when Inspector Open in CSSStyleSelector::loadPendingImages(). + https://bugs.webkit.org/show_bug.cgi?id=46224 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::sendMessageToFrontend): + +2010-10-18 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] AC rendering bugs + + This fixes a regression that was introduced by making scrolling in accelerated compositing automatic, + which made our explicit function to scroll the compositing layers superfluous, making the scrolling behavior + when graphics layers are present incorrect. The fix simply removes those redundant functions. + + https://bugs.webkit.org/show_bug.cgi?id=47571 + + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::scroll): + (WebCore::PageClientQGraphicsWidget::update): + (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer): + * WebCoreSupport/PageClientQt.h: + +2010-10-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by nobody, build fix. + + [Qt] Fix the build with MSVC. + + Splitting the condition in two to prevent qmake parentheses issues. + + * Api/DerivedSources.pro: + +2010-10-18 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Antonio Gomes. + + [QT] Unable to load pages on QtTestBrowser after canceling a page load. + https://bugs.webkit.org/show_bug.cgi?id=43827 + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): + +2010-10-15 Qi Zhang <qi.2.zhang@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] window.close() doesn't work in qt + https://bugs.webkit.org/show_bug.cgi?id=46186 + + Introduce new attribute in QWebSettings to trigger "setAllowScriptsToCloseWindow" + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-10-15 Andreas Kling <kling@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Unbreak scrolling the ContentsLayer with QWebView + + r69777 broke scrolling the contents layer in QWebView by not restoring + the painter clip after painting each part of the dirty region. + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderRelativeCoords): + +2010-09-27 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Andreas Kling. + + [Qt] Added functions for obtaining and checking the supported content types. + http://webkit.org/b/37880 + + * Api/qwebpage.cpp: + (extractContentTypeFromHash): + (extractContentTypeFromPluginVector): + (QWebPage::supportedContentTypes): + (QWebPage::supportsContentType): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::supportedContentType): + +2010-10-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r69795. + http://trac.webkit.org/changeset/69795 + https://bugs.webkit.org/show_bug.cgi?id=47687 + + 'See discussion at webkit.org/b/47609' (Requested by mwenge on + #webkit). + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::canHandleRequest): + (WebCore::FrameLoaderClientQt::dispatchUnableToImplementPolicy): + +2010-10-14 Robert Hogan <robert@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Fix http/tests/misc/redirect-to-external-url.html + + Support the test in FrameLoaderClientQt and unskip. + + https://bugs.webkit.org/show_bug.cgi?id=47609 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::canHandleRequest): + (WebCore::FrameLoaderClientQt::dispatchUnableToImplementPolicy): + +2010-10-14 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Texmap] [Qt] Texture mapper initial implementation + https://bugs.webkit.org/show_bug.cgi?id=47070 + + Allow rendering of accelerated-compositing with TextureMapper, inside a QWebFrame. The frame will render the regular content, + either normally or through tiled backingstore, then let the TextureMapper layer render itself to the active context, and + then render the scrollbar and pan icon. This is different from the current implementation, which uses additional QGraphicsItems for AC + and the scrollbar overlay. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::paint): + * Api/qwebframe.cpp: + (QWebFramePrivate::renderFromTiledBackingStore): + (QWebFramePrivate::renderRelativeCoords): + +2010-10-13 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=43987 + Switch XMLHttpRequest, FileReader, and FileReaderSync to use a Stringbuilder + to construct their internal result string. Remove ScriptString (this is now + redundant). + + * WebCoreSupport/FrameLoaderClientQt.cpp: + +2010-10-13 Dinu Jacob <dinu.jacob@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Update .def file for Symbian + https://bugs.webkit.org/show_bug.cgi?id=47540 + + Updated symbols for Symbian - added viewportAttributesForSize and + made viewportConfigurationForSize absent based on the API change in + 47325 + + * symbian/eabi/QtWebKitu.def: + +2010-10-12 David Leong <david.leong@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Enable Netscape plugin metadata caching on Linux + https://bugs.webkit.org/show_bug.cgi?id=46287 + + QWebSettings::enablePersistentStorage will now store the netscape + plugin cache to QDesktopServices::CacheLocation. + + * Api/qwebsettings.cpp: + (QWebSettings::enablePersistentStorage): + +2010-10-12 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] Editing commands should not be executed on non-editable content. + https://bugs.webkit.org/show_bug.cgi?id=47426 + + Remove calls to editor()->command() when we are not in editable content. + There is no value in doing that, and in some cases, it prevents scrolling. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-10-08 Hui Huang <hui.2.huang@nokia.com> + + Reviewed by Simon Hausmann. + + ifdef out code that rewrites Flash Plug-in wmode for Symbian build + https://bugs.webkit.org/show_bug.cgi?id=43484 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-10-07 Andreas Kling <kling@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] API: ViewportConfiguration => ViewportArguments + https://bugs.webkit.org/show_bug.cgi?id=47325 + + * Api/qwebpage.cpp: + (QWebPage::ViewportAttributes::ViewportAttributes): + (QWebPage::ViewportAttributes::~ViewportAttributes): + (QWebPage::ViewportAttributes::operator=): + (QWebPage::viewportAttributesForSize): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + (QtViewportAttributesPrivate::QtViewportAttributesPrivate): + +2010-10-07 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Fixing viewport meta tag user-scalable handling + https://bugs.webkit.org/show_bug.cgi?id=47330 + + user-scalable attribute was not considered in viewport meta tag handling. + + * Api/qwebpage.cpp: + (QWebPage::viewportConfigurationForSize): + +2010-10-05 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] Hook up accelerometer data via Qt DeviceMotion + https://bugs.webkit.org/show_bug.cgi?id=47105 + + Get accelerometer necessary data via Qt mobility library using a + provider class. Enable, also the RotationRate using the current device + orientation provider. + + * WebCoreSupport/DeviceMotionClientQt.cpp: + (WebCore::DeviceMotionClientQt::DeviceMotionClientQt): + (WebCore::DeviceMotionClientQt::~DeviceMotionClientQt): + (WebCore::DeviceMotionClientQt::startUpdating): + (WebCore::DeviceMotionClientQt::stopUpdating): + (WebCore::DeviceMotionClientQt::currentDeviceMotion): + (WebCore::DeviceMotionClientQt::changeDeviceMotion): + * WebCoreSupport/DeviceMotionClientQt.h: + * WebCoreSupport/DeviceMotionProviderQt.cpp: Added. + (WebCore::DeviceMotionProviderQt::DeviceMotionProviderQt): + (WebCore::DeviceMotionProviderQt::~DeviceMotionProviderQt): + (WebCore::DeviceMotionProviderQt::start): + (WebCore::DeviceMotionProviderQt::stop): + (WebCore::DeviceMotionProviderQt::filter): + * WebCoreSupport/DeviceMotionProviderQt.h: Added. + (WebCore::DeviceMotionProviderQt::currentDeviceMotion): + +2010-10-07 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Some viewport meta tag api refactoring + https://bugs.webkit.org/show_bug.cgi?id=47334 + + WebCore::findConfigurationForViewportData renamed to computeViewportAttributes. + WebCore::ViewportAttributes::layoutViewport renamed to layoutSize. + + * Api/qwebpage.cpp: + (QWebPage::viewportConfigurationForSize): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::viewportAsText): + +2010-10-07 Keith Kyzivat <keith.kyzivat@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Update .def file for Symbian + https://bugs.webkit.org/show_bug.cgi?id=47336 + Fix and re-freeze symbols for symbian - viewportConfigurationForSize + API changed, allowGeolocationRequest removed from API, several + DumpRenderTree support calls added. + + * symbian/eabi/QtWebKitu.def: + +2010-10-06 Ragner Magalhaes <ragner.magalhaes@openbossa.org> + + Reviewed by Antonio Gomes. + + [Qt] Duplicated code in QWebPagePrivate + https://bugs.webkit.org/show_bug.cgi?id=47195 + + Remove duplicated code from QWebPagePrivate class for QGraphicsView and QWidget's mouse events. + + * Api/qwebpage.cpp: + (QWebPagePrivate::mouseMoveEvent): + (QWebPagePrivate::mousePressEvent): + (QWebPagePrivate::mouseDoubleClickEvent): + (QWebPagePrivate::mouseTripleClickEvent): + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::wheelEvent): + (QWebPagePrivate::dragEnterEvent): + (QWebPagePrivate::dragLeaveEvent): + (QWebPagePrivate::dragMoveEvent): + (QWebPagePrivate::dropEvent): + * Api/qwebpage_p.h: + +2010-10-06 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Renaming WebCore::ViewportConfiguration to WebCore::ViewportAttributes + https://bugs.webkit.org/show_bug.cgi?id=47268 + + Renaming WebCore::ViewportConfiguration to WebCore::ViewportAttributes + + * Api/qwebpage.cpp: + (QWebPage::viewportConfigurationForSize): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::viewportAsText): + +2010-10-05 Andrew Wilson <atwilson@chromium.org> + + Reviewed by Andreas Kling. + + Notification onclick() events don't act like user gestures + https://bugs.webkit.org/show_bug.cgi?id=47137 + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::notificationClicked): + Use UserGestureIndicator to make sure click events are treated like user gestures. + +2010-10-05 Robert Hogan <robert@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] Fix url conversion in QWebHistory + + Converting from KURL to WFT::String to QUrl does not + permit proper percent encoding later. + + https://bugs.webkit.org/show_bug.cgi?id=47048 + + * Api/qwebhistory.cpp: + (QWebHistoryItem::originalUrl): + (QWebHistoryItem::url): + +2010-10-05 Jakob Petsovits <jpetsovits@rim.com> + + Reviewed by Andreas Kling. + + [Qt] Make build work with QT_NO_CURSOR + https://bugs.webkit.org/show_bug.cgi?id=46097 + + Add a missing semicolon. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::setCursor): + +2010-10-05 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed build fix. + + [Symbian] Fix build issue due to gaps in ordinals in the def file + + Restore previously removed symbols and mark them absent instead. We must + not remove symbols from this file, because it breaks binary compatibility + (when re-assigning the ordinals of the following symbols) or it causes build + breakage when instead having a gap in the ordinal sequence. Instead removing + a symbol is done by marking it as absent. + + * symbian/eabi/QtWebKitu.def: + +2010-10-04 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Adler. + + Rename RedirectScheduler to NavigationScheduler + https://bugs.webkit.org/show_bug.cgi?id=47037 + + Update for name change. + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): + +2010-10-04 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Hook up DeviceOrientation data for Qt support + https://bugs.webkit.org/show_bug.cgi?id=47052 + + Get DeviceOrientation necessary data via Qt mobility library + using a provider class. + + * WebCoreSupport/DeviceOrientationClientQt.cpp: + (WebCore::DeviceOrientationClientQt::DeviceOrientationClientQt): + (WebCore::DeviceOrientationClientQt::~DeviceOrientationClientQt): + (WebCore::DeviceOrientationClientQt::startUpdating): + (WebCore::DeviceOrientationClientQt::stopUpdating): + (WebCore::DeviceOrientationClientQt::lastOrientation): + (WebCore::DeviceOrientationClientQt::changeDeviceOrientation): + * WebCoreSupport/DeviceOrientationClientQt.h: + * WebCoreSupport/DeviceOrientationProviderQt.cpp: Added. + (WebCore::DeviceOrientationProviderQt::DeviceOrientationProviderQt): + (WebCore::DeviceOrientationProviderQt::~DeviceOrientationProviderQt): + (WebCore::DeviceOrientationProviderQt::start): + (WebCore::DeviceOrientationProviderQt::stop): + (WebCore::DeviceOrientationProviderQt::filter): + * WebCoreSupport/DeviceOrientationProviderQt.h: Added. + (WebCore::DeviceOrientationProviderQt::isActive): + (WebCore::DeviceOrientationProviderQt::orientation): + (WebCore::DeviceOrientationProviderQt::hasAlpha): + +2010-09-28 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Viewport data change notifications + https://bugs.webkit.org/show_bug.cgi?id=46755 + + Regarding viewport meta tags, what matters for browser developers is to know when the viewport data has + changed and its current value. Viewport data belongs to the document, but it is useful to keep the current + viewport data in Page as a reference, to be able to send notifications only when the current viewport + has changed. + + * Api/qwebframe.cpp: + * Api/qwebframe_p.h: + * Api/qwebpage.cpp: + (QWebPagePrivate::viewportArguments): + (QWebPage::viewportConfigurationForSize): + * Api/qwebpage_p.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::viewportDataChanged): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::viewportAsText): + +2010-10-04 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + [Qt] Fix platform plugin support after r68128 + + Replaced the qobject_cast from the QObject derived extension to a + static_cast. qobject_cast works by comparing pointers to meta-object + instances, of which there are two each: one compiled into WebKit and + one compiled into the plugin. + + The platform plugin ensures the validity of the interface contract + through its version and the initial safe qobject_cast from QObject + to QWebKitPlatformPlugin. After that it is safe to use static_cast, + and with the recent changes even required. + + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createSelectInputMethod): + (WebCore::QtPlatformPlugin::createNotificationPresenter): + (WebCore::QtPlatformPlugin::createHapticFeedbackPlayer): + +2010-10-02 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Provide Qt support for DeviceMotion/Orientation clients + https://bugs.webkit.org/show_bug.cgi?id=47051 + + Dummy implementation of DeviceMotion/Orientation client classes + to make possible to hook up motion/orientation data + in further implementations. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * WebCoreSupport/DeviceMotionClientQt.cpp: Added. + (WebCore::DeviceMotionClientQt::DeviceMotionClientQt): + (WebCore::DeviceMotionClientQt::setController): + (WebCore::DeviceMotionClientQt::startUpdating): + (WebCore::DeviceMotionClientQt::stopUpdating): + (WebCore::DeviceMotionClientQt::currentDeviceMotion): + (WebCore::DeviceMotionClientQt::deviceMotionControllerDestroyed): + * WebCoreSupport/DeviceMotionClientQt.h: Added. + (WebCore::DeviceMotionClientQt::~DeviceMotionClientQt): + * WebCoreSupport/DeviceOrientationClientQt.cpp: Added. + (WebCore::DeviceOrientationClientQt::DeviceOrientationClientQt): + (WebCore::DeviceOrientationClientQt::setController): + (WebCore::DeviceOrientationClientQt::startUpdating): + (WebCore::DeviceOrientationClientQt::stopUpdating): + (WebCore::DeviceOrientationClientQt::lastOrientation): + (WebCore::DeviceOrientationClientQt::deviceOrientationControllerDestroyed): + * WebCoreSupport/DeviceOrientationClientQt.h: Added. + (WebCore::DeviceOrientationClientQt::~DeviceOrientationClientQt): + +2010-09-30 Robert Hogan <robert@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] Support for PlainTextController + + Unskip editing/text-iterator/basic-iteration.html + + https://bugs.webkit.org/show_bug.cgi?id=38805 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::plainText): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-09-30 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] V8 port: Unbreak build + + Add missing <wtf/text/CString.h> include. + + * WebCoreSupport/InspectorServerQt.cpp: + +2010-09-30 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Crash if an scene with accelerated compositing layout during the paint event + https://bugs.webkit.org/show_bug.cgi?id=46812 + + Delay the deletion of the overlay after the current event is processed. + + Removing the overlay can sometimes be done inside the rendering code of + the overlay itself. When the rendering code is using the reference after + the deletion of the overlay, WebKit crashes. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::overlay): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::~PageClientQGraphicsWidget): + (WebCore::PageClientQGraphicsWidget::createOrDeleteOverlay): + * WebCoreSupport/PageClientQt.h: + (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget): + +2010-09-30 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Fix tst_QWebPage::geolocationRequestJS() + https://bugs.webkit.org/show_bug.cgi?id=46814 + + Disable the test. This test cannot pass with a + standard build of WebKit, it is disabled until the API is finilized. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::geolocationRequestJS): + +2010-09-29 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Ariya Hidayat. + + [Qt] Don't keep local reference to QGraphicsItemOverlay in QGWVPrivate + https://bugs.webkit.org/show_bug.cgi?id=46812 + + Get the QGraphicsItemOverlay* via the QWebPageClient (d->page->d->client) + instead of keeping a local pointer to it. + + This is cleanup for a follow-up patch. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::overlay): + (QGraphicsWebView::paint): + (QGraphicsWebView::setPage): + (QGraphicsWebView::updateGeometry): + (QGraphicsWebView::setGeometry): + +2010-09-28 Jenn Braithwaite <jennb@chromium.org> + + Reviewed by Dmitry Titov. + + Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument. + https://bugs.webkit.org/show_bug.cgi?id=46663 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::didTransferChildFrameToNewDocument): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-09-28 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Clean up QWebPage::ViewportConfiguration API + https://bugs.webkit.org/show_bug.cgi?id=46730 + + - Pass QSize parameter as const-reference + - Style fixes + + * Api/qwebpage.cpp: + (QWebPage::viewportConfigurationForSize): + * Api/qwebpage.h: + +2010-09-28 Andras Becsi <abecsi@webkit.org> + + Reviewed by Csaba Osztrogonác. + + Undefined reference errors when linking due to gperf and inlining. + webkit.org/b/29244 + + EFL CMake changes by Leandro Pereira <leandro@profusion.mobi> + + Refactor gperf code generation and usage to fix the debug build with gcc>4.4. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore + to access the functionality provided. This resulted in debug build failure with newer gcc versions + because of a behaviour change of gcc, which disables C style inlining in debug mode. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled + in their own compilation unit. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need + for multiple inclusions of generated C files to access these functions. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-09-28 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Remove support for Qt 4.5 + https://bugs.webkit.org/show_bug.cgi?id=46718 + + Remove the code for versions of Qt prior to 4.6. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebView::sceneEvent): + (QGraphicsWebViewPrivate::detachCurrentPage): + * Api/qwebframe.cpp: + (QWebFrame::load): + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::handleSoftwareInputPanel): + (QWebPagePrivate::inputMethodEvent): + (QWebPagePrivate::touchEvent): + (QWebPage::inputMethodQuery): + (QWebPage::view): + (QWebPage::event): + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebView::QWebView): + (QWebViewPrivate::detachCurrentPage): + (QWebView::event): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQWidget::setInputMethodHints): + (WebCore::PageClientQGraphicsWidget::setInputMethodEnabled): + (WebCore::PageClientQGraphicsWidget::inputMethodEnabled): + (WebCore::PageClientQGraphicsWidget::setInputMethodHints): + * WebCoreSupport/PageClientQt.h: + (WebCore::QGraphicsItemOverlay::page): + * tests/qwebframe/tst_qwebframe.cpp: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods_data): + (inputMethodHints): + (inputMethodEnabled): + (tst_QWebPage::inputMethods): + (tst_QWebPage::originatingObjectInNetworkRequests): + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::reusePage): + +2010-09-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + Clean up QWebPage initialization + + * Api/qwebpage.cpp: + * Api/qwebpage_p.h: + +2010-09-28 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] tst_QWebPage::testStopScheduledPageRefresh() fails on MeeGo handset + https://bugs.webkit.org/show_bug.cgi?id=46706 + + The test require the network to succeed or fail in order to work. + On MeeGo, the network can simply timeout the because of the netword access + management. This patch makes the test use local URLs to avoid the + problem. + + * tests/qwebpage/tst_qwebpage.cpp: + (TestNetworkManager::TestNetworkManager): + +2010-09-27 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Antonio Gomes. + + [Qt] Remove setDeviceSize methods + https://bugs.webkit.org/show_bug.cgi?id=46347 + + Remove our setDeviceHeight() API and obtain it automatically from the + system. Also for testing purposes, make it possible to override the + values via two newly introduced environment variables. + + * Api/qgraphicswebview.cpp: + * Api/qgraphicswebview.h: + * Api/qwebpage.cpp: + (getintenv): + (queryDeviceSizeForScreenContainingWidget): + (QWebPage::viewportConfigurationForSize): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::windowRect): + * symbian/eabi/QtWebKitu.def: + +2010-09-27 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Antonio Gomes. + + Enable local rendering of NPAPI plugins on Maemo6. + + https://bugs.webkit.org/show_bug.cgi?id=46618 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-09-27 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] tst_QWebFrame::popupFocus() randomly fail on MeeGo handset because the focus is not set on the window + https://bugs.webkit.org/show_bug.cgi?id=46617 + + This patch avoid the race condition by waiting for the window + to be mapped on screen before attempting any actions. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-09-24 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Keep viewport information in Document + https://bugs.webkit.org/show_bug.cgi?id=46385 + + The viewport meta data (layout viewport, scale) needs to be set again when bringing + back a page from the page cache. As the viewport metadata is only retrieved while parsing + the document, we need to store it in the Document class. + + * Api/qwebframe.cpp: + (QWebFramePrivate::viewportArguments): + * Api/qwebframe_p.h: + * Api/qwebpage.cpp: + (QWebPage::viewportConfigurationForSize): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::didReceiveViewportArguments): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::viewportAsText): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad): + +2010-09-23 Ademar de Souza Reis Jr <ademar.reis@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Fix QWebHapticFeedbackPlayer exposure via QWebKitPlatformPlugin + + [Qt] QWebHapticFeedbackPlayer needs correct exposure through QWebKitPlatformPlugin + https://bugs.webkit.org/show_bug.cgi?id=46402 + + QWebHapticFeedbackPlayer is exported through + QWebKitPlatformPlugin::createExtension(), but + createHapticFeedbackPlayer() and the correct + inheritage are missing. + + * Api/qwebkitplatformplugin.h: + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createHapticFeedbackPlayer): + * WebCoreSupport/QtPlatformPlugin.h: + +2010-09-23 Nate Chapin <japhet@chromium.org> + + Reviewed by Darin Fisher. + + Add hyperlink auditing settings (i.e., <a ping>). + https://bugs.webkit.org/show_bug.cgi?id=30458 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2010-09-23 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Refactor QtWebKitPlatformPlugin interface + + Make it easier to keep source-compability for the + QtWebKitPlatformPlugin interface, and run qmake + on the example (but not build) for convenience. + + https://bugs.webkit.org/show_bug.cgi?id=46345 + + * Api/qwebkitplatformplugin.h: + * WebCoreSupport/QtPlatformPlugin.cpp: + * examples/platformplugin/README: + * examples/platformplugin/WebPlugin.cpp: + * examples/platformplugin/WebPlugin.h: + * examples/platformplugin/qwebkitplatformplugin.h: + +2010-09-22 Andras Becsi <abecsi@webkit.org> + + Speculative build fix for the Qt Windows bots. + + * Api/DerivedSources.pro: + +2010-09-22 Jamey Hicks <jamey.hicks@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Web Inspector: Remote Web Inspector support for QtWebKit + https://bugs.webkit.org/show_bug.cgi?id=43988 + + Runs a web debug server on port specified by QtTestBrowser + argument -remote-inspector-port. Property + _q_webInspectorServerPort of the QWebPage instance will be set + according to the argument. All pages with that property set will + be remotely inspectable. + + URL for remote inspection of first QWebPage is + http://localhost:9222/webkit/inspector/inspector.html?page=1 + where 1 is the number of the QWebPage instance. + + The base URL yields an index page with links to the individual inspectors: + http://localhost:9222/ + + * Api/qwebinspector.cpp: + (QWebInspectorPrivate::attachAndReplaceRemoteFrontend): + (QWebInspectorPrivate::detachRemoteFrontend): + * Api/qwebinspector_p.h: + (QWebInspectorPrivate::QWebInspectorPrivate): + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + (QWebPagePrivate::inspectorServerPort): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::InspectorClientQt): + (WebCore::InspectorClientQt::inspectorDestroyed): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorClientQt::attachAndReplaceRemoteFrontend): + (WebCore::InspectorClientQt::detachRemoteFrontend): + (WebCore::InspectorClientQt::sendMessageToFrontend): + * WebCoreSupport/InspectorClientQt.h: + * WebCoreSupport/InspectorServerQt.cpp: Added. + (WebCore::generateWebSocketChallengeResponse): + (WebCore::parseWebSocketChallengeNumber): + (WebCore::InspectorServerQt::server): + (WebCore::InspectorServerQt::InspectorServerQt): + (WebCore::InspectorServerQt::~InspectorServerQt): + (WebCore::InspectorServerQt::listen): + (WebCore::InspectorServerQt::close): + (WebCore::InspectorServerQt::inspectorClientForPage): + (WebCore::InspectorServerQt::registerClient): + (WebCore::InspectorServerQt::unregisterClient): + (WebCore::InspectorServerQt::newConnection): + (WebCore::InspectorServerRequestHandlerQt::InspectorServerRequestHandlerQt): + (WebCore::InspectorServerRequestHandlerQt::~InspectorServerRequestHandlerQt): + (WebCore::InspectorServerRequestHandlerQt::tcpReadyRead): + (WebCore::InspectorServerRequestHandlerQt::tcpConnectionDisconnected): + (WebCore::InspectorServerRequestHandlerQt::webSocketSend): + (WebCore::InspectorServerRequestHandlerQt::webSocketReadyRead): + (WebCore::RemoteFrontendChannel::RemoteFrontendChannel): + (WebCore::RemoteFrontendChannel::sendMessageToFrontend): + * WebCoreSupport/InspectorServerQt.h: Added. + +2010-09-22 Balazs Kelemen <kb@inf.u-szeged.hu> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] PluginStrategy implementation is broken + https://bugs.webkit.org/show_bug.cgi?id=46078 + + Remove the QWebPage* member from WebPlatformStrategies. + Get the originator QWebPage of the getPluginInfo call via + the Page* argument. + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * WebCoreSupport/WebPlatformStrategies.cpp: + (WebPlatformStrategies::initialize): + (WebPlatformStrategies::WebPlatformStrategies): + (WebPlatformStrategies::getPluginInfo): + Use the ChromeClient for accessing the originator QWebPage. + * WebCoreSupport/WebPlatformStrategies.h: + +2010-09-22 İsmail Dönmez <ismail@namtrac.org> + + Reviewed by Andreas Kling. + + [Qt] Buildfix for WinCE + + * Api/DerivedSources.pro: + +2010-09-20 Philippe Normand <pnormand@igalia.com> + + Reviewed by Eric Carlson. + + [GTK] enhanced context menu for media elements + https://bugs.webkit.org/show_bug.cgi?id=45021 + + * WebCoreSupport/WebPlatformStrategies.cpp: + * WebCoreSupport/WebPlatformStrategies.h: + (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow): + (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow): + (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard): + (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard): + (WebPlatformStrategies::contextMenuItemTagToggleMediaControls) + (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop) + (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen) + (WebPlatformStrategies::contextMenuItemTagMediaPlay) + (WebPlatformStrategies::contextMenuItemTagMediaPause) + (WebPlatformStrategies::contextMenuItemTagMediaMute) + +2010-09-20 Jacob Dinu <dinu.jacob@nokia.com> + + Reviewed by Adam Barth. + + Added a new qwebpage test for loading a cached page + https://bugs.webkit.org/show_bug.cgi?id=41155 + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::loadCachedPage): + +2010-09-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix forward includes generation for MSVC when sh is in PATH. + + MSVC's nmake isn't affected by having sh in PATH. + + * Api/DerivedSources.pro: + +2010-09-18 Ademar de Souza Reis Jr <ademar.reis@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Enable Platform Strategies on Qt + + [Qt] Turn on PLATFORM_STRATEGIES + https://bugs.webkit.org/show_bug.cgi?id=45831 + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): Initialize the PlatformStrategy + singleton. + * WebCoreSupport/WebPlatformStrategies.cpp: Added, code was moved + from platform/qt/Localizations.cpp and plugins/qt/PluginDataQt.cpp + (WebPlatformStrategies::initialize): create the singleton, + following the same "pattern" used by Mac and Win ports. + (WebPlatformStrategies::WebPlatformStrategies): + (WebPlatformStrategies::createPluginStrategy): + (WebPlatformStrategies::createLocalizationStrategy): + (WebPlatformStrategies::createVisitedLinkStrategy): + (WebPlatformStrategies::refreshPlugins): + (WebPlatformStrategies::getPluginInfo): + (WebPlatformStrategies::inputElementAltText): + (WebPlatformStrategies::resetButtonDefaultLabel): + (WebPlatformStrategies::searchableIndexIntroduction): + (WebPlatformStrategies::submitButtonDefaultLabel): + (WebPlatformStrategies::fileButtonChooseFileLabel): + (WebPlatformStrategies::fileButtonNoFileSelectedLabel): + (WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow): + (WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk): + (WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard): + (WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow): + (WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk): + (WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard): + (WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow): + (WebPlatformStrategies::contextMenuItemTagCopy): + (WebPlatformStrategies::contextMenuItemTagGoBack): + (WebPlatformStrategies::contextMenuItemTagGoForward): + (WebPlatformStrategies::contextMenuItemTagStop): + (WebPlatformStrategies::contextMenuItemTagReload): + (WebPlatformStrategies::contextMenuItemTagCut): + (WebPlatformStrategies::contextMenuItemTagPaste): + (WebPlatformStrategies::contextMenuItemTagNoGuessesFound): + (WebPlatformStrategies::contextMenuItemTagIgnoreSpelling): + (WebPlatformStrategies::contextMenuItemTagLearnSpelling): + (WebPlatformStrategies::contextMenuItemTagSearchWeb): + (WebPlatformStrategies::contextMenuItemTagLookUpInDictionary): + (WebPlatformStrategies::contextMenuItemTagOpenLink): + (WebPlatformStrategies::contextMenuItemTagIgnoreGrammar): + (WebPlatformStrategies::contextMenuItemTagSpellingMenu): + (WebPlatformStrategies::contextMenuItemTagShowSpellingPanel): + (WebPlatformStrategies::contextMenuItemTagCheckSpelling): + (WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping): + (WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling): + (WebPlatformStrategies::contextMenuItemTagFontMenu): + (WebPlatformStrategies::contextMenuItemTagBold): + (WebPlatformStrategies::contextMenuItemTagItalic): + (WebPlatformStrategies::contextMenuItemTagUnderline): + (WebPlatformStrategies::contextMenuItemTagOutline): + (WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu): + (WebPlatformStrategies::contextMenuItemTagTextDirectionMenu): + (WebPlatformStrategies::contextMenuItemTagDefaultDirection): + (WebPlatformStrategies::contextMenuItemTagLeftToRight): + (WebPlatformStrategies::contextMenuItemTagRightToLeft): + (WebPlatformStrategies::contextMenuItemTagInspectElement): + (WebPlatformStrategies::searchMenuNoRecentSearchesText): + (WebPlatformStrategies::searchMenuRecentSearchesText): + (WebPlatformStrategies::searchMenuClearRecentSearchesText): + (WebPlatformStrategies::AXWebAreaText): + (WebPlatformStrategies::AXLinkText): + (WebPlatformStrategies::AXListMarkerText): + (WebPlatformStrategies::AXImageMapText): + (WebPlatformStrategies::AXHeadingText): + (WebPlatformStrategies::AXDefinitionListTermText): + (WebPlatformStrategies::AXDefinitionListDefinitionText): + (WebPlatformStrategies::AXButtonActionVerb): + (WebPlatformStrategies::AXRadioButtonActionVerb): + (WebPlatformStrategies::AXTextFieldActionVerb): + (WebPlatformStrategies::AXCheckedCheckBoxActionVerb): + (WebPlatformStrategies::AXUncheckedCheckBoxActionVerb): + (WebPlatformStrategies::AXMenuListActionVerb): + (WebPlatformStrategies::AXMenuListPopupActionVerb): + (WebPlatformStrategies::AXLinkActionVerb): + (WebPlatformStrategies::missingPluginText): + (WebPlatformStrategies::crashedPluginText): + (WebPlatformStrategies::multipleFileUploadText): + (WebPlatformStrategies::unknownFileSizeText): + (WebPlatformStrategies::imageTitle): + (WebPlatformStrategies::mediaElementLoadingStateText): + (WebPlatformStrategies::mediaElementLiveBroadcastStateText): + (WebPlatformStrategies::localizedMediaControlElementString): + (WebPlatformStrategies::localizedMediaControlElementHelpText): + (WebPlatformStrategies::localizedMediaTimeDescription): + (WebPlatformStrategies::validationMessageValueMissingText): + (WebPlatformStrategies::validationMessageTypeMismatchText): + (WebPlatformStrategies::validationMessagePatternMismatchText): + (WebPlatformStrategies::validationMessageTooLongText): + (WebPlatformStrategies::validationMessageRangeUnderflowText): + (WebPlatformStrategies::validationMessageRangeOverflowText): + (WebPlatformStrategies::validationMessageStepMismatchText): + (WebPlatformStrategies::isLinkVisited): + (WebPlatformStrategies::addVisitedLink): + * WebCoreSupport/WebPlatformStrategies.h: Added, based on Mac and Win + versions. + +2010-09-18 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] V8 port: Add FrameLoaderClientQt::allowScriptExtension() + https://bugs.webkit.org/show_bug.cgi?id=46034 + + r67749 added FrameLoaderClient::allowScriptExtension() (V8-specific) + Add a stub implementation that simply returns false for now. + + * WebCoreSupport/FrameLoaderClientQt.h: + (WebCore::FrameLoaderClientQt::allowScriptExtension): + +2010-09-17 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + REGRESSION (r60104): Zoom level is unexpectedly reset on page reload + https://bugs.webkit.org/show_bug.cgi?id=42863 + + * Api/qwebframe.cpp: + (QWebFrame::setTextSizeMultiplier): + (QWebFrame::textSizeMultiplier): + (QWebFrame::setZoomFactor): + (QWebFrame::zoomFactor): + Call functions on Frame instead of FrameView. + +2010-09-16 Darin Adler <darin@apple.com> + + Fix build. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): Updated for change + in name of isUrlField to isURLField. + +2010-09-16 Darin Adler <darin@apple.com> + + Reviewed by Andreas Kling. + + Reduce use of HTMLInputElement::inputType so we can remove it later + https://bugs.webkit.org/show_bug.cgi?id=45903 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId): + Use isPasswordField. + +2010-09-16 Robert Hogan <robert@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Support globalhistory tests + https://bugs.webkit.org/show_bug.cgi?id=45774 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::populateVisitedLinks): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::dumpHistoryCallbacks): + (DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::setTitle): + (WebCore::FrameLoaderClientQt::updateGlobalHistory): + (WebCore::FrameLoaderClientQt::updateGlobalHistoryRedirectLinks): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-09-16 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove FrameLoaderClientQt::webFrame() to use NetworkingContext to get the WebFrame to avoid layering violations + https://bugs.webkit.org/show_bug.cgi?id=42293 + + * Api/qwebframe.cpp: + (QWebFrame::childFrames): + (QWebFramePrivate::kit): + * Api/qwebpage.cpp: + (QWebPage::currentFrame): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::runJavaScriptAlert): + (WebCore::ChromeClientQt::runJavaScriptConfirm): + (WebCore::ChromeClientQt::runJavaScriptPrompt): + (WebCore::ChromeClientQt::contentsSizeChanged): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::chooseFile): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-09-15 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Update the Symbian def files + + Re-freeze with the viewport meta tag updates. + + * symbian/eabi/QtWebKitu.def: + +2010-09-14 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] V8 port: Get inspector up and running + https://bugs.webkit.org/show_bug.cgi?id=45771 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::ensureDebuggerScriptLoaded): Added, loads DebuggerScript.js into ScriptDebugServer. + (WebCore::InspectorClientQt::openInspectorFrontend): Ensure that DebuggerScript.js is loaded + before opening an inspector. + +2010-09-14 Enrico Ros <eros@codeaurora.org> + + Reviewed by Andreas Kling. + + [Qt] Respect title attribute on option elements + https://bugs.webkit.org/show_bug.cgi?id=45084 + + Set the tooltip in the combo box model, so it's reflected in the view. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::populate): + +2010-09-13 Daniel Bates <dbates@rim.com> + + https://bugs.webkit.org/show_bug.cgi?id=45732 + + Fix the Qt build. I missed this when reviewing the patch + for Bug #45732. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::suspendActiveDOMObjects): Change enum value ActiveDOMObject::JavaScriptPaused to + ActiveDOMObject::JavaScriptDebuggerPaused + +2010-09-13 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Daniel Bates. + + [Qt] DumpRenderTreeSupportQt::suspendActiveDOMObjects needs a new parameter + https://bugs.webkit.org/show_bug.cgi?id=45732 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::suspendActiveDOMObjects): Pass ActiveDOMObject::JavaScriptPaused + to suspendActiveDOMObjects. + +2010-09-13 Enrica Casucci <enrica@apple.com> + + Reviewed by Sam Weinig. + + Paste should be implemented in WebCore like Copy and Cut for Mac also. + https://bugs.webkit.org/show_bug.cgi?id=45494 + <rdar://problem/7660537> + + On the Mac platform, the implementation of the paste operation is all done + at the WebKit level. In order to support it on WebKit2 it is necessary to + refactor the code and move this functionality at the level of WebCore like + we already have on Windows. + The original code relies on some in AppKit functions that call back into + WebKit causing problems in WebKit2. All this functionality has been moved + at the level of the editor client where it can be dealt with appropriately. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::canShowMIMETypeAsHTML): Added stub. + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-08-27 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Antti Koivisto. + + Add a Qt API for the viewport meta tag support based on the + following draft spec: + + http://people.opera.com/rune/TR/ED-css-viewport-20100806/ + + Add common handling of viewport meta tag based on new Opera spec + https://bugs.webkit.org/show_bug.cgi?id=44201 + + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + * Api/qwebpage.cpp: + (QWebPage::ViewportConfiguration::ViewportConfiguration): + (QWebPage::ViewportConfiguration::~ViewportConfiguration): + (QWebPage::ViewportConfiguration::operator=): + (QWebPage::viewportConfigurationForSize): + (QWebPage::setPreferredContentsSize): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + (QtViewportConfigurationPrivate::QtViewportConfigurationPrivate): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::didReceiveViewportArguments): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::viewportAsText): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout): + +2010-09-12 Martin Smith <martin.smith@nokia.com> + + Reviewed by Simon Hausmann. + + doc: Changed the title so lists of contents sort better. + + * docs/qtwebkit.qdoc: + +2010-09-12 David Boddie <david.boddie@nokia.com> + + Reviewed by Simon Hausmann. + + Doc: More work on the QML documentation. + + * declarative/qdeclarativewebview.cpp: + +2010-09-12 Martin Jones <martin.jones@nokia.com> + + Reviewed by Simon Hausmann. + + [Qml] Ensure WebView gets focus when an editable node is clicked on. + + Task-number: QTBUG-13342 + + * declarative/qdeclarativewebview.cpp: + (GraphicsWebView::mousePressEvent): + +2010-09-12 David Boddie <david.boddie@nokia.com> + + Reviewed by Simon Hausmann. + + Doc: qdoc fixes. + + * declarative/qdeclarativewebview.cpp: + +2010-09-12 Oswald Buddenhagen <oswald.buddenhagen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] let WebKit inject itself into the qt configuration + + Task-number: QTBUG-12379 + + * qt_webkit_version.pri: Use the faster + instead of * + operator to add webkit to the config. + +2010-09-12 Martin Smith <martin.smith@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix group of declarative web view in QML docs. + + * declarative/qdeclarativewebview.cpp: + +2010-09-12 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Partial implementation of Qt bridge using V8 and QtScript. + + * Api/qwebelement.cpp: + (QWebElement::evaluateJavaScript): Stub it out for now, + to compile, until we have a conversion path between v8::Object + and QScriptValue. + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): Implemented using + few lines of QtScript code. + (QWebFrame::evaluateJavaScript): Ditto. + +2010-09-12 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Andreas Kling. + + Fix the build with V8. + + This is a temporary kludge until the scriptworld stuff is properly + ported, as part of the upcoming DRT work. + + * Api/qwebscriptworld.cpp: + (QWebScriptWorld::QWebScriptWorld): + +2010-09-11 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] V8 port for Qt platform: Qt WebCoreSupport changes + https://bugs.webkit.org/show_bug.cgi?id=45149 + + Original patch by Vlad Burlik <volodimir.burlik@nokia.com> + + Implemented the V8 specifics needed in DumpRenderTreeSupportQt and + FrameLoaderClientQt. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::javaScriptObjectsCount): + (DumpRenderTreeSupportQt::garbageCollectorCollect): + (DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread): + (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::didCreateScriptContextForFrame): + (WebCore::FrameLoaderClientQt::didDestroyScriptContextForFrame): + (WebCore::FrameLoaderClientQt::didCreateIsolatedScriptContext): + (WebCore::FrameLoaderClientQt::createDocumentLoader): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-09-11 Vlad Burlik <volodimir.burlik@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] V8 port for QT platform: QT API implementation changes + https://bugs.webkit.org/show_bug.cgi?id=45148 + + V8 Implementation of QWebFrame::addToJavaScriptWindowObject() + and QWebFrame::evaluateJavaScript() + + * Api/qwebelement.cpp: + (setupScriptContext): JSC and V8 variations + (QWebElement::evaluateJavaScript): + * Api/qwebelement.h: + * Api/qwebframe.cpp: QObject injection to V8 world + (QWebFrame::addToJavaScriptWindowObject): + (QWebFrame::evaluateJavaScript): + * Api/qwebpage.cpp: Use ScriptController type definitions instead of direct references to JSC or V8 + (QWebPagePrivate::QWebPagePrivate): + +2010-09-10 yi shen <yi.4.shen@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] selected text gets deleted when qgraphicswebview losts focus + https://bugs.webkit.org/show_bug.cgi?id=45539 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-09-10 Sam Weinig <sam@webkit.org> + + Fix Qt build. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-09-10 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom. + Precursor to <rdar://problem/7660657> + https://bugs.webkit.org/show_bug.cgi?id=45522 + + * Api/qwebframe.cpp: + (QWebFrame::setTextSizeMultiplier): + (QWebFrame::textSizeMultiplier): + (QWebFrame::setZoomFactor): + (QWebFrame::zoomFactor): + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + Move tracking of text only zoom here from WebCore. + +2010-09-10 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] Support click event for notifications + https://bugs.webkit.org/show_bug.cgi?id=44836 + + Propagate click events to JavaScript from either the + platform plugn or from QSystemTrayIcon. + Also added the method NotificationWrapper::openerPageUrl so that + if the platform plugin can reopen the page that created the + notification directly, when the user clicks the notification. + + Added DumpRenderTreeSupportQt::simulateDesktopNotificationClick + for testing purpose. + + * Api/qwebkitplatformplugin.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::simulateDesktopNotificationClick): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationWrapper::openerPageUrl): + (WebCore::NotificationWrapper::notificationClicked): + (WebCore::NotificationPresenterClientQt::displayNotification): + (WebCore::NotificationPresenterClientQt::notificationClicked): + * WebCoreSupport/NotificationPresenterClientQt.h: + * examples/platformplugin/WebNotificationPresenter.cpp: + (WebNotificationWidget::event): + * examples/platformplugin/WebNotificationPresenter.h: + (WebNotificationPresenter::WebNotificationPresenter): + * examples/platformplugin/qwebkitplatformplugin.h: + +2010-09-10 Adam Barth <abarth@webkit.org> + + Attempt to fix the failign Qt tests. This patch adapts code from + Chromium. The long-term fix is to remove the need for this code, but + that's a bit too complicated for a buildfix patch. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): + (WebCore::FrameLoaderClientQt::makeRepresentation): + (WebCore::FrameLoaderClientQt::revertToProvisionalState): + (WebCore::FrameLoaderClientQt::finishedLoading): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-09-10 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Fisher. + + Move code from WebKit-layer to DocumentLoader + https://bugs.webkit.org/show_bug.cgi?id=45569 + + This code didn't know that setEncoding can be called multiple times. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): + (WebCore::FrameLoaderClientQt::finishedLoading): + (WebCore::FrameLoaderClientQt::setMainDocumentError): + (WebCore::FrameLoaderClientQt::committedLoad): + (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse): + (WebCore::FrameLoaderClientQt::dispatchDidFailLoading): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-09-10 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Main resource bytes shouldn't bounce through FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=45496 + + Now return the bytes to the DocumentLoader. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::committedLoad): + +2010-09-08 Darin Adler <darin@apple.com> + + Reviewed by Adam Barth. + + Move functions from Frame to Editor as planned + https://bugs.webkit.org/show_bug.cgi?id=45218 + + * Api/qwebpage.cpp: + (QWebPage::selectedText): + (QWebPage::setContentEditable): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::firstRectForCharacterRange): + Changed call sites to use editor(). + +2010-09-08 Peter Kasting <pkasting@google.com> + + Reviewed by David Hyatt. + + Add smooth scrolling framework, and a Windows implementation. + https://bugs.webkit.org/show_bug.cgi?id=32356 + + * Api/qwebframe.cpp: + (QWebFrame::setScrollBarValue): + +2010-09-06 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Update NetworkAccessManager in Qt FrameNetworkingContext + https://bugs.webkit.org/show_bug.cgi?id=45231 + + Make possible to get the current QNAM when NetwokingContext request it. + + * WebCoreSupport/FrameNetworkingContextQt.cpp: + (WebCore::FrameNetworkingContextQt::networkAccessManager): + +2010-09-06 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Antonio Gomes. + + Web Inspector: Tests crash on Qt bots revealed by r66720 + https://bugs.webkit.org/show_bug.cgi?id=45256 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::InspectorClientQt): m_frontendClient must be initialized by constructor + +2010-09-06 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Attempt to fix random test crashes after r66720. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorFrontendClientQt::~InspectorFrontendClientQt): + * WebCoreSupport/InspectorClientQt.h: + +2010-09-05 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66801. + http://trac.webkit.org/changeset/66801 + https://bugs.webkit.org/show_bug.cgi?id=45242 + + 'breaks editing/pasteboard/onpaste-text-html.html' (Requested + by mwenge4 on #webkit). + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::addMessageToConsole): + +2010-09-05 Robert Hogan <robert@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] utf8 encoding of console() messages + + http/tests/security/xssAuditor/embed-tag-null-char.html + http/tests/security/xssAuditor/object-embed-tag-null-char.html + + both fail because ChromeClientQt::addMessageToConsole() is + casting String to QString rather than String::utf8().data() + + https://bugs.webkit.org/show_bug.cgi?id=45240 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::addMessageToConsole): + +2010-09-03 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Add Qt's specific implementation of NetworkingContext. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::setFrame): + (WebCore::FrameLoaderClientQt::createNetworkingContext): + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/FrameNetworkingContextQt.cpp: + (WebCore::FrameNetworkingContextQt::FrameNetworkingContextQt): + (WebCore::FrameNetworkingContextQt::create): + (WebCore::FrameNetworkingContextQt::originatingObject): + (WebCore::FrameNetworkingContextQt::networkAccessManager): + +2010-09-02 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector + https://bugs.webkit.org/show_bug.cgi?id=44230 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::inspectorDestroyed): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorClientQt::releaseFrontendPage): + (WebCore::InspectorFrontendClientQt::closeWindow): + (WebCore::InspectorFrontendClientQt::disconnectFromBackend): + (WebCore::InspectorFrontendClientQt::destroyInspectorView): + (WebCore::InspectorFrontendClientQt::inspectorClientDestroyed): + * WebCoreSupport/InspectorClientQt.h: + +2010-09-02 Andreas Kling <andreas.kling@nokia.com> + + Rubber-stamped by Simon Hausmann. + + [Qt] REGRESSION(r62898): tst_QWebFrame crashing + https://bugs.webkit.org/show_bug.cgi?id=43039 + + Rolling out the offending change <http://trac.webkit.org/changeset/62898> + + * tests/qwebframe/tst_qwebframe.cpp: + (tst_QWebFrame::evalJSV): + +2010-09-01 Mahesh Kulkarni <mahesh.kulkarni@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] QWebPage::allowGeolocationRequest should be async API + https://bugs.webkit.org/show_bug.cgi?id=41364 + + Provides a new async API for geolocation permission. Using + Notification API approach from qtwebkit. GeolocationPermissionClientQt + maintains list of pending requests from WebCore and intimates them + when client either allowes/denies the request. Also implements + ChromeClientQt::cancelGeolocationPermissionRequestForFrame. + + * Api/qwebpage.cpp: + (QWebPage::setUserPermission): + * Api/qwebpage.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::requestGeolocationPermissionForFrame): + (WebCore::ChromeClientQt::cancelGeolocationPermissionRequestForFrame): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/GeolocationPermissionClientQt.cpp: Added. + (WebCore::GeolocationPermissionClientQt::geolocationPermissionClient): + (WebCore::GeolocationPermissionClientQt::GeolocationPermissionClientQt): + (WebCore::GeolocationPermissionClientQt::~GeolocationPermissionClientQt): + (WebCore::GeolocationPermissionClientQt::requestGeolocationPermissionForFrame): + (WebCore::GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame): + (WebCore::GeolocationPermissionClientQt::setPermission): + * WebCoreSupport/GeolocationPermissionClientQt.h: Added. + * tests/qwebpage/tst_qwebpage.cpp: + (JSTestPage::requestPermission): + (tst_QWebPage::geolocationRequestJS): + +2010-08-31 Dave Hyatt <hyatt@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that + the former can occur in more places without having to do the latter. + + * Api/qwebelement.cpp: + (QWebElement::render): + * Api/qwebframe.cpp: + (QWebFramePrivate::renderRelativeCoords): + +2010-08-31 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] tst_QWebPage::originatingObjectInNetworkRequests() fails on trunk + https://bugs.webkit.org/show_bug.cgi?id=45001 + + Fix the test, we should not use data encoded URL since we are not + setting an URL but setting the substituteData directly. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::originatingObjectInNetworkRequests): + +2010-08-31 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + JSC TimeoutChecker::didTimeOut overflows on ARM + https://bugs.webkit.org/show_bug.cgi?id=38538 + + Re-enabled the test that was skipped for Maemo 5. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::infiniteLoopJS): + +2010-08-30 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66198. + http://trac.webkit.org/changeset/66198 + https://bugs.webkit.org/show_bug.cgi?id=44856 + + It made tests crash on Qt bot (Requested by Ossy_ on #webkit). + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::inspectorDestroyed): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorClientQt::releaseFrontendPage): + (WebCore::InspectorFrontendClientQt::closeWindow): + * WebCoreSupport/InspectorClientQt.h: + +2010-08-28 Daniel Bates <dbates@rim.com> + + Attempt to fix the Qt Windows and Qt Linux Release minimal builds + after changeset 66297 <http://trac.webkit.org/changeset/66297>. + + * Api/qwebplugindatabase.cpp: + (QWebPluginDatabase::plugins): Wrap the call to PluginPackage::ensurePluginLoaded + in #if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE). + +2010-08-27 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] tst_QWebView::focusInputTypes() fails on MeeGo Handset with WebKit 2.1 + https://bugs.webkit.org/show_bug.cgi?id=44761 + + Make the test more robust to changes in the execution environment. The click + are now correctly simulated, and the position are determined from the content. + + The test also create the view and page on the stack to avoid the leak when the + test is failing. + + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): + +2010-08-27 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Cache plugin info to a persistent database + + https://bugs.webkit.org/show_bug.cgi?id=43179 + + Implement a cache of NPAPI plugin metadata. Write the metadata to aa + file that gets rewritten if any plugin is added / removed. Compilation + of the feature is controlled by #if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + + Currently only enabled for Qt UNIX flavors. + + * Api/qwebplugindatabase.cpp: + (QWebPluginDatabase::plugins): Match previous behavior: ensure all returned plugins are loaded. + * Api/qwebsettings.cpp: + (QWebSettings::enablePersistentStorage): Set plugin cache path. + +2010-08-27 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] tst_QWebFrame::inputFieldFocus() fails on MeeGo Handset with QtWebKit 2.1 + https://bugs.webkit.org/show_bug.cgi?id=44703 + + Make the test more robust to changes in the execution environment. + The position where the mouse events are sent is now computed from the element geometry, + this make the test less dependent on the fonts. + + The test now also make sure the window manager mapped the window on screen + before attempting to send the events. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-08-27 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] tst_QWebFrame::hitTestContent() fails on Meego Handset + https://bugs.webkit.org/show_bug.cgi?id=44701 + + Make the test more robust. The position of the text is not relying + on the size of the fonts anymore. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-08-26 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Add support for automatically creating new windows in QWebView + https://bugs.webkit.org/show_bug.cgi?id=29847 + + Improved the documentation of createWindow methods of both QWebView and + QWebPage by mentioning that for any of them be called, QWebSettings' + JavaScriptCanOpenWindows attribute must be set to true. + + * Api/qwebpage.cpp: + * Api/qwebview.cpp: + +2010-08-27 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector + https://bugs.webkit.org/show_bug.cgi?id=44230 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::inspectorDestroyed): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorClientQt::releaseFrontendPage): + (WebCore::InspectorFrontendClientQt::closeWindow): + (WebCore::InspectorFrontendClientQt::disconnectFromBackend): + (WebCore::InspectorFrontendClientQt::destroyInspectorView): + (WebCore::InspectorFrontendClientQt::inspectorClientDestroyed): + * WebCoreSupport/InspectorClientQt.h: + +2010-08-26 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Antonio Gomes. + + [Qt] Remove dead code. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::statusbarVisible): + +2010-08-26 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Revert r66103 since Qt tests are failing. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorFrontendClientQt::closeWindow): + * WebCoreSupport/InspectorClientQt.h: + +2010-08-26 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector + https://bugs.webkit.org/show_bug.cgi?id=44230 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorFrontendClientQt::closeWindow): + (WebCore::InspectorFrontendClientQt::disconnectFromBackend): + (WebCore::InspectorFrontendClientQt::destroyInspectorView): + * WebCoreSupport/InspectorClientQt.h: + +2010-08-26 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] tst_QWebFrame::popupFocus() hardcode the element position + https://bugs.webkit.org/show_bug.cgi?id=44674 + + This patch dynamically find the position of the combo element instead + of hardcoding a position to click. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-08-25 Leo Yang <leo.yang@torchmobile.com.cn> + + Reviewed by Simon Hausmann. + + In FrameLoaderClientQt::createFrame we should call loadURLIntoChildFrame + with parent frame's loader instead of child frame's loader. + https://bugs.webkit.org/show_bug.cgi?id=43930 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createFrame): + +2010-08-25 Gabor Loki <loki@webkit.org> + + Reviewed by Gavin Barraclough. + + Avoid increasing required alignment of target type warning + https://bugs.webkit.org/show_bug.cgi?id=43963 + + Fix alignment warnings on Qt. + + * Api/qwebelement.cpp: + (QWebElement::evaluateJavaScript): + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): + +2010-08-24 Andras Becsi <abecsi@inf.u-szeged.hu> + + Reviewed by Simon Hausmann. + + [Qt] Fix predeclared variables for Symbian to be able to build QtWebKit for Symbian on Linux. + + * Api/DerivedSources.pro: + +2010-08-20 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Ariya Hidayat. + + [Qt] Allow wmode=transparent in QWebView on Maemo5 after r65775. + + https://bugs.webkit.org/show_bug.cgi?id=44043 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-08-22 Marc Mutz <marc.mutz@kdab.com> + + Reviewed by Antonio Gomes. + + [Qt] Actually emit the QWebView::selectionChanged() signal + + https://bugs.webkit.org/show_bug.cgi?id=44252 + + * Api/qwebview.cpp: + (QWebView::setPage): Connect QWebPage::selectionChanged() to QWebView::selectionChanged() + +2010-08-20 Ademar de Souza Reis Jr <ademar.reis@openbossa.org> + + Reviewed by Ariya Hidayat. + + [Qt] constify core() and kit() parameters + https://bugs.webkit.org/show_bug.cgi?id=44347 + + * Api/qwebframe.cpp: + (QWebFrame::evaluateJavaScript): + * Api/qwebframe_p.h: + * Api/qwebhistory.cpp: + (QWebHistoryItemPrivate::core): + * Api/qwebhistory_p.h: + * Api/qwebpage.cpp: + (QWebPagePrivate::core): + * Api/qwebpage_p.h: + +2010-08-19 Balazs Kelemen <kb@inf.u-szeged.hu> + + Reviewed by Antonio Gomes. + + [Qt] Fix cursor change propagation + https://bugs.webkit.org/show_bug.cgi?id=44250 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::setCursor): Implemented. Propagete the callback forward to the PageClient. + +2010-08-19 David Kilzer <ddkilzer@apple.com> + + BUILD FIX #3: <http://webkit.org/b/44285> Fix compilation with NETSCAPE_PLUGIN_API disabled + + Still trying to make Qt Linux Release minimal buildbot happy. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): Wrap code that + handles Netscape plugins in #if ENABLE(NETSCAPE_PLUGIN_API) + and #endif. + +2010-08-19 David Kilzer <ddkilzer@apple.com> + + BUILD FIX: FrameLoaderClientQt.h should include ResourceError.h + + * WebCoreSupport/FrameLoaderClientQt.h: Include ResourceError.h. + +2010-08-19 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Kenneth Christiansen. + + [Qt] Inject wmode=opaque for both QWebView and QGraphicsWebView on Maemo5 + as Flash XEmbed support is flaky. + + https://bugs.webkit.org/show_bug.cgi?id=44043 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2010-08-18 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, trivial Symbian build fix. + + [Qt] Remove unnecessary QtGui include from NotificationPresenterClientQt.cpp + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + +2010-08-17 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Ariya Hidayat. + + [Qt] [Symbian] Consistently use Q_OS_SYMBIAN to guard all Symbian platform dependencies + https://bugs.webkit.org/show_bug.cgi?id=44124 + + Q_WS_S60 is not defined for Symbian^4 devices as Q_WS_S60 used to guard + Avkon UI framework dependencies. Use Q_OS_SYMBIAN everywhere to mark + Symbian dependencies. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::populate): + +2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebCoreSupport/FrameNetworkingContextQt.cpp: Added. + Empty placeholder for now. + * WebCoreSupport/FrameNetworkingContextQt.h: Added. + Placeholder with tentative code that might be changed when landing + the rest of it. + +2010-08-17 Hui Huang <hui.2.huang@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Fix ARM5 compiling error in FrameLoaderClientQt.cpp + https://bugs.webkit.org/show_bug.cgi?id=43927 + + In the Symbian build chain QT_USE_FAST_OPERATOR_PLUS is defined, + which means that the '+' will automatically be performed as the + QStringBuilder '%'. Create a QString explicitly to make sure that + toLocal8bit() member is available that the qPrintable Macro uses. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + +2010-08-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Kenneth Christiansen. + + [Qt] Implement ChromeClient's windowToScreen() and screenToWindow() + + * WebCoreSupport/ChromeClientQt.cpp: + +2010-08-14 Adam Barth <abarth@webkit.org> + + Propagate name change to Qt. + + * Api/qwebelement.cpp: + (QWebElement::appendInside): + (QWebElement::prependInside): + (QWebElement::prependOutside): + (QWebElement::appendOutside): + (QWebElement::encloseContentsWith): + (QWebElement::encloseWith): + +2010-08-12 Jeremy Orlow <jorlow@chromium.org> + + Revert for now + https://bugs.webkit.org/show_bug.cgi?id=43794 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-08-11 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Adam Barth. + + Some settings are linked to the PageGroup not the Page. Create a new class for those. + https://bugs.webkit.org/show_bug.cgi?id=43794 + + Change WebSettings to use the new GroupSettings class rather than Settings for the + settings that moved. This is sub-optimal since the settings aren't really + per-view, but I don't see how we can change the API at this point. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-08-11 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Update the Symbian def files + + Re-freeze with various QGraphicsWebView and DRT updates. + The uppper part of the diff is just whitespace, so + diff -w will show the real diff. + + * symbian/eabi/QtWebKitu.def: + +2010-08-10 Anders Bakken <agbakken@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Don't connect to microFocusChanged() if _q_updateMicroFocus is a noop. + https://bugs.webkit.org/show_bug.cgi?id=40580 + + _q_updateMicroFocus() is a noop unless this ifdef evaluates to true: + #if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + + In such cases there's no need to carry the overhead of the extra + signal/slot connection. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_updateMicroFocus): + (QGraphicsWebView::setPage): + +2010-08-10 Chris Marrin <cmarrin@apple.com> + + Reviewed by Oliver Hunt. + + Add suspendAnimations/resumeAnimation API to DRT + https://bugs.webkit.org/show_bug.cgi?id=43733 + + Qt specific API. Missing symbian symbol defines in: + + WebKit/qt/symbian/bwins/QtWebKitu.def + WebKit/qt/symbian/eabi/QtWebKitu.def + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::suspendAnimations): + (DumpRenderTreeSupportQt::resumeAnimations): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/InspectorClientQt.h: + +2010-08-08 Ariya Hidayat <ariya@sencha.com> + + Reviewed by Antonio Gomes. + + Inconsistent Qt version checks + https://bugs.webkit.org/show_bug.cgi?id=43695 + + Use QT_VERSION_CHECK macro instead of encoded hex. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebViewPrivate::detachCurrentPage): + * Api/qwebframe.cpp: + (QWebFrame::load): + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + (QWebPage::view): + * Api/qwebview.cpp: + (QWebViewPrivate::detachCurrentPage): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + * WebCoreSupport/PageClientQt.cpp: + * WebCoreSupport/PageClientQt.h: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/InspectorClientQt.h: + +2010-08-06 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Move Qt's popup menu implementation from WebCore to WebKit layer + https://bugs.webkit.org/show_bug.cgi?id=43427 + + After PopupMenu changes in bug 42592 class QtAbstractWebPopup became unecessary and + there is no need to keep any Qt specific code for popup menus in WebCore/platform/qt. + + PopupMenuQt has been moved from WebCore/platform/qt to WebKit/qt/WebCoreSupport and + assumed the responsibilities of QtAbstractWebPopup. SearchPopupMenuQt has been moved + to WebKit/qt/WebCoreSupport as well. + + All classes that previously inherited from QtAbstractWebPopup now inherit from + QWebSelectMethod and QtPlatformPlugin's method createSelectInputMethod now returns an + instance of class QWebSelectMethod instead of QtAbstractWebPopup. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + (WebCore::ChromeClientQt::createPopupMenu): + (WebCore::ChromeClientQt::createSearchPopupMenu): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/PopupMenuQt.cpp: Added. + (SelectData::SelectData): + (SelectData::itemText): + (SelectData::itemToolTip): + (SelectData::itemIsEnabled): + (SelectData::itemCount): + (SelectData::itemIsSelected): + (SelectData::multiple): + (SelectData::itemType): + (WebCore::PopupMenuQt::PopupMenuQt): + (WebCore::PopupMenuQt::~PopupMenuQt): + (WebCore::PopupMenuQt::disconnectClient): + (WebCore::PopupMenuQt::show): + (WebCore::PopupMenuQt::didHide): + (WebCore::PopupMenuQt::hide): + (WebCore::PopupMenuQt::updateFromElement): + (WebCore::PopupMenuQt::selectItem): + * WebCoreSupport/PopupMenuQt.h: Added. + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::hidePopup): + (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::show): + (WebCore::QtFallbackWebPopup::populate): + (WebCore::QtFallbackWebPopup::activeChanged): + (WebCore::QtFallbackWebPopup::pageClient): + * WebCoreSupport/QtFallbackWebPopup.h: + (WebCore::QtFallbackWebPopup::setGeometry): + (WebCore::QtFallbackWebPopup::geometry): + (WebCore::QtFallbackWebPopup::setFont): + (WebCore::QtFallbackWebPopup::font): + * WebCoreSupport/QtMaemoWebPopup.cpp: + (WebCore::Maemo5Popup::populateList): + (WebCore::QtMaemoWebPopup::QtMaemoWebPopup): + (WebCore::QtMaemoWebPopup::createSingleSelectionPopup): + (WebCore::QtMaemoWebPopup::createMultipleSelectionPopup): + (WebCore::QtMaemoWebPopup::createPopup): + (WebCore::QtMaemoWebPopup::show): + (WebCore::QtMaemoWebPopup::popupClosed): + (WebCore::QtMaemoWebPopup::itemClicked): + (WebCore::Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup): + (WebCore::Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup): + * WebCoreSupport/QtMaemoWebPopup.h: + (WebCore::Maemo5Popup::Maemo5Popup): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createSelectInputMethod): + * WebCoreSupport/QtPlatformPlugin.h: + * WebCoreSupport/SearchPopupMenuQt.cpp: Added. + (WebCore::SearchPopupMenuQt::SearchPopupMenuQt): + (WebCore::SearchPopupMenuQt::popupMenu): + (WebCore::SearchPopupMenuQt::saveRecentSearches): + (WebCore::SearchPopupMenuQt::loadRecentSearches): + (WebCore::SearchPopupMenuQt::enabled): + * WebCoreSupport/SearchPopupMenuQt.h: Added. + +2010-08-06 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Add support for the Android viewport meta tag extensions. + http://webkit.org/b/43567 + + * Api/qwebpage.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::didReceiveViewportArguments): + +2010-08-05 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/InspectorClientQt.h: + +2010-08-05 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Clean up the input method handling + https://bugs.webkit.org/show_bug.cgi?id=43545 + + Replace the way of individually setting input method hints by + many calls to QWidget::setInputMethodHints with one single call. + + This is more efficient by requiring less updates in the input + method hint. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQWidget::setInputMethodHints): + (WebCore::PageClientQGraphicsWidget::setInputMethodHints): + * WebCoreSupport/PageClientQt.h: + +2010-08-05 David Leong <david.leong@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Input mode states are not reset after entering a password field + https://bugs.webkit.org/show_bug.cgi?id=43530 + + Input mode hints are not reset if clicking on password <input> elements then + clicking on <textarea> elements + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qwebview/resources/input_types.html: + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): + + +2010-08-04 Pierre Rossi <pierre.rossi@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] QWebFrame::setContent() does not respect charset provided in the mimeType + https://bugs.webkit.org/show_bug.cgi?id=43125 + + * Api/qwebframe.cpp: + (QWebFrame::setContent): + * tests/qwebframe/tst_qwebframe.cpp: + +2010-08-03 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Edits to bridge documentation + https://bugs.webkit.org/show_bug.cgi?id=43012 + + * docs/qtwebkit-bridge.qdoc: + * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp: + (wrapInFunction): + +2010-08-03 Kim Grönholm <kim.1.gronholm@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Platform plugin interface for Haptics + https://bugs.webkit.org/show_bug.cgi?id=43143 + + Platform plugin interface for playing haptic feedback + + * Api/qwebkitplatformplugin.h: + (QWebHapticFeedbackPlayer::): + (QWebKitPlatformPlugin::): + * examples/platformplugin/WebPlugin.h: + (WebPlugin::createHapticFeedbackPlayer): + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebHapticFeedbackPlayer::): + (QWebKitPlatformPlugin::): + +2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::selectItemWritingDirectionIsNatural): + (WebCore::ChromeClientQt::createPopupMenu): + (WebCore::ChromeClientQt::createSearchPopupMenu): + * WebCoreSupport/ChromeClientQt.h: + +2010-08-02 Jeremy Orlow <jorlow@chromium.org> + + Speculative revert of 64425 due to Chromium instability + https://bugs.webkit.org/show_bug.cgi?id=43347 + + * WebCoreSupport/ChromeClientQt.cpp: + * WebCoreSupport/ChromeClientQt.h: + +2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::selectItemWritingDirectionIsNatural): + (WebCore::ChromeClientQt::createPopupMenu): + (WebCore::ChromeClientQt::createSearchPopupMenu): + * WebCoreSupport/ChromeClientQt.h: + +2010-07-31 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r64422. + http://trac.webkit.org/changeset/64422 + https://bugs.webkit.org/show_bug.cgi?id=43304 + + Build fixes are needed for Snow Leopard and Windows. + (Requested by lca on #webkit). + + * WebCoreSupport/ChromeClientQt.cpp: + * WebCoreSupport/ChromeClientQt.h: + +2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::selectItemWritingDirectionIsNatural): + (WebCore::ChromeClientQt::createPopupMenu): + (WebCore::ChromeClientQt::createSearchPopupMenu): + * WebCoreSupport/ChromeClientQt.h: + +2010-07-30 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Simon Fraser. + + Enabling view modes to all platforms + https://bugs.webkit.org/show_bug.cgi?id=37505 + + As view mode media feature is now supported by WebCore there is no need + to keep its implementation here. QtWebKit now uses WebCore's view mode media feature + implementation. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + * Api/qwebpage_p.h: + * WebCoreSupport/ChromeClientQt.cpp: + * WebCoreSupport/ChromeClientQt.h: + +2010-07-30 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota): + * WebCoreSupport/ChromeClientQt.h: + +2010-07-29 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Antonio Gomes. + + QWebFrame and QWebView documentation fix. + + The QWebFrame and the QWebView setHtml() methods are a bit confusing. + There are a few registered bugs in Webkit's bugzilla that source is + in a bad usage of the function. + Additional information were added. + + https://bugs.webkit.org/show_bug.cgi?id=31115 + + * Api/qgraphicswebview.cpp: + * Api/qwebframe.cpp: + * Api/qwebview.cpp: + +2010-07-28 Kim Grönholm <kim.1.gronholm@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] Decouple QTouchEvent's accepted flag from JS prevent default + https://bugs.webkit.org/show_bug.cgi?id=42892 + + Added comments to the touch event handling code. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::sceneEvent): + * Api/qwebpage.cpp: + (QWebPagePrivate::touchEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebView::event): + +2010-07-26 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Page clients should be passed to Page constructor via structure of pointers + https://bugs.webkit.org/show_bug.cgi?id=42834 + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2010-07-27 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Incorrect input method hints + https://bugs.webkit.org/show_bug.cgi?id=43037 + + Properly set or reset all input method hints when + activating input fields. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): Extended unit test to verify that we + reset hints. + +2010-07-27 Kim Grönholm <kim.1.gronholm@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Decouple QTouchEvent's accepted flag from JS prevent default + https://bugs.webkit.org/show_bug.cgi?id=42892 + + We need to always accept the QTouchEvents in order to get TouchUpdate and + TouchEnd events. QWebPage::event() return value is used to indicate + whether the default action was prevented for the touch events. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::sceneEvent): + * Api/qwebpage.cpp: + (QWebPagePrivate::touchEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebView::event): + +2010-07-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Change default font from sans-serif to serif + + This matches what other ports and browser engines do. + + We now also use QFont's defaultFontFamily() to resolve the + correct fonts for each platform. For Qt >= 4.7 we can take + advantage of the new enums for generic font families. + + * Api/qwebsettings.cpp: + +2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml() + + This ensures that long-running JavaScript (for example due to a modal alert() dialog), + will not trigger a deferred load after only 500ms (the default tokenizer delay) while + still giving a reasonable timeout (10 seconds) to prevent deadlock. + + https://bugs.webkit.org/show_bug.cgi?id=29381 + + * Api/qwebframe.cpp: Document the behaviour + * WebCoreSupport/FrameLoaderClientQt.cpp: set the custom tokenizer delay for substitute loads + * tests/qwebframe/tst_qwebframe.cpp: Add test + +2010-07-23 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + Doc: Fixed incorrect QML property type. + + * declarative/qdeclarativewebview.cpp: + +2010-07-23 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Build fix for Qt apps + + Add webkit to QT_CONFIG. qconfig.pri will read qt_webkit_version.pri and + that's how it will pick up webkit in QT_CONFIG. + + * qt_webkit_version.pri: + +2010-07-22 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] QtWebKit needs public API for Notifications. + https://bugs.webkit.org/show_bug.cgi?id=41413 + + Remove DumpRenderTree private API and introduce new API. + Also add support for informing the UI when a notification request is cancelled. + + * Api/qwebpage.cpp: + (QWebPage::setUserPermission): + * Api/qwebpage.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::requestPermission): + (WebCore::NotificationPresenterClientQt::checkPermission): + (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission): + (WebCore::NotificationPresenterClientQt::allowNotificationForFrame): + (WebCore::NotificationPresenterClientQt::toPage): + (WebCore::NotificationPresenterClientQt::toFrame): + * WebCoreSupport/NotificationPresenterClientQt.h: + +2010-07-22 Jamey Hicks <jamey.hicks@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable binding of QObjects to JavaScript environment for inspector frontend + + This patch enables QObjects to be bound to global variables in the + javascript environment of the inspector frontend. This is useful + for writing alternate inspector frontends in javascript which need + additional native functionality. It's a lighter-weight alternative + than using an NPAPI plugin. + + The code which instantiates QWebInspector uses this by setting the + dynamic property "q_inspectorJavaScriptWindowObjects" on the + QWebInspector. The value of this property should be a + QMap<QString,QVariant> mapping global variable name to QObject. + + I have used this to add support for eclipse/chrome remote + debugging in QtTestBrowser. + + https://bugs.webkit.org/show_bug.cgi?id=41995 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientWebPage::InspectorClientWebPage): + (WebCore::InspectorClientWebPage::javaScriptWindowObjectCleared): + (WebCore::InspectorClientQt::openInspectorFrontend): + +2010-07-22 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Library versioning. + + 2.1 is branched, trunk will become 2.2. + + * Api/qwebkitglobal.h: + * qt_webkit_version.pri: + +2010-07-21 Brady Eidson <beidson@apple.com> + + Reviewed by Geoffrey Garen. + + Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry + https://bugs.webkit.org/show_bug.cgi?id=42783 + + * Api/qwebpage.cpp: + (QWebPage::acceptNavigationRequest): + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::addLocalScheme): + (QWebSecurityOrigin::removeLocalScheme): + (QWebSecurityOrigin::localSchemes): + +2010-07-20 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + [Qt] Add API to define device-width and height for use with the viewport meta tag + https://bugs.webkit.org/show_bug.cgi?id=42597 + + Reviewed by Antonio Gomes. + + Add a new API for setting the deviceSize for use in conjunction with + out viewport meta tag API. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::setDeviceSize): + (QGraphicsWebView::deviceSize): + * Api/qgraphicswebview.h: + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::windowRect): + * WebCoreSupport/PageClientQt.h: + (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget): + +2010-07-20 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] DRT sideeffect revealed by r63657 + https://bugs.webkit.org/show_bug.cgi?id=42578 + + Don't set an automatic timeout for notifications when running in DRT. + This fixes an issue with cancel() notifications in unrelated tests. + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::displayNotification): + +2010-07-18 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] tst_QWebPage fails cursorMovements and textSelection + https://bugs.webkit.org/show_bug.cgi?id=42531 + + Correct the HTML used by these tests. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::cursorMovements): + (tst_QWebPage::textSelection): + (tst_QWebPage::textEditing): + +2010-07-18 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] tst_QWebElement fails firstChildNextSibling and lastChildPreviousSibling + https://bugs.webkit.org/show_bug.cgi?id=42527 + + Correct the HTML used by these tests. + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::firstChildNextSibling): + (tst_QWebElement::lastChildPreviousSibling): + +2010-07-16 Zhe Su <suzhe@chromium.org> + + Reviewed by Darin Adler. + + REGRESSION(r61484): Broke focus behaviour on Qt and probably other platforms + https://bugs.webkit.org/show_bug.cgi?id=42253 + + Dummy implementation of EditorClient::willSetInputMethodState. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::willSetInputMethodState): + * WebCoreSupport/EditorClientQt.h: + +2010-07-14 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=42232 + Make changing Cursors work in WebKit2. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::setCursor): + * WebCoreSupport/ChromeClientQt.h: + Change prototype to match new one. + +2010-07-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Darin Adler. + + Prevent assertion/duplicate loads for non-deferred subtitute-data loads + + https://bugs.webkit.org/show_bug.cgi?id=30879 + + MainResourceLoader uses the member m_initialRequest to store requests for future + deferred loads. When doing the actual load in handleDataLoadNow(), we therefore + have to clear this request so that subsequent entries into the loader will not + start yet another load. + + This can happen as a result of a PageGroupLoadDeferrer going out of scope when + returning from Chrome::runJavaScriptAlert(), which calls setDeferredLoading(false), + but only in the case of using both substitute-data and non-deferred main resource + load together. That's why two new DRT functions were added: + + * queueLoadHTMLString() + * setDeferMainResourceLoad() + + The change adds DRT hooks for Mac, Win and Qt for these two functions. For Mac + and Win the hook uses new SPI in WebDataSource. For Qt a new static member was + added to the FrameLoaderClientQt and accessed though DumpRenderTreeSupportQt. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setDeferMainResourceDataLoad): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createDocumentLoader): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-07-09 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Laszlo Gombos. + + NotificationPresenter needs a cancelRequestPermission API + https://bugs.webkit.org/show_bug.cgi?id=41783 + + Updated NotificationPresenter API to use ScriptExecutionContext instead of origin + and added a new NotificationPresenter::cancelRequestsForPermission API. + The new API will be implemented in a followup patch. + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::requestPermission): + (WebCore::NotificationPresenterClientQt::checkPermission): + (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission): + * WebCoreSupport/NotificationPresenterClientQt.h: + +2010-07-09 Kent Hansen <kent.hansen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Skip test that never terminates on maemo5 + + Due to https://bugs.webkit.org/show_bug.cgi?id=38538 + the tst_QWebPage::infiniteLoopJS() autotest never terminates. + Skip the test so that the test case may run to completion. + + Patch by Dominik Holland <dominik.holland@nokia.com> + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::infiniteLoopJS): + +2010-07-09 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed trivial Symbian build fix. + + [Qt] Fix the Symbian build when compiling without S60 + + Use Q_OS_SYMBIAN instead of Q_WS_S60 for the user agent + determination. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2010-07-09 Kristian Amlie <kristian.amlie@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fixed Qt symbian/linux-armcc mkspec when configured with -qtlibinfix. + + * declarative/declarative.pro: Use QT_LIBINFIX. + +2010-07-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by Simon Hausmann. + + [Qt] Remove superfluous function calls + https://bugs.webkit.org/show_bug.cgi?id=40353 + + QWebFrame::setUrl() calls ensureAbsoluteUrl() twice. It's better to + store a local variable and reuse this one. + + QWebFrame::load(QUrl) calls QWebFrame::load(QNetworkRequest) which in + turn will get the QUrl from the request and make sure it's absolute by + calling ensureAbsoluteUrl() on it. + + * Api/qwebframe.cpp: + (QWebFrame::setUrl): + (QWebFrame::load): + +2010-07-08 Sam Magnuson <smagnuson@netflix.com> + + Reviewed by Simon Hausmann. + + [Qt] instance objects created for QObjects are somtimes GC'd + https://bugs.webkit.org/show_bug.cgi?id=40352 + + Improved the test to check for jsObjects that that are garbage collected. + + * tests/qwebframe/tst_qwebframe.cpp: + (tst_QWebFrame::): + +2010-07-08 Aaron Boodman <aa@chromium.org> + + Unreviewed change to fix qt build after c62876. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::addUserStyleSheet): + +2010-07-07 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Add DRT support for pageProperty etc. + + https://bugs.webkit.org/show_bug.cgi?id=41584 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::isPageBoxVisible): + (DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels): + (DumpRenderTreeSupportQt::pageProperty): + (DumpRenderTreeSupportQt::addUserStyleSheet): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-07-08 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=41826 + Convert BackForwardList to an abstract base class and add BackForwardListImpl + as the concrete implementation of it. + + * Api/qwebhistory.cpp: + (QWebHistory::clear): + (QWebHistory::back): + (QWebHistory::forward): + (QWebHistory::goToItem): + (operator>>): + (QWebHistoryPrivate::page): + +2010-07-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + Remove unused WEBKIT_VERSION define from qwebpage.cpp + + We now use qWebKitVersion() + + * Api/qwebpage.cpp: + +2010-07-07 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=41772 + Add basic piping for BackForwardControllerClient. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2010-07-07 Marc Mutz <marc.mutz@kdab.com> + + Reviewed by Adam Barth. + + [Qt] QWebSettings: Don't leak native pixmaps + + When Q_GLOBAL_STATIC gets around to deleting the QHash with the + pixmaps in, the QApplication destructor has already been + completed. This makes it impossible for ~QPixmap to return the + native pixmap to the OS, thus leaking them. + + This patch adds a post routine (executed as part of ~QApplication) + that clears the hash so Q_GLOBAL_STATIC's destruction doesn't have + to execute ~QPixmap's anymore. + + https://bugs.webkit.org/show_bug.cgi?id=41657 + + * Api/qwebsettings.cpp: + (earlyClearGraphics): New. Clears the pixmap hash. + (graphics): add earlyClearGraphics as a qAddPostRoutine() + +2010-07-06 Csaba Osztrogonác <ossy@webkit.org> + + Rubber-stamped by Kenneth Rohde Christiansen. + + Client errors should set "WebKitErrorDomain" domain instead of "WebKit" to match Mac. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::blockedError): + (WebCore::FrameLoaderClientQt::cannotShowURLError): + (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): + (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError): + +2010-07-06 Darin Adler <darin@apple.com> + + Fix crash caused by my fix to the Qt build. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorFrontendClientQt::closeWindow): Release pointer into + a local OwnPtr instead of calling clear. Another fix, probably better, + would be to change OwnPtr::clear to zero out the pointer before deleting, + but that affects many more call sites, so I will do that separately. + +2010-07-06 Darin Adler <darin@apple.com> + + Fix Qt build. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorFrontendClientQt::closeWindow): Call clear instead of + calling delete on the result of leakPtr. + +2010-06-19 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + WebInspector: js function name was fixed. + dispatchMessageToFrontend -> dispatchMessageFromBackend. + https://bugs.webkit.org/show_bug.cgi?id=40675 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::sendMessageToFrontend): + +2010-07-03 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Return usable property names from DRT's computedStyleIncludingVisitedInfo() + + Object property names such as 'background-color' need to be returned in camel + case, i.e. backgroundColor so that JS can reference them. Add support for this + to DumpRenderTreeSupportQt. + + https://bugs.webkit.org/show_bug.cgi?id=40445 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (convertToPropertyName): + (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo): + +2010-07-01 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] dump frames in ascending alphabetical order of title + + https://bugs.webkit.org/show_bug.cgi?id=41261 + + Unskip: + http/tests/navigation/metaredirect-frames.html + http/tests/navigation/redirect302-frames.html + http/tests/navigation/redirect302-subframeload.html + http/tests/navigation/timerredirect-frames.html + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::getChildHistoryItems): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-07-01 Bea Lam <bea.lam@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Doc improvements for QDeclarativeWebView + + * declarative/qdeclarativewebview.cpp: + +2010-07-01 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Create QComboBoxes when clicked and destroy on hide. + https://bugs.webkit.org/show_bug.cgi?id=41451 + + Currently a QComboBox is created for each RenderMenuList and + it gets destroyed either when the RenderMenuList or the + QWebView (its Qt parent) is destroyed. This cause a crash + when the QWebView is destroyed before the render tree (which + is kept in cache). + + This patch aim to destroy the QComboBox as soon as its popup + gets hidden, and likewise, create it only when the popup is + requested to be shown. + It also removes the unneeded reference to the QGraphicsProxyWidget, + destroying the QComboBox automatically destroys its bound + proxywidget. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::hidePopup): + (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::show): + (WebCore::QtFallbackWebPopup::hide): + (WebCore::QtFallbackWebPopup::destroyPopup): + (WebCore::QtFallbackWebPopup::populate): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-07-01 Satish Sampath <satish@chromium.org> + + Reviewed by Kent Tamura. + + Rendering the speech button in input elements. + https://bugs.webkit.org/show_bug.cgi?id=40984 + + * Api/qwebsettings.cpp: + (graphics): + * Api/qwebsettings.h: + +2010-06-30 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Make sure we catch closed QComboBox popups. + https://bugs.webkit.org/show_bug.cgi?id=39019 + + The way it works currently is using the QComboBox::show/hidePopup + virtual method to catch popup requests in the middle. There is + some cases however that the popup widget gets closed without + going through the hidePopup method. + + This patch adds an event filter to the popup's view to know when + it gets closed and calls hidePopup to call our handling code. + This may get hidePopup called twice but this shouldn't have any + effect. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::QtFallbackWebPopupCombo): + (WebCore::QtFallbackWebPopupCombo::eventFilter): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-06-30 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Symbian build fix. + + [Qt] Update the def files to link DumpRenderTree. + + * symbian/eabi/QtWebKitu.def: + +2010-06-30 Samuel Nevala <samuel.nevala@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] Auto test wont compile from \3rdparty\webkit\WebKit\qt\tests + https://bugs.webkit.org/show_bug.cgi?id=38720 + + Load qttest_p4.prf under QTDIR_build. + + * tests/tests.pri: + +2010-06-29 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] support dumpResourceResponseMIMETypes + https://bugs.webkit.org/show_bug.cgi?id=41260 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-06-28 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed Symbian build fix. + + [Qt] Update the def file after r61879. + + * symbian/eabi/QtWebKitu.def: + +2010-06-28 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] QGraphicsWebView crash when calling setScale() before setUrl() + https://bugs.webkit.org/show_bug.cgi?id=40000 + + Check 'page' before dereference in _q_scaleChanged() + Autotest included. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_scaleChanged): + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl): + +2010-06-26 Simon Hausmann <hausmann@webkit.org> + + [Qt] Prospective build fix for MSVC + + In order for the forward declaration of QWebScriptWorldPrivate + to work with QExplicitlySharedDataPointer, then copy constructor + and assignment operators must not be compiler generated, to + avoid them ending up in places where the private class is not + declared. + + * Api/qwebscriptworld.cpp: + (QWebScriptWorld::QWebScriptWorld): + (QWebScriptWorld::operator=): + * Api/qwebscriptworld.h: + +2010-06-26 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] DRT Support for setCustomPolicyDelegate + + https://bugs.webkit.org/show_bug.cgi?id=39564 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setCustomPolicyDelegate): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (drtDescriptionSuitableForTestResult): + (WebCore::navigationTypeToString): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-06-25 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QtWebKit crashes if <select>'s render changes in its onchange event + https://bugs.webkit.org/show_bug.cgi?id=41164 + + QtWebKit crashes if <select>'s renderer changes in its onchange event. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup): + +2010-06-25 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Support evaluateScriptInIsolatedWorld() + + https://bugs.webkit.org/show_bug.cgi?id=40079 + + Remove evaluateScriptInIsolatedWorld() from QtWebKit API. + Remove QWebScriptWorld from exported headers. + Confine support to DumpRenderTreeSupportQt so that the tests can pass. + + * Api/headers.pri: + * Api/qwebframe.cpp: + * Api/qwebframe.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::clearScriptWorlds): + (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-06-24 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Symbian build fix. + + The QML WebKit integration needs to be part of QtWebKit.sis + + * declarative/declarative.pro: Removed non-working deployment. + +2010-06-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file after r61478. + + * symbian/eabi/QtWebKitu.def: + +2010-06-23 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + [Qt] Doc: Fixed documentation errors. + + * docs/qtwebkit-bridge.qdoc: + +2010-06-23 Alessandro Portale <alessandro.portale@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Provide the Webkit Qml plugin with a UID3 on Symbian + + ...otherwise we cannot Symbian sign it. + + * declarative/declarative.pro: + +2010-06-23 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Qt package build fix. + + When building without build-webkit, set OUTPUT_DIR if necessary, like + in the other .pro files. + + * declarative/declarative.pro: + +2010-06-22 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix compilation with QT_NO_COMBOBOX. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + +2010-06-21 Robert Hogan <robert@webkit.org> + + [Qt] Build fix for Qt on Windows MSVC2008 + + Unreviewed, build fix. + + Fix by Jocelyn Turcotte. + + * Api/qwebframe.cpp: + +2010-06-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by nobody, build fix. + + [Qt] Fix MSVC build. + + The max macro was replacing the max function used in StringImpl.h + when compiling moc_NotificationPresenterClientQt.cpp. + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + +2010-06-21 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file with recent new exports. + + * symbian/eabi/QtWebKitu.def: + +2010-06-21 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed build fix. + + [Qt] Fix package builds + + Don't use rpath unless we're building inside the trunk. + + * declarative/declarative.pro: + +2010-06-20 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + The QWebHistory regression fix. + + After change r51629 and r61207 QWebHistory's function back(), + forward(), goToItem() got broken. + + Use page->goToItem() instead of direct actions on the BackForwardList. + + [Qt] REGRESSION(r61207): qwebhistory unit test hangs + https://bugs.webkit.org/show_bug.cgi?id=40672 + + * Api/qwebhistory.cpp: + (QWebHistory::back): + (QWebHistory::forward): + (QWebHistory::goToItem): + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::init): + (tst_QWebHistory::back): + (tst_QWebHistory::forward): + +2010-06-19 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Platform plugin's multi-select does not take OptGroup into account + https://bugs.webkit.org/show_bug.cgi?id=40718 + + Make sure that SelectData is valid throughout the lifetime of the dialog. + This is mostly important for the Orbt based plugin. + Added virtual desctructors where they were missing. + + * Api/qwebkitplatformplugin.h: + (QWebSelectData::~QWebSelectData): + (QWebSelectMethod::~QWebSelectMethod): + (QWebNotificationData::~QWebNotificationData): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::SelectInputMethodWrapper::SelectInputMethodWrapper): + (WebCore::SelectInputMethodWrapper::~SelectInputMethodWrapper): + (WebCore::SelectInputMethodWrapper::show): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebSelectData::~QWebSelectData): + (QWebSelectMethod::~QWebSelectMethod): + (QWebNotificationData::~QWebNotificationData): + +2010-06-19 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Simon Hausmann. + + Bridge documentation: some snippets have the wrong indentation + https://bugs.webkit.org/show_bug.cgi?id=40717 + + Fixed code snippets + + * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp: + (wrapInFunction): + +2010-06-02 Robert Hogan <robert@webkit.org> + + Reviewed by Adam Barth. + + [Qt] Support evaluateScriptInIsolatedWorld() + + https://bugs.webkit.org/show_bug.cgi?id=40079 + + * Api/headers.pri: + * Api/qwebframe.cpp: + (QWebFrame::evaluateScriptInIsolatedWorld): + * Api/qwebframe.h: + * Api/qwebscriptworld.cpp: Added. + (QWebScriptWorld::QWebScriptWorld): + (QWebScriptWorld::world): + (QWebScriptWorld::~QWebScriptWorld): + * Api/qwebscriptworld.h: Added. + * Api/qwebscriptworld_p.h: Added. + (QWebScriptWorldPrivate::QWebScriptWorldPrivate): + (QWebScriptWorldPrivate::~QWebScriptWorldPrivate): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-06-19 Olivier Goffart <olivier.goffart@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Compilation in QWebPagePrivate::timerEvent with clang + https://bugs.webkit.org/show_bug.cgi?id=40714 + + QObject::timerEvent is protected and cannot be accessed by QWebPagePrivate + with clang + + QWebPagePrivate is a friend of QWebPage and then should have access to + all protected members of parents of QWebPage, including QObject. + But the clang team do not want to conform to this aspect of the specification + because "It is either a drafting error or a horrible mistake." + See http://llvm.org/bugs/show_bug.cgi?id=6840 + + This change is better because QWebPage does not reimplement the timerEvent + (QWebPagePrivate::timerEvent is called from QWebPage::event) + So customers that would reimplement their own timerEvent + for their own timer now get a chance to catch them. + + + * Api/qwebpage.cpp: + (QWebPagePrivate::timerEvent): + +2010-06-19 Mirko Damiani <mirko@develer.com> + + Reviewed by Simon Hausmann. + + [Qt] Avoid truncation of zoom factor in QWebFrame's print function. + https://bugs.webkit.org/show_bug.cgi?id=40662 + + The zoom factor is a qreal number but its value is truncated to an + integer. So a cast to qreal is needed to avoid this issue. + + * Api/qwebframe.cpp: + (QWebFrame::print): + +2010-06-18 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] pass plugins/open-and-close-window-with-plugin.html on Qt + + Capture logDestroy messages from the test plugin. DRT's WebPage + is already destroyed by the time they are emitted. + + https://bugs.webkit.org/show_bug.cgi?id=33333 + + Unskip: + plugins/open-and-close-window-with-plugin.html + plugins/geturlnotify-during-document-teardown.html + + * Api/qwebpage.cpp: + (QWebPage::javaScriptConsoleMessage): + +2010-06-18 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix documentation for the declarative module import. + + * declarative/qdeclarativewebview.cpp: + +2010-06-18 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + Fix documentation issue on the onAlert handler. + Fix compilation issue with QT_NO_ACTION. + + * declarative/qdeclarativewebview.cpp: + * declarative/qdeclarativewebview_p.h: + +2010-06-18 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Antti Koivisto. + + REGRESSION(r60958) [Qt] qwebpage::inputMethods auto-test fails + https://bugs.webkit.org/show_bug.cgi?id=40830 + + When activating a regular input method field, always set or unset the ImhHiddenText + input method hint. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + +2010-06-18 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Change the target path to QtWebKit. + + * declarative/declarative.pro: + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-06-17 Robert Hogan <robert@webkit.org> + + [Qt] Build fix + + Unreviewed. + + Remove includes in qdeclarativewebview*.* that rely on an installation + of QtWebKit. + + * declarative/qdeclarativewebview.cpp: + * declarative/qdeclarativewebview_p.h: + +2010-06-17 Robert Hogan <robert@webkit.org> + + Unreviewed, rolling out r61346. + http://trac.webkit.org/changeset/61346 + https://bugs.webkit.org/show_bug.cgi?id=33333 + + Broke inspector tests on Qt + + * Api/qwebpage.cpp: + (QWebPage::javaScriptConsoleMessage): + +2010-06-17 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] pass plugins/open-and-close-window-with-plugin.html on Qt + + Capture logDestroy messages from the test plugin. DRT's WebPage + is already destroyed by the time they are emitted. + + https://bugs.webkit.org/show_bug.cgi?id=33333 + + Unskip: + plugins/open-and-close-window-with-plugin.html + plugins/geturlnotify-during-document-teardown.html + + * Api/qwebpage.cpp: + (QWebPage::javaScriptConsoleMessage): + +2010-06-17 Jesus Sanchez-Palencia <jesus@webkit.org>, Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit does not support viewport meta tag + https://bugs.webkit.org/show_bug.cgi?id=39902 + + Add viewport meta tag support to QtWebKit API layer. + + This implements didReceiveViewportArguments in our ChromeClientQt + which is hooked up with QWebPage::viewportChangeRequested(). + This signal does not affect the current default behavior. + The documentation of the signal explains how to make use of this new feature. + + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + Store information about whether the page has been laid out or not. + * Api/qwebpage.cpp: + (QWebPage::viewportChangeRequested): + * Api/qwebpage_p.h: + Added class QtViewportHintsPrivate. + * Api/qwebpage.h: + (QWebPage::setPreferredContentsSize): + Improved documentation and now only layout if the page had already + passed layout phase. + Added class QWebPage::ViewportHints. + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::windowRect): + Modified to work as intended by the DOM, for both QWebView + and QGraphicsWebView. + (WebCore::ChromeClientQt::didReceiveViewportArguments): + Emits the signal QWebPage::viewportChangeRequested. + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout): + Update information about whether the page has been laid out or not. + If the page has been laid out we ignore any further viewport meta data. + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQWidget::windowRect): + (WebCore::PageClientQGraphicsWidget::windowRect): + (WebCore::PageClientQGraphicsWidget::graphicsItemVisibleRect): + * WebCoreSupport/PageClientQt.h: + The PageClient is now responsible for providing the right window rect. + +2010-06-17 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Upstream the WebKit QML integration plugin + https://bugs.webkit.org/show_bug.cgi?id=40050 + + Add to the Qt port the QML WebKit integration plugin. + QDeclarativeWebView is creating the item and expose + properties. The C++ API is not public, only the + properties are. + + * declarative/declarative.pro: Added. + * declarative/plugin.cpp: Added. + (WebKitQmlPlugin::registerTypes): + * declarative/qdeclarativewebview.cpp: Added. + (QDeclarativeWebViewPrivate::QDeclarativeWebViewPrivate): + (QDeclarativeWebViewPrivate::): + (QDeclarativeWebViewPrivate::windowObjectsAppend): + (GraphicsWebView::GraphicsWebView): + (GraphicsWebView::mousePressEvent): + (GraphicsWebView::mouseReleaseEvent): + (GraphicsWebView::mouseDoubleClickEvent): + (GraphicsWebView::timerEvent): + (GraphicsWebView::mouseMoveEvent): + (QDeclarativeWebView::QDeclarativeWebView): + (QDeclarativeWebView::~QDeclarativeWebView): + (QDeclarativeWebView::init): + (QDeclarativeWebView::componentComplete): + (QDeclarativeWebView::status): + (QDeclarativeWebView::progress): + (QDeclarativeWebView::doLoadStarted): + (QDeclarativeWebView::doLoadProgress): + (QDeclarativeWebView::pageUrlChanged): + (QDeclarativeWebView::doLoadFinished): + (QDeclarativeWebView::url): + (QDeclarativeWebView::setUrl): + (QDeclarativeWebView::preferredWidth): + (QDeclarativeWebView::setPreferredWidth): + (QDeclarativeWebView::preferredHeight): + (QDeclarativeWebView::setPreferredHeight): + (QDeclarativeWebView::evaluateJavaScript): + (QDeclarativeWebView::updateDeclarativeWebViewSize): + (QDeclarativeWebView::initialLayout): + (QDeclarativeWebView::updateContentsSize): + (QDeclarativeWebView::geometryChanged): + (QDeclarativeWebView::javaScriptWindowObjects): + (QDeclarativeWebView::qmlAttachedProperties): + (QDeclarativeWebViewPrivate::updateWindowObjects): + (QDeclarativeWebView::renderingEnabled): + (QDeclarativeWebView::setRenderingEnabled): + (QDeclarativeWebView::heuristicZoom): + (QDeclarativeWebView::pressGrabTime): + (QDeclarativeWebView::setPressGrabTime): + (QDeclarativeWebView::backAction): + (QDeclarativeWebView::forwardAction): + (QDeclarativeWebView::reloadAction): + (QDeclarativeWebView::stopAction): + (QDeclarativeWebView::title): + (QDeclarativeWebView::icon): + (QDeclarativeWebView::setStatusText): + (QDeclarativeWebView::windowObjectCleared): + (QDeclarativeWebView::statusText): + (QDeclarativeWebView::page): + (QDeclarativeWebView::settingsObject): + (QDeclarativeWebView::setPage): + (QDeclarativeWebView::load): + (QDeclarativeWebView::html): + (QDeclarativeWebView::setHtml): + (QDeclarativeWebView::setContent): + (QDeclarativeWebView::history): + (QDeclarativeWebView::settings): + (QDeclarativeWebView::createWindow): + (QDeclarativeWebView::newWindowComponent): + (QDeclarativeWebView::setNewWindowComponent): + (QDeclarativeWebView::newWindowParent): + (QDeclarativeWebView::setNewWindowParent): + (QDeclarativeWebView::contentsSize): + (QDeclarativeWebView::contentsScale): + (QDeclarativeWebView::setContentsScale): + (QDeclarativeWebView::elementAreaAt): + (QDeclarativeWebPage::QDeclarativeWebPage): + (QDeclarativeWebPage::~QDeclarativeWebPage): + (QDeclarativeWebPage::chooseFile): + (QDeclarativeWebPage::javaScriptAlert): + (QDeclarativeWebPage::javaScriptConfirm): + (QDeclarativeWebPage::javaScriptPrompt): + (QDeclarativeWebPage::viewItem): + (QDeclarativeWebPage::createWindow): + * declarative/qdeclarativewebview_p.h: Added. + (QDeclarativeWebView::): + (QDeclarativeWebView::isComponentCompletePublic): + (QDeclarativeWebViewAttached::QDeclarativeWebViewAttached): + (QDeclarativeWebViewAttached::windowObjectName): + (QDeclarativeWebViewAttached::setWindowObjectName): + (QDeclarativeWebSettings::QDeclarativeWebSettings): + (QDeclarativeWebSettings::standardFontFamily): + (QDeclarativeWebSettings::setStandardFontFamily): + (QDeclarativeWebSettings::fixedFontFamily): + (QDeclarativeWebSettings::setFixedFontFamily): + (QDeclarativeWebSettings::serifFontFamily): + (QDeclarativeWebSettings::setSerifFontFamily): + (QDeclarativeWebSettings::sansSerifFontFamily): + (QDeclarativeWebSettings::setSansSerifFontFamily): + (QDeclarativeWebSettings::cursiveFontFamily): + (QDeclarativeWebSettings::setCursiveFontFamily): + (QDeclarativeWebSettings::fantasyFontFamily): + (QDeclarativeWebSettings::setFantasyFontFamily): + (QDeclarativeWebSettings::minimumFontSize): + (QDeclarativeWebSettings::setMinimumFontSize): + (QDeclarativeWebSettings::minimumLogicalFontSize): + (QDeclarativeWebSettings::setMinimumLogicalFontSize): + (QDeclarativeWebSettings::defaultFontSize): + (QDeclarativeWebSettings::setDefaultFontSize): + (QDeclarativeWebSettings::defaultFixedFontSize): + (QDeclarativeWebSettings::setDefaultFixedFontSize): + (QDeclarativeWebSettings::autoLoadImages): + (QDeclarativeWebSettings::setAutoLoadImages): + (QDeclarativeWebSettings::javascriptEnabled): + (QDeclarativeWebSettings::setJavascriptEnabled): + (QDeclarativeWebSettings::javaEnabled): + (QDeclarativeWebSettings::setJavaEnabled): + (QDeclarativeWebSettings::pluginsEnabled): + (QDeclarativeWebSettings::setPluginsEnabled): + (QDeclarativeWebSettings::privateBrowsingEnabled): + (QDeclarativeWebSettings::setPrivateBrowsingEnabled): + (QDeclarativeWebSettings::javascriptCanOpenWindows): + (QDeclarativeWebSettings::setJavascriptCanOpenWindows): + (QDeclarativeWebSettings::javascriptCanAccessClipboard): + (QDeclarativeWebSettings::setJavascriptCanAccessClipboard): + (QDeclarativeWebSettings::developerExtrasEnabled): + (QDeclarativeWebSettings::setDeveloperExtrasEnabled): + (QDeclarativeWebSettings::linksIncludedInFocusChain): + (QDeclarativeWebSettings::setLinksIncludedInFocusChain): + (QDeclarativeWebSettings::zoomTextOnly): + (QDeclarativeWebSettings::setZoomTextOnly): + (QDeclarativeWebSettings::printElementBackgrounds): + (QDeclarativeWebSettings::setPrintElementBackgrounds): + (QDeclarativeWebSettings::offlineStorageDatabaseEnabled): + (QDeclarativeWebSettings::setOfflineStorageDatabaseEnabled): + (QDeclarativeWebSettings::offlineWebApplicationCacheEnabled): + (QDeclarativeWebSettings::setOfflineWebApplicationCacheEnabled): + (QDeclarativeWebSettings::localStorageDatabaseEnabled): + (QDeclarativeWebSettings::setLocalStorageDatabaseEnabled): + (QDeclarativeWebSettings::localContentCanAccessRemoteUrls): + (QDeclarativeWebSettings::setLocalContentCanAccessRemoteUrls): + * declarative/qmldir: Added. + * docs/qtwebkit.qdocconf: + +2010-06-17 Mark Brand <mabrand@mabrand.nl> + + Reviewed by Simon Hausmann. + + [Qt] use "win32-g++*" scope to match all MinGW makespecs + + The scope "win32-g++" comes from the name of the makespec. However, it + is frequently used to check for MinGW. This works fine as long as + win32-g++ is the only makespec for MinGW. Now we need the wildcard + to cover "win32-g++-cross" as well. + + * Api/DerivedSources.pro: + +2010-05-28 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> + + Reviewed by Simon Hausmann, Antti Koivisto + + [Qt] Add internal Qt Api to configure repaint throttling parameters. + https://bugs.webkit.org/show_bug.cgi?id=38401 + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-06-16 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix tiled backing store painting when calling QGraphicsWebView::setPage() after setResizesToContents(true) + + When calling setPage() after setResizesToContents, the value of the property wasn't propagated + to the page client. Therefore the visible rect for the tiled backing store was incorrect. + + Simply move the variable assignment into updateResizesToContentsForPage(), which is always called. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + (QGraphicsWebView::setResizesToContents): + +2010-06-16 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + Swap WebGL and SiteSpecificQuirks attributes in the QWebSettings + enum, to allow for binary compatibility with qtwebkit-2.0, where + WebGL is not in the settings but SiteSpecificQuirks will be. + + * Api/qwebsettings.h: + +2010-06-15 Darin Adler <darin@apple.com> + + Fix build. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::shouldClose): Call loader()->shouldClose(). + +2010-06-15 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Rename NotificatioIconWrapper to NotificationWrapper + https://bugs.webkit.org/show_bug.cgi?id=40571 + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationWrapper::NotificationWrapper): + (WebCore::NotificationWrapper::close): + (WebCore::NotificationWrapper::title): + (WebCore::NotificationWrapper::message): + (WebCore::NotificationWrapper::iconData): + (WebCore::NotificationWrapper::notificationClosed): + (WebCore::NotificationPresenterClientQt::displayNotification): + (WebCore::NotificationPresenterClientQt::cancel): + (WebCore::NotificationPresenterClientQt::notificationForWrapper): + * WebCoreSupport/NotificationPresenterClientQt.h: + (WebCore::NotificationWrapper::~NotificationWrapper): + +2010-06-15 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file with recent new exports. + + * symbian/eabi/QtWebKitu.def: + +2010-06-15 Yael Aharon <yael.aharon@nokia.com> + + Unreviewed. + + Fix typo in reviewer name in r61187 + +2010-06-15 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Simon Fraser. + + [Qt] Build fix for Qt minimal after r61121 + https://bugs.webkit.org/show_bug.cgi?id=40624 + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationIconWrapper::NotificationIconWrapper): + (WebCore::NotificationIconWrapper::close): + (WebCore::NotificationIconWrapper::title): + (WebCore::NotificationIconWrapper::message): + (WebCore::NotificationIconWrapper::iconData): + (WebCore::NotificationIconWrapper::notificationClosed): + * WebCoreSupport/NotificationPresenterClientQt.h: + (WebCore::NotificationIconWrapper::~NotificationIconWrapper): + +2010-06-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file with recent new exports. + + * symbian/eabi/QtWebKitu.def: + +2010-06-13 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Platform plugin support for Notifications UI + https://bugs.webkit.org/show_bug.cgi?id=40005 + + Add an interface to the platform plugin to display notifications. + Implemented the notification in the example platform plugin. + This interface is enabled by default, but could be turned off with + a build flag. The platform plugin should control its own lifecycle, + so now the close timer applies only when using the QSystemTrayIcon. + That's because QSystemTrayIcon does not inform its caller when it + is closed. + + Changed the way NotificationPresenterClientQt is deleted because it + is being accessed when GC is deleting the Notification objects. + NotificationPresenterClientQt is now detaching itself from the + Notifications before it is deleted. + + * Api/qwebkitplatformplugin.h: + (QWebNotificationPresenter::QWebNotificationPresenter): + (QWebNotificationPresenter::~QWebNotificationPresenter): + (QWebKitPlatformPlugin::): + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationIconWrapper::NotificationIconWrapper): + (WebCore::NotificationIconWrapper::title): + (WebCore::NotificationIconWrapper::message): + (WebCore::NotificationIconWrapper::iconData): + (WebCore::NotificationPresenterClientQt::~NotificationPresenterClientQt): + (WebCore::NotificationIconWrapper::notificationClosed): + (WebCore::NotificationPresenterClientQt::displayNotification): + (WebCore::NotificationPresenterClientQt::cancel): + (WebCore::NotificationPresenterClientQt::notificationForWrapper): + (WebCore::NotificationPresenterClientQt::removeReplacedNotificationFromQueue): + (WebCore::NotificationPresenterClientQt::detachNotification): + * WebCoreSupport/NotificationPresenterClientQt.h: + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createNotificationPresenter): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebNotificationPresenter.cpp: Added. + (WebNotificationWidget::WebNotificationWidget): + (WebNotificationWidget::~WebNotificationWidget): + (WebNotificationWidget::showNotification): + (WebNotificationWidget::event): + * examples/platformplugin/WebNotificationPresenter.h: Added. + (WebNotificationPresenter::WebNotificationPresenter): + (WebNotificationPresenter::~WebNotificationPresenter): + (WebNotificationPresenter::showNotification): + * examples/platformplugin/WebPlugin.cpp: + (WebPlugin::supportsExtension): + * examples/platformplugin/WebPlugin.h: + (WebPlugin::createNotificationPresenter): + * examples/platformplugin/platformplugin.pro: + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebNotificationPresenter::QWebNotificationPresenter): + (QWebNotificationPresenter::~QWebNotificationPresenter): + (QWebKitPlatformPlugin::): + +2010-06-14 Mahesh Kulkarni <mahesh.kulkarni@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] navigator.geolocation support for Qt port + https://bugs.webkit.org/show_bug.cgi?id=39724 + + Implement ChromeClientQt::requestGeolocationPermissionForFrame() which delegates call to QWebPage::allowGeolocationRequest + Layout and unit test cases for the are also added. + + * Api/qwebpage.cpp: + (QWebPage::allowGeolocationRequest): + * Api/qwebpage.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::requestGeolocationPermissionForFrame): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setMockGeolocationPosition): + (DumpRenderTreeSupportQt::setMockGeolocationError): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * tests/qwebpage/tst_qwebpage.cpp: + (JSTestPage::shouldInterruptJavaScript): + (JSTestPage::allowGeolocationRequest): + (JSTestPage::setGeolocationPermission): + (tst_QWebPage::geolocationRequestJS): + +2010-06-14 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc + data from inspected page to WebInspector as JSON string via http. The native + serialization to JSON string is supported by InspectorValue's classes. This patch + has the implementation of sendMessageToFrontend function. WebKit version of it still + uses ScriptFunctionCall and will be switched to another transport a little bit later. + https://bugs.webkit.org/show_bug.cgi?id=40134 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::InspectorClientQt): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorClientQt::releaseFrontendPage): + (WebCore::InspectorClientQt::sendMessageToFrontend): + * WebCoreSupport/InspectorClientQt.h: + +2010-06-13 Charles Wei <charles.wei@torchmobile.com.cn> + + Reviewed by George Staikos. + + Fix the QtWebKit which doesn't recognize the MIME type of HTML/TEXT in uppercase + https://bugs.webkit.org/show_bug.cgi?id=39492 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::canShowMIMEType): + +2010-06-08 Robert Hogan <robert@webkit.org> + + Reviewed by Eric Seidel. + + [Qt] Add support for callShouldCloseOnWebView() to DRT + https://bugs.webkit.org/show_bug.cgi?id=40330 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::shouldClose): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-06-12 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Kenneth Rohde Christiansen. + + Added an attribute to enable/disable site specific quirks mode in WebKit. + The attribute is enabled by default. + + https://bugs.webkit.org/show_bug.cgi?id=40073 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2010-06-12 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix tst_qwebframe regression from http://trac.webkit.org/changeset/61062 + + Only use cacheableBindingRootObject() if the object has QtOwnership. + + https://bugs.webkit.org/show_bug.cgi?id=40527 + + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): + +2010-06-13 Robert Hogan <robert@webkit.org> + + Reviewed by Alexey Proskuryakov. + + FrameLoader::clear() clears JS objects that cached pages later rely on + + https://bugs.webkit.org/show_bug.cgi?id=37725 + https://bugs.webkit.org/show_bug.cgi?id=31626 + + Fix the following tests for Qt: + + fast/events/pageshow-pagehide-on-back-cached.html + fast/events/pageshow-pagehide-on-back-cached-with-frames.html + fast/loader/input-element-page-cache-crash.html + fast/dom/Window/timer-resume-on-navigation-back.html + loader/go-back-to-different-window-size.html + fast/dom/javascript-url-crash-function.html + fast/dom/location-new-window-no-crash.html + http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-window-open.html + + which currently fail because the page's Qt-bindings runtime objects are + cleared when navigating away from the page containing them. + + Track Qt-bindings objects in a separate ScriptController::cacheableRootBindingObject(). + RuntimeObjects tracked by this root object will not get invalidated on page navigations, + so they will still be available when the pages containing them are retrieved from the + b/f cache. + + This means the Qt bindings objects will only get cleared on Frame::pageDestroyed(). + + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): + +2010-06-12 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Add documentation to the QtWebkit bridge + https://bugs.webkit.org/show_bug.cgi?id=35861 + + The previous accepted patch was actually a faulty one; It was hard to trace since it's just a documentation + change. The new patch amends that, with the correct snippets and grammar fixes. + + * docs/qtwebkit-bridge.qdoc: + * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp: + (wrapInFunction): + +2010-06-12 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Back-forward list dumping is incorrect + + https://bugs.webkit.org/show_bug.cgi?id=36392 + + Support dumping child history items in DRT. + + Unskip: + + fast/loader/frame-src-change-added-to-history.html + fast/loader/frame-src-change-not-added-to-history.html + fast/loader/frame-location-change-not-added-to-history.html + + * Api/qwebhistory.cpp: + (QWebHistoryItemPrivate::core): + * Api/qwebhistory.h: + * Api/qwebhistory_p.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::isTargetItem): + (DumpRenderTreeSupportQt::historyItemTarget): + (DumpRenderTreeSupportQt::getChildHistoryItems): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-06-11 Jesus Sanchez-Palencia <jesus@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Typo error in QWebPluginFactory Documentation + https://bugs.webkit.org/show_bug.cgi?id=40490 + + * Api/qwebpluginfactory.cpp: + +2010-06-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by nobody, build fix. + + [Qt] Second fix attempt for the build break introduced by r61002. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2010-06-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by nobody, build fix. + + [Qt] Fix build break introduced by r61002. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2010-05-31 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Implement the simple text code path. + https://bugs.webkit.org/show_bug.cgi?id=40077 + + Remove the FONT_FAST_PATH macro and use the Qt's + fast text implementation instead of the one of WebKit. + + The Qt::TextBypassShaping flag is used to tell Qt to + only use the glyph advances. + + Qt 4.7 is needed to get this flag thus the complex path is always + used if QtWebKit is compiled against an earlier version. + + Contrary to the WebKit's implementation, the complex code path + is taken if the text is RightToLeft, justified or is formatted + with non-zero letter or word spacing. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2010-06-10 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Support for loading notification icons + https://bugs.webkit.org/show_bug.cgi?id=40004 + + Take into use the icon that was loaded for the notification. + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::show): + +2010-06-10 Mahesh Kulkarni <mahesh.kulkarni@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Memory leak in qwebpage unit test cases + https://bugs.webkit.org/show_bug.cgi?id=40405 + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::infiniteLoopJS): + +2010-06-10 Raine Makelainen <raine.makelainen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Impossible to set input method hints based HTML5 input types + https://bugs.webkit.org/show_bug.cgi?id=40107 + + EditorClientQt to set input method hints for "number", "tel", + "email", and "url" HTML input elements. + + Tests for HTML input elements and input method hints added for + QGraphicsWebView and QWebView. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qgraphicswebview/resources/input_types.html: Added. + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (GraphicsWebView::GraphicsWebView): + (GraphicsWebView::fireMouseClick): + (tst_QGraphicsWebView::focusInputTypes): + * tests/qgraphicswebview/tst_qgraphicswebview.qrc: Added. + * tests/qwebview/resources/input_types.html: Added. + * tests/qwebview/tst_qwebview.cpp: + (WebView::fireMouseClick): + (tst_QWebView::focusInputTypes): + * tests/qwebview/tst_qwebview.qrc: + +2010-06-10 Eric Seidel <eric@webkit.org> + + Reviewed by Adam Barth. + + Reduce FrameView.h includes to speed up build times + https://bugs.webkit.org/show_bug.cgi?id=40408 + + * Api/qwebframe.cpp: + - Include RenderLayer.h since it's used in this file. + +2010-06-10 Andy Shaw <andy.shaw@nokia.com> + + Reviewed by Simon Hausmann. + + REGRESSION: [Qt] When dragging onto a page that handles the drag in Javascript it will be a move and not a copy by default + https://bugs.webkit.org/show_bug.cgi?id=40401 + + The correct pattern in Qt for Dnd events is to use acceptProposedAction() instead + of accept(). + + * Api/qwebpage.cpp: + (QWebPagePrivate::dragEnterEvent): + (QWebPagePrivate::dragMoveEvent): + (QWebPagePrivate::dropEvent): + +2010-06-09 Pierre Rossi <pierre.rossi@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + QWebPage::findText() does not clear selection when passed empty string + https://bugs.webkit.org/show_bug.cgi?id=31779 + + * Api/qwebpage.cpp: + (QWebPage::findText): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::findText): + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] PageClientQt.h has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40257 + + * WebCoreSupport/PageClientQt.h: + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] InspectorClientQt.cpp has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40255 + + * WebCoreSupport/InspectorClientQt.cpp: + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] FrameLoaderClientQt.h has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40251 + + * WebCoreSupport/FrameLoaderClientQt.h: + (WebCore::FrameLoaderClientQt::dispatchWillSendSubmitEvent): + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] EditorClientQt.h has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40249 + + * WebCoreSupport/EditorClientQt.h: + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] EditCommandQt.cpp/h have coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40248 + + * WebCoreSupport/EditCommandQt.cpp: + (EditCommandQt::EditCommandQt): + (EditCommandQt::~EditCommandQt): + (EditCommandQt::redo): + (EditCommandQt::undo): + * WebCoreSupport/EditCommandQt.h: + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] DumpRenderTreeSupportQt.cpp has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40247 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::firstRectForCharacterRange): + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] DragClientQt.cpp has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40246 + + * WebCoreSupport/DragClientQt.cpp: + (WebCore::DragClientQt::startDrag): + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by Laszlo Gombos. + + [Qt] ContextMenuClientQt.h has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40242 + + * WebCoreSupport/ContextMenuClientQt.h: + +2010-06-09 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] ChromeClientQt.cpp has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40240 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::pageRect): + (WebCore::ChromeClientQt::createWindow): + (WebCore::ChromeClientQt::runJavaScriptAlert): + (WebCore::ChromeClientQt::runJavaScriptConfirm): + (WebCore::ChromeClientQt::runJavaScriptPrompt): + (WebCore::ChromeClientQt::print): + (WebCore::ChromeClientQt::attachRootGraphicsLayer): + (WebCore::ChromeClientQt::visibleRectForTiledBackingStore): + +2010-06-09 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r60889. + http://trac.webkit.org/changeset/60889 + https://bugs.webkit.org/show_bug.cgi?id=40365 + + gtk bot has some kind of memory corruption (Requested by + loislo on #webkit). + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::InspectorClientQt): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorFrontendClientQt::InspectorFrontendClientQt): + (WebCore::InspectorFrontendClientQt::closeWindow): + * WebCoreSupport/InspectorClientQt.h: + +2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc + data from inspected page to WebInspector as JSON string via http. The native + serialization to JSON string is supported by InspectorValue's classes. This patch + has the implementation of sendMessageToFrontend function. WebKit version of it still + uses ScriptFunctionCall and will be switched to another transport a little bit later. + https://bugs.webkit.org/show_bug.cgi?id=40134 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::InspectorClientQt): + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorClientQt::releaseFrontendPage): + (WebCore::InspectorClientQt::sendMessageToFrontend): + * WebCoreSupport/InspectorClientQt.h: + +2010-06-08 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Ojan Vafai and Darin Adler. + + Refactor platform dependent editing behavior code out of Settings + https://bugs.webkit.org/show_bug.cgi?id=39854 + + EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to + EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setEditingBehavior): + +2010-06-07 Anders Bakken <agbakken@gmail.com> + + Reviewed by David Levin. + + [Qt] NotificationPresenterClientQt.cpp has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40256 + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::show): + +2010-06-06 Antonio Gomes <tonikitoo@webkit.org>, Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Christiansen, Eric Seidel. + + [Qt] Expose the editing behavior setting in DRT to test all editing code paths + https://bugs.webkit.org/show_bug.cgi?id=39680 + + Make setEditingBehavior() a no-operation if the editingBehavior + argument is not recognized to avoid using an uninitialized variable. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setEditingBehavior): + +2010-06-04 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Symbian build fix. + + [Qt] Updated the def file with recent new exports. + + * symbian/eabi/QtWebKitu.def: + +2010-06-03 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Don't send notifications event after the page was navigated away + https://bugs.webkit.org/show_bug.cgi?id=40127 + + Added a check before sending events to the notification and before logging. + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::cancel): + (WebCore::NotificationPresenterClientQt::sendEvent): + +2010-06-02 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Shinichiro Hamaji. + + [Qt] Fix compilation with QT_NO_PROPERTIES + https://bugs.webkit.org/show_bug.cgi?id=38324 + + * Api/qwebpage.cpp: + (QWebPage::event): + * Api/qwebpage_p.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::openInspectorFrontend): + +2010-06-02 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Simon Hausmann. + + [Qt] Shared platform plugin + https://bugs.webkit.org/show_bug.cgi?id=39968 + + Allow several instances of class QtPlatformPlugin to share the QWebKitPlatformPlugin + object provided by a plugin. + + Updated plugin interface version number due to ABI breaking change. + + * Api/qwebkitplatformplugin.h: + (QWebKitPlatformPlugin::~QWebKitPlatformPlugin): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::load): + (WebCore::QtPlatformPlugin::~QtPlatformPlugin): + (WebCore::QtPlatformPlugin::plugin): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebKitPlatformPlugin::~QWebKitPlatformPlugin): + +2010-06-02 Raine Makelainen <raine.makelainen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] On Maemo6 platform auto upper case and predictive text input method hints are not disabled for password field. + https://bugs.webkit.org/show_bug.cgi?id=40062 + + Introducing Q_WS_MAEMO_6 for Maemo6 specific code. Enabling code that sets input + method hints Qt::ImhNoAutoUppercase and Qt::ImhNoPredictiveText true for Maemo6. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + +2010-06-01 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix the lifecycle of notification objects + https://bugs.webkit.org/show_bug.cgi?id=40003 + + Notification objects are not tightly related to the page that created them, + and should be decoupled from the page. + Create one NotificationPresenter that handles all notifications. + Add ref/deref to the notification objects when they are added/removed from + the queue of active notifications. The same technique is used for XMLHttpRequest. + Instead of deleting all notifications associated with a page when the page is navigated, + delete them on a timer, using the same timeout that QSystemTrayIcon is using. + Break up the show() method into smaller methods. + Use OwnPtr instead of raw pointer for QSystemTrayIcon. + Move creating the QIcon to just before showing it in the QSyetemTrayIcon. + + No new tests as this is just a refactoring. Existing notifications test cover the code. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::~QWebPagePrivate): + * Api/qwebpage_p.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::notificationPresenter): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setNotificationsReceiver): + (DumpRenderTreeSupportQt::allowNotificationForOrigin): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld): + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationPresenterClientQt::notificationPresenter): + (WebCore::NotificationIconWrapper::NotificationIconWrapper): + (WebCore::NotificationIconWrapper::~NotificationIconWrapper): + (WebCore::NotificationIconWrapper::close): + (WebCore::NotificationPresenterClientQt::NotificationPresenterClientQt): + (WebCore::NotificationPresenterClientQt::removeClient): + (WebCore::NotificationPresenterClientQt::show): + (WebCore::NotificationPresenterClientQt::displayNotification): + (WebCore::NotificationPresenterClientQt::cancel): + (WebCore::NotificationPresenterClientQt::notificationObjectDestroyed): + (WebCore::NotificationPresenterClientQt::requestPermission): + (WebCore::NotificationPresenterClientQt::sendEvent): + (WebCore::NotificationPresenterClientQt::removeReplacedNotificationFromQueue): + (WebCore::NotificationPresenterClientQt::dumpReplacedIdText): + (WebCore::NotificationPresenterClientQt::dumpShowText): + * WebCoreSupport/NotificationPresenterClientQt.h: + (WebCore::NotificationPresenterClientQt::addClient): + +2010-06-01 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Add documentation to the QtWebkit bridge + https://bugs.webkit.org/show_bug.cgi?id=35861 + + This patch includes comprehensive qdoc documentation for the QtWebkit bridge. + + * docs/qtwebkit-bridge.qdoc: Added. + * docs/qtwebkit.qdoc: + * docs/webkitsnippets/doc_src_qtscript.qdoc: Added. + * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp: Added. + (wrapInFunction): + +2010-06-01 Raine Makelainen <raine.makelainen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt]: REGRESSION(r58703): QWebSettings::JavascriptCanAccessClipboard has wrong case in "Javascript" part. + https://bugs.webkit.org/show_bug.cgi?id=39878 + + QWebSettings::JavaScriptCanAccessClipboard reverted back to + QWebSettings::JavascriptCanAccessClipboard. QWebSettings::DOMPasteAllowed enum removed. + + Value of QWebSettings::JavascriptCanAccessClipboard to setDOMPasteAllowed and + setJavaScriptCanAccessClipboard of WebCore::Settings. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-06-01 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Rename versioning .pri file to what Qt's mkspecs/features/qt.pri expects. + + * qt_webkit_version.pri: Renamed from WebKit/qt/qtwebkit_version.pri. + +2010-05-31 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + Change enum EAlteration from { MOVE, EXTEND } to { AlterationMove, AlterationExtend } and enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT} to { DirectionForward, DirectionBackward, DirectionRight, DirectionLeft } to avoid macro conflict, and also better coding style conformance. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-05-31 Oswald Buddenhagen <oswald.buddenhagen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Escape backslashes in the .pro files + + qmake in Qt 4.7 warns about unescaped backspaces and deprecates them. + + * Api/DerivedSources.pro: + * docs/docs.pri: + +2010-05-30 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + This is a coding style cleanup before fixing to bug 35530. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::registerCommandForUndo): + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-05-29 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Kenneth Rohde Christiansen. + + Added a WebAction to stop all pending page refresh/redirect + requests set through the <meta http-equiv="refresh"...> tag. + + https://bugs.webkit.org/show_bug.cgi?id=29899 + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): + * Api/qwebpage.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::testStopScheduledPageRefresh): + +2010-05-28 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + Add a missing #if ENABLE(), some null checking. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-05-28 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=39874 + [Qt] Make tiled backing store more configurable + + Make tile size, tile creation delay and tiling area dynamically configurable. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-05-28 Yael Aharon <yael.aharon@nokia.com> + + Unreviewed build fix after r60348. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setNotificationsReceiver): + +2010-05-28 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Pass all web notification layout tests + https://bugs.webkit.org/show_bug.cgi?id=39146 + + Add support for multiple simultaneous notifications. + Add a private callback mechanism to the client for security checks. + Notifications are disabled if the client does not set the callbacks. + Support replaceId and cancel. + Send close and display events when needed. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setNotificationsReceiver): + (DumpRenderTreeSupportQt::allowNotificationForOrigin): + (DumpRenderTreeSupportQt::setCheckPermissionFunction): + (DumpRenderTreeSupportQt::setRequestPermissionFunction): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld): + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (NotificationIconWrapper::NotificationIconWrapper): + (NotificationIconWrapper::~NotificationIconWrapper): + (NotificationPresenterClientQt::NotificationPresenterClientQt): + (NotificationPresenterClientQt::show): + (NotificationPresenterClientQt::cancel): + (NotificationPresenterClientQt::notificationObjectDestroyed): + (NotificationPresenterClientQt::requestPermission): + (NotificationPresenterClientQt::checkPermission): + (NotificationPresenterClientQt::allowNotificationForOrigin): + (NotificationPresenterClientQt::clearNotificationsList): + (NotificationPresenterClientQt::sendEvent): + * WebCoreSupport/NotificationPresenterClientQt.h: + (WebCore::NotificationPresenterClientQt::~NotificationPresenterClientQt): + (WebCore::NotificationPresenterClientQt::setReceiver): + +2010-05-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Platform plugin example + https://bugs.webkit.org/show_bug.cgi?id=39489 + + Adding a Qt platform plugin example to repository. + + * examples/platformplugin/README: Added. + * examples/platformplugin/WebPlugin.cpp: Added. + (Popup::populateList): + (Popup::onItemSelected): + (WebPopup::WebPopup): + (WebPopup::~WebPopup): + (WebPopup::createSingleSelectionPopup): + (WebPopup::createMultipleSelectionPopup): + (WebPopup::createPopup): + (WebPopup::show): + (WebPopup::hide): + (WebPopup::popupClosed): + (WebPopup::itemClicked): + (SingleSelectionPopup::SingleSelectionPopup): + (MultipleItemListDelegate::MultipleItemListDelegate): + (MultipleItemListDelegate::paint): + (MultipleSelectionPopup::MultipleSelectionPopup): + (WebPlugin::supportsExtension): + * examples/platformplugin/WebPlugin.h: Added. + (Popup::Popup): + (WebPlugin::createSelectInputMethod): + * examples/platformplugin/platformplugin.pro: Added. + * examples/platformplugin/qwebkitplatformplugin.h: Copied from WebKit/qt/Api/qwebkitplatformplugin.h. + (QWebSelectData::~QWebSelectData): + (QWebSelectData::): + (QWebSelectMethod::~QWebSelectMethod): + (QWebKitPlatformPlugin::~QWebKitPlatformPlugin): + (QWebKitPlatformPlugin::): + +2010-05-25 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Ojan Vafai. + + [Qt] Expose the editing behavior setting in DRT to test all editing code paths + https://bugs.webkit.org/show_bug.cgi?id=39680 + + Add support to Qt's DRT to setting the editing behavior. Patch is a follow up of + bug 38603, which just stubbed out the Qt bits of it. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: Implementation of editing behavior control. + (DumpRenderTreeSupportQt::setEditingBehavior): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-05-24 Robert Hogan <robert@webkit.org> + + Reviewed by Laszlo Gombos. + + [Qt] DRT Support for removeOriginAccessWhitelistEntry + + Unskips http/tests/xmlhttprequest/origin-whitelisting-removal.html + + [Qt] DRT Support for removeOriginAccessWhitelistEntry + https://bugs.webkit.org/show_bug.cgi?id=39565 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * Api/qwebframe.cpp: + (QWebFrame::setTextSizeMultiplier): Call functions on FrameView. + (QWebFrame::textSizeMultiplier): Ditto. + (QWebFrame::setZoomFactor): Ditto. + (QWebFrame::zoomFactor): Ditto. + * Api/qwebpage.cpp: + (QWebPage::setContentEditable): Removed call to empty function, + removeEditingStyleFromBodyElement. + +2010-05-23 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] GraphicsLayer: The rocket animation doesn't scroll together with the page + https://bugs.webkit.org/show_bug.cgi?id=39517 + + A previous fix to this issue was overridden by the PageClientQt refactor. Reapplying. + + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::update): + +2010-05-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Update the Symbian version for the user agent + https://bugs.webkit.org/show_bug.cgi?id=38389 + + Fixes a regression introduced by r58648. Ensure that the "Symbian" string + is only listed one time in the User Agent string. + + In addition make an effort to align the User Agent string to already + released WebKit based products for Symbian. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2010-05-21 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Add DeviceOrientation and DeviceOrientationClient + https://bugs.webkit.org/show_bug.cgi?id=39479 + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2010-05-21 Simon Hausmann <simon.hausmann@nokia.com> + + Symbian build fix. + + [Qt] Updated the wins def file with one new export. + + The DRT symbols are still missing, but I can't build DRT ;( + + * symbian/bwins/QtWebKitu.def: + +2010-05-20 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] WINSCW compile fix for qwebframe test + https://bugs.webkit.org/show_bug.cgi?id=38722 + + WINSCW cannot determine template type up the hierarchy + to common base class. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-05-20 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Remove unused "old style" private APIs + + These symbols were introduced after QtWebKit v4.6 + so no-one should be using them + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + +2010-05-20 Rajiv Ramanasankaran <rajiv.ramanasankaran@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] QWebPage::inputMethodQuery() returns wrong values for Qt::ImCursorPosition, Qt::ImAnchorPosition + https://bugs.webkit.org/show_bug.cgi?id=38779 + + The earlier implementation was written with the assumption that in this scenario the + anchor position always corresponds to the START index and that the current cursor position + always corresponds to the END index in WebKit. + + Updated the implementation of QWebPage::inputMethodQuery(Qt::ImCursorPosition) and + QWebPage::inputMethodQuery(Qt::ImAnchorPosition) for the case where the Editor is not in + composition mode. In the non-composition mode, the Anchor and the Current cursor positions + correspond to the Base and Extent position offsets in WebKit. + + Also added the auto-tests for the RIGHT to LEFT and LEFT to RIGHT selections. + + * Api/qwebpage.cpp: + (QWebPage::inputMethodQuery): Now returning correct values for Qt::ImCursorPosition and + Qt::ImAnchorPosition when the Editor is not in composition mode. + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): Added auto-tests for RIGHT to LEFT and LEFT to RIGHT selections + +2010-05-20 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Skipping popup focus test for maemo + https://bugs.webkit.org/show_bug.cgi?id=39314 + + Skipping popup focus test for maemo in qwebframe auto test. + + The test method tst_QWebFrame::popupFocus() was testing popup focus AND input + field focus. The input field focus has been removed from the method popupFocus() + and a new test method named inputFieldFocus() has been added. Finally the test + method popupFocus() has been skipped for maemo. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-05-19 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Crash fix in the HistoryController. + + The problem was casued by a documented feature of the QWebFrame::setHtml(). + The method doesn't affect a browsing history (doesn't create a HistoryItem instance), so + m_currentItem and m_previousItem are not set. + + A null check was added. + + [Qt] The QWebPage crashes on history.pushState(). + https://bugs.webkit.org/show_bug.cgi?id=38840 + + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::popPushState_data): + (tst_QWebHistory::popPushState): + +2010-05-19 Antti Koivisto <koivisto@iki.fi> + + Rubber-stamped by Kenneth Rohde Christiansen. + + [Qt] TiledBackingStore updates broken when not using resizesToContents mode + https://bugs.webkit.org/show_bug.cgi?id=39359 + + Put the back logic that was lost in refactoring. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::visibleRectForTiledBackingStore): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::graphicsItemVisibleRect): + * WebCoreSupport/PageClientQt.h: + (WebCore::PageClientQWidget::viewResizesToContentsEnabled): + (WebCore::PageClientQGraphicsWidget::viewResizesToContentsEnabled): + +2010-05-19 Simon Hausmann <simon.hausmann@nokia.com> + + Symbian build fix. + + [Qt] Updated the def file with exports needed for DumpRenderTree. + + * symbian/eabi/QtWebKitu.def: + +2010-05-19 Denis Dzyubenko <denis.dzyubenko@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + When creating the UA, do not sassmue the language code is a + two-letter iso639-1 code. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2010-05-18 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Move visible rect calculation from QGraphicsWebViewPrivate to PageClientQGraphicsWidget + https://bugs.webkit.org/show_bug.cgi?id=39294 + + * Api/qgraphicswebview.cpp: + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::graphicsItemVisibleRect): + * WebCoreSupport/PageClientQt.h: + +2010-05-18 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Symbian build fix. + + [Qt] Updated the def file with new exports after r59335. + + * symbian/eabi/QtWebKitu.def: + +2010-05-18 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + Fix QWebHistory serialization. + + Regression was caused by bug 33224. The streaming function + should generate a documentSequenceNumber for all loaded values. + + [Qt] tst_QWebHistory::serialize_2() fails + https://bugs.webkit.org/show_bug.cgi?id=37322 + + * Api/qwebhistory.cpp: + (operator>>): + +2010-05-17 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix compilation with QT_NO_COMBOBOX + https://bugs.webkit.org/show_bug.cgi?id=38324 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + * WebCoreSupport/QtFallbackWebPopup.cpp: + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-05-17 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=39218 + [Qt] Tiled backing store tiles sometimes flicker when exiting a zoom animation + + Tiles sometimes flicker when exiting a zoom animation. This happens as a result + of the visible rectangle being momentarily out of sync. + + Instead of updating the visible rect by explicitly setting it, pull it through + the client and recompute in WebKit the level. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::paint): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::visibleRectForTiledBackingStore): + * WebCoreSupport/ChromeClientQt.h: + +2010-05-16 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Unskip fast/loader/main-document-url-for-non-http-loads.html + + Fix FrameLoaderClientQt.cpp to print relative filename paths correctly. + + Move qt_* functions in FrameLoaderClientQt, EditorClientQt, and NotificationPresenterClientQt + to DumpRenderTreeSupportQt. Create new functions to replace them in DumpRenderTreeSupportQt. + Support for the old function names is retained until confirmed that no one uses them outside + QtWebKit. + + https://bugs.webkit.org/show_bug.cgi?id=38867 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::dumpFrameLoader): + (DumpRenderTreeSupportQt::dumpResourceLoadCallbacks): + (DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath): + (DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect): + (DumpRenderTreeSupportQt::setWillSendRequestReturnsNull): + (DumpRenderTreeSupportQt::setWillSendRequestClearHeaders): + (DumpRenderTreeSupportQt::dumpEditingCallbacks): + (DumpRenderTreeSupportQt::dumpSetAcceptsEditing): + (DumpRenderTreeSupportQt::dumpNotification): + (qt_dump_frame_loader): + (qt_dump_resource_load_callbacks): + (qt_dump_resource_load_callbacks_path): + (qt_set_will_send_request_returns_null_on_redirect): + (qt_set_will_send_request_returns_null): + (qt_set_will_send_request_clear_headers): + (qt_dump_editing_callbacks): + (qt_dump_set_accepts_editing): + (qt_dump_notification): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/EditorClientQt.cpp: + * WebCoreSupport/EditorClientQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (drtDescriptionSuitableForTestResult): + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/NotificationPresenterClientQt.cpp: + * WebCoreSupport/NotificationPresenterClientQt.h: + +2010-05-16 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt]Unskip security/set-form-autocomplete-attribute.html + + Add support for layoutTestController.elementDoesAutoCompleteForElementWithId(). + + https://bugs.webkit.org/show_bug.cgi?id=38859 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-05-16 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Prospective Qt/Mac build fix. + + The friend declaration of QGraphicsWidget confuses gcc and thinks that it's an implicit + forward declaration, moving the class into the WebCore namespace (WebCore::QGraphicsWidget). + + The declaration seems useless as no method of QGraphicsWidget is going to call anything + in this class. + + * WebCoreSupport/PageClientQt.h: + +2010-05-15 Charles Wei <charles.wei@torchmobile.com.cn> + + Reviewed by Simon Hausmann. + + This patch fixes the build failure of WebKit on Linux for Qt4.5 + https://bugs.webkig.org/show_bug.cgi?id=39108 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::syncLayers): + * WebCoreSupport/QtPlatformPlugin.cpp: + +2010-05-14 Kent Hansen <kent.hansen@nokia.com>, Jocelyn Turcotte <jocelyn.turcotte@nokia.com>, Tor Arne Vestbø <tor.arne.vestbo@nokia.com>, Henry Haverinen <henry.haverinen@nokia.com>, Jedrzej Nowacki <jedrzej.nowacki@nokia.com>, Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Merge overhaul of the QtWebKit API documentation + + Numerous improvements in wording, qdoc warning fixes and + clarifications, done in a team work effort. + + No functional changes. + + * Api/qwebdatabase.cpp: + * Api/qwebelement.cpp: + * Api/qwebframe.cpp: + * Api/qwebhistoryinterface.cpp: + * Api/qwebinspector.cpp: + * Api/qwebkitversion.cpp: + * Api/qwebpage.cpp: + * Api/qwebpluginfactory.cpp: + * Api/qwebsecurityorigin.cpp: + * Api/qwebsettings.cpp: + * Api/qwebsettings.h: + * docs/qtwebkit.qdoc: + * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: + (wrapInFunction): + * docs/webkitsnippets/webelement/main.cpp: + (findButtonAndClick): + (autocomplete1): + (autocomplete2): + (main): + +2010-05-14 Martin Smith <msmith@trolltech.com> + + Reviewed by Simon Hausmann. + + Documentation: Fix overview grouping. + + * docs/qtwebkit.qdoc: + +2010-05-14 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Laszlo Gombos. + + [QT] Update the Symbian version for the user agent + https://bugs.webkit.org/show_bug.cgi?id=38389 + + Update the user agent for Symbian^2 to Symbian^4 + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2010-05-14 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Simon Hausmann. + + Implemented createJavaAppletWidget to activate Java applet support. + + https://bugs.webkit.org/show_bug.cgi?id=33044 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createJavaAppletWidget): + +2010-05-13 Simon Hausmann <hausmann@webkit.org> + + Symbian build fix. + + [Qt] Updated the def file with new exports. + + * symbian/eabi/QtWebKitu.def: Add missing gc symbol for QtLauncher + +2010-05-13 Simon Hausmann <simon.hausmann@nokia.com> + + Symbian build fix. + + [Qt] Updated the def file with new exports. + + * symbian/eabi/QtWebKitu.def: + +2010-05-11 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] tst_QWebPage::inputMethods failing on Maemo5 + https://bugs.webkit.org/show_bug.cgi?id=38685 + + Check if the SIP (Software Input Panel) is triggered, which normally + happens on mobile platforms, when a user input form receives a mouse click. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-05-11 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Laszlo Gombos. + + [Qt] REGRESSION(r58497) tst_QGraphicsWebView::crashOnViewlessWebPages() is failing + https://bugs.webkit.org/show_bug.cgi?id=38655 + + Fix double free by moving the connect till after the resize. + + The bug is causes by the fact that a resize of an empty page causes a + layout, thus deleting the qgraphicswebview before setHtml is called, + which then deletes it again, causing a double free. + + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::crashOnViewlessWebPages): + +2010-05-12 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Laszlo Gombos. + + [Qt] Regression(r59152): QGraphicsPageClient is not forwarding scroll and update events to view + https://bugs.webkit.org/show_bug.cgi?id=39016 + + Some forward calls got lost during the refatory. + + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::scroll): + (WebCore::PageClientQGraphicsWidget::update): + +2010-05-13 Antonio Gomes <tonikitoo@webkit.org>, Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Kenneth Christiansen. + + [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo + https://bugs.webkit.org/show_bug.cgi?id=37759 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::markerTextForListItem): + (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-05-12 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Nested overflow div does not scroll + https://bugs.webkit.org/show_bug.cgi?id=38641 + + Modify qtwebkit_webframe_scrollOverflow, if the current node's render layer + does not scroll it will try and scroll the parent's render layer. Also export + qtwebkit_webframe_scrollOverflow so we can use it independently of + qtwebkit_webframe_scrollRecursively + + * Api/qwebframe.cpp: + (qtwebkit_webframe_scrollOverflow): + (qtwebkit_webframe_scrollRecursively): + +2010-05-12 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Kenneth Christiansen. + + [Qt] Remove the unneeded check for QWidgetPageClient @QGraphicsWebView::detachCurrentPage + https://bugs.webkit.org/show_bug.cgi?id=38989 + + Reasons: + - There is no need to check for a QWidgetPageClient-based in QGraphicsWebView. + - The client has always to be deleted anyways. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::detachPage): + +2010-05-12 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Laszlo Gombos. + + Add a comment to explain the web inspector dynamic property url hook + and that it's there on purpose :) + + https://bugs.webkit.org/show_bug.cgi?id=35340 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::openInspectorFrontend): + +2010-05-11 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Kenneth Christiansen. + + [Qt] Implement a detachCurrentPage method for QGraphicsWebView and QWebView + https://bugs.webkit.org/show_bug.cgi?id=38939 + + unsetPageIfExists method was renamed to detachCurrentPage method and is now responsible + for doing all the unset logic of page and pageClient references previously done by + the Q{Graphics}WebView destructor(s). + + It is a code clean up, no behaviour change. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): + (QGraphicsWebView::~QGraphicsWebView): + (QGraphicsWebViewPrivate::detachCurrentPage): + (QGraphicsWebView::setPage): + * Api/qwebview.cpp: + (QWebViewPrivate::~QWebViewPrivate): + (QWebView::~QWebView): + (QWebViewPrivate::detachCurrentPage): + (QWebView::setPage): + +2010-05-11 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Kenneth Christiansen. + + [Qt] emit initialLayoutCompleted signal from FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout + https://bugs.webkit.org/show_bug.cgi?id=38921 + + Emit initialLayoutCompleted signal from FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout + instead of FrameLoaderClientQt::dispatchDidFirstLayout , because the former ensures that a + visual content layed out on the frame. + + It matches to QWebFrame::initialLayoutCompleted signal documentation at: + + "... This is the first time you will see contents displayed on the frame ..." + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout): + (WebCore::FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout): + +2010-05-11 Jesus Sanchez-Palencia <jesus@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + Add PageClientQGraphicsWidget specific implementation. + QGraphicsWebViewPrivate doesn't inherit QWebPageClient anymore + and the needed functions were moved to this new PageClient class, + including Tiling and Accelerated Composite specific ones. + + [Qt] PageClientQt specific implementation for QGraphicsWidget + https://bugs.webkit.org/show_bug.cgi?id=37866 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::syncLayers): + (QGraphicsWebViewPrivate::_q_scaleChanged): + (QGraphicsWebView::event): + (QGraphicsWebView::setPage): + (QGraphicsWebView::updateGeometry): + (QGraphicsWebView::setGeometry): + (QGraphicsWebView::setResizesToContents): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::~PageClientQGraphicsWidget): + (WebCore::PageClientQGraphicsWidget::scroll): + (WebCore::PageClientQGraphicsWidget::update): + (WebCore::PageClientQGraphicsWidget::createOrDeleteOverlay): + (WebCore::PageClientQGraphicsWidget::syncLayers): + (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer): + (WebCore::PageClientQGraphicsWidget::markForSync): + (WebCore::PageClientQGraphicsWidget::updateCompositingScrollPosition): + (WebCore::PageClientQGraphicsWidget::updateTiledBackingStoreScale): + (WebCore::PageClientQGraphicsWidget::setInputMethodEnabled): + (WebCore::PageClientQGraphicsWidget::inputMethodEnabled): + (WebCore::PageClientQGraphicsWidget::setInputMethodHint): + (WebCore::PageClientQGraphicsWidget::cursor): + (WebCore::PageClientQGraphicsWidget::updateCursor): + (WebCore::PageClientQGraphicsWidget::palette): + (WebCore::PageClientQGraphicsWidget::screenNumber): + (WebCore::PageClientQGraphicsWidget::ownerWidget): + (WebCore::PageClientQGraphicsWidget::geometryRelativeToOwnerWidget): + (WebCore::PageClientQGraphicsWidget::pluginParent): + (WebCore::PageClientQGraphicsWidget::style): + * WebCoreSupport/PageClientQt.h: + (WebCore::QGraphicsItemOverlay::page): + (WebCore::QGraphicsItemOverlay::boundingRect): + (WebCore::QGraphicsItemOverlay::paint): + (WebCore::QGraphicsItemOverlay::prepareGraphicsItemGeometryChange): + (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget): + (WebCore::PageClientQGraphicsWidget::isQWidgetClient): + (WebCore::PageClientQGraphicsWidget::allowsAcceleratedCompositing): + (WebCore::PageClientQGraphicsWidget::): + +2010-05-09 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used + https://bugs.webkit.org/show_bug.cgi?id=38574 + + The fix uses a QWeakPointer for rootGraphicsLayer, protecting from a crash in case the layer is deleted before the QGraphicsWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::setRootGraphicsLayer): + (QGraphicsWebViewPrivate::updateCompositingScrollPosition): + +2010-05-08 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Simon Hausmann. + + [Qt] Platform plugin + https://bugs.webkit.org/show_bug.cgi?id=38438 + + Select popups delegate private API. To provide select popup delegates + a plugin that implements QWebKitPlatformPlugin must be found + in QCoreApplication::libraryPaths. + + * Api/headers.pri: + * Api/qwebkitplatformplugin.h: Added. + (QWebSelectData::~QWebSelectData): + (QWebSelectData::): + (QWebSelectMethod::~QWebSelectMethod): + (QWebKitPlatformPlugin::~QWebKitPlatformPlugin): + (QWebKitPlatformPlugin::): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/QtPlatformPlugin.cpp: Added. + (WebCore::SelectData::SelectData): + (WebCore::SelectData::itemText): + (WebCore::SelectData::itemToolTip): + (WebCore::SelectData::itemIsEnabled): + (WebCore::SelectData::itemCount): + (WebCore::SelectData::itemIsSelected): + (WebCore::SelectData::multiple): + (WebCore::SelectData::itemType): + (WebCore::SelectInputMethodWrapper::SelectInputMethodWrapper): + (WebCore::SelectInputMethodWrapper::show): + (WebCore::SelectInputMethodWrapper::hide): + (WebCore::SelectInputMethodWrapper::selectItem): + (WebCore::SelectInputMethodWrapper::didHide): + (WebCore::getPluginObject): + (WebCore::QtPlatformPlugin::~QtPlatformPlugin): + (WebCore::QtPlatformPlugin::plugin): + (WebCore::QtPlatformPlugin::createSelectInputMethod): + * WebCoreSupport/QtPlatformPlugin.h: Added. + (WebCore::QtPlatformPlugin::QtPlatformPlugin): + +2010-05-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Document a limitation of QWebPage::linkClicked + https://bugs.webkit.org/show_bug.cgi?id=37694 + + * Api/qwebpage.cpp: + +2010-05-02 Simon Hausmann <hausmann@webkit.org> + + [Qt] Unreviewed, QtWebKit versioning for the trunk. + + The next version is going to be 2.1, based off the trunk. + + * Api/qwebkitglobal.h: + +2010-05-07 Simon Hausmann <simon.hausmann@nokia.com> + + Symbian build fix. + + [Qt] Updated the def file with absent exports. + + * symbian/eabi/QtWebKitu.def: + +2010-05-06 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Patch to fix compilation warnings for QGraphicsWebView + https://bugs.webkit.org/show_bug.cgi?id=37428 + + Patch by Alexis Menard <alexis.menard@nokia.com> + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::itemChange): + +2010-05-06 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Replace public inspector url with private property for QtLauncher + https://bugs.webkit.org/show_bug.cgi?id=35340 + + Replace the public API with a private dynamic property until this feature + is ready. + + * Api/qwebsettings.cpp: + * Api/qwebsettings.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::openInspectorFrontend): + * symbian/bwins/QtWebKitu.def: + * symbian/eabi/QtWebKitu.def: + +2010-05-04 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage viewMode property + https://bugs.webkit.org/show_bug.cgi?id=38119 + + Rename the property from wrt_viewMode to _q_viewMode. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::viewModes): + +2010-05-04 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + [Qt] Preserve binary compatibility with qtwebkit-2.0 branch + + Moved the WebGL attribute in QWebSettings to the end of the enum, + to ensure that the numeric values of the enum values following it + are the same as in the release branch. + + * Api/qwebsettings.h: + +2010-05-03 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Expose HTMLTokenizer yielding parameters + https://bugs.webkit.org/show_bug.cgi?id=37023 + + Enables to set TimeDelay and ChunkSize for + HTMLTokenizer. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-05-03 Abhishek Arya <inferno@chromium.org> + + Reviewed by Adam Barth. + + Add support for controlling clipboard access from javascript. + Clipboard access from javascript is disabled by default. + https://bugs.webkit.org/show_bug.cgi?id=27751 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-05-03 Jens Alfke <snej@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Add "willSendSubmitEvent" hook to WebFrameClient and FrameLoaderClient + https://bugs.webkit.org/show_bug.cgi?id=38397 + + No tests (functionality is exposed only through native WebKit API.) + + * WebCoreSupport/FrameLoaderClientQt.h: + (WebCore::FrameLoaderClientQt::dispatchWillSendSubmitEvent): + +2010-05-03 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Prune dead code in QWebPage + + * Api/qwebpage.cpp: + +2010-05-02 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix compilation with QT_NO_BEARERMANAGEMENT + https://bugs.webkit.org/show_bug.cgi?id=38324 + + * Api/qwebsettings.cpp: + +2010-04-29 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit versioning added + https://bugs.webkit.org/show_bug.cgi?id=37207 + + QtWebkit releases separated from Qt release cycle. + + * qtwebkit_version.pri: Added. + +2010-05-02 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage::userAgentForUrl is terrible API + https://bugs.webkit.org/show_bug.cgi?id=33875 + + Simplify the creation of the user agent string to avoid some + overhead for each loaded url. + + The static part of the user agent is cached so it only have + to be made once. + This creation has been made in order to simplify the code. + + The two variable: application name and current language are + set dynamically when needed. + The default locale is non longer created if the widget locale + is used. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::userAgentApplicationName): + (tst_QWebPage::userAgentLocaleChange): + +2010-05-02 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] GraphicsLayer: animation incorrect when scrolling + https://bugs.webkit.org/show_bug.cgi?id=38371 + + This is a regression introduced with the invalidate-on-scroll code path, that uses QGraphicsWebViewPrivate::update() + instead of QGraphicsWebViewPrivate::scroll(). The patch makes sure that the scrolling position is correct on + each content update - this shouldn't have a performance impact - the only overhead is an additional value-test on each update. + + Tested by http://www.the-art-of-web.com/css/css-animation/ + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::update): + +2010-05-01 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Add smart paste support + + https://bugs.webkit.org/show_bug.cgi?id=38136 + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): Enable smart paste support by default. + +2010-04-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Reinstate qt_drt_ symbol exports as of QtWebKit 4.6 release + https://bugs.webkit.org/show_bug.cgi?id=38304 + + This change provides backward compatibility with some previously + exported private symbols. No new functionality introduced. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (qt_resumeActiveDOMObjects): + (qt_suspendActiveDOMObjects): + (qt_drt_clearFrameName): + (qt_drt_garbageCollector_collect): + (qt_drt_garbageCollector_collectOnAlternateThread): + (qt_drt_javaScriptObjectsCount): + (qt_drt_numberOfActiveAnimations): + (qt_drt_overwritePluginDirectories): + (qt_drt_pauseAnimation): + (qt_drt_pauseTransitionOfProperty): + (qt_drt_resetOriginAccessWhiteLists): + (qt_drt_run): + (qt_drt_setJavaScriptProfilingEnabled): + (qt_drt_whiteListAccessFromOrigin): + (qt_webpage_groupName): + (qt_webpage_setGroupName): + +2010-04-29 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Get rid of forceLayout() on FrameView + https://bugs.webkit.org/show_bug.cgi?id=38199 + + The function FrameView::forceLayout() is missleading + because it does not actually force the layout, the call is + equivalent to layout(). + + This patch replace the call to forceLayout() by layout() in Qt + to avoid the misunderstanding/improve readability. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + (QWebPage::setPreferredContentsSize): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setMediaType): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::forceLayout): + +2010-04-29 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + Remove unnecessary call to FrameView::forceLayout() in setViewportSize() + This prevents a double relayout on resize. + + https://bugs.webkit.org/show_bug.cgi?id=38179 + + Thanks to Nate Whetsell <nathan.whetsell@gmail.com> for spotting this. + + * Api/qwebpage.cpp: + (QWebPage::setViewportSize): + +2010-04-29 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] REGRESSION(r57982): tst_qwebpage::showModalDialog() crashes + https://bugs.webkit.org/show_bug.cgi?id=38314 + + Make sure that there's always a main frame when returning from createWindow() + to the caller in WebCore. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createWindow): + +2010-04-28 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Qt build fix. + + [Qt] Guard the body of the function instead of the function for + exported functions. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::webInspectorExecuteScript): + (DumpRenderTreeSupportQt::webInspectorClose): + (DumpRenderTreeSupportQt::webInspectorShow): + (DumpRenderTreeSupportQt::setTimelineProfilingEnabled): + +2010-04-28 Antonio Gomes <tonikitoo@webkit.org>, Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] tst_QWebHistoryInterface::visitedLinks() fails + https://bugs.webkit.org/show_bug.cgi?id=37323 + + Patch fixes styleProperty method of QWebElement to make use of + CSSComputedStyleDeclaration::computedStyle 'allowVisitedStyle' parameter + and the corresponding failing QWebHistoryInterface::visitedLinks method. + + * Api/qwebelement.cpp: + (QWebElement::styleProperty): + * tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp: + (tst_QWebHistoryInterface::visitedLinks): + +2010-04-28 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage viewMode property + https://bugs.webkit.org/show_bug.cgi?id=38119 + + Replacing method qt_wrt_setViewMode by wrt_viewMode property. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::wrt_viewModes): + +2010-04-28 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] WINS DEF file freeze + + Updated WINSCW def file with added and removed symbols. + + * symbian/bwins/QtWebKitu.def: + +2010-04-25 Sam Weinig <sam@webkit.org> + + Reviewed by Maciej Stachowiak. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=38097 + Disentangle initializing the main thread from initializing threading + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): Add call to initializeMainThread. + +2010-04-26 Thiago Macieira <thiago.macieira@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix the include header <qstring.h> -> <QtCore/qstring.h> + + The module/header.h style inclusion removes the need to have -I$QTDIR/include/depending-module + in the include search path for the application. + + * Api/qwebkitversion.h: + +2010-04-26 Bruno Schmidt <bruno.schmidt@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Exposing an QVariantMap containing QObjectStar to Javascript + causes Segmentation Fault + https://bugs.webkit.org/show_bug.cgi?id=34729 + + If an QVariantMap containing QObjectStar is added to the to QtWebkit + Javascript, it's use causes Segmentation Fault. + It happens because, in the case QMetaType::QVariantMap, the "root" + object that is inside of a PassRefPtr is passed recursively inside a + loop to recover the content of the map, but the PassRefPtr semantics + prohibit its use inside a loop, so the "root" object mus be passed + using the method "PassRefPtr::get" in order to keep the current + reference. + + * tests/qwebframe/tst_qwebframe.cpp: + (MyQObject::MyQObject): new property variantMapProperty + (MyQObject::variantMapProperty): read variantMapProperty + (MyQObject::setVariantMapProperty): write variantMapProperty + +2010-04-25 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Simon Hausmann. + + [Qt] layoutTestController.counterValueForElementById crashes for a nonexistent ID + https://bugs.webkit.org/show_bug.cgi?id=34573 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::counterValueForElementById): + +2010-04-20 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Add more support for textInputController + + Add support for selectedRange(), setMarkedText(), insertText(), + and firstRectForCharacterRange(). + + https://bugs.webkit.org/show_bug.cgi?id=35702 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::selectedRange): + (DumpRenderTreeSupportQt::firstRectForCharacterRange): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-04-22 John Pavan <john.pavan@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] inputMethodQuery returns coordinates in web page coordinates rather than in item coordinates. + https://bugs.webkit.org/show_bug.cgi?id=37163 + + + QWebPage::inputMethodQuery is modified so that it + returns coordinates in the widget's coordinate system. + Tests are added for QGraphicsWebView and QWebView + to verify that this behavior is correct after the webpage + has been scrolled. + + * Api/qwebpage.cpp: + (QWebPage::inputMethodQuery): + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::microFocusCoordinates): + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::microFocusCoordinates): + +2010-04-22 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Fix createPlugin() tests in tst_qwebpage to match behaviour of Qt plugins + when PluginsEnabled is false. + + tst_qwebpage should have been updated as part of r56662. + (See https://bugs.webkit.org/show_bug.cgi?id=32196) + + Updated documentation of QWebPage::createPlugin and QWebSetting::pluginsEnabled + to match the new behaviour. + + * Api/qwebpage.cpp: Update docs. + * Api/qwebsettings.cpp: Update docs. + * tests/qwebpage/tst_qwebpage.cpp: + (createPlugin): + (tst_QWebPage::createPluginWithPluginsEnabled): + (tst_QWebPage::createPluginWithPluginsDisabled): + +2010-04-22 Dave Moore <davemoore@chromium.org> + + Reviewed by Dimitri Glazkov. + + Added notification when the favicons for a page are changed + from a script. + The Document object will notify the frame loader, which will + notify the client. Implementations of FrameLoaderClient will + have to add one method; dispatchDidChangeIcons(). + + https://bugs.webkit.org/show_bug.cgi?id=33812 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidChangeIcons): + (WebCore::FrameLoaderClientQt::didChangeTitle): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-04-22 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove translatable strings from the hybridPixmap test. + https://bugs.webkit.org/show_bug.cgi?id=37867 + + * tests/hybridPixmap/widget.ui: + +2010-04-22 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix autotests .qrc file paths when built in Qt. + + Compiling auto-tests from qt/tests/auto/qweb* produced + failing tests since these .pro files include the + ones in WebKit/qt/tests and the .qrc file was + not added to RESOURCES + + * tests/benchmarks/loading/loading.pro: + * tests/benchmarks/painting/painting.pro: + * tests/qgraphicswebview/qgraphicswebview.pro: + * tests/qwebelement/qwebelement.pro: + * tests/qwebframe/qwebframe.pro: + * tests/qwebhistory/qwebhistory.pro: + * tests/qwebhistoryinterface/qwebhistoryinterface.pro: + * tests/qwebinspector/qwebinspector.pro: + * tests/qwebpage/qwebpage.pro: + * tests/qwebplugindatabase/qwebplugindatabase.pro: + * tests/qwebview/qwebview.pro: + * tests/tests.pri: + +2010-04-22 Adam Barth <abarth@webkit.org> + + Unreviewed, rolling out r58069. + http://trac.webkit.org/changeset/58069 + https://bugs.webkit.org/show_bug.cgi?id=27751 + + Broke compile on Windows. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-04-22 Abhishek Arya <inferno@chromium.org> + + Reviewed by Adam Barth. + + Add support for controlling clipboard access from javascript. + Clipboard access from javascript is disabled by default. + https://bugs.webkit.org/show_bug.cgi?id=27751 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-04-21 Jesus Sanchez-Palencia <jesus@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + Add PageClientQWidget implementation based on the old + QWebPageWidgetClient to PageClientQt files. Also fix + QWebPage::setView() to use PageClientQWidget. + + [Qt] PageClientQt specific implementation for QWidget + https://bugs.webkit.org/show_bug.cgi?id=37858 + + * Api/qwebpage.cpp: + (QWebPage::setView): + * WebCoreSupport/PageClientQt.cpp: Added. + (WebCore::PageClientQWidget::scroll): + (WebCore::PageClientQWidget::update): + (WebCore::PageClientQWidget::setInputMethodEnabled): + (WebCore::PageClientQWidget::inputMethodEnabled): + (WebCore::PageClientQWidget::setInputMethodHint): + (WebCore::PageClientQWidget::cursor): + (WebCore::PageClientQWidget::updateCursor): + (WebCore::PageClientQWidget::palette): + (WebCore::PageClientQWidget::screenNumber): + (WebCore::PageClientQWidget::ownerWidget): + (WebCore::PageClientQWidget::geometryRelativeToOwnerWidget): + (WebCore::PageClientQWidget::pluginParent): + (WebCore::PageClientQWidget::style): + * WebCoreSupport/PageClientQt.h: Added. + (WebCore::PageClientQWidget::PageClientQWidget): + (WebCore::PageClientQWidget::isQWidgetClient): + +2010-04-21 Jakub Wieczorek <jwieczorek@webkit.org> + + Reviewed by Darin Adler. + + List item markers are not always updated after changes in the DOM. + https://bugs.webkit.org/show_bug.cgi?id=37060 + + * Api/qwebelement.h: Make DumpRenderTreeSupportQt a friend class. + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::markerTextForListItem): Add a private API to get the marker text for a list item. + +2010-04-21 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Check the request empty or not in ChromeClientQt::createWindow() + https://bugs.webkit.org/show_bug.cgi?id=37821 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createWindow): + +2010-04-21 Shu Chang <chang.shu@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix Symbian build where QT_NO_SYSTEMTRAYICON is defined. + https://bugs.webkit.org/show_bug.cgi?id=37442 + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (NotificationPresenterClientQt::show): + * WebCoreSupport/NotificationPresenterClientQt.h: + +2010-04-21 Eric Seidel <eric@webkit.org> + + Unreviewed, rolling out r57963. + http://trac.webkit.org/changeset/57963 + https://bugs.webkit.org/show_bug.cgi?id=37759 + + Three tests started crashing on the Qt bot. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::isCommandEnabled): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-04-21 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo + https://bugs.webkit.org/show_bug.cgi?id=37759 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-04-21 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Simon Fraser. + + [Qt] Fix or remove the runtime flag for accelerated compositing. + https://bugs.webkit.org/show_bug.cgi?id=37313 + + This lets the QWebPageClient "veto" the settings value for accelerated compositing. + In this case we allow accelerated compositing only on QGraphicsWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::allowsAcceleratedCompositing): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::allowsAcceleratedCompositing): + * WebCoreSupport/ChromeClientQt.h: + +2010-04-20 Adam Barth <abarth@webkit.org> + + Unreviewed build fix. + + * Api/qwebframe.cpp: + (QWebFrame::setUrl): + +2010-04-20 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Factor DocumentWriter out of FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=37175 + + Update these callsites because the method moved to DocumentWriter. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::finishedLoading): + (WebCore::FrameLoaderClientQt::setMainDocumentError): + (WebCore::FrameLoaderClientQt::committedLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFailLoading): + +2010-04-20 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + Change a parameter type of chooseIconForFiles() + https://bugs.webkit.org/show_bug.cgi?id=37504 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::chooseIconForFiles): + * WebCoreSupport/ChromeClientQt.h: + +2010-04-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix compilation against namespaced Qt. + + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-04-18 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Add support for LayoutTestController commands: + setSmartInsertDeleteEnabled + setSelectTrailingWhitespaceEnabled + execCommand + isCommandEnabled + + https://bugs.webkit.org/show_bug.cgi?id=35844 + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * Api/qwebpage_p.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled): + (DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled): + (DumpRenderTreeSupportQt::executeCoreCommandByName): + (DumpRenderTreeSupportQt::isCommandEnabled): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::smartInsertDeleteEnabled): + (WebCore::EditorClientQt::toggleSmartInsertDelete): + (WebCore::EditorClientQt::isSelectTrailingWhitespaceEnabled): + * WebCoreSupport/EditorClientQt.h: + +2010-04-15 Kent Hansen <kent.hansen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Mark QWebFrame::overloadedSlots autotest as expected failure + + https://bugs.webkit.org/show_bug.cgi?id=37319 + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-04-09 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Kenneth Christiansen and Tor Arne Vestbø. + + REGRESSION(r56552): Broken scrollbars size + https://bugs.webkit.org/show_bug.cgi?id=36853 + + The regression was caused by r56552, which introduced a fix to bug + webkit.org/b/21300. The bug solved an issue with the resize handle on mac, + but did it in a way that affected all Qt platforms and thus broke the behavior + on non-mac platforms. + + This patch makes the mac specific change ifdef'ed and only applied for the mac + platform. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::windowResizerRect): + +2010-04-15 Bruno Schmidt <bruno.schmidt@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Null QObjects properties cause Segmentation Fault + https://bugs.webkit.org/show_bug.cgi?id=34730 + + QObjects exported to the QWebkit javascript with properties that are + a null "QObject*" cause Segmentation Fault. + + If an QObject is added to the javascript context and it contains + properties of the type QObject* with NULL value, calling the property + causes Segmentation Fault. + + Follow the tests for the corrections done over WebCore. + + * tests/qwebframe/tst_qwebframe.cpp: + (MyQObject::MyQObject): init the field m_objectStar + (MyQObject::objectStarProperty): read the Object* prop + (MyQObject::setObjectStarProperty): write the Object* prop + (tst_QWebFrame::getSetStaticProperty): new tests for the new prop + +2010-04-14 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Changing view mode names due to specification changes + https://bugs.webkit.org/show_bug.cgi?id=37615 + + test: fast/media/media-feature-wgt-view-mode.html + + specification: http://dev.w3.org/2006/waf/widgets-vmmf/ + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::isWindowed): + (WebCore::ChromeClientQt::isFullscreen): + (WebCore::ChromeClientQt::isMaximized): + (WebCore::ChromeClientQt::isMinimized): + * WebCoreSupport/ChromeClientQt.h: + +2010-04-14 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Simon Hausmann. + + [Qt] Moving setViewMode from DumpRenderTreeSupportQt to qwebpage.cpp + https://bugs.webkit.org/show_bug.cgi?id=37622 + + Method qt_wrt_setViewMode was removed from qwebpage.cpp by mistake in r57433 + (bug 35844). Moving it back. + + * Api/qwebpage.cpp: + (qt_wrt_setViewMode): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setMediaType): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-04-14 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Rendering artifacts on Qt plugins when scrolling the page + https://bugs.webkit.org/show_bug.cgi?id=37152 + + Because we no longer repaint the entire viewport on scroll, + we must trigger a repaint of QtPluginWidgets when their geometry changes. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + +2010-04-14 Aaron Boodman <aa@chromium.org> + + Reviewed by David Levin. + + Support relative URLs for notifications on Chromium. They weren't working previously because WebCore was inserting + the relative URL into a KURL instance, but when KURL is backed by GURL as it is on Chromium, relative URLs are + unsupported. Fixed by resolving the relative URL first. + + https://bugs.webkit.org/show_bug.cgi?id=36623 + + Adding tests for this is difficult because we don't currently have DRT support for notifications on Mac, only Windows. + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (NotificationPresenterClientQt::show): Return type of NotificationContents::iconURL() changed. + +2010-04-13 Timothy Hatcher <timothy@apple.com> + + Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry. + And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists. + + SecurityOrigin needs a way to remove individual OriginAccessEntries + https://bugs.webkit.org/show_bug.cgi?id=37449 + + Reviewed by Dave Hyatt. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::whiteListAccessFromOrigin): + (DumpRenderTreeSupportQt::resetOriginAccessWhiteLists): + +2010-04-11 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r57468. + http://trac.webkit.org/changeset/57468 + https://bugs.webkit.org/show_bug.cgi?id=37433 + + Broke the world... Must have applied the patch wrong + (Requested by abarth on #webkit). + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::finishedLoading): + (WebCore::FrameLoaderClientQt::setMainDocumentError): + (WebCore::FrameLoaderClientQt::committedLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFailLoading): + +2010-04-11 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Factor DocumentWriter out of FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=37175 + + Update these callsites because the method moved to DocumentWriter. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::finishedLoading): + (WebCore::FrameLoaderClientQt::setMainDocumentError): + (WebCore::FrameLoaderClientQt::committedLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFailLoading): + +2010-04-11 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Add setWillSendRequestReturnsNull and setWillSendRequestClearHeader + + https://bugs.webkit.org/show_bug.cgi?id=37410 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (qt_set_will_send_request_returns_null): + (qt_set_will_send_request_clear_headers): + (WebCore::FrameLoaderClientQt::dispatchWillSendRequest): + +2010-04-10 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + Refactor Qt DRT support in QtWebKit + + Move all QT DRT support functions to a static class. + + https://bugs.webkit.org/show_bug.cgi?id=35844 + + * Api/qwebframe.cpp: Remove static functions. + * Api/qwebframe.h: Make DumpRenderTreeSupportQt a friend. + * Api/qwebpage.cpp: Remove static functions. + * Api/qwebpage.h: Make DumpRenderTreeSupportQt a friend. + * Api/qwebsecurityorigin.cpp: Remove static functions. + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: Added. + (DumpRenderTreeSupportQt::DumpRenderTreeSupportQt): + (DumpRenderTreeSupportQt::~DumpRenderTreeSupportQt): + (DumpRenderTreeSupportQt::overwritePluginDirectories): + (DumpRenderTreeSupportQt::workerThreadCount): + (DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled): + (DumpRenderTreeSupportQt::setFrameFlatteningEnabled): + (DumpRenderTreeSupportQt::webPageSetGroupName): + (DumpRenderTreeSupportQt::webPageGroupName): + (DumpRenderTreeSupportQt::webInspectorExecuteScript): + (DumpRenderTreeSupportQt::webInspectorClose): + (DumpRenderTreeSupportQt::webInspectorShow): + (DumpRenderTreeSupportQt::setTimelineProfilingEnabled): + (DumpRenderTreeSupportQt::hasDocumentElement): + (DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled): + (DumpRenderTreeSupportQt::pauseAnimation): + (DumpRenderTreeSupportQt::pauseTransitionOfProperty): + (DumpRenderTreeSupportQt::pauseSVGAnimation): + (DumpRenderTreeSupportQt::numberOfActiveAnimations): + (DumpRenderTreeSupportQt::clearFrameName): + (DumpRenderTreeSupportQt::javaScriptObjectsCount): + (DumpRenderTreeSupportQt::garbageCollectorCollect): + (DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread): + (DumpRenderTreeSupportQt::counterValueForElementById): + (DumpRenderTreeSupportQt::pageNumberForElementById): + (DumpRenderTreeSupportQt::numberOfPages): + (DumpRenderTreeSupportQt::suspendActiveDOMObjects): + (DumpRenderTreeSupportQt::resumeActiveDOMObjects): + (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld): + (DumpRenderTreeSupportQt::whiteListAccessFromOrigin): + (DumpRenderTreeSupportQt::resetOriginAccessWhiteLists): + (DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme): + (DumpRenderTreeSupportQt::setCaretBrowsingEnabled): + (DumpRenderTreeSupportQt::setMediaType): + (DumpRenderTreeSupportQt::setViewMode): + * WebCoreSupport/DumpRenderTreeSupportQt.h: Added. + * WebCoreSupport/EditorClientQt.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::multiplePageGroupsAndLocalStorage): + (tst_QWebPage::inputMethodsTextFormat): + (tst_QWebPage::protectBindingsRuntimeObjectsFromCollector): + +2010-04-11 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Update layoutTestController.DumpResourceLoadCallbacks to match other ports. + + Unskip http/tests/xmlhttprequest/abort-should-cancel-load.html + http/tests/misc/will-send-request-returns-null-on-redirect.html + fast/loader/user-style-sheet-resource-load-callbacks.html + http/tests/misc/window-dot-stop.html + http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html + http/tests/security/XFrameOptions/x-frame-options-deny.html + http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow.html + http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html + http/tests/xmlhttprequest/abort-should-cancel-load.html + + QNetworkReply::OperationCanceledError has a value of 5, so update expected results accordingly. + + https://bugs.webkit.org/show_bug.cgi?id=37237 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (qt_set_will_send_request_returns_null_on_redirect): + (drtDescriptionSuitableForTestResult): + (WebCore::FrameLoaderClientQt::dispatchWillSendRequest): + (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse): + (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading): + (WebCore::FrameLoaderClientQt::dispatchDidFailLoading): + +2010-04-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Implement Desktop Notifications API for QtWebKit + https://bugs.webkit.org/show_bug.cgi?id=35503 + + Map WebKit notifications to Qt's SystemTray API and + implement DRT tracing. + + This patch does not implement the security part of + WebKit notifications. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::notificationPresenter): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/NotificationPresenterClientQt.cpp: Added. + (qt_dump_notification): + (NotificationPresenterClientQt::NotificationPresenterClientQt): + (NotificationPresenterClientQt::show): + (NotificationPresenterClientQt::cancel): + (NotificationPresenterClientQt::notificationObjectDestroyed): + (NotificationPresenterClientQt::requestPermission): + (NotificationPresenterClientQt::checkPermission): + * WebCoreSupport/NotificationPresenterClientQt.h: Added. + +2010-04-09 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt]Fix compile error with QT_NO_IM + https://bugs.webkit.org/show_bug.cgi?id=36533 + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::hidePopup): + +2010-04-09 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] tst_QWebFrame::popupFocus() fails + https://bugs.webkit.org/show_bug.cgi?id=37320 + + The QWebPopup class has been moved & renamed, so tst_QWebFrame::popupFocus() should use + the class name "QComboBox", rather than "WebCore::QWebPopup" to find the popup menu. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-04-09 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Holger Freyther. + + Removing the use of topLevelWidget of QWidget class since it is deprecated/obsolete + since Qt 4.5. window() method is being used instead now. + + See http://doc.trolltech.com/4.5/qwidget-obsolete.html#topLevelWidget for more info. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::windowRect): + (WebCore::ChromeClientQt::show): + (WebCore::ChromeClientQt::windowResizerRect): + +2010-04-09 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix compile error with QT_NO_ACTION + https://bugs.webkit.org/show_bug.cgi?id=36529 + + Make sure QT_NO_ACTION is not defined to use QAction + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::pageAction): + * Api/qwebpage.cpp: + (QWebPagePrivate::updateAction): + (QWebPage::updatePositionDependentActions): + * Api/qwebpage.h: + * Api/qwebview.cpp: + * Api/qwebview.h: + +2010-04-09 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Lars Knoll. + + [Qt] tests/qgraphicswebview fails + https://bugs.webkit.org/show_bug.cgi?id=37317 + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): Don't crash if the ownerWidget is null. + +2010-04-08 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Warnings when compiling InspectorClientQt.cpp + https://bugs.webkit.org/show_bug.cgi?id=37266 + + Add a default: for the switch()-case to avoid + warnings. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::variantToSetting): + +2010-04-01 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by David Hyatt. + + [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect. + https://bugs.webkit.org/show_bug.cgi?id=29431 + + Make use of the new lock parameter of set{Vertical,Horizontal}ScrollbarMode. + + Always added a qt auto test for set scrollbar policy feature. + + * Api/qwebframe.cpp: + (QWebFrame::setScrollBarPolicy): + * tests/qwebframe/tst_qwebframe.cpp: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (FrameLoaderClientQt::transitionToCommittedForNewPage): + +2010-04-08 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] WebKit crashes while input text through input method. + The formatted text underline painting crashes when painting with invalid indexes. + https://bugs.webkit.org/show_bug.cgi?id=36870 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethodsTextFormat_data): + (tst_QWebPage::inputMethodsTextFormat): + +2010-04-08 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] qtwebkit_webframe_scrollRecursively scrolls when body.style.overflow="hidden" + https://bugs.webkit.org/show_bug.cgi?id=36674 + + The scrolling check was based on the frameview's scrolloffset, and + maximumScrollPosition, which does not acknowledge the overflow properties. + + I am now basing the scrolling off the scrollbar position. The scrollbars are + affected by the overflow properties indicating when not to scroll. The scrollbar + positions also continue to work for CSS ::-webkit-scrollbar styles. + + * Api/qwebframe.cpp: + (qtwebkit_webframe_scrollRecursively): + +2010-04-07 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest() + https://bugs.webkit.org/show_bug.cgi?id=36949 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-04-07 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=36827 + + Updated the WebCore::shouldTreatAsAttachement function call with the + new more generic replacement WebCore::contentDispositionType. + + See comments 39-42 in https://bugs.webkit.org/show_bug.cgi?id=36395 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType): + +2010-04-07 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] When providing a widget for the PDF mime type it will cause a crash + + m_pluginView may actually be a Widget (for embedded Qt widgets), + so always check isPluginView() before calling PluginView specific methods. + + https://bugs.webkit.org/show_bug.cgi?id=29450 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::finishedLoading): + (WebCore::FrameLoaderClientQt::setMainDocumentError): + (WebCore::FrameLoaderClientQt::committedLoad): + +2010-04-06 Diego Gonzalez <diego.gonzalez@openbossa.org> + + Reviewed by Simon Hausmann. + + [Qt] Add mechanism to detect QtWebKit 2.0 via the preprocessor + https://bugs.webkit.org/show_bug.cgi?id=36538 + + * Api/qwebkitglobal.h: + +2010-04-02 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] [Symbian] Rebaseline Symbian def file + https://bugs.webkit.org/show_bug.cgi?id=37038 + + Switch the ordinal numbers for qtwebkit_webframe_scrollRecursively + and QWebInspector::closeEvent to match QtWebkit 4.6 branch + + Fix the signature for qt_drt_setFrameFlatteningEnabled + after r56718. + + Add new QtWebKit API symbols introduced not listed in the file yet. + + * symbian/eabi/QtWebKitu.def: + +2010-03-30 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Adam Treat. + + Stored focused frame and document in a vars, instead of querying for them many times. + + * Api/qwebpage.cpp: + (QWebPagePrivate::mousePressEvent(QEvent* ev)): + (QWebPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev): + +2010-04-02 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Eric Seidel. + + [Qt]Fix compile error with QT_NO_SETTINGS + https://bugs.webkit.org/show_bug.cgi?id=36533 + + If QT_NO_SETTINGS is defined, QSettings is not available. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::populateSetting): + (WebCore::InspectorClientQt::storeSetting): + +2010-04-02 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Maemo5 theme - customized popup for <select multiple> elements + https://bugs.webkit.org/show_bug.cgi?id=36368 + + Using QtMaemoWebPopup instead of QtFallbackWebPopup for Maemo. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::show): + (WebCore::QtFallbackWebPopup::populate): + +2010-04-01 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Add Single and Multiple Selection Popup for Maemo 5. + + [Qt] Maemo5 theme - popup dialogs + https://bugs.webkit.org/show_bug.cgi?id=36789 + + * WebCoreSupport/QtMaemoWebPopup.cpp: + (WebCore::Maemo5Popup::populateList): + (WebCore::Maemo5Popup::onItemSelected): + (WebCore::QtMaemoWebPopup::createSingleSelectionPopup): + (WebCore::QtMaemoWebPopup::createMultipleSelectionPopup): + (WebCore::Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup): + (WebCore::MultipleItemListDelegate::MultipleItemListDelegate): + (WebCore::MultipleItemListDelegate::paint): + (WebCore::Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup): + * WebCoreSupport/QtMaemoWebPopup.h: + +2010-03-31 Marcus Bulach <bulach@chromium.org> + + Reviewed by Jeremy Orlow. + + Adds Geolocation param for cancelGeolocationPermissionRequestForFrame. + https://bugs.webkit.org/show_bug.cgi?id=35031 + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::cancelGeolocationPermissionRequestForFrame): + +2010-03-31 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=36446 + [Qt] QWebSettings::TiledBackingStoreEnabled attribute lacks documentation and default value + + * Api/qgraphicswebview.cpp: + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2010-03-30 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=36866 + Move CString to WTF + + * Api/qwebelement.cpp: + +2010-03-30 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QGraphicsScene mousePressEvent does not set the clickCausedFocus flag + https://bugs.webkit.org/show_bug.cgi?id=35259 + + The clickCausedFocus flag is not being set in method + mousePressEvent(QGraphicsSceneMouseEvent* ev). This flag is used + in conjunction with QStyle::RSIP_OnMouseClickAndAlreadyFocused when + deciding to launch the software input panel. + + * Api/qwebpage.cpp: + (QWebPagePrivate::mousePressEvent): + +2010-03-30 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Maemo5 theme - QtMaemoWebPopup class + https://bugs.webkit.org/show_bug.cgi?id=36790 + + A new QtAbstractWebPopup descendant class to be used for maemo menu lists. + This is the first step. The next step will be the dialogs implementation that + will come in bug 36789 and finally to use QtMaemoWebPopup instead of QtFallbackWebPopup + that will come in bug 36368. + + * WebCoreSupport/QtMaemoWebPopup.cpp: Added. + (WebCore::QtMaemoWebPopup::QtMaemoWebPopup): + (WebCore::QtMaemoWebPopup::~QtMaemoWebPopup): + (WebCore::QtMaemoWebPopup::createSingleSelectionPopup): + (WebCore::QtMaemoWebPopup::createMultipleSelectionPopup): + (WebCore::QtMaemoWebPopup::createPopup): + (WebCore::QtMaemoWebPopup::show): + (WebCore::QtMaemoWebPopup::hide): + (WebCore::QtMaemoWebPopup::popupClosed): + (WebCore::QtMaemoWebPopup::itemClicked): + * WebCoreSupport/QtMaemoWebPopup.h: Added. + (WebCore::Maemo5Popup::Maemo5Popup): + +2010-03-29 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Simon Hausmann. + + [Qt] Added support for handling the HTTP "Content-Disposition" header. + + https://bugs.webkit.org/show_bug.cgi?id=36395 + + Whenever a server response contains a "Content-Disposition: attachment..." header, + treat the request as a download and emit the unsupportedContent signal. + + * Api/qwebpage.cpp: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::download): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType): + +2010-03-22 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Fraser. + + Add support for Widgets 1.0: View Mode Media Feature + https://bugs.webkit.org/show_bug.cgi?id=35446 + + Add an internal Qt API for changing the view mode media feature + (http://www.w3.org/TR/widgets-vmmf/). + + * Api/qwebpage.cpp: + (qt_wrt_setViewMode): + (QWebPagePrivate::priv): + * Api/qwebpage_p.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::isDocked): + (WebCore::ChromeClientQt::isFloating): + (WebCore::ChromeClientQt::isApplication): + (WebCore::ChromeClientQt::isFullscreen): + * WebCoreSupport/ChromeClientQt.h: + +2010-03-29 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Antti Koivisto. + + Use 'Mobile Safari' instead of 'Safari' on mobile Qt platforms. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2010-03-29 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] unit tests don't compile inside of Qt + + https://bugs.webkit.org/show_bug.cgi?id=36756 + + * tests/tests.pri: Don't do the target substitution inside Qt and find the sources + through VPATH instead of relying on the location of the .pro file exclusively. + +2010-03-26 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Antti Koivisto. + + Change due to renaming of frame flattening setting. + + * Api/qwebpage.cpp: + (qt_drt_setFrameFlatteningEnabled): + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * symbian/eabi/QtWebKitu.def: + +2010-03-28 Alexey Proskuryakov <ap@apple.com> + + Build fix. Include WindowsKeyboardCodes.h instead of KeyboardCodes.h. + + * WebCoreSupport/EditorClientQt.cpp: + +2010-03-26 Olivier Goffart <ogoffart@trolltech.com> + + Reviewed by Simon Hausmann. + + [Qt] Compile with QT_USE_FAST_OPERATOR_PLUS + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::populateSetting): + (WebCore::InspectorClientQt::storeSetting): + +2010-03-26 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + [Qt] Doc: Simplified Commercial Editions for Qt 4.7. + + * docs/qtwebkit.qdoc: + +2010-03-26 Simon Hausmann <simon.hausmann@nokia.com> + + Symbian build fix. + + [Qt] Updated the def file with new exports used by QtLauncher. + + * symbian/eabi/QtWebKitu.def: + +2010-03-25 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QtLauncher crashes on Mac OS and Linux when exiting with QGraphicsView mode enabled + https://bugs.webkit.org/show_bug.cgi?id=35251 + + Followed the way QWebView registers for the signal QWebPage::destroyed(), to prevent + QGraphicsWebView from referencing QWebPage after it was deleted. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_pageDestroyed): + (QGraphicsWebView::setPage): + * Api/qgraphicswebview.h: + +2010-03-25 Kent Hansen <kent.hansen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] QWebFrame::pageChanged() signal is not documented + https://bugs.webkit.org/show_bug.cgi?id=36609 + + * Api/qwebframe.cpp: + +2010-03-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Implement ChromeClient::windowResizerRect() + + https://bugs.webkit.org/show_bug.cgi?id=21300 + + We assume the resize corner to be in the lower right corner of + the window and having the width and height of the scrollbars. + + The helper function geometryRelativeToOwnerWidget() in the page + client is used to clip the resize rect to the actual size of the + viewport, not the size of the QGraphicsView. + + * Api/qgraphicswebview.cpp: + * Api/qwebpage.cpp: + * WebCoreSupport/ChromeClientQt.cpp: + +2010-03-25 Shu Chang <chang.shu@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Added documentation for delete button. + https://bugs.webkit.org/show_bug.cgi?id=31560 + + * Api/qwebsettings.cpp: + +2010-03-25 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Eric Seidel. + + [Qt]Fix compile error with QT_NO_DESKTOPSERVICES + https://bugs.webkit.org/show_bug.cgi?id=36533 + + * Api/qwebsettings.cpp: + (QWebSettings::enablePersistentStorage): + +2010-03-25 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Eric Seidel. + + [Qt]Fix compile error with QT_NO_DEBUG_STREAM + https://bugs.webkit.org/show_bug.cgi?id=36533 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::graphicsItemVisibleRect): + +2010-03-25 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Eric Seidel. + + Make QWebPage not depend on view() but use the client->ownerWidget() + instead. Also, handle the case where there is not page client. + + * Api/qwebpage.cpp: + (QWebPagePrivate::createContextMenu): + (QWebPagePrivate::keyPressEvent): + (QWebPage::javaScriptAlert): + (QWebPage::javaScriptConfirm): + (QWebPage::javaScriptPrompt): + (QWebPage::shouldInterruptJavaScript): + (QWebPage::createWindow): + (QWebPage::action): + (QWebPage::extension): + (QWebPage::chooseFile): + (QWebPage::userAgentForUrl): + +2010-03-24 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Add the FrameFlatteningEnabled WebAttribute to QWebSettings. + + [Qt] Missing QWebSettings for Frame Flattening + https://bugs.webkit.org/show_bug.cgi?id=36553 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2010-03-24 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> + + Reviewed by Laszlo Gombos. + + Auto-uppercase and predictive text need to be disabled for S60 (as for maemo) + https://bugs.webkit.org/show_bug.cgi?id=33176 + + * WebCoreSupport/EditorClientQt.cpp: + +2010-03-24 Kent Hansen <kent.hansen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Rename QWebSettings::XSSAuditorEnabled to XSSAuditingEnabled + https://bugs.webkit.org/show_bug.cgi?id=36522 + + For consistency with other QWebSettings attributes. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-03-23 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Calling setView(0) on a QWebPage being shown by a QGraphicsWebView, + would uninstall the page client, deleting the QGraphicsWebViewPrivate + instance. If called with an argument, it would do a wrong static_cast + and crash. + + * Api/qwebpage.cpp: + (QWebPageWidgetClient::QWebPageWidgetClient): + (QWebPageWidgetClient::isQWidgetClient): + (QWebPageWidgetClient::screenNumber): + (QWebPage::QWebPage): + (QWebPage::setView): + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::unsetPageIfExists): + (QGraphicsWebView::setPage): + * Api/qwebpage.cpp: + (QWebPageWidgetClient::isQWidgetClient): + (QWebPageWidgetClient::screenNumber): + (QWebPage::QWebPage): + (QWebPage::setView): + * Api/qwebpage.h: + * Api/qwebview.cpp: + (QWebViewPrivate::unsetPageIfExists): + (QWebView::setPage): + +2010-03-24 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + Make Icon::createIconForFiles() optional. + https://bugs.webkit.org/show_bug.cgi?id=35072 + + - Rename iconForFiles() to chooseIconForFiles(). + - Call Icon::createIconForFiles() from chooseIconForFiles(). + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::chooseIconForFiles): + * WebCoreSupport/ChromeClientQt.h: + +2010-03-23 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + QGraphicsWebView crash when calling setView on the QWebPage... + https://bugs.webkit.org/show_bug.cgi?id=36436 + + Checking for pageClient existance before showing popups. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::show): + +2010-03-23 Anders Bakken <anders.bakken@nokia.com>, Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Check if q->scene() is available before actually using it + on QGraphicsWebViewPrivate. + + QGraphicsWebView crash + https://bugs.webkit.org/show_bug.cgi?id=32670 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::screenNumber): + (QGraphicsWebViewPrivate::ownerWidget): + +2010-03-23 David Leong <david.leong@nokia.com> + + Reviewed by Laszlo Gombos. + + Build fix for Symbian Def file. + + * symbian/eabi/QtWebKitu.def: + +2010-03-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove support for Qt v4.4 + https://bugs.webkit.org/show_bug.cgi?id=36389 + + * Api/qwebelement.cpp: + (QWebElement::classes): + * Api/qwebpage.cpp: + (QWebPagePrivate::editorActionForKeyEvent): + (QWebPage::userAgentForUrl): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + * tests/tests.pro: + +2010-03-22 Kent Hansen <kent.hansen@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Fix qdoc warnings + https://bugs.webkit.org/show_bug.cgi?id=36447 + + * Api/qgraphicswebview.cpp: Add missing (). + * Api/qwebframe.cpp: Remove reference to non-existent parameter "url". + * Api/qwebsettings.cpp: Document parameter "location". + +2010-03-22 Jakub Wieczorek <jwieczorek@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Don't construct a QLineEdit every time when painting a text field + https://bugs.webkit.org/show_bug.cgi?id=36373 + + Add a simple benchmark covering this area. + + * tests/benchmarks/painting/tst_painting.cpp: + (tst_Painting::textAreas): + +2010-03-22 Yi Shen <shenyi2006@gmail.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=35933 + [Qt] [Symbian] Can not backward select (highlight) text using virtual keyboard + Make sure the selection start index is smaller than the selection end index. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2010-03-21 Kristian Amlie <kristian.amlie@nokia.com> + + Reviewed by Simon Hausmann. + + Fixed updating the VKB display when inputting into QGraphicsWebView. + https://bugs.webkit.org/show_bug.cgi?id=36292 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_updateMicroFocus): + (QGraphicsWebView::setPage): + * Api/qgraphicswebview.h: + +2010-03-19 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed. + + Buildfix for Qt v4.5. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewOverlay::q): + +2010-03-18 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Darin Adler. + + Make it possible for the Qt DRT to set the media type from + the LayoutTestController. + + * Api/qwebframe.cpp: + (qt_drt_setMediaType): + +2010-03-18 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] New API scrollRecursively has several problems. + https://bugs.webkit.org/show_bug.cgi?id=35873 + + Remove scrollRecursively from the Qt 4.7 API + Update the internal API to accept a hit test position + for nested scrolling + + * Api/qwebframe.cpp: + (webframe_scrollOverflow): + (qtwebkit_webframe_scrollRecursively): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + * tests/qwebframe/tst_qwebframe.cpp: + +2010-03-18 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=36102 + [Qt] Scaling control API for tiled backing store + + The scale is set by passing the QGraphicsWebView scale to the backing store. The + only new API is the tiledBackingStoreFrozen property which allows disabling + all updates (for example during zoom animation). + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_scaleChanged): + (QGraphicsWebViewPrivate::updateTiledBackingStoreScale): + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebView::isTiledBackingStoreFrozen): + (QGraphicsWebView::setTiledBackingStoreFrozen): + * Api/qgraphicswebview.h: + * Api/qwebframe.cpp: + * Api/qwebframe_p.h: + +2010-03-17 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Tor Arne Vestbø. + + Fix Qt build with tiled backing store disabled. + + * Api/qwebframe.cpp: + * Api/qwebframe_p.h: + +2010-03-17 Chang Shu <chang.shu@nokia.com> + + Reviewed by Laszlo Gombos. + + https://bugs.webkit.org/show_bug.cgi?id=36139 + [Qt] Clean up cache while setting cache quota. This behavior matches other platforms, + such as mac and gtk. + + * Api/qwebsettings.cpp: + (QWebSettings::setOfflineWebApplicationCacheQuota): + +2010-03-17 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable accelerated compositing by default + https://bugs.webkit.org/show_bug.cgi?id=35866 + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2010-03-15 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=36121 + [Qt] Make WebKit scrollbars work with tiling + + - Use the scrollbar overlay (implemented for accelerated compositing) when in tiled mode. + - Make overlay compile unconditionally, enable on demand. This removes bunch of unneeded ifdefs. + - Update the scroll position to the backing store as needed. + - Renamed some methods. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::): + (QGraphicsWebViewPrivate::createOrDeleteOverlay): + (QGraphicsWebViewPrivate::setRootGraphicsLayer): + (QGraphicsWebViewPrivate::updateCompositingScrollPosition): + (QGraphicsWebViewPrivate::scroll): + (QGraphicsWebViewPrivate::update): + (QGraphicsWebViewPrivate::graphicsItemVisibleRect): + (QGraphicsWebView::paint): + (QGraphicsWebView::setPage): + (QGraphicsWebView::updateGeometry): + (QGraphicsWebView::setGeometry): + * Api/qwebframe.cpp: + (QWebFramePrivate::renderFromTiledBackingStore): + * Api/qwebframe_p.h: + +2010-03-15 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Fix crash in QWebView::setPage() + + tst_qwebpage was crashing on setPage(0) + + https://bugs.webkit.org/show_bug.cgi?id=36137 + + * Api/qwebview.cpp: + (QWebView::setPage): + +2010-03-16 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost. + + Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder + https://bugs.webkit.org/show_bug.cgi?id=35036 + + * Api/qwebinspector.cpp: + (QWebInspector::hideEvent): + (QWebInspector::closeEvent): + * Api/qwebinspector.h: + * Api/qwebpage.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::openInspectorFrontend): + (WebCore::InspectorFrontendClientQt::InspectorFrontendClientQt): + (WebCore::InspectorFrontendClientQt::frontendLoaded): + (WebCore::InspectorFrontendClientQt::localizedStringsURL): + (WebCore::InspectorFrontendClientQt::hiddenPanels): + (WebCore::InspectorFrontendClientQt::bringToFront): + (WebCore::InspectorFrontendClientQt::closeWindow): + (WebCore::InspectorFrontendClientQt::attachWindow): + (WebCore::InspectorFrontendClientQt::detachWindow): + (WebCore::InspectorFrontendClientQt::setAttachedWindowHeight): + (WebCore::InspectorFrontendClientQt::inspectedURLChanged): + (WebCore::InspectorFrontendClientQt::updateWindowTitle): + * WebCoreSupport/InspectorClientQt.h: + +2010-03-15 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed. + + [Qt] Build fix if TILED_BACKING_STORE is disabled. + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderContentsLayerAbsoluteCoords): + +2010-03-14 Chang Shu <chang.shu@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] [Symbian] Use Symbian native dialog providers for combo pupups. + https://bugs.webkit.org/show_bug.cgi?id=35919 + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::show): + (WebCore::ResetAndDestroy): + (WebCore::QtFallbackWebPopup::showS60BrowserDialog): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-03-14 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=35146 + Support tiled backing store + + Implements a basic tiled backing store mechanism. Tiles are created and + deleted on demand. The page content is cached to the tiles. Tile content + is kept in sync with the document. Since the backing store covers area + larger than the currently visible viewport, the document can be scrolled + quickly without having to enter rendering tree painting. + + The tile management code is platform independent. This patch has simple QPixmap + based tile implementation for Qt. + + The feature is behind ENABLE_TILED_BACKING_STORE flag. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::visibleRect): + (QGraphicsWebView::paint): + * Api/qwebframe.cpp: + (QWebFramePrivate::renderContentsLayerAbsoluteCoords): + * Api/qwebframe.h: + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-03-13 Csaba Osztrogonác <ossy@webkit.org> + + [Qt] Enable accelerated compositing by default + https://bugs.webkit.org/show_bug.cgi?id=35866 + + Unreviewed. Roll-out r55955, because it broke 3 tests: + - animations/fill-mode-transform.html + - animations/play-state.html + - animations/simultaneous-start-left.html + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2010-03-13 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable accelerated compositing by default + https://bugs.webkit.org/show_bug.cgi?id=35866 + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2010-03-11 Anders Carlsson <andersca@apple.com> + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebCoreSupport/ChromeClientQt.cpp: + * WebCoreSupport/ChromeClientQt.h: + +2010-03-10 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Add Support for WebKitEnableCaretBrowsing to Qt DRT + + Unskip test fast/events/multiline-link-arrow-navigation.html + Fix typo (superfluous space) in QWebSettings docs. + + https://bugs.webkit.org/show_bug.cgi?id=35593 + + * Api/qwebpage.cpp: + (qt_drt_enableCaretBrowsing): + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): fix typo in docs + +2010-03-02 Adam Treat <atreat@rim.com> + + Reviewed by Dave Hyatt. + + Adapt the qt port to the refactoring of repaint methods. + + https://bugs.webkit.org/show_bug.cgi?id=34214 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::invalidateContents): + (WebCore::ChromeClientQt::invalidateWindow): + (WebCore::ChromeClientQt::invalidateContentsAndWindow): + (WebCore::ChromeClientQt::invalidateContentsForSlowScroll): + * WebCoreSupport/ChromeClientQt.h: + +2010-03-08 Eric Uhrhane <ericu@chromium.org> + + Reviewed by David Levin. + + Remove the now-redundant Settings fields for the Database + https://bugs.webkit.org/show_bug.cgi?id=35763 + + No new tests; this code isn't called. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): Remove the call into Settings. + +2010-03-08 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Binary incompatibility between Qt 4.6's WebKit and trunk in QWebSettings + https://bugs.webkit.org/show_bug.cgi?id=35858 + + Moved the enum value added in r54873 to the end of the enum, to preserve + binary compatibility. DnsPrefetchEnabled was in the last release and needs + to remain after LocalContentCanAccessRemoteUrls. + + * Api/qwebsettings.h: + +2010-03-06 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Sam Weinig. + + Remove unnecessary includes of wtf/Platform.h. This is already pulled in by the prefix header. + + * WebCoreSupport/EditCommandQt.cpp: + +2010-03-02 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + Patch by Antonio Gomes <tonikitoo@webkit.org> + + [Qt] QWebSettings attribute for toggle Spatial Navigation on/off + https://bugs.webkit.org/show_bug.cgi?id=33714 (Qt API part) + + Added 'SpatialNavigationEnabled' attribute to QWebSettings. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-03-04 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] qwebelement.h does not include QtCore headers correctly + https://bugs.webkit.org/show_bug.cgi?id=35748 + + The header files of QtCore must be included as QtCore/foo.h. + + See also http://bugreports.qt.nokia.com/browse/QTBUG-8661 + + * Api/qwebelement.h: + +2010-03-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Make the OUTPUT_DIR variable in qmake projects independent of build-webkit's logic. + + This also allows shadow builds relying only on qmake to work properly. + + * tests/benchmarks/loading/loading.pro: + * tests/benchmarks/painting/painting.pro: + * tests/hybridPixmap/hybridPixmap.pro: + * tests/qgraphicswebview/qgraphicswebview.pro: + * tests/qwebelement/qwebelement.pro: + * tests/qwebframe/qwebframe.pro: + * tests/qwebhistory/qwebhistory.pro: + * tests/qwebhistoryinterface/qwebhistoryinterface.pro: + * tests/qwebinspector/qwebinspector.pro: + * tests/qwebpage/qwebpage.pro: + * tests/qwebplugindatabase/qwebplugindatabase.pro: + +2010-03-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix generation of forwarding headers + + The dependencies were a bit wrong, so we ended up not generating + forwarding headers for qwebkitversion.h and qwebkitglobal.h + + The forwarding headers are now the only targets depending on the + real headers. All other targets either depend on the generated + class headers, or the forwarding headers. + + * Api/DerivedSources.pro: + +2010-03-02 Eric Uhrhane <ericu@chromium.org> + + Reviewed by David Levin. + + Move database enable bit fully out of settings + This is stage one of a three-stage commit [webkit, then chromium, then + webkit again]. In this change I'm adding calls to + Database::setIsAvailable inside Settings::setDatabaseEnabled and + anywhere else that called it, and switching webkit fully over to using + that flag [added in a previous checkin]. Phase two will remove + Chromium's use of Settings for the Database, and phase three will remove + the Setting for the Database enable entirely, leaving only + Database::isAvailable/setIsAvailable. + + No new tests; tested by existing storage tests. + + https://bugs.webkit.org/show_bug.cgi?id=35310 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): Add a call to Database::setIsAvailable + +2010-03-02 Simon Hausmann <simon.hausmann@nokia.com> + + Symbian build fix. + + [Qt] Updated the def file with one new export, to fix + QtLauncher linkage. + + * symbian/eabi/QtWebKitu.def: + +2010-03-01 Jakob Petsovits <jpetsovits@rim.com> + + Reviewed by Adam Barth. + + Adapt to the new ZoomMode enum. + https://bugs.webkit.org/show_bug.cgi?id=35347 + + * Api/qwebframe.cpp: + (QWebFrame::setTextSizeMultiplier): + (QWebFrame::setZoomFactor): + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-02-26 Diego Gonzalez <diego.gonzalez@openbossa.org> + + Reviewed by Simon Hausmann. + + Fix documentation of QWebSettings::setUserStyleSheetUrl method + + The base 64 data in the exemple shows a not valid code. + + REGRESSION: QWebSettings::setUserStyleSheetUrl is not working with a data URL (Base64) + https://bugs.webkit.org/show_bug.cgi?id=34802 + + * Api/qwebsettings.cpp: + +2010-02-26 Jamey Hicks <jamey.hicks@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] added QWebSettings::setInspectorUrl() and QWebSettings::inspectorUrl() + + Enables the use of alternate Web Inspector frontends by changing + the location of the frontend. + + This is required so that the Web Inspector may be run from an + external process or an external tool such as Eclipse or Aptana may + be used instead of the in-process Web Inspector UI. + + https://bugs.webkit.org/show_bug.cgi?id=35340 + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + (QWebSettings::setInspectorUrl): + (QWebSettings::inspectorUrl): + * Api/qwebsettings.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::createPage): + +2010-02-25 Jarkko Sakkinen <jarkko.sakkinen@tieto.com> + + Reviewed by Kenneth Rohde Christiansen. + + Qt WebGL support + + Adds enabling and disabling of WebGL support to QWebSettings. + https://bugs.webkit.org/show_bug.cgi?id=35153 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2010-02-19 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove QGVLauncher + + https://bugs.webkit.org/show_bug.cgi?id=35292 + + * QGVLauncher/QGVLauncher.pro: Removed. + * QGVLauncher/main.cpp: Removed. + +2010-02-23 Steve Block <steveblock@google.com> + + Reviewed by Darin Adler. + + Adds ChromeClient::cancelGeolocationPermissionRequestForFrame + https://bugs.webkit.org/show_bug.cgi?id=34962 + + This method is required so that a Geolocation object can cancel an + asynchronous permission request. This allows the chrome client to cancel + any UI it is showing for the permission request. + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::cancelGeolocationPermissionRequestForFrame): + +2010-02-22 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed Symbian build fix. + + [Qt] Updated the def file with new exports to enable + building DumpRenderTree. + + * symbian/eabi/QtWebKitu.def: + +2010-02-18 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Minor improvement to hybrid QPixmap + https://bugs.webkit.org/show_bug.cgi?id=34507 + + * tests/hybridPixmap/test.html: use assignToHTMLImageElement on an + existing element instead of toHTMLImageElement which creates a new one + +2010-02-17 Dmitry Titov <dimich@chromium.org> + + Reviewed by David Levin, Darin Fisher, Simon Hausmann. + + When a live iframe element is moved between pages, it still depends on the old page. + https://bugs.webkit.org/show_bug.cgi?id=34382 + + * Api/qwebframe_p.h: + (QWebFramePrivate::setPage): Added. + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::didTransferChildFrameToNewDocument): + The QWebFrame caches a QWebPage which should be replaced when Frame is re-parented. + Also, the QWebFrame is a child (in QT terms) of QWebPage - so update that relationship as well. + Emit a signal that QWebFrame moved to a different QWebPage. + + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-02-17 Kent Tamura <tkent@chromium.org> + + Reviewed by Eric Seidel. + + Introduces new Icon loading interface in order to support + asynchronous loading. + https://bugs.webkit.org/show_bug.cgi?id=32054 + + Add an empty implementation of ChromeClient::iconForFiles(). + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::iconForFiles): + * WebCoreSupport/ChromeClientQt.h: + +2010-02-17 Diego Gonzalez <diego.gonzalez@openbossa.org> + + Reviewed by Ariya Hidayat. + + Make possible Qt DRT to get total number of pages to be printed + + LayoutTests: + printing/numberOfPages.html + + [Qt] DRT: Get total number of pages to be printed + https://bugs.webkit.org/show_bug.cgi?id=34955 + + * Api/qwebframe.cpp: + (qt_drt_numberOfPages): + (qt_drt_evaluateScriptInIsolatedWorld): + +2010-02-16 Ariya Hidayat <ariya.hidayat@gmail.com> + + Reviewed by Simon Hausmann. + + [Qt] Allow scrolling to an anchor programmatically. + https://bugs.webkit.org/show_bug.cgi?id=29856 + + * Api/qwebframe.cpp: + (QWebFrame::scrollToAnchor): New API function. + * Api/qwebframe.h: + * tests/qwebframe/tst_qwebframe.cpp: New tests for scrollToAnchor(). + +2010-02-16 Ariya Hidayat <ariya.hidayat@gmail.com> + + Reviewed by Laszlo Gombos. + + Fix building with Qt < 4.6. + https://bugs.webkit.org/show_bug.cgi?id=34885 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + +2010-02-16 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Symbian build fix. + + Updated the def file with two new exports used by QtLauncher. + + * symbian/eabi/QtWebKitu.def: + +2010-02-16 Ismail Donmez <ismail@namtrac.org> + + Reviewed by Pavel Feldman. + + Fix compilation with inspector disabled. + https://bugs.webkit.org/show_bug.cgi?id=32724 + + * Api/qwebpage.cpp: + (qt_drt_webinspector_executeScript): + (qt_drt_webinspector_close): + (qt_drt_webinspector_show): + (qt_drt_setTimelineProfilingEnabled): + +2010-02-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausman. + + [Qt] Fix include paths for forwarding headers in standalone builds. + + * Api/DerivedSources.pro: Use relative paths for package builds and added some + documentation. + +2010-02-15 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] QtWebkit bridge: enable passing a QWebElement to a signal/slot/property + Add Q_DECLARE_METATYPE to QWebElement, add relevant tests to + tst_qwebframe + https://bugs.webkit.org/show_bug.cgi?id=34901 + + * Api/qwebelement.h: declare metatype + * tests/qwebframe/tst_qwebframe.cpp: + (MyQObject::webElementProperty): new test for QWebElement + (MyQObject::setWebElementProperty): new test for QWebElement + (MyQObject::myOverloadedSlot): new test for QWebElement + +2010-02-15 Robert Hogan <robert@roberthogan.net>, Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] DRT: Support evaluateInWebInspector(), setTimelineProfilingEnabled(). + + Support LayoutTestController.evaluateInWebInspector(), setTimelineProfilingEnabled() in Qt DRT. + + https://bugs.webkit.org/show_bug.cgi?id=33096 + + This allows the following tests to pass: + + inspector/console-format-collections.html + inspector/styles-iframe.html + inspector/syntax-highlight-css.html + inspector/syntax-highlight-javascript.html + inspector/timeline-enum-stability.html + inspector/timeline-layout.html + inspector/timeline-mark-timeline.html + inspector/timeline-paint.html + inspector/timeline-parse-html.html + inspector/timeline-recalculate-styles.html + inspector/timeline-script-tag-1.html + inspector/timeline-script-tag-2.html + inspector/timeline-trivial.html + inspector/cookie-resource-match.html + inspector/elements-img-tooltip.html + inspector/elements-panel-selection-on-refresh.html + inspector/inspected-objects-not-overriden.html + inspector/timeline-event-dispatch.html + inspector/timeline-network-resource.html + inspector/elements-panel-rewrite-href.html + inspector/console-dir.html + inspector/console-dirxml.html + inspector/console-format.html + inspector/console-tests.html + inspector/elements-panel-structure.html + inspector/evaluate-in-frontend.html + inspector/console-clear.html + + * Api/qwebpage.cpp: + (qt_drt_webinspector_executeScript): + (qt_drt_webinspector_close): + (qt_drt_webinspector_show): + (qt_drt_setTimelineProfilingEnabled): + + * WebCoreSupport/InspectorClientQt.cpp: + (InspectorClientQt::createPage) + +2010-02-12 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen and Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=34885 + Add a QGraphicsWebView mode that makes it automatically resize itself to the size of the content. + + This is useful for cases where the client wants to implement page panning and zooming by manipulating + the graphics item. + + Add a option to QGVLauncher to test this mode. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + (QGraphicsWebViewPrivate::_q_contentsSizeChanged): + (QGraphicsWebView::setPage): + (QGraphicsWebView::setResizesToContents): + (QGraphicsWebView::resizesToContents): + * Api/qgraphicswebview.h: + * QGVLauncher/main.cpp: + (WebView::WebView): + (MainView::MainView): + (MainView::setMainWidget): + (MainView::resizeEvent): + (main): + +2010-02-12 Diego Gonzalez <diego.gonzalez@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Qt DRT now dump the frame loader callbacks when LayoutTestController() + method is called. + + LayoutTests: + http/tests/security/mixedContent/data-url-script-in-iframe.html + http/tests/security/mixedContent/empty-url-plugin-in-frame.html + http/tests/security/mixedContent/insecure-css-in-iframe.html + http/tests/security/mixedContent/insecure-iframe-in-iframe.html + http/tests/security/mixedContent/insecure-image-in-iframe.html + http/tests/security/mixedContent/insecure-plugin-in-iframe.html + http/tests/security/mixedContent/insecure-script-in-iframe.html + http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe.html + http/tests/security/mixedContent/redirect-https-to-http-script-in-iframe.html + + [Qt] Make possible Qt DRT dump frame load callbacks + https://bugs.webkit.org/show_bug.cgi?id=34702 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::didDisplayInsecureContent): + (WebCore::FrameLoaderClientQt::didRunInsecureContent): + +2010-02-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Make qtlauncher and qgvlauncher use the generated headers + path to make sure they are correctly generated. + + * tests/tests.pri: + +2010-02-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Ensure relative paths in generated .pri files to ensure that + a source package with pre-generated derived sources can be compiled. + + - Re-add a separate headers.pri file for WEBKIT_API_HEADERS + - Rename the generated headers.pri to classheaders.pri to avoid + confusion with the one generated by synqt since they don't have the + same content. + - Remove private headers list variable from classheaders.pri + - Use $$PWD in classheaders.pri + - Remove classheaders.pri from the installed files + + * Api/DerivedSources.pro: + +2010-02-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Minor fixes on QtWebKit headers generation. + + - Adds QtWebKit to the generated headers destination path + - Improve compatibility with MinGW + + * Api/DerivedSources.pro: + +2010-02-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by nobody, build fix. + + [Qt] Fix standalone build with MinGW. + + * tests/qwebelement/tst_qwebelement.cpp: + * tests/tests.pri: + +2010-02-10 Diego Gonzalez <diego.gonzalez@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Implement pageNumberForElementById() method in Qt DRT LayoutTestController, + to make Qt DRT able to get page number. + + LayoutTests: + printing/page-break-always.html + printing/pageNumerForElementById.html + printing/css2.1/page-break-before-000.html + printing/css2.1/page-break-after-000.html + printing/css2.1/page-break-after-004.html + printing/css2.1/page-break-before-001.html + printing/css2.1/page-break-after-001.html + printing/css2.1/page-break-after-002.html + printing/css2.1/page-break-before-002.html + printing/css2.1/page-break-inside-000.html + + [Qt] Make possible Qt DRT get a page number for element by ID + https://bugs.webkit.org/show_bug.cgi?id=34777 + + * Api/qwebframe.cpp: + (qt_drt_pageNumberForElementById): + +2010-02-09 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Adam Barth. + + [Qt] Unit test for window.runModalDialog + https://bugs.webkit.org/show_bug.cgi?id=34755 + + * tests/qwebpage/tst_qwebpage.cpp: + (TestModalPage::TestModalPage): + (TestModalPage::createWindow): + (tst_QWebPage::showModalDialog): + +2010-02-09 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Sync with API changes in Maemo 5 kinetic scrolling + + https://bugs.webkit.org/show_bug.cgi?id=34747 + + This is a forward-port of http://qt.gitorious.org/+qt-developers/qt/x11-maemo/commit/08497561 + + * Api/qwebview.cpp: + (qt_sendSpontaneousEvent): + (QWebViewKineticScroller::QWebViewKineticScroller): + (QWebViewKineticScroller::setWidget): + (QWebViewKineticScroller::eventFilter): + (QWebViewKineticScroller::cancelLeftMouseButtonPress): + (QWebViewKineticScroller::currentFrame): + (QWebViewKineticScroller::scrollingFrameAt): + (QWebViewKineticScroller::maximumScrollPosition): + (QWebViewKineticScroller::scrollPosition): + (QWebViewKineticScroller::viewportSize): + (QWebViewKineticScroller::setScrollPosition): + (QWebViewKineticScroller::sendEvent): + (QWebView::QWebView): + +2010-02-09 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Webkit in Qt does not have window.showModalDialog + https://bugs.webkit.org/show_bug.cgi?id=25585 + + Create a new eventloop when runModal() is called. + Added comemnt in QWebPage::createWindow that the application is responsible + for setting the modality of the appropriate window. + + * Api/qwebpage.cpp: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::ChromeClientQt): + (WebCore::ChromeClientQt::~ChromeClientQt): + (WebCore::ChromeClientQt::canRunModal): + (WebCore::ChromeClientQt::runModal): + * WebCoreSupport/ChromeClientQt.h: + +2010-01-19 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Dave Hyatt. + + Implement flattening of framesets + https://bugs.webkit.org/show_bug.cgi?id=32717 + + Privately export the setFrameSetFlatteningEnabled setting for + use with the Qt DRT. + + * Api/qwebpage.cpp: + (qt_drt_setFrameSetFlatteningEnabled): + (QWebPagePrivate::core): + * Api/qwebpage_p.h: + +2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + [Qt] Fix build on Windows + + Reviewed by Kenneth Rohde Christiansen. + + DerivedSources for our API headers failed on Windows, + due to Windows not accepting ; as a command separator, + not needing quotes for echo, and needing < and > escaped. + + We now detect Windows and set these quote markers and + escape markers accordingly, as well as use && for separating + individual commands. + + * Api/DerivedSources.pro: + +2010-02-05 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Remove unused inmport of ScriptFunctionCall.h + + https://bugs.webkit.org/show_bug.cgi?id=33592 + + * Api/qwebelement.cpp: + +2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Generate convenience headers (QWebView, etc) using qmake + + In Qt this is done using syncqt, but we use a pro-file instead + that generates makefile-rules for each of the extra headers. + + These extra headers are installed alongside the normal headers. + + * Api/DerivedSources.pro: Added. List of headers + pro file magic + * Api/headers.pri: Removed, list of headers is now in the above file + +2010-02-04 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Ariya Hidayat. + + [Qt] Tuning and optimizations to GraphicsLayerQt. Mainly reduced usage + of QTimer::singleShot, and moved syncLayers() from paint() to update() + https://bugs.webkit.org/show_bug.cgi?id=34062 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::update): Moved the sync operation to update + (QGraphicsWebView::paint): Moved the sync operation to update + +2010-02-03 Andras Becsi <abecsi@webkit.org> + + Unreviewed build fix. + + [Qt] Roll-out r54281 because it broke the build on the Qt Release bot. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::markForSync): + (QGraphicsWebViewPrivate::update): + (QGraphicsWebView::paint): + +2010-02-02 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Ariya Hidayat. + + Do not use a proxy widget for the QComboBox on Maemo 5, as it + is not working properly and it is not needed at all, as the + comboboxes comes up in their full width on the screen and + do not depend on view. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::show): + +2010-02-02 Jessie Berlin <jberlin@webkit.org> + + Rubber Stamped by Holger Freyther. + + [Qt] Fix style issue identified in bug: + https://bugs.webkit.org/show_bug.cgi?id=34329 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientWebPage::InspectorClientWebPage): + Fix indentation. + +2010-02-01 Jessie Berlin <jberlin@webkit.org> + + Reviewed by Holger Freyther. + + [Qt] Enable inspecting the Web Inspector in QtLauncher + + https://bugs.webkit.org/show_bug.cgi?id=34329 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientWebPage::InspectorClientWebPage): + Allow the DeveloperExtrasEnabled setting to default to true for the page containing the Web Inspector. + +2010-02-02 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Display HTML tags verbatim in JS alert/confirm/prompt boxes + + https://bugs.webkit.org/show_bug.cgi?id=34429 + + * Api/qwebpage.cpp: + (QWebPage::javaScriptAlert): + (QWebPage::javaScriptConfirm): + (QWebPage::javaScriptPrompt): + +2010-02-02 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable a way to measure FPS in QGVLauncher + run QGVLauncher with --show-fps to see ongoing fps measurements + This is not meant as accurate FPS, but rather as a way to find + improvements/regressions + https://bugs.webkit.org/show_bug.cgi?id=34450 + + * QGVLauncher/main.cpp: + (MainView::MainView): initialize FPS values + (MainView::paintEvent): count a painted frame here + (MainView::printFps): we print the fps with qDebug every 5 seconds. + +2010-01-29 Ben Murdoch <benm@google.com> + + Reviewed by Dimitri Glazkov. + + [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage. + https://bugs.webkit.org/show_bug.cgi?id=34215 + + Add needTouchEvents() to the ChromeClient which is called when the page decides it needs or no longer needs to be informed of touch events. + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::needTouchEvents): Add an empty implementation. + +2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann + + Disable auto-uppercase and predictive text on Maemo5, just like the + build-in MicroB Browser. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + +2010-01-28 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Support kinetic scrolling on Maemo 5 + + https://bugs.webkit.org/show_bug.cgi?id=34267 + + Patch by Ralf Engels <ralf.engels@nokia.com> and + Robert Griebl <rgriebl@trolltech.com> + + * Api/qwebview.cpp: + (QWebViewKineticScroller::QWebViewKineticScroller): + (QWebViewKineticScroller::eventFilter): + (QWebViewKineticScroller::currentFrame): + (QWebViewKineticScroller::scrollingFrameAt): + (QWebViewKineticScroller::attachToWidget): + (QWebViewKineticScroller::removeFromWidget): + (QWebViewKineticScroller::positionRange): + (QWebViewKineticScroller::position): + (QWebViewKineticScroller::viewportSize): + (QWebViewKineticScroller::setPosition): + (QWebView::QWebView): + +2010-01-28 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Do not set the combobox font on Maemo5 and S60; use the + default instead. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::populate): + +2010-01-28 Trond Kjernåsen <trond@trolltech.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix for endless print loop when printing web pages + + * Api/qwebframe.cpp: + (QWebFrame::print): + +2010-01-27 Diego Gonzalez <diego.gonzalez@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] DRT Provide worker thread ability to track counters + https://bugs.webkit.org/show_bug.cgi?id=34221 + + Implement workerThreadCount() in LayoutTestController of Qt DRT + + Tests: + fast/workers/dedicated-worker-lifecycle.html + fast/workers/shared-worker-frame-lifecycle.html + fast/workers/shared-worker-lifecycle.html + fast/workers/worker-lifecycle.html + + * Api/qwebpage.cpp: + (qt_drt_workerThreadCount): + +2010-01-27 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Update the .def files with exported symbols + + * symbian/eabi/QtWebKitu.def: Add two mangled missing new symbols for arm eabi. + +2010-01-27 Kent Hansen <kent.hansen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Meta-methods can't be introspected using ES5 API + https://bugs.webkit.org/show_bug.cgi?id=34087 + + Test that Object.getOwnPropertyDescriptor and + Object.getOwnPropertyNames work with meta-methods. + + * tests/qwebframe/tst_qwebframe.cpp: + +2010-01-26 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Show comboboxes on Maemo 5 + https://bugs.webkit.org/show_bug.cgi?id=34088 + + Don't try to show the combobox by simulating a mouse event from QCursor::pos() to + get the combobox position right. The position on Maemo 5 is independent from the mouse + and there's no QCursor::pos(). + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::show): + +2010-01-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + First steps of the QtScript API. + + Two new classes were created; QScriptEngine and QScriptValue. + The first should encapsulate a javascript context and the second a script + value. + + This API is still in development, so it isn't compiled by default. + To trigger compilation, pass --qmakearg="CONFIG+=build-qtscript" to + build-webkit. + + https://bugs.webkit.org/show_bug.cgi?id=32565 + + * docs/qtwebkit.qdocconf: + +2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Hausmann. + + [Qt] JavaScript prompt is currently broken + https://bugs.webkit.org/show_bug.cgi?id=30914 + + In r52152 a patch was landed to convert a null QString + to an empty WebCore::String in case the prompt was accepted + but the default implementation returned the null QString. + + The patch tried to avoid assign to result twice and + was not checking the QString if it is null but the default + value. This lead to always returning an empty string on + successful prompts. Fix it by checking the variable 'x' + for isNull. + + The manual test case used didn't cover the case of non + empty input, replace it with an automatic test case that + should cover all cases. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::runJavaScriptPrompt): Fix the bug. + * tests/qwebpage/tst_qwebpage.cpp: Add automatic test case + (JSPromptPage::JSPromptPage): + (JSPromptPage::javaScriptPrompt): + (tst_QWebPage::testJSPrompt): + +2010-01-25 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] In RenderThemeQt determine the QStyle from the page client instead of the page's view + https://bugs.webkit.org/show_bug.cgi?id=34053 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::style): Implement QWebPageClient::style() and return the graphics + widget's style. + * Api/qwebpage.cpp: + (QWebPageWidgetClient::style): Implement QWebPageClient::style() and return the widget's style. + +2010-01-25 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] Phone backup support for QtWebkit for Symbian devices. + https://bugs.webkit.org/show_bug.cgi?id=34077 + + * symbian/backup_registration.xml: Added. + +2010-01-23 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix positioning of ComboBox popup in QGraphicsWebView. + + Wrap the popup in a QGraphicsProxyWidget, so that the popup + transforms with the item. + + https://bugs.webkit.org/show_bug.cgi?id=33887 + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::hidePopup): + (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::show): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-01-22 Peter Kasting <pkasting@google.com> + + Not reviewed, backout. + + Back out r52673, which caused several regressions. + https://bugs.webkit.org/show_bug.cgi?id=32533 + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::hidePopup): + +2010-01-22 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + + [Qt] Save the QWebPageClient instead of the ownerWidget in QtAbstractWebPopup + + The QWebPageClient is required for the QtFallbackWebPopup. QtFallbackWebPopup will + need it to create a QGraphicsProxyWidget (in a future commit) for the + QGraphicsWebView's web popup. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::show): + +2010-01-22 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Kenneth Rohde Christiansen. + + QState::polished() was renamed to QState::propertiesAssigned() when + Qt 4.6.0 was released. + + * QGVLauncher/main.cpp: + (MainWindow::init): + +2010-01-21 Diego Gonzalez <diego.gonzalez@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] add setDomainRelaxationForbiddenForURLScheme in Qt DRT + https://bugs.webkit.org/show_bug.cgi?id=33945 + + * Api/qwebsecurityorigin.cpp: + (qt_drt_setDomainRelaxationForbiddenForURLScheme): + +2010-01-21 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Antti Koivisto. + + [Qt] Implement GraphicsLayer for accelerated layer compositing + https://bugs.webkit.org/show_bug.cgi?id=33514 + + Here we have the QGraphicsWebView support for accelerated compositing + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewOverlay::q): access to container object + (QGraphicsWebViewOverlay::boundingRect): overlay has same rect as the + webview + (QGraphicsWebViewOverlay::paint): paint everything but the contents + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): some vars needed + for accelerated compositing + (QGraphicsWebViewPrivate::): + (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): + (QGraphicsWebViewPrivate::setRootGraphicsLayer): make sure we have a + scrollbar overlay, and that the new graphics layer is parented by the + web-view + (QGraphicsWebViewPrivate::markForSync): flush changes at earliest + convenience or during the next draw + + (QGraphicsWebViewPrivate::updateCompositingScrollPosition): sync the + position of the compositing layer with the scroll position + (QGraphicsWebViewPrivate::syncLayers): flush changes now + (QGraphicsWebViewPrivate::scroll): make sure we also move the + compositing layer + (QGraphicsWebViewPrivate::update): also update the overlay if needed + (QGraphicsWebView::QGraphicsWebView): initialize overlay with 0 + (QGraphicsWebView::paint): paint only contents if we have an overlay, + sync the compositing layers now if needed + (QGraphicsWebView::setPage): also clean up the compositing + (QGraphicsWebView::updateGeometry): also update overlay geo + (QGraphicsWebView::setGeometry): also update overlay geo + * Api/qgraphicswebview.h: reimp compositing stuff from QWebPageClient + * Api/qwebsettings.cpp: init new settings flag for compositing as + false + (QWebSettingsPrivate::apply): apply new settings flag for compositing + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: new settings flag for compositing + * Api/qwebview.cpp: + (QWebView::setPage): qwebview doesn't support compositing: always false + * QGVLauncher/main.cpp: + (WebView::WebView): some more cmdline arguments + compositing + (MainWindow::init): some more cmdline arguments + (main): ditto + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::attachRootGraphicsLayer): reimp for + accel-compositing + (WebCore::ChromeClientQt::setNeedsOneShotDrawingSynchronization): + reimp for accel compositing + (WebCore::ChromeClientQt::scheduleCompositingLayerSync): reimp for + accel compositing + * WebCoreSupport/ChromeClientQt.h: reimps for accel compositing + +2010-01-21 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Improve the autotests of QtWebkit + https://bugs.webkit.org/show_bug.cgi?id=32216 + + Remove qWait() of the test when possible. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::loadFinished): + (tst_QWebPage::database): + (tst_QWebPage::testEnablePersistentStorage): + (tst_QWebPage::errorPageExtension): + (tst_QWebPage::screenshot): + +2010-01-21 Simon Hausmann <simon.hausmann@nokia.com> + + Prospective build fix for the Qt build. + + Fix compilation against Qt without WebKit support by not including QtWebKit/QWebView + but widget.h instead and instantiating QWebView through a typedef, to ensure we're using + our locally built WebKit. + + * tests/hybridPixmap/widget.h: + * tests/hybridPixmap/widget.ui: + +2010-01-21 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Adding QPixmap/QImage support for the Qt hybrid layer + https://bugs.webkit.org/show_bug.cgi?id=32461 + + * tests/hybridPixmap: Added. + * tests/hybridPixmap/hybridPixmap.pro: Added. + * tests/hybridPixmap/resources.qrc: Added. + * tests/hybridPixmap/test.html: Added. + * tests/hybridPixmap/tst_hybridPixmap.cpp: Added. + (tst_hybridPixmap::tst_hybridPixmap): tests most of the use cases for + hybrid pixmap/image manipulation + (tst_hybridPixmap::init): QTestLib initialization + (tst_hybridPixmap::cleanup): QTestLib cleanup + (tst_hybridPixmap::hybridPixmap): run the html file + * tests/hybridPixmap/widget.cpp: Added. + (Widget::Widget): + (Widget::refreshJS): + (Widget::start): + (Widget::completeTest): + (Widget::setPixmap): + (Widget::pixmap): + (Widget::setImage): + (Widget::image): + (Widget::~Widget): + (Widget::changeEvent): + (Widget::compare): + (Widget::imageSlot): + (Widget::pixmapSlot): + (Widget::randomSlot): + * tests/hybridPixmap/widget.h: Added. + * tests/hybridPixmap/widget.ui: Added. + * tests/tests.pro: + +2010-01-21 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Custom select popups. + https://bugs.webkit.org/show_bug.cgi?id=33418 + + Adjusting QtFallbackWebPopupCombo to the changes in WebCore layer. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::QtFallbackWebPopupCombo): + (WebCore::QtFallbackWebPopupCombo::showPopup): + (WebCore::QtFallbackWebPopupCombo::hidePopup): + (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::show): + (WebCore::QtFallbackWebPopup::hide): + (WebCore::QtFallbackWebPopup::populate): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-01-19 Steve Block <steveblock@google.com> + + Reviewed by Adam Barth. + + Renames WebCore/bridge/runtime.[cpp|h] to WebCore/bridge/Bridge.[cpp|h] + https://bugs.webkit.org/show_bug.cgi?id=33801 + + * Api/qwebframe.cpp: + +2010-01-14 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Adam Roben. + + Drag and Drop source/destination code needs cleanup. + <https://bugs.webkit.org/show_bug.cgi?id=33691>. + + Update to new way of calling sourceOperation. + + * WebCoreSupport/DragClientQt.cpp: + (WebCore::DragClientQt::startDrag): + +2010-01-14 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Symbian build fixes. + + * tests/qwebpage/tst_qwebpage.cpp: Include util.h + * tests/tests.pri: Don't define TESTS_SOURCE_DIR, it doesn't work. + * tests/util.h: Define TESTS_SOURCE_DIR here, just like it's done in Qt. + +2010-01-14 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Update Symbian .def symbol export files after private API additions. + + * symbian/bwins/QtWebKitu.def: + * symbian/eabi/QtWebKitu.def: + +2010-01-13 Darin Adler <darin@apple.com> + + Reviewed by Dan Bernstein. + + Move more of the selection and caret painting code from Frame to SelectionController. + https://bugs.webkit.org/show_bug.cgi?id=33619 + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): Seems possibly wrong to be directly invoking this + setCaretVisible here, but I updated it to call it in its new location. + +2010-01-11 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Holger Freyther. + + [Qt] Add private API for QWebFrame scrolling, to maintain binary compatibility with Qt 4.6. + + This is just a temporary addition until we have introduced #ifdefs to allow + safely removing the private API again. + + * Api/qwebframe.cpp: + (qtwebkit_webframe_scrollRecursively): + +2010-01-10 Robert Hogan <robert@roberthogan.net> + + Reviewed by Adam Barth. + + [Qt] Add enableXSSAuditor support to QWebSettings and DRT. + + https://bugs.webkit.org/show_bug.cgi?id=33419 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-01-09 Daniel Bates <dbates@webkit.org> + + No review, rolling out r53044. + http://trac.webkit.org/changeset/53044 + https://bugs.webkit.org/show_bug.cgi?id=33419 + + We need to look into this some more because the Qt + bot is failing the XSSAuditor tests. See bug #33419 + for more details. + + * Api/qwebsettings.cpp: + * Api/qwebsettings.h: + +2010-01-09 Daniel Bates <dbates@webkit.org> + + Reviewed by Adam Barth. + + https://bugs.webkit.org/show_bug.cgi?id=33419 + + Adds support for the XSSAuditor to the Qt DRT. + + * Api/qwebsettings.cpp: Updated comment to reflect added key XSSAuditorEnabled. + * Api/qwebsettings.h: Adds settings key XSSAuditorEnabled. + +2010-01-08 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Delegation client + https://bugs.webkit.org/show_bug.cgi?id=32826 + + Added method createPopup to ChromeClientQt used to create popups. + QtFallbackWebPopup moved from WebCore/platform/qt to + WebKit/qt/WebCoreSupport. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createPopup): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/QtFallbackWebPopup.cpp: Added. + (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::show): + (WebCore::QtFallbackWebPopup::populate): + (WebCore::QtFallbackWebPopup::showPopup): + (WebCore::QtFallbackWebPopup::hidePopup): + (WebCore::QtFallbackWebPopup::activeChanged): + (WebCore::QtFallbackWebPopup::setParent): + * WebCoreSupport/QtFallbackWebPopup.h: Added. + (WebCore::QtFallbackWebPopup::hide): + +2010-01-07 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Allow the application to override online/offline network status + https://bugs.webkit.org/show_bug.cgi?id=32684 + + Add a setting so that applications can overide the network status. + Applications that use this setting still need to block network access + through QNAM. + + * Api/qwebsettings.cpp: + (qt_networkAccessAllowed): + +2010-01-07 Yongjun Zhang <yongjun.zhang@nokia.com>, Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] need an API to suspend and resume active Javascript DOM objects. + https://bugs.webkit.org/show_bug.cgi?id=31673 + + Add suspend and resume DOM objects private API to QWebFrame. + + * Api/qwebframe.cpp: + (qt_suspendActiveDOMObjects): + (qt_resumeActiveDOMObjects): + +2010-01-06 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Return an invalid Qt::ImMicroFocus if queried while the view needs to layout. + + https://bugs.webkit.org/show_bug.cgi?id=33204 + + * Api/qwebpage.cpp: + (QWebPage::inputMethodQuery): + +2010-01-05 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Drag & drop layout tests fail even when run manually + https://bugs.webkit.org/show_bug.cgi?id=33055 + + No new tests. Fix 3 layout tests when run manually. + fast/events/drag-and-drop.html + fast/events/drag-and-drop-dataTransfer-types-nocrash.html + fast/events/drag-and-drop-fire-drag-dragover.html + Running these tests in DRT will be fixed in 31332. + + * Api/qwebpage.cpp: + (dropActionToDragOp): + (dragOpToDropAction): + (QWebPagePrivate::dragEnterEvent): + (QWebPagePrivate::dragMoveEvent): + (QWebPagePrivate::dropEvent): + Accept drag events even if they are not over a drop target. + This is to ensure that drag events will continue to be delivered. + + * Api/qwebpage_p.h: + * WebCoreSupport/DragClientQt.cpp: + (WebCore::dragOperationToDropActions): + (WebCore::dropActionToDragOperation): + (WebCore::DragClientQt::startDrag): + Send dragEnd event. + +2010-01-04 Daniel Bates <dbates@webkit.org> + + Reviewed by Eric Seidel. + + https://bugs.webkit.org/show_bug.cgi?id=33097 + + Cleans up the File menu to better conform to the File menu in Safari + both in terms of options and keyboard shortcuts. Adds a "Quit" menu + options to close all open windows. + + * QGVLauncher/main.cpp: + (MainWindow::buildUI): + +2009-12-31 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable all HTML5 persistent features for QGVLauncher + https://bugs.webkit.org/show_bug.cgi?id=33086 + + * QGVLauncher/main.cpp: Call enablePersistentStorage() + (main): + +2009-12-30 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] It should be possible to disable inspector + https://bugs.webkit.org/show_bug.cgi?id=32724 + + This change fixes the build break. Some QtWebKit interfaces + will not be fully functional (most notable QWebInspector) if + INSPECTOR is disabled. + + * Api/qwebinspector.cpp: + (QWebInspector::showEvent): + (QWebInspector::closeEvent): + * Api/qwebpage.cpp: + (webActionForContextMenuAction): + (QWebPagePrivate::getOrCreateInspector): + (QWebPagePrivate::inspectorController): + (QWebPage::triggerAction): + (QWebPage::updatePositionDependentActions): + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::showWindow): + (WebCore::InspectorClientQt::closeWindow): + +2009-12-30 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + Upstream Symbian def files from Qt 4.6. + + These files define the ABI of QtWebKit on Symbian. + + * symbian/bwins/QtWebKitu.def: Added. + * symbian/eabi/QtWebKitu.def: Added. + +2009-12-29 Daniel Bates <dbates@webkit.org> + + Reviewed by Ariya Hidayat. + + https://bugs.webkit.org/show_bug.cgi?id=32925 + + Adds an Open File dialog to make it convenient to open a file + to view in the browser. + + * QGVLauncher/main.cpp: + (MainWindow::load): Modified to call loadURL. + (MainWindow::openFile): Added. + (MainWindow::loadURL): Added. + (MainWindow::buildUI): Added menu item Open File. + +2009-12-29 Robert Hogan <robert@roberthogan.net> + + Reviewed by Eric Seidel. + + [Qt] Fix crash on LayoutTests/fast/loader/empty-embed-src-attribute.html + + Related to https://bugs.webkit.org/show_bug.cgi?id=23806 + + If an embedded document is loaded within a page and it has an empty + URL, use a blank URL for the load request. + + https://bugs.webkit.org/show_bug.cgi?id=33017 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createFrame): + +2009-12-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Rubber-stamped by Simon Hausmann and Holger Freyther. + + [Qt] Remove WebKit/qt/WebKitPart empty directory + + The content of the directory has been removed by r34888. + + * WebKitPart: Removed. + +2009-12-29 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Eric Seidel. + + [Qt] DRT: Frame loader callbacks differ from the Mac port + https://bugs.webkit.org/show_bug.cgi?id=32989 + + Remove messages from the callbacks that should not dump them to match + the expected results for the http/loading tests. + + Unskip some http/loading tests which succeed now. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage): + (WebCore::FrameLoaderClientQt::dispatchWillClose): + (WebCore::FrameLoaderClientQt::dispatchDidReceiveIcon): + (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld): + +2009-12-29 Robert Hogan <robert@roberthogan.net> + + Reviewed by Eric Seidel. + + [Qt] fix fast/dom/Window/window-onFocus.html + + Add support for layouttestcontroller.windowIsKey to Qt DRT and fix issue where + window.onblur was getting dispatched twice from QtWebKit. + + https://bugs.webkit.org/show_bug.cgi?id=32990 + + * Api/qwebpage.cpp: + (QWebPagePrivate::focusOutEvent): + +2009-12-24 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Gustavo Noronha. + + Doc : QGraphicsWebView::zoomFactor was introduced in 4.6. + + * Api/qgraphicswebview.cpp: + +2009-12-22 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Holger Freyther. + + Moved QtLauncher to WebKitTools/ + + * QtLauncher: Removed. + * QtLauncher/QtLauncher.pro: Removed. + * QtLauncher/main.cpp: Removed. + +2009-12-21 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + Doc: Minor fixes to language. + + * Api/qwebpage.cpp: + +2009-12-21 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Clean up the WebKit layer unit-tests + + - Use tests.pri for common options + - Standardize file naming + - Move all resources to 'resources' subdir + - Standardize how TESTS_SOURCE_DIR is used + - Get rid of UID3 for symbian (autogenerated) + - Don't build app bundles on Mac OS X + + * tests/benchmarks/loading/loading.pro: Added. + * tests/benchmarks/loading/tst_loading.pro: Removed. + * tests/benchmarks/painting/painting.pro: Added. + * tests/benchmarks/painting/tst_painting.pro: Removed. + * tests/qgraphicswebview/qgraphicswebview.pro: + * tests/qwebelement/qwebelement.pro: + * tests/qwebelement/qwebelement.qrc: Removed. + * tests/qwebelement/resources/image.png: Renamed from WebKit/qt/tests/qwebelement/image.png. + * tests/qwebelement/resources/style.css: Renamed from WebKit/qt/tests/qwebelement/style.css. + * tests/qwebelement/resources/style2.css: Renamed from WebKit/qt/tests/qwebelement/style2.css. + * tests/qwebelement/tst_qwebelement.qrc: Added. + * tests/qwebframe/qwebframe.pro: + * tests/qwebframe/qwebframe.qrc: Removed. + * tests/qwebframe/resources/image.png: Renamed from WebKit/qt/tests/qwebframe/image.png. + * tests/qwebframe/resources/style.css: Renamed from WebKit/qt/tests/qwebframe/style.css. + * tests/qwebframe/resources/test1.html: Renamed from WebKit/qt/tests/qwebframe/test1.html. + * tests/qwebframe/resources/test2.html: Renamed from WebKit/qt/tests/qwebframe/test2.html. + * tests/qwebframe/resources/testiframe.html: Renamed from WebKit/qt/tests/qwebframe/testiframe.html. + * tests/qwebframe/resources/testiframe2.html: Renamed from WebKit/qt/tests/qwebframe/testiframe2.html. + * tests/qwebframe/tst_qwebframe.cpp: + * tests/qwebframe/tst_qwebframe.qrc: Added. + * tests/qwebhistory/qwebhistory.pro: + * tests/qwebhistory/resources/page1.html: Renamed from WebKit/qt/tests/qwebhistory/data/page1.html. + * tests/qwebhistory/resources/page2.html: Renamed from WebKit/qt/tests/qwebhistory/data/page2.html. + * tests/qwebhistory/resources/page3.html: Renamed from WebKit/qt/tests/qwebhistory/data/page3.html. + * tests/qwebhistory/resources/page4.html: Renamed from WebKit/qt/tests/qwebhistory/data/page4.html. + * tests/qwebhistory/resources/page5.html: Renamed from WebKit/qt/tests/qwebhistory/data/page5.html. + * tests/qwebhistory/resources/page6.html: Renamed from WebKit/qt/tests/qwebhistory/data/page6.html. + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::): + * tests/qwebhistory/tst_qwebhistory.qrc: + * tests/qwebhistoryinterface/qwebhistoryinterface.pro: + * tests/qwebinspector/qwebinspector.pro: + * tests/qwebpage/qwebpage.pro: + * tests/qwebpage/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebpage/frametest/frame_a.html. + * tests/qwebpage/resources/iframe.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe.html. + * tests/qwebpage/resources/iframe2.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe2.html. + * tests/qwebpage/resources/iframe3.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe3.html. + * tests/qwebpage/resources/index.html: Renamed from WebKit/qt/tests/qwebpage/frametest/index.html. + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::backActionUpdate): + (tst_QWebPage::frameAt): + (tst_QWebPage::errorPageExtensionInFrameset): + (tst_QWebPage::screenshot): + * tests/qwebpage/tst_qwebpage.qrc: + * tests/qwebplugindatabase/qwebplugindatabase.pro: + * tests/qwebview/qwebview.pro: + * tests/qwebview/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebview/data/frame_a.html. + * tests/qwebview/resources/index.html: Renamed from WebKit/qt/tests/qwebview/data/index.html. + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::reusePage): + (tst_QWebView::crashTests): + * tests/qwebview/tst_qwebview.qrc: + * tests/resources/image2.png: Renamed from WebKit/qt/tests/qwebframe/resources/image2.png. + * tests/tests.pri: Added. + * tests/tests.pro: + +2009-12-18 Ariya Hidayat <ariya.hidayat@gmail.com> + + Build fix, not reviewed. + + * QtLauncher/main.cpp: + (MainWindow::setTouchMocking): Leave setTouchMocking as an empty + function for Qt < 4.6 so that moc still creates a slot for that. + Otherwise, it would have generated a linker error. + +2009-12-18 Adam Roben <aroben@apple.com> + + Qt build fix + + * Api/qwebpage.cpp: Added #include. + +2009-12-18 Adam Roben <aroben@apple.com> + + Qt build fix + + * Api/qwebpage.cpp: + Added #includes. + +2009-12-18 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Add new API to QWebFrame to scrollRecursively starting with any css overflow + then checking current frame and then ancestors + https://bugs.webkit.org/show_bug.cgi?id=32668 + + * Api/qwebframe.cpp: + (QWebFramePrivate::scrollOverflow): + (QWebFrame::scrollRecursively): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + * tests/qwebframe/qwebframe.qrc: + * tests/qwebframe/testiframe.html: Added. + * tests/qwebframe/testiframe2.html: Added. + * tests/qwebframe/tst_qwebframe.cpp: + +2009-12-18 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Fix infinite recursion in touch mocking. + + Don't send the fake touch events to the view, as that'll trigger the + event filter again. + + * QtLauncher/main.cpp: + (MainWindow::sendTouchEvent): + +2009-12-17 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Add support for mocking touch events with Q(GV)Launcher + https://bugs.webkit.org/show_bug.cgi?id=32434 + + The event delivery should go through QCoreApplication::sendEvent() + + * QtLauncher/main.cpp: + (MainWindow::sendTouchEvent): + +2009-12-17 Kim Grönholm <kim.gronholm@nomovok.com> + + Reviewed by Simon Hausmann. + + [Qt] Add support for touch events in QWebView and QGraphicsWebView + https://bugs.webkit.org/show_bug.cgi?id=32432 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebView::sceneEvent): + * Api/qwebview.cpp: + (QWebView::QWebView): + (QWebView::event): + +2009-12-17 Kim Grönholm <kim.gronholm@nomovok.com> + + Reviewed by Simon Hausmann. + + [Qt] Add support for mocking touch events with QtLauncher + https://bugs.webkit.org/show_bug.cgi?id=32434 + + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + (MainWindow::sendTouchEvent): + (MainWindow::eventFilter): + (MainWindow::setTouchMocking): + (MainWindow::setupUI): + +2009-12-14 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix JavaScript prompt behavior for empty/null strings. + https://bugs.webkit.org/show_bug.cgi?id=30914 + + The patch is based on the work done by Gupta Manish. + + In the default implementation of the JavaScript prompt + we are using a QInputDialog to get the text and this has + one quirk with regard to not entering any text. + + In other WebKit ports and in Firefox an empty string is + returned but in the Qt case it is a null string. + + Change the API documentation in QWebPage to mention we want to + have a non null string but do the fixup in the ChromeClientQt + to support existing code. + + * Api/qwebpage.cpp: + (QWebPage::javaScriptPrompt): Change API documentation + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::runJavaScriptPrompt): Fixup null QString + +2009-11-24 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Hausmann. + + [Qt] Do not disable the inspector on show and hide + https://bugs.webkit.org/show_bug.cgi?id=31851 + + On Qt/X11 with some window managers the window will be + hidden when switching windows. In this case all the results + are gone when coming back to the window. + + Attempt to use the CloseEvent to figure out if the window + was closed and withdrawn as this is more friendly to the + user of the inspector client. + + * Api/qwebinspector.cpp: + (QWebInspector::hideEvent): + (QWebInspector::closeEvent): + * Api/qwebinspector.h: + +2009-12-14 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Improve the autotests of QtWebkit + https://bugs.webkit.org/show_bug.cgi?id=32216 + + Refactor tst_qwebelement to remove the qWait() + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::style): + +2009-12-14 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + Fix the QWebPage inputMethods() autotest after r51758 + to compare the Qt::ImFont property's family against an explicitly + previously configured family. + + https://bugs.webkit.org/show_bug.cgi?id=32491 + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2009-12-13 Sam Weinig <sam@webkit.org> + + Reviewed by Dan Bernstein. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=32499 + Add client based Geolocation provider + + Add first cut of a client based Geolocation provider. This is guarded by + ENABLE(CLIENT_BASED_GEOLOCATION) and is off by default for now. This adds a + GeolocationControllerClient interface that no-one currently implements, + but will in a subsequent patch. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2009-12-13 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + Add a test in Qt for https://bugs.webkit.org/show_bug.cgi?id=29005 + https://bugs.webkit.org/show_bug.cgi?id=29008 + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-12-13 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Holger Freyther. + + [Qt] Re-enable QWebView::renderHints property for Qt for Symbian + + https://bugs.webkit.org/show_bug.cgi?id=28273 + + The bug in Qt's moc that triggered a linking error when declaring this + property has been fixed and we can remove the workaround. + + * Api/qwebview.h: + +2009-12-11 Yael Aharon <yael.aharon@nokia.com> + + Unreviewed build fix for Qt versions < 4.6. + + * tests/qwebframe/tst_qwebframe.cpp: + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::reusePage): + +2009-12-11 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Tor Arne Vestbø. + + [Qt] Updated QWebElement documentation + + findAll() returns a QWebElementCollection, not QList<QWebElement>. + + * docs/webkitsnippets/webelement/main.cpp: + (findAll): + +2009-12-11 Simon Hausmann <hausmann@webkit.org>, Kim Grönholm <kim.gronholm@nomovok.com> + + Reviewed by Antti Koivisto. + + Forward Qt touch events to the event handler as platform touch events. + + https://bugs.webkit.org/show_bug.cgi?id=32114 + + * Api/qwebpage.cpp: + (QWebPagePrivate::touchEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + +2009-12-07 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Improve the autotests of QtWebkit + https://bugs.webkit.org/show_bug.cgi?id=32216 + + Remove the calls to qWait() of the autotest of QWebView + + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::reusePage): + +2009-12-07 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Improve the autotests of QtWebkit + https://bugs.webkit.org/show_bug.cgi?id=32216 + + Refactor tst_qwebframe to remove qWait() and use + the function waitForSignal() from util.h + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-12-07 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Improve the autotests of QtWebkit + https://bugs.webkit.org/show_bug.cgi?id=32216 + + Refactor the test of QGraphicsWebView: + -make waitForSignal() available to all the tests. + -remove QTest::qWait() + + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::crashOnViewlessWebPages): + * tests/util.h: + (waitForSignal): + +2009-12-07 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + + [Qt] Plugins: Force windowless mode when there is no native window handle + + Inject wmode=opaque while instantiating the plugin for the case when the + webpage is not backed by a native window handle. + + https://bugs.webkit.org/show_bug.cgi?id=32059 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2009-12-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Corrects QtLauncher style + + * QtLauncher/main.cpp: + (WebPage::acceptNavigationRequest): + (MainWindow::MainWindow): + (MainWindow::webPage): + (MainWindow::webView): + (MainWindow::changeLocation): + (MainWindow::loadFinished): + (MainWindow::showLinkHover): + (MainWindow::zoomIn): + (MainWindow::zoomOut): + (MainWindow::print): + (MainWindow::setEditable): + (MainWindow::dumpHtml): + (MainWindow::selectElements): + (MainWindow::newWindow): + (MainWindow::setupUI): + (WebPage::createWindow): + (WebPage::createPlugin): + (main): + +2009-12-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QtLauncher: add a menu to show or hide the web inspector. + https://bugs.webkit.org/show_bug.cgi?id=32149 + + * QtLauncher/main.cpp: + (WebInspector::WebInspector): + (WebInspector::showEvent): + (WebInspector::hideEvent): + (MainWindow::MainWindow): + (MainWindow::setupUI): + +2009-12-04 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Antti Koivisto. + + Split out the renderPrivate in two methods, one for working on + relative coordinates (relative to the viewport) and one for + working on absolute coordinates. The latter is more effecient + for implementing tiling, as you don't need translate the coords, + and because it avoid clipping to the viewport. + + No behaviour changes, so no new tests. + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderContentsLayerAbsoluteCoords): + (QWebFramePrivate::renderRelativeCoords): + (QWebFrame::render): + * Api/qwebframe_p.h: + +2009-12-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Allow removing 'qrc' as a local security origin scheme + + * tests/qwebpage/tst_qwebpage.cpp: + +2009-12-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Clean up argument parsing in the QtLauncher + + * QtLauncher/main.cpp: + +2009-12-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Prevent the inspector from closing its wrapping widget. + This is not necessary anymore since we now hide the embedded + close button. + https://bugs.webkit.org/show_bug.cgi?id=32149 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::showWindow): + (WebCore::InspectorClientQt::closeWindow): + +2009-12-03 İsmail Dönmez <ismail@namtrac.org> + + Reviewed by Eric Seidel. + + Fix compilation when SVG is disabled. + + * Api/qwebframe.cpp: + (qt_drt_pauseSVGAnimation): + +2009-12-03 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/7214236> and http://webkit.org/b/32052 - Implement HTML5 state object history API + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidPushStateWithinPage): + (WebCore::FrameLoaderClientQt::dispatchDidReplaceStateWithinPage): + (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-12-03 Pavel Feldman <pfeldman@dhcp-172-28-174-220.spb.corp.google.com> + + Reviewed by Timothy Hatcher. + + Web Inspector: Simplify the settings support in inspector controller. + + https://bugs.webkit.org/show_bug.cgi?id=32076 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::populateSetting): + (WebCore::InspectorClientQt::storeSetting): + (WebCore::variantToSetting): + (WebCore::settingToVariant): + * WebCoreSupport/InspectorClientQt.h: + +2009-12-03 Ben Murdoch <benm@google.com> + + Reviewed by Brady Eidson. + + [Android] The FrameLoaderClient is unaware of BackForwardList changes. + https://bugs.webkit.org/show_bug.cgi?id=31914 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidAddBackForwardItem): Add an empty implementation. Method added to FrameLoaderClient by Android (see bug). + (WebCore::FrameLoaderClientQt::dispatchDidRemoveBackForwardItem): ditto. + (WebCore::FrameLoaderClientQt::dispatchDidChangeBackForwardIndex): ditto. + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com> + + Not reviewed. Try to fix Qt build. + + * Api/qwebframe.cpp: + (qt_drt_pauseSVGAnimation): + +2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Simon Fraser. + + Add SVG animation test framework with 'snapshot' functionality + https://bugs.webkit.org/show_bug.cgi?id=31897 + + Add API used by the new 'sampleSVGAnimationForElementAtTime' DRT method, + forwarding the call to SVGDocumentExtensions, if SVG is enabled. + + Implemented just like the existing pauseAnimation* methods for CSS animations. + + * Api/qwebframe.cpp: + (qt_drt_pauseSVGAnimation): + +2009-12-01 Daniel Bates <dbates@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=31898 + + Makes QtLauncher default to the http scheme for URLs. + + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + (MainWindow::changeLocation): + (main): + +2009-11-30 Abhinav Mithal <abhinav.mithal@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt][Symbian] Report SymbianOS in user agent string for Symbian + https://bugs.webkit.org/show_bug.cgi?id=31961 + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2009-11-30 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix minor waning in QtWebKit + https://bugs.webkit.org/show_bug.cgi?id=31963 + + * tests/qwebpage/tst_qwebpage.cpp: + (ErrorPage::extension): Remove info wariable as it is + not used. + +2009-11-28 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] SoftwareInputPanelRequest event sent when clicking in newly loaded page + + https://bugs.webkit.org/show_bug.cgi?id=31401 + + Don't set the event unless there is a focused node we can use + for editing afterwards. + + * Api/qwebpage.cpp: + (QWebPagePrivate::handleSoftwareInputPanel): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2009-11-26 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Holger Freyther. + + Removed unused ICO image plugin handler. + + * Plugins/ICOHandler.cpp: Removed. + * Plugins/ICOHandler.h: Removed. + * Plugins/Plugins.pro: Removed. + +2009-11-12 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Do not show the QWidget when the WebCore::Widget is hidden + https://bugs.webkit.org/show_bug.cgi?id=31203 + + The clipping code was making a QWidget visible even if the + WebCore::Widget was hidden. Fix the bug by calling setVisible + only if the WebCore::Widget Widget::isSelfVisible. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::QtPluginWidget::show): Override WebCore::Widget::show to call handleVisibility + (WebCore::QtPluginWidget::handleVisibility): New method to call setVisible when we are visible + (FrameLoaderClientQt::createPlugin): Hide the QWidget by default + +2009-11-23 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + Updated the QWebElement documentation with links to examples and + external resources. + Fixed the project file for the webelement snippet and tidied up the + markers used for quoting the code. + + * Api/qwebelement.cpp: + * docs/webkitsnippets/webelement/main.cpp: + (findAll): + * docs/webkitsnippets/webelement/webelement.pro: + +2009-11-23 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Wrong runtime instance objects of wrapped QObjects may be used if + the wrapped object died before the gc removed the instance. + + https://bugs.webkit.org/show_bug.cgi?id=31681 + + Added a unit-test to verify that wrapping a QObject with the + same identity as a previously but now dead object works. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Add instantiation tests for QWebInspector. + + * tests/qwebinspector/qwebinspector.pro: Added. + * tests/qwebinspector/tst_qwebinspector.cpp: Added. + (tst_QWebInspector::attachAndDestroy): + * tests/tests.pro: + +2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix QWebInspector destruction problem. + https://bugs.webkit.org/show_bug.cgi?id=31664 + + * Api/qwebpage.cpp: + (QWebPage::~QWebPage): + +2009-11-19 Olivier Goffart <ogoffart@trolltech.com> + + Reviewed by Simon Hausmann. + + [Qt] Normalize signal and slot signatures. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::setPage): + * Api/qwebview.cpp: + (QWebView::setPage): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::setFrame): + * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: + (wrapInFunction): + * tests/qwebframe/tst_qwebframe.cpp: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::modified): + (tst_QWebPage::database): + +2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove support for Qt v4.3 or older versions + https://bugs.webkit.org/show_bug.cgi?id=29469 + + * Api/qcookiejar.cpp: Removed. + * Api/qcookiejar.h: Removed. + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::event): + * Api/qwebframe.cpp: + (QWebFrame::load): + * Api/qwebframe.h: + * Api/qwebkitglobal.h: + * Api/qwebnetworkinterface.cpp: Removed. + * Api/qwebnetworkinterface.h: Removed. + * Api/qwebnetworkinterface_p.h: Removed. + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::acceptNavigationRequest): + (QWebPage::acceptNavigationRequest): + (QWebPage::action): + (QWebPage::userAgentForUrl): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebView::load): + (QWebView::event): + * Api/qwebview.h: + * QtLauncher/main.cpp: + (MainWindow::print): + (MainWindow::setupUI): + (main): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::download): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + (WebCore::FrameLoaderClientQt::startDownload): + (WebCore::FrameLoaderClientQt::createPlugin): + +2009-11-18 Shu Chang <Chang.Shu@nokia.com> + + Reviewed by Eric Seidel. + + [Qt] Add support for displaying deleteButton. + https://bugs.webkit.org/show_bug.cgi?id=31560 + + Test: LayoutTests/editing/deleting/5408255.html + + * Api/qwebsettings.cpp: + (graphics): + * Api/qwebsettings.h: + +2009-11-18 Paul Olav Tvete <paul.tvete@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Make the QWebElement::render() test pass when pixmaps aren't 32 bit. + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::render): + +2009-11-18 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Clarify and simplify the legal section in the overview documentation, + after review with our legal team. + + * docs/qtwebkit.qdoc: + +2009-11-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Add QtLauncher support for opening links in the default browser + + This can be triggered by either the context menu or by clicking a link + while holding down the Alt key. Opening a link in a new windows is + triggered by holding down Shift. + + * QtLauncher/main.cpp: + +2009-11-17 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QGLLauncher does not support drag&drop of local files + https://bugs.webkit.org/show_bug.cgi?id=31057 + + Enable accepting files in QGraphicsWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebView::dragEnterEvent): + +2009-11-17 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Kenneth Christiansen. + + [Qt] better test coverage for ErrorPageExtension + https://bugs.webkit.org/show_bug.cgi?id=31583 + + Improved the coverage of current ErrorPageExtension tests by + adding autotests involving frameset and iframes. + + * tests/qwebpage/tst_qwebpage.cpp: + (ErrorPage::extension): Make the ErrorPageExtension + to work for all frames, not only the main frame. + (tst_QWebPage::errorPageExtension): Stop using + the 'frameset.html' resouce in this method since + an autotest specific for frameset's is being added. + (tst_QWebPage::errorPageExtensionInIFrames): Added. + (tst_QWebPage::errorPageExtensionInFrameset): Added. + +2009-11-16 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + API documentation fixes. + + * Api/qgraphicswebview.cpp: Removed duplicate docs. + * Api/qwebelement.cpp: Added missing docs. + * Api/qwebsettings.cpp: Ditto. + +2009-11-14 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Antti Koivisto. + + [Qt] Broken back/forward after using ErrorPageExtension to set error page + https://bugs.webkit.org/show_bug.cgi?id=30573 + + Implemented autotests for covering the back/forward + reset problem involving error pages. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::errorPageExtension): + +2009-11-13 Adam Roben <aroben@apple.com> + + Update for changes to FrameLoaderClient + + Fixes <http://webkit.org/b/31124> Tell the WebFrameLoadDelegate when + window objects in isolated worlds are cleared + + Reviewed by Dave Hyatt. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld): + * WebCoreSupport/FrameLoaderClientQt.h: + Replaced windowObjectCleared with this function. Does nothing if the + passed-in world is not the mainThreadNormalWorld(). + +2009-11-13 Andras Becsi <becsi.andras@stud.u-szeged.hu> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable Page Cache if setMaximumPagesInCache needs it. + This fixes https://bugs.webkit.org/show_bug.cgi?id=31266. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::setMaximumPagesInCache): + +2009-11-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix initial QWebView focus behavior. + + focusController->setFocused(true) was not always called. + https://bugs.webkit.org/show_bug.cgi?id=31466 + + * Api/qwebpage.cpp: + (QWebPagePrivate::focusInEvent): + +2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + Update documentation for the Qt API + + * Api/qgraphicswebview.cpp: + * Api/qwebelement.cpp: + * Api/qwebframe.cpp: + * Api/qwebsettings.cpp: + * Api/qwebview.cpp: + +2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + Use correct install-path when running qdoc3 + + * docs/docs.pri: + +2009-11-12 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Darin Adler. + + externalRepresentation should take Frame as the argument + https://bugs.webkit.org/show_bug.cgi?id=31393 + + No new tests as this is just a refactoring. + + * Api/qwebframe.cpp: + (QWebFrame::renderTreeDump): + +2009-11-12 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Jan Alonzo. + + [Qt] Various doc fixes + https://bugs.webkit.org/show_bug.cgi?id=31358 + + QWebPage's constructor docs are mentioning "QWebView": + "Constructs an empty QWebView with parent". + + * Api/qwebpage.cpp: + +2009-11-12 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Custom printing shrink factors + https://bugs.webkit.org/show_bug.cgi?id=29042 + + This reverts commit r49769. The public API for this needs to be reviewed + before its inclusion in Qt. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2009-11-11 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Kenneth Christiansen. + + [Qt] Various doc fixes + https://bugs.webkit.org/show_bug.cgi?id=31358 + + Fixed wrong documentation: item's dimensions do fit to Web page + content by default. + + Kenneth agreed to land this as a followup patch to the + just landed documentation patch. + + * Api/qgraphicswebview.cpp: + +2009-11-11 David Boddie <dboddie@trolltech.com> + + Reviewed by Kenneth Christiansen. + + [Qt] Various doc fixes + https://bugs.webkit.org/show_bug.cgi?id=31323 + + Fixed and synchronized QWebView related documentation. + + * Api/qgraphicswebview.cpp: + * Api/qwebview.cpp: + +2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed buildbot fix. + + Export a method to the DRT to know if the document has a + document element. + + * Api/qwebframe.cpp: + (qt_drt_hasDocumentElement): + +2009-11-11 Liang QI <liang.qi@nokia.com> + + [Qt] Fix tst_qwebpage and tst_qwebframe compilation on Symbian. + + * tests/qwebframe/qwebframe.pro: + * tests/qwebframe/tst_qwebframe.cpp: + * tests/qwebpage/qwebpage.pro: + * tests/qwebpage/tst_qwebpage.cpp: + +2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Fix a crash in the layout test plugins/document-open.html + + * Api/qwebframe.cpp: + (QWebFrame::toPlainText): + +2009-11-11 Warwick Allison <warwick.allison@nokia.com>, Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Regression: Preserve the parent of plugin objects when using + QtWebKit with only a QWebPage. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): Don't reparent + plugins to 0. + * tests/qwebpage/tst_qwebpage.cpp: + (PluginCounterPage::PluginCounterPage): Initialize m_pluginParent to 0. + (PluginCounterPage::~PluginCounterPage): Delete the plugin parent later + (after the page) + (PluginTracerPage::createPlugin): Assign a dummy parent to the plugin. + (PluginTracerPage::PluginTracerPage): Set up the plugin parent. + (tst_QWebPage::createViewlessPlugin): Verify that for viewless pages the + plugin parent remains unchanged. + +2009-11-11 David Boddie <dboddie@trolltech.com> + + [Qt] Doc: Added internal or hidden placeholder documentation. + + * Api/qwebpage.cpp: + +2009-11-11 Martin Smith <msmith@trolltech.com> + + [Qt] doc: Changed Trolltech to Nokia + + * Api/qwebview.cpp: + +2009-11-11 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=31323 + Fix a few compiler warnings + + * tests/qwebframe/tst_qwebframe.cpp: Add extra brackets + to make it explicit where the else case belongs + +2009-11-11 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Fix enabling of software input panel when activating editable elements + in QGraphicsWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::inputMethodEnabled): Implement method to + query for input method support. + * Api/qwebpage.cpp: + (QWebPageWidgetClient::inputMethodEnabled): Ditto for QWidget. + (QWebPagePrivate::handleSoftwareInputPanel): Don't use view() to + test for input method support. Instead query using QWebPageClient + and send the SIPR event to the ownerWidget() instead of the view(). + The latter is null for QGraphicsWebView. + * tests/qwebpage/tst_qwebpage.cpp: + (EventSpy::EventSpy): + (EventSpy::eventFilter): + (tst_QWebPage::inputMethods): Modify the test to verify that SIPR + events are dispatched when activating focusable content. + +2009-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed documentation fixes. + + Added a few improvements from Jocelyn Turcotte to the + createWindow docs. + + * Api/qwebview.cpp: + +2009-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed documentation fix. + + [Qt] Make qwebpage's createWindow not qwebview dependent. + https://bugs.webkit.org/show_bug.cgi?id=30771 + + Update documentation to make it clear that a reimplementation + of the createWindow method of the associated QWebPage can + result in the QWebView::createWindow method to never be called. + + * Api/qwebview.cpp: + +2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Few classes have virtual functions but non-virtual destructor + https://bugs.webkit.org/show_bug.cgi?id=31269 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): Add virtual + destructor. + +2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=30628 + Add an API to get all the attributes from a QWebElement. + + * Api/qwebelement.cpp: + (QWebElement::attributesName): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::listAttributes): + +2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Use explicit parentheses to silence gcc 4.4 -Wparentheses warnings + https://bugs.webkit.org/show_bug.cgi?id=31040 + + * Api/qwebpage.cpp: + (QWebPagePrivate::handleScrolling): + +2009-11-09 Mark Mentovai <mark@chromium.org> + + Reviewed by Dan Bernstein. + + Track "can have scrollbar" state within FrameView independently of the + individual scrollbar states in ScrollView. + + rdar://problem/7215132, https://bugs.webkit.org/show_bug.cgi?id=29167 + REGRESSION (r48064): mint.com loses scrollbars after coming out of + edit mode. + + rdar://problem/7314421, https://bugs.webkit.org/show_bug.cgi?id=30517 + REGRESSION (r48064): Extra scroll bars in GarageBand Lesson Store. + + Test: fast/overflow/scrollbar-restored.html + + * Api/qwebframe.cpp: + (QWebFrame::setScrollBarPolicy): + +2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=30772 + Add a non-const iterator to QWebElementCollection. + Move the two attributes of the iterator to private. + + * Api/qwebelement.h: + (const_iterator::begin): + (const_iterator::end): + (const_iterator::constBegin): + (const_iterator::constEnd): + (const_iterator::iterator::iterator): + (const_iterator::iterator::operator*): + (const_iterator::iterator::operator==): + (const_iterator::iterator::operator!=): + (const_iterator::iterator::operator<): + (const_iterator::iterator::operator<=): + (const_iterator::iterator::operator>): + (const_iterator::iterator::operator>=): + (const_iterator::iterator::operator++): + (const_iterator::iterator::operator--): + (const_iterator::iterator::operator+=): + (const_iterator::iterator::operator-=): + (const_iterator::iterator::operator+): + (const_iterator::iterator::operator-): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::nonConstIterator): + (tst_QWebElement::constIterator): + +2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Christiansen. + + [Qt] Remove the sessionStorage setting (per Page) + https://bugs.webkit.org/show_bug.cgi?id=31249 + + This setting allows to run sessionStorage on/off on a per page + basis. Remove this prematurely exposed API. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::database): + (tst_QWebPage::testOptionalJSObjects): + +2009-11-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Remove the QWebPage:webInspectorTriggered signal. + User customization of the communication between QWebPage + and QWebInspector will be properly designed in the next version. + https://bugs.webkit.org/show_bug.cgi?id=30773 + + * Api/qwebinspector.cpp: + * Api/qwebpage.cpp: + (QWebPagePrivate::getOrCreateInspector): + (QWebPage::triggerAction): + * Api/qwebpage.h: + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + +2009-11-05 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Added a missing re-implementation of QGraphicsItem::inputMethodQuery(). + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::inputMethodQuery): + * Api/qgraphicswebview.h: + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Provide a dummy re-implementation of QGraphicsLayoutItem::sizeHint(), + similar to QWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::sizeHint): + * Api/qgraphicswebview.h: + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Removed zoomFactoryChanged() signal and added + linkClicked() to QGraphicsWebView, for consistency with + QWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::setPage): + (QGraphicsWebView::setZoomFactor): + * Api/qgraphicswebview.h: + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Added QGraphicsWebView::findText() for convenience and consistency + with QWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::findText): + * Api/qgraphicswebview.h: + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Added QGraphicsWebView::pageAction() and triggerPageAction(), for + consistency with QWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::pageAction): + (QGraphicsWebView::triggerPageAction): + * Api/qgraphicswebview.h: + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Removed QGraphicsWebView::toHtml() after API review. + + That's consistent with QWebView and also based on the assumption that + toHtml() is called less frequently than setHtml(). + + * Api/qgraphicswebview.cpp: + * Api/qgraphicswebview.h: + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::qgraphicswebview): + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Removed the interactive property of QGraphicsWebView. + + There are clearly use-cases for this feature, but it will require + more work to make this fully work with an enum to have fine-grained + control over the interactivity levels. For now it is easy to achieve + in user-code what the boolean property did. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebView::hoverMoveEvent): + (QGraphicsWebView::mouseMoveEvent): + (QGraphicsWebView::mousePressEvent): + (QGraphicsWebView::mouseReleaseEvent): + (QGraphicsWebView::mouseDoubleClickEvent): + (QGraphicsWebView::keyPressEvent): + (QGraphicsWebView::keyReleaseEvent): + (QGraphicsWebView::dragLeaveEvent): + (QGraphicsWebView::dragMoveEvent): + (QGraphicsWebView::dropEvent): + (QGraphicsWebView::wheelEvent): + (QGraphicsWebView::inputMethodEvent): + * Api/qgraphicswebview.h: + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::qgraphicswebview): + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Make the QGraphicsWebView constructor explicit. + + * Api/qgraphicswebview.h: + +2009-11-05 Shu Chang <Chang.Shu@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Add support for Shift-PageUp and Shift-PageDown key events. + https://bugs.webkit.org/show_bug.cgi?id=31166 + + Test: LayoutTests/editing/selection/shrink-selection-after-shift-pagedown.html + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2009-11-05 Simon Hausmann <hausmann@webkit.org> + + Last Qt 4.5 build fix (*sigh*) + + * tests/qwebpage/tst_qwebpage.cpp: + (inputMethodHints): inputMethodHints() is only used for + Qt 4.6, so guard the whole function. + +2009-11-05 Simon Hausmann <hausmann@webkit.org> + + Another prospective build fix against Qt 4.5 (build bot) + + Don't compile & run the QGraphicsWebView portion of the + input methods auto test with Qt 4.5. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods_data): + (inputMethodHints): + (inputMethodEnabled): + (tst_QWebPage::inputMethods): + +2009-11-05 Simon Hausmann <hausmann@webkit.org> + + Prospective build fix against Qt 4.5 (build bot) + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::setInputMethodEnabled): Guard the + use of Qt 4.6 specific API with #ifdefs. + +2009-11-01 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Kenneth Christiansen. + + [Qt] Fix enabling of input method support on QGraphicsWebView. + https://bugs.webkit.org/show_bug.cgi?id=30605 + + Instead of setting the unsupported widget attribute on the + QGraphicsWidget in setInputMethodEnabled() set the + ItemAcceptsInputMethod GraphicsItem flag directly. + + Changed the existing input method auto test to run once + on a QWebView and once on a QGraphicsWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::setInputMethodEnabled): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods_data): + (inputMethodHints): + (inputMethodEnabled): + (tst_QWebPage::inputMethods): + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Kenneth Christiansen. + + Added QGraphicsWebView::modified property, for consistency + with QWebView. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::isModified): + * Api/qgraphicswebview.h: + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::qgraphicswebview): + +2009-11-04 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Kenneth Christiansen. + + Removed status and progress properties of QGraphicsWebView. + Added loadProgress and statusBarMessage signals instead, + after API review. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): + (QGraphicsWebView::setPage): + * Api/qgraphicswebview.h: + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::qgraphicswebview): + +2009-11-04 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] REGRESSION: Allow applications to use their own QWidget bypassing QWebView. + https://bugs.webkit.org/show_bug.cgi?id=30979 + + Decouple QWebViewPrivate from QWebPageClient, and automatically create + QWebPageWidgetClient whenever the view is QWidget based. + + * Api/qwebpage.cpp: + (QWebPageWidgetClient::QWebPageWidgetClient): + (QWebPageWidgetClient::scroll): + (QWebPageWidgetClient::update): + (QWebPageWidgetClient::setInputMethodEnabled): + (QWebPageWidgetClient::setInputMethodHint): + (QWebPageWidgetClient::cursor): + (QWebPageWidgetClient::updateCursor): + (QWebPageWidgetClient::palette): + (QWebPageWidgetClient::screenNumber): + (QWebPageWidgetClient::ownerWidget): + (QWebPageWidgetClient::pluginParent): + (QWebPage::setView): + * Api/qwebview.cpp: + (QWebView::~QWebView): + (QWebView::setPage): + (QWebView::event): + +2009-11-03 Andras Becsi <becsi.andras@stud.u-szeged.hu> + + Reviewed by Simon Hausmann. + + [Qt] Fix build of unit-test after r50454. + + * tests/qwebpage/tst_qwebpage.cpp: + +2009-11-03 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Make QWebPluginDatabase private API for now. + + https://bugs.webkit.org/show_bug.cgi?id=30775 + + * Api/headers.pri: + * Api/qwebplugindatabase.cpp: + * Api/qwebplugindatabase_p.h: Renamed from WebKit/qt/Api/qwebplugindatabase.h. + * Api/qwebsettings.cpp: + * Api/qwebsettings.h: + * QtLauncher/main.cpp: + (MainWindow::setupUI): + * tests/tests.pro: + +2009-11-03 Simon Hausmann <hausmann@webkit.org> + + Rubber-stamped by Tor Arne Vestbø. + + Oops, also remove the API docs of the removed networkRequestStarted() signal. + + * Api/qwebpage.cpp: + +2009-11-03 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Replace the QWebPage::networkRequestStarted() signal with the originatingObject + property set to the QWebFrame that belongs to the request. + + https://bugs.webkit.org/show_bug.cgi?id=29975 + + * Api/qwebpage.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + (WebCore::FrameLoaderClientQt::startDownload): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::loadFinished): + (TestNetworkManager::createRequest): + (tst_QWebPage::originatingObjectInNetworkRequests): + +2009-11-02 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Adam Barth. + + QWebView crash fix. + + The QWebView should not crash if the stop() method is called from + a function triggered by the loadProgress signal. + + A null pointer protection was added in the ProgressTracker::incrementProgress. + + New autotest was created. + + https://bugs.webkit.org/show_bug.cgi?id=29425 + + * tests/qwebview/tst_qwebview.cpp: + (WebViewCrashTest::WebViewCrashTest): + (WebViewCrashTest::loading): + (tst_QWebView::crashTests): + +2009-11-01 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Eric Seidel. + + Turn on warnings for QtWebKit for gcc + https://bugs.webkit.org/show_bug.cgi?id=30958 + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): Reorder initialization list + to fix compiler warnings. + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): Ditto. + +2009-10-30 Evan Stade <estade@chromium.org> + + Reviewed by David Levin. + + Notify the chrome when the focused node has changed. + https://bugs.webkit.org/show_bug.cgi?id=30832 + + Added stub implementation for new ChromeClient function. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::focusedNodeChanged): + * WebCoreSupport/ChromeClientQt.h: + +2009-10-30 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Remove the QWebInspector::windowTitleChanged signal, + QEvent::WindowTitleChange can be used to achieve the same. + https://bugs.webkit.org/show_bug.cgi?id=30927 + + * Api/qwebinspector.cpp: + * Api/qwebinspector.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::updateWindowTitle): + +2009-10-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Implement DELETE HTTP method for XmlHttpRequest + https://bugs.webkit.org/show_bug.cgi?id=30894 + + No new tests as this functionality is already tested by the + xmlhttprequest LayoutTests. As this patch depends on an unreleased + version of the dependent QtNetwork library and the tests will be + enabled later once the dependent library is released (and the + buildbot is updated). + + * Api/qwebframe.cpp: + (QWebFrame::load): + +2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Remove QWebView::guessUrlFromString() and replace its use + with the new QUrl::fromUserInput() if using Qt 4.6 or newer. + + * Api/qwebview.cpp: + * Api/qwebview.h: + * QGVLauncher/main.cpp: + (urlFromUserInput): + (WebPage::applyProxy): + (MainWindow::load): + * QtLauncher/main.cpp: + (urlFromUserInput): + (MainWindow::MainWindow): + (MainWindow::changeLocation): + * tests/qwebview/tst_qwebview.cpp: + +2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Serialize directly to the stream, and not first to an QByteArray, + that is later serialized. That is slower and also uses more bytes. + + * Api/qwebhistory.cpp: + (operator<<): + (operator>>): + +2009-10-28 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Eric Seidel. + + [Qt] WebFrame::counterValueForElementById must not be exposed + https://bugs.webkit.org/show_bug.cgi?id=30882 + + * Api/qwebframe.cpp: + (qt_drt_counterValueForElementById): + * Api/qwebframe.h: + +2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Darin Adler. + + Provide a way to get counter values with layoutTestContoller + https://bugs.webkit.org/show_bug.cgi?id=30555 + + * Api/qwebframe.cpp: + (QWebFrame::counterValueForElementById): + (QWebHitTestResult::frame): + * Api/qwebframe.h: + +2009-10-28 Antonio Gomes <tonikitoo@webkit.org> + + Pushing missing WebKit/qt/tests/qwebframe/resources/ dir from bug 29248. + + [Qt] [API] Make it possible to have 'invisible' loads + https://bugs.webkit.org/show_bug.cgi?id=29248 + + * tests/qwebframe/resources/image2.png: Copied from WebKit/qt/tests/qwebelement/image.png. + +2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + [Qt] QWebHistory::saveState() is inconsistent with the Qt API + https://bugs.webkit.org/show_bug.cgi?id=30710 + + Make the versioning internal and enforce it in the WebCore + part. Adjust the comments, as well as remove now dead code. + + * Api/qwebhistory.cpp: + (operator<<): + (operator>>): + * Api/qwebhistory.h: + +2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Holger Freyther. + + [Qt] QWebHistory::saveState() is inconsistent with the Qt API + https://bugs.webkit.org/show_bug.cgi?id=30710 + + Remove the QWebHistory::saveState() and ::restoreState() as + they are inconsistent with the Qt API. + + Update unittests to reflect the change. + + * Api/qwebhistory.cpp: + (operator<<): + (operator>>): + * Api/qwebhistory.h: + * tests/qwebhistory/tst_qwebhistory.cpp: + (saveHistory): + (restoreHistory): + (tst_QWebHistory::saveAndRestore_crash_1): + (tst_QWebHistory::saveAndRestore_crash_2): + (tst_QWebHistory::saveAndRestore_crash_3): + (tst_QWebHistory::clear): + +2009-10-27 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Holger Freyther. + + Complementary fix to bug 30779. + + By mistake I used QWeakPointer's toStrongRef() method which docs + explicitly say to not be used in this situation (when the tracked + pointer is devired from QObject). Instead QWeakPointer's data() + is recommended. + + * Api/qwebpage.cpp: + (QWebPage::view): + +2009-10-27 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Fraser. + + Change HitTestResult methods to use (3d) transformation aware methods + https://bugs.webkit.org/show_bug.cgi?id=27347 + + The HitTestResult::boundingBox method was removed. The + RenderObject must be used directly. In contrast to the + old HitTestResult::boundingBox method this code must use + a (3d) transformation aware method to not run into an + assert in SVGRenderBase::mapLocalToContainer. + + * Api/qwebframe.cpp: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): + +2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Rubberstamped by Oliver Hunt. + + Change two methods to be internal for DRT use only. + + Part of [Qt] Review all new API in Qt 4.6 + https://bugs.webkit.org/show_bug.cgi?id=29843#c11 + + * Api/qwebsecurityorigin.cpp: + (qt_drt_whiteListAccessFromOrigin): + (qt_drt_resetOriginAccessWhiteLists): + (QWebSecurityOrigin::localSchemes): + * Api/qwebsecurityorigin.h: + +2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Make sure that initiating a rotation while rotating won't make + it end up at rotation positions that are not a multiply of + 180 degrees. + + * QGVLauncher/main.cpp: + (MainView::animatedFlip): + +2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed Qt build fix. + + Update the tests as well to the new API change. + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::clear): + +2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Rubberstamped by Tor Arne Vestbø. + + [Qt] QWebElement::removeChildren() should be + QWebElement::removeAllChildren() + https://bugs.webkit.org/show_bug.cgi?id=30630 + + * Api/qwebelement.cpp: + (QWebElement::removeAllChildren): + * Api/qwebelement.h: + +2009-10-27 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Antti Koivisto and Holger Freyther. + + Make QWebPagePrivate's (QWidget) view to be a QWeakPointer. + https://bugs.webkit.org/show_bug.cgi?id=30779 + + The fact that it was been set from external objects of qwebpage + and not being deleted internally can lead to dangling references. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::~QGraphicsWebView): + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::createContextMenu): + (QWebPagePrivate::handleSoftwareInputPanel): + (QWebPagePrivate::keyPressEvent): + (QWebPage::setView): + (QWebPage::view): + (QWebPage::javaScriptAlert): + (QWebPage::javaScriptConfirm): + (QWebPage::javaScriptPrompt): + (QWebPage::shouldInterruptJavaScript): + (QWebPage::createWindow): + (QWebPage::extension): + (QWebPage::chooseFile): + (QWebPage::userAgentForUrl): + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebView::~QWebView): + +2009-10-26 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed documentation fix from David Boddie (Qt Doc Team) + + Removes the check around the RenderHints property documentation + that was clearly added to synchronize the source and header files + when the #if !defined(Q_OS_SYMBIAN) guards was added to the + property. + + The documentation has also been updated to ensure that Symbian + users know that there is no actual RenderHints property on their + platform. + + * Api/qwebview.cpp: + +2009-10-26 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed documentation fix from David Boddie (Qt Doc Team) + + Ensure that qdoc will always see the RenderHints property. + + The property was only defined in the header file if the Q_OS_SYMBIAN + symbol was not defined, resulting in the property not showing up + in the Qt documentation just because one platform doesn't support it. + + A follow up commit will improve the documentation for the property + and note that it is not supported on the Symbiam platform. + + * Api/qwebview.h: + +2009-10-26 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Reintroduce QWebElementCollection + + Revert the patch that has replaced QWebElementCollection + with QList<QWebElement>. Update the tests accordingly. + + Remove the constness of the return type of QWebElement operator[]. + + https://bugs.webkit.org/show_bug.cgi?id=30767 + + * Api/qwebelement.cpp: + (QWebElement::findAll): + (QWebElementCollectionPrivate::QWebElementCollectionPrivate): + (QWebElementCollectionPrivate::create): + (QWebElementCollection::QWebElementCollection): + (QWebElementCollection::operator=): + (QWebElementCollection::~QWebElementCollection): + (QWebElementCollection::operator+): + (QWebElementCollection::append): + (QWebElementCollection::count): + (QWebElementCollection::at): + (QWebElementCollection::toList): + * Api/qwebelement.h: + (const_iterator::begin): + (const_iterator::end): + (const_iterator::operator[]): + * Api/qwebframe.cpp: + (QWebFrame::findAllElements): + * Api/qwebframe.h: + * QtLauncher/main.cpp: + (MainWindow::selectElements): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::simpleCollection): + (tst_QWebElement::iteration): + (tst_QWebElement::emptyCollection): + (tst_QWebElement::appendCollection): + (tst_QWebElement::nullSelect): + (tst_QWebElement::hasSetFocus): + (tst_QWebElement::render): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2009-10-24 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Holger Freyther. + + [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian + https://bugs.webkit.org/show_bug.cgi?id=30476 + + Assign ReadUserData WriteUserData NetworkServices Symbian capabilities + to all QtWebkit executables. + + * QGVLauncher/QGVLauncher.pro: + * QtLauncher/QtLauncher.pro: + * tests/benchmarks/loading/tst_loading.pro: + * tests/benchmarks/painting/tst_painting.pro: + * tests/qgraphicswebview/qgraphicswebview.pro: + * tests/qwebelement/qwebelement.pro: + * tests/qwebframe/qwebframe.pro: + * tests/qwebhistory/qwebhistory.pro: + * tests/qwebhistoryinterface/qwebhistoryinterface.pro: + * tests/qwebpage/qwebpage.pro: + * tests/qwebplugindatabase/qwebplugindatabase.pro: + * tests/qwebview/qwebview.pro: + +2009-10-22 Gavin Barraclough <barraclough@apple.com> + + Reviewed by NOBODY (speculative build fix - qt is currently already broken!) + Build fix following bug #30696. + + * Api/qwebelement.cpp: + (setupScriptContext): + * Api/qwebframe.cpp: + (QWebFrame::evaluateJavaScript): + +2009-10-22 Shu Chang <Chang.Shu@nokia.com> + + Reviewed by Eric Seidel. + + [Qt] Enable track visited links in QWebPage + https://bugs.webkit.org/show_bug.cgi?id=30574 + + Test: fast/history/clicked-link-is-visited.html + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2009-10-22 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Eric Seidel. + + [Qt] Add Print Shortcut to QtLauncher + + https://bugs.webkit.org/show_bug.cgi?id=30682 + + * QtLauncher/main.cpp: + (MainWindow::setupUI): + +2009-10-22 Antonio Gomes <tonikitoo@webkit.org> + + Rubberstamped by Tor Arne Vestbø. + + Code standarlization for QGVLauncher. + + 1) Made member initilization lists in constructors + to be per line. + 2) Made applyProxy method inline as all other methods in + WebPage class. + + * QGVLauncher/main.cpp: + (WebPage::WebPage): + (WebPage::applyProxy): + (MainView::MainView): + (MainWindow::MainWindow): + (MainWindow::init): + +2009-10-22 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Add a Y-Axis rotation to QGVLauncher. + + It uses the QStateMachine API from Qt 4.6. + + * QGVLauncher/main.cpp: + (WebView::WebView): + (WebView::setYRotation): + (WebView::yRotation): + (MainView::flip): + (MainView::animatedYFlip): + (SharedScene::SharedScene): + (SharedScene::webView): + (MainWindow::init): + (MainWindow::animatedYFlip): + (MainWindow::buildUI): + +2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed By Adam Barth. + + Add some actions to the menu for cursor debugging. + + GraphicsView based launcher only. + + * QGVLauncher/main.cpp: + (MainView::setWaitCursor): + (MainView::resetCursor): + (MainView::flip): + (MainWindow::setWaitCursor): + (MainWindow::resetCursor): + (MainWindow::buildUI): + +2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Rubberstamped by Adam Barth. + + Remove clipRenderToViewport as agreed upon in + https://bugs.webkit.org/show_bug.cgi?id=29843 + + * Api/qwebframe.cpp: + * Api/qwebframe.h: + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + +2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Adam Barth. + + Update the tests to test the new render functionality, and take + into consideration that render() clips to the frame itself as well + as the viewport. + + QWebFrame::render() now always clips, so the old tests were bogus. + + Rendering pure contents (no scrollbars etc) without clipping can now + be accomplished using QWebFrame::documentElement()->render(...) + + * Api/qwebframe.cpp: + * Api/qwebframe.h: + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + * tests/qwebframe/tst_qwebframe.cpp: + +2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Rubberstamped by Adam Barth. + + As we do not support rendering a QWebFrame without it being clipped + the the frame as well as the viewport, we now set the viewport size + to the size of the contents. + + Rendering pure contents (no scrollbars etc) without clipping can be + acomplished using QWebFrame::documentElement()->render(...) + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::render): + +2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Add menu item to dump the plugin list to the console, + which can be handy for debugging. + + * QtLauncher/main.cpp: + (MainWindow::dumpPlugins): + (MainWindow::setupUI): + +2009-10-19 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Introduce new render method on QWebFrame, which supports specifying + which layers to render (scrollbars, contents, pan-icon). + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderPrivate): + (QWebFrame::render): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + +2009-10-19 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Ariya Hidayat. + + [Qt] Infinite loop (leading to crash) when setting cursor in QGraphicsWebView + https://bugs.webkit.org/show_bug.cgi?id=30549 + + Patch reimplements QGraphicsItem's itemChange method, and make + CursorChange event to be emitted after cursor has already been + set. + + QWidget::setCursor send the event just after it sets the cursor, + then patch makes both behaviors compatible. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::itemChange): + * Api/qgraphicswebview.h: + +2009-10-19 Nate Chapin <japhet@chromium.org> + + Unreviewed, build fix. + + Update call to FrameLoader::loadFrameRequest(). + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): + +2009-10-19 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> + + Reviewed by Ariya Hidayat. + + Add QWebElement::render API which allows rendering of single + element. + + * Api/qwebelement.cpp: + (QWebElement::render): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::render): + * tests/qwebelement/qwebelement.qrc: + * tests/qwebelement/image.png: Added. + +2009-10-19 Markus Goetz <Markus.Goetz@nokia.com> + + Reviewed by Ariya Hidayat. + + QWebPage: Doc: setNetworkAccessManager should only be called once. + + * Api/qwebpage.cpp: + +2009-10-19 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Tor Arne. + + Wrong ifdef combination in QGraphicsWebView's event method. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::event): + +2009-10-19 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Holger Freyther. + + [Qt] Windowed Plugins: Don't crash when client is 0. + + Client is 0 when we use QWebPage without a QWebView or QGraphicsWebView. + In addition, setFrameRect()/updatePluginWidget() is called even if the + plugin was not succesfully loaded. updatePluginWidget() updates the + window rect which is, in theory, useful to draw something that indicates + that we didn't load successfully. + + So, a status check is added to setNPWindowIfNeeded. + + https://bugs.webkit.org/show_bug.cgi?id=30380 + + * tests/qwebpage/qwebpage.pro: + * tests/qwebpage/tst_qwebpage.cpp: + (takeScreenshot): + (tst_QWebPage::screenshot_data): + (tst_QWebPage::screenshot): + * tests/resources/test.swf: Copied from LayoutTests/fast/replaced/resources/test.swf. + +2009-10-19 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Holger Freyther. + + [Qt] Windowed Plugins: Fix crash when QWebPage is deleted after QWebView. + + Fixes various sources of crashes: + 1. The PluginContainer is a child of QWebView. When the view gets deleted, + the PluginView is not notified about the deletion of PluginContainer. + 2. QWebView destructor does not set client to 0. + 3. Sometimes pending paint events are sent after the plugin has died, so add + a check in PluginView::setNPWindowIfNeeded. + + https://bugs.webkit.org/show_bug.cgi?id=30354 + + * Api/qwebview.cpp: + (QWebView::~QWebView): + * tests/qwebview/qwebview.pro: + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::reusePage_data): + (tst_QWebView::reusePage): + +2009-10-19 Jakob Truelsen <antialize@gmail.com> + + Reviewed by Adam Barth. + + https://bugs.webkit.org/show_bug.cgi?id=29042 + + Allow one to costumize the minimal and maximal shrink factors, + Added methods setPrintingMinimumShrinkFactor, printingMinimumShrinkFactor, + setPrintingMaximumShrinkFactor, printingMaximumShrinkFactor to QWebSettings. + + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + (QWebSettings::setPrintingMinimumShrinkFactor): + (QWebSettings::printingMinimumShrinkFactor): + (QWebSettings::setPrintingMaximumShrinkFactor): + (QWebSettings::printingMaximumShrinkFactor): + * Api/qwebsettings.h: + +2009-10-18 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Rename fixedContentsSize property to preferredContentsSize as + agreed upon with Simon Hausmann and Matthias Ettrich. + + * Api/qwebpage.cpp: + (QWebPage::preferredContentsSize): + (QWebPage::setPreferredContentsSize): + * Api/qwebpage.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2009-10-16 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] QGLauncher leaks WebPage object + https://bugs.webkit.org/show_bug.cgi?id=30465 + + Make 'SharedScene' to own 'WebPage' reference and delete it at its destructor. + + * Api/qwebpage.cpp: + (QWebPage::view): + * Api/qwebpage_p.h: + * QGVLauncher/main.cpp: + (SharedScene::SharedScene): + (SharedScene::~SharedScene): + +2009-10-16 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] "dangling" pointer to qwebpage's view object can leads QGLauncher to crash + https://bugs.webkit.org/show_bug.cgi?id=30459 + + Remove all setView(ev->widget()) calls in QWebPage and QGWV event handling methods, + since QWebPageClient would do the trick. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::hoverMoveEvent): + * Api/qwebpage.cpp: + (QWebPagePrivate::mouseMoveEvent): + (QWebPagePrivate::mousePressEvent): + (QWebPagePrivate::mouseDoubleClickEvent): + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::wheelEvent): + (QWebPagePrivate::dragEnterEvent): + (QWebPagePrivate::dragLeaveEvent): + (QWebPagePrivate::dragMoveEvent): + +2009-10-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Pull out r49676 as it caused build breakges on Symbian + + * Api/qwebpage.cpp: + +2009-10-16 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Need a way to inform the application when a Netscape plugin is created or deleted + https://bugs.webkit.org/show_bug.cgi?id=30179 + + Added "c" style static methods for the application to hook up for + receiving notifications when a plugin is created or destroyed. + + * Api/qwebpage.cpp: + +2009-10-15 Antonio Gomes <tonikitoo@webkit.org> + + Rubberstamped by Tor Arne. + + Make QGLauncher's WebPage class constructor to get a QObject* as parent (not QWidget*). + + * QGVLauncher/main.cpp: + (WebPage::WebPage): + +2009-10-15 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Tor Arne. + + [Qt] QGLauncher crashes while closing a window + https://bugs.webkit.org/show_bug.cgi?id=30385 + + Set page's pageClient reference to '0' at QGWV deletion. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::~QGraphicsWebView): + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (WebPage::WebPage): + (WebPage::aborting): + (tst_QGraphicsWebView::crashOnViewlessWebPages): + +2009-10-13 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Make context menu to work in QGraphicsWebView + https://bugs.webkit.org/show_bug.cgi?id=30336 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::event): + +2009-10-13 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + + [Qt] Plugins : Remove all traces of winId. Use ownerWidget() instead. + + This is a bug for two reasons: + 1. Everytime we use winId(), we end up creating a native widget. This causes an + unnecessary copy of contents from the backing store to the native widget. + 2. Neither windowed nor windowless plugins require the winId of the QWebView or + QGraphicsView. + + Introduce ownerWidget() which returns a QWidget * without creating a native widget + (as opposed to QWidget::find(winId)). + + https://bugs.webkit.org/show_bug.cgi?id=30170 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::ownerWidget): + * Api/qwebview.cpp: + (QWebViewPrivate::ownerWidget): + +2009-10-13 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Add some initial autotests for QWebPage's ErrorPageExtention + https://bugs.webkit.org/show_bug.cgi?id=30296 + + * tests/qwebpage/tst_qwebpage.cpp: + (ErrorPage::ErrorPage): + (ErrorPage::supportsExtension): + (ErrorPage::extension): + (tst_QWebPage::errorPageExtension): + +2009-10-13 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] better handle possible edge cases on qwebframe::requestedUrl use + https://bugs.webkit.org/show_bug.cgi?id=30216 + + QWebFrame::requestedUrl can be called at any time during the load + process, including: + + * An error handling (whereas an alternate error page for unsuccessful + load is being set); + * A ssl error exception call; + * During navigation notifications/callbacks (titleChanged, urlChanged, + progresses, addHistoryEntry, etc); + * Among others. + + This patch makes requestedUrl calls to fallback to FrameLoaderClient + m_loadError's failingURL when an error has occurred, unless it is + null/empty. + + Also, m_loadError is now being reset at each the main frame starts a + load, in order to avoid previous load errors footprints. + + * Api/qwebframe.cpp: + (QWebFrame::requestedUrl): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::postProgressStartedNotification): + +2009-10-12 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + [Qt] Missing default value for the default text encoding. + https://bugs.webkit.org/show_bug.cgi?id=30311 + + QtWebKit has provided a default, hardcoded value for default charset but since + the addition of the defaultTextEncoding setting in QWebSettings, that hardcoded + value has had no effect. + + Added a regression test and unskipped fast/dom/Document/document-charset.html, + which is passing now. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::defaultTextEncoding): + +2009-10-12 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Implement the new palette() methods on the page clients + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::palette): + * Api/qwebview.cpp: + (QWebViewPrivate::palette): + +2009-10-12 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + QWebPage's createViewlessPlugin autotest crash fix. + + It is possible that plugins that are QWidgets or QGraphicsWidgets + are created before a view has been assigned to a QWebPage. The + plug-ins won't be fully functional, as by design, they should + visualise something, but they won't crash and will stay in memory. + + An autotest that covers this use-case, is included. + + https://bugs.webkit.org/show_bug.cgi?id=30118 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + * tests/qwebpage/tst_qwebpage.cpp: + (PluginTrackedPageWidget::PluginTrackedPageWidget): + (PluginTrackedPageGraphicsWidget::PluginTrackedPageGraphicsWidget): + (PluginTrackedPageGraphicsWidget::createPlugin): + (tst_QWebPage::destroyPlugin): + (tst_QWebPage::createViewlessPlugin): + +2009-10-09 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Simon Hausmann. + + Sets Qt::WA_InputMethodEnabled and Qt::ImhHiddenText for password fields in EditorClientQt + setInputMethodState. This change is needed so widgets such as the s60 software + input panel can receive input method events for password fields. + It's up to the Qt platform to determine which widget will receive input method + events when these flags are set. + Also added implementation for setInputMethodEnabled and setInputMethodHint + to QGraphicsWebViewPrivate and QWebViewPrivate. This change removes the direct + dependency on QWebView and uses QWebPageClient. + Added autotest to tst_qwebpage.cpp + https://bugs.webkit.org/show_bug.cgi?id=30023 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::setInputMethodEnabled): + (QGraphicsWebViewPrivate::setInputMethodHint): + * Api/qwebview.cpp: + (QWebViewPrivate::setInputMethodEnabled): + (QWebViewPrivate::setInputMethodHint): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2009-10-08 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Move executeScript from FrameLoader to ScriptController + https://bugs.webkit.org/show_bug.cgi?id=30200 + + Update API call. + + * Api/qwebframe.cpp: + (QWebFrame::evaluateJavaScript): + +2009-10-08 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + Part of testOptionalJSObjects autotest was marked as "expect to fail". + + Two places in tst_QWebPage::testOptionalJSObjects were marked as + expected to fail. The problem concern checking if a feature is enabled + or disabled. According to discussion on webkit dev mailing list + a disabled feature should be invisible from java script level, but + there are exceptions from the rule. So we decided to disable the test + for now. + + https://bugs.webkit.org/show_bug.cgi?id=29867 + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::testOptionalJSObjects): + +2009-10-07 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Adler. + + Factor PolicyChecker out of FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=30155 + + Move the policy callback to the policy object. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::callPolicyFunction): + +2009-10-07 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Get rid of useless loadFailed signal in QGraphicsWebView + https://bugs.webkit.org/show_bug.cgi?id=30166 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_doLoadFinished): + * Api/qgraphicswebview.h: + * QGVLauncher/main.cpp: + (MainWindow::init): + (MainWindow::loadFinished): + +2009-10-07 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + + Add a simple rotation effect to QGVLauncher + + https://bugs.webkit.org/show_bug.cgi?id=30162 + + * QGVLauncher/main.cpp: + (MainView::animatedFlip): + (MainWindow::animatedFlip): + (MainWindow::buildUI): + +2009-10-07 Volker Hilsheimer <volker.hilsheimer@nokia.com> + + Reviewed by Simon Hausmann. + + Doc: Document HTML and status as properties. + + * Api/qgraphicswebview.cpp: + +2009-10-07 Martin Smith <msmith@trolltech.com> + + Reviewed by Simon Hausmann. + + Fix qdoc warning about disabled renderHints property + on Symbian. + + * Api/qwebview.cpp: + * Api/qwebview.h: + +2009-10-06 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Move setLocalLoadPolicy and friends to SecurityOrigin + https://bugs.webkit.org/show_bug.cgi?id=30110 + + Call the new API. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + +2009-10-06 Benjamin C Meyer <bmeyer@rim.com> + + Reviewed by Ariya Hidayat. + + When the drag data contains an image set it on the QDrag so it will be visible to the user. + + * WebCoreSupport/DragClientQt.cpp: + (WebCore::DragClientQt::startDrag): + +2009-10-06 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Timothy Hatcher. + + Web Inspector: close inspector client view on + InspectorController::close API call. + + In order to run batch web inspector layout tests (and not affect + subsequent tests) we should close inspector client's view upon + InspectorController::close API call. + + https://bugs.webkit.org/show_bug.cgi?id=30009 + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::createPage): + +2009-10-06 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] don't enable input methods on Symbian by default. + https://bugs.webkit.org/show_bug.cgi?id=30117 + + If input methods are enabled Symbian FEP will be launched on every + pointer event making webpage navigation impossible with QWebView. + + * Api/qwebview.cpp: + (QWebView::QWebView): + +2009-10-05 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Hausmann. + + QtLauncher: print the number of loaded urls + + When using the -r mode print the number of URLs loaded so far. This + is extremly useful when opening the same URL over and over again and + one wants to see the progress. + + * QtLauncher/main.cpp: + (URLLoader::URLLoader): + (URLLoader::loadNext): + +2009-10-05 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + + Add screenshot option to menubar + + https://bugs.webkit.org/show_bug.cgi?id=30067 + + * QtLauncher/main.cpp: + (MainWindow::screenshot): + (MainWindow::setupUI): + +2009-10-05 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + + Setting the env QTLAUNCHER_USE_ARGB_VISUALS makes Qt use WA_TranslucentWindow. + + https://bugs.webkit.org/show_bug.cgi?id=30068 + + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + +2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Rubberstamped by Simon Hausmann. + + Add documentation to the ErrorPageExtension. + + * Api/qwebpage.cpp: + +2009-10-02 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Inform the application when a new request is created + https://bugs.webkit.org/show_bug.cgi?id=29975 + + Add a signal to QWebPage, to inform the application when a request is created. + + * Api/qwebpage.cpp: + * Api/qwebpage.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::loadFinished): + +2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + ErrorPageExtension: Add a pointer to the QWebFrame that had + an error. + + * Api/qwebpage.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::callErrorPageExtension): + +2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Do not empty the offline web appcache when clearing + memory caches. That one is not in memory, but stored + in sqlite. + + * Api/qwebsettings.cpp: + (QWebSettings::clearMemoryCaches): + +2009-10-05 J-P Nurmi <jpnurmi@gmail.com> + + Reviewed by Simon Hausmann. + + Added QGraphicsWidget-plugins support to FrameLoaderClientQt. + + https://bugs.webkit.org/show_bug.cgi?id=29710 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::pluginParent): + * Api/qwebview.cpp: + (QWebViewPrivate::pluginParent): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::): + (WebCore::FrameLoaderClientQt::createPlugin): + +2009-10-03 Adam Barth <abarth@webkit.org> + + Unreview build fix. I wish I had a try server... + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateAction): + +2009-10-02 Norbert Leser <norbert.leser@nokia.com> + + Reviewed by Simon Hausmann. + + Conditionally guard cursor code (cursor and updateCursor functions) with !QT_NO_CURSOR. + Otherwise, it is inconsistent with class declaration of QCursor. + + * Api/qgraphicswebview.cpp: + * Api/qwebview.cpp: + +2009-10-02 Prasanth Ullattil <prasanth.ullattil@nokia.com> + + Reviewed by Simon Hausmann. + + Fix compiler warnings about unused function arguments. + + * Api/qwebframe.cpp: + (QWebFrame::scrollBarMinimum): + * Api/qwebpage.cpp: + (QWebPagePrivate::focusInEvent): + (QWebPagePrivate::focusOutEvent): + (QWebPagePrivate::leaveEvent): + (QWebPage::javaScriptAlert): + (QWebPage::javaScriptConfirm): + (QWebPage::javaScriptPrompt): + (QWebPage::triggerAction): + (QWebPage::acceptNavigationRequest): + (QWebPage::chooseFile): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::repaint): + (WebCore::ChromeClientQt::mouseDidMoveOverElement): + (WebCore::ChromeClientQt::reachedMaxAppCacheSize): + * WebCoreSupport/ContextMenuClientQt.cpp: + (WebCore::ContextMenuClientQt::downloadURL): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect): + (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady): + (WebCore::FrameLoaderClientQt::representationExistsForURLScheme): + (WebCore::FrameLoaderClientQt::generatedMIMETypeForURLScheme): + (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem): + (WebCore::FrameLoaderClientQt::pluginWillHandleLoadError): + (WebCore::FrameLoaderClientQt::assignIdentifierToInitialRequest): + (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading): + (WebCore::FrameLoaderClientQt::createJavaAppletWidget): + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::setAttachedWindowHeight): + (WebCore::InspectorClientQt::highlight): + (WebCore::InspectorClientQt::removeSetting): + +2009-10-01 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Make Software Input Panel requests work with QGraphicsWebView + _and_ QWebView by sharing the event code in handleSoftwareInputPanel(). + + * Api/qwebpage.cpp: + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::handleSoftwareInputPanel): + * Api/qwebpage_p.h: + +2009-10-01 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Rename QWebGraphicsItem to QGraphicsWebView + + * Api/headers.pri: + * Api/qwebpage.h: + * Api/qwebgraphicsitem.cpp: Renamed. + * Api/qwebgraphicsitem.h: Renamed. + * WebKit/qt/QGVLauncher/main.cpp: + * tests/tests.pro: + * tests/qwebgraphicsitem/qwebgraphicsitem.pro: Renamed. + * tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp: Renamed. + +2009-10-01 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=29248 + [Qt] [API] Make it possible to have 'invisible' loads + + Make QWebFrame's setHtml and setContent methods to not change + session and global history at all. + + * Api/qwebframe.cpp: + (QWebFrame::setHtml): + (QWebFrame::setContent): + * tests/qwebframe/qwebframe.pro: + * tests/qwebframe/tst_qwebframe.cpp: + +2009-10-01 Kristian Amlie <kristian.amlie@nokia.com> + + Reviewed by Simon Hausmann. + + Fixed software input panel support on web input elements. + + Send the RequestSoftwareInputPanel event if the element supports focus + and the element is clicked. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::mousePressEvent): + (QWebPagePrivate::mouseReleaseEvent): + * Api/qwebpage_p.h: + +2009-10-01 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Simon Hausmann. + + Implementation for QWebPage::inputMethodQuery and QWebPagePrivate::inputMethodEvent + + https://bugs.webkit.org/show_bug.cgi?id=29681 + + Some additional changes from Kristian Amlie <kristian.amlie@nokia.com>: + + * Fixed surrounding text to exclude preedit string + * Avoid emission of microFocusChanged during setComposition() + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::respondToChangedSelection): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + +2009-09-30 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by David Hyatt. + + Add the failed URL to the ErrorPageExtension, as it is quite + useful for creating error pages. + + * Api/qwebpage.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::callErrorPageExtension): + +2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu> + + Reviewed by Tor Arne Vestbø. + + [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard. + This fixes https://bugs.webkit.org/show_bug.cgi?id=19674. + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=29844 + + QWebPage dependency autotest fix. + + Fix for database() autotest. All opened databases should be removed at + end of test. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::database): + +2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + Some QWebHistory and QWebPage autotest crash fixes. + + Some checking for m_mainFrame were added. MainFrame should be created + at some point of QWebPage live cicle. + + https://bugs.webkit.org/show_bug.cgi?id=29803 + + * Api/qwebpage.cpp: + (QWebPage::~QWebPage): + (QWebPage::currentFrame): + (QWebPage::history): + (QWebPage::selectedText): + (QWebPage::updatePositionDependentActions): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::crashTests_LazyInitializationOfMainFrame): + +2009-09-29 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann and Tor Arne Vestbø. + + Implement QWebPage Extension for error pages, incl. + an example on how to use it in QtLauncher. + + Correct our use of ResourceError. + + * Api/qwebpage.h: + (ExtensionOption::): + (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn): + * QtLauncher/main.cpp: + (WebPage::supportsExtension): + (MainWindow::MainWindow): + (MainWindow::selectElements): + (WebPage::extension): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::cancelledError): + (WebCore::FrameLoaderClientQt::blockedError): + (WebCore::FrameLoaderClientQt::cannotShowURLError): + (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): + (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError): + (WebCore::FrameLoaderClientQt::fileDoesNotExistError): + (WebCore::FrameLoaderClientQt::callErrorPageExtension): + (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-09-28 Andre Poenitz <andre.poenitz@trolltech.com> + + Reviewed by Simon Hausmann. + + Compile fix with namespaced Qt. + + * Api/qwebinspector_p.h: + +2009-09-27 Joe Ligman <joseph.ligman@mindspring.com> + + Reviewed by Simon Hausmann. + + [Qt] Adding API setFocus and hasFocus to QWebElement. This API is needed for + clients that want to check/set the focus node of the document. + https://bugs.webkit.org/show_bug.cgi?id=29682 + + * Api/qwebelement.cpp: + (QWebElement::hasFocus): + (QWebElement::setFocus): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::hasSetFocus): + +2009-09-25 Csaba Osztrogonac <oszi@inf.u-szeged.hu> + + Reviewed by Simon Hausmann. + + [Qt] Make tst_qwebframe work if Qt built without SSL support + https://bugs.webkit.org/show_bug.cgi?id=29735 + + * tests/qwebframe/tst_qwebframe.cpp: Missing #ifndef blocks added. + +2009-09-24 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Update QWebElement API to remove script related methods. + QWebElement::evaluateScript is the only one kept, these are + removed to postpone most of the QtWebKit<->JavaScript API design + after 4.6. + https://bugs.webkit.org/show_bug.cgi?id=29708 + + * Api/qwebelement.cpp: + * Api/qwebelement.h: + Methods removed: + - QWebElement::callFunction + - QWebElement::functions + - QWebElement::scriptableProperty + - QWebElement::setScriptableProperty + - QWebElement::scriptableProperties + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::evaluateScript): + +2009-09-25 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Rename QWebElement::evaluateScript + to QWebElement::evaluateJavaScript. + https://bugs.webkit.org/show_bug.cgi?id=29709 + + * Api/qwebelement.cpp: + (QWebElement::evaluateJavaScript): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::evaluateJavaScript): + +2009-09-25 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Update the stypeProperty API of QWebElement. + https://bugs.webkit.org/show_bug.cgi?id=29711 + + * Api/qwebelement.cpp: + (QWebElement::styleProperty): + - Merge the stypeProperty and the computedStyleProperty methods + - Remove the default value for the style resolving enum + - Rename ResolveRule to StyleResolveStrategy + (QWebElement::setStyleProperty): + - Remove the priority argument since it is possible to control the + behaviour by adding !important or removing in the value. + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::style): + (tst_QWebElement::computedStyle): + * tests/qwebframe/tst_qwebframe.cpp: + +2009-09-24 Jon Honeycutt <jhoneycutt@apple.com> + + Reviewed by Alice Liu. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + Pass 0 for new Page constructor argument. + +2009-09-24 Martin Smith <msmith@trolltech.com> + + Reviewed by Simon Hausmann. + + qdoc: Added \brief texts to all the since 4.6 functions. + + * Api/qwebhistory.cpp: + +2009-09-23 J-P Nurmi <jpnurmi@gmail.com> + + Reviewed by Simon Hausmann. + + Prevent QWebPage::setView() from changing the viewport size on the fly + in case the view doesn't actually change. QWebPage::setView() is + called upon every QWebGraphicsItem::hoverMoveEvent(), which forced + the viewport size to be equal to the size of the whole graphics view. + + https://bugs.webkit.org/show_bug.cgi?id=29676 + + * Api/qwebpage.cpp: + (QWebPage::setView): + +2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Crash fix in QWebHistory back and forward methods. + + QWebHistory::back() and QWebHistory::forward() were crashing on + ASSERT in WebCore::BackForwardList. The methods should check + canGoBack() and canGoForward() at the beginning. + + https://bugs.webkit.org/show_bug.cgi?id=29675 + + * Api/qwebhistory.cpp: + (QWebHistory::back): + (QWebHistory::forward): + +2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Bug fix. QWebHistory should call QWebPage::updateNavigationActions + + In QWebHistory's methods that change item count or current item call + to QWebPage::updateNavigationActions should be executed. + QWebHistory::clear() and QWebHistory::restorState() were changed. + New helper method, QWebPagePrivate accesor, were created in + QWebHistoryPrivate class. + Two autotest were developed. + + https://bugs.webkit.org/show_bug.cgi?id=29246 + + * Api/qwebhistory.cpp: + (QWebHistory::clear): + (QWebHistory::restoreState): + (QWebHistoryPrivate::page): + * Api/qwebhistory_p.h: + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::saveAndRestore_1): + (tst_QWebHistory::clear): + +2009-09-23 Norbert Leser <norbert.leser@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Need to guard QX11Info include with Q_WS_X11. + That class may not be available (in QT 4.5 for Symbian, for instance). + Completes fixes in r48627 and r48604. + + * Api/qwebgraphicsitem.cpp: + * Api/qwebview.cpp: + +2009-09-22 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Add default timeout while waiting for signals in QWebPage auto + tests. + https://bugs.webkit.org/show_bug.cgi?id=29637 + + * tests/qwebpage/tst_qwebpage.cpp: + (waitForSignal): + +2009-09-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reivewed by Simon Hausmann. + + Fix the Qt/Mac build after r48604 (Implement new QWebPageClient class) + + There's no QWidget::x11Info() on Mac, and setPlatformPluginWidget() + takes a QWidget*, not a QWebPageClient* + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItemPrivate::screenNumber): + * Api/qwebview.cpp: + (QWebViewPrivate::screenNumber): + +2009-09-21 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + For Qt, platformPageClient() will now return a class derived from + the QWebPageClient, so the patch adapts our Qt hooks to go though + this class and not depend on the QWebView. + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItemPrivate::scroll): + (QWebGraphicsItemPrivate::update): + (QWebGraphicsItemPrivate::cursor): + (QWebGraphicsItemPrivate::updateCursor): + (QWebGraphicsItemPrivate::screenNumber): + (QWebGraphicsItemPrivate::winId): + (QWebGraphicsItem::event): + (QWebGraphicsItem::setPage): + * Api/qwebgraphicsitem.h: + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebViewPrivate::scroll): + (QWebViewPrivate::update): + (QWebViewPrivate::cursor): + (QWebViewPrivate::updateCursor): + (QWebViewPrivate::screenNumber): + (QWebViewPrivate::winId): + (QWebView::setPage): + (QWebView::event): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::repaint): + (WebCore::ChromeClientQt::scroll): + (WebCore::ChromeClientQt::platformPageClient): + +2009-09-21 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=29609 + Build fix for windows when using Qt 4.5.0. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2009-09-19 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=29345 + The tests of QWebFrame did not use QTRY_VERIFY for + tests involving the event loop. + + * tests/qwebframe/tst_qwebframe.cpp: + * tests/util.h: Added. Copy of tests/shared/util.h of Qt + +2009-09-19 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + [Qt] Add an autotest stub for QWebGraphicsItem. + + It just calls all the functions and makes sure they don't crash. + + * tests/qwebgraphicsitem/qwebgraphicsitem.pro: Added. + * tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp: Added. + (tst_QWebGraphicsItem::qwebgraphicsitem): + * tests/tests.pro: + +2009-09-18 Norbert Leser <norbert.leser@nokia.com> + + Reviewed by Eric Seidel. + + Corrected the Symbian specific UID3 values to be assigned + from the "unprotected" pool that permits self-signing of + those test and demo executables. (Added new UID3 values + where they were missing for new components.) + + * QGVLauncher/QGVLauncher.pro: + * QtLauncher/QtLauncher.pro: + * tests/benchmarks/loading/tst_loading.pro: + * tests/benchmarks/painting/tst_painting.pro: + * tests/qwebelement/qwebelement.pro: + * tests/qwebframe/qwebframe.pro: + * tests/qwebhistory/qwebhistory.pro: + * tests/qwebhistoryinterface/qwebhistoryinterface.pro: + * tests/qwebpage/qwebpage.pro: + * tests/qwebplugindatabase/qwebplugindatabase.pro: + * tests/qwebview/qwebview.pro: + +2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Make PlatformWindow return something else than PlatformWidget + https://bugs.webkit.org/show_bug.cgi?id=29085 + + Reflect the rename of platformWindow and it's return type. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::platformPageClient): + * WebCoreSupport/ChromeClientQt.h: + +2009-09-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Add persistence support for configuration options in the + inspector. + + * Api/qwebinspector.cpp: + * QtLauncher/main.cpp: + (main): + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::populateSetting): + (WebCore::InspectorClientQt::storeSetting): + (WebCore::variantToSetting): + (WebCore::settingToVariant): + +2009-09-18 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Fixed a bunch of documentation warnings. + + * Api/qwebgraphicsitem.cpp: + * Api/qwebplugindatabase.cpp: + * Api/qwebpluginfactory.cpp: + * Api/qwebsecurityorigin.cpp: + +2009-09-18 Warwick Allison <warwick.allison@nokia.com> + + Reviewed by Simon Hausmann. + + Added a test that console output works. + + * tests/qwebpage/tst_qwebpage.cpp: + (ConsolePage::ConsolePage): + (ConsolePage::javaScriptConsoleMessage): + (tst_QWebPage::consoleOutput): + +2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Improve documentation for Page Cache. + + * Api/qwebsettings.cpp: + +2009-09-17 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Update QWebSettings::setUserStyleSheetUrl() docs and test + + https://bugs.webkit.org/show_bug.cgi?id=29081 + + The documentation now specifies that the URL has to be a local file + or a a data-URL (with utf-8 and base64-encoded data), as these are the + only two schemes that the current code path accepts. + + The auto-test has been updated to reflect this limitation. + + At a later point we should concider adding API for the new way of + doing both user defined stylesheets and scripts. + + * Api/qwebsettings.cpp: + * tests/qwebpage/tst_qwebpage.cpp: + +2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + Symbian build fix. + + Moved the #ifdefs around _q_cleanupLeakMessages() into the function + definition. + + QMake is not being able to distinguish between release and debug builds + in Symbian build. This is a Symbian toolchain issue. + + * Api/qwebpage.cpp: + (QWebPagePrivate::_q_cleanupLeakMessages): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + +2009-09-17 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + Small cosmetic documentation fixlet in the QWebInspector. + + * Api/qwebinspector.cpp: + +2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by Eric Seidel. + + Detect and add Windows7 properly to the user agent. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2009-09-16 Andras Becsi <andrewbecsi@yahoo.co.uk> + + Rubberstamped by Kenneth Christiansen. + + [Qt] Build fix for previous changes. + + * QGVLauncher/main.cpp: + (MainView::flip): + +2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed potential Qt < 4.6 build fix. + + * QGVLauncher/main.cpp: + (MainView::flip): + +2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Add a "Flip effect" to our GraphicsView based launcher. + + * QGVLauncher/main.cpp: + (MainView::resizeEvent): + (MainView::flip): + (MainWindow::flip): + (MainWindow::buildUI): + +2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> + + Rubber-stamped by Simon Hausmann. + + [Qt] Typo fix. Pass the window object to the Format + menu. In this way Qt can free its internal graphical + objects during exit. + + * QtLauncher/main.cpp: + (MainWindow::setupUI): + +2009-09-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Build break fix on gcc ARM. + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItemPrivate::_q_doLoadProgress): + +2009-09-16 Warwick Allison <warwick.allison@nokia.com> + + Reviewed by Simon Hausmann. + + Fix a crash in QWebFrame::hasFocus() with a simple null pointer check + when the focused frame is null. We do the same check in other places + where we call kit(). + + * Api/qwebframe.cpp: + (QWebFrame::hasFocus): + +2009-09-16 Jure Repinc <jlp@holodeck1.com> + + Reviewed by Simon Hausmann. + + Fixed a typo found during translation. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): + +2009-09-14 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + [Qt] QWebGraphicsItem should check for null QWebPage. + https://bugs.webkit.org/show_bug.cgi?id=29185 + + Don't crash in QWebGraphicsItem when the page is still null, by + either checking if it's the case or constructing the default one. + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItem::icon): + (QWebGraphicsItem::setZoomFactor): + (QWebGraphicsItem::zoomFactor): + (QWebGraphicsItem::setGeometry): + (QWebGraphicsItem::load): + (QWebGraphicsItem::setHtml): + (QWebGraphicsItem::toHtml): + (QWebGraphicsItem::setContent): + (QWebGraphicsItem::history): + (QWebGraphicsItem::settings): + +2009-09-11 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + Doc: Note that Netscape plugins are only available on desktop platforms. + + * docs/qtwebkit.qdoc: + +2009-09-11 Martin Smith <msmith@trolltech.com> + + Reviewed by Simon Hausmann. + + Adjust the name of the contentspage for the documentation + to the new name used in Qt 4.6. + + * docs/qtwebkit.qdoc: + +2009-09-11 Ariya Hidayat <ariya.hidayat@nokia.com> + + Reviewed by Simon Hausmann. + + Changed URLs from qtsoftware.com to qt.nokia.com, as part of a general + renaming. + + * Api/qwebpluginfactory.cpp: + * docs/webkitsnippets/simple/main.cpp: + (main): + * docs/webkitsnippets/webpage/main.cpp: + (main): + +2009-09-11 Volker Hilsheimer <volker.hilsheimer@nokia.com> + + Reviewed by Simon Hausmann. + + Restructure the documentation, both on a file and on a content level. + + * Api/qwebdatabase.cpp: + * Api/qwebelement.cpp: + * Api/qwebframe.cpp: + * Api/qwebhistory.cpp: + * Api/qwebhistoryinterface.cpp: + * Api/qwebpage.cpp: + * Api/qwebpluginfactory.cpp: + * Api/qwebsecurityorigin.cpp: + * Api/qwebsettings.cpp: + * Api/qwebview.cpp: + * docs/qtwebkit.qdoc: + +2009-09-11 Yongjun Zhang <yongjun.zhang@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=29136 + [Qt] emit microFocusChanged() signal when no QWidget-based view is present. + + emit microFocusChange() signal regardless of view. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + +2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=28806 + + [Qt] Make the WebInspector available as a QWidget. + + * Api/headers.pri: + * Api/qwebelement.cpp: + (QWebElement::enclosingElement): + * Api/qwebelement.h: + * Api/qwebinspector.cpp: Added. + * Api/qwebinspector.h: Added. + * Api/qwebinspector_p.h: Added. + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::setInspector): + (QWebPagePrivate::getOrCreateInspector): + (QWebPagePrivate::inspectorController): + (QWebPage::~QWebPage): + (QWebPage::triggerAction): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + * Api/qwebsettings.cpp: + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientWebPage::InspectorClientWebPage): + (WebCore::InspectorClientWebPage::createWindow): + (WebCore::InspectorClientQt::createPage): + (WebCore::InspectorClientQt::showWindow): + (WebCore::InspectorClientQt::closeWindow): + (WebCore::InspectorClientQt::attachWindow): + (WebCore::InspectorClientQt::detachWindow): + (WebCore::InspectorClientQt::updateWindowTitle): + * WebCoreSupport/InspectorClientQt.h: + * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: Added. + +2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Eric Seidel. + + [Qt] Fix comparison between signed and unsigned integer warnings + https://bugs.webkit.org/show_bug.cgi?id=29162 + + No functional change. + + * Api/qwebelement.cpp: + (QWebElement::findAll): + * Api/qwebhistory.cpp: + (QWebHistory::items): + (QWebHistory::backItems): + (QWebHistory::forwardItems): + (QWebHistory::saveState): + * Api/qwebplugindatabase.cpp: + (QWebPluginDatabase::setSearchPaths): + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::runOpenPanel): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + +2009-09-10 Simon Hausmann <hausmann@webkit.org> + + Rubber-stamped by Ariya Hidayat. + + Fix a bunch of qdoc warnings: Invalid references, non-standard + wording, etc. + + * Api/qwebelement.cpp: + * Api/qwebgraphicsitem.cpp: + * Api/qwebsecurityorigin.cpp: + +2009-09-10 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Ariya Hidayat. + + Fix context menu event delivery with QWebGraphicsItem. + + Re-implement the correct context menu virtual function using + a QGraphicsSceneContextMenuEvent and forward & handle it in + QWebPage. + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItem::contextMenuEvent): + * Api/qwebgraphicsitem.h: + * Api/qwebpage.cpp: + (QWebPagePrivate::contextMenuEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + +2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed. + + Build fix for QtWebKit for Mac after r48219. + + qevent and qstyleoption are QtGui interfaces. + + * Api/qwebgraphicsitem.cpp: + * Api/qwebgraphicsitem.h: + +2009-09-09 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Call the right base class function QGraphicsWidget::event() instead + of skipping it and using QObject::event() instead. + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItem::event): + +2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed. + + Fix comment at Tor Arne Vestbø's request. + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItem::sceneEvent): + (QWebGraphicsItem::event): + +2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Implement some virtual event methods so that we can fix + event-related bugs in Qt patch releases. + + * Api/qwebgraphicsitem.cpp: + (QWebGraphicsItem::sceneEvent): + (QWebGraphicsItem::event): + * Api/qwebgraphicsitem.h: + +2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>, Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Simon Hausmann. + + Add a new QGraphicsWidget based version of the "QWebView" + under the name "QWebGraphicsItem". + + https://bugs.webkit.org/show_bug.cgi?id=28862 + + Includes an alternative Qt launcher using the QGraphicsView. + + * Api/headers.pri: + * Api/qwebgraphicsitem.cpp: Added. + * Api/qwebgraphicsitem.h: Added. + * Api/qwebpage.h: + * QGVLauncher/QGVLauncher.pro: Copied from WebKit/qt/QtLauncher/QtLauncher.pro. + * QGVLauncher/main.cpp: Added. + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::repaint): + (WebCore::ChromeClientQt::scroll): + +2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed build fix. + + Potential build fix for Qt 4.5 + + * Api/qwebpage.cpp: + (QWebPagePrivate::mousePressEvent): + +2009-09-08 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=29007 + Add a test for the signal QWebFrame::javaScriptWindowObjectCleared() + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix unused variable warnings + https://bugs.webkit.org/show_bug.cgi?id=29018 + + * Api/qwebpage.cpp: + (QWebPagePrivate::keyPressEvent): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::startDownload): + (WebCore::FrameLoaderClientQt::createFrame): + +2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Ariya Hidayat. + + [Qt] Use the declaration order in initializer lists + https://bugs.webkit.org/show_bug.cgi?id=29017 + + * Api/qwebframe_p.h: + +2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + Add support for handling QGraphicsScene events. + + * Api/qwebpage.cpp: + (QWebPagePrivate::mouseMoveEvent): + (QWebPagePrivate::mousePressEvent): + (QWebPagePrivate::mouseDoubleClickEvent): + (QWebPagePrivate::mouseTripleClickEvent): + (QWebPagePrivate::handleClipboard): + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::wheelEvent): + (QWebPagePrivate::dragEnterEvent): + (QWebPagePrivate::dragLeaveEvent): + (QWebPagePrivate::dragMoveEvent): + (QWebPagePrivate::dropEvent): + (QWebPage::event): + * Api/qwebpage_p.h: + +2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Make cursor set cleaner in QtWebKit Api: eliminate SetCursorEvent hack. + https://bugs.webkit.org/show_bug.cgi?id=28865 + + Clean up the unserCursor hack to use the QCursor set + as a property of the QWidget by WebCore::WidgetQt. + + Remove all code that are no longer necessary for getting + cursor change events. + + Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> and + Antonio Gomes <antonio.gomes@openbossa.org> on 2009-09-07 + + * Api/qwebpage.cpp: + * Api/qwebpage_p.h: + * Api/qwebview.cpp: + (QWebViewPrivate::QWebViewPrivate): + (QWebView::event): + +2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit single API to enable persistency + https://bugs.webkit.org/show_bug.cgi?id=28682 + + Disable LocalStorage, ApplicationCache, HTML5 offline storage by + default. + + If persistency is enabled the default directory for LocalStorage and + ApplicationCache is now based on QDesktopServices::DataLocation and not + QDesktopServices::CacheLocation (as it is expected to keep this data + around after a reboot). + + If persistency is enabled initialize HTML5 offline storage as well - this + fixed offline Storage for QtLauncher. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + (QWebSettings::enablePersistentStorage): + * Api/qwebsettings.h: Add a new API called enablePersistentStorage + * QtLauncher/main.cpp: Use the new enablePersistentStorage API + (main): + +2009-09-07 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + Speed up the QWebPluginInfo::supportsMimeType() function. + https://bugs.webkit.org/show_bug.cgi?id=27651 + + Instead of going through the MIME types list constructed with + mimeTypes() function, look up the internal mimeToDescriptions map. + + * Api/qwebplugindatabase.cpp: + (QWebPluginInfo::supportsMimeType): + +2009-09-07 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + Speed up the QWebPluginInfo::mimeTypes() function. + https://bugs.webkit.org/show_bug.cgi?id=27651 + + Instead of constructing a list of MIME types every time it is called, + do this only once. + + * Api/qwebplugindatabase.cpp: + (QWebPluginInfo::mimeTypes): + (QWebPluginInfo::operator=): + * Api/qwebplugindatabase.h: + * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: + (tst_QWebPluginDatabase::operatorassign_data): + (tst_QWebPluginDatabase::operatorassign): + +2009-09-07 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + Remove the private classes from QWebPluginDatabase. + https://bugs.webkit.org/show_bug.cgi?id=27651 + + Instead, hold the PluginDatabase and PluginPackage objects as class + members and take care of refcounting on our own instead of using RefPtr. + + This way we not only made the code cleaner but also got rid of + redundant allocations when constructing null QWebPluginInfo objects. + + The private classes have been forward-declared and the d-pointers left + to be on the safe side. + + * Api/qwebplugindatabase.cpp: + (QWebPluginInfo::QWebPluginInfo): + (QWebPluginInfo::~QWebPluginInfo): + (QWebPluginInfo::name): + (QWebPluginInfo::description): + (QWebPluginInfo::mimeTypes): + (QWebPluginInfo::path): + (QWebPluginInfo::isNull): + (QWebPluginInfo::setEnabled): + (QWebPluginInfo::isEnabled): + (QWebPluginInfo::operator==): + (QWebPluginInfo::operator!=): + (QWebPluginInfo::operator=): + (QWebPluginDatabase::QWebPluginDatabase): + (QWebPluginDatabase::~QWebPluginDatabase): + (QWebPluginDatabase::plugins): + (QWebPluginDatabase::searchPaths): + (QWebPluginDatabase::setSearchPaths): + (QWebPluginDatabase::addSearchPath): + (QWebPluginDatabase::refresh): + (QWebPluginDatabase::pluginForMimeType): + (QWebPluginDatabase::setPreferredPluginForMimeType): + * Api/qwebplugindatabase.h: + * Api/qwebplugindatabase_p.h: Removed. + +2009-09-05 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Eric Seidel. + + [Qt] r47424 broke binary compatibility + https://bugs.webkit.org/show_bug.cgi?id=28996 + + Append the new DnsPrefetchEnabled attribute at the end of the enum. + + * Api/qwebsettings.h: + +2009-09-04 Mark Mentovai <mark@chromium.org> + + Reviewed by Dave Hyatt. + + https://bugs.webkit.org/show_bug.cgi?id=28614 + + Account for scrollbar state changes that occur during layout. + + * Api/qwebframe.cpp: + (QWebFrame::setScrollBarPolicy): + + Eliminate duplicated (and incorrect) scrollbar mode tracking between + FrameView and ScrollView. + +2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Eric Seidel. + + [Qt] Fix tst_QWebPage::database autotest failure + https://bugs.webkit.org/show_bug.cgi?id=28961 + + Make sure that the test case enables the feature before + the feature gets tested + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::database): + +2009-09-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by Eric Seidel. + + Any QtWebKit application crashes on exit if the inspector is + used during the session rather then exiting. + + If a QWebView has a QWebPage that is destroyed the QWebView + does not update its pointer and will crash the next time + it access the page pointers (such as in its destructor). + + InspectorClientView should not call deleteLater when the page + is destroyed because it does not have a parent and is a top + level widget. close() needs to be called so that QApplication + can exit the application if quitOnLastWindowClosed is set + and a InspectorClientView is the last window, otherwise + the application will never exit. + + * Api/qwebview.cpp: + (QWebViewPrivate::_q_pageDestroyed): + (QWebView::setPage): + * Api/qwebview.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientView::InspectorClientView): + +2009-09-03 Adam Barth <abarth@webkit.org> + + Reviewed by eric@webkit.org. + + https://bugs.webkit.org/show_bug.cgi?id=24696 + + Stub implementations of mixed content methods of FrameLoaderClient. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::didDisplayInsecureContent): + (WebCore::FrameLoaderClientQt::didRunInsecureContent): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-09-03 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Eric Seidel. + + [Qt] Add a setting to turn SessionStorage on/off + https://bugs.webkit.org/show_bug.cgi?id=28836 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + * tests/qwebpage/tst_qwebpage.cpp: + (testFlag): + (tst_QWebPage::testOptionalJSObjects): + +2009-09-02 Richard Moore <rich@kde.org> + + Reviewed by Tor Arne Vestbø. + + [Qt] Make sure we relayout the page after evaluating JS + + https://bugs.webkit.org/show_bug.cgi?id=28235 + + QtWebKit does not always seem to reflow the page when evaluating + javascript. This patch changes the way evaluateJavaScript works to + use the frameloader which ensures that this is done properly. + + * Api/qwebframe.cpp: + (QWebFrame::evaluateJavaScript): + * tests/qwebframe/tst_qwebframe.cpp: + +2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=25889 + [GTK] scrollbar policy for main frame is not implementable + + Add empty implementation for new ChromeClient method. + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::scrollbarsModeDidChange): + +2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Ariya Hidayat. + + QWebHistory::clear() modifications. + + Clear() method was changed. If QWebHistory is empty (there is no + elements even current) clear() do nothing. If there at least one + element clear() will delete everything apart of current. + + New autotests in QWebHistory + + New autotests were added to QWebHistory. They should check some crashes + in save and restore state process and clear() method and general + behavior on where QWebHistory::count() == 0 or QWebHistory::count() == 1 + + Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=28711 + + * Api/qwebhistory.cpp: + (QWebHistory::clear): + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::back): + (tst_QWebHistory::forward): + (tst_QWebHistory::saveAndRestore_crash_1): + (tst_QWebHistory::saveAndRestore_crash_2): + (tst_QWebHistory::saveAndRestore_crash_3): + (tst_QWebHistory::clear): + +2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Ariya Hidayat. + + [Qt] Cleanup, old and commented part of source code was removed. + Fix some formatting problems. + + https://bugs.webkit.org/show_bug.cgi?id=28712 + + * Api/qwebhistory_p.h: + (QWebHistoryPrivate::QWebHistoryPrivate): + +2009-08-26 Adam Barth <abarth@webkit.org> + + Reviewed by Oliver Hunt. + + Don't let local files access web URLs + https://bugs.webkit.org/show_bug.cgi?id=28480 + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2009-08-25 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Ariya Hidayat. + + Bug 28708 - Make possible to better use ResourceError in FrameLoaderClientQt class. + + * Api/qwebframe.cpp: + (QWebFrame::requestedUrl): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): + (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad): + (WebCore::FrameLoaderClientQt::postProgressFinishedNotification): + (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-08-22 Adam Barth <abarth@webkit.org> + + Revert 47684. We're going to do this later once clients have had a + chance to opt into the setting they like. + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2009-08-22 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Don't let local files access web URLs + https://bugs.webkit.org/show_bug.cgi?id=28480 + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2009-08-19 Aaron Boodman <aa@chromium.org> + + Speculative build break fix for qt. + + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::whiteListAccessFromOrigin): + * Api/qwebsecurityorigin.h: + +2009-08-19 Aaron Boodman <aa@chromium.org> + + Reviewed by David Levin. + + https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to + specify a more granular policy for cross-origin XHR access. + + * Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists. + (QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto. + (QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto. + * Api/qwebsecurityorigin.h: Ditto. + +2009-08-18 Markus Goetz <Markus.Goetz@nokia.com> + + Reviwed by Ariya Hidayat. + + [Qt] For prefecthDNS, the pre-fetching has to be enabled in the + WebSettings. + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2009-08-17 Darin Adler <darin@apple.com> + + Try to fix Qt build again. + + * WebCoreSupport/EditorClientQt.cpp: Move "using namespace". + +2009-08-17 Darin Adler <darin@apple.com> + + Try to fix Qt build. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::shouldShowDeleteInterface): + Use getAttribute(classAttr) instead of className() function. + +2009-08-14 Yongjun Zhang <yongjun.zhang@nokia.com> + + Reviewed by Simon Hausmann. + + RVCT elftran fails to resolve QPainter::staticMetaObject coming with + QWebView::RenderHints property. + + This is a temporary fix and will be revereted when the right symbols + exported from Qt lib in S60. + + https://bugs.webkit.org/show_bug.cgi?id=28181 + + * Api/qwebview.h: + +2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Public API to configure the storage path for HTML5 localStorage + https://bugs.webkit.org/show_bug.cgi?id=28036 + + Disables LocalStorage for QtWebKit by default by setting + QWebSettings::LocalStorageEnabled to false. + + Sets up a default for the LocalStorage path so that clients would only + need to enable the LocalStorageEnabled setting to turn on LocalStoragre + support. + + Turn on LocalStorage support for QtLauncher and the relevant test + since LocalStorage is now disabled by default for QtWebkit. + + * Api/qwebpage.cpp: + (defaultCachePath): + (initializeApplicationCachePathIfNecessary): + (QWebPagePrivate::QWebPagePrivate): + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + (QWebSettings::setLocalStoragePath): + (QWebSettings::localStoragePath): + * Api/qwebsettings.h: + * QtLauncher/main.cpp: + (main): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::multiplePageGroupsAndLocalStorage): + +2009-08-14 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Allow applications to register their own local URL scheme. + https://bugs.webkit.org/show_bug.cgi?id=28240 + + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::addLocalScheme): + (QWebSecurityOrigin::removeLocalScheme): + (QWebSecurityOrigin::localSchemes): + * Api/qwebsecurityorigin.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::localURLSchemes): + +2009-08-13 Mark Rowe <mrowe@apple.com> + + Try and fix the Qt build. + + * Api/qwebelement.cpp: + +2009-08-13 Kavindra Devi Palaraja <kavindra.palaraja@nokia.com> + + Reviewed by Simon Hausmann. + + Doc - Some cleanup on the documentation of QWebElement + + * Api/qwebelement.cpp: + +2009-08-13 Norbert Leser <norbert.leser@nokia.com> + + Reviewed by Simon Hausmann. + + Symbian target components (library and executable files) + require Unique Identifiers (i.e., UID3). + These identifiers are defined in the respective project + files, conditionally for "symbian" platform. + + * QtLauncher/QtLauncher.pro: + * tests/qwebelement/qwebelement.pro: + * tests/qwebframe/qwebframe.pro: + * tests/qwebhistory/qwebhistory.pro: + * tests/qwebhistoryinterface/qwebhistoryinterface.pro: + * tests/qwebpage/qwebpage.pro: + * tests/qwebview/qwebview.pro: + +2009-08-12 George Wright <george.wright@torchmobile.com> + + Reviewed by Adam Treat. + + Initialise zoom levels independent of whether a URL is valid or not to + fix https://bugs.webkit.org/show_bug.cgi?id=28162 + + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + +2009-08-12 Joerg Bornemann <joerg.bornemann@trolltech.com> + + Reviewed by Simon Hausmann. + + QtWebKit compile fix for Windows CE + + There's no getenv on Windows CE, use qgetenv instead. + + * Api/qwebpage.cpp: + (qt_drt_overwritePluginDirectories): + +2009-08-10 Kavindra Palaraja <kavindra.palaraja@nokia.com> + + Reviewed by Simon Hausmann. + + Various fixes and improvements to the QWebPluginInfo, QWebPluginDatabase and QWebSettings documentation. + + * Api/qwebplugindatabase.cpp: + * Api/qwebsettings.cpp: + +2009-08-08 Volker Hilsheimer <volker.hilsheimer@nokia.com> + + Reviewed by Simon Hausmann. + + Doc: there is no group of explicitly shared classes, only one class uses this. + + Explain the implications in the QWebHistoryItem documentation, and get rid + of the "group". + + * Api/qwebhistory.cpp: + +2009-08-05 Csaba Osztrogonac <oszi@inf.u-szeged.hu> + + Reviewed by Simon Hausmann. + + [Qt] Fix build error caused by http://trac.webkit.org/changeset/46763 + + * Api/qwebpluginfactory.h: Export macro added. + +2009-08-04 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Simon Hausmann. + + [Qt] QWebFrame::requestedUrl method can mis-behave in case of unhandled sslErrors. + https://bugs.webkit.org/show_bug.cgi?id=27804 + + * Api/qwebframe.cpp: + (QWebFrame::requestedUrl): + * tests/qwebframe/tst_qwebframe.cpp: + +2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Rename QWebPlugin to QWebPluginInfo, as discussed on IRC. + + * Api/qwebplugindatabase.cpp: + (QWebPluginInfoPrivate::QWebPluginInfoPrivate): + (QWebPluginInfo::QWebPluginInfo): + (QWebPluginInfo::~QWebPluginInfo): + (QWebPluginInfo::name): + (QWebPluginInfo::description): + (QWebPluginInfo::mimeTypes): + (QWebPluginInfo::supportsMimeType): + (QWebPluginInfo::path): + (QWebPluginInfo::isNull): + (QWebPluginInfo::setEnabled): + (QWebPluginInfo::isEnabled): + (QWebPluginInfo::operator==): + (QWebPluginInfo::operator!=): + (QWebPluginInfo::operator=): + (QWebPluginDatabase::plugins): + (QWebPluginDatabase::pluginForMimeType): + (QWebPluginDatabase::setPreferredPluginForMimeType): + * Api/qwebplugindatabase.h: + * Api/qwebplugindatabase_p.h: + * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: + (tst_QWebPluginDatabase::installedPlugins): + (tst_QWebPluginDatabase::searchPaths): + (tst_QWebPluginDatabase::null_data): + (tst_QWebPluginDatabase::null): + (tst_QWebPluginDatabase::pluginForMimeType): + (tst_QWebPluginDatabase::enabled): + (tst_QWebPluginDatabase::operatorequal_data): + (tst_QWebPluginDatabase::operatorequal): + (tst_QWebPluginDatabase::preferredPlugin): + +2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Adam Treat. + + Replace QWebPlugin::MimeType with a typedef to + QWebPluginFactory::MimeType. + + * Api/qwebplugindatabase.cpp: + * Api/qwebplugindatabase.h: + * Api/qwebpluginfactory.cpp: + (QWebPluginFactory::MimeType::operator==): + * Api/qwebpluginfactory.h: + +2009-08-04 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + Add QWebPluginDatabase API to the Qt API. + + https://bugs.webkit.org/show_bug.cgi?id=27651 + + * Api/headers.pri: + * Api/qwebplugindatabase.cpp: Added. + (QWebPluginPrivate::QWebPluginPrivate): + (QWebPluginDatabasePrivate::QWebPluginDatabasePrivate): + (QWebPlugin::MimeType::operator==): + (QWebPlugin::QWebPlugin): + (QWebPlugin::~QWebPlugin): + (QWebPlugin::name): + (QWebPlugin::description): + (QWebPlugin::mimeTypes): + (QWebPlugin::supportsMimeType): + (QWebPlugin::path): + (QWebPlugin::isNull): + (QWebPlugin::setEnabled): + (QWebPlugin::isEnabled): + (QWebPlugin::operator==): + (QWebPlugin::operator!=): + (QWebPlugin::operator=): + (QWebPluginDatabase::QWebPluginDatabase): + (QWebPluginDatabase::~QWebPluginDatabase): + (QWebPluginDatabase::plugins): + (QWebPluginDatabase::defaultSearchPaths): + (QWebPluginDatabase::searchPaths): + (QWebPluginDatabase::setSearchPaths): + (QWebPluginDatabase::addSearchPath): + (QWebPluginDatabase::refresh): + (QWebPluginDatabase::pluginForMimeType): + (QWebPluginDatabase::setPreferredPluginForMimeType): + * Api/qwebplugindatabase.h: Added. + * Api/qwebplugindatabase_p.h: Added. + * Api/qwebsettings.cpp: + (QWebSettings::pluginDatabase): + * Api/qwebsettings.h: + * tests/qwebplugindatabase/qwebplugindatabase.pro: Added. + * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: Added. + (tst_QWebPluginDatabase::installedPlugins): + (tst_QWebPluginDatabase::searchPaths): + (tst_QWebPluginDatabase::null_data): + (tst_QWebPluginDatabase::null): + (tst_QWebPluginDatabase::pluginForMimeType): + (tst_QWebPluginDatabase::enabled): + (tst_QWebPluginDatabase::operatorequal_data): + (tst_QWebPluginDatabase::operatorequal): + (tst_QWebPluginDatabase::preferredPlugin): + * tests/tests.pro: + +2009-08-03 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> + + Reviewed by Simon Hausmann. + + Do memory cleanup when running robotized QtLauncher in debug as well. + + * QtLauncher/main.cpp: + (launcherMain): + (main): + +2009-07-30 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Initialize HTML5 Application Cache for QtWebKit to a sensible default + https://bugs.webkit.org/show_bug.cgi?id=27866 + + * Api/qwebpage.cpp: + (initializeApplicationCachePathIfNecessary): + (QWebPagePrivate::QWebPagePrivate): + +2009-07-31 Jakob Petsovits <jakob.petsovits@torchmobile.com> + + Reviewed by Adam Treat. + + Build QtWebKit without benchmark tests for Qt < 4.5. + https://bugs.webkit.org/show_bug.cgi?id=27886 + + The QBENCHMARK macro is only available from 4.5 on, + so builds for Qt < 4.5 shouldn't try to build those. + + * tests/tests.pro: + +2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Adam Treat. + + Fix warning by migrating use of QString.sprintf(...) to + QString.arg().arg()... + + * WebCoreSupport/EditorClientQt.cpp: + (dumpRange): + +2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Tor Arne Vestbø. + + Expose the Offline Web Application Cache in the Qt API. + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + (QWebSettings::setOfflineWebApplicationCachePath): + (QWebSettings::offlineWebApplicationCachePath): + (QWebSettings::setOfflineWebApplicationCacheQuota): + (QWebSettings::offlineWebApplicationCacheQuota): + * Api/qwebsettings.h: + +2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Adam Treat. + + Add missing Q_OBJECT to class inheriting from QObject. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Adam Treat. + + Fix indentation. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com> + + Reviewed by Simon Hausmann. + + Fix documentation links to examples. + + * Api/qwebview.cpp: + +2009-07-30 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> + + Reviewed by Simon Hausmann. + + Allocate MainWindow on heap in robotized QtLauncher as well. + + * QtLauncher/main.cpp: + (main): + +2009-07-29 Kevin McCullough <kmccullough@apple.com> + + Reviewed by Darin Adler. + + Added foundation work to allow a testing infrastructure for the Web + Inspector. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::inspectorWindowObjectCleared): + * WebCoreSupport/InspectorClientQt.h: + +2009-07-29 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> + + Reviewed by Simon Hausmann. + + [Qt] In debug mode, this fix frees cached resources + and other unreferenced objects (by calling the + garbage collector) to remove the LEAK messages. + https://bugs.webkit.org/show_bug.cgi?id=27767 + + * Api/qwebframe.cpp: + (qt_drt_cache_clear): + * QtLauncher/main.cpp: + (main): + +2009-07-28 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Fix the Qt build by adapting to the changes of ScriptObject. + + * Api/qwebelement.cpp: + (setupScriptObject): + +2009-07-28 Robert Hogan <robert@roberthogan.net> + + Reviewed by Simon Hausmann. + + Add WebKit version API to Qt. + + Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig + at compile time and make it available to Qt applications through + qWebKitVersion(). + + Also amend the User Agent string to place the Safari clause outside + the final bracket and to the end of the UA string. + + https://bugs.webkit.org/show_bug.cgi?id=27158 + + Minor build tweak by Simon Hausmann (adding export macros to new functions). + + * Api/headers.pri: + * Api/qwebkitversion.cpp: Added. + (webKitVersion): + (webKitMajorVersion): + (webKitMinorVersion): + * Api/qwebkitversion.h: Added. + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::getWebKitVersion): + +2009-07-28 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Ariya Hidayat. + + Fix compilation with the precompiled header. + + * WebKit_pch.h: Don't include JSDOMBinding.h and MathObject.h, + as they include AtomicString.h. AtomicString.cpp needs to enable + a #define before including AtomicString.h, which breaks if the PCH + forces the inclusion beforehand. + +2009-07-28 Ariya Hidayat <ariya.hidayat@nokia.com> + + Reviewed by Simon Hausmann. + + Added tests to ensure that scroll position can be changed + programmatically, even when the scroll bar policy is set to off. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + Fix a few compilation warnings in the QWebFrame tests. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-28 Andre Pedralho <andre.pedralho@openbossa.org> + + Reviewed by Simon Hausmann. + + Fixed tst_QWebFrame::hasSetFocus test which was using + an undefined resource. + https://bugs.webkit.org/show_bug.cgi?id=27512 + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-28 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Make it possible to pass relative file names to QtLauncher. + + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + +2009-07-27 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=27735 + Give a helpful name to JSLock constructor argument + + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): + +2009-07-27 Volker Hilsheimer <volker.hilsheimer@nokia.com> + + Reviewed by Simon Hausmann. + + QWebView's "enabled" parameter should default to true, as with QGraphicsView and + QPainter. + + * Api/qwebview.cpp: Add reference to QPainter::renderHints(). + * Api/qwebview.h: Add default for enabled argument. + +2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> + + Reviewed by Simon Hausmann. + + More documentation cleanups in the QWebElement class overview. + + * Api/qwebelement.cpp: + +2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> + + Reviewed by Simon Hausmann. + + Clean up documentation of QWebElement's findFirst and findAll functions, + as well as their QWebFrame counterparts. + + * Api/qwebelement.cpp: + * Api/qwebframe.cpp: + +2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> + + Reviewed by Simon Hausmann. + + Various documentation cleanups + + * Fixed qdoc warnings + * Hide QWebNetworkInterface from the class overview + * Mention QWebElement in the module overview + * More cleanups + + * Api/qwebframe.cpp: + * Api/qwebnetworkinterface.cpp: + * Api/qwebview.cpp: + * docs/qtwebkit.qdoc: + +2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> + + Reviewed by Simon Hausmann. + + Added missing class diagram referenced from the docs, taken from the Qt + documentation. + + * docs/qtwebkit.qdocconf: Register the image directory with + qdoc. + * docs/qwebview-diagram.png: Added. + +2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Adam Treat. + + As per discussion on IRC, changed originalUrl by requestedUrl. + + * Api/qwebframe.cpp: + (QWebFrame::requestedUrl): + * Api/qwebframe.h: + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-24 Andre Pedralho <andre.pedralho@openbossa.org> + + Reviewed by Adam Treat. + + Removed void QWebFrame::renderContents(...) and added the Q_PROPERTY + clipRenderToViewport to control whether QWebFrame::render would call + FrameView::paintContents rather than FrameView::paint and do not clip + the frame content to viewport. + + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderPrivate): + (QWebFrame::clipRenderToViewport): + (QWebFrame::setClipRenderToViewport): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Simon Hausmann. + + [QT] Implement originalUrl getter method to the API + https://bugs.webkit.org/show_bug.cgi?id=25867 + + * Api/qwebframe.cpp: + (QWebFrame::originalUrl): + * Api/qwebframe.h: + * tests/qwebframe/qwebframe.qrc: + * tests/qwebframe/test1.html: Added. + * tests/qwebframe/test2.html: Added. + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-24 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Build fix for Qt. + + Fix build issue introduced in 46344 + ([Bug 22700] ApplicationCache should have size limit) + + Remove method only added to the Qt ChromeClient. + + * WebCoreSupport/ChromeClientQt.h: + +2009-07-24 Andrei Popescu <andreip@google.com> + + Reviewed by Anders Carlsson. + + ApplicationCache should have size limit + https://bugs.webkit.org/show_bug.cgi?id=22700 + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::reachedMaxAppCacheSize): + Adds empty implementation of the reachedMaxAppCacheSize callback. + * WebCoreSupport/ChromeClientQt.h: + +2009-07-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Add simple proxy support for QtLauncher + https://bugs.webkit.org/show_bug.cgi?id=27495 + + Picks up proxy settings from the http_proxy environment + variable. + + * QtLauncher/QtLauncher.pro: Add QtNetwork dependency for all + platforms. + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + +2009-07-23 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Holger Freyther. + + Added a testcase to verify that cached methods in the QOBject bindings + remain alife even after garbage collection. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::protectBindingsRuntimeObjectsFromCollector): + +2009-07-23 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> + + Reviewed by Simon Hausmann. + + Fixing two issues related to QtLauncher + - MainWindow objects are not always freed after close + - JavaScript window.close() sometimes crashes + https://bugs.webkit.org/show_bug.cgi?id=27601 + + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + (main): + +2009-07-21 Volker Hilsheimer <volker.hilsheimer@nokia.com> + + Reviewed by Simon Hausmann. + + Various improvements to the API documentation. + + * Updated link to W3c Database spec + * Formatting fixes, cleanups + * Add missing \since 4.6 tags to QWebPage::frameAt + * Extend QWebDatabase and QWebSecurityOrigin docs. + + * Api/qwebdatabase.cpp: + * Api/qwebpage.cpp: + * Api/qwebsecurityorigin.cpp: + * Api/qwebview.cpp: + +2009-07-21 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Rubber-stamped by Simon Hausmann. + + Remove preliminary-tag from QWebElement + + * Api/qwebelement.cpp: + +2009-07-20 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Eric Seidel. + + Fix Qt code to follow the WebKit Coding Style. + + * Api/qcookiejar.cpp: + (QCookieJar::setCookieJar): + (QCookieJar::cookieJar): + * Api/qcookiejar.h: + * Api/qwebdatabase.cpp: + (QWebDatabase::QWebDatabase): + (QWebDatabase::removeDatabase): + * Api/qwebdatabase.h: + * Api/qwebdatabase_p.h: + * Api/qwebelement.h: + * Api/qwebframe.cpp: + (QWebFrame::title): + (QWebFrame::print): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + * Api/qwebhistory.cpp: + (QWebHistory::clear): + * Api/qwebhistory.h: + * Api/qwebhistory_p.h: + * Api/qwebhistoryinterface.cpp: + (gCleanupInterface): + (QWebHistoryInterface::setDefaultInterface): + (QWebHistoryInterface::defaultInterface): + (QWebHistoryInterface::QWebHistoryInterface): + * Api/qwebhistoryinterface.h: + * Api/qwebnetworkinterface.cpp: + (QWebNetworkManager::started): + (QWebNetworkManager::finished): + (QWebNetworkInterfacePrivate::parseDataUrl): + (QWebNetworkInterface::addJob): + (WebCoreHttp::onResponseHeaderReceived): + (WebCoreHttp::onReadyRead): + * Api/qwebnetworkinterface.h: + * Api/qwebnetworkinterface_p.h: + * Api/qwebpage.cpp: + (QWebPagePrivate::editorCommandForWebActions): + (QWebPagePrivate::createContextMenu): + (QWebPagePrivate::focusInEvent): + (QWebPage::fixedContentsSize): + (QWebPage::setContentEditable): + (QWebPage::swallowContextMenuEvent): + (QWebPage::findText): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + * Api/qwebpluginfactory.h: + * Api/qwebsecurityorigin.h: + * Api/qwebsecurityorigin_p.h: + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::QWebSettingsPrivate): + (QWebSettingsPrivate::apply): + (QWebSettings::globalSettings): + (QWebSettings::QWebSettings): + (QWebSettings::fontSize): + (QWebSettings::setUserStyleSheetUrl): + (QWebSettings::setDefaultTextEncoding): + (QWebSettings::setIconDatabasePath): + (QWebSettings::iconDatabasePath): + (QWebSettings::iconForUrl): + (QWebSettings::setWebGraphic): + (QWebSettings::setFontFamily): + (QWebSettings::fontFamily): + (QWebSettings::testAttribute): + (qt_websettings_setLocalStorageDatabasePath): + * Api/qwebsettings.h: + * Api/qwebview.cpp: + (QWebView::setPage): + (QWebView::event): + * Api/qwebview.h: + +2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Hausmann. + + [Qt] Add test for loading webpages... + + Performance test for loading webpages. Wait for the loadFinished + signal to be fired. This should include a non empty layout. + + * tests/benchmarks/loading/tst_loading.cpp: Added. + (waitForSignal): + (tst_Loading::init): + (tst_Loading::cleanup): + (tst_Loading::load_data): + (tst_Loading::load): + * tests/benchmarks/loading/tst_loading.pro: Added. + * tests/tests.pro: + +2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Hausmann. + + [Qt] Add a test case for drawing a simple viewrect to a QPixmap + + * tests/benchmarks/painting/tst_painting.cpp: Added. + (waitForSignal): + (tst_Painting::init): + (tst_Painting::cleanup): + (tst_Painting::paint_data): + (tst_Painting::paint): + * tests/benchmarks/painting/tst_painting.pro: Added. + * tests/tests.pro: + +2009-07-20 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Holger Freyther. + + [Qt] Add an option for QtLauncher to build without QtUiTools dependency + https://bugs.webkit.org/show_bug.cgi?id=27438 + + Based on Norbert Leser's work. + + * QtLauncher/main.cpp: + (WebPage::createPlugin): + +2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Adam Treat. + + Coding style fixes. + + * Api/qcookiejar.cpp: + (QCookieJarPrivate::QCookieJarPrivate): + (qHash): + (QCookieJar::cookieJar): + * Api/qwebelement.cpp: + (QWebElement::functions): + (QWebElement::scriptableProperties): + * Api/qwebframe.cpp: + (QWebFrame::metaData): + (QWebFrame::scrollBarValue): + (QWebFrame::scroll): + (QWebFrame::scrollPosition): + (QWebFrame::print): + * Api/qwebnetworkinterface.cpp: + (decodePercentEncoding): + (QWebNetworkRequestPrivate::init): + (QWebNetworkRequestPrivate::setURL): + (QWebNetworkRequest::QWebNetworkRequest): + (QWebNetworkRequest::operator=): + (QWebNetworkRequest::setUrl): + (QWebNetworkRequest::setHttpHeader): + (QWebNetworkRequest::httpHeaderField): + (QWebNetworkRequest::setHttpHeaderField): + (QWebNetworkRequest::setPostData): + (QWebNetworkJob::setResponse): + (QWebNetworkJob::frame): + (QWebNetworkManager::add): + (QWebNetworkManager::cancel): + (QWebNetworkManager::started): + (QWebNetworkManager::data): + (QWebNetworkManager::finished): + (QWebNetworkManager::addHttpJob): + (QWebNetworkManager::cancelHttpJob): + (QWebNetworkManager::httpConnectionClosed): + (QWebNetworkInterfacePrivate::sendFileData): + (QWebNetworkInterfacePrivate::parseDataUrl): + (QWebNetworkManager::doWork): + (QWebNetworkInterface::setDefaultInterface): + (QWebNetworkInterface::defaultInterface): + (QWebNetworkInterface::QWebNetworkInterface): + (QWebNetworkInterface::addJob): + (QWebNetworkInterface::cancelJob): + (WebCoreHttp::WebCoreHttp): + (WebCoreHttp::request): + (WebCoreHttp::scheduleNextRequest): + (WebCoreHttp::getConnection): + (WebCoreHttp::onResponseHeaderReceived): + (WebCoreHttp::onReadyRead): + (WebCoreHttp::onRequestFinished): + (WebCoreHttp::onAuthenticationRequired): + (WebCoreHttp::onProxyAuthenticationRequired): + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::inputMethodEvent): + (QWebPagePrivate::shortcutOverrideEvent): + (QWebPage::inputMethodQuery): + (QWebPage::javaScriptPrompt): + (QWebPage::updatePositionDependentActions): + (QWebPage::userAgentForUrl): + (QWebPagePrivate::_q_onLoadProgressChanged): + (QWebPage::totalBytes): + (QWebPage::bytesReceived): + * Api/qwebsettings.cpp: + (QWebSettings::iconForUrl): + (QWebSettings::setObjectCacheCapacities): + * Api/qwebview.cpp: + (QWebView::paintEvent): + (QWebView::changeEvent): + +2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Simon Hausmann. + + Overwrite the plugin directories for the DRT. + Part of https://bugs.webkit.org/show_bug.cgi?id=27215 + + * Api/qwebpage.cpp: + (qt_drt_overwritePluginDirectories): Only set the plugin directories + to the ones in the QTWEBKIT_PLUGIN_PATH environment variable. + +2009-07-16 Xiaomei Ji <xji@chromium.org> + + Reviewed by Dan Bernstein. + + This is the 2nd part of fixing "RTL: tooltip does not get its directionlity from its element's." + https://bugs.webkit.org/show_bug.cgi?id=24187 + + Add one extra parameter to the callee of HitTestResult::title() due to the signature change. + + * Api/qwebframe.cpp: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): Add direction as a parameter to the callee of HitTestResult::title(). + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::mouseDidMoveOverElement): Add direction as a parameter to the callee of HitTestResult::title(). + +2009-07-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by Adam Treat. + + Add new action to qwebpage to reload without cache. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateAction): + (QWebPagePrivate::updateNavigationActions): + (QWebPage::triggerAction): + * Api/qwebpage.h: + +2009-07-16 Xiaomei Ji <xji@chromium.org> + + Reviewed by Darin Adler. + + Fix tooltip does not get its directionality from its element's directionality. + https://bugs.webkit.org/show_bug.cgi?id=24187 + + Per mitz's suggestion in comment #6, while getting the plain-text + title, we also get the directionality of the title. How to handle + the directionality is up to clients. Clients could ignore it, + or use attribute or unicode control characters to display the title + as what they want. + + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::setToolTip): Add directionality as 2nd parameter to setToopTip() (without handling it yet). + * WebCoreSupport/ChromeClientQt.h: Add directionality as 2nd parameter to setToolTip(). + +2009-07-15 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=27285 + + When the user clicks a link with a target attribute, the newly created window should be visible. + Make new windows created in Qtlauncher visible. + + * QtLauncher/main.cpp: + (WebPage::createWindow): + +2009-07-14 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Zack Rusin. + + https://bugs.webkit.org/show_bug.cgi?id=26983 + + The default constructed values for QSize and WebCore::IntSize are different. The former + produces an invalid size whereas the latter produces a size of zero. This was causing + a layout to be triggered when constructing a view and an assert to be hit. This patch fixes + the crash by taking care not to cause an unnecessary layout triggered by ScrollView::setFixedLayoutSize. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2009-07-13 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Fix qdoc warnings for QWebPage::shouldInterruptJavaScript() and mention + how to re-implement it. + + * Api/qwebpage.cpp: + +2009-07-13 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Ariya Hidayat. + + Fix crash with plugins when the plugin stream is cancelled. + + Similar to r26667 handle the case where didReceiveResponse on the + plugin view results in failure to set up the stream and + setMainDocumentError being called instead. This will set the + m_pluginView back to 0 and we need check for it before calling + didReceiveData. + + This was triggered by consecutive execution of + LayoutTests/plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html + followed by LayoutTests/scrollbars/scrollbar-crash-on-refresh.html + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::committedLoad): + +2009-07-13 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Ariya Hidayat. + + Added QWebDatabase::removeAllDatabases, as a way to delete all + databases from the offline storage path. + + Used by the Qt DRT. + + * Api/qwebdatabase.cpp: + (QWebDatabase::removeAllDatabases): + * Api/qwebdatabase.h: + +2009-07-13 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Ariya Hidayat. + + Added loadStarted() and loadFinished() signals to QWebFrame, + to allow load tracking of individual frames, as opposed to + QWebPage's loadStarted/loadFinished signals that are emitted + whenever _any_ child frame loads/finishes. + + * Api/qwebframe.cpp: Document new signals. + * Api/qwebframe.h: Add new signals. + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::setFrame): Connect new signals. + +2009-07-13 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Ariya Hidayat. + + Add hooks for the GCController JavaScript interface needed by the + Qt DRT. + + Fixed sort order of includes in qwebframe.cpp. + + * Api/qwebframe.cpp: + (qt_drt_javaScriptObjectsCount): + (qt_drt_garbageCollector_collect): + (qt_drt_garbageCollector_collectOnAlternateThread): + +2009-07-13 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Ariya Hidayat. + + Add hooks for the GCController JavaScript interface needed by the + Qt DRT. + + Fixed sort order of includes in qwebframe.cpp. + + * Api/qwebframe.cpp: + (qt_drt_javaScriptObjectsCount): + (qt_drt_garbageCollector_collect): + (qt_drt_garbageCollector_collectOnAlternateThread): + +2009-07-12 Brent Fulgham <bfulgham@gmail.com> + + Speculative build fix after http://trac.webkit.org/changeset/45786. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::addMessageToConsole): + * WebCoreSupport/ChromeClientQt.h: + +2009-07-10 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=27136 + + Fix a bug where webkit hangs when executing infinite JavaScript loop. + + * Api/qwebpage.cpp: + (QWebPage::shouldInterruptJavaScript): + * Api/qwebpage.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::shouldInterruptJavaScript): + * tests/qwebpage/tst_qwebpage.cpp: + (JSTestPage::JSTestPage): + (JSTestPage::shouldInterruptJavaScript): + (tst_QWebPage::infiniteLoopJS): + +2009-07-10 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=27108 + + Fix crash when in frame tree of a new frame before the new frame + has been installed in the frame tree, similar to r35088. + + After calling Frame::init() the frame it may have been removed from the + frame tree again through JavaScript. Detect this by checking the page() + afterwards. + + To make this check safe the Frame::init() code was moved into + QWebFrameData's constructor, where a RefPtr holds a reference to the frame. + After the check back in FrameLoaderClientQt we would hold the single + reference left and after release() the frame, its frame loader, its + client as well as the QWebFrame should have disappeared then. + + * Api/qwebframe.cpp: + (QWebFramePrivate::init): Only call Frame::init here, the rest is + done in QWebFrameData's constructor. + (QWebFrame::QWebFrame): + * Api/qwebframe_p.h: Adjust declaration. + (QWebFrameData::QWebFrameData): Create the Frame here. + * Api/qwebpage.cpp: + (QWebPagePrivate::createMainFrame): Adjust and simplify + to new QWebFrame constructor. + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createFrame): Adjust to + new QWebFrame construction using QWebFrameData and add the + check like in r35088. + +2009-07-09 Beth Dakin <bdakin@apple.com> + + Reviewed by Dave Hyatt. + + Make Widget RefCounted to fix: + + <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs + at WebCore::Widget::afterMouseDown() after clicking To Do's close + box + <rdar://problem/6978804> WER #16: Repro Access Violation in + WebCore::PluginView::bindingInstance (1310178023) + -and- + <rdar://problem/6991251> WER #13: Crash in WebKit! + WebCore::PluginView::performRequest+203 (1311461169) + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + (WebCore::FrameLoaderClientQt::createJavaAppletWidget): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-07-08 Pradeepto Bhattacharya <pradeepto@kde.org> + + Reviewed by Ariya Hidayat. + + Build fix. + + * WebCoreSupport/FrameLoaderClientQt.h: Removed the slot slotCallPolicyFunction(). + +2009-07-08 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Tor Arne Vestbø. + + https://bugs.webkit.org/show_bug.cgi?id=27080 + + Fix DRT instability issues with fast/loader/submit-form-while-parsing-2.html + + When the form is submitted we call the policy function in the frame + loader delayed with a queued connection. That queued connection + sometimes interferes with the javascript timeout set in the testcase. + + Eliminate the entire delayed policy function mechanism and instead always + call back directly, like in the other ports. In most other places we called + the slot directly anyway. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): Remove m_policyFunction. + (WebCore::FrameLoaderClientQt::callPolicyFunction): Call the policy function directly instead + of emitting the queued signal. + (WebCore::FrameLoaderClientQt::cancelPolicyCheck): Call callPolicyFunction directly. + (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm): Ditto. + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType): Ditto. + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction): Ditto. + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): Ditto. + * WebCoreSupport/FrameLoaderClientQt.h: Remove m_policyFunction as well as the associated + signal. + +2009-07-07 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Holger Freyther. + + Add Qt DRT hook for clearing the frame name. + + * Api/qwebframe.cpp: + (qt_drt_clearFrameName): + +2009-07-05 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Holger Freyther. + + Fix two qdoc warnings. + + Added missing \property for QWebFrame::hasFocus and added \a + tag for pos of QWebPage::frameAt. + + * Api/qwebframe.cpp: + * Api/qwebpage.cpp: + +2009-07-04 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Hausmann. + + Use the recently introduced FocusController::setFocused + + Use the recently introduced FocusController::setFocused + in the Qt platform. The SelectionController will be updated + from within the FocusController now. + + * Api/qwebpage.cpp: + (QWebPagePrivate::focusInEvent): + (QWebPagePrivate::focusOutEvent): + +2009-07-02 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Improve documentation of QWebFrame::setFocus and hasFocus() + Added missing Q_PROPERTY for QWebFrame::hasFocus. + + * Api/qwebframe.cpp: Clarify the docs. + * Api/qwebframe.h: add Q_PROPERTY(focus). + +2009-07-02 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Simon Hausmann. + + Bug 26855: [Qt] New methods for QWebFrame to check and set focus. + + Added new public methods QWebFrame::hasFocus() and QWebFrame::setFocus() + Added auto test. + + * Api/qwebframe.cpp: + (QWebFrame::hasFocus): + (QWebFrame::setFocus): + * Api/qwebframe.h: + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-01 Robert Hogan <robert@roberthogan.net> + + Reviewed by NOBODY. + + Fix Qt segfault when javascript disabled. + If clients call addToJavaScriptWindowObject even though JavascriptEnabled is false + webkit will segfault on the assert: + ASSERTION FAILED: _rootObject + (../../../WebCore/bridge/runtime.cpp:52 + JSC::Bindings::Instance::Instance(WTF::PassRefPtr<JSC::Bindings::RootObject>)) + Fix is to ensure JavaScript is enabled when client calls addToJavaScriptWindowObject. + + https://bugs.webkit.org/show_bug.cgi?id=26906 + + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): + +2009-07-01 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + [Qt] Move some API headers from WebCore.pro to headers.pri so that they + get installed when running make install from the build directory. + + * Api/headers.pri: + +2009-07-01 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> + + Reviewed by Simon Hausmann. + + Fixed robotized QtLauncher to work when there is no index.html in the user's home. + + * QtLauncher/main.cpp: + (main): + +2009-06-30 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Adam Roben. + + Renamed scrollbarUnderPoint to scrollbarAtPoint to follow conventions. + + * Api/qwebpage.cpp: + (QWebPage::swallowContextMenuEvent): + +2009-06-30 Joe Ligman <joseph.ligman@nokia.com> + + Reviewed by Adam Treat. + + Bug 26422: [Qt] QWebPagePrivate::frameAt calculates wrong frame + + Added a public method QWebPage::frameAt + Removed QWebPagePrivate::frameAt, which calcuated the wrong frame + Modified QWebPage::swallowContextMenuEvent to use the new frameAt method + New test case for frameAt added to tst_qwebpage.cpp + + * Api/qwebpage.cpp: + (QWebPage::frameAt): + (QWebPage::swallowContextMenuEvent): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + * tests/qwebpage/frametest/iframe.html: Added. + * tests/qwebpage/frametest/iframe2.html: Added. + * tests/qwebpage/frametest/iframe3.html: Added. + * tests/qwebpage/tst_qwebpage.cpp: + (frameAtHelper): + (tst_QWebPage::frameAt): + * tests/qwebpage/tst_qwebpage.qrc: + +2009-06-30 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Simon Hausmann. + + Add QWebFrame::baseUrl() function that exposes the base URL of a frame. + Autotests included. + + * Api/qwebframe.cpp: + (QWebFrame::baseUrl): + * Api/qwebframe.h: + * tests/qwebframe/tst_qwebframe.cpp: + +2009-06-29 Simon Hausmann <simon.hausmann@nokia.com> + + Fix the Qt build, add missing isSpeaking() implementation to + ContextMenuClient. + + * WebCoreSupport/ContextMenuClientQt.cpp: + (WebCore::ContextMenuClientQt::isSpeaking): + * WebCoreSupport/ContextMenuClientQt.h: + +2009-06-28 Sriram Yadavalli <sriram.yadavalli@nokia.com> + + Reviewed by Eric Seidel. + + [Qt] Fix build break for Qt + https://bugs.webkit.org/show_bug.cgi?id=26779 + + * Api/qwebpage.cpp: + (QWebPage::swallowContextMenuEvent): + +2009-06-27 Simon Hausmann <simon.hausmann@nokia.com> + + Build fix for Qt under Windows. + + * Api/qwebhistory.h: Use consistent export linkage for the datastream operators. + +2009-06-26 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Simon Fraser. + + Changed call of scrollbarUnderMouse to scrollbarUnderPoint to match new API. + + * Api/qwebpage.cpp: + (QWebPage::swallowContextMenuEvent): + +2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + Add support for saving and loading of QWebHistory to and from a QByteArray. + + This includes streaming operators for QWebHistory. for convenience. + + New autotests that test QWebHistory and QWebHistoryItem serialization. + + * Api/qwebhistory.cpp: + (QWebHistory::restoreState): + (QWebHistory::saveState): + (operator<<): + (operator>>): + * Api/qwebhistory.h: + * Api/qwebhistory_p.h: + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::): + (tst_QWebHistory::init): + (tst_QWebHistory::title): + (tst_QWebHistory::count): + (tst_QWebHistory::back): + (tst_QWebHistory::forward): + (tst_QWebHistory::itemAt): + (tst_QWebHistory::goToItem): + (tst_QWebHistory::items): + (tst_QWebHistory::serialize_1): + (tst_QWebHistory::serialize_2): + (tst_QWebHistory::serialize_3): + (tst_QWebHistory::saveAndRestore_1): + (tst_QWebHistory::saveAndRestore_2): + (tst_QWebHistory::saveAndRestore_3): + +2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + Fix the behaviour of QWebHistory::itemAt to interpret the specified index as absolute index. + + Returns an invalid QWebHistoryItem if the index is out of range. + + * Api/qwebhistory.cpp: + (QWebHistory::itemAt): + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::itemAt): + +2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + Added a few autotest to QWebHistory. + + * tests/qwebhistory/data/page1.html: Added. + * tests/qwebhistory/data/page2.html: Added. + * tests/qwebhistory/data/page3.html: Added. + * tests/qwebhistory/data/page4.html: Added. + * tests/qwebhistory/data/page5.html: Added. + * tests/qwebhistory/data/page6.html: Added. + * tests/qwebhistory/qwebhistory.pro: Added. + * tests/qwebhistory/tst_qwebhistory.cpp: Added. + (tst_QWebHistory::): + (tst_QWebHistory::tst_QWebHistory): + (tst_QWebHistory::~tst_QWebHistory): + (tst_QWebHistory::init): + (tst_QWebHistory::cleanup): + (tst_QWebHistory::title): + (tst_QWebHistory::count): + (tst_QWebHistory::back): + (tst_QWebHistory::forward): + (tst_QWebHistory::goToItem): + (tst_QWebHistory::items): + * tests/qwebhistory/tst_qwebhistory.qrc: Added. + * tests/tests.pro: + +2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + Fix support for documenting functions prefixed with QWEBKIT_EXPORT + + Add QWEBKIT_EXPORT to the list of macros to ignore by qdoc. + + * docs/qtwebkit.qdocconf: + +2009-06-26 Yongjun Zhang <yongjun.zhang@nokia.com> + + Reviewed by Eric Seidel. + + Bug 20303: [Qt] Key events are not working in frames. + + Send scrolling events to current focused frame, bubble the event + up to parent frame if it is not handled. Use EventHandler's new + shared scrolling code. + + * Api/qwebpage.cpp: + (QWebPagePrivate::keyPressEvent): + (QWebPagePrivate::handleScrolling): + * Api/qwebpage_p.h: + +2009-06-25 Jakub Wieczorek <faw217@gmail.com> + + Reviewed by Adam Treat. + + Add highlight functionality to the QWebPage::findText() method. Introduced is + new HighlightAllOccurrences flag which passed to the function will make it mark + all existing occurrences of specified string in the page. + + * Api/qwebpage.cpp: + (QWebPage::findText): + * Api/qwebpage.h: + * Api/qwebview.cpp: + +2009-06-19 Daniel Teske <qt-info@nokia.com> + + Reviewed by Simon Hausmann. + + Remove warnings for QString() constructions from const char * + + By explicitly wrapping it with QLatin1String() / QLatin1Char() + + * Api/qwebelement.cpp: + (QWebElement::classes): Use QLatin1String. + (QWebElement::addClass): Ditto. + (QWebElement::removeClass): Ditto. + (QWebElement::toggleClass): Ditto. + +2009-06-18 Friedemann Kleint <Friedemann.Kleint@nokia.com> + + Reviewed by Simon Hausmann. + + Fixed MinGW compilation. + + * Api/qwebelement.cpp: + (QWebElement::evaluateScript): + +2009-06-18 Markus Goetz <Markus.Goetz@nokia.com> + + Reviewed by Simon Hausman. + + Clarify in docs how to compile with debug information. + + * docs/qtwebkit.qdoc: + +2009-06-17 Markus Goetz <Markus.Goetz@nokia.com> + + Reviewed by Simon Hausmann. + + QWebPage: Don't call supportsSsl() + + This stops QWebPage from loading the OpenSSL libs, + certificates etc. when they are not needed for the non-HTTPS case. + + Loading the SSL libraries can be a very slow operation. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + +2009-06-16 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + Doc: Fixed QWebPage::forwardUnsupportedContent documentation and added + more information about Web plugins. + + * Api/qwebpage.cpp: + * Api/qwebsettings.cpp: + * docs/qtwebkit.qdoc: + +2009-06-16 Morten Engvoldsen <morten.engvoldsen@nokia.com> + + Reviewed by Ariya Hidayat. + + Clearifying QWebFrame docs + + Adding docs to toHtml() and toPlainText() + + * Api/qwebframe.cpp: + +2009-06-15 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by Adam Treat. + + Support the back/forward/stop/refresh multimedia keys and accept the + event when handling backspace and shift backspace as we should. + + * Api/qwebpage.cpp: + (QWebPagePrivate::keyPressEvent): + +2009-06-15 Andre Pedralho <andre.pedralho@openbossa.org> + + Reviewed by Adam Treat. + + https://bugs.webkit.org/show_bug.cgi?id=26351 + Remove bool QWebHitTestResult::isScrollBar() const and make sure a null QWebHitTestResult is returned instead. + + * Api/qwebframe.cpp: + (QWebFrame::hitTestContent): + * Api/qwebframe.h: + * Api/qwebpage.cpp: + (QWebPage::updatePositionDependentActions): + +2009-06-15 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Adam Treat. + + Fix the logic for disabling the fixed layout feature, when an invalid + QSize is set. + + * Api/qwebpage.cpp: + (QWebPage::setFixedContentsSize): + +2009-06-13 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Fisher. + + https://bugs.webkit.org/show_bug.cgi?id=24492 + + Move registerURLSchemeAsLocal from FrameLoader to SecurityOrigin. + + * Api/qwebpage.cpp: + (QWebPage::acceptNavigationRequest): + +2009-06-10 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Ariya Hidayat. + + Documented ResolveRule and StylePriority enum values as well as their use in + QWebElement::styleProperty and QWebElement::setStyleProperty methods. + + Based on the work of Simon Hausmann. + + * Api/qwebelement.cpp: + (QWebElement::styleProperty): + (QWebElement::setStyleProperty): + * Api/qwebelement.h: + +2009-06-09 Ariya Hidayat <ariya.hidayat@nokia.com> + + Rubber-stamped by Simon Hausmann. + + Fix qdoc warning, function parameter string must be referred. + + * Api/qwebview.cpp: + +2009-06-09 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Renamed QWebSettings::AllowUniversalAccessFromFileUrls to + LocalContentCanAccessRemoteUrls, as discussed in the API review. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2009-06-09 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Merged useFixedLayout property with fixedLayoutSize and + renamed the latter to fixedContentsSize. + + * Api/qwebpage.cpp: + (QWebPage::fixedContentsSize): + (QWebPage::setFixedContentsSize): + * Api/qwebpage.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2009-06-09 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Renamed QWebHitTestResult::linkTarget to linkElement() and made it return + a QWebElement. The link target itself is always the target DOM attribute. + + * Api/qwebframe.cpp: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): + (QWebHitTestResult::linkElement): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + * tests/qwebframe/tst_qwebframe.cpp: + +2009-06-08 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Holger Freyther. + + Renamed QWebElement::enclosingBlock to enclosingBlockElement + and changed the return type to QWebElement, as discussed in + the API review. This API is more generic and through + QWebElement's geometry() it is possible to retrieve the + same information. + + * Api/qwebelement.cpp: + (QWebElement::QWebElement): + * Api/qwebelement.h: + * Api/qwebframe.cpp: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): + (QWebHitTestResult::enclosingBlockElement): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + +2009-06-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Add missing includes of config.h + + * Api/qcookiejar.cpp: + * Api/qwebnetworkinterface.cpp: + * Plugins/ICOHandler.cpp: + * WebCoreSupport/DragClientQt.cpp: + * WebCoreSupport/EditCommandQt.cpp: + +2009-06-03 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Simon Hausmann. + + Add API to make it possible to clear all memory caches used by + QtWebKit. + + * Api/qwebsettings.cpp: + (QWebSettings::clearMemoryCaches): + * Api/qwebsettings.h: + +2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Rubber-stamped by Gustavo Noronha. + + Before guessing the url trim the string to remove whitespace added to the start/end by the user. + + * Api/qwebview.cpp: + (QWebView::guessUrlFromString): + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::guessUrlFromString_data): + +2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Rubber-stamped by Gustavo Noronha. + + Use QLatin1Char() to compile when QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII is defined + + * Api/qwebview.cpp: + (QWebView::guessUrlFromString): + +2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Rubber-stamped by Gustavo Noronha. + + Cleanup autotest file + - use proper includes + - remove useless constructor and destructor + - add missing newline at the end of the file + + * tests/qwebview/tst_qwebview.cpp: + +2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Rubber-stamped by Gustavo Noronha. + + Add a missing space between two words in the documentation. + + * Api/qwebview.cpp: + +2009-05-26 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=25823 + + Add an API to generate a QUrl out of a string correcting for errors and missing information. + See the API documentation for more details about the function. + + Autotests: included + + * Api/qwebview.cpp: + (QWebView::guessUrlFromString): + * Api/qwebview.h: + * QtLauncher/main.cpp: + (MainWindow::MainWindow): + (MainWindow::changeLocation): + * tests/qwebview/.gitignore: Added. + * tests/qwebview/qwebview.pro: + (tst_QWebView::initTestCase): + (tst_QWebView::cleanupTestCase): + (tst_QWebView::init): + (tst_QWebView::cleanup): + (tst_QWebView::guessUrlFromString_data): + (tst_QWebView::guessUrlFromString): + +2009-05-23 David Kilzer <ddkilzer@apple.com> + + Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr + + <https://bugs.webkit.org/show_bug.cgi?id=25495> + + Reviewed by Oliver Hunt. + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::createHTMLParserQuirks): Return a + PassOwnPtr<> instead of a raw HTMLParserQuirks pointer. + +2009-05-23 Jakob Truelsen <antialize@gmail.com> + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=25863 + + Expose the default text encoding property to Qt. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::setDefaultTextEncoding): + (QWebSettings::defaultTextEncoding): + * Api/qwebsettings.h: + +2009-05-21 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Simon Hausmann. + + [Qt] Additional test for resource load (CSS file) for QWebFrame. + + * tests/qwebframe/qwebframe.qrc: + * tests/qwebframe/style.css: Added. + * tests/qwebframe/tst_qwebframe.cpp: + +2009-05-22 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Qt build fix. + + Provide dummy implementation of pure virtual EditorClient method. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::getAutoCorrectSuggestionForMisspelledWord): + * WebCoreSupport/EditorClientQt.h: + +2009-05-20 Ariya Hidayat <ariya.hidayat@nokia.com> + + Reviewed by Simon Hausmann and Holger Freyther. + + [Qt] Add renderHints property to QWebView. + + * Api/qwebview.cpp: + (QWebViewPrivate::QWebViewPrivate): + (QWebView::renderHints): + (QWebView::setRenderHints): + (QWebView::setRenderHint): + (QWebView::paintEvent): + * Api/qwebview.h: + * tests/qwebview/qwebview.pro: Added. + * tests/qwebview/tst_qwebview.cpp: Added. + (tst_QWebView::tst_QWebView): + (tst_QWebView::~tst_QWebView): + (tst_QWebView::init): + (tst_QWebView::cleanup): + (tst_QWebView::renderHints): + * tests/tests.pro: + +2009-05-20 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=25834 + + Make ChromeClient a interface again + + With recent additions to ChromeClient.h empty defaults were + added. This is bad for porters as these changes go unnoticed + and at runtime no notImplemented warning is logged and grepping + for notImplemented will not show anything. Change this Client + to be like the other Clients again and always have pure virtuals + (but for stuff inside #ifdef PLATFORM(MAC)). + + Update the various WebKit/* implementations to compile again. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::setCursor): + (WebCore::ChromeClientQt::requestGeolocationPermissionForFrame): + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::scrollRectIntoView): + +2009-05-19 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Simon Hausmann. + + Fix a plugin bug in the WebKit code, similar to the one in WebCore. + + The problem is when a non visible QtPluginWidget would show it self + in a sibling frame. The problem was due to our clipping. In Qt, + if setMask is set with an empty QRegion, no clipping will + be performed, so in that case we hide the PluginContainer + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::): + +2009-05-18 Zoltan Horvath <horvath.zoltan.6@stud.u-szeged.hu> + + Reviewed by Ariya Hidayat. + + Makes QtLauncher to accept multiple urls in command line and opens these in separate windows. + + * QtLauncher/main.cpp: + (MainWindow::newWindow): + (main): + +2009-05-14 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Ariya Hidayat. + + Add a comment to QWebView::iconChanged(), mentioning that you will + need to set the icon database path for icons to be loaded, and thus + receive the signal. + + * Api/qwebview.cpp: + +2009-05-14 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Ariya Hidayat. + + Fix setHtml test case by adding <head> tag to the expected result. This tag is automatically added by WebKit. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-05-14 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Ariya Hidayat. + + Add a test case for the signal urlChanged(). + * tests/qwebframe/tst_qwebframe.cpp: + +2009-05-13 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Ariya Hidayat. + + Move emitting the signal QWebFrame::urlChanged to FrameLoaderClientQt::dispatchDidCommitLoad(). + This is to ensure that urlChanged() is emitted even if the frame has no title. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle): + (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad): + +2009-05-13 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Rubberstamped by Ariya Hidayat. + + Fix coding style: Add {} to contents of if, containing a for loop. + + * Api/qwebelement.cpp: + (QWebElement::styleProperty): + +2009-05-12 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Ariya Hidayat. + + Fixed a possible crash @styleProperty when there is no embedded/external CSS set. + + * Api/qwebelement.cpp: + (QWebElement::styleProperty): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::style): + +2009-05-12 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Ariya Hidayat. + + Added external CSS test cases to QWebElement::styleProperty() method. + + Also some ::styleProperty() tests cleanup. + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::style): + +2009-05-12 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Ariya Hidayat. + + Many methods were not considering the case of the element not having + siblings or children when inserting nodes, and thus broke in some + situations. This patch fixes that. + + * Api/qwebelement.cpp: + (QWebElement::prependInside): + (QWebElement::appendOutside): + (QWebElement::encloseWith): + +2009-05-08 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Ariya Hidayat. + + Make is possible to mark a style property as important while setting + it. Also support the normal CSS property syntax "!important", while + accepting spaces between the ! and the important keyword. + + * Api/qwebelement.cpp: + (QWebElement::setStyleProperty): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::style): + +2009-05-08 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Ariya Hidayat. + + Working with Antonio Gomes. + + Add support for finding the style property actually applied to the element. + + * Api/qwebelement.cpp: + (QWebElement::styleProperty): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::style): + +2009-05-11 Norbert Leser <norbert.leser@nokia.com> + + Reviewed by Darin Adler. + + Bug 24538: class/struct mixup in forward declarations + https://bugs.webkit.org/show_bug.cgi?id=24538 + + * Api/qwebpage.h: + +2009-05-11 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Holger Freyther. + + Fix Qt build when ENABLE_DATABASE is turned off + + https://bugs.webkit.org/show_bug.cgi?id=25587 + + * Api/qwebdatabase.cpp: + (QWebDatabase::displayName): + (QWebDatabase::expectedSize): + (QWebDatabase::size): + (QWebDatabase::fileName): + (QWebDatabase::removeDatabase): + * Api/qwebdatabase_p.h: + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::allOrigins): + (QWebSecurityOrigin::databases): + +2009-05-05 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Simon Hausmann. + + Improve behaviour of the QWebElement enclose* functions, to work + similar to the jQuery wrap functions. We now enclose the contents + of the element in the child of the deepest descendant element + within the structure of the enclose element structure given. + + * Api/qwebelement.cpp: + (findInsertionPoint): + (QWebElement::encloseContentsWith): + (QWebElement::encloseWith): + (QWebElement::replace): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::encloseContentsWith): + (tst_QWebElement::encloseWith): + +2009-05-06 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Simon Hausmann. + + After commit rev @43215, setHtml() without a <head> tag, + automatically adds it, so update our test case to respect this. + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::textHtml): + +2009-05-06 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Qt build fix. + + Dont' use ENABLE() in Qt API headers, as they are not available when building + against the API. + + * Api/qwebdatabase.h: + * Api/qwebsecurityorigin.h: + +2009-05-05 Ben Murdoch <benm@google.com> + + Reviewed by Eric Seidel. + + Add #if ENABLE(DATABASE) guards around database code so toggling ENABLE_DATABASE off does not break builds. + https://bugs.webkit.org/show_bug.cgi?id=24776 + + * Api/qwebdatabase.cpp: + * Api/qwebdatabase.h: + * Api/qwebdatabase_p.h: + * Api/qwebsecurityorigin.cpp: + (QWebSecurityOrigin::databaseUsage): + (QWebSecurityOrigin::databaseQuota): + (QWebSecurityOrigin::setDatabaseQuota): + * Api/qwebsecurityorigin.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::exceededDatabaseQuota): + * WebCoreSupport/ChromeClientQt.h: + +2009-05-05 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Various improvements to the class documentation, including a simple snippet for QWebElement. + + * Api/qwebelement.cpp: + * Api/qwebframe.cpp: + * docs/webkitsnippets/webelement/main.cpp: Added. + * docs/webkitsnippets/webelement/webelement.pro: Added. + +2009-05-05 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Simplify variant conversion by moving the null check into + convertValueToQVariant. + + * Api/qwebframe.cpp: + (QWebFrame::evaluateJavaScript): Moved null check into conversion function. + * tests/qwebframe/tst_qwebframe.cpp: + Added test to verify the correct conversion of null values to QVariant. + +2009-05-01 Geoffrey Garen <ggaren@apple.com> + + Rubber Stamped by Sam Weinig. + + Renamed JSValuePtr => JSValue. + + * Api/qwebelement.cpp: + (setupScriptContext): + (setupScriptObject): + (QWebElement::evaluateScript): + (QWebElement::functions): + (QWebElement::scriptableProperty): + (QWebElement::setScriptableProperty): + (QWebElement::scriptableProperties): + +2009-05-01 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Timothy Hatcher. + + Add a FrameLoaderClient callback for the ResourceRetrievedByXMLHttpRequest. + + https://bugs.webkit.org/show_bug.cgi?id=25347 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-04-30 David Kilzer <ddkilzer@apple.com> + + Provide a mechanism to create a quirks delegate for HTMLParser + + Reviewed by David Hyatt. + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::createHTMLParserQuirks): Added. The + default implementation of this factory method returns 0. + +2009-04-30 Ariya Hidayat <ariya.hidayat@nokia.com> + + Unreviewed build fix after r43072. + + * Api/qwebframe.cpp: + (qt_drt_setJavaScriptProfilingEnabled): Enclose with JAVASCRIPT_DEBUGGER. + +2009-04-30 Ariya Hidayat <ariya.hidayat@nokia.com> + + Unreviewed build fix after r43063. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::addMessageToConsole): + * WebCoreSupport/ChromeClientQt.h: + +2009-04-30 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Simon Hausmann. + + Implement encloseContentsWith and rename wrap to encloseWith. + + Also in encloseWith, make sure that you cannot enclose with + non-enclosable elements. + + * Api/qwebelement.cpp: + (QWebElement::encloseContentsWith): + (QWebElement::encloseWith): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::encloseContentsWith): + (tst_QWebElement::encloseWith): + +2009-04-30 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Darin Adler. + + 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-04-30 Ariya Hidayat <ariya.hidayat@nokia.com> + + Unreviewed build fix, after r43035. + + Temporarily use Position::deprecatedEditingOffset(). + + * Api/qwebpage.cpp: + (QWebPage::inputMethodQuery): + +2009-03-27 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by Simon Hausmann. + + Update the page actions when a finishing loading even if the frame is + not the top frame such as when browsing inside of a website with frames. + https://bugs.webkit.org/show_bug.cgi?id=24890 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad): + * tests/qwebpage/frametest/frame_a.html: Added. + * tests/qwebpage/frametest/index.html: Added. + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::backActionUpdate): + +2009-04-29 Ariya Hidayat <ariya.hidayat@nokia.com> + + Reviewed by Simon Hausmann. + + Implement QWebElement::evaluateScript. + + * Api/qwebelement.cpp: + (setupScriptContext): + (QWebElement::evaluateScript): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::evaluateScript): + +2009-04-29 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Replaced QWebElementCollection with QList<QWebElement>. + + * Api/qwebelement.cpp: + (QWebElement::findAll): + * Api/qwebelement.h: + * Api/qwebframe.cpp: + (QWebFrame::findAllElements): + * Api/qwebframe.h: + * QtLauncher/main.cpp: + (MainWindow::selectElements): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::simpleCollection): + (tst_QWebElement::namespaceURI): + (tst_QWebElement::nullSelect): + +2009-04-28 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + QWebElement API changes after another round of API review: + + * Fix argument names of findAll/findFirst + * Split up toXml into innerXml and outerXml + * Removed confusing toggleClass overload + * Fixed casing of namespaceUri to follow QXmlStreamReader + * Removed tagName from firstChild/nextSibling/etc. + * Renamed append/prepend/insertAfter/insertBefore to [append|prepend][Inside|Outside] + * Renamed wrapWith() back to wrap() + * Made clone() const + * Renamed remove() to takeFromDocument(), added removeFromDocument() + * Renamed clear() to removeChildren() + * Renamed scriptsFunctions/callScriptFunction to functions()/callFunction() + * Renamed scriptProperty to scriptableProperty + + * Api/qwebelement.cpp: + (QWebElement::findAll): + (QWebElement::findFirst): + (QWebElement::setOuterXml): + (QWebElement::toOuterXml): + (QWebElement::setInnerXml): + (QWebElement::toInnerXml): + (QWebElement::namespaceUri): + (QWebElement::firstChild): + (QWebElement::lastChild): + (QWebElement::nextSibling): + (QWebElement::previousSibling): + (QWebElement::callFunction): + (QWebElement::functions): + (QWebElement::scriptableProperty): + (QWebElement::setScriptableProperty): + (QWebElement::scriptableProperties): + (QWebElement::appendInside): + (QWebElement::prependInside): + (QWebElement::prependOutside): + (QWebElement::appendOutside): + (QWebElement::clone): + (QWebElement::takeFromDocument): + (QWebElement::removeFromDocument): + (QWebElement::removeChildren): + (QWebElement::wrap): + (QWebElement::replace): + * Api/qwebelement.h: + * Api/qwebframe.cpp: + (QWebFrame::findAllElements): + (QWebFrame::findFirstElement): + * Api/qwebframe.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::textHtml): + (tst_QWebElement::classes): + (tst_QWebElement::namespaceURI): + (tst_QWebElement::foreachManipulation): + (tst_QWebElement::callFunction): + (tst_QWebElement::callFunctionSubmitForm): + (tst_QWebElement::functionNames): + (tst_QWebElement::properties): + (tst_QWebElement::appendAndPrepend): + (tst_QWebElement::insertBeforeAndAfter): + (tst_QWebElement::remove): + (tst_QWebElement::clear): + (tst_QWebElement::replaceWith): + +2009-04-28 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Fix some qdoc warnings. + + * Api/qwebframe.cpp: Fix links. + * Api/qwebnetworkinterface.cpp: Make docs internal. + * Api/qwebnetworkinterface.h: Ditto. + * Api/qwebpage.cpp: Fix property name in \property. + +2009-04-24 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Ariya Hidayat. + + Fix qdoc warning about link to QAction::isEnabled. + + * Api/qwebpage.cpp: + +2009-04-24 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Ariya Hidayat. + + Added support for generating API docs in the Qt build using "make docs" + + Added code snippets and overview from the Qt sources references in the API docs. + + * Api/qwebpage.cpp: Adjust paths to snippets. + * Api/qwebview.cpp: Ditto. + * docs/docs.pri: Added. + * docs/qtwebkit.qdoc: Added. + * docs/qtwebkit.qdocconf: Added. + * docs/webkitsnippets/qtwebkit_build_snippet.qdoc: Added. + * docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp: Added. + * docs/webkitsnippets/simple/main.cpp: Added. + * docs/webkitsnippets/simple/simple.pro: Added. + * docs/webkitsnippets/webpage/main.cpp: Added. + * docs/webkitsnippets/webpage/webpage.pro: Added. + +2009-04-23 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Ariya Hidayat. + + [Qt] Added QWebElement::computedStyleProperty method. + + * Api/qwebelement.cpp: + (QWebElement::computedStyleProperty): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::computedStyle): + +2009-04-23 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Rubber-stamped by Ariya Hidayat. + + [Qt] Rename QWebElement arguments from html to markup + + * Api/qwebelement.cpp: + (QWebElement::append): + (QWebElement::prepend): + (QWebElement::insertBefore): + (QWebElement::insertAfter): + * Api/qwebelement.h: + +2009-04-21 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Ariya Hidayat. + + QWebElementSelection renamed to QWebElementCollection. + + * Api/qwebelement.cpp: + (QWebElement::findAll): + (QWebElementCollectionPrivate::QWebElementCollectionPrivate): + (QWebElementCollectionPrivate::create): + (QWebElementCollection::QWebElementCollection): + (QWebElementCollection::operator=): + (QWebElementCollection::~QWebElementCollection): + (QWebElementCollection::operator+): + (QWebElementCollection::append): + (QWebElementCollection::count): + (QWebElementCollection::at): + (QWebElementCollection::toList): + * Api/qwebelement.h: + * Api/qwebframe.cpp: + (QWebFrame::findAllElements): + * Api/qwebframe.h: + * QtLauncher/main.cpp: + (MainWindow::selectElements): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::simpleCollection): + (tst_QWebElement::iteration): + (tst_QWebElement::emptyCollection): + (tst_QWebElement::appendCollection): + (tst_QWebElement::nullSelect): + +2009-04-17 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=25242 + + Remove QtCore 4.5 dependency from QWebElement test + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::iteration): Use QList::count() instead of QList::length() + +2009-04-16 Holger Hans Peter Freyther <zecke@selfish.org> + + Rubber-stamped by Simon Hausmann. + + Make the operator== and operator!= non inline to + allow looking at the d-pointer in the future. + + * Api/qwebelement.cpp: + (QWebElement::operator==): + (QWebElement::operator!=): + * Api/qwebelement.h: + +2009-04-15 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Ariya Hidayat. + + Rename extend() method in QWebElementSelection to append(). + + * Api/qwebelement.cpp: + (QWebElementSelection::append): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::appendSelection): + +2009-04-15 Antonio Gomes <antonio.gomes@openbossa.org> + + Reviewed by Simon Hausmann. + + Fixed nit/typo in QWebElement documentation. + + * Api/qwebelement.cpp: + +2009-04-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=24841 + + Fix linking against QtWebKit for Symbian and other platforms + where the OS ABI distinguishes between an import or an export situation. + + * Api/qwebkitglobal.h: Instead of white-listing Win, remove the test. + +2009-04-14 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Tor Arne Vestbø. + + Rename QWebElement::setHtml and html to setXml and toXml respectivily. + + Also add a mean to define the scope (inner or other). + + * Api/qwebelement.cpp: + (QWebElement::setXml): + (QWebElement::toXml): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::textHtml): + (tst_QWebElement::foreachManipulation): + +2009-04-14 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> + + Reviewed by Tor Arne Vestbø. + + Rename QWebElement::setText() and text() to ::setPlainText and + ::toPlainText, respectively. + + * Api/qwebelement.cpp: + (QWebElement::setPlainText): + (QWebElement::toPlainText): + * Api/qwebelement.h: + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::textHtml): + (tst_QWebElement::simpleSelection): + (tst_QWebElement::appendAndPrepend): + (tst_QWebElement::insertBeforeAndAfter): + (tst_QWebElement::replaceWith): + (tst_QWebElement::wrap): + (tst_QWebElement::firstChildNextSiblingWithTag): + (tst_QWebElement::lastChildPreviousSiblingWithTag): + +2009-04-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Rename DOM API select function to findFirst, findAll, etc. + + * Api/qwebelement.cpp: + (QWebElement::findAll): + (QWebElement::findFirst): + * Api/qwebelement.h: + * Api/qwebframe.cpp: + (QWebFrame::findAllElements): + (QWebFrame::findFirstElement): + * Api/qwebframe.h: + * QtLauncher/main.cpp: + (MainWindow::selectElements): + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::simpleSelection): + (tst_QWebElement::attributesNS): + (tst_QWebElement::classes): + (tst_QWebElement::namespaceURI): + (tst_QWebElement::iteration): + (tst_QWebElement::foreachManipulation): + (tst_QWebElement::callFunctionSubmitForm): + (tst_QWebElement::documentElement): + (tst_QWebElement::frame): + (tst_QWebElement::style): + (tst_QWebElement::extendSelection): + (tst_QWebElement::properties): + (tst_QWebElement::appendAndPrepend): + (tst_QWebElement::insertBeforeAndAfter): + (tst_QWebElement::remove): + (tst_QWebElement::clear): + (tst_QWebElement::replaceWith): + (tst_QWebElement::wrap): + (tst_QWebElement::nullSelect): + (tst_QWebElement::firstChildNextSibling): + (tst_QWebElement::firstChildNextSiblingWithTag): + (tst_QWebElement::lastChildPreviousSibling): + (tst_QWebElement::lastChildPreviousSiblingWithTag): + +2009-04-06 Simon Hausmann <simon.hausmann@nokia.com> + Ariya Hidayat <ariya.hidayat@nokia.com> + Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + Genevieve Mak <gen@staikos.net> + + Reviewed by Tor Arne Vestbø, Simon Hausmann + + First revision of new API in the Qt port to access the DOM. + + * Api/headers.pri: Added qwebelement.h to the API headers. + * Api/qwebelement.cpp: Added. + * Api/qwebelement.h: Added. + * Api/qwebframe.cpp: + (QWebFrame::documentElement): Added accessor for the document element. + (QWebFrame::selectElements): Added convenienc query method. + (QWebFrame::selectElement): Ditto. + (QWebHitTestResult::element): Added accessor for underlying DOM element. + * Api/qwebframe.h: + * QtLauncher/main.cpp: Simple test gui for element selections. + * tests/qwebelement/qwebelement.pro: Added. + * tests/qwebelement/tst_qwebelement.cpp: Added. + * tests/tests.pro: Added QWebElement & QWebElementSelection unit tests. + +2009-04-02 Simon Hausmann <simon.hausmann@nokia.com> + + Fix the Qt build. + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): Adapted code to renamed loadFrameRequest function. + +2009-04-02 Takumi Asaki <takumi.asaki@nokia.com> + + Reviewed by Simon Hausmann. + + Fix pre-edit handling of text fields with input methods. + + The input method sends an empty preeditString() if all characters of + the preedit should be deleted. So inputMethodEvent() has to use + preeditString() if it's empty. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + +2009-03-30 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + Document that setHtml/setContent loads only the html/data immediately, not external objects. + + * Api/qwebframe.cpp: + * Api/qwebview.cpp: + +2009-03-29 Darin Adler <darin@apple.com> + + Try to fix Qt build. + + * WebCoreSupport/EditorClientQt.cpp: Added include of HTMLElement.h. + + * WebCoreSupport/FrameLoaderClientQt.cpp: Added include of FormState.h. + (WebCore::FrameLoaderClientQt::prepareForDataSourceReplacement): + Removed unneeded call to detachChildren, which is called by FrameLoader + right after this. + (WebCore::FrameLoaderClientQt::createFrame): Use loadURLIntoChildFrame + as other platforms do in the corresponding functions. + +2009-03-27 Erik L. Bunce <elbunce@xendom.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=24869 + + Fixes an incorrect case in tst_qwebpage. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::cursorMovements): + +2009-03-27 Erik L. Bunce <elbunce@xendom.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=24746 + + Add new editing related QWebPage::WebActions + * Clipboard: PasteAndMatchStyle + * Formatting: RemoveFormat, ToggleStrikethrough, ToggleSubscript, and + ToggleSuperscript + * List Editing: InsertUnorderedList, InsertOrderedList, Indent, Outdent + * Paragraph Justification: AlignCenter, AlignJustified, AlignLeft, AlignRight + + Improved selection and editing tests. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateEditorActions): + (QWebPage::action): + * Api/qwebpage.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textSelection): + (tst_QWebPage::textEditing): + +2009-03-26 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + Fix the documentation of the QLocale usage in userAgentForUrl. + + * Api/qwebpage.cpp: + +2009-03-20 Erik L. Bunce <elbunce@xendom.com> + + Reviewed by Simon Hausmann. + + Fix for InsertParagraphSeparator and InsertLineSeparator so that + QWebPage::action() creates QActions for them. Also make sure they get + updated appropriately. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateEditorActions): + (QWebPage::action): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textEditing): + +2009-03-20 Erik L. Bunce <elbunce@xendom.com> + + Reviewed by Tor Arne Vestbø. + + Fix QWebPage::WebActions action states to more closely match when they are + actually applicable and remove erroneous documentation. + + * Most WebActions implemented using editor commands now use the + Editor::Command::isEnabled() to control their availability. + * SelectAll is always enabled (since it's editor command is). + * SetTextDirection{} family of WebActions are available when canEdit() is true + and not just canEditRichly(). + + Fix and clarify documentation about the availability of various web actions. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateAction): + (QWebPagePrivate::updateEditorActions): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textSelection): + +2009-03-19 Ariya Hidayat <ariya.hidayat@trolltech.com> + + Reviewed by Simon Hausmann. + + Fixes pedantic compilation in QtWebKit. + + There are no semi-colons after namespace declarations. + + * Api/qwebdatabase.h: + * Api/qwebsecurityorigin.h: + +2009-03-19 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + Doc: Removed obsolete warning about Flash and other plugins. + + * Api/qwebsettings.cpp: + +2009-03-19 Paul Olav Tvete <paul.tvete@nokia.com> + + Reviewed by Simon Hausmann. + + Properly escape tooltip text + + ManualTest: http://xkcd.com/554/ + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::setToolTip): + +2009-03-10 Adam Treat <adam.treat@torchmobile.com> + + Build fix for Qt after r41555. + + * Api/qwebpage.cpp: + (QWebPage::acceptNavigationRequest): + +2009-03-10 Xan Lopez <xlopez@igalia.com> + + Build fix, no review. + + * Api/qwebpage.cpp: + (QWebPage::inputMethodQuery): + +2009-03-07 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Cameron Zwarich. + + These methods are clearly returning the wrong values as the two were + returning swapped information. + + * Api/qwebpage.cpp: + (QWebPage::totalBytes): + (QWebPage::bytesReceived): + +2009-03-05 Ariya Hidayat <ariya.hidayat@nokia.com> + + Rubber-stamped by Simon Hausmann. + + [Qt] NPAPI plugins are supported, adjust the API documentation. + + * Api/qwebsettings.cpp: + +2009-03-04 Adam Barth <abath@webkit.org> + + Reviewed by Alexey Proskuryakov. + + https://bugs.webkit.org/show_bug.cgi?id=24356 + + Fix WebKit style for allowUniversalAccessFromFileURLs. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2009-03-03 Adam Barth <abarth@webkit.org> + + Reviewed by Alexey Proskuryakov. + + https://bugs.webkit.org/show_bug.cgi?id=24340 + + Expose AllowUniversalAccessFromFileUrls to Qt clients. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + (QWebSettings::QWebSettings): + * Api/qwebsettings.h: + +2009-03-03 Ariya Hidayat <ariya.hidayat@trolltech.com> + + Rubber-stamped by Simon Hausmann. + + [Qt] Create and update the action for SelectAll. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateAction): + (QWebPagePrivate::updateEditorActions): + (QWebPage::action): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textSelection): + +2009-03-02 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Eric Seidel. + + Add three new drt helper functions that enable all of the tests in + LayoutTests/animation/* and LayoutTests/transitions/* to now pass. + + * Api/qwebframe.cpp: + (qt_drt_pauseAnimation): + (qt_drt_pauseTransitionOfProperty): + (qt_drt_numberOfActiveAnimations): + +2009-03-02 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by George Staikos. + + https://bugs.webkit.org/show_bug.cgi?id=21230 + On X11 match the behavior of Firefox and also copy the url to the + clipboard selection when the action Copy Link Location is executed. + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): + +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 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=24094 + Make sure to empty the cache on exit to get rid of superfluous leak messages + for CachedResource's in order to keep the leak messages accurate. This + is analagous to what the Mac port is doing on application exit when all + WebView's have been closed. + + * Api/qwebpage.cpp: + (QWebPagePrivate::_q_cleanupLeakMessages): + (QWebPage::QWebPage): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + +2009-02-23 Thiago Macieira <thiago.macieira@nokia.com> + + Reviewed by Simon Hausmann. + + Fix the Copyright notices in a few files + + * WebKit_pch.h: + +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 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by Nikolas Zimmermann. + + https://bugs.webkit.org/show_bug.cgi?id=23738 + Expose the url elements target frame string. This is the sister function + to the existing linkTargetFrame which returns the QWebFrame*. When the + linkTargetFrame is 0 it is useful to know what the target was to be. + + * Api/qwebframe.cpp: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): + (QWebHitTestResult::linkTarget): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + * tests/qwebframe/tst_qwebframe.cpp: + +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-11 Dimitri Dupuis-latour <dupuislatour@apple.com> + + Stub out InspectorClientQt::hiddenPanels. + + Reviewed by Timothy Hatcher. + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::hiddenPanels): + * WebCoreSupport/InspectorClientQt.h: + +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-10 Adam Treat <adam.treat@torchmobile.com> + + Fix the Qt build as class Selection is now VisibleSelection. + + * Api/qwebpage.cpp: + (QWebPage::inputMethodQuery): + +2009-02-06 Geoffrey Garen <ggaren@apple.com> + + Build fix. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::updateGlobalHistoryRedirectLinks): + * WebCoreSupport/FrameLoaderClientQt.h: + +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-06 Aaron Boodman <aa@chromium.org> + + Reviewed by Holger Freyther. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::documentElementAvailable):) + Fix compile error in Qt build introduced by the below change (r40694). + +2009-02-05 Aaron Boodman <aa@chromium.org> + + Reviewed by Dave Hyatt. + + https://bugs.webkit.org/show_bug.cgi?id=23708 + Adds documentElementAvailable() callback to FrameLoaderClient. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClient::documentElementAvailable): + Stub out documentElementAvailable(). + * WebCoreSupport/FrameLoaderClientQt.h: + Ditto. + +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-02-02 Geoffrey Garen <ggaren@apple.com> + + Build fix. + + * Api/qwebframe.cpp: + (QWebFrame::QWebFrame): + (QWebFrame::load): + (QWebFrame::setHtml): + (QWebFrame::setContent): + +2009-02-02 Geoffrey Garen <ggaren@apple.com> + + Build fix. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createFrame): + +2009-02-02 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Sam Weinig. + + Track redirects in global history. + + Keep Qt building. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::updateGlobalHistoryForRedirectWithoutHistoryItem): + (WebCore::FrameLoaderClientQt::createFrame): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-02-02 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Update for changes to WebCore. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + (WebCore::FrameLoaderClientQt::createJavaAppletWidget): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-02-02 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Nikolas Zimmermann. + + https://bugs.webkit.org/show_bug.cgi?id=23587 + Refactor HitTestRequest to eliminate all the ugly boolean arguments and + use an enum bitflag instead. Cleanup all the code that constructs the + various HitTestRequests to make the code more readable. + + * Api/qwebframe.cpp: + (QWebFrame::hitTestContent): + +2009-02-02 Adam Treat <adam.treat@torchmobile.com> + + Fix the Qt build to call forceLayout on the view instead. + + * Api/qwebpage.cpp: + (QWebPage::setFixedLayoutSize): + (QWebPage::setUseFixedLayout): + +2009-02-02 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Darin Adler. + + Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView + + https://bugs.webkit.org/show_bug.cgi?id=23428 + + FrameView::forceLayout could be killed but the comment might + contain a value over the the plain FrameView::layout... + + Adjust the WebCore/WebKit consumers of these methods. + + * Api/qwebpage.cpp: + (QWebPage::setViewportSize): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::forceLayout): + +2009-01-30 Geoffrey Garen <ggaren@apple.com> + + Build fix. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createFrame): + +2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=22056 + + Kill FrameLoaderClient.cpp, move the code over to Frame::createView + + FrameLoaderClient is supposed to be an interface, move the + to be shared code to Frame which is a controller and is + allowed to create a FrameView. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): + +2009-01-30 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Sam Weinig. + + Split "lockHistory" into "lockHistory" and "lockBackForwardList" in + preparation for setting them differently during a redirect. + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): + +2009-01-30 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig + + Remove FrameLoaderClient code that is now handled by FrameLoader itself + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::frameLoadCompleted): + +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 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Nikolas Zimmermann and George Staikos. + + https://bugs.webkit.org/show_bug.cgi?id=23557 + Do not clip the QWebFrame::hitTestContent method to the visible viewport + and add a regression test to make sure it works. + + * Api/qwebframe.cpp: + (QWebFrame::hitTestContent): + * tests/qwebframe/tst_qwebframe.cpp: + +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://qt.nokia.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-27 Brady Eidson <beidson@apple.com> + + Reviewed by Dan Bernstein + + Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::savePlatformDataToCachedFrame): + (WebCore::FrameLoaderClientQt::transitionToCommittedFromCachedFrame): + * WebCoreSupport/FrameLoaderClientQt.h: + +2009-01-26 Simon Fraser <simon.fraser@apple.com> + + Reviewed by David Hyatt + + Back out r40285, because it was checked in with no bug number, no + testcase, is rendering change that did not get thorough review, + and broke the Mac build. + + * Api/qwebframe.cpp: + (QWebFrame::hitTestContent): + +2009-01-26 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Nikolas Zimmermann. + + Do not clip the QWebFrame::hitTestContent method to the visible viewport. + + * Api/qwebframe.cpp: + (QWebFrame::hitTestContent): + +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-24 Adam Treat <adam.treat@torchmobile.com> + + Oops, fix the Qt build. + + * Api/qwebframe.cpp: + (QWebFrame::render): + +2009-01-24 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Nikolas Zimmermann. + + Add QWebFrame::renderContents() method which allows arbitary rendering + of any content region within the QWebFrame. It also does not draw any + scrollbars. + + * Api/qwebframe.cpp: + (QWebFrame::renderContents): + * Api/qwebframe.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://qt.nokia.com/developer/task-tracker/index_html?id=219344&method=entry + + [Qt] API documentation for QWebPage::WebAction enum. + + * Api/qwebpage.cpp: + +2009-01-16 Ariya Hidayat <ariya.hidayat@trolltech.com> + + Another attempt at fixing the Qt build. + + * Api/qwebframe.cpp: + (QWebFrame::addToJavaScriptWindowObject): + +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://qt.nokia.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-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 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-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. + + Add Qt API to QWebHitTestResult::isScrollBar method + + * Api/qwebframe.cpp: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): + (QWebHitTestResult::isScrollBar): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): + +2009-01-07 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by George Staikos. + + Add Qt API for QWebFrame::scrollBarGeometry method + + * Api/qwebframe.cpp: + (QWebFrame::scrollBarGeometry): + * Api/qwebframe.h: + +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-06 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Simon Hausmann. + + Update the documentation to reflect when these API changes will land in + upstream Qt + + * Api/qwebframe.cpp: + * Api/qwebpage.cpp: + +2009-01-05 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by George Staikos. + + Add Qt API for QWebFrame::contentsSizeChanged signal + + * Api/qwebframe.cpp: + * Api/qwebframe.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::contentsSizeChanged): + * WebCoreSupport/ChromeClientQt.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): + +2009-01-04 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by George Staikos. + + Add new API to QWebHitTestResult to return a rect for the smallest enclosing + block element of the hit test + + * Api/qwebframe.cpp: + (QWebHitTestResultPrivate::QWebHitTestResultPrivate): + (QWebHitTestResult::enclosingBlock): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + +2008-12-30 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by George Staikos. + + Make the qt port build and work with the new fixedLayoutSize feature + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPage::fixedLayoutSize): + (QWebPage::setFixedLayoutSize): + (QWebPage::useFixedLayout): + (QWebPage::setUseFixedLayout): + * Api/qwebpage.h: + * Api/qwebpage_p.h: + * 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/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp new file mode 100644 index 0000000..acb136a --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -0,0 +1,759 @@ +/* + * Copyright (C) 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2010 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 "ChromeClientQt.h" + +#include "ApplicationCacheStorage.h" +#include "DatabaseTracker.h" +#include "FileChooser.h" +#include "Frame.h" +#include "FrameLoadRequest.h" +#include "FrameLoader.h" +#include "FrameLoaderClientQt.h" +#include "FrameView.h" +#include "Geolocation.h" +#if USE(ACCELERATED_COMPOSITING) +#include "GraphicsLayer.h" +#endif +#include "GeolocationPermissionClientQt.h" +#include "HitTestResult.h" +#include "Icon.h" +#include "NavigationAction.h" +#include "NetworkingContext.h" +#include "NotImplemented.h" +#include "NotificationPresenterClientQt.h" +#include "PageClientQt.h" +#include "PopupMenuQt.h" +#if defined(Q_WS_MAEMO_5) +#include "QtMaemoWebPopup.h" +#else +#include "QtFallbackWebPopup.h" +#endif +#include "QWebPageClient.h" +#include "ScrollbarTheme.h" +#include "SearchPopupMenuQt.h" +#include "SecurityOrigin.h" +#include "ViewportArguments.h" +#include "WindowFeatures.h" + +#include "qgraphicswebview.h" +#include "qwebframe_p.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include "qwebsecurityorigin.h" +#include "qwebsecurityorigin_p.h" +#include "qwebview.h" +#include <qdebug.h> +#include <qeventloop.h> +#include <qtextdocument.h> +#include <qtooltip.h> +#include <wtf/OwnPtr.h> + +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#include "FullScreenVideoQt.h" +#include "HTMLMediaElement.h" +#include "HTMLNames.h" +#include "HTMLVideoElement.h" +#include "MediaPlayerPrivateQt.h" +#endif + +namespace WebCore { + +bool ChromeClientQt::dumpVisitedLinksCallbacks = false; + +ChromeClientQt::ChromeClientQt(QWebPage* webPage) + : m_webPage(webPage) + , m_eventLoop(0) +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) + , m_fullScreenVideo(0) +#endif +{ + toolBarsVisible = statusBarVisible = menuBarVisible = true; +} + +ChromeClientQt::~ChromeClientQt() +{ + if (m_eventLoop) + m_eventLoop->exit(); + +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) + delete m_fullScreenVideo; +#endif +} + +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()))); +} + +/*! + windowRect represents the rect of the Window, including all interface elements + like toolbars/scrollbars etc. It is used by the viewport meta tag as well as + by the DOM Window object: outerHeight(), outerWidth(), screenX(), screenY(). +*/ +FloatRect ChromeClientQt::windowRect() +{ + if (!platformPageClient()) + return FloatRect(); + return platformPageClient()->windowRect(); +} + +FloatRect ChromeClientQt::pageRect() +{ + if (!m_webPage) + return FloatRect(); + return FloatRect(QRectF(QPointF(0, 0), m_webPage->viewportSize())); +} + +float ChromeClientQt::scaleFactor() +{ + if (!m_webPage) + return 1; + return m_webPage->d->pixelRatio; +} + +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. +} + + +void ChromeClientQt::focusedNodeChanged(Node*) +{ +} + +void ChromeClientQt::focusedFrameChanged(Frame*) +{ +} + +Page* ChromeClientQt::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&) +{ + QWebPage* newPage = m_webPage->createWindow(features.dialog ? QWebPage::WebModalDialog : QWebPage::WebBrowserWindow); + if (!newPage) + return 0; + + // A call to QWebPage::mainFrame() implicitly creates the main frame. + // Make sure it exists, as WebCore expects it when returning from this call. + newPage->mainFrame(); + return newPage->d->page; +} + +void ChromeClientQt::show() +{ + if (!m_webPage) + return; + QWidget* view = m_webPage->view(); + if (!view) + return; + view->window()->show(); +} + + +bool ChromeClientQt::canRunModal() +{ + return true; +} + + +void ChromeClientQt::runModal() +{ + m_eventLoop = new QEventLoop(); + QEventLoop* eventLoop = m_eventLoop; + m_eventLoop->exec(); + delete eventLoop; +} + + +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; +} + + +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(MessageSource, MessageType, MessageLevel, 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; + QWebFrame* webFrame = qobject_cast<QWebFrame*>(f->loader()->networkingContext()->originatingObject()); + m_webPage->javaScriptAlert(webFrame, x); +} + +bool ChromeClientQt::runJavaScriptConfirm(Frame* f, const String& msg) +{ + QString x = msg; + QWebFrame* webFrame = qobject_cast<QWebFrame*>(f->loader()->networkingContext()->originatingObject()); + return m_webPage->javaScriptConfirm(webFrame, x); +} + +bool ChromeClientQt::runJavaScriptPrompt(Frame* f, const String& message, const String& defaultValue, String& result) +{ + QString x = result; + QWebFrame* webFrame = qobject_cast<QWebFrame*>(f->loader()->networkingContext()->originatingObject()); + bool rc = m_webPage->javaScriptPrompt(webFrame, (QString)message, (QString)defaultValue, &x); + + // Fix up a quirk in the QInputDialog class. If no input happened the string should be empty + // but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914. + if (rc && x.isNull()) + result = String(""); + else + result = x; + + return rc; +} + +void ChromeClientQt::setStatusbarText(const String& msg) +{ + QString x = msg; + emit m_webPage->statusBarMessage(x); +} + +bool ChromeClientQt::shouldInterruptJavaScript() +{ + bool shouldInterrupt = false; + QMetaObject::invokeMethod(m_webPage, "shouldInterruptJavaScript", Qt::DirectConnection, Q_RETURN_ARG(bool, shouldInterrupt)); + return shouldInterrupt; +} + +bool ChromeClientQt::tabsToLinks() const +{ + return m_webPage->settings()->testAttribute(QWebSettings::LinksIncludedInFocusChain); +} + +IntRect ChromeClientQt::windowResizerRect() const +{ +#if defined(Q_WS_MAC) + if (!m_webPage) + return IntRect(); + + QWebPageClient* pageClient = platformPageClient(); + if (!pageClient) + return IntRect(); + + QWidget* ownerWidget = pageClient->ownerWidget(); + if (!ownerWidget) + return IntRect(); + + QWidget* topLevelWidget = ownerWidget->window(); + QRect topLevelGeometry(topLevelWidget->geometry()); + + // There's no API in Qt to query for the size of the resizer, so we assume + // it has the same width and height as the scrollbar thickness. + int scollbarThickness = ScrollbarTheme::nativeTheme()->scrollbarThickness(); + + // There's no API in Qt to query for the position of the resizer. Sometimes + // it's drawn by the system, and sometimes it's a QSizeGrip. For RTL locales + // it might even be on the lower left side of the window, but in WebKit we + // always draw scrollbars on the right hand side, so we assume this to be the + // location when computing the resize rect to reserve for WebKit. + QPoint resizeCornerTopLeft = ownerWidget->mapFrom(topLevelWidget, + QPoint(topLevelGeometry.width(), topLevelGeometry.height()) + - QPoint(scollbarThickness, scollbarThickness)); + + QRect resizeCornerRect = QRect(resizeCornerTopLeft, QSize(scollbarThickness, scollbarThickness)); + return resizeCornerRect.intersected(pageClient->geometryRelativeToOwnerWidget()); +#else + return IntRect(); +#endif +} + +void ChromeClientQt::invalidateWindow(const IntRect&, bool) +{ + notImplemented(); +} + +void ChromeClientQt::invalidateContentsAndWindow(const IntRect& windowRect, bool immediate) +{ + // No double buffer, so only update the QWidget if content changed. + if (platformPageClient()) { + QRect rect(windowRect); + rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize())); + if (!rect.isEmpty()) + platformPageClient()->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::invalidateContentsForSlowScroll(const IntRect& windowRect, bool immediate) +{ + invalidateContentsAndWindow(windowRect, immediate); +} + +void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&) +{ + if (platformPageClient()) + platformPageClient()->scroll(delta.width(), delta.height(), scrollViewRect); + emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect); +} + +#if ENABLE(TILED_BACKING_STORE) +void ChromeClientQt::delegatedScrollRequested(const IntSize& delta) +{ + emit m_webPage->scrollRequested(delta.width(), delta.height(), QRect(QPoint(0, 0), m_webPage->viewportSize())); +} +#endif + +IntRect ChromeClientQt::windowToScreen(const IntRect& rect) const +{ + QWebPageClient* pageClient = platformPageClient(); + if (!pageClient) + return rect; + + QWidget* ownerWidget = pageClient->ownerWidget(); + if (!ownerWidget) + return rect; + + QRect screenRect(rect); + screenRect.translate(ownerWidget->mapToGlobal(QPoint(0, 0))); + + return screenRect; +} + +IntPoint ChromeClientQt::screenToWindow(const IntPoint& point) const +{ + QWebPageClient* pageClient = platformPageClient(); + if (!pageClient) + return point; + + QWidget* ownerWidget = pageClient->ownerWidget(); + if (!ownerWidget) + return point; + + return ownerWidget->mapFromGlobal(point); +} + +PlatformPageClient ChromeClientQt::platformPageClient() const +{ + return m_webPage->d->client.get(); +} + +void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) const +{ + if (frame->loader()->networkingContext()) + QWebFramePrivate::kit(frame)->contentsSizeChanged(size); +} + +void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned) +{ + TextDirection dir; + if (result.absoluteLinkURL() != lastHoverURL + || result.title(dir) != lastHoverTitle + || result.textContent() != lastHoverContent) { + lastHoverURL = result.absoluteLinkURL(); + lastHoverTitle = result.title(dir); + lastHoverContent = result.textContent(); + emit m_webPage->linkHovered(lastHoverURL.prettyURL(), + lastHoverTitle, lastHoverContent); + } +} + +void ChromeClientQt::setToolTip(const String &tip, TextDirection) +{ +#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)); +} + +#if ENABLE(DATABASE) +void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseName) +{ + quint64 quota = QWebSettings::offlineStorageDefaultQuota(); + + if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin())) + DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota); + + emit m_webPage->databaseQuotaExceeded(QWebFramePrivate::kit(frame), databaseName); +} +#endif + +#if ENABLE(OFFLINE_WEB_APPLICATIONS) +void ChromeClientQt::reachedMaxAppCacheSize(int64_t) +{ + // FIXME: Free some space. + notImplemented(); +} + +void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin* origin) +{ + int64_t quota; + quint64 defaultOriginQuota = WebCore::cacheStorage().defaultOriginQuota(); + + QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(origin); + QWebSecurityOrigin* securityOrigin = new QWebSecurityOrigin(priv); + + if (!WebCore::cacheStorage().quotaForOrigin(origin, quota)) + WebCore::cacheStorage().storeUpdatedQuotaForOrigin(origin, defaultOriginQuota); + + emit m_webPage->applicationCacheQuotaExceeded(securityOrigin, defaultOriginQuota); +} +#endif + +#if ENABLE(NOTIFICATIONS) +NotificationPresenter* ChromeClientQt::notificationPresenter() const +{ + return NotificationPresenterClientQt::notificationPresenter(); +} +#endif + +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 (unsigned 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); + } +} + +void ChromeClientQt::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser) +{ + chooser->iconLoaded(Icon::createIconForFiles(filenames)); +} + +void ChromeClientQt::setCursor(const Cursor& cursor) +{ +#ifndef QT_NO_CURSOR + QWebPageClient* pageClient = platformPageClient(); + if (!pageClient) + return; + pageClient->setCursor(*cursor.platformCursor()); +#else + UNUSED_PARAM(cursor); +#endif +} + +void ChromeClientQt::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation) +{ +#if ENABLE(GEOLOCATION) + QWebFrame* webFrame = QWebFramePrivate::kit(frame); + GeolocationPermissionClientQt::geolocationPermissionClient()->requestGeolocationPermissionForFrame(webFrame, geolocation); +#endif +} + +void ChromeClientQt::cancelGeolocationPermissionRequestForFrame(Frame* frame, Geolocation* geolocation) +{ +#if ENABLE(GEOLOCATION) + QWebFrame* webFrame = QWebFramePrivate::kit(frame); + GeolocationPermissionClientQt::geolocationPermissionClient()->cancelGeolocationPermissionRequestForFrame(webFrame, geolocation); +#endif +} + +#if USE(ACCELERATED_COMPOSITING) +void ChromeClientQt::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer) +{ + if (platformPageClient()) + platformPageClient()->setRootGraphicsLayer(graphicsLayer ? graphicsLayer->platformLayer() : 0); +} + +void ChromeClientQt::setNeedsOneShotDrawingSynchronization() +{ + // we want the layers to synchronize next time we update the screen anyway + if (platformPageClient()) + platformPageClient()->markForSync(false); +} + +void ChromeClientQt::scheduleCompositingLayerSync() +{ + // we want the layers to synchronize ASAP + if (platformPageClient()) + platformPageClient()->markForSync(true); +} + +ChromeClient::CompositingTriggerFlags ChromeClientQt::allowedCompositingTriggers() const +{ + if (platformPageClient() && platformPageClient()->allowsAcceleratedCompositing()) + return AllTriggers; + + return 0; +} + +#endif + +#if ENABLE(TILED_BACKING_STORE) +IntRect ChromeClientQt::visibleRectForTiledBackingStore() const +{ + if (!platformPageClient() || !m_webPage) + return IntRect(); + + if (!platformPageClient()->viewResizesToContentsEnabled()) + return QRect(m_webPage->mainFrame()->scrollPosition(), m_webPage->mainFrame()->geometry().size()); + + return enclosingIntRect(FloatRect(platformPageClient()->graphicsItemVisibleRect())); +} +#endif + +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +FullScreenVideoQt* ChromeClientQt::fullScreenVideo() +{ + if (!m_fullScreenVideo) + m_fullScreenVideo = new FullScreenVideoQt(this); + return m_fullScreenVideo; +} + +bool ChromeClientQt::supportsFullscreenForNode(const Node* node) +{ + ASSERT(node); + return node->hasTagName(HTMLNames::videoTag) && fullScreenVideo()->isValid(); +} + +bool ChromeClientQt::requiresFullscreenForVideoPlayback() +{ + return fullScreenVideo()->requiresFullScreenForVideoPlayback(); +} + +void ChromeClientQt::enterFullscreenForNode(Node* node) +{ + ASSERT(node && node->hasTagName(HTMLNames::videoTag)); + + HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node); + PlatformMedia platformMedia = videoElement->platformMedia(); + + ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType); + if (platformMedia.type != PlatformMedia::QtMediaPlayerType) + return; + + fullScreenVideo()->enterFullScreenForNode(node); +} + +void ChromeClientQt::exitFullscreenForNode(Node* node) +{ + ASSERT(node && node->hasTagName(HTMLNames::videoTag)); + + HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node); + PlatformMedia platformMedia = videoElement->platformMedia(); + + ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType); + if (platformMedia.type != PlatformMedia::QtMediaPlayerType) + return; + + fullScreenVideo()->exitFullScreenForNode(node); +} +#endif + +QWebSelectMethod* ChromeClientQt::createSelectPopup() const +{ + QWebSelectMethod* result = m_platformPlugin.createSelectInputMethod(); + if (result) + return result; + +#if defined(Q_WS_MAEMO_5) + return new QtMaemoWebPopup; +#elif !defined(QT_NO_COMBOBOX) + return new QtFallbackWebPopup(this); +#else + return 0; +#endif +} + +void ChromeClientQt::dispatchViewportDataDidChange(const ViewportArguments&) const +{ + emit m_webPage->viewportChangeRequested(); +} + +bool ChromeClientQt::selectItemWritingDirectionIsNatural() +{ + return false; +} + +PassRefPtr<PopupMenu> ChromeClientQt::createPopupMenu(PopupMenuClient* client) const +{ + return adoptRef(new PopupMenuQt(client, this)); +} + +PassRefPtr<SearchPopupMenu> ChromeClientQt::createSearchPopupMenu(PopupMenuClient* client) const +{ + return adoptRef(new SearchPopupMenuQt(createPopupMenu(client))); +} + +void ChromeClientQt::populateVisitedLinks() +{ + // We don't need to do anything here because history is tied to QWebPage rather than stored + // in a separate database + if (dumpVisitedLinksCallbacks) { + printf("Asked to populate visited links for WebView \"%s\"\n", + qPrintable(m_webPage->mainFrame()->url().toString())); + } +} + +} // namespace WebCore diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h new file mode 100644 index 0000000..d8c2f57 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -0,0 +1,220 @@ +/* + * Copyright (C) 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2010 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. + */ + +#ifndef ChromeClientQt_H +#define ChromeClientQt_H + +#include "ChromeClient.h" +#include "FloatRect.h" +#include "RefCounted.h" +#include "KURL.h" +#include "PlatformString.h" +#include "QtPlatformPlugin.h" + +QT_BEGIN_NAMESPACE +class QEventLoop; +QT_END_NAMESPACE + +class QWebPage; + +namespace WebCore { + + class FileChooser; + class FloatRect; + class Page; + struct FrameLoadRequest; + class QtAbstractWebPopup; + struct ViewportArguments; +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) + class FullScreenVideoQt; +#endif + + 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 void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); + + virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&); + 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(MessageSource, MessageType, MessageLevel, 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 invalidateWindow(const IntRect&, bool); + virtual void invalidateContentsAndWindow(const IntRect&, bool); + virtual void invalidateContentsForSlowScroll(const IntRect&, bool); + virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); +#if ENABLE(TILED_BACKING_STORE) + virtual void delegatedScrollRequested(const IntSize& scrollDelta); +#endif + + virtual IntPoint screenToWindow(const IntPoint&) const; + virtual IntRect windowToScreen(const IntRect&) const; + virtual PlatformPageClient platformPageClient() const; + virtual void contentsSizeChanged(Frame*, const IntSize&) const; + + virtual void scrollbarsModeDidChange() const { } + virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); + + virtual void setToolTip(const String&, TextDirection); + + virtual void print(Frame*); +#if ENABLE(DATABASE) + virtual void exceededDatabaseQuota(Frame*, const String&); +#endif +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); + virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); +#endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif + +#if ENABLE(NOTIFICATIONS) + virtual NotificationPresenter* notificationPresenter() const; +#endif + +#if USE(ACCELERATED_COMPOSITING) + // see ChromeClient.h + // this is a hook for WebCore to tell us what we need to do with the GraphicsLayers + virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*); + virtual void setNeedsOneShotDrawingSynchronization(); + virtual void scheduleCompositingLayerSync(); + virtual CompositingTriggerFlags allowedCompositingTriggers() const; +#endif + +#if ENABLE(TILED_BACKING_STORE) + virtual IntRect visibleRectForTiledBackingStore() const; +#endif + +#if ENABLE(TOUCH_EVENTS) + virtual void needTouchEvents(bool) { } +#endif + +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) + virtual bool supportsFullscreenForNode(const Node*); + virtual void enterFullscreenForNode(Node*); + virtual void exitFullscreenForNode(Node*); + virtual bool requiresFullscreenForVideoPlayback(); + FullScreenVideoQt* fullScreenVideo(); +#endif + + virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); + virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); + + virtual void formStateDidChange(const Node*) { } + + virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; } + + virtual void setCursor(const Cursor&); + + virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {} + + virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*); + virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*); + + virtual bool selectItemWritingDirectionIsNatural(); + virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const; + virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; + virtual void populateVisitedLinks(); + + QWebSelectMethod* createSelectPopup() const; + + virtual void dispatchViewportDataDidChange(const ViewportArguments&) const; + + QWebPage* m_webPage; + WebCore::KURL lastHoverURL; + WTF::String lastHoverTitle; + WTF::String lastHoverContent; + + bool toolBarsVisible; + bool statusBarVisible; + bool menuBarVisible; + QEventLoop* m_eventLoop; + +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) + FullScreenVideoQt* m_fullScreenVideo; +#endif + + static bool dumpVisitedLinksCallbacks; + + mutable QtPlatformPlugin m_platformPlugin; + }; +} + +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp new file mode 100644 index 0000000..b4400ff --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp @@ -0,0 +1,87 @@ +/* + * 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&) +{ + notImplemented(); +} + +void ContextMenuClientQt::lookUpInDictionary(Frame*) +{ + notImplemented(); +} + +void ContextMenuClientQt::speak(const String&) +{ + notImplemented(); +} + +bool ContextMenuClientQt::isSpeaking() +{ + notImplemented(); + return false; +} + +void ContextMenuClientQt::stopSpeaking() +{ + notImplemented(); +} + +void ContextMenuClientQt::searchWithGoogle(const Frame*) +{ + notImplemented(); +} + +} + diff --git a/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h b/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h new file mode 100644 index 0000000..1b4475f --- /dev/null +++ b/Source/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 bool isSpeaking(); + virtual void stopSpeaking(); + virtual void searchWithGoogle(const Frame*); +}; +} + +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp new file mode 100644 index 0000000..4761514 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2010 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 "DeviceMotionClientQt.h" + +#include "DeviceMotionController.h" +#include "DeviceMotionProviderQt.h" + +#include "qwebpage.h" + +namespace WebCore { + +DeviceMotionClientQt::DeviceMotionClientQt(QWebPage* page) + : m_page(page) + , m_controller(0) + , m_provider(new DeviceMotionProviderQt()) +{ + + connect(m_provider, SIGNAL(deviceMotionChanged()), SLOT(changeDeviceMotion())); +} + +DeviceMotionClientQt::~DeviceMotionClientQt() +{ + disconnect(); + delete m_provider; +} + +void DeviceMotionClientQt::setController(DeviceMotionController* controller) +{ + m_controller = controller; +} + +void DeviceMotionClientQt::startUpdating() +{ + m_provider->start(); +} + +void DeviceMotionClientQt::stopUpdating() +{ + m_provider->stop(); +} + +DeviceMotionData* DeviceMotionClientQt::currentDeviceMotion() const +{ + return m_provider->currentDeviceMotion(); +} + +void DeviceMotionClientQt::deviceMotionControllerDestroyed() +{ + delete this; +} + +void DeviceMotionClientQt::changeDeviceMotion() +{ + if (!m_controller) + return; + + m_controller->didChangeDeviceMotion(currentDeviceMotion()); +} + +} // namespace WebCore + +#include "moc_DeviceMotionClientQt.cpp" diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h b/Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h new file mode 100644 index 0000000..ea843e2 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010 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 DeviceMotionClientQt_h +#define DeviceMotionClientQt_h + +#include "DeviceMotionClient.h" +#include "DeviceMotionData.h" + +#include <QObject> + +class QWebPage; + +namespace WebCore { + +class DeviceMotionProviderQt; + +class DeviceMotionClientQt : public QObject, public DeviceMotionClient { + Q_OBJECT +public: + DeviceMotionClientQt(QWebPage*); + virtual ~DeviceMotionClientQt(); + + virtual void setController(DeviceMotionController*); + virtual void startUpdating(); + virtual void stopUpdating(); + virtual DeviceMotionData* currentDeviceMotion() const; + virtual void deviceMotionControllerDestroyed(); + +public Q_SLOTS: + void changeDeviceMotion(); + +private: + QWebPage* m_page; + DeviceMotionController* m_controller; + DeviceMotionProviderQt* m_provider; +}; + +} // namespece WebCore + +#endif // DeviceMotionClientQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp b/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp new file mode 100644 index 0000000..ccf7697 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2010 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 "DeviceMotionProviderQt.h" + +#include "DeviceOrientationProviderQt.h" + +namespace WebCore { + +DeviceMotionProviderQt::DeviceMotionProviderQt() +{ + m_acceleration.addFilter(this); + m_motion = DeviceMotionData::create(); + m_deviceOrientation = new DeviceOrientationProviderQt(); +} + +DeviceMotionProviderQt::~DeviceMotionProviderQt() +{ + delete m_deviceOrientation; +} + +void DeviceMotionProviderQt::start() +{ + m_acceleration.start(); + m_deviceOrientation->start(); +} + +void DeviceMotionProviderQt::stop() +{ + m_acceleration.stop(); + m_deviceOrientation->stop(); +} + +bool DeviceMotionProviderQt::filter(QAccelerometerReading* reading) +{ + RefPtr<DeviceMotionData::Acceleration> accel = DeviceMotionData::Acceleration::create( + /* x available */ true, reading->x(), + /* y available */ true, reading->y(), + /* z available */ true, reading->z()); + + RefPtr<DeviceMotionData::RotationRate> rotation = DeviceMotionData::RotationRate::create( + m_deviceOrientation->hasAlpha(), m_deviceOrientation->orientation()->alpha(), + /* beta available */ true, m_deviceOrientation->orientation()->beta(), + /* gamma available */ true, m_deviceOrientation->orientation()->gamma()); + + m_motion = DeviceMotionData::create(accel, + accel, /* FIXME: Needs to provide acceleration include gravity. */ + rotation, + false, 0 /* The interval is treated internally by Qt mobility */); + + emit deviceMotionChanged(); + + return false; +} + +} // namespace WebCore + +#include "moc_DeviceMotionProviderQt.cpp" diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h b/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h new file mode 100644 index 0000000..f3200d5 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010 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 DeviceMotionProviderQt_h +#define DeviceMotionProviderQt_h + +#include "DeviceMotionData.h" +#include "RefPtr.h" + +#include <QAccelerometerFilter> +#include <QObject> + +QTM_USE_NAMESPACE + +namespace WebCore { + +class DeviceOrientationProviderQt; + +class DeviceMotionProviderQt : public QObject, public QAccelerometerFilter { + Q_OBJECT +public: + DeviceMotionProviderQt(); + ~DeviceMotionProviderQt(); + + bool filter(QAccelerometerReading*); + void start(); + void stop(); + DeviceMotionData* currentDeviceMotion() const { return m_motion.get(); } + +Q_SIGNALS: + void deviceMotionChanged(); + +private: + RefPtr<DeviceMotionData> m_motion; + QAccelerometer m_acceleration; + DeviceOrientationProviderQt* m_deviceOrientation; +}; + +} // namespace WebCore + +#endif // DeviceMotionProviderQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp new file mode 100644 index 0000000..81ddaa2 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2010 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 "DeviceOrientationClientMockQt.h" + +#include "DeviceOrientation.h" +#include "DeviceOrientationClientMock.h" +#include "DeviceOrientationController.h" + +namespace WebCore { + +bool DeviceOrientationClientMockQt::mockIsActive = false; + +DeviceOrientationClientMockQt* DeviceOrientationClientMockQt::client() +{ + static DeviceOrientationClientMockQt* client = 0; + if (!client) + client = new DeviceOrientationClientMockQt; + + return client; +} + +DeviceOrientationClientMockQt::DeviceOrientationClientMockQt() + : m_clientMock(new DeviceOrientationClientMock()) +{ + m_orientation = DeviceOrientation::create(); +} + +DeviceOrientationClientMockQt::~DeviceOrientationClientMockQt() +{ + delete m_clientMock; +} + +void DeviceOrientationClientMockQt::setController(DeviceOrientationController* controller) +{ + m_clientMock->setController(m_controller); +} + +void DeviceOrientationClientMockQt::startUpdating() +{ + m_clientMock->startUpdating(); +} + +void DeviceOrientationClientMockQt::stopUpdating() +{ + m_clientMock->stopUpdating(); +} + +DeviceOrientation* DeviceOrientationClientMockQt::lastOrientation() const +{ + return m_orientation.get(); +} + +void DeviceOrientationClientMockQt::deviceOrientationControllerDestroyed() +{ + delete this; +} + +void DeviceOrientationClientMockQt::setOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +{ + m_orientation = DeviceOrientation::create(canProvideAlpha, alpha, + canProvideBeta, beta, + canProvideGamma, gamma); + m_clientMock->setOrientation(m_orientation); + + emit mockOrientationChanged(m_orientation.get()); +} + +} // namespace WebCore + +#include "moc_DeviceOrientationClientMockQt.cpp" diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h new file mode 100644 index 0000000..cc5913d --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 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 DeviceOrientationClientMockQt_h +#define DeviceOrientationClientMockQt_h + +#include "DeviceOrientationClient.h" +#include "RefPtr.h" + +#include <QObject> + +namespace WebCore { + +class DeviceOrientation; +class DeviceOrientationClientMock; +class DeviceOrientationController; + +class DeviceOrientationClientMockQt : public QObject, public DeviceOrientationClient { + Q_OBJECT +public: + static DeviceOrientationClientMockQt* client(); + virtual ~DeviceOrientationClientMockQt(); + + virtual void setController(DeviceOrientationController*); + virtual void startUpdating(); + virtual void stopUpdating(); + virtual DeviceOrientation* lastOrientation() const; + virtual void deviceOrientationControllerDestroyed(); + void setOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma); + static bool mockIsActive; + +Q_SIGNALS: + void mockOrientationChanged(DeviceOrientation*); + +private: + DeviceOrientationClientMockQt(); + + DeviceOrientationClientMock* m_clientMock; + DeviceOrientationController* m_controller; + RefPtr<DeviceOrientation> m_orientation; +}; + +} // namespace WebCore + +#endif // DeviceOrientationClientMockQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp new file mode 100644 index 0000000..01cbe73 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2010 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 "DeviceOrientationClientQt.h" + +#include "DeviceOrientationClientMockQt.h" +#include "DeviceOrientationController.h" +#include "DeviceOrientationProviderQt.h" +#include "qwebpage.h" + +namespace WebCore { + +DeviceOrientationClientQt::DeviceOrientationClientQt(QWebPage* page) + : m_page(page) + , m_controller(0) + , m_provider(new DeviceOrientationProviderQt()) +{ + connect(m_provider, SIGNAL(deviceOrientationChanged(DeviceOrientation*)), SLOT(changeDeviceOrientation(DeviceOrientation*))); +} + +DeviceOrientationClientQt::~DeviceOrientationClientQt() +{ + disconnect(); + delete m_provider; +} + +void DeviceOrientationClientQt::setController(DeviceOrientationController* controller) +{ + m_controller = controller; +} + +void DeviceOrientationClientQt::startUpdating() +{ + m_provider->start(); +} + +void DeviceOrientationClientQt::stopUpdating() +{ + m_provider->stop(); +} + +DeviceOrientation* DeviceOrientationClientQt::lastOrientation() const +{ + return m_provider->orientation(); +} + +void DeviceOrientationClientQt::deviceOrientationControllerDestroyed() +{ + delete this; +} + +void DeviceOrientationClientQt::changeDeviceOrientation(DeviceOrientation* orientation) +{ + if (!m_controller) + return; + + m_controller->didChangeDeviceOrientation(orientation); +} + +} // namespace WebCore + +#include "moc_DeviceOrientationClientQt.cpp" diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h new file mode 100644 index 0000000..61968c4 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010 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 DeviceOrientationClientQt_h +#define DeviceOrientationClientQt_h + +#include "DeviceOrientation.h" +#include "DeviceOrientationClient.h" + +#include <QObject> + +class QWebPage; + +namespace WebCore { + +class DeviceOrientationProviderQt; + +class DeviceOrientationClientQt : public QObject, public DeviceOrientationClient { + Q_OBJECT +public: + DeviceOrientationClientQt(QWebPage*); + virtual ~DeviceOrientationClientQt(); + + virtual void setController(DeviceOrientationController*); + virtual void startUpdating(); + virtual void stopUpdating(); + virtual DeviceOrientation* lastOrientation() const; + virtual void deviceOrientationControllerDestroyed(); + +public Q_SLOTS: + void changeDeviceOrientation(DeviceOrientation*); + +private: + QWebPage* m_page; + DeviceOrientationController* m_controller; + DeviceOrientationProviderQt* m_provider; +}; + +} // namespace WebCore + +#endif // DeviceOrientationClientQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp new file mode 100644 index 0000000..a31930d --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2010 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 "DeviceOrientationProviderQt.h" + +#include "DeviceOrientationClientMockQt.h" + +namespace WebCore { + +DeviceOrientationProviderQt::DeviceOrientationProviderQt() +{ + m_rotation.addFilter(this); + m_orientation = DeviceOrientation::create(); + + if (DeviceOrientationClientMockQt::mockIsActive) + activeClientMock(); +} + +DeviceOrientationProviderQt::~DeviceOrientationProviderQt() +{ + disconnect(); +} + +void DeviceOrientationProviderQt::start() +{ + m_rotation.start(); +} + +void DeviceOrientationProviderQt::stop() +{ + m_rotation.stop(); +} + +bool DeviceOrientationProviderQt::filter(QRotationReading* reading) +{ + // Provide device orientation data according W3C spec: + // http://dev.w3.org/geo/api/spec-source-orientation.html + // Qt mobility provide these data via QRotationSensor using the + // QRotationReading class: + // - the rotation around z axis (alpha) is given as z in QRotationReading; + // - the rotation around x axis (beta) is given as x in QRotationReading; + // - the rotation around y axis (gamma) is given as y in QRotationReading; + // See: http://doc.qt.nokia.com/qtmobility-1.0/qrotationreading.html + // The Z (alpha) rotation angle is checked via hasAlpha() private method, + // depending if the device is able do detect the alpha rotation. X (beta) and + // Y (gamma) axis are availble in this context. + m_orientation = DeviceOrientation::create(hasAlpha(), reading->z(), + /* x available */ true, reading->x(), + /* y available */ true, reading->y()); + emit deviceOrientationChanged(m_orientation.get()); + + return false; +} + +void DeviceOrientationProviderQt::changeDeviceOrientation(DeviceOrientation* orientation) +{ + m_orientation = orientation; +} + +void DeviceOrientationProviderQt::activeClientMock() +{ + connect(DeviceOrientationClientMockQt::client(), SIGNAL(mockOrientationChanged(DeviceOrientation*)), SLOT(changeDeviceOrientation(DeviceOrientation*))); +} + +} + +#include "moc_DeviceOrientationProviderQt.cpp" diff --git a/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h new file mode 100644 index 0000000..e87937e --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2010 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 DeviceOrientationProviderQt_h +#define DeviceOrientationProviderQt_h + +#include "DeviceOrientation.h" +#include "RefPtr.h" + +#include <QObject> +#include <QRotationFilter> + +QTM_USE_NAMESPACE + +namespace WebCore { + +class DeviceOrientationClientQt; + +class DeviceOrientationProviderQt : public QObject, public QRotationFilter { + Q_OBJECT +public: + DeviceOrientationProviderQt(); + ~DeviceOrientationProviderQt(); + + bool filter(QRotationReading*); + void start(); + void stop(); + bool isActive() const { return m_rotation.isActive(); } + DeviceOrientation* orientation() const { return m_orientation.get(); } + bool hasAlpha() const { return m_rotation.property("hasZ").toBool(); } + +Q_SIGNALS: + void deviceOrientationChanged(DeviceOrientation*); + +public Q_SLOTS: + void changeDeviceOrientation(DeviceOrientation*); + +private: + void activeClientMock(); + + RefPtr<DeviceOrientation> m_orientation; + QRotationSensor m_rotation; +}; + +} + +#endif // DeviceOrientationProviderQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp new file mode 100644 index 0000000..f136328 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp @@ -0,0 +1,118 @@ +/* + * 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 "config.h" +#include "DragClientQt.h" + +#include "ClipboardQt.h" +#include "Frame.h" +#include "PlatformMouseEvent.h" +#include "qwebpage.h" + +#include <QDrag> +#include <QMimeData> + + +namespace WebCore { + +static inline Qt::DropActions dragOperationsToDropActions(unsigned op) +{ + Qt::DropActions result = Qt::IgnoreAction; + if (op & DragOperationCopy) + result = Qt::CopyAction; + if (op & DragOperationMove) + result |= Qt::MoveAction; + if (op & DragOperationGeneric) + result |= Qt::MoveAction; + if (op & DragOperationLink) + result |= Qt::LinkAction; + return result; +} + +static inline DragOperation dropActionToDragOperation(Qt::DropActions action) +{ + DragOperation result = DragOperationNone; + if (action & Qt::CopyAction) + result = DragOperationCopy; + if (action & Qt::LinkAction) + result = DragOperationLink; + if (action & Qt::MoveAction) + result = DragOperationMove; + return result; +} + +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 dragImage, const IntPoint&, const IntPoint&, Clipboard* clipboard, Frame* 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); + if (dragImage) + drag->setPixmap(*dragImage); + else if (clipboardData && clipboardData->hasImage()) + drag->setPixmap(qvariant_cast<QPixmap>(clipboardData->imageData())); + DragOperation dragOperationMask = clipboard->sourceOperation(); + drag->setMimeData(clipboardData); + Qt::DropAction actualDropAction = drag->exec(dragOperationsToDropActions(dragOperationMask)); + + // Send dragEnd event + PlatformMouseEvent me(m_webPage->view()->mapFromGlobal(QCursor::pos()), QCursor::pos(), LeftButton, MouseEventMoved, 0, false, false, false, false, 0); + frame->eventHandler()->dragSourceEndedAt(me, dropActionToDragOperation(actualDropAction)); + } +#endif +} + + +DragImageRef DragClientQt::createDragImageForLink(KURL&, const String&, Frame*) +{ + return 0; +} + +} // namespace WebCore diff --git a/Source/WebKit/qt/WebCoreSupport/DragClientQt.h b/Source/WebKit/qt/WebCoreSupport/DragClientQt.h new file mode 100644 index 0000000..4c83191 --- /dev/null +++ b/Source/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/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp new file mode 100644 index 0000000..ecd91eb --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -0,0 +1,989 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.net> + Copyright (C) 2008,2009,2010 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 "DumpRenderTreeSupportQt.h" + +#include "ApplicationCacheStorage.h" +#include "CSSComputedStyleDeclaration.h" +#include "ChromeClientQt.h" +#include "ContextMenu.h" +#include "ContextMenuClientQt.h" +#include "ContextMenuController.h" +#include "DeviceOrientation.h" +#include "DeviceOrientationClientMockQt.h" +#include "Editor.h" +#include "EditorClientQt.h" +#include "Element.h" +#include "FocusController.h" +#include "Frame.h" +#include "FrameLoaderClientQt.h" +#include "FrameView.h" +#if USE(JSC) +#include "GCController.h" +#elif USE(V8) +#include "V8GCController.h" +#include "V8Proxy.h" +#endif +#include "Geolocation.h" +#include "GeolocationServiceMock.h" +#include "Geoposition.h" +#include "HistoryItem.h" +#include "HTMLInputElement.h" +#include "InspectorController.h" +#include "NodeList.h" +#include "NotificationPresenterClientQt.h" +#include "Page.h" +#include "PageGroup.h" +#include "PluginDatabase.h" +#include "PositionError.h" +#include "PrintContext.h" +#include "RenderListItem.h" +#include "RenderTreeAsText.h" +#include "ScriptController.h" +#include "SecurityOrigin.h" +#include "Settings.h" +#if ENABLE(SVG) +#include "SVGDocumentExtensions.h" +#include "SVGSMILElement.h" +#endif +#include "TextIterator.h" +#include "WorkerThread.h" +#include <wtf/CurrentTime.h> + +#include "qwebelement.h" +#include "qwebframe.h" +#include "qwebframe_p.h" +#include "qwebhistory.h" +#include "qwebhistory_p.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include "qwebscriptworld.h" + +using namespace WebCore; + +QMap<int, QWebScriptWorld*> m_worldMap; + +QDRTNode::QDRTNode() + : m_node(0) +{ +} + +QDRTNode::QDRTNode(WebCore::Node* node) + : m_node(0) +{ + if (node) { + m_node = node; + m_node->ref(); + } +} + +QDRTNode::~QDRTNode() +{ + if (m_node) + m_node->deref(); +} + + +DumpRenderTreeSupportQt::DumpRenderTreeSupportQt() +{ +} + +DumpRenderTreeSupportQt::~DumpRenderTreeSupportQt() +{ +} + +void DumpRenderTreeSupportQt::overwritePluginDirectories() +{ + PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false); + + Vector<String> paths; + String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data()); + qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths); + + db->setPluginDirectories(paths); + db->refresh(); +} + +int DumpRenderTreeSupportQt::workerThreadCount() +{ +#if ENABLE(WORKERS) + return WebCore::WorkerThread::workerThreadCount(); +#else + return 0; +#endif +} + +void DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(bool b) +{ + QWebPagePrivate::drtRun = b; +} + +void DumpRenderTreeSupportQt::setFrameFlatteningEnabled(QWebPage* page, bool enabled) +{ + QWebPagePrivate::core(page)->settings()->setFrameFlatteningEnabled(enabled); +} + +void DumpRenderTreeSupportQt::webPageSetGroupName(QWebPage* page, const QString& groupName) +{ + page->handle()->page->setGroupName(groupName); +} + +QString DumpRenderTreeSupportQt::webPageGroupName(QWebPage* page) +{ + return page->handle()->page->groupName(); +} + +void DumpRenderTreeSupportQt::webInspectorExecuteScript(QWebPage* page, long callId, const QString& script) +{ +#if ENABLE(INSPECTOR) + if (!page->handle()->page->inspectorController()) + return; + page->handle()->page->inspectorController()->evaluateForTestInFrontend(callId, script); +#endif +} + +void DumpRenderTreeSupportQt::webInspectorClose(QWebPage* page) +{ +#if ENABLE(INSPECTOR) + if (!page->handle()->page->inspectorController()) + return; + page->handle()->page->inspectorController()->close(); +#endif +} + +void DumpRenderTreeSupportQt::webInspectorShow(QWebPage* page) +{ +#if ENABLE(INSPECTOR) + if (!page->handle()->page->inspectorController()) + return; + page->handle()->page->inspectorController()->show(); +#endif +} + +void DumpRenderTreeSupportQt::setTimelineProfilingEnabled(QWebPage* page, bool enabled) +{ +#if ENABLE(INSPECTOR) + InspectorController* controller = page->handle()->page->inspectorController(); + if (!controller) + return; + if (enabled) + controller->startTimelineProfiler(); + else + controller->stopTimelineProfiler(); +#endif +} + +bool DumpRenderTreeSupportQt::hasDocumentElement(QWebFrame* frame) +{ + return QWebFramePrivate::core(frame)->document()->documentElement(); +} + +void DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled(QWebFrame* frame, bool enabled) +{ +#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) + Frame* coreFrame = QWebFramePrivate::core(frame); + InspectorController* controller = coreFrame->page()->inspectorController(); + if (!controller) + return; + if (enabled) + controller->enableProfiler(); + else + controller->disableProfiler(); +#endif +} + +// Pause a given CSS animation or transition on the target node at a specific time. +// If the animation or transition is already paused, it will update its pause time. +// This method is only intended to be used for testing the CSS animation and transition system. +bool DumpRenderTreeSupportQt::pauseAnimation(QWebFrame *frame, const QString &animationName, double time, const QString &elementId) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return false; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return false; + + Document* doc = coreFrame->document(); + Q_ASSERT(doc); + + Node* coreNode = doc->getElementById(elementId); + if (!coreNode || !coreNode->renderer()) + return false; + + return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time); +} + +bool DumpRenderTreeSupportQt::pauseTransitionOfProperty(QWebFrame *frame, const QString &propertyName, double time, const QString &elementId) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return false; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return false; + + Document* doc = coreFrame->document(); + Q_ASSERT(doc); + + Node* coreNode = doc->getElementById(elementId); + if (!coreNode || !coreNode->renderer()) + return false; + + return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time); +} + +// Pause a given SVG animation on the target node at a specific time. +// This method is only intended to be used for testing the SVG animation system. +bool DumpRenderTreeSupportQt::pauseSVGAnimation(QWebFrame *frame, const QString &animationId, double time, const QString &elementId) +{ +#if !ENABLE(SVG) + return false; +#else + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return false; + + Document* doc = coreFrame->document(); + Q_ASSERT(doc); + + if (!doc->svgExtensions()) + return false; + + Node* coreNode = doc->getElementById(animationId); + if (!coreNode || !SVGSMILElement::isSMILElement(coreNode)) + return false; + + return doc->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<SVGSMILElement*>(coreNode), time); +#endif +} + +// Returns the total number of currently running animations (includes both CSS transitions and CSS animations). +int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return false; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return false; + + return controller->numberOfActiveAnimations(); +} + +void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->suspendAnimations(); +} + +void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->resumeAnimations(); +} + +void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + coreFrame->tree()->clearName(); +} + +int DumpRenderTreeSupportQt::javaScriptObjectsCount() +{ +#if USE(JSC) + return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount(); +#elif USE(V8) + // FIXME: Find a way to do this using V8. + return 1; +#endif +} + +void DumpRenderTreeSupportQt::garbageCollectorCollect() +{ +#if USE(JSC) + gcController().garbageCollectNow(); +#elif USE(V8) + v8::V8::LowMemoryNotification(); +#endif +} + +void DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(bool waitUntilDone) +{ +#if USE(JSC) + gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone); +#elif USE(V8) + // FIXME: Find a way to do this using V8. + garbageCollectorCollect(); +#endif +} + +// Returns the value of counter in the element specified by \a id. +QString DumpRenderTreeSupportQt::counterValueForElementById(QWebFrame* frame, const QString& id) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (Document* document = coreFrame->document()) { + if (Element* element = document->getElementById(id)) + return WebCore::counterValueForElement(element); + } + return QString(); +} + +int DumpRenderTreeSupportQt::pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return -1; + + Element* element = coreFrame->document()->getElementById(AtomicString(id)); + if (!element) + return -1; + + return PrintContext::pageNumberForElement(element, FloatSize(width, height)); +} + +int DumpRenderTreeSupportQt::numberOfPages(QWebFrame* frame, float width, float height) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return -1; + + return PrintContext::numberOfPages(coreFrame, FloatSize(width, height)); +} + +// Suspend active DOM objects in this frame. +void DumpRenderTreeSupportQt::suspendActiveDOMObjects(QWebFrame* frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (coreFrame->document()) + // FIXME: This function should be changed take a ReasonForSuspension parameter + // https://bugs.webkit.org/show_bug.cgi?id=45732 + coreFrame->document()->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused); +} + +// Resume active DOM objects in this frame. +void DumpRenderTreeSupportQt::resumeActiveDOMObjects(QWebFrame* frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (coreFrame->document()) + coreFrame->document()->resumeActiveDOMObjects(); +} + +void DumpRenderTreeSupportQt::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +{ + SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains); +} + +void DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +{ + SecurityOrigin::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains); +} + +void DumpRenderTreeSupportQt::resetOriginAccessWhiteLists() +{ + SecurityOrigin::resetOriginAccessWhitelists(); +} + +void DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme) +{ + SecurityOrigin::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme); +} + +void DumpRenderTreeSupportQt::setCaretBrowsingEnabled(QWebPage* page, bool value) +{ + page->handle()->page->settings()->setCaretBrowsingEnabled(value); +} + +void DumpRenderTreeSupportQt::setMediaType(QWebFrame* frame, const QString& type) +{ + WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); + WebCore::FrameView* view = coreFrame->view(); + view->setMediaType(type); + coreFrame->document()->styleSelectorChanged(RecalcStyleImmediately); + view->layout(); +} + +void DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(QWebPage* page, bool enabled) +{ + page->d->smartInsertDeleteEnabled = enabled; +} + + +void DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(QWebPage* page, bool enabled) +{ + page->d->selectTrailingWhitespaceEnabled = enabled; +} + + +void DumpRenderTreeSupportQt::executeCoreCommandByName(QWebPage* page, const QString& name, const QString& value) +{ + page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value); +} + +bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPage* page, const QString& name) +{ + return page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled(); +} + +bool DumpRenderTreeSupportQt::findString(QWebPage* page, const QString& string, const QStringList& optionArray) +{ + // 1. Parse the options from the array + WebCore::FindOptions options = 0; + const int optionCount = optionArray.size(); + for (int i = 0; i < optionCount; ++i) { + const QString& option = optionArray.at(i); + if (option == QLatin1String("CaseInsensitive")) + options |= WebCore::CaseInsensitive; + else if (option == QLatin1String("AtWordStarts")) + options |= WebCore::AtWordStarts; + else if (option == QLatin1String("TreatMedialCapitalAsWordStart")) + options |= WebCore::TreatMedialCapitalAsWordStart; + else if (option == QLatin1String("Backwards")) + options |= WebCore::Backwards; + else if (option == QLatin1String("WrapAround")) + options |= WebCore::WrapAround; + else if (option == QLatin1String("StartInSelection")) + options |= WebCore::StartInSelection; + } + + // 2. find the string + WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame(); + return frame && frame->editor()->findString(string, options); +} + +QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listItem) +{ + return WebCore::markerTextForListItem(listItem.m_element); +} + +static QString convertToPropertyName(const QString& name) +{ + QStringList parts = name.split('-'); + QString camelCaseName; + for (int j = 0; j < parts.count(); ++j) { + QString part = parts.at(j); + if (j) + camelCaseName.append(part.replace(0, 1, part.left(1).toUpper())); + else + camelCaseName.append(part); + } + return camelCaseName; +} + +QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(const QWebElement& element) +{ + QVariantMap res; + + WebCore::Element* webElement = element.m_element; + if (!webElement) + return res; + + RefPtr<WebCore::CSSComputedStyleDeclaration> style = computedStyle(webElement, true); + for (int i = 0; i < style->length(); i++) { + QString name = style->item(i); + QString value = (static_cast<WebCore::CSSStyleDeclaration*>(style.get()))->getPropertyValue(name); + res[convertToPropertyName(name)] = QVariant(value); + } + return res; +} + +QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPage* page) +{ + WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame(); + QVariantList selectedRange; + RefPtr<Range> range = frame->selection()->toNormalizedRange().get(); + + Element* selectionRoot = frame->selection()->rootEditableElement(); + Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement(); + + RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset()); + ASSERT(testRange->startContainer() == scope); + int startPosition = TextIterator::rangeLength(testRange.get()); + + ExceptionCode ec; + testRange->setEnd(range->endContainer(), range->endOffset(), ec); + ASSERT(testRange->startContainer() == scope); + int endPosition = TextIterator::rangeLength(testRange.get()); + + selectedRange << startPosition << (endPosition - startPosition); + + return selectedRange; + +} + +QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPage* page, int location, int length) +{ + WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame(); + QVariantList rect; + + if ((location + length < location) && (location + length)) + length = 0; + + Element* selectionRoot = frame->selection()->rootEditableElement(); + Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement(); + RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(scope, location, length); + + if (!range) + return QVariantList(); + + QRect resultRect = frame->editor()->firstRectForRange(range.get()); + rect << resultRect.x() << resultRect.y() << resultRect.width() << resultRect.height(); + return rect; +} + +bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return false; + + Document* doc = coreFrame->document(); + Q_ASSERT(doc); + + Node* coreNode = doc->getElementById(elementId); + if (!coreNode || !coreNode->renderer()) + return false; + + HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode); + if (!inputElement) + return false; + + return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->autoComplete(); +} + +void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& editingBehavior) +{ + WebCore::EditingBehaviorType coreEditingBehavior; + + if (editingBehavior == "win") + coreEditingBehavior = EditingWindowsBehavior; + else if (editingBehavior == "mac") + coreEditingBehavior = EditingMacBehavior; + else if (editingBehavior == "unix") + coreEditingBehavior = EditingUnixBehavior; + else { + ASSERT_NOT_REACHED(); + return; + } + + Page* corePage = QWebPagePrivate::core(page); + if (!corePage) + return; + + corePage->settings()->setEditingBehaviorType(coreEditingBehavior); +} + +void DumpRenderTreeSupportQt::clearAllApplicationCaches() +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + WebCore::cacheStorage().empty(); + WebCore::cacheStorage().vacuumDatabaseFile(); +#endif +} + +void DumpRenderTreeSupportQt::dumpFrameLoader(bool b) +{ + FrameLoaderClientQt::dumpFrameLoaderCallbacks = b; +} + +void DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(bool b) +{ + FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = b; +} + +void DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(bool b) +{ + FrameLoaderClientQt::dumpResourceLoadCallbacks = b; +} + +void DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(const QString& path) +{ + FrameLoaderClientQt::dumpResourceLoadCallbacksPath = path; +} + +void DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(bool b) +{ + FrameLoaderClientQt::dumpResourceResponseMIMETypes = b; +} + +void DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(bool b) +{ + FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = b; +} + +void DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(bool b) +{ + FrameLoaderClientQt::sendRequestReturnsNull = b; +} + +void DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(const QStringList& headers) +{ + FrameLoaderClientQt::sendRequestClearHeaders = headers; +} + +void DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(bool b) +{ + FrameLoaderClientQt::deferMainResourceDataLoad = b; +} + +void DumpRenderTreeSupportQt::setCustomPolicyDelegate(bool enabled, bool permissive) +{ + FrameLoaderClientQt::policyDelegateEnabled = enabled; + FrameLoaderClientQt::policyDelegatePermissive = permissive; +} + +void DumpRenderTreeSupportQt::dumpHistoryCallbacks(bool b) +{ + FrameLoaderClientQt::dumpHistoryCallbacks = b; +} + +void DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(bool b) +{ + ChromeClientQt::dumpVisitedLinksCallbacks = b; +} + +void DumpRenderTreeSupportQt::dumpEditingCallbacks(bool b) +{ + EditorClientQt::dumpEditingCallbacks = b; +} + +void DumpRenderTreeSupportQt::dumpSetAcceptsEditing(bool b) +{ + EditorClientQt::acceptsEditing = b; +} + +void DumpRenderTreeSupportQt::dumpNotification(bool b) +{ +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::dumpNotification = b; +#endif +} + +QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, const QSize& availableSize) +{ + WebCore::ViewportArguments args = page->d->viewportArguments(); + WebCore::ViewportAttributes conf = WebCore::computeViewportAttributes(args, + /* desktop-width */ 980, + /* device-width */ 320, + /* device-height */ 480, + /* device-dpi */ 160, + availableSize); + + QString res; + res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f]\n", + conf.layoutSize.width(), + conf.layoutSize.height(), + conf.initialScale, + conf.minimumScale, + conf.maximumScale); + + return res; +} + +void DumpRenderTreeSupportQt::activeMockDeviceOrientationClient(bool b) +{ +#if ENABLE(DEVICE_ORIENTATION) + DeviceOrientationClientMockQt::mockIsActive = b; +#endif +} + +void DumpRenderTreeSupportQt::removeMockDeviceOrientation() +{ +#if ENABLE(DEVICE_ORIENTATION) + DeviceOrientationClientMockQt* client = DeviceOrientationClientMockQt::client(); + delete client; +#endif +} + +void DumpRenderTreeSupportQt::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +{ +#if ENABLE(DEVICE_ORIENTATION) + DeviceOrientationClientMockQt::client()->setOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); +#endif +} + +void DumpRenderTreeSupportQt::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +{ +#if ENABLE(GEOLOCATION) + RefPtr<Geoposition> geoposition = Geoposition::create(Coordinates::create(latitude, longitude, false, 0, accuracy, true, 0, false, 0, false, 0), currentTime() * 1000.0); + GeolocationServiceMock::setPosition(geoposition); +#endif +} + +void DumpRenderTreeSupportQt::setMockGeolocationError(int errorCode, const QString& message) +{ +#if ENABLE(GEOLOCATION) + RefPtr<PositionError> positionError = PositionError::create(static_cast<PositionError::ErrorCode>(errorCode), message); + GeolocationServiceMock::setError(positionError); +#endif +} + +bool DumpRenderTreeSupportQt::isTargetItem(const QWebHistoryItem& historyItem) +{ + QWebHistoryItem it = historyItem; + if (QWebHistoryItemPrivate::core(&it)->isTargetItem()) + return true; + return false; +} + +QString DumpRenderTreeSupportQt::historyItemTarget(const QWebHistoryItem& historyItem) +{ + QWebHistoryItem it = historyItem; + return (QWebHistoryItemPrivate::core(&it)->target()); +} + +QMap<QString, QWebHistoryItem> DumpRenderTreeSupportQt::getChildHistoryItems(const QWebHistoryItem& historyItem) +{ + QWebHistoryItem it = historyItem; + HistoryItem* item = QWebHistoryItemPrivate::core(&it); + const WebCore::HistoryItemVector& children = item->children(); + + unsigned size = children.size(); + QMap<QString, QWebHistoryItem> kids; + for (unsigned i = 0; i < size; ++i) { + QWebHistoryItem kid(new QWebHistoryItemPrivate(children[i].get())); + kids.insert(DumpRenderTreeSupportQt::historyItemTarget(kid), kid); + } + return kids; +} + +bool DumpRenderTreeSupportQt::shouldClose(QWebFrame* frame) +{ + WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); + return coreFrame->loader()->shouldClose(); +} + +void DumpRenderTreeSupportQt::clearScriptWorlds() +{ + m_worldMap.clear(); +} + +void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldID, const QString& script) +{ + QWebScriptWorld* scriptWorld; + if (!worldID) { + scriptWorld = new QWebScriptWorld(); + } else if (!m_worldMap.contains(worldID)) { + scriptWorld = new QWebScriptWorld(); + m_worldMap.insert(worldID, scriptWorld); + } else + scriptWorld = m_worldMap.value(worldID); + + WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); + + ScriptController* proxy = coreFrame->script(); + + if (!proxy) + return; +#if USE(JSC) + proxy->executeScriptInWorld(scriptWorld->world(), script, true); +#elif USE(V8) + ScriptSourceCode source(script); + Vector<ScriptSourceCode> sources; + sources.append(source); + proxy->evaluateInIsolatedWorld(0, sources, true); +#endif +} + +bool DumpRenderTreeSupportQt::isPageBoxVisible(QWebFrame* frame, int pageIndex) +{ + WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); + return coreFrame->document()->isPageBoxVisible(pageIndex); +} + +QString DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels(QWebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) +{ + WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); + return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageIndex, width, height, + marginTop, marginRight, marginBottom, marginLeft); +} + +QString DumpRenderTreeSupportQt::pageProperty(QWebFrame* frame, const QString& propertyName, int pageNumber) +{ + WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); + return PrintContext::pageProperty(coreFrame, propertyName.toUtf8().constData(), pageNumber); +} + +void DumpRenderTreeSupportQt::addUserStyleSheet(QWebPage* page, const QString& sourceCode) +{ + page->handle()->page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, QUrl(), 0, 0, WebCore::InjectInAllFrames); +} + +void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& title) +{ +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::notificationPresenter()->notificationClicked(title); +#endif +} + +QString DumpRenderTreeSupportQt::plainText(const QVariant& range) +{ + QMap<QString, QVariant> map = range.toMap(); + QVariant startContainer = map.value("startContainer"); + map = startContainer.toMap(); + + return map.value("innerText").toString(); +} + +QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping) +{ + QVariantList res; + WebCore::Element* webElement = document.m_element; + if (!webElement) + return res; + + Document* doc = webElement->document(); + if (!doc) + return res; + RefPtr<NodeList> nodes = doc->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping); + for (int i = 0; i < nodes->length(); i++) { + QVariant v; + // QWebElement will be null if the Node is not an HTML Element + if (nodes->item(i)->isHTMLElement()) + v.setValue(QWebElement(nodes->item(i))); + else + v.setValue(QDRTNode(nodes->item(i))); + res << v; + } + return res; +} + +// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release + +void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame) +{ + DumpRenderTreeSupportQt::resumeActiveDOMObjects(frame); +} + +void QWEBKIT_EXPORT qt_suspendActiveDOMObjects(QWebFrame* frame) +{ + DumpRenderTreeSupportQt::suspendActiveDOMObjects(frame); +} + +void QWEBKIT_EXPORT qt_drt_clearFrameName(QWebFrame* frame) +{ + DumpRenderTreeSupportQt::clearFrameName(frame); +} + +void QWEBKIT_EXPORT qt_drt_garbageCollector_collect() +{ + DumpRenderTreeSupportQt::garbageCollectorCollect(); +} + +void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone) +{ + DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(waitUntilDone); +} + +int QWEBKIT_EXPORT qt_drt_javaScriptObjectsCount() +{ + return DumpRenderTreeSupportQt::javaScriptObjectsCount(); +} + +int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame* frame) +{ + return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame); +} + +void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories() +{ + DumpRenderTreeSupportQt::overwritePluginDirectories(); +} + +bool QWEBKIT_EXPORT qt_drt_pauseAnimation(QWebFrame* frame, const QString& animationName, double time, const QString& elementId) +{ + return DumpRenderTreeSupportQt::pauseAnimation(frame, animationName, time, elementId); +} + +bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame* frame, const QString& propertyName, double time, const QString &elementId) +{ + return DumpRenderTreeSupportQt::pauseTransitionOfProperty(frame, propertyName, time, elementId); +} + +void QWEBKIT_EXPORT qt_drt_resetOriginAccessWhiteLists() +{ + DumpRenderTreeSupportQt::resetOriginAccessWhiteLists(); +} + +void QWEBKIT_EXPORT qt_drt_run(bool b) +{ + DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(b); +} + +void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* frame, bool enabled) +{ + DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled(frame, enabled); +} + +void QWEBKIT_EXPORT qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +{ + DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains); +} + +QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page) +{ + return DumpRenderTreeSupportQt::webPageGroupName(page); +} + +void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName) +{ + DumpRenderTreeSupportQt::webPageSetGroupName(page, groupName); +} + +void QWEBKIT_EXPORT qt_dump_frame_loader(bool b) +{ + DumpRenderTreeSupportQt::dumpFrameLoader(b); +} + +void QWEBKIT_EXPORT qt_dump_resource_load_callbacks(bool b) +{ + DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(b); +} + +void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b) +{ + DumpRenderTreeSupportQt::dumpEditingCallbacks(b); +} + +void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b) +{ + DumpRenderTreeSupportQt::dumpSetAcceptsEditing(b); +} + diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h new file mode 100644 index 0000000..6917039 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -0,0 +1,189 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.net> + Copyright (C) 2008,2009,2010 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. +*/ + +#ifndef DumpRenderTreeSupportQt_h +#define DumpRenderTreeSupportQt_h + +#include "qwebkitglobal.h" +#include <QVariant> + +namespace WebCore { +class Text; +class Node; +} + + +#if defined(WTF_USE_V8) && WTF_USE_V8 +namespace V8 { +namespace Bindings { +class QtDRTNodeRuntime; +} +} +#else +namespace JSC { +namespace Bindings { +class QtDRTNodeRuntime; +} +} +#endif + +class QWebElement; +class QWebFrame; +class QWebPage; +class QWebHistoryItem; +class QWebScriptWorld; + +extern QMap<int, QWebScriptWorld*> m_worldMap; + +// Used to pass WebCore::Node's to layout tests using LayoutTestController +class QWEBKIT_EXPORT QDRTNode { +public: + QDRTNode(); + ~QDRTNode(); + +private: + explicit QDRTNode(WebCore::Node*); + + friend class DumpRenderTreeSupportQt; + +#if defined(WTF_USE_V8) && WTF_USE_V8 + friend class V8::Bindings::QtDRTNodeRuntime; +#else + friend class JSC::Bindings::QtDRTNodeRuntime; +#endif + + WebCore::Node* m_node; +}; + +Q_DECLARE_METATYPE(QDRTNode) + +class QWEBKIT_EXPORT DumpRenderTreeSupportQt { + +public: + + DumpRenderTreeSupportQt(); + ~DumpRenderTreeSupportQt(); + + + static void executeCoreCommandByName(QWebPage* page, const QString& name, const QString& value); + static bool isCommandEnabled(QWebPage* page, const QString& name); + static bool findString(QWebPage* page, const QString& string, const QStringList& optionArray); + static void setSmartInsertDeleteEnabled(QWebPage* page, bool enabled); + static void setSelectTrailingWhitespaceEnabled(QWebPage* page, bool enabled); + static QVariantList selectedRange(QWebPage* page); + static QVariantList firstRectForCharacterRange(QWebPage* page, int location, int length); + + static bool pauseAnimation(QWebFrame*, const QString& name, double time, const QString& elementId); + static bool pauseTransitionOfProperty(QWebFrame*, const QString& name, double time, const QString& elementId); + static bool pauseSVGAnimation(QWebFrame*, const QString& animationId, double time, const QString& elementId); + static void suspendActiveDOMObjects(QWebFrame* frame); + static void resumeActiveDOMObjects(QWebFrame* frame); + + static void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme); + static void setFrameFlatteningEnabled(QWebPage*, bool); + static void setCaretBrowsingEnabled(QWebPage* page, bool value); + static void setMediaType(QWebFrame* qframe, const QString& type); + static void setDumpRenderTreeModeEnabled(bool b); + + static void garbageCollectorCollect(); + static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone); + static void setJavaScriptProfilingEnabled(QWebFrame*, bool enabled); + static int javaScriptObjectsCount(); + static void clearScriptWorlds(); + static void evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldID, const QString& script); + + static void setTimelineProfilingEnabled(QWebPage*, bool enabled); + static void webInspectorExecuteScript(QWebPage* page, long callId, const QString& script); + static void webInspectorShow(QWebPage* page); + static void webInspectorClose(QWebPage* page); + + static QString webPageGroupName(QWebPage *page); + static QString counterValueForElementById(QWebFrame* frame, const QString& id); + static void webPageSetGroupName(QWebPage* page, const QString& groupName); + static void clearFrameName(QWebFrame* frame); + static void overwritePluginDirectories(); + static int numberOfActiveAnimations(QWebFrame*); + static void suspendAnimations(QWebFrame*); + static void resumeAnimations(QWebFrame*); + static int numberOfPages(QWebFrame* frame, float width, float height); + static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height); + static bool hasDocumentElement(QWebFrame* frame); + static bool elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId); + static void setEditingBehavior(QWebPage* page, const QString& editingBehavior); + + static void clearAllApplicationCaches(); + + static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); + static void removeWhiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); + static void resetOriginAccessWhiteLists(); + + static void activeMockDeviceOrientationClient(bool b); + static void removeMockDeviceOrientation(); + static void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma); + + static void setMockGeolocationPosition(double latitude, double longitude, double accuracy); + static void setMockGeolocationError(int errorCode, const QString& message); + + static int workerThreadCount(); + + static QString markerTextForListItem(const QWebElement& listItem); + static QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element); + static QString plainText(const QVariant& rng); + + static void dumpFrameLoader(bool b); + static void dumpUserGestureInFrameLoader(bool b); + static void dumpResourceLoadCallbacks(bool b); + static void dumpResourceResponseMIMETypes(bool b); + static void dumpResourceLoadCallbacksPath(const QString& path); + static void setWillSendRequestReturnsNullOnRedirect(bool b); + static void setWillSendRequestReturnsNull(bool b); + static void setWillSendRequestClearHeaders(const QStringList& headers); + static void dumpHistoryCallbacks(bool b); + static void dumpVisitedLinksCallbacks(bool b); + + static void setDeferMainResourceDataLoad(bool b); + + static void dumpEditingCallbacks(bool b); + static void dumpSetAcceptsEditing(bool b); + + static void dumpNotification(bool b); + + static QMap<QString, QWebHistoryItem> getChildHistoryItems(const QWebHistoryItem& historyItem); + static bool isTargetItem(const QWebHistoryItem& historyItem); + static QString historyItemTarget(const QWebHistoryItem& historyItem); + + static bool shouldClose(QWebFrame* frame); + + static void setCustomPolicyDelegate(bool enabled, bool permissive); + + static bool isPageBoxVisible(QWebFrame* frame, int pageIndex); + + static QString pageSizeAndMarginsInPixels(QWebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft); + static QString pageProperty(QWebFrame* frame, const QString& propertyName, int pageNumber); + static void addUserStyleSheet(QWebPage* page, const QString& sourceCode); + static void simulateDesktopNotificationClick(const QString& title); + static QString viewportAsText(QWebPage*, const QSize&); + + static QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping); +}; + +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/EditCommandQt.cpp b/Source/WebKit/qt/WebCoreSupport/EditCommandQt.cpp new file mode 100644 index 0000000..4b820a9 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/EditCommandQt.cpp @@ -0,0 +1,63 @@ +/* + 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 "EditCommandQt.h" + +using namespace WebCore; + +#ifndef QT_NO_UNDOCOMMAND +EditCommandQt::EditCommandQt(WTF::RefPtr<EditCommand> cmd, QUndoCommand *parent) + : QUndoCommand(parent) + , m_cmd(cmd) + , m_first(true) +{ +} +#else +EditCommandQt::EditCommandQt(WTF::RefPtr<EditCommand> cmd) + : m_cmd(cmd) + , m_first(true) +{ +} +#endif + +EditCommandQt::~EditCommandQt() +{ +} + + +void EditCommandQt::redo() +{ + if (m_first) { + m_first = false; + return; + } + if (m_cmd) + m_cmd->reapply(); +} + + +void EditCommandQt::undo() +{ + if (m_cmd) + m_cmd->unapply(); +} + + +// vim: ts=4 sw=4 et diff --git a/Source/WebKit/qt/WebCoreSupport/EditCommandQt.h b/Source/WebKit/qt/WebCoreSupport/EditCommandQt.h new file mode 100644 index 0000000..47dc67c --- /dev/null +++ b/Source/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 <EditCommand.h> +#include <QUndoCommand> +#include <qglobal.h> + +class EditCommandQt +#ifndef QT_NO_UNDOCOMMAND + : public QUndoCommand +#endif +{ + public: +#ifndef QT_NO_UNDOCOMMAND + EditCommandQt(WTF::RefPtr<WebCore::EditCommand> cmd, QUndoCommand *parent = 0); +#else + EditCommandQt(WTF::RefPtr<WebCore::EditCommand> cmd); +#endif + ~EditCommandQt(); + + void redo(); + void undo(); + + private: + WTF::RefPtr<WebCore::EditCommand> m_cmd; + bool m_first; +}; + +#endif + +// vim: ts=4 sw=4 et diff --git a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp new file mode 100644 index 0000000..ed6bc45 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -0,0 +1,669 @@ +/* + * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> + * Copyright (C) 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. + * 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 "CSSStyleDeclaration.h" +#include "Document.h" +#include "EditCommandQt.h" +#include "Editor.h" +#include "FocusController.h" +#include "Frame.h" +#include "HTMLElement.h" +#include "HTMLInputElement.h" +#include "HTMLNames.h" +#include "KeyboardEvent.h" +#include "NotImplemented.h" +#include "Page.h" +#include "PlatformKeyboardEvent.h" +#include "QWebPageClient.h" +#include "Range.h" +#include "Settings.h" +#include "WindowsKeyboardCodes.h" +#include "qwebpage.h" +#include "qwebpage_p.h" + +#include <QUndoStack> +#include <stdio.h> +#include <wtf/OwnPtr.h> + +#define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__); + +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)"); + WebCore::ExceptionCode code; + + QString str = QString("range from %1 of %2 to %3 of %4") + .arg(range->startOffset(code)).arg(dumpPath(range->startContainer(code))) + .arg(range->endOffset(code)).arg(dumpPath(range->endContainer(code))); + + return str; +} + + +namespace WebCore { + +bool EditorClientQt::dumpEditingCallbacks = false; +bool EditorClientQt::acceptsEditing = true; + +using namespace HTMLNames; + +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->getAttribute(classAttr) == "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(); + Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); + if (!frame->editor()->ignoreCompositionSelectionChange()) + 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() +{ + return m_page->d->smartInsertDeleteEnabled; +} + +void EditorClientQt::toggleSmartInsertDelete() +{ + bool current = m_page->d->smartInsertDeleteEnabled; + m_page->d->smartInsertDeleteEnabled = !current; +} + +bool EditorClientQt::isSelectTrailingWhitespaceEnabled() +{ + return m_page->d->selectTrailingWhitespaceEnabled; +} + +void EditorClientQt::toggleContinuousSpellChecking() +{ + notImplemented(); +} + +void EditorClientQt::toggleGrammarChecking() +{ + notImplemented(); +} + +static const unsigned CtrlKey = 1 << 0; +static const unsigned AltKey = 1 << 1; +static const unsigned ShiftKey = 1 << 2; + +struct KeyDownEntry { + unsigned virtualKey; + unsigned modifiers; + const char* editorCommand; +}; + +// Handle here key down events that are needed for spatial navigation and caret browsing, or +// are not handled by QWebPage. +static const KeyDownEntry keyDownEntries[] = { + // Ones that do not have an associated QAction: + { VK_DELETE, 0, "DeleteForward" }, + { VK_BACK, ShiftKey, "DeleteBackward" }, + { VK_BACK, 0, "DeleteBackward" }, + // Ones that need special handling for caret browsing: + { VK_PRIOR, 0, "MovePageUp" }, + { VK_PRIOR, ShiftKey, "MovePageUpAndModifySelection" }, + { VK_NEXT, 0, "MovePageDown" }, + { VK_NEXT, ShiftKey, "MovePageDownAndModifySelection" }, + // Ones that need special handling for spatial navigation: + { VK_LEFT, 0, "MoveLeft" }, + { VK_RIGHT, 0, "MoveRight" }, + { VK_UP, 0, "MoveUp" }, + { VK_DOWN, 0, "MoveDown" }, +}; + +const char* editorCommandForKeyDownEvent(const KeyboardEvent* event) +{ + if (event->type() != eventNames().keydownEvent) + return ""; + + static HashMap<int, const char*> keyDownCommandsMap; + if (keyDownCommandsMap.isEmpty()) { + + unsigned numEntries = sizeof(keyDownEntries) / sizeof((keyDownEntries)[0]); + for (unsigned i = 0; i < numEntries; i++) + keyDownCommandsMap.set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].editorCommand); + } + + unsigned modifiers = 0; + if (event->shiftKey()) + modifiers |= ShiftKey; + if (event->altKey()) + modifiers |= AltKey; + if (event->ctrlKey()) + modifiers |= CtrlKey; + + int mapKey = modifiers << 16 | event->keyCode(); + return mapKey ? keyDownCommandsMap.get(mapKey) : 0; +} + +void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event) +{ + Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); + if (!frame) + 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()) { + bool doSpatialNavigation = false; + if (isSpatialNavigationEnabled(frame)) { + if (!kevent->modifiers()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_LEFT: + case VK_RIGHT: + case VK_UP: + case VK_DOWN: + doSpatialNavigation = true; + } + } + } + +#ifndef QT_NO_SHORTCUT + QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent()); + if (action != QWebPage::NoWebAction && !doSpatialNavigation) { + 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); + event->setDefaultHandled(); + return; + } else +#endif // QT_NO_SHORTCUT + { + String commandName = editorCommandForKeyDownEvent(event); + if (!commandName.isEmpty()) { + if (frame->editor()->command(commandName).execute()) // Event handled. + event->setDefaultHandled(); + return; + } + + if (kevent->windowsVirtualKeyCode() == VK_TAB) { + // Do not handle TAB text insertion here. + return; + } + + // Text insertion. + bool shouldInsertText = false; + if (kevent->type() != PlatformKeyboardEvent::KeyDown && !kevent->text().isEmpty()) { + + if (kevent->ctrlKey()) { + if (kevent->altKey()) + shouldInsertText = true; + } else { +#ifndef Q_WS_MAC + // We need to exclude checking for Alt because it is just a different Shift + if (!kevent->altKey()) +#endif + shouldInsertText = true; + + } + } + + if (shouldInsertText) { + frame->editor()->insertText(kevent->text(), event); + event->setDefaultHandled(); + return; + } + } + + // Event not handled. + return; + } + + // Non editable content. + if (m_page->handle()->page->settings()->caretBrowsingEnabled()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_LEFT: + case VK_RIGHT: + case VK_UP: + case VK_DOWN: + case VK_HOME: + case VK_END: + { +#ifndef QT_NO_SHORTCUT + QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent()); + ASSERT(action != QWebPage::NoWebAction); + m_page->triggerAction(action); + event->setDefaultHandled(); +#endif + return; + } + case VK_PRIOR: // PageUp + case VK_NEXT: // PageDown + { + String commandName = editorCommandForKeyDownEvent(event); + ASSERT(!commandName.isEmpty()); + frame->editor()->command(commandName).execute(); + event->setDefaultHandled(); + return; + } + } + } + +#ifndef QT_NO_SHORTCUT + if (kevent->qtEvent() == QKeySequence::Copy) { + m_page->triggerAction(QWebPage::Copy); + event->setDefaultHandled(); + return; + } +#endif // QT_NO_SHORTCUT +} + +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(); +} + +String EditorClientQt::getAutoCorrectSuggestionForMisspelledWord(const String&) +{ + notImplemented(); + return String(); +} + +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& word, const String& context, Vector<String>& guesses) +{ + notImplemented(); +} + +bool EditorClientQt::isEditing() const +{ + return m_editing; +} + +void EditorClientQt::willSetInputMethodState() +{ +} + +void EditorClientQt::setInputMethodState(bool active) +{ + QWebPageClient* webPageClient = m_page->d->client.get(); + if (webPageClient) { + Qt::InputMethodHints hints; + + HTMLInputElement* inputElement = 0; + Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); + if (frame && frame->document() && frame->document()->focusedNode()) + if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) + inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode()); + + if (inputElement) { + // Set input method hints for "number", "tel", "email", "url" and "password" input elements. + if (inputElement->isTelephoneField()) + hints |= Qt::ImhDialableCharactersOnly; + if (inputElement->isNumberField()) + hints |= Qt::ImhDigitsOnly; + if (inputElement->isEmailField()) + hints |= Qt::ImhEmailCharactersOnly; + if (inputElement->isURLField()) + hints |= Qt::ImhUrlCharactersOnly; + // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag + // for password fields. The Qt platform is responsible for determining which widget + // will receive input method events for password fields. + if (inputElement->isPasswordField()) { + active = true; + hints |= Qt::ImhHiddenText; + } + } + +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + // disables auto-uppercase and predictive text for mobile devices + hints |= Qt::ImhNoAutoUppercase; + hints |= Qt::ImhNoPredictiveText; +#endif // Q_WS_MAEMO_5 || Q_WS_MAEMO_6 || Q_OS_SYMBIAN + webPageClient->setInputMethodHints(hints); + webPageClient->setInputMethodEnabled(active); + } + emit m_page->microFocusChanged(); +} + +} + +// vim: ts=4 sw=4 et diff --git a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h new file mode 100644 index 0000000..1e410e6 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h @@ -0,0 +1,127 @@ +/* + * 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 void toggleSmartInsertDelete(); + 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 String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord); + 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& word, const String& context, Vector<String>& guesses); + virtual void willSetInputMethodState(); + virtual void setInputMethodState(bool enabled); + virtual void requestCheckingOfString(SpellChecker*, int, const String&) {} + + bool isEditing() const; + + static bool dumpEditingCallbacks; + static bool acceptsEditing; + +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/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp new file mode 100644 index 0000000..474b768 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -0,0 +1,1623 @@ +/* + * Copyright (C) 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2008 Collabora Ltd. All rights reserved. + * Coypright (C) 2008 Holger Hans Peter Freyther + * Coypright (C) 2009, 2010 Girish Ramakrishnan <girish@forwardbias.in> + * + * 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 "FormState.h" +#include "FrameLoaderClientQt.h" +#include "FrameNetworkingContextQt.h" +#include "FrameTree.h" +#include "FrameView.h" +#include "DocumentLoader.h" +#include "HitTestResult.h" +#if USE(JSC) +#include "JSDOMWindowBase.h" +#elif USE(V8) +#include "V8DOMWindow.h" +#endif +#include "MIMETypeRegistry.h" +#include "MouseEvent.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 "HTMLAppletElement.h" +#include "HTMLFormElement.h" +#include "HTMLPlugInElement.h" +#include "HTTPParsers.h" +#include "QtNAMThreadSafeProxy.h" +#include "NotImplemented.h" +#include "QNetworkReplyHandler.h" +#include "ResourceHandleInternal.h" +#include "ResourceHandle.h" +#include "ScriptController.h" +#include "Settings.h" +#include "QWebPageClient.h" +#include "ViewportArguments.h" + +#include "qwebpage.h" +#include "qwebpage_p.h" +#include "qwebframe.h" +#include "qwebframe_p.h" +#include "qwebhistoryinterface.h" +#include "qwebpluginfactory.h" + +#include <qfileinfo.h> + +#include <QCoreApplication> +#include <QDebug> +#include <QGraphicsScene> +#include <QGraphicsWidget> +#include <QNetworkRequest> +#include <QNetworkReply> +#include <QStringList> +#include "qwebhistory_p.h" +#include <wtf/OwnPtr.h> + +static QMap<unsigned long, QString> dumpAssignedUrls; + +// 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 drtPrintFrameUserGestureStatus(WebCore::Frame* frame) +{ + if (frame->loader()->isProcessingUserGesture()) + return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("true")); + return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("false")); +} + +static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url) +{ + if (_url.isEmpty() || !_url.isLocalFile()) + return _url.string(); + // Remove the leading path from file urls + return QString(_url.string()).replace(WebCore::FrameLoaderClientQt::dumpResourceLoadCallbacksPath, "").mid(1); +} + +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 = drtDescriptionSuitableForTestResult(request.url()); + QString httpMethod = request.httpMethod(); + QString mainDocumentUrl = drtDescriptionSuitableForTestResult(request.firstPartyForCookies()); + return QString::fromLatin1("<NSURLRequest URL %1, main document URL %2, http method %3>").arg(url).arg(mainDocumentUrl).arg(httpMethod); +} + +static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceResponse& response) +{ + QString url = drtDescriptionSuitableForTestResult(response.url()); + int httpStatusCode = response.httpStatusCode(); + return QString::fromLatin1("<NSURLResponse %1, http status code %2>").arg(url).arg(httpStatusCode); +} + +static QString drtDescriptionSuitableForTestResult(const RefPtr<WebCore::Node> node, int exception) +{ + QString result; + if (exception) { + result.append("ERROR"); + return result; + } + if (!node) { + result.append("NULL"); + return result; + } + result.append(node->nodeName()); + RefPtr<WebCore::Node> parent = node->parentNode(); + if (parent) { + result.append(" > "); + result.append(drtDescriptionSuitableForTestResult(parent, 0)); + } + return result; +} + +namespace WebCore +{ + +bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false; +bool FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = false; +bool FrameLoaderClientQt::dumpResourceLoadCallbacks = false; +bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false; +bool FrameLoaderClientQt::sendRequestReturnsNull = false; +bool FrameLoaderClientQt::dumpResourceResponseMIMETypes = false; +bool FrameLoaderClientQt::deferMainResourceDataLoad = true; +bool FrameLoaderClientQt::dumpHistoryCallbacks = false; + +QStringList FrameLoaderClientQt::sendRequestClearHeaders; +QString FrameLoaderClientQt::dumpResourceLoadCallbacksPath; +bool FrameLoaderClientQt::policyDelegateEnabled = false; +bool FrameLoaderClientQt::policyDelegatePermissive = false; + +// Taken from DumpRenderTree/chromium/WebViewHost.cpp +static const char* navigationTypeToString(NavigationType type) +{ + switch (type) { + case NavigationTypeLinkClicked: + return "link clicked"; + case NavigationTypeFormSubmitted: + return "form submitted"; + case NavigationTypeBackForward: + return "back/forward"; + case NavigationTypeReload: + return "reload"; + case NavigationTypeFormResubmitted: + return "form resubmitted"; + case NavigationTypeOther: + return "other"; + } + return "illegal value"; +} + +FrameLoaderClientQt::FrameLoaderClientQt() + : m_frame(0) + , m_webFrame(0) + , m_pluginView(0) + , m_hasSentResponseToPlugin(false) + , m_hasRepresentation(false) + , m_loadError(ResourceError()) +{ +} + + +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(loadStarted()), + m_webFrame, 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(loadFinished(bool)), + m_webFrame, SIGNAL(loadFinished(bool))); + connect(this, SIGNAL(titleChanged(QString)), + m_webFrame, SIGNAL(titleChanged(QString))); +} + +void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, PolicyAction action) +{ + (m_frame->loader()->policyChecker()->*function)(action); +} + +bool FrameLoaderClientQt::hasWebView() const +{ + //notImplemented(); + return true; +} + +void FrameLoaderClientQt::savePlatformDataToCachedFrame(CachedFrame*) +{ + notImplemented(); +} + +void FrameLoaderClientQt::transitionToCommittedFromCachedFrame(CachedFrame*) +{ +} + +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(); + + QWebPage* page = m_webFrame->page(); + const QSize preferredLayoutSize = page->preferredContentsSize(); + + ScrollbarMode hScrollbar = (ScrollbarMode) m_webFrame->scrollBarPolicy(Qt::Horizontal); + ScrollbarMode vScrollbar = (ScrollbarMode) m_webFrame->scrollBarPolicy(Qt::Vertical); + bool hLock = hScrollbar != ScrollbarAuto; + bool vLock = vScrollbar != ScrollbarAuto; + + IntSize currentVisibleContentSize = m_frame->view() ? m_frame->view()->actualVisibleContentRect().size() : IntSize(); + + m_frame->createView(m_webFrame->page()->viewportSize(), + backgroundColor, !backgroundColor.alpha(), + preferredLayoutSize.isValid() ? IntSize(preferredLayoutSize) : IntSize(), + preferredLayoutSize.isValid(), + hScrollbar, hLock, + vScrollbar, vLock); + + bool isMainFrame = m_frame == m_frame->page()->mainFrame(); + if (isMainFrame && page->d->client) { + m_frame->view()->setPaintsEntireContents(page->d->client->viewResizesToContentsEnabled()); + m_frame->view()->setDelegatesScrolling(page->d->client->viewResizesToContentsEnabled()); + } + + // The HistoryController will update the scroll position later if needed. + m_frame->view()->setActualVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize)); +} + +void FrameLoaderClientQt::didSaveToPageCache() +{ +} + +void FrameLoaderClientQt::didRestoreFromPageCache() +{ +} + +void FrameLoaderClientQt::dispatchDidBecomeFrameset(bool) +{ +} + +void FrameLoaderClientQt::makeRepresentation(DocumentLoader*) +{ + m_hasRepresentation = true; +} + + +void FrameLoaderClientQt::forceLayout() +{ + FrameView* view = m_frame->view(); + if (view) + view->layout(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, double) +{ + 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(); +} + +#if USE(V8) +void FrameLoaderClientQt::didCreateScriptContextForFrame() +{ +} +void FrameLoaderClientQt::didDestroyScriptContextForFrame() +{ +} +void FrameLoaderClientQt::didCreateIsolatedScriptContext() +{ +} +#endif + +void FrameLoaderClientQt::dispatchDidPushStateWithinPage() +{ + if (dumpFrameLoaderCallbacks) + printf("%s - dispatchDidPushStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + notImplemented(); +} + +void FrameLoaderClientQt::dispatchDidReplaceStateWithinPage() +{ + if (dumpFrameLoaderCallbacks) + printf("%s - dispatchDidReplaceStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + notImplemented(); +} + +void FrameLoaderClientQt::dispatchDidPopStateWithinPage() +{ + if (dumpFrameLoaderCallbacks) + printf("%s - dispatchDidPopStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + notImplemented(); +} + +void FrameLoaderClientQt::dispatchWillClose() +{ +} + + +void FrameLoaderClientQt::dispatchDidStartProvisionalLoad() +{ + if (dumpFrameLoaderCallbacks) + printf("%s - didStartProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + if (dumpUserGestureInFrameLoaderCallbacks) + printf("%s - in didStartProvisionalLoadForFrame\n", qPrintable(drtPrintFrameUserGestureStatus(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; + + emit titleChanged(title); +} + + +void FrameLoaderClientQt::dispatchDidChangeIcons() +{ + if (dumpFrameLoaderCallbacks) + printf("%s - didChangeIcons\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + if (!m_webFrame) + return; + + // FIXME: To be notified of changing icon URLS add notification + // emit iconsChanged(); +} + + +void FrameLoaderClientQt::dispatchDidCommitLoad() +{ + if (dumpFrameLoaderCallbacks) + printf("%s - didCommitLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + if (m_frame->tree()->parent() || !m_webFrame) + return; + + emit m_webFrame->urlChanged(m_webFrame->url()); + 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()); + + bool isMainFrame = (m_frame == m_frame->page()->mainFrame()); + if (!isMainFrame) + return; + + emit m_webFrame->page()->viewportChangeRequested(); +} + + +void FrameLoaderClientQt::dispatchDidFinishDocumentLoad() +{ + if (dumpFrameLoaderCallbacks) + printf("%s - didFinishDocumentLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + if (QWebPagePrivate::drtRun) { + int unloadEventCount = m_frame->domWindow()->pendingUnloadEventListeners(); + 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))); + + // Clears the previous error. + m_loadError = ResourceError(); + + if (!m_webFrame) + return; + m_webFrame->page()->d->updateNavigationActions(); +} + + +void FrameLoaderClientQt::dispatchDidFirstLayout() +{ +} + +void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout() +{ + if (m_webFrame) + emit m_webFrame->initialLayoutCompleted(); +} + +void FrameLoaderClientQt::dispatchShow() +{ + notImplemented(); +} + + +void FrameLoaderClientQt::cancelPolicyCheck() +{ +// qDebug() << "FrameLoaderClientQt::cancelPolicyCheck"; +} + + +void FrameLoaderClientQt::dispatchWillSubmitForm(FramePolicyFunction function, + PassRefPtr<FormState>) +{ + notImplemented(); + // FIXME: This is surely too simple + callPolicyFunction(function, PolicyUse); +} + + +void FrameLoaderClientQt::dispatchDidLoadMainResource(DocumentLoader*) +{ +} + + +void FrameLoaderClientQt::revertToProvisionalState(DocumentLoader*) +{ + m_hasRepresentation = true; +} + + +void FrameLoaderClientQt::postProgressStartedNotification() +{ + if (m_webFrame && m_frame->page()) { + // A new load starts, so lets clear the previous error. + m_loadError = ResourceError(); + 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_loadError.isNull()); +} + +void FrameLoaderClientQt::setMainFrameDocumentReady(bool) +{ + // 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) { + // This is necessary to create an empty document. See bug 634004. + // However, we only want to do this if makeRepresentation has been called, to + // match the behavior on the Mac. + if (m_hasRepresentation) + loader->frameLoader()->writer()->setEncoding("", false); + return; + } + if (m_pluginView->isPluginView()) + m_pluginView->didFinishLoading(); + m_pluginView = 0; + m_hasSentResponseToPlugin = false; +} + +bool FrameLoaderClientQt::canShowMIMETypeAsHTML(const String& MIMEType) const +{ + notImplemented(); + return false; +} + +bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const +{ + String type = MIMEType; + type.makeLower(); + if (MIMETypeRegistry::isSupportedImageMIMEType(type)) + return true; + + if (MIMETypeRegistry::isSupportedNonImageMIMEType(type)) + return true; + + if (m_frame && m_frame->settings() && m_frame->settings()->arePluginsEnabled() + && PluginDatabase::installedPlugins()->isMIMETypeRegistered(type)) + return true; + + return false; +} + +bool FrameLoaderClientQt::representationExistsForURLScheme(const String&) const +{ + return false; +} + + +String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String&) const +{ + notImplemented(); + return String(); +} + + +void FrameLoaderClientQt::frameLoadCompleted() +{ + // Note: Can be called multiple times. +} + + +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() +{ +} + +void FrameLoaderClientQt::setTitle(const String& title, const KURL& url) +{ + // Used by Apple WebKit to update the title of an existing history item. + // QtWebKit doesn't accomodate this on history items. If it ever does, + // it should be privateBrowsing-aware.For now, we are just passing + // globalhistory layout tests. + if (dumpHistoryCallbacks) { + printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", + qPrintable(drtDescriptionSuitableForTestResult(url)), + qPrintable(QString(title))); + } +} + + +String FrameLoaderClientQt::userAgent(const KURL& url) +{ + if (m_webFrame) { + return m_webFrame->page()->userAgentForUrl(url); + } + return String(); +} + +void FrameLoaderClientQt::dispatchDidReceiveIcon() +{ + 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::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world) +{ + if (world != mainThreadNormalWorld()) + return; + + if (m_webFrame) { + emit m_webFrame->javaScriptWindowObjectCleared(); + } +} + +void FrameLoaderClientQt::documentElementAvailable() +{ + return; +} + +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(); + WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader(); + if (history) + history->addHistoryEntry(loader->urlForHistory().prettyURL()); + + if (dumpHistoryCallbacks) { + printf("WebView navigated to url \"%s\" with title \"%s\" with HTTP equivalent method \"%s\". The navigation was %s and was %s%s.\n", + qPrintable(drtDescriptionSuitableForTestResult(loader->urlForHistory())), + qPrintable(QString(loader->title())), + qPrintable(QString(loader->request().httpMethod())), + ((loader->substituteData().isValid() || (loader->response().httpStatusCode() >= 400)) ? "a failure" : "successful"), + ((!loader->clientRedirectSourceForHistory().isEmpty()) ? "a client redirect from " : "not a client redirect"), + (!loader->clientRedirectSourceForHistory().isEmpty()) ? qPrintable(drtDescriptionSuitableForTestResult(loader->clientRedirectSourceForHistory())) : ""); + } +} + +void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks() +{ + // Apple WebKit is the only port that makes use of this callback. It calls + // WebCore::HistoryItem::addRedirectURL() with the contents of + // loader->[server|client]RedirectDestinationForHistory(). + // WebCore can associate a bunch of redirect URLs with a particular + // item in the history, presumably this allows Safari to skip the redirections + // when navigating to that history item. That might be a feature Qt wants to + // offer through QWebHistoryInterface in the future. For now, we're just + // passing tests in LayoutTests/http/tests/globalhistory. + WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader(); + + if (!loader->clientRedirectSourceForHistory().isNull()) { + if (dumpHistoryCallbacks) { + printf("WebView performed a client redirect from \"%s\" to \"%s\".\n", + qPrintable(QString(loader->clientRedirectSourceForHistory())), + qPrintable(QString(loader->clientRedirectDestinationForHistory()))); + } + } + + if (!loader->serverRedirectSourceForHistory().isNull()) { + if (dumpHistoryCallbacks) { + printf("WebView performed a server redirect from \"%s\" to \"%s\".\n", + qPrintable(QString(loader->serverRedirectSourceForHistory())), + qPrintable(QString(loader->serverRedirectDestinationForHistory()))); + } + } +} + +bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const +{ + return true; +} + +void FrameLoaderClientQt::dispatchDidAddBackForwardItem(WebCore::HistoryItem*) const +{ +} + +void FrameLoaderClientQt::dispatchDidRemoveBackForwardItem(WebCore::HistoryItem*) const +{ +} + +void FrameLoaderClientQt::dispatchDidChangeBackForwardIndex() const +{ +} + +void FrameLoaderClientQt::didDisplayInsecureContent() +{ + if (dumpFrameLoaderCallbacks) + printf("didDisplayInsecureContent\n"); + + notImplemented(); +} + +void FrameLoaderClientQt::didRunInsecureContent(WebCore::SecurityOrigin*) +{ + if (dumpFrameLoaderCallbacks) + printf("didRunInsecureContent\n"); + + notImplemented(); +} + +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) + return; + if (m_pluginView->isPluginView()) + m_pluginView->didFail(error); + m_pluginView = 0; + m_hasSentResponseToPlugin = false; +} + +// FIXME: This function should be moved into WebCore. +void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) +{ + if (!m_pluginView) + loader->commitData(data, length); + + // We re-check here as the plugin can have been created + if (m_pluginView && m_pluginView->isPluginView()) { + if (!m_hasSentResponseToPlugin) { + m_pluginView->didReceiveResponse(loader->response()); + // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in + // setting up this stream can cause the main document load to be cancelled, setting m_pluginView + // to null + if (!m_pluginView) + return; + m_hasSentResponseToPlugin = true; + } + m_pluginView->didReceiveData(data, length); + } +} + +WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request) +{ + ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(), + QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); + error.setIsCancellation(true); + return error; +} + +// copied from WebKit/Misc/WebKitErrors[Private].h +enum { + WebKitErrorCannotShowMIMEType = 100, + WebKitErrorCannotShowURL = 101, + WebKitErrorFrameLoadInterruptedByPolicyChange = 102, + WebKitErrorCannotUseRestrictedPort = 103, + WebKitErrorCannotFindPlugIn = 200, + WebKitErrorCannotLoadPlugIn = 201, + WebKitErrorJavaUnavailable = 202, + WebKitErrorPluginWillHandleLoad = 203 +}; + +WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request) +{ + return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(), + QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8)); +} + + +WebCore::ResourceError FrameLoaderClientQt::cannotShowURLError(const WebCore::ResourceRequest& request) +{ + return ResourceError("WebKitErrorDomain", WebKitErrorCannotShowURL, request.url().string(), + QCoreApplication::translate("QWebFrame", "Cannot show URL", 0, QCoreApplication::UnicodeUTF8)); +} + +WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceRequest& request) +{ + return ResourceError("WebKitErrorDomain", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(), + QCoreApplication::translate("QWebFrame", "Frame load interrupted by policy change", 0, QCoreApplication::UnicodeUTF8)); +} + +WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response) +{ + return ResourceError("WebKitErrorDomain", WebKitErrorCannotShowMIMEType, response.url().string(), + QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8)); +} + +WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response) +{ + return ResourceError("QtNetwork", QNetworkReply::ContentNotFoundError, response.url().string(), + QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8)); +} + +WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse& response) +{ + return ResourceError("WebKit", WebKitErrorPluginWillHandleLoad, response.url().string(), + QCoreApplication::translate("QWebFrame", "Loading is handled by the media engine", 0, QCoreApplication::UnicodeUTF8)); +} + +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 (!deferMainResourceDataLoad || substituteData.isValid()) { + loader->setDeferMainResourceDataLoad(false); + // Use the default timeout interval for JS as the HTML tokenizer delay. This ensures + // that long-running JavaScript will still allow setHtml() to be synchronous, while + // still giving a reasonable timeout to prevent deadlock. +#if USE(JSC) + double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f; +#elif USE(V8) + // FIXME: Hard coded for now. + double delay = 10000 / 1000.0f; +#endif + m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay); + } else + m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1); + return loader.release(); +} + +void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&) +{ + if (!m_webFrame) + return; + + QNetworkReplyHandler* handler = handle->getInternal()->m_job; + QtNetworkReplyThreadSafeProxy* replyProxy = handler->release(); + if (replyProxy) { + QWebPage *page = m_webFrame->page(); + if (page->forwardUnsupportedContent()) + emit page->unsupportedContent(replyProxy->reply()); + else + replyProxy->abort(); + } +} + +void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, 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)), + (redirectResponse.isNull()) ? "(null)" : qPrintable(drtDescriptionSuitableForTestResult(redirectResponse))); + + if (sendRequestReturnsNull) + newRequest.setURL(QUrl()); + + if (sendRequestReturnsNullOnRedirect && !redirectResponse.isNull()) { + printf("Returning null for this redirect\n"); + newRequest.setURL(QUrl()); + } + + for (int i = 0; i < sendRequestClearHeaders.size(); ++i) + newRequest.setHTTPHeaderField(sendRequestClearHeaders.at(i).toLocal8Bit().constData(), QString()); + + // 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 identifier, const WebCore::ResourceResponse& response) +{ + + m_response = response; + if (dumpResourceLoadCallbacks) + printf("%s - didReceiveResponse %s\n", + qPrintable(dumpAssignedUrls[identifier]), + qPrintable(drtDescriptionSuitableForTestResult(response))); + + if (dumpResourceResponseMIMETypes) { + printf("%s has MIME type %s\n", + qPrintable(QFileInfo(drtDescriptionSuitableForTestResult(response.url())).fileName()), + qPrintable(QString(response.mimeType()))); + } +} + +void FrameLoaderClientQt::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long, int) +{ +} + +void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier) +{ + if (dumpResourceLoadCallbacks) + printf("%s - didFinishLoading\n", + (dumpAssignedUrls.contains(identifier) ? qPrintable(dumpAssignedUrls[identifier]) : "<unknown>")); +} + +void FrameLoaderClientQt::dispatchDidFailLoading(WebCore::DocumentLoader* loader, unsigned long identifier, const WebCore::ResourceError& error) +{ + if (dumpResourceLoadCallbacks) + printf("%s - didFailLoadingWithError: %s\n", + (dumpAssignedUrls.contains(identifier) ? qPrintable(dumpAssignedUrls[identifier]) : "<unknown>"), + qPrintable(drtDescriptionSuitableForTestResult(error))); +} + +bool FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int) +{ + notImplemented(); + return false; +} + +void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& error) +{ + QWebPage* page = m_webFrame->page(); + if (page->supportsExtension(QWebPage::ErrorPageExtension)) { + QWebPage::ErrorPageExtensionOption option; + + if (error.domain() == "QtNetwork") + option.domain = QWebPage::QtNetwork; + else if (error.domain() == "HTTP") + option.domain = QWebPage::Http; + else if (error.domain() == "WebKit") + option.domain = QWebPage::WebKit; + else + return; + + option.url = QUrl(error.failingURL()); + option.frame = m_webFrame; + option.error = error.errorCode(); + option.errorString = error.localizedDescription(); + + QWebPage::ErrorPageExtensionReturn output; + if (!page->extension(QWebPage::ErrorPageExtension, &option, &output)) + return; + + KURL baseUrl(output.baseUrl); + KURL failingUrl(option.url); + + WebCore::ResourceRequest request(baseUrl); + WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(output.content.constData(), output.content.length()); + WebCore::SubstituteData substituteData(buffer, output.contentType, output.encoding, failingUrl); + m_frame->loader()->load(request, substituteData, false); + } +} + +void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError& error) +{ + if (dumpFrameLoaderCallbacks) + printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + m_loadError = error; + if (!error.isNull() && !error.isCancellation()) + callErrorPageExtension(error); +} + +void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& error) +{ + if (dumpFrameLoaderCallbacks) + printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); + + m_loadError = error; + if (!error.isNull() && !error.isCancellation()) + callErrorPageExtension(error); +} + +WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage(const WebCore::NavigationAction&) +{ + 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 WTF::String& MIMEType, const WebCore::ResourceRequest&) +{ + // we need to call directly here + const ResourceResponse& response = m_frame->loader()->activeDocumentLoader()->response(); + if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment) + callPolicyFunction(function, PolicyDownload); + else if (canShowMIMEType(MIMEType)) + callPolicyFunction(function, PolicyUse); + else + callPolicyFunction(function, PolicyDownload); +} + +void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>, const WTF::String&) +{ + Q_ASSERT(m_webFrame); + QNetworkRequest r(request.toNetworkRequest(m_webFrame)); + 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); + } + + callPolicyFunction(function, PolicyIgnore); + return; + } + callPolicyFunction(function, PolicyUse); +} + +void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>) +{ + Q_ASSERT(m_webFrame); + QNetworkRequest r(request.toNetworkRequest(m_webFrame)); + QWebPage*page = m_webFrame->page(); + PolicyAction result; + + // Currently, this is only enabled by DRT + if (policyDelegateEnabled) { + RefPtr<Node> node; + for (const Event* event = action.event(); event; event = event->underlyingEvent()) { + if (event->isMouseEvent()) { + const MouseEvent* mouseEvent = static_cast<const MouseEvent*>(event); + node = QWebFramePrivate::core(m_webFrame)->eventHandler()->hitTestResultAtPoint( + mouseEvent->absoluteLocation(), false).innerNonSharedNode(); + break; + } + } + + printf("Policy delegate: attempt to load %s with navigation type '%s'%s\n", + qPrintable(drtDescriptionSuitableForTestResult(request.url())), navigationTypeToString(action.type()), + (node) ? qPrintable(QString(" originating from " + drtDescriptionSuitableForTestResult(node, 0))) : ""); + + if (policyDelegatePermissive) + result = PolicyUse; + else + result = PolicyIgnore; + + callPolicyFunction(function, result); + return; + } + + 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); + } + + callPolicyFunction(function, PolicyIgnore); + return; + } + callPolicyFunction(function, PolicyUse); +} + +void FrameLoaderClientQt::dispatchUnableToImplementPolicy(const WebCore::ResourceError&) +{ + notImplemented(); +} + +void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request) +{ + if (!m_webFrame) + return; + + emit m_webFrame->page()->downloadRequested(request.toNetworkRequest(m_webFrame)); +} + +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(m_frame->page(), m_frame, ownerElement, name); + + if (url.isEmpty()) + frameData.url = blankURL(); + else + frameData.url = url; + + frameData.referrer = referrer; + frameData.allowsScrolling = allowsScrolling; + frameData.marginWidth = marginWidth; + frameData.marginHeight = marginHeight; + + QPointer<QWebFrame> webFrame = new QWebFrame(m_webFrame, &frameData); + // The creation of the frame may have run arbitrary JavaScript that removed it from the page already. + if (!webFrame->d->frame->page()) { + frameData.frame.release(); + ASSERT(webFrame.isNull()); + return 0; + } + + emit m_webFrame->page()->frameCreated(webFrame); + + // ### set override encoding if we have one + + m_frame->loader()->loadURLIntoChildFrame(frameData.url, frameData.referrer, frameData.frame.get()); + + // The frame's onload handler may have removed it from the document. + if (!frameData.frame->tree()->parent()) + return 0; + + return frameData.frame.release(); +} + +void FrameLoaderClientQt::didTransferChildFrameToNewDocument(Page*) +{ + ASSERT(m_frame->ownerElement()); + + if (!m_webFrame) + return; + + Frame* parentFrame = m_webFrame->d->frame->tree()->parent(); + ASSERT(parentFrame); + + if (QWebFrame* parent = QWebFramePrivate::kit(parentFrame)) { + m_webFrame->d->setPage(parent->page()); + + if (m_webFrame->parent() != qobject_cast<QObject*>(parent)) + m_webFrame->setParent(parent); + } +} + +void FrameLoaderClientQt::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) +{ +} + +ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& _mimeType) +{ +// qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<_mimeType; + QFileInfo fi(url.path()); + String extension = fi.suffix(); + 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()) + mimeType = MIMETypeRegistry::getMIMETypeForExtension(extension); + + if (!mimeType.length()) + mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(extension); + + 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()); + + QRegion clipRegion = QRegion(clipRect); + platformWidget()->setMask(clipRegion); + + handleVisibility(); + + platformWidget()->update(); + } + + virtual void show() + { + Widget::show(); + handleVisibility(); + } + +private: + void handleVisibility() + { + if (!isVisible()) + return; + + // if setMask is set with an empty QRegion, no clipping will + // be performed, so in that case we hide the platformWidget + QRegion mask = platformWidget()->mask(); + platformWidget()->setVisible(!mask.isEmpty()); + } +}; + +#if !defined(QT_NO_GRAPHICSVIEW) +class QtPluginGraphicsWidget: public Widget +{ +public: + static RefPtr<QtPluginGraphicsWidget> create(QGraphicsWidget* w = 0) + { + return adoptRef(new QtPluginGraphicsWidget(w)); + } + + ~QtPluginGraphicsWidget() + { + if (graphicsWidget) + graphicsWidget->deleteLater(); + } + virtual void invalidateRect(const IntRect& r) + { + QGraphicsScene* scene = graphicsWidget ? graphicsWidget->scene() : 0; + if (scene) + scene->update(QRect(r)); + } + virtual void frameRectsChanged() + { + if (!graphicsWidget) + return; + + IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height())); + graphicsWidget->setGeometry(QRect(windowRect)); + + // FIXME: clipping of graphics widgets + } + virtual void show() + { + if (graphicsWidget) + graphicsWidget->show(); + } + virtual void hide() + { + if (graphicsWidget) + graphicsWidget->hide(); + } +private: + QtPluginGraphicsWidget(QGraphicsWidget* w = 0) + : Widget(0) + , graphicsWidget(w) + { + setBindingObject(graphicsWidget); + } + + QGraphicsWidget* graphicsWidget; +}; +#endif // QT_NO_GRAPHICSVIEW + +PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* 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 (unsigned i = 0; i < paramNames.size(); ++i) { + params.append(paramNames[i]); + if (paramNames[i] == "classid") + classid = paramValues[i]; + } + for (unsigned 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 (unsigned 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 (!object) { + QWebPluginFactory* factory = m_webFrame->page()->pluginFactory(); + if (factory) + object = factory->create(mimeType, qurl, params, values); + } + + if (object) { + QWidget* widget = qobject_cast<QWidget*>(object); + if (widget) { + QWidget* parentWidget = 0; + if (m_webFrame->page()->d->client) + parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent()); + if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. + widget->setParent(parentWidget); + widget->hide(); + RefPtr<QtPluginWidget> w = adoptRef(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; + } + +#if !defined(QT_NO_GRAPHICSVIEW) + QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object); + if (graphicsWidget) { + QGraphicsObject* parentWidget = 0; + if (m_webFrame->page()->d->client) + parentWidget = qobject_cast<QGraphicsObject*>(m_webFrame->page()->d->client->pluginParent()); + graphicsWidget->hide(); + if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. + graphicsWidget->setParentItem(parentWidget); + RefPtr<QtPluginGraphicsWidget> w = QtPluginGraphicsWidget::create(graphicsWidget); + // Make sure it's invisible until properly placed into the layout + w->setFrameRect(IntRect(0, 0, 0, 0)); + return w; + } +#endif // QT_NO_GRAPHICSVIEW + + // FIXME: make things work for widgetless plugins as well + delete object; + } +#if ENABLE(NETSCAPE_PLUGIN_API) + else { // NPAPI Plugins + Vector<String> params = paramNames; + Vector<String> values = paramValues; + if (mimeType == "application/x-shockwave-flash") { + QWebPageClient* client = m_webFrame->page()->d->client.get(); + const bool isQWebView = client && qobject_cast<QWidget*>(client->pluginParent()); +#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5) + size_t wmodeIndex = params.find("wmode"); + if (wmodeIndex == -1) { + // Disable XEmbed mode and force it to opaque mode + params.append("wmode"); + values.append("opaque"); + } else if (!isQWebView) { + // Disable transparency if client is not a QWebView + values[wmodeIndex] = "opaque"; + } +#else + if (!isQWebView) { + // inject wmode=opaque when there is no client or the client is not a QWebView + size_t wmodeIndex = params.find("wmode"); + if (wmodeIndex == -1) { + params.append("wmode"); + values.append("opaque"); + } else + values[wmodeIndex] = "opaque"; + } +#endif + } + + RefPtr<PluginView> pluginView = PluginView::create(m_frame, pluginSize, element, url, + params, values, mimeType, loadManually); + return pluginView; + } +#endif // ENABLE(NETSCAPE_PLUGIN_API) + + return 0; +} + +void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget) +{ + ASSERT(!m_pluginView); + m_pluginView = static_cast<PluginView*>(pluginWidget); + m_hasSentResponseToPlugin = false; +} + +PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* element, const KURL& url, + const Vector<String>& paramNames, const Vector<String>& paramValues) +{ + return createPlugin(pluginSize, element, url, paramNames, paramValues, "application/x-java-applet", true); +} + +String FrameLoaderClientQt::overrideMediaType() const +{ + return String(); +} + +QString FrameLoaderClientQt::chooseFile(const QString& oldFile) +{ + return m_webFrame->page()->chooseFile(m_webFrame, oldFile); +} + +PassRefPtr<FrameNetworkingContext> FrameLoaderClientQt::createNetworkingContext() +{ + return FrameNetworkingContextQt::create(m_frame, m_webFrame, m_webFrame->page()->networkAccessManager()); +} + +} + +#include "moc_FrameLoaderClientQt.cpp" diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h new file mode 100644 index 0000000..3d93eaf --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h @@ -0,0 +1,273 @@ +/* + * 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 "Frame.h" +#include "FrameLoader.h" +#include "FrameLoaderClient.h" +#include "KURL.h" +#include <wtf/OwnPtr.h> +#include "PluginView.h" +#include "RefCounted.h" +#include "ResourceError.h" +#include "ResourceResponse.h" +#include <QUrl> +#include <qobject.h> +#include <wtf/Forward.h> +class QWebFrame; + +namespace WebCore { + +class AuthenticationChallenge; +class DocumentLoader; +class Element; +class FormState; +class NavigationAction; +class FrameNetworkingContext; +class ResourceLoader; + +struct LoadErrorResetToken; + +class FrameLoaderClientQt : public QObject, public FrameLoaderClient { + Q_OBJECT + + friend class ::QWebFrame; + void callPolicyFunction(FramePolicyFunction function, PolicyAction action); + void callErrorPageExtension(const ResourceError&); +signals: + 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); + + 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 dispatchDidPushStateWithinPage(); + virtual void dispatchDidReplaceStateWithinPage(); + virtual void dispatchDidPopStateWithinPage(); + virtual void dispatchWillClose(); + virtual void dispatchDidReceiveIcon(); + virtual void dispatchDidStartProvisionalLoad(); + virtual void dispatchDidReceiveTitle(const String& title); + virtual void dispatchDidChangeIcons(); + 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(const WebCore::NavigationAction&); + virtual void dispatchShow(); + + virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WTF::String&, const WebCore::ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>, const WTF::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 dispatchWillSendSubmitEvent(HTMLFormElement*) { } + 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 void updateGlobalHistoryRedirectLinks(); + virtual bool shouldGoToHistoryItem(HistoryItem*) const; + virtual void dispatchDidAddBackForwardItem(HistoryItem*) const; + virtual void dispatchDidRemoveBackForwardItem(HistoryItem*) const; + virtual void dispatchDidChangeBackForwardIndex() const; + virtual void didDisplayInsecureContent(); + virtual void didRunInsecureContent(SecurityOrigin*); + + 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 canShowMIMETypeAsHTML(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 savePlatformDataToCachedFrame(WebCore::CachedFrame*); + virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); + virtual void transitionToCommittedForNewPage(); + + virtual void didSaveToPageCache(); + virtual void didRestoreFromPageCache(); + + virtual void dispatchDidBecomeFrameset(bool); + + 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 void didTransferChildFrameToNewDocument(WebCore::Page*); + virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, WebCore::Page*); + virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool); + virtual void redirectDataToPlugin(Widget* pluginWidget); + + virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, 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 dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*); + virtual void documentElementAvailable(); + virtual void didPerformFirstNavigation() const; + +#if USE(V8) + // A frame's V8 context was created or destroyed. + virtual void didCreateScriptContextForFrame(); + virtual void didDestroyScriptContextForFrame(); + + // A context untied to a frame was created (through evaluateInIsolatedWorld). + // This context is not tied to the lifetime of its frame, and is destroyed + // in garbage collection. + virtual void didCreateIsolatedScriptContext(); + + // Returns true if we should allow the given V8 extension to be added to + // the script context at the currently loading page and given extension group. + virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) { return false; } +#endif + + virtual void registerForIconNotification(bool); + + QString chooseFile(const QString& oldFile); + + virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext(); + + static bool dumpFrameLoaderCallbacks; + static bool dumpUserGestureInFrameLoaderCallbacks; + static bool dumpResourceLoadCallbacks; + static bool dumpResourceResponseMIMETypes; + static QString dumpResourceLoadCallbacksPath; + static bool sendRequestReturnsNullOnRedirect; + static bool sendRequestReturnsNull; + static QStringList sendRequestClearHeaders; + static bool policyDelegateEnabled; + static bool policyDelegatePermissive; + static bool deferMainResourceDataLoad; + static bool dumpHistoryCallbacks; + +private: + Frame *m_frame; + QWebFrame *m_webFrame; + ResourceResponse m_response; + + // Plugin view to redirect data to + WebCore::PluginView* m_pluginView; + bool m_hasSentResponseToPlugin; + + // True if makeRepresentation was called. We don't actually have a concept + // of a "representation", but we need to know when we're expected to have one. + // See finishedLoading(). + bool m_hasRepresentation; + + ResourceError m_loadError; +}; + +} + +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp new file mode 100644 index 0000000..b3b0f00 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp @@ -0,0 +1,53 @@ +/* + Copyright (C) 2010 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 "FrameNetworkingContextQt.h" + +#include <QNetworkAccessManager> +#include <QObject> +#include <QWebFrame> +#include <QWebPage> + +namespace WebCore { + +FrameNetworkingContextQt::FrameNetworkingContextQt(Frame* frame, QObject* originatingObject, QNetworkAccessManager* networkAccessManager) + : FrameNetworkingContext(frame) + , m_originatingObject(originatingObject) + , m_networkAccessManager(networkAccessManager) +{ +} + +PassRefPtr<FrameNetworkingContextQt> FrameNetworkingContextQt::create(Frame* frame, QObject* originatingObject, QNetworkAccessManager* networkAccessManager) +{ + return adoptRef(new FrameNetworkingContextQt(frame, originatingObject, networkAccessManager)); +} + +QObject* FrameNetworkingContextQt::originatingObject() const +{ + return m_originatingObject; +} + +QNetworkAccessManager* FrameNetworkingContextQt::networkAccessManager() const +{ + return (qobject_cast<QWebFrame*>(m_originatingObject))->page()->networkAccessManager(); +} + +} diff --git a/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h new file mode 100644 index 0000000..461023e --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2010 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 FrameNetworkingContextQt_h +#define FrameNetworkingContextQt_h + +#include "FrameNetworkingContext.h" + +namespace WebCore { + +class FrameNetworkingContextQt : public FrameNetworkingContext { +public: + static PassRefPtr<FrameNetworkingContextQt> create(Frame*, QObject* originatingObject, QNetworkAccessManager*); + +private: + FrameNetworkingContextQt(Frame*, QObject* originatingObject, QNetworkAccessManager*); + + virtual QObject* originatingObject() const; + virtual QNetworkAccessManager* networkAccessManager() const; + + QObject* m_originatingObject; + QNetworkAccessManager* m_networkAccessManager; +}; + +} + +#endif // FrameNetworkingContextQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp new file mode 100644 index 0000000..bdc22e5 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2011 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 "FullScreenVideoQt.h" + +#include "ChromeClientQt.h" +#include "HTMLNames.h" +#include "HTMLVideoElement.h" +#include "MediaPlayerPrivateQt.h" +#include "Node.h" +#include "qwebkitplatformplugin.h" + +#include <QGraphicsVideoItem> + +namespace WebCore { + +FullScreenVideoQt::FullScreenVideoQt(ChromeClientQt* chromeClient) + : m_chromeClient(chromeClient) + , m_videoElement(0) +{ + Q_ASSERT(m_chromeClient); + m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler(); + + if (m_FullScreenVideoHandler) + connect(m_FullScreenVideoHandler, SIGNAL(fullScreenClosed()), this, SLOT(aboutToClose())); +} + +FullScreenVideoQt::~FullScreenVideoQt() +{ + delete m_FullScreenVideoHandler; +} + +void FullScreenVideoQt::enterFullScreenForNode(Node* node) +{ + Q_ASSERT(node); + Q_ASSERT(m_FullScreenVideoHandler); + + if (!m_FullScreenVideoHandler) + return; + + MediaPlayerPrivateQt* mediaPlayerQt = mediaPlayerForNode(node); + mediaPlayerQt->removeVideoItem(); + m_FullScreenVideoHandler->enterFullScreen(mediaPlayerQt->mediaPlayer()); +} + +void FullScreenVideoQt::exitFullScreenForNode(Node* node) +{ + Q_ASSERT(node); + Q_ASSERT(m_FullScreenVideoHandler); + + if (!m_FullScreenVideoHandler) + return; + + m_FullScreenVideoHandler->exitFullScreen(); + MediaPlayerPrivateQt* mediaPlayerQt = mediaPlayerForNode(node); + mediaPlayerQt->restoreVideoItem(); +} + +void FullScreenVideoQt::aboutToClose() +{ + Q_ASSERT(m_videoElement); + m_videoElement->exitFullscreen(); +} + +MediaPlayerPrivateQt* FullScreenVideoQt::mediaPlayer() +{ + Q_ASSERT(m_videoElement); + PlatformMedia platformMedia = m_videoElement->platformMedia(); + return static_cast<MediaPlayerPrivateQt*>(platformMedia.media.qtMediaPlayer); +} + +MediaPlayerPrivateQt* FullScreenVideoQt::mediaPlayerForNode(Node* node) +{ + Q_ASSERT(node); + if (node) + m_videoElement = static_cast<HTMLVideoElement*>(node); + return mediaPlayer(); +} + +bool FullScreenVideoQt::requiresFullScreenForVideoPlayback() +{ + return m_FullScreenVideoHandler ? m_FullScreenVideoHandler->requiresFullScreenForVideoPlayback() : false; +} + +} + diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h new file mode 100644 index 0000000..637da70 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 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 FullScreenVideoQt_h +#define FullScreenVideoQt_h + +#include <QObject> + +QT_BEGIN_NAMESPACE +class QGraphicsVideoItem; +QT_END_NAMESPACE + +class QWebFullScreenVideoHandler; + +namespace WebCore { + +class ChromeClientQt; +class HTMLVideoElement; +class Node; +class MediaPlayerPrivateQt; + +class FullScreenVideoQt : public QObject { + Q_OBJECT +public: + FullScreenVideoQt(ChromeClientQt*); + ~FullScreenVideoQt(); + + virtual void enterFullScreenForNode(Node*); + virtual void exitFullScreenForNode(Node*); + bool requiresFullScreenForVideoPlayback(); + bool isValid() const { return m_FullScreenVideoHandler; } + +private: + MediaPlayerPrivateQt* mediaPlayer(); + MediaPlayerPrivateQt* mediaPlayerForNode(Node* = 0); + +private slots: + void aboutToClose(); + +private: + ChromeClientQt* m_chromeClient; + HTMLVideoElement* m_videoElement; + QWebFullScreenVideoHandler* m_FullScreenVideoHandler; +}; + +} + +#endif // PopupMenuQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp new file mode 100644 index 0000000..7500e99 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2010 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "GeolocationPermissionClientQt.h" + +#include "Geolocation.h" + +#include "qwebframe.h" +#include "qwebkitglobal.h" +#include "qwebpage.h" + +namespace WebCore { + +#if ENABLE(GEOLOCATION) + +static GeolocationPermissionClientQt* s_geolocationPermission; + +GeolocationPermissionClientQt* GeolocationPermissionClientQt::geolocationPermissionClient() +{ + if (s_geolocationPermission) + return s_geolocationPermission; + + s_geolocationPermission = new GeolocationPermissionClientQt(); + return s_geolocationPermission; +} + +GeolocationPermissionClientQt::GeolocationPermissionClientQt() +{ +} + +GeolocationPermissionClientQt::~GeolocationPermissionClientQt() +{ +} + +void GeolocationPermissionClientQt::requestGeolocationPermissionForFrame(QWebFrame* webFrame, Geolocation* listener) +{ + m_pendingPermissionRequests.insert(webFrame, listener); + + QWebPage* page = webFrame->page(); + emit page->featurePermissionRequested(webFrame, QWebPage::Geolocation); +} + + +void GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame(QWebFrame* webFrame, Geolocation* listener) +{ + m_pendingPermissionRequests.remove(webFrame); + + QWebPage* page = webFrame->page(); + emit page->featurePermissionRequestCanceled(webFrame, QWebPage::Geolocation); +} + +void GeolocationPermissionClientQt::setPermission(QWebFrame* webFrame, QWebPage::PermissionPolicy permission) +{ + if (!m_pendingPermissionRequests.contains(webFrame)) + return; + + Geolocation* listener = m_pendingPermissionRequests.value(webFrame); + + if (permission == QWebPage::PermissionGrantedByUser) + listener->setIsAllowed(true); + else if (permission == QWebPage::PermissionDeniedByUser) + listener->setIsAllowed(false); + else + return; + + m_pendingPermissionRequests.remove(webFrame); +} + +#endif // ENABLE(GEOLOCATION) +} diff --git a/Source/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h b/Source/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h new file mode 100644 index 0000000..abe9c76 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2010 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 GeolocationPermissionClientQt_h +#define GeolocationPermissionClientQt_h + +#include "Geolocation.h" +#include "qwebpage.h" + +#include <QHash> + +class QWebFrame; +class QWebPage; + +namespace WebCore { + +class GeolocationPermissionClientQt { +public: + GeolocationPermissionClientQt(); + ~GeolocationPermissionClientQt(); + + void requestGeolocationPermissionForFrame(QWebFrame*, Geolocation*); + void cancelGeolocationPermissionRequestForFrame(QWebFrame*, Geolocation*); + void setPermission(QWebFrame*, QWebPage::PermissionPolicy); + + static GeolocationPermissionClientQt* geolocationPermissionClient(); +private: + QHash<QWebFrame*, Geolocation*> m_pendingPermissionRequests; +}; + +} + +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp new file mode 100644 index 0000000..1b06e2e --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp @@ -0,0 +1,412 @@ +/* + * 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 "Frame.h" +#include "InspectorBackendDispatcher.h" +#include "InspectorController.h" +#include "InspectorFrontend.h" +#include "InspectorServerQt.h" +#include "NotImplemented.h" +#include "Page.h" +#include "PlatformString.h" +#include "ScriptDebugServer.h" +#include "qwebinspector.h" +#include "qwebinspector_p.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include "qwebview.h" +#include <QtCore/QCoreApplication> +#include <QtCore/QFile> +#include <QtCore/QSettings> +#include <QtCore/QVariant> + +namespace WebCore { + +static const QLatin1String settingStoragePrefix("Qt/QtWebKit/QWebInspector/"); +static const QLatin1String settingStorageTypeSuffix(".type"); + +static String variantToSetting(const QVariant& qvariant); +static QVariant settingToVariant(const String& value); + +class InspectorClientWebPage : public QWebPage { + Q_OBJECT + friend class InspectorClientQt; +public: + InspectorClientWebPage(QObject* parent = 0) + : QWebPage(parent) + { + connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), SLOT(javaScriptWindowObjectCleared())); + } + + QWebPage* createWindow(QWebPage::WebWindowType) + { + QWebView* view = new QWebView; + QWebPage* page = new QWebPage; + view->setPage(page); + view->setAttribute(Qt::WA_DeleteOnClose); + return page; + } + +public slots: + void javaScriptWindowObjectCleared() + { +#ifndef QT_NO_PROPERTIES + QVariant inspectorJavaScriptWindowObjects = property("_q_inspectorJavaScriptWindowObjects"); + if (!inspectorJavaScriptWindowObjects.isValid()) + return; + QMap<QString, QVariant> javaScriptNameObjectMap = inspectorJavaScriptWindowObjects.toMap(); + QWebFrame* frame = mainFrame(); + QMap<QString, QVariant>::const_iterator it = javaScriptNameObjectMap.constBegin(); + for ( ; it != javaScriptNameObjectMap.constEnd(); ++it) { + QString name = it.key(); + QVariant value = it.value(); + QObject* obj = value.value<QObject*>(); + frame->addToJavaScriptWindowObject(name, obj); + } +#endif + } +}; + +#if USE(V8) +static void ensureDebuggerScriptLoaded() +{ + static bool scriptLoaded = false; + if (scriptLoaded) + return; + + QFile debuggerScriptFile(":/webkit/inspector/DebuggerScript.js"); + if (debuggerScriptFile.open(QIODevice::ReadOnly)) { + QByteArray ba = debuggerScriptFile.readAll(); + ScriptDebugServer::shared().setDebuggerScriptSource(String(ba.constData(), ba.length())); + scriptLoaded = true; + } +} +#endif + +InspectorClientQt::InspectorClientQt(QWebPage* page) + : m_inspectedWebPage(page) + , m_frontendWebPage(0) + , m_frontendClient(0) +{ + InspectorServerQt* webInspectorServer = InspectorServerQt::server(); + if (webInspectorServer) + webInspectorServer->registerClient(this); +} + +void InspectorClientQt::inspectorDestroyed() +{ +#if ENABLE(INSPECTOR) + if (m_frontendClient) + m_frontendClient->inspectorClientDestroyed(); + + InspectorServerQt* webInspectorServer = InspectorServerQt::server(); + if (webInspectorServer) + webInspectorServer->unregisterClient(this); + + delete this; +#endif +} + + +void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController* inspectorController) +{ +#if ENABLE(INSPECTOR) +#if USE(V8) + ensureDebuggerScriptLoaded(); +#endif + + QWebView* inspectorView = new QWebView; + InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView); + inspectorView->setPage(inspectorPage); + + QWebInspector* inspector = m_inspectedWebPage->d->getOrCreateInspector(); + // Remote frontend was attached. + if (m_inspectedWebPage->d->inspector->d->remoteFrontend) + return; + + // This is a known hook that allows changing the default URL for the + // Web inspector. This is used for SDK purposes. Please keep this hook + // around and don't remove it. + // https://bugs.webkit.org/show_bug.cgi?id=35340 + QUrl inspectorUrl; +#ifndef QT_NO_PROPERTIES + inspectorUrl = inspector->property("_q_inspectorUrl").toUrl(); +#endif + if (!inspectorUrl.isValid()) + inspectorUrl = QUrl("qrc:/webkit/inspector/inspector.html"); + +#ifndef QT_NO_PROPERTIES + QVariant inspectorJavaScriptWindowObjects = inspector->property("_q_inspectorJavaScriptWindowObjects"); + if (inspectorJavaScriptWindowObjects.isValid()) + inspectorPage->setProperty("_q_inspectorJavaScriptWindowObjects", inspectorJavaScriptWindowObjects); +#endif + inspectorView->page()->mainFrame()->load(inspectorUrl); + m_inspectedWebPage->d->inspectorFrontend = inspectorView; + inspector->d->setFrontend(inspectorView); + + m_frontendClient = new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this); + inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(m_frontendClient); + m_frontendWebPage = inspectorPage; +#endif +} + +void InspectorClientQt::releaseFrontendPage() +{ + m_frontendWebPage = 0; + m_frontendClient = 0; +} + +void InspectorClientQt::attachAndReplaceRemoteFrontend(RemoteFrontendChannel* channel) +{ +#if ENABLE(INSPECTOR) + // Channel was allocated by InspectorServerQt. Here we transfer ownership to inspector. + m_inspectedWebPage->d->inspector->d->attachAndReplaceRemoteFrontend(channel); + m_inspectedWebPage->d->inspectorController()->connectFrontend(); +#endif +} + +void InspectorClientQt::detachRemoteFrontend() +{ +#if ENABLE(INSPECTOR) + m_inspectedWebPage->d->inspector->d->detachRemoteFrontend(); + m_inspectedWebPage->d->inspectorController()->disconnectFrontend(); +#endif +} + +void InspectorClientQt::highlight(Node*) +{ + notImplemented(); +} + +void InspectorClientQt::hideHighlight() +{ + notImplemented(); +} + +void InspectorClientQt::populateSetting(const String& key, String* setting) +{ +#ifdef QT_NO_SETTINGS + Q_UNUSED(key) + Q_UNUSED(setting) + qWarning("QWebInspector: QSettings is not supported by Qt."); +#else + QSettings qsettings; + if (qsettings.status() == QSettings::AccessError) { + // QCoreApplication::setOrganizationName and QCoreApplication::setApplicationName haven't been called + qWarning("QWebInspector: QSettings couldn't read configuration setting [%s].", + qPrintable(static_cast<QString>(key))); + return; + } + + QString settingKey(settingStoragePrefix + QString(key)); + QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString(); + QVariant storedValue = qsettings.value(settingKey); + storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data())); + *setting = variantToSetting(storedValue); +#endif // QT_NO_SETTINGS +} + +void InspectorClientQt::storeSetting(const String& key, const String& setting) +{ +#ifdef QT_NO_SETTINGS + Q_UNUSED(key) + Q_UNUSED(setting) + qWarning("QWebInspector: QSettings is not supported by Qt."); +#else + QSettings qsettings; + if (qsettings.status() == QSettings::AccessError) { + qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].", + qPrintable(static_cast<QString>(key))); + return; + } + + QVariant valueToStore = settingToVariant(setting); + QString settingKey(settingStoragePrefix + QString(key)); + qsettings.setValue(settingKey, valueToStore); + qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type())); +#endif // QT_NO_SETTINGS +} + +bool InspectorClientQt::sendMessageToFrontend(const String& message) +{ +#if ENABLE(INSPECTOR) + if (m_inspectedWebPage->d->inspector->d->remoteFrontend) { + RemoteFrontendChannel* session = qobject_cast<RemoteFrontendChannel*>(m_inspectedWebPage->d->inspector->d->remoteFrontend); + if (session) + session->sendMessageToFrontend(message); + return true; + } + if (!m_frontendWebPage) + return false; + + Page* frontendPage = QWebPagePrivate::core(m_frontendWebPage); + return doDispatchMessageOnFrontendPage(frontendPage, message); +#else + return false; +#endif +} + +static String variantToSetting(const QVariant& qvariant) +{ + String retVal; + + switch (qvariant.type()) { + case QVariant::Bool: + retVal = qvariant.toBool() ? "true" : "false"; + case QVariant::String: + retVal = qvariant.toString(); + default: + break; + } + + return retVal; +} + +static QVariant settingToVariant(const String& setting) +{ + QVariant retVal; + retVal.setValue(static_cast<QString>(setting)); + return retVal; +} + +#if ENABLE(INSPECTOR) +InspectorFrontendClientQt::InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView, InspectorClientQt* inspectorClient) + : InspectorFrontendClientLocal(inspectedWebPage->d->page->inspectorController(), inspectorView->page()->d->page) + , m_inspectedWebPage(inspectedWebPage) + , m_inspectorView(inspectorView) + , m_destroyingInspectorView(false) + , m_inspectorClient(inspectorClient) +{ +} + +InspectorFrontendClientQt::~InspectorFrontendClientQt() +{ + ASSERT(m_destroyingInspectorView); + if (m_inspectorClient) + m_inspectorClient->releaseFrontendPage(); +} + +void InspectorFrontendClientQt::frontendLoaded() +{ + InspectorFrontendClientLocal::frontendLoaded(); + setAttachedWindow(true); +} + +String InspectorFrontendClientQt::localizedStringsURL() +{ + notImplemented(); + return String(); +} + +String InspectorFrontendClientQt::hiddenPanels() +{ + notImplemented(); + return String(); +} + +void InspectorFrontendClientQt::bringToFront() +{ + updateWindowTitle(); +} + +void InspectorFrontendClientQt::closeWindow() +{ + destroyInspectorView(true); +} + +void InspectorFrontendClientQt::disconnectFromBackend() +{ + destroyInspectorView(false); +} + +void InspectorFrontendClientQt::attachWindow() +{ + notImplemented(); +} + +void InspectorFrontendClientQt::detachWindow() +{ + notImplemented(); +} + +void InspectorFrontendClientQt::setAttachedWindowHeight(unsigned) +{ + notImplemented(); +} + +void InspectorFrontendClientQt::inspectedURLChanged(const String& newURL) +{ + m_inspectedURL = newURL; + updateWindowTitle(); +} + +void InspectorFrontendClientQt::updateWindowTitle() +{ + if (m_inspectedWebPage->d->inspector) { + QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL); + m_inspectedWebPage->d->inspector->setWindowTitle(caption); + } +} + +void InspectorFrontendClientQt::destroyInspectorView(bool notifyInspectorController) +{ + if (m_destroyingInspectorView) + return; + m_destroyingInspectorView = true; + + // Inspected page may have already been destroyed. + if (m_inspectedWebPage) { + // Clear reference from QWebInspector to the frontend view. + m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(0); + } + +#if ENABLE(INSPECTOR) + if (notifyInspectorController) + m_inspectedWebPage->d->inspectorController()->disconnectFrontend(); +#endif + if (m_inspectorClient) + m_inspectorClient->releaseFrontendPage(); + + // Clear pointer before deleting WebView to avoid recursive calls to its destructor. + OwnPtr<QWebView> inspectorView = m_inspectorView.release(); +} + +void InspectorFrontendClientQt::inspectorClientDestroyed() +{ + m_inspectorClient = 0; + m_inspectedWebPage = 0; +} +#endif +} + +#include "InspectorClientQt.moc" diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h new file mode 100644 index 0000000..64a2d0c --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h @@ -0,0 +1,115 @@ +/* + * 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 "InspectorFrontendClientLocal.h" +#include "OwnPtr.h" +#include "PassOwnPtr.h" +#include <QtCore/QString> +#include <wtf/Forward.h> + +class QWebPage; +class QWebView; + +namespace WebCore { +class InspectorFrontendClientQt; +class InspectorServerRequestHandlerQt; +class Node; +class Page; +class RemoteFrontendChannel; + +class InspectorClientQt : public InspectorClient { +public: + InspectorClientQt(QWebPage*); + + virtual void inspectorDestroyed(); + + virtual void openInspectorFrontend(WebCore::InspectorController*); + + virtual void highlight(Node*); + virtual void hideHighlight(); + + virtual void populateSetting(const String& key, String* value); + virtual void storeSetting(const String& key, const String& value); + + virtual bool sendMessageToFrontend(const String&); + + void releaseFrontendPage(); + + void attachAndReplaceRemoteFrontend(RemoteFrontendChannel *channel); + void detachRemoteFrontend(); + +private: + QWebPage* m_inspectedWebPage; + QWebPage* m_frontendWebPage; + InspectorFrontendClientQt* m_frontendClient; + bool m_remoteInspector; + + friend class InspectorServerRequestHandlerQt; +}; + +class InspectorFrontendClientQt : public InspectorFrontendClientLocal { +public: + InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView, InspectorClientQt* inspectorClient); + virtual ~InspectorFrontendClientQt(); + + virtual void frontendLoaded(); + + virtual String localizedStringsURL(); + + virtual String hiddenPanels(); + + virtual void bringToFront(); + virtual void closeWindow(); + virtual void disconnectFromBackend(); + + virtual void attachWindow(); + virtual void detachWindow(); + + virtual void setAttachedWindowHeight(unsigned height); + + virtual void inspectedURLChanged(const String& newURL); + + void inspectorClientDestroyed(); + +private: + void updateWindowTitle(); + void destroyInspectorView(bool notifyInspectorController); + QWebPage* m_inspectedWebPage; + OwnPtr<QWebView> m_inspectorView; + QString m_inspectedURL; + bool m_destroyingInspectorView; + InspectorClientQt* m_inspectorClient; +}; +} + +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp new file mode 100644 index 0000000..7002dce --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp @@ -0,0 +1,389 @@ +/* + Copyright (C) 2010 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 "InspectorServerQt.h" + +#include "InspectorBackendDispatcher.h" +#include "InspectorClientQt.h" +#include "MD5.h" +#include "Page.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include <QFile> +#include <QHttpHeader> +#include <QHttpRequestHeader> +#include <QHttpResponseHeader> +#include <QString> +#include <QStringList> +#include <QTcpServer> +#include <QTcpSocket> +#include <QUrl> +#include <QWidget> +#include <qendian.h> +#include <wtf/text/CString.h> + +namespace WebCore { + +/*! + Computes the WebSocket handshake response given the two challenge numbers and key3. + */ +static void generateWebSocketChallengeResponse(uint32_t number1, uint32_t number2, const unsigned char key3[8], unsigned char response[16]) +{ + uint8_t challenge[16]; + qToBigEndian<qint32>(number1, &challenge[0]); + qToBigEndian<qint32>(number2, &challenge[4]); + memcpy(&challenge[8], key3, 8); + MD5 md5; + md5.addBytes(challenge, sizeof(challenge)); + Vector<uint8_t, 16> digest; + md5.checksum(digest); + memcpy(response, digest.data(), 16); +} + +/*! + Parses and returns a WebSocket challenge number according to the + method specified in the WebSocket protocol. + + The field contains numeric digits interspersed with spaces and + non-numeric digits. The protocol ignores the characters that are + neither digits nor spaces. The digits are concatenated and + interpreted as a long int. The result is this number divided by + the number of spaces. + */ +static quint32 parseWebSocketChallengeNumber(QString field) +{ + QString nString; + int numSpaces = 0; + for (int i = 0; i < field.size(); i++) { + QChar c = field[i]; + if (c == (QChar)' ') { + numSpaces++; + } else if ((c >= (QChar)'0') && (c <= (QChar)'9')) { + nString.append((QChar)c); + } + } + quint32 num = nString.toLong(); + quint32 result = (numSpaces ? (num / numSpaces) : num); + return result; +} + +static InspectorServerQt* s_inspectorServer; + +InspectorServerQt* InspectorServerQt::server() +{ + // s_inspectorServer is deleted in unregisterClient() when the last client is unregistered. + if (!s_inspectorServer) + s_inspectorServer = new InspectorServerQt(); + + return s_inspectorServer; +} + +InspectorServerQt::InspectorServerQt() + : QObject() + , m_tcpServer(0) + , m_pageNumber(1) +{ +} + +InspectorServerQt::~InspectorServerQt() +{ + close(); +} + +void InspectorServerQt::listen(quint16 port) +{ + if (m_tcpServer) + return; + + m_tcpServer = new QTcpServer(); + m_tcpServer->listen(QHostAddress::Any, port); + connect(m_tcpServer, SIGNAL(newConnection()), SLOT(newConnection())); +} + +void InspectorServerQt::close() +{ + if (m_tcpServer) { + m_tcpServer->close(); + delete m_tcpServer; + } + m_tcpServer = 0; +} + +InspectorClientQt* InspectorServerQt::inspectorClientForPage(int pageNum) +{ + InspectorClientQt* client = m_inspectorClients.value(pageNum); + return client; +} + +void InspectorServerQt::registerClient(InspectorClientQt* client) +{ + if (!m_inspectorClients.key(client)) + m_inspectorClients.insert(m_pageNumber++, client); +} + +void InspectorServerQt::unregisterClient(InspectorClientQt* client) +{ + int pageNum = m_inspectorClients.key(client, -1); + if (pageNum >= 0) + m_inspectorClients.remove(pageNum); + if (!m_inspectorClients.size()) { + // s_inspectorServer points to this. + s_inspectorServer = 0; + close(); + deleteLater(); + } +} + +void InspectorServerQt::newConnection() +{ + QTcpSocket* tcpConnection = m_tcpServer->nextPendingConnection(); + InspectorServerRequestHandlerQt* handler = new InspectorServerRequestHandlerQt(tcpConnection, this); + handler->setParent(this); +} + +InspectorServerRequestHandlerQt::InspectorServerRequestHandlerQt(QTcpSocket* tcpConnection, InspectorServerQt* server) + : QObject(server) + , m_tcpConnection(tcpConnection) + , m_server(server) + , m_inspectorClient(0) +{ + m_endOfHeaders = false; + m_contentLength = 0; + + connect(m_tcpConnection, SIGNAL(readyRead()), SLOT(tcpReadyRead())); + connect(m_tcpConnection, SIGNAL(disconnected()), SLOT(tcpConnectionDisconnected())); +} + +InspectorServerRequestHandlerQt::~InspectorServerRequestHandlerQt() +{ +} + +void InspectorServerRequestHandlerQt::tcpReadyRead() +{ + QHttpRequestHeader header; + bool isWebSocket = false; + if (!m_tcpConnection) + return; + + if (!m_endOfHeaders) { + while (m_tcpConnection->bytesAvailable() && !m_endOfHeaders) { + QByteArray line = m_tcpConnection->readLine(); + m_data.append(line); + if (line == "\r\n") + m_endOfHeaders = true; + } + if (m_endOfHeaders) { + header = QHttpRequestHeader(QString::fromLatin1(m_data)); + if (header.isValid()) { + m_path = header.path(); + m_contentType = header.contentType().toLatin1(); + m_contentLength = header.contentLength(); + if (header.hasKey("Upgrade") && (header.value("Upgrade") == QLatin1String("WebSocket"))) + isWebSocket = true; + + m_data.clear(); + } + } + } + + if (m_endOfHeaders) { + QStringList pathAndQuery = m_path.split("?"); + m_path = pathAndQuery[0]; + QStringList words = m_path.split(QString::fromLatin1("/")); + + if (isWebSocket) { + // switch to websocket-style WebSocketService messaging + if (m_tcpConnection) { + m_tcpConnection->disconnect(SIGNAL(readyRead())); + connect(m_tcpConnection, SIGNAL(readyRead()), SLOT(webSocketReadyRead())); + + QByteArray key3 = m_tcpConnection->read(8); + + quint32 number1 = parseWebSocketChallengeNumber(header.value("Sec-WebSocket-Key1")); + quint32 number2 = parseWebSocketChallengeNumber(header.value("Sec-WebSocket-Key2")); + + char responseData[16]; + generateWebSocketChallengeResponse(number1, number2, (unsigned char*)key3.data(), (unsigned char*)responseData); + QByteArray response(responseData, sizeof(responseData)); + + QHttpResponseHeader responseHeader(101, "WebSocket Protocol Handshake", 1, 1); + responseHeader.setValue("Upgrade", header.value("Upgrade")); + responseHeader.setValue("Connection", header.value("Connection")); + responseHeader.setValue("Sec-WebSocket-Origin", header.value("Origin")); + responseHeader.setValue("Sec-WebSocket-Location", ("ws://" + header.value("Host") + m_path)); + responseHeader.setContentLength(response.size()); + m_tcpConnection->write(responseHeader.toString().toLatin1()); + m_tcpConnection->write(response); + m_tcpConnection->flush(); + + if ((words.size() == 4) + && (words[1] == QString::fromLatin1("devtools")) + && (words[2] == QString::fromLatin1("page"))) { + int pageNum = words[3].toInt(); + + m_inspectorClient = m_server->inspectorClientForPage(pageNum); + // Attach remoteFrontendChannel to inspector, also transferring ownership. + if (m_inspectorClient) + m_inspectorClient->attachAndReplaceRemoteFrontend(new RemoteFrontendChannel(this)); + } + + } + + return; + } + if (m_contentLength && (m_tcpConnection->bytesAvailable() < m_contentLength)) + return; + + QByteArray content = m_tcpConnection->read(m_contentLength); + m_endOfHeaders = false; + + QByteArray response; + int code = 200; + QString text = QString::fromLatin1("OK"); + + // If no path is specified, generate an index page. + if ((m_path == "") || (m_path == "/")) { + QString indexHtml = "<html><head><title>Remote Web Inspector</title></head><body><ul>\n"; + for (QMap<int, InspectorClientQt* >::const_iterator it = m_server->m_inspectorClients.begin(); + it != m_server->m_inspectorClients.end(); + ++it) { + indexHtml.append(QString("<li><a href=\"/webkit/inspector/inspector.html?page=%1\">%2</li>\n") + .arg(it.key()) + .arg(it.value()->m_inspectedWebPage->mainFrame()->url().toString())); + } + indexHtml.append("</ul></body></html>"); + response = indexHtml.toLatin1(); + } else { + QString path = QString(":%1").arg(m_path); + QFile file(path); + // It seems that there should be an enum or define for these status codes somewhere in Qt or WebKit, + // but grep fails to turn one up. + // QNetwork uses the numeric values directly. + if (file.exists()) { + file.open(QIODevice::ReadOnly); + response = file.readAll(); + } else { + code = 404; + text = QString::fromLatin1("Not OK"); + } + } + + QHttpResponseHeader responseHeader(code, text, 1, 0); + responseHeader.setContentLength(response.size()); + if (!m_contentType.isEmpty()) + responseHeader.setContentType(QString::fromLatin1(m_contentType)); + + QByteArray asciiHeader = responseHeader.toString().toAscii(); + m_tcpConnection->write(asciiHeader); + + m_tcpConnection->write(response); + m_tcpConnection->flush(); + m_tcpConnection->close(); + + return; + } +} + +void InspectorServerRequestHandlerQt::tcpConnectionDisconnected() +{ + if (m_inspectorClient) + m_inspectorClient->detachRemoteFrontend(); + m_tcpConnection->deleteLater(); + m_tcpConnection = 0; +} + +int InspectorServerRequestHandlerQt::webSocketSend(QByteArray payload) +{ + Q_ASSERT(m_tcpConnection); + m_tcpConnection->putChar(0x00); + int nBytes = m_tcpConnection->write(payload); + m_tcpConnection->putChar(0xFF); + m_tcpConnection->flush(); + return nBytes; +} + +int InspectorServerRequestHandlerQt::webSocketSend(const char* data, size_t length) +{ + Q_ASSERT(m_tcpConnection); + m_tcpConnection->putChar(0x00); + int nBytes = m_tcpConnection->write(data, length); + m_tcpConnection->putChar(0xFF); + m_tcpConnection->flush(); + return nBytes; +} + +void InspectorServerRequestHandlerQt::webSocketReadyRead() +{ + Q_ASSERT(m_tcpConnection); + if (!m_tcpConnection->bytesAvailable()) + return; + QByteArray content = m_tcpConnection->read(m_tcpConnection->bytesAvailable()); + m_data.append(content); + while (m_data.size() > 0) { + // first byte in websocket frame should be 0 + Q_ASSERT(!m_data[0]); + + // Start of WebSocket frame is indicated by 0 + if (m_data[0]) { + qCritical() << "webSocketReadyRead: unknown frame type" << m_data[0]; + m_data.clear(); + m_tcpConnection->close(); + return; + } + + // End of WebSocket frame indicated by 0xff. + int pos = m_data.indexOf(0xff, 1); + if (pos < 1) + return; + + // After above checks, length will be >= 0. + size_t length = pos - 1; + if (length <= 0) + return; + + QByteArray payload = m_data.mid(1, length); + +#if ENABLE(INSPECTOR) + if (m_inspectorClient) { + InspectorController* inspectorController = m_inspectorClient->m_inspectedWebPage->d->page->inspectorController(); + inspectorController->inspectorBackendDispatcher()->dispatch(QString::fromUtf8(payload)); + } +#endif + + // Remove this WebSocket message from m_data (payload, start-of-frame byte, end-of-frame byte). + m_data = m_data.mid(length + 2); + } +} + +RemoteFrontendChannel::RemoteFrontendChannel(InspectorServerRequestHandlerQt* requestHandler) + : QObject(requestHandler) + , m_requestHandler(requestHandler) +{ +} + +bool RemoteFrontendChannel::sendMessageToFrontend(const String& message) +{ + if (!m_requestHandler) + return false; + CString cstr = message.utf8(); + return m_requestHandler->webSocketSend(cstr.data(), cstr.length()); +} + +} diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h new file mode 100644 index 0000000..922b63e --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.h @@ -0,0 +1,112 @@ +/* + Copyright (C) 2010 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 InspectorServerQt_h +#define InspectorServerQt_h + +#include <QList> +#include <QMap> +#include <QObject> +#include <QPair> +#include <QString> +#include <wtf/Forward.h> + +QT_BEGIN_NAMESPACE +class QTcpServer; +class QTcpSocket; +QT_END_NAMESPACE +class QWebPage; + +namespace WebCore { +class InspectorServerRequestHandlerQt; +class InspectorClientQt; + +class InspectorServerQt : public QObject { + Q_OBJECT +public: + + static InspectorServerQt* server(); + + void listen(quint16 port); + + void registerClient(InspectorClientQt* client); + void unregisterClient(InspectorClientQt* client); + + void close(); + InspectorClientQt* inspectorClientForPage(int pageNum); + +protected: + InspectorServerQt(); + virtual ~InspectorServerQt(); + +private slots: + void newConnection(); + +private: + QTcpServer* m_tcpServer; + QMap<int, InspectorClientQt*> m_inspectorClients; + int m_pageNumber; + + friend class InspectorServerRequestHandlerQt; +}; + +class RemoteFrontendChannel : public QObject { + Q_OBJECT +public: + + RemoteFrontendChannel(InspectorServerRequestHandlerQt* requestHandler); + bool sendMessageToFrontend(const String& message); + +private: + InspectorServerRequestHandlerQt* m_requestHandler; +}; + +class InspectorServerRequestHandlerQt : public QObject { + Q_OBJECT +public: + + InspectorServerRequestHandlerQt(QTcpSocket *tcpConnection, InspectorServerQt *server); + virtual ~InspectorServerRequestHandlerQt(); + virtual int webSocketSend(QByteArray payload); + virtual int webSocketSend(const char *payload, size_t length); + +private slots: + void tcpReadyRead(); + void tcpConnectionDisconnected(); + void webSocketReadyRead(); + +private: + QTcpSocket* m_tcpConnection; + InspectorServerQt* m_server; + + QString m_path; + QByteArray m_contentType; + int m_contentLength; + bool m_endOfHeaders; + QByteArray m_data; + InspectorClientQt* m_inspectorClient; + + void handleInspectorRequest(QStringList words); + void handleFromFrontendRequest(); + void handleResourceRequest(QStringList words); + +}; + +} +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp new file mode 100644 index 0000000..994cd85 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp @@ -0,0 +1,468 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "NotificationPresenterClientQt.h" + +#include "Document.h" +#include "DumpRenderTreeSupportQt.h" +#include "EventNames.h" +#include "KURL.h" +#include "Page.h" +#include "QtPlatformPlugin.h" +#include "ScriptExecutionContext.h" +#include "SecurityOrigin.h" +#include "UserGestureIndicator.h" + +#include "qwebframe_p.h" +#include "qwebkitglobal.h" +#include "qwebpage.h" + +namespace WebCore { + +#if ENABLE(NOTIFICATIONS) + +const double notificationTimeout = 10.0; + +bool NotificationPresenterClientQt::dumpNotification = false; + +NotificationPresenterClientQt* s_notificationPresenter = 0; + +NotificationPresenterClientQt* NotificationPresenterClientQt::notificationPresenter() +{ + if (s_notificationPresenter) + return s_notificationPresenter; + + s_notificationPresenter = new NotificationPresenterClientQt(); + return s_notificationPresenter; +} + +#endif + +NotificationWrapper::NotificationWrapper() + : m_closeTimer(this, &NotificationWrapper::close) +{ +#if ENABLE(NOTIFICATIONS) + +#ifndef QT_NO_SYSTEMTRAYICON + m_notificationIcon = 0; +#endif + m_presenter = 0; +#endif +} + +void NotificationWrapper::close(Timer<NotificationWrapper>*) +{ +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::notificationPresenter()->cancel(this); +#endif +} + +const QString NotificationWrapper::title() const +{ +#if ENABLE(NOTIFICATIONS) + Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); + if (notification) + return notification->contents().title(); +#endif + return QString(); +} + +const QString NotificationWrapper::message() const +{ +#if ENABLE(NOTIFICATIONS) + Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); + if (notification) + return notification->contents().body(); +#endif + return QString(); +} + +const QByteArray NotificationWrapper::iconData() const +{ + QByteArray iconData; +#if ENABLE(NOTIFICATIONS) + Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); + if (notification) { + if (notification->iconData()) + iconData = QByteArray::fromRawData(notification->iconData()->data(), notification->iconData()->size()); + } +#endif + return iconData; +} + +const QUrl NotificationWrapper::openerPageUrl() const +{ + QUrl url; +#if ENABLE(NOTIFICATIONS) + Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); + if (notification) { + if (notification->scriptExecutionContext()) + url = static_cast<Document*>(notification->scriptExecutionContext())->page()->mainFrame()->document()->url(); + } +#endif + return url; +} + +void NotificationWrapper::notificationClicked() +{ +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::notificationPresenter()->notificationClicked(this); +#endif +} + +void NotificationWrapper::notificationClosed() +{ +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::notificationPresenter()->cancel(this); +#endif +} + +#if ENABLE(NOTIFICATIONS) + +NotificationPresenterClientQt::NotificationPresenterClientQt() : m_clientCount(0) +{ +} + +NotificationPresenterClientQt::~NotificationPresenterClientQt() +{ + while (!m_notifications.isEmpty()) { + NotificationsQueue::Iterator iter = m_notifications.begin(); + detachNotification(iter.key()); + } +} + +void NotificationPresenterClientQt::removeClient() +{ + m_clientCount--; + if (!m_clientCount) { + s_notificationPresenter = 0; + delete this; + } +} + +bool NotificationPresenterClientQt::show(Notification* notification) +{ + // FIXME: workers based notifications are not supported yet. + if (notification->scriptExecutionContext()->isWorkerContext()) + return false; + notification->setPendingActivity(notification); + if (!notification->replaceId().isEmpty()) + removeReplacedNotificationFromQueue(notification); + if (dumpNotification) + dumpShowText(notification); + QByteArray iconData; + if (notification->iconData()) + iconData = QByteArray::fromRawData(notification->iconData()->data(), notification->iconData()->size()); + displayNotification(notification, iconData); + notification->releaseIconData(); + return true; +} + +void NotificationPresenterClientQt::displayNotification(Notification* notification, const QByteArray& bytes) +{ + NotificationWrapper* wrapper = new NotificationWrapper(); + m_notifications.insert(notification, wrapper); + QString title; + QString message; + // FIXME: download & display HTML notifications + if (notification->isHTML()) + message = notification->url().string(); + else { + title = notification->contents().title(); + message = notification->contents().body(); + } + + if (m_platformPlugin.plugin() && m_platformPlugin.plugin()->supportsExtension(QWebKitPlatformPlugin::Notifications)) + wrapper->m_presenter = m_platformPlugin.createNotificationPresenter(); + + if (!wrapper->m_presenter) { +#ifndef QT_NO_SYSTEMTRAYICON + if (!dumpNotification) + wrapper->m_closeTimer.startOneShot(notificationTimeout); + QPixmap pixmap; + if (bytes.length() && pixmap.loadFromData(bytes)) { + QIcon icon(pixmap); + wrapper->m_notificationIcon = new QSystemTrayIcon(icon); + } else + wrapper->m_notificationIcon = new QSystemTrayIcon(); +#endif + } + + sendEvent(notification, "display"); + + // Make sure the notification was not cancelled during handling the display event + if (m_notifications.find(notification) == m_notifications.end()) + return; + + if (wrapper->m_presenter) { + wrapper->connect(wrapper->m_presenter.get(), SIGNAL(notificationClosed()), wrapper, SLOT(notificationClosed()), Qt::QueuedConnection); + wrapper->connect(wrapper->m_presenter.get(), SIGNAL(notificationClicked()), wrapper, SLOT(notificationClicked())); + wrapper->m_presenter->showNotification(wrapper); + return; + } + +#ifndef QT_NO_SYSTEMTRAYICON + wrapper->connect(wrapper->m_notificationIcon.get(), SIGNAL(messageClicked()), wrapper, SLOT(notificationClicked())); + wrapper->m_notificationIcon->show(); + wrapper->m_notificationIcon->showMessage(notification->contents().title(), notification->contents().body()); +#endif +} + +void NotificationPresenterClientQt::cancel(Notification* notification) +{ + if (dumpNotification && notification->scriptExecutionContext()) { + if (notification->isHTML()) + printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->url().string()).toUtf8().constData()); + else + printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->contents().title()).toUtf8().constData()); + } + + NotificationsQueue::Iterator iter = m_notifications.find(notification); + if (iter != m_notifications.end()) { + sendEvent(notification, eventNames().closeEvent); + detachNotification(notification); + } +} + +void NotificationPresenterClientQt::cancel(NotificationWrapper* wrapper) +{ + Notification* notification = notificationForWrapper(wrapper); + if (notification) + cancel(notification); +} + +void NotificationPresenterClientQt::notificationClicked(NotificationWrapper* wrapper) +{ + Notification* notification = notificationForWrapper(wrapper); + if (notification) { + // Make sure clicks on notifications are treated as user gestures. + UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); + sendEvent(notification, eventNames().clickEvent); + } +} + +void NotificationPresenterClientQt::notificationClicked(const QString& title) +{ + if (!dumpNotification) + return; + NotificationsQueue::ConstIterator end = m_notifications.end(); + NotificationsQueue::ConstIterator iter = m_notifications.begin(); + Notification* notification = 0; + while (iter != end) { + notification = iter.key(); + QString notificationTitle; + if (notification->isHTML()) + notificationTitle = notification->url().string(); + else + notificationTitle = notification->contents().title(); + if (notificationTitle == title) + break; + iter++; + } + if (notification) + sendEvent(notification, eventNames().clickEvent); +} + +Notification* NotificationPresenterClientQt::notificationForWrapper(const NotificationWrapper* wrapper) const +{ + NotificationsQueue::ConstIterator end = m_notifications.end(); + NotificationsQueue::ConstIterator iter = m_notifications.begin(); + while (iter != end && iter.value() != wrapper) + iter++; + if (iter != end) + return iter.key(); + return 0; +} + +void NotificationPresenterClientQt::notificationObjectDestroyed(Notification* notification) +{ + // Called from ~Notification(), Remove the entry from the notifications list and delete the icon. + NotificationsQueue::Iterator iter = m_notifications.find(notification); + if (iter != m_notifications.end()) + delete m_notifications.take(notification); +} + +void NotificationPresenterClientQt::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback) +{ + if (dumpNotification) + printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", QString(context->securityOrigin()->toString()).toUtf8().constData()); + + QHash<ScriptExecutionContext*, CallbacksInfo >::iterator iter = m_pendingPermissionRequests.find(context); + if (iter != m_pendingPermissionRequests.end()) + iter.value().m_callbacks.append(callback); + else { + RefPtr<VoidCallback> cb = callback; + CallbacksInfo info; + info.m_frame = toFrame(context); + info.m_callbacks.append(cb); + m_pendingPermissionRequests.insert(context, info); + + if (toPage(context) && toFrame(context)) { + m_pendingPermissionRequests.insert(context, info); + emit toPage(context)->featurePermissionRequested(toFrame(context), QWebPage::Notifications); + } + } +} + +NotificationPresenter::Permission NotificationPresenterClientQt::checkPermission(ScriptExecutionContext* context) +{ + return m_cachedPermissions.value(context, NotificationPresenter::PermissionNotAllowed); +} + +void NotificationPresenterClientQt::cancelRequestsForPermission(ScriptExecutionContext* context) +{ + m_cachedPermissions.remove(context); + + QHash<ScriptExecutionContext*, CallbacksInfo >::iterator iter = m_pendingPermissionRequests.find(context); + if (iter == m_pendingPermissionRequests.end()) + return; + + QWebFrame* frame = iter.value().m_frame; + if (!frame) + return; + QWebPage* page = frame->page(); + m_pendingPermissionRequests.erase(iter); + + if (!page) + return; + + if (dumpNotification) + printf("DESKTOP NOTIFICATION PERMISSION REQUEST CANCELLED: %s\n", QString(context->securityOrigin()->toString()).toUtf8().constData()); + + emit page->featurePermissionRequestCanceled(frame, QWebPage::Notifications); +} + +void NotificationPresenterClientQt::allowNotificationForFrame(Frame* frame) +{ + m_cachedPermissions.insert(frame->document(), NotificationPresenter::PermissionAllowed); + + QHash<ScriptExecutionContext*, CallbacksInfo>::iterator iter = m_pendingPermissionRequests.begin(); + while (iter != m_pendingPermissionRequests.end()) { + if (iter.key() == frame->document()) + break; + } + + if (iter == m_pendingPermissionRequests.end()) + return; + + QList<RefPtr<VoidCallback> >& callbacks = iter.value().m_callbacks; + for (int i = 0; i < callbacks.size(); i++) + callbacks.at(i)->handleEvent(); + m_pendingPermissionRequests.remove(iter.key()); +} + +void NotificationPresenterClientQt::sendEvent(Notification* notification, const AtomicString& eventName) +{ + if (notification->scriptExecutionContext()) + notification->dispatchEvent(Event::create(eventName, false, true)); +} + +void NotificationPresenterClientQt::removeReplacedNotificationFromQueue(Notification* notification) +{ + Notification* oldNotification = 0; + NotificationsQueue::Iterator end = m_notifications.end(); + NotificationsQueue::Iterator iter = m_notifications.begin(); + + while (iter != end) { + Notification* existingNotification = iter.key(); + if (existingNotification->replaceId() == notification->replaceId() && existingNotification->url().protocol() == notification->url().protocol() && existingNotification->url().host() == notification->url().host()) { + oldNotification = iter.key(); + break; + } + iter++; + } + + if (oldNotification) { + if (dumpNotification) + dumpReplacedIdText(oldNotification); + sendEvent(oldNotification, eventNames().closeEvent); + detachNotification(oldNotification); + } +} + +void NotificationPresenterClientQt::detachNotification(Notification* notification) +{ + delete m_notifications.take(notification); + notification->detachPresenter(); + notification->unsetPendingActivity(notification); +} + +void NotificationPresenterClientQt::dumpReplacedIdText(Notification* notification) +{ + if (notification) + printf("REPLACING NOTIFICATION %s\n", notification->isHTML() ? QString(notification->url().string()).toUtf8().constData() : QString(notification->contents().title()).toUtf8().constData()); +} + +void NotificationPresenterClientQt::dumpShowText(Notification* notification) +{ + if (notification->isHTML()) + printf("DESKTOP NOTIFICATION: contents at %s\n", QString(notification->url().string()).toUtf8().constData()); + else { + printf("DESKTOP NOTIFICATION:%s icon %s, title %s, text %s\n", + notification->dir() == "rtl" ? "(RTL)" : "", + QString(notification->contents().icon().string()).toUtf8().constData(), QString(notification->contents().title()).toUtf8().constData(), + QString(notification->contents().body()).toUtf8().constData()); + } +} + +QWebPage* NotificationPresenterClientQt::toPage(ScriptExecutionContext* context) +{ + if (!context || context->isWorkerContext()) + return 0; + + Document* document = static_cast<Document*>(context); + if (!document) + return 0; + + Page* page = document->page(); + if (!page || !page->mainFrame()) + return 0; + + return QWebFramePrivate::kit(page->mainFrame())->page(); +} + +QWebFrame* NotificationPresenterClientQt::toFrame(ScriptExecutionContext* context) +{ + if (!context || context->isWorkerContext()) + return 0; + + Document* document = static_cast<Document*>(context); + if (!document || !document->frame()) + return 0; + + return QWebFramePrivate::kit(document->frame()); +} + +#endif // ENABLE(NOTIFICATIONS) +} + +#include "moc_NotificationPresenterClientQt.cpp" diff --git a/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h new file mode 100644 index 0000000..a501247 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 NotificationPresenterClientQt_h +#define NotificationPresenterClientQt_h + +#include "Notification.h" +#include "NotificationPresenter.h" +#include "QtPlatformPlugin.h" +#include "Timer.h" + +#include "qwebkitplatformplugin.h" + +#include <QMultiHash> +#include <QSystemTrayIcon> + +class QWebFrame; +class QWebPage; + +namespace WebCore { + +class Document; +class Frame; +class ScriptExecutionContext; + +class NotificationWrapper : public QObject, public QWebNotificationData { + Q_OBJECT +public: + NotificationWrapper(); + ~NotificationWrapper() {} + + void close(); + void close(Timer<NotificationWrapper>*); + const QString title() const; + const QString message() const; + const QByteArray iconData() const; + const QUrl openerPageUrl() const; + +public Q_SLOTS: + void notificationClosed(); + void notificationClicked(); + +public: +#ifndef QT_NO_SYSTEMTRAYICON + OwnPtr<QSystemTrayIcon> m_notificationIcon; +#endif + + OwnPtr<QWebNotificationPresenter> m_presenter; + Timer<NotificationWrapper> m_closeTimer; +}; + +#if ENABLE(NOTIFICATIONS) + +typedef QHash <Notification*, NotificationWrapper*> NotificationsQueue; + +class NotificationPresenterClientQt : public NotificationPresenter { +public: + NotificationPresenterClientQt(); + ~NotificationPresenterClientQt(); + + /* WebCore::NotificationPresenter interface */ + virtual bool show(Notification*); + virtual void cancel(Notification*); + virtual void notificationObjectDestroyed(Notification*); + virtual void requestPermission(ScriptExecutionContext*, PassRefPtr<VoidCallback>); + virtual NotificationPresenter::Permission checkPermission(ScriptExecutionContext*); + virtual void cancelRequestsForPermission(ScriptExecutionContext*); + + void cancel(NotificationWrapper*); + + void allowNotificationForFrame(Frame*); + + static bool dumpNotification; + + void addClient() { m_clientCount++; } + void removeClient(); + static NotificationPresenterClientQt* notificationPresenter(); + + Notification* notificationForWrapper(const NotificationWrapper*) const; + void notificationClicked(NotificationWrapper*); + void notificationClicked(const QString& title); + +private: + void sendEvent(Notification*, const AtomicString& eventName); + void displayNotification(Notification*, const QByteArray&); + void removeReplacedNotificationFromQueue(Notification*); + void detachNotification(Notification*); + void dumpReplacedIdText(Notification*); + void dumpShowText(Notification*); + QWebPage* toPage(ScriptExecutionContext*); + QWebFrame* toFrame(ScriptExecutionContext*); + + int m_clientCount; + struct CallbacksInfo { + QWebFrame* m_frame; + QList<RefPtr<VoidCallback> > m_callbacks; + }; + QHash<ScriptExecutionContext*, CallbacksInfo > m_pendingPermissionRequests; + QHash<ScriptExecutionContext*, NotificationPresenter::Permission> m_cachedPermissions; + + NotificationsQueue m_notifications; + QtPlatformPlugin m_platformPlugin; +}; + +#endif + +} + +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp new file mode 100644 index 0000000..c3869c5 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp @@ -0,0 +1,483 @@ +/* + * Copyright (C) 2010 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 "PageClientQt.h" +#include "TextureMapperQt.h" +#include "texmap/TextureMapperPlatformLayer.h" +#include <QGraphicsScene> +#include <QGraphicsView> +#if defined(Q_WS_X11) +#include <QX11Info> +#endif + +#ifdef QT_OPENGL_LIB +#include "opengl/TextureMapperGL.h" +#include <QGLWidget> +#endif + +namespace WebCore { + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) +class PlatformLayerProxyQt : public QObject, public virtual TextureMapperLayerClient { +public: + PlatformLayerProxyQt(QWebFrame* frame, TextureMapperContentLayer* layer, QObject* object) + : QObject(object) + , m_frame(frame) + , m_layer(layer) + { + if (m_layer) + m_layer->setPlatformLayerClient(this); + m_frame->d->rootGraphicsLayer = m_layer; + } + + void setTextureMapper(PassOwnPtr<TextureMapper> textureMapper) + { + m_frame->d->textureMapper = textureMapper; + } + + virtual ~PlatformLayerProxyQt() + { + if (m_layer) + m_layer->setPlatformLayerClient(0); + if (m_frame->d) + m_frame->d->rootGraphicsLayer = 0; + } + + virtual TextureMapper* textureMapper() + { + return m_frame->d->textureMapper.get(); + } + + // Since we just paint the composited tree and never create a special item for it, we don't have to handle its size changes. + void setSizeChanged(const IntSize&) { } + +private: + QWebFrame* m_frame; + TextureMapperContentLayer* m_layer; +}; + +class PlatformLayerProxyQWidget : public PlatformLayerProxyQt { +public: + PlatformLayerProxyQWidget(QWebFrame* frame, TextureMapperContentLayer* layer, QWidget* widget) + : PlatformLayerProxyQt(frame, layer, widget) + , m_widget(widget) + { + if (m_widget) + m_widget->installEventFilter(this); + + if (textureMapper()) + return; + + setTextureMapper(TextureMapperQt::create()); + } + + // We don't want a huge region-clip on the compositing layers; instead we unite the rectangles together + // and clear them when the paint actually occurs. + bool eventFilter(QObject* object, QEvent* event) + { + if (object == m_widget && event->type() == QEvent::Paint) + m_dirtyRect = QRect(); + return QObject::eventFilter(object, event); + } + + void setNeedsDisplay() + { + if (m_widget) + m_widget->update(); + } + + void setNeedsDisplayInRect(const IntRect& rect) + { + m_dirtyRect |= rect; + m_widget->update(m_dirtyRect); + } + +private: + QRect m_dirtyRect; + QWidget* m_widget; +}; + +#if !defined(QT_NO_GRAPHICSVIEW) +class PlatformLayerProxyQGraphicsObject : public PlatformLayerProxyQt { +public: + PlatformLayerProxyQGraphicsObject(QWebFrame* frame, TextureMapperContentLayer* layer, QGraphicsObject* object) + : PlatformLayerProxyQt(frame, layer, object) + , m_graphicsItem(object) + { + if (textureMapper()) + return; + +#ifdef QT_OPENGL_LIB + QGraphicsView* view = object->scene()->views()[0]; + if (view && view->viewport() && view->viewport()->inherits("QGLWidget")) { + setTextureMapper(TextureMapperGL::create()); + return; + } +#endif + setTextureMapper(TextureMapperQt::create()); + } + + void setNeedsDisplay() + { + if (m_graphicsItem) + m_graphicsItem->update(); + } + + void setNeedsDisplayInRect(const IntRect& rect) + { + if (m_graphicsItem) + m_graphicsItem->update(QRectF(rect)); + } + +private: + QGraphicsItem* m_graphicsItem; +}; +#endif // QT_NO_GRAPHICSVIEW + +void PageClientQWidget::setRootGraphicsLayer(TextureMapperPlatformLayer* layer) +{ + if (layer) { + platformLayerProxy = new PlatformLayerProxyQWidget(page->mainFrame(), static_cast<TextureMapperContentLayer*>(layer), view); + return; + } + delete platformLayerProxy; + platformLayerProxy = 0; +} + +void PageClientQWidget::markForSync(bool scheduleSync) +{ + syncTimer.startOneShot(0); +} + +void PageClientQWidget::syncLayers(Timer<PageClientQWidget>*) +{ + QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive(); +} +#endif + +void PageClientQWidget::scroll(int dx, int dy, const QRect& rectToScroll) +{ + view->scroll(qreal(dx), qreal(dy), rectToScroll); +} + +void PageClientQWidget::update(const QRect & dirtyRect) +{ + view->update(dirtyRect); +} + +void PageClientQWidget::setInputMethodEnabled(bool enable) +{ + view->setAttribute(Qt::WA_InputMethodEnabled, enable); +} + +bool PageClientQWidget::inputMethodEnabled() const +{ + return view->testAttribute(Qt::WA_InputMethodEnabled); +} + +void PageClientQWidget::setInputMethodHints(Qt::InputMethodHints hints) +{ + view->setInputMethodHints(hints); +} + +PageClientQWidget::~PageClientQWidget() +{ +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + delete platformLayerProxy; +#endif +} + +#ifndef QT_NO_CURSOR +QCursor PageClientQWidget::cursor() const +{ + return view->cursor(); +} + +void PageClientQWidget::updateCursor(const QCursor& cursor) +{ + view->setCursor(cursor); +} +#endif + +QPalette PageClientQWidget::palette() const +{ + return view->palette(); +} + +int PageClientQWidget::screenNumber() const +{ +#if defined(Q_WS_X11) + return view->x11Info().screen(); +#endif + return 0; +} + +QWidget* PageClientQWidget::ownerWidget() const +{ + return view; +} + +QRect PageClientQWidget::geometryRelativeToOwnerWidget() const +{ + return view->geometry(); +} + +QObject* PageClientQWidget::pluginParent() const +{ + return view; +} + +QStyle* PageClientQWidget::style() const +{ + return view->style(); +} + +QRectF PageClientQWidget::windowRect() const +{ + return QRectF(view->window()->geometry()); +} + +#if !defined(QT_NO_GRAPHICSVIEW) +PageClientQGraphicsWidget::~PageClientQGraphicsWidget() +{ + delete overlay; +#if USE(ACCELERATED_COMPOSITING) +#if USE(TEXTURE_MAPPER) + delete platformLayerProxy; +#else + if (!rootGraphicsLayer) + return; + // we don't need to delete the root graphics layer. The lifecycle is managed in GraphicsLayerQt.cpp. + rootGraphicsLayer.data()->setParentItem(0); + view->scene()->removeItem(rootGraphicsLayer.data()); +#endif +#endif +} + +void PageClientQGraphicsWidget::scroll(int dx, int dy, const QRect& rectToScroll) +{ + view->scroll(qreal(dx), qreal(dy), rectToScroll); +} + +void PageClientQGraphicsWidget::update(const QRect& dirtyRect) +{ + view->update(dirtyRect); + + createOrDeleteOverlay(); + if (overlay) + overlay->update(QRectF(dirtyRect)); +#if USE(ACCELERATED_COMPOSITING) + syncLayers(); +#endif +} + +void PageClientQGraphicsWidget::createOrDeleteOverlay() +{ + // We don't use an overlay with TextureMapper. Instead, the overlay is drawn inside QWebFrame. +#if !USE(TEXTURE_MAPPER) + bool useOverlay = false; + if (!viewResizesToContents) { +#if USE(ACCELERATED_COMPOSITING) + useOverlay = useOverlay || rootGraphicsLayer; +#endif +#if ENABLE(TILED_BACKING_STORE) + useOverlay = useOverlay || QWebFramePrivate::core(page->mainFrame())->tiledBackingStore(); +#endif + } + if (useOverlay == !!overlay) + return; + + if (useOverlay) { + overlay = new QGraphicsItemOverlay(view, page); + overlay->setZValue(OverlayZValue); + } else { + // Changing the overlay might be done inside paint events. + overlay->deleteLater(); + overlay = 0; + } +#endif // !USE(TEXTURE_MAPPER) +} + +#if USE(ACCELERATED_COMPOSITING) +void PageClientQGraphicsWidget::syncLayers() +{ + if (shouldSync) { + QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive(); + shouldSync = false; + } +} + +#if USE(TEXTURE_MAPPER) +void PageClientQGraphicsWidget::setRootGraphicsLayer(TextureMapperPlatformLayer* layer) +{ + if (layer) { + platformLayerProxy = new PlatformLayerProxyQGraphicsObject(page->mainFrame(), static_cast<TextureMapperContentLayer*>(layer), view); + return; + } + delete platformLayerProxy; + platformLayerProxy = 0; +} +#else +void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsObject* layer) +{ + if (rootGraphicsLayer) { + rootGraphicsLayer.data()->setParentItem(0); + view->scene()->removeItem(rootGraphicsLayer.data()); + QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive(); + } + + rootGraphicsLayer = layer; + + if (layer) { + layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); + layer->setParentItem(view); + layer->setZValue(RootGraphicsLayerZValue); + } + createOrDeleteOverlay(); +} +#endif + +void PageClientQGraphicsWidget::markForSync(bool scheduleSync) +{ + shouldSync = true; + if (scheduleSync) + syncMetaMethod.invoke(view, Qt::QueuedConnection); +} + +#endif + +#if ENABLE(TILED_BACKING_STORE) +void PageClientQGraphicsWidget::updateTiledBackingStoreScale() +{ + WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore(); + if (!backingStore) + return; + backingStore->setContentsScale(view->scale()); +} +#endif + +void PageClientQGraphicsWidget::setInputMethodEnabled(bool enable) +{ + view->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable); +} + +bool PageClientQGraphicsWidget::inputMethodEnabled() const +{ + return view->flags() & QGraphicsItem::ItemAcceptsInputMethod; +} + +void PageClientQGraphicsWidget::setInputMethodHints(Qt::InputMethodHints hints) +{ + view->setInputMethodHints(hints); +} + +#ifndef QT_NO_CURSOR +QCursor PageClientQGraphicsWidget::cursor() const +{ + return view->cursor(); +} + +void PageClientQGraphicsWidget::updateCursor(const QCursor& cursor) +{ + view->setCursor(cursor); +} +#endif + +QPalette PageClientQGraphicsWidget::palette() const +{ + return view->palette(); +} + +int PageClientQGraphicsWidget::screenNumber() const +{ +#if defined(Q_WS_X11) + if (QGraphicsScene* scene = view->scene()) { + const QList<QGraphicsView*> views = scene->views(); + + if (!views.isEmpty()) + return views.at(0)->x11Info().screen(); + } +#endif + + return 0; +} + +QWidget* PageClientQGraphicsWidget::ownerWidget() const +{ + if (QGraphicsScene* scene = view->scene()) { + const QList<QGraphicsView*> views = scene->views(); + return views.value(0); + } + return 0; +} + +QRect PageClientQGraphicsWidget::geometryRelativeToOwnerWidget() const +{ + if (!view->scene()) + return QRect(); + + QList<QGraphicsView*> views = view->scene()->views(); + if (views.isEmpty()) + return QRect(); + + QGraphicsView* graphicsView = views.at(0); + return graphicsView->mapFromScene(view->boundingRect()).boundingRect(); +} + +#if ENABLE(TILED_BACKING_STORE) +QRectF PageClientQGraphicsWidget::graphicsItemVisibleRect() const +{ + if (!view->scene()) + return QRectF(); + + QList<QGraphicsView*> views = view->scene()->views(); + if (views.isEmpty()) + return QRectF(); + + QGraphicsView* graphicsView = views.at(0); + int xOffset = graphicsView->horizontalScrollBar()->value(); + int yOffset = graphicsView->verticalScrollBar()->value(); + return view->mapRectFromScene(QRectF(QPointF(xOffset, yOffset), graphicsView->viewport()->size())); +} +#endif + +QObject* PageClientQGraphicsWidget::pluginParent() const +{ + return view; +} + +QStyle* PageClientQGraphicsWidget::style() const +{ + return view->style(); +} + +QRectF PageClientQGraphicsWidget::windowRect() const +{ + if (!view->scene()) + return QRectF(); + + // The sceneRect is a good approximation of the size of the application, independent of the view. + return view->scene()->sceneRect(); +} +#endif // QT_NO_GRAPHICSVIEW + +} // namespace WebCore diff --git a/Source/WebKit/qt/WebCoreSupport/PageClientQt.h b/Source/WebKit/qt/WebCoreSupport/PageClientQt.h new file mode 100644 index 0000000..16bb50c --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/PageClientQt.h @@ -0,0 +1,239 @@ +/* + * Copyright (C) 2010 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 PageClientQt_h +#define PageClientQt_h + +#include "FrameView.h" +#include "GraphicsContext.h" +#include "IntRect.h" +#include "QWebPageClient.h" +#include "TiledBackingStore.h" +#include "qgraphicswebview.h" +#include "qwebframe.h" +#include "qwebframe_p.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include <QtCore/qmetaobject.h> +#include <QtGui/qgraphicsscene.h> +#include <QtGui/qgraphicsview.h> +#include <QtGui/qgraphicswidget.h> +#include <QtGui/qscrollbar.h> +#include <QtGui/qstyleoption.h> +#include <QtGui/qwidget.h> + +#include <Settings.h> + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) +#include "texmap/TextureMapperPlatformLayer.h" +#endif + +namespace WebCore { + +class PageClientQWidget : public QWebPageClient { +public: + PageClientQWidget(QWidget* newView, QWebPage* newPage) + : view(newView) + , page(newPage) +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + , syncTimer(this, &PageClientQWidget::syncLayers) + , platformLayerProxy(0) +#endif + { + Q_ASSERT(view); + } + virtual ~PageClientQWidget(); + + virtual bool isQWidgetClient() const { return true; } + + virtual void scroll(int dx, int dy, const QRect&); + virtual void update(const QRect& dirtyRect); + virtual void setInputMethodEnabled(bool enable); + virtual bool inputMethodEnabled() const; + virtual void setInputMethodHints(Qt::InputMethodHints hints); + +#ifndef QT_NO_CURSOR + virtual QCursor cursor() const; + virtual void updateCursor(const QCursor& cursor); +#endif + + virtual QPalette palette() const; + virtual int screenNumber() const; + virtual QWidget* ownerWidget() const; + virtual QRect geometryRelativeToOwnerWidget() const; + + virtual QObject* pluginParent() const; + + virtual QStyle* style() const; + + virtual bool viewResizesToContentsEnabled() const { return false; } + + virtual QRectF windowRect() const; + + QWidget* view; + QWebPage* page; + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + virtual void setRootGraphicsLayer(TextureMapperPlatformLayer* layer); + virtual void markForSync(bool scheduleSync); + void syncLayers(Timer<PageClientQWidget>*); +#endif + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + virtual bool allowsAcceleratedCompositing() const { return true; } +#else + virtual bool allowsAcceleratedCompositing() const { return false; } +#endif + +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + Timer<PageClientQWidget> syncTimer; + PlatformLayerProxyQt* platformLayerProxy; +#endif +}; + +#if !defined(QT_NO_GRAPHICSVIEW) +// the overlay is here for one reason only: to have the scroll-bars and other +// extra UI elements appear on top of any QGraphicsItems created by CSS compositing layers +class QGraphicsItemOverlay : public QGraphicsObject { + public: + QGraphicsItemOverlay(QGraphicsWidget* view, QWebPage* p) + :QGraphicsObject(view) + , q(view) + , page(p) + { + setPos(0, 0); + setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); + setCacheMode(QGraphicsItem::DeviceCoordinateCache); + } + + QRectF boundingRect() const + { + return q->boundingRect(); + } + + void paint(QPainter* painter, const QStyleOptionGraphicsItem* options, QWidget*) + { + page->mainFrame()->render(painter, static_cast<QWebFrame::RenderLayer>(QWebFrame::AllLayers&(~QWebFrame::ContentsLayer)), options->exposedRect.toRect()); + } + + void prepareGraphicsItemGeometryChange() + { + prepareGeometryChange(); + } + + QGraphicsWidget* q; + QWebPage* page; +}; + + +class PageClientQGraphicsWidget : public QWebPageClient { +public: + PageClientQGraphicsWidget(QGraphicsWebView* newView, QWebPage* newPage) + : view(newView) + , page(newPage) + , viewResizesToContents(false) +#if USE(ACCELERATED_COMPOSITING) +#if USE(TEXTURE_MAPPER) + , platformLayerProxy(0) +#endif + , shouldSync(false) +#endif + , overlay(0) + { + Q_ASSERT(view); +#if USE(ACCELERATED_COMPOSITING) + // the overlay and stays alive for the lifetime of + // this QGraphicsWebView as the scrollbars are needed when there's no compositing + view->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); + syncMetaMethod = view->metaObject()->method(view->metaObject()->indexOfMethod("syncLayers()")); +#endif + } + + virtual ~PageClientQGraphicsWidget(); + + virtual bool isQWidgetClient() const { return false; } + + virtual void scroll(int dx, int dy, const QRect&); + virtual void update(const QRect& dirtyRect); + virtual void setInputMethodEnabled(bool enable); + virtual bool inputMethodEnabled() const; + virtual void setInputMethodHints(Qt::InputMethodHints hints); + +#ifndef QT_NO_CURSOR + virtual QCursor cursor() const; + virtual void updateCursor(const QCursor& cursor); +#endif + + virtual QPalette palette() const; + virtual int screenNumber() const; + virtual QWidget* ownerWidget() const; + virtual QRect geometryRelativeToOwnerWidget() const; + + virtual QObject* pluginParent() const; + + virtual QStyle* style() const; + + virtual bool viewResizesToContentsEnabled() const { return viewResizesToContents; } + + void createOrDeleteOverlay(); + +#if ENABLE(TILED_BACKING_STORE) + void updateTiledBackingStoreScale(); + virtual QRectF graphicsItemVisibleRect() const; +#endif + +#if USE(ACCELERATED_COMPOSITING) + virtual void setRootGraphicsLayer(PlatformLayer* layer); + virtual void markForSync(bool scheduleSync); + void syncLayers(); + + // QGraphicsWebView can render composited layers + virtual bool allowsAcceleratedCompositing() const { return true; } +#endif + + virtual QRectF windowRect() const; + + QGraphicsWebView* view; + QWebPage* page; + bool viewResizesToContents; + +#if USE(ACCELERATED_COMPOSITING) +#if USE(TEXTURE_MAPPER) + PlatformLayerProxyQt* platformLayerProxy; +#else + QWeakPointer<QGraphicsObject> rootGraphicsLayer; +#endif + // we have to flush quite often, so we use a meta-method instead of QTimer::singleShot for putting the event in the queue + QMetaMethod syncMetaMethod; + + // we need to sync the layers if we get a special call from the WebCore + // compositor telling us to do so. We'll get that call from ChromeClientQt + bool shouldSync; +#endif + // the overlay gets instantiated when the root layer is attached, and get deleted when it's detached + QGraphicsItemOverlay* overlay; + + // we need to put the root graphics layer behind the overlay (which contains the scrollbar) + enum { RootGraphicsLayerZValue, OverlayZValue }; +}; +#endif // QT_NO_GRAPHICSVIEW + +} +#endif // PageClientQt diff --git a/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp new file mode 100644 index 0000000..0c0f2d7 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp @@ -0,0 +1,160 @@ +/* + * This file is part of the popup menu implementation for <select> elements in WebCore. + * + * Copyright (C) 2008, 2009, 2010 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2006 Apple Computer, Inc. + * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com + * Coypright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> + * + * 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 "PopupMenuQt.h" + +#include "ChromeClientQt.h" +#include "FrameView.h" +#include "PopupMenuClient.h" +#include "QtFallbackWebPopup.h" + +#include "qwebkitplatformplugin.h" + +class SelectData : public QWebSelectData { +public: + SelectData(WebCore::PopupMenuClient*& data) : d(data) {} + + virtual ItemType itemType(int) const; + virtual QString itemText(int idx) const { return QString(d ? d->itemText(idx) : ""); } + virtual QString itemToolTip(int idx) const { return QString(d ? d->itemToolTip(idx) : ""); } + virtual bool itemIsEnabled(int idx) const { return d ? d->itemIsEnabled(idx) : false; } + virtual int itemCount() const { return d ? d->listSize() : 0; } + virtual bool itemIsSelected(int idx) const { return d ? d->itemIsSelected(idx) : false; } + virtual bool multiple() const; + +private: + WebCore::PopupMenuClient*& d; +}; + +bool SelectData::multiple() const +{ + if (!d) + return false; + +#if ENABLE(NO_LISTBOX_RENDERING) + WebCore::ListPopupMenuClient* client = static_cast<WebCore::ListPopupMenuClient*>(d); + return client && client->multiple(); +#else + return false; +#endif +} + +SelectData::ItemType SelectData::itemType(int idx) const +{ + if (!d) + return SelectData::Option; + + if (d->itemIsSeparator(idx)) + return SelectData::Separator; + if (d->itemIsLabel(idx)) + return SelectData::Group; + return SelectData::Option; +} + +namespace WebCore { + +PopupMenuQt::PopupMenuQt(PopupMenuClient* client, const ChromeClientQt* chromeClient) + : m_popupClient(client) + , m_popup(0) + , m_selectData(0) + , m_chromeClient(chromeClient) +{ +} + +PopupMenuQt::~PopupMenuQt() +{ + delete m_selectData; + delete m_popup; +} + +void PopupMenuQt::disconnectClient() +{ + m_popupClient = 0; +} + +void PopupMenuQt::show(const IntRect& rect, FrameView* view, int index) +{ +#ifndef QT_NO_COMBOBOX + if (!m_popupClient) + return; + + if (!m_popup) { + m_popup = m_chromeClient->createSelectPopup(); + connect(m_popup, SIGNAL(didHide()), this, SLOT(didHide())); + connect(m_popup, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool))); + } + + if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup)) { + QRect geometry(rect); + geometry.moveTopLeft(view->contentsToWindow(rect.topLeft())); + fallback->setGeometry(geometry); + fallback->setFont(m_popupClient->menuStyle().font().font()); + } + + if (m_selectData) + delete m_selectData; + m_selectData = new SelectData(m_popupClient); + m_popup->show(*m_selectData); +#endif +} + +void PopupMenuQt::didHide() +{ + if (m_popupClient) + m_popupClient->popupDidHide(); +} + +void PopupMenuQt::hide() +{ + if (m_popup) + m_popup->hide(); +} + +void PopupMenuQt::updateFromElement() +{ + if (m_popupClient) + m_popupClient->setTextFromItem(m_popupClient->selectedIndex()); +} + +void PopupMenuQt::selectItem(int index, bool ctrl, bool shift) +{ + if (!m_popupClient) + return; + +#if ENABLE(NO_LISTBOX_RENDERING) + ListPopupMenuClient* client = static_cast<ListPopupMenuClient*>(m_popupClient); + if (client) { + client->listBoxSelectItem(index, ctrl, shift); + return; + } +#endif + + m_popupClient->valueChanged(index); +} + +} + +// vim: ts=4 sw=4 et diff --git a/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h new file mode 100644 index 0000000..837f323 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 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 PopupMenuQt_h +#define PopupMenuQt_h + +#include "PopupMenu.h" +#include <QObject> + +class QWebSelectData; +class QWebSelectMethod; + +namespace WebCore { + +class ChromeClientQt; +class FrameView; +class PopupMenuClient; + +class PopupMenuQt : public QObject, public PopupMenu { + Q_OBJECT +public: + PopupMenuQt(PopupMenuClient*, const ChromeClientQt*); + ~PopupMenuQt(); + + virtual void show(const IntRect&, FrameView*, int index); + virtual void hide(); + virtual void updateFromElement(); + virtual void disconnectClient(); + +private slots: + void didHide(); + void selectItem(int index, bool ctrl, bool shift); + +private: + PopupMenuClient* m_popupClient; + QWebSelectMethod* m_popup; + QWebSelectData* m_selectData; + const ChromeClientQt* m_chromeClient; +}; + +} + +#endif // PopupMenuQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp new file mode 100644 index 0000000..afa6492 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2010 Girish Ramakrishnan <girish@forwardbias.in> + * 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. + * + */ +#include "config.h" +#include "QtFallbackWebPopup.h" + +#ifndef QT_NO_COMBOBOX + +#include "ChromeClientQt.h" +#include "QWebPageClient.h" +#include "qgraphicswebview.h" +#include <QAbstractItemView> +#include <QApplication> +#include <QGraphicsProxyWidget> +#include <QGraphicsScene> +#include <QGraphicsView> +#include <QInputContext> +#include <QMouseEvent> +#include <QStandardItemModel> + +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) +#include <BrCtlDialogsProvider.h> +#include <BrowserDialogsProvider.h> // S60 platform private header file +#include <e32base.h> +#endif + +namespace WebCore { + +QtFallbackWebPopupCombo::QtFallbackWebPopupCombo(QtFallbackWebPopup& ownerPopup) + : m_ownerPopup(ownerPopup) +{ + // Install an event filter on the view inside the combo box popup to make sure we know + // when the popup got closed. E.g. QComboBox::hidePopup() won't be called when the popup + // is closed by a mouse wheel event outside its window. + view()->installEventFilter(this); +} + +void QtFallbackWebPopupCombo::showPopup() +{ + QComboBox::showPopup(); + m_ownerPopup.m_popupVisible = true; +} + +void QtFallbackWebPopupCombo::hidePopup() +{ +#ifndef QT_NO_IM + QWidget* activeFocus = QApplication::focusWidget(); + if (activeFocus && activeFocus == QComboBox::view() + && activeFocus->testAttribute(Qt::WA_InputMethodEnabled)) { + QInputContext* qic = activeFocus->inputContext(); + if (qic) { + qic->reset(); + qic->setFocusWidget(0); + } + } +#endif // QT_NO_IM + + QComboBox::hidePopup(); + + if (!m_ownerPopup.m_popupVisible) + return; + + m_ownerPopup.m_popupVisible = false; + emit m_ownerPopup.didHide(); + m_ownerPopup.destroyPopup(); +} + +bool QtFallbackWebPopupCombo::eventFilter(QObject* watched, QEvent* event) +{ + Q_ASSERT(watched == view()); + + if (event->type() == QEvent::Show && !m_ownerPopup.m_popupVisible) + showPopup(); + else if (event->type() == QEvent::Hide && m_ownerPopup.m_popupVisible) + hidePopup(); + + return false; +} + +// QtFallbackWebPopup + +QtFallbackWebPopup::QtFallbackWebPopup(const ChromeClientQt* chromeClient) + : m_popupVisible(false) + , m_combo(0) + , m_chromeClient(chromeClient) +{ +} + +QtFallbackWebPopup::~QtFallbackWebPopup() +{ + destroyPopup(); +} + +void QtFallbackWebPopup::show(const QWebSelectData& data) +{ + if (!pageClient()) + return; + +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) + TRAP_IGNORE(showS60BrowserDialog()); +#else + + destroyPopup(); + m_combo = new QtFallbackWebPopupCombo(*this); + connect(m_combo, SIGNAL(activated(int)), + SLOT(activeChanged(int)), Qt::QueuedConnection); + + populate(data); + + QRect rect = geometry(); + if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) { + QGraphicsProxyWidget* proxy = new QGraphicsProxyWidget(webView); + proxy->setWidget(m_combo); + proxy->setGeometry(rect); + } else { + m_combo->setParent(pageClient()->ownerWidget()); + m_combo->setGeometry(QRect(rect.left(), rect.top(), + rect.width(), m_combo->sizeHint().height())); + + } + + QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton, + Qt::LeftButton, Qt::NoModifier); + QCoreApplication::sendEvent(m_combo, &event); +#endif +} + +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) + +static void ResetAndDestroy(TAny* aPtr) +{ + RPointerArray<HBufC>* items = reinterpret_cast<RPointerArray<HBufC>* >(aPtr); + items->ResetAndDestroy(); +} + +void QtFallbackWebPopup::showS60BrowserDialog() +{ + static MBrCtlDialogsProvider* dialogs = CBrowserDialogsProvider::NewL(0); + if (!dialogs) + return; + + int size = itemCount(); + CArrayFix<TBrCtlSelectOptionData>* options = new CArrayFixFlat<TBrCtlSelectOptionData>(qMax(1, size)); + RPointerArray<HBufC> items(qMax(1, size)); + CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &items)); + + for (int i = 0; i < size; i++) { + if (itemType(i) == Separator) { + TBrCtlSelectOptionData data(_L("----------"), false, false, false); + options->AppendL(data); + } else { + HBufC16* itemStr = HBufC16::NewL(itemText(i).length()); + itemStr->Des().Copy((const TUint16*)itemText(i).utf16(), itemText(i).length()); + CleanupStack::PushL(itemStr); + TBrCtlSelectOptionData data(*itemStr, i == currentIndex(), false, itemIsEnabled(i)); + options->AppendL(data); + items.AppendL(itemStr); + CleanupStack::Pop(); + } + } + + dialogs->DialogSelectOptionL(KNullDesC(), (TBrCtlSelectOptionType)(ESelectTypeSingle | ESelectTypeWithFindPane), *options); + + CleanupStack::PopAndDestroy(&items); + + int newIndex; + for (newIndex = 0; newIndex < options->Count() && !options->At(newIndex).IsSelected(); newIndex++) {} + if (newIndex == options->Count()) + newIndex = currentIndex(); + + m_popupVisible = false; + popupDidHide(); + + if (currentIndex() != newIndex && newIndex >= 0) + valueChanged(newIndex); + + delete options; +} +#endif + +void QtFallbackWebPopup::hide() +{ + // Destroying the QComboBox here cause problems if the popup is in the + // middle of its show animation. Instead we rely on the fact that the + // Qt::Popup window will hide itself on mouse events outside its window. +} + +void QtFallbackWebPopup::destroyPopup() +{ + if (m_combo) { + m_combo->deleteLater(); + m_combo = 0; + } +} + +void QtFallbackWebPopup::populate(const QWebSelectData& data) +{ + QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_combo->model()); + Q_ASSERT(model); + +#if !defined(Q_OS_SYMBIAN) + m_combo->setFont(font()); +#endif + + int currentIndex = -1; + for (int i = 0; i < data.itemCount(); ++i) { + switch (data.itemType(i)) { + case QWebSelectData::Separator: + m_combo->insertSeparator(i); + break; + case QWebSelectData::Group: + m_combo->insertItem(i, data.itemText(i)); + model->item(i)->setEnabled(false); + break; + case QWebSelectData::Option: + m_combo->insertItem(i, data.itemText(i)); + model->item(i)->setEnabled(data.itemIsEnabled(i)); +#ifndef QT_NO_TOOLTIP + model->item(i)->setToolTip(data.itemToolTip(i)); +#endif + if (data.itemIsSelected(i)) + currentIndex = i; + break; + } + } + + if (currentIndex >= 0) + m_combo->setCurrentIndex(currentIndex); +} + +void QtFallbackWebPopup::activeChanged(int index) +{ + if (index < 0) + return; + + emit selectItem(index, false, false); +} + +QWebPageClient* QtFallbackWebPopup::pageClient() const +{ + return m_chromeClient->platformPageClient(); +} + +} + +#endif // QT_NO_COMBOBOX diff --git a/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h new file mode 100644 index 0000000..7c98fb4 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h @@ -0,0 +1,92 @@ +/* + * 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. + * + */ +#ifndef QtFallbackWebPopup_h +#define QtFallbackWebPopup_h + +#include "Platform.h" +#include "qwebkitplatformplugin.h" + +#include <QComboBox> + +#ifndef QT_NO_COMBOBOX + +QT_BEGIN_NAMESPACE +class QGraphicsProxyWidget; +QT_END_NAMESPACE + +class QWebPageClient; + +namespace WebCore { + +class ChromeClientQt; +class QtFallbackWebPopupCombo; + +class QtFallbackWebPopup : public QWebSelectMethod { + Q_OBJECT +public: + QtFallbackWebPopup(const ChromeClientQt*); + ~QtFallbackWebPopup(); + + virtual void show(const QWebSelectData&); + virtual void hide(); + + void destroyPopup(); + + void setGeometry(const QRect& rect) { m_geometry = rect; } + QRect geometry() const { return m_geometry; } + + void setFont(const QFont& font) { m_font = font; } + QFont font() const { return m_font; } + +private slots: + void activeChanged(int); + +private: + friend class QtFallbackWebPopupCombo; + bool m_popupVisible; + QtFallbackWebPopupCombo* m_combo; + const ChromeClientQt* m_chromeClient; + QRect m_geometry; + QFont m_font; + + QWebPageClient* pageClient() const; + + void populate(const QWebSelectData&); +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) + void showS60BrowserDialog(); +#endif +}; + +class QtFallbackWebPopupCombo : public QComboBox { +public: + QtFallbackWebPopupCombo(QtFallbackWebPopup& ownerPopup); + virtual void showPopup(); + virtual void hidePopup(); + virtual bool eventFilter(QObject* watched, QEvent* event); + +private: + QtFallbackWebPopup& m_ownerPopup; +}; + +} + +#endif // QT_NO_COMBOBOX + +#endif // QtFallbackWebPopup_h diff --git a/Source/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp b/Source/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp new file mode 100644 index 0000000..90af0c6 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2010 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 "QtMaemoWebPopup.h" + +#include <QHBoxLayout> +#include <QListWidget> +#include <QListWidgetItem> +#include <QPainter> +#include <QPushButton> +#include <QStyledItemDelegate> +#include <QVBoxLayout> + +#include <libintl.h> + + +namespace WebCore { + +static const int gMaemoListItemSize = 70; +static const int gMaemoListPadding = 38; +static const int gMaemoMaxVisibleItems = 5; + +void Maemo5Popup::populateList() +{ + QListWidgetItem* listItem; + for (int i = 0; i < m_data.itemCount(); ++i) { + if (m_data.itemType(i) == QWebSelectData::Option) { + listItem = new QListWidgetItem(m_data.itemText(i)); + m_list->addItem(listItem); + listItem->setSelected(m_data.itemIsSelected(i)); + } else if (m_data.itemType(i) == QWebSelectData::Group) { + listItem = new QListWidgetItem(m_data.itemText(i)); + m_list->addItem(listItem); + listItem->setSelected(false); + listItem->setFlags(Qt::NoItemFlags); + } + } + connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onItemSelected(QListWidgetItem*))); +} + +void Maemo5Popup::onItemSelected(QListWidgetItem* item) +{ + if (item->flags() != Qt::NoItemFlags) + emit itemClicked(m_list->row(item)); +} + +QtMaemoWebPopup::QtMaemoWebPopup() + : m_popup(0) +{ +} + +QtMaemoWebPopup::~QtMaemoWebPopup() +{ + if (m_popup) + m_popup->deleteLater(); +} + +Maemo5Popup* QtMaemoWebPopup::createSingleSelectionPopup(const QWebSelectData& data) +{ + return new Maemo5SingleSelectionPopup(data); +} + +Maemo5Popup* QtMaemoWebPopup::createMultipleSelectionPopup(const QWebSelectData& data) +{ + return new Maemo5MultipleSelectionPopup(data); +} + +Maemo5Popup* QtMaemoWebPopup::createPopup(const QWebSelectData& data) +{ + Maemo5Popup* result = data.multiple() ? createMultipleSelectionPopup(data) : createSingleSelectionPopup(data); + connect(result, SIGNAL(finished(int)), this, SLOT(popupClosed())); + connect(result, SIGNAL(itemClicked(int)), this, SLOT(itemClicked(int))); + return result; +} + +void QtMaemoWebPopup::show(const QWebSelectData& data) +{ + if (m_popup) + return; + + m_popup = createPopup(data); + m_popup->show(); +} + +void QtMaemoWebPopup::hide() +{ + if (!m_popup) + return; + + m_popup->accept(); +} + +void QtMaemoWebPopup::popupClosed() +{ + if (!m_popup) + return; + + m_popup->deleteLater(); + m_popup = 0; + emit didHide(); +} + +void QtMaemoWebPopup::itemClicked(int idx) +{ + emit selectItem(idx, true, false); +} + +Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup(const QWebSelectData& data) + : Maemo5Popup(data) +{ + // we try to get the standard list title the web browser is using + const char* title = ::dgettext("osso-browser-ui", "weba_ti_texlist_single"); + if (qstrcmp(title, "weba_ti_texlist_single")) + setWindowTitle(QString::fromUtf8(title)); + else + setWindowTitle("Select item"); + + QHBoxLayout* hLayout = new QHBoxLayout(this); + hLayout->setContentsMargins(0, 0, 0, 0); + + m_list = new QListWidget(this); + populateList(); + + hLayout->addSpacing(gMaemoListPadding); + hLayout->addWidget(m_list); + hLayout->addSpacing(gMaemoListPadding); + + connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(accept())); + + const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count(); + resize(size().width(), visibleItemCount * gMaemoListItemSize); +} + + +class MultipleItemListDelegate : public QStyledItemDelegate { +public: + MultipleItemListDelegate(QObject* parent = 0) + : QStyledItemDelegate(parent) + { + tickMark = QIcon::fromTheme("widgets_tickmark_list").pixmap(48, 48); + } + + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const + { + QStyledItemDelegate::paint(painter, option, index); + + if (option.state & QStyle::State_Selected) + painter->drawPixmap(option.rect.width() - tickMark.rect().width(), option.rect.y() + (option.rect.height() / 2 - tickMark.rect().height() / 2), tickMark); + } + +private: + QPixmap tickMark; +}; + +Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup(const QWebSelectData& data) + : Maemo5Popup(data) +{ + // we try to get the standard list title the web browser is using + const char* title = ::dgettext("osso-browser-ui", "weba_ti_textlist_multi"); + if (qstrcmp(title, "weba_ti_textlist_multi")) + setWindowTitle(QString::fromUtf8(title)); + else + setWindowTitle("Select items"); + + QHBoxLayout* hLayout = new QHBoxLayout(this); + hLayout->setContentsMargins(0, 0, 0, 0); + + m_list = new QListWidget(this); + m_list->setSelectionMode(QAbstractItemView::MultiSelection); + populateList(); + + MultipleItemListDelegate* delegate = new MultipleItemListDelegate(this); + m_list->setItemDelegate(delegate); + + hLayout->addSpacing(gMaemoListPadding); + hLayout->addWidget(m_list); + + QVBoxLayout* vLayout = new QVBoxLayout(); + + const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count(); + vLayout->addSpacing((visibleItemCount - 1) * gMaemoListItemSize); + + // we try to get the standard Done button title + QPushButton* done = new QPushButton(this); + title = ::dgettext("hildon-libs", "wdgt_bd_done"); + if (qstrcmp(title, "wdgt_bd_done")) + done->setText(QString::fromUtf8(title)); + else + done->setText("Done"); + + done->setMinimumWidth(178); + vLayout->addWidget(done); + + hLayout->addSpacing(8); + hLayout->addLayout(vLayout); + hLayout->addSpacing(18); + + connect(done, SIGNAL(clicked()), this, SLOT(accept())); + resize(size().width(), visibleItemCount * gMaemoListItemSize); +} + +} diff --git a/Source/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h b/Source/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h new file mode 100644 index 0000000..5433b75 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2010 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 QtMaemoWebPopup_h +#define QtMaemoWebPopup_h + +#include "qwebkitplatformplugin.h" + +#include <QDialog> + +class QListWidgetItem; +class QListWidget; + + +namespace WebCore { + +class Maemo5Popup : public QDialog { + Q_OBJECT +public: + Maemo5Popup(const QWebSelectData& data) : m_data(data) {} + +signals: + void itemClicked(int idx); + +protected slots: + void onItemSelected(QListWidgetItem* item); + +protected: + void populateList(); + + const QWebSelectData& m_data; + QListWidget* m_list; +}; + + +class QtMaemoWebPopup : public QWebSelectMethod { + Q_OBJECT +public: + QtMaemoWebPopup(); + ~QtMaemoWebPopup(); + + virtual void show(const QWebSelectData& data); + virtual void hide(); + +private slots: + void popupClosed(); + void itemClicked(int idx); + +private: + Maemo5Popup* m_popup; + + Maemo5Popup* createPopup(const QWebSelectData& data); + Maemo5Popup* createSingleSelectionPopup(const QWebSelectData& data); + Maemo5Popup* createMultipleSelectionPopup(const QWebSelectData& data); +}; + + +class Maemo5SingleSelectionPopup : public Maemo5Popup { + Q_OBJECT +public: + Maemo5SingleSelectionPopup(const QWebSelectData& data); +}; + + +class Maemo5MultipleSelectionPopup : public Maemo5Popup { + Q_OBJECT +public: + Maemo5MultipleSelectionPopup(const QWebSelectData& data); +}; + +} + +#endif // QtMaemoWebPopup_h diff --git a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp new file mode 100644 index 0000000..ea56134 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2010 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 "QtPlatformPlugin.h" + +#include "qwebkitplatformplugin.h" + +#include <QCoreApplication> +#include <QDir> +#include <QPluginLoader> + +namespace WebCore { + +bool QtPlatformPlugin::load(const QString& file) +{ + m_loader.setFileName(file); + if (!m_loader.load()) + return false; + + QObject* obj = m_loader.instance(); + if (obj) { + m_plugin = qobject_cast<QWebKitPlatformPlugin*>(obj); + if (m_plugin) + return true; + } + + m_loader.unload(); + return false; +} + +bool QtPlatformPlugin::load() +{ + const QLatin1String suffix("/webkit/"); + const QStringList paths = QCoreApplication::libraryPaths(); + + for (int i = 0; i < paths.count(); ++i) { + const QDir dir(paths[i] + suffix); + if (!dir.exists()) + continue; + const QStringList files = dir.entryList(QDir::Files); + for (int j = 0; j < files.count(); ++j) { + if (load(dir.absoluteFilePath(files.at(j)))) + return true; + } + } + return false; +} + +QtPlatformPlugin::~QtPlatformPlugin() +{ + m_loader.unload(); +} + +bool QtPlatformPlugin::loadStaticallyLinkedPlugin() +{ + QObjectList objs = QPluginLoader::staticInstances(); + for (int i = 0; i < objs.size(); ++i) { + m_plugin = qobject_cast<QWebKitPlatformPlugin*>(objs[i]); + if (m_plugin) + return true; + } + return false; +} + +QWebKitPlatformPlugin* QtPlatformPlugin::plugin() +{ + if (m_loaded) + return m_plugin; + m_loaded = true; + + if (loadStaticallyLinkedPlugin()) + return m_plugin; + + // Plugin path is stored in a static variable to avoid searching for the plugin + // more then once. + static QString pluginPath; + + if (pluginPath.isNull()) { + if (load()) + pluginPath = m_loader.fileName(); + } else + load(pluginPath); + + return m_plugin; +} + +QWebSelectMethod* QtPlatformPlugin::createSelectInputMethod() +{ + QWebKitPlatformPlugin* p = plugin(); + return p ? static_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0; +} + + +QWebNotificationPresenter* QtPlatformPlugin::createNotificationPresenter() +{ + QWebKitPlatformPlugin* p = plugin(); + return p ? static_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0; +} + +QWebHapticFeedbackPlayer* QtPlatformPlugin::createHapticFeedbackPlayer() +{ + QWebKitPlatformPlugin* p = plugin(); + return p ? static_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0; +} + +QWebTouchModifier* QtPlatformPlugin::createTouchModifier() +{ + QWebKitPlatformPlugin* p = plugin(); + return p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0; +} + +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +QWebFullScreenVideoHandler* QtPlatformPlugin::createFullScreenVideoHandler() +{ + QWebKitPlatformPlugin* p = plugin(); + return p ? static_cast<QWebFullScreenVideoHandler*>(p->createExtension(QWebKitPlatformPlugin::FullScreenVideoPlayer)) : 0; +} +#endif + +} diff --git a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h new file mode 100644 index 0000000..71ee2bb --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2010 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 QtPlatformPlugin_h +#define QtPlatformPlugin_h + +#include <QPluginLoader> + +class QWebSelectMethod; +class QWebKitPlatformPlugin; +class QWebNotificationPresenter; +class QWebHapticFeedbackPlayer; +class QWebSelectData; +class QWebTouchModifier; +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +class QWebFullScreenVideoHandler; +#endif + +namespace WebCore { + +class QtPlatformPlugin { +public: + QtPlatformPlugin() : m_loaded(false), m_plugin(0) {} + ~QtPlatformPlugin(); + + QWebSelectMethod* createSelectInputMethod(); + QWebNotificationPresenter* createNotificationPresenter(); + QWebHapticFeedbackPlayer* createHapticFeedbackPlayer(); + QWebTouchModifier* createTouchModifier(); +#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) + QWebFullScreenVideoHandler* createFullScreenVideoHandler(); +#endif + + QWebKitPlatformPlugin* plugin(); + +private: + bool m_loaded; + QWebKitPlatformPlugin* m_plugin; + QPluginLoader m_loader; + bool load(); + bool load(const QString& file); + bool loadStaticallyLinkedPlugin(); +}; + +} + +#endif // QtPlatformPlugin_h diff --git a/Source/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp b/Source/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp new file mode 100644 index 0000000..63437cf --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp @@ -0,0 +1,49 @@ +/* + * Copyright C 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2010 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 "SearchPopupMenuQt.h" + +namespace WebCore { + +SearchPopupMenuQt::SearchPopupMenuQt(PassRefPtr<PopupMenu> popup) + : m_popup(popup) +{ +} + +PopupMenu* SearchPopupMenuQt::popupMenu() +{ + return m_popup.get(); +} + +void SearchPopupMenuQt::saveRecentSearches(const AtomicString&, const Vector<String>&) +{ +} + +void SearchPopupMenuQt::loadRecentSearches(const AtomicString&, Vector<String>&) +{ +} + +bool SearchPopupMenuQt::enabled() +{ + return true; +} + +} diff --git a/Source/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h b/Source/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h new file mode 100644 index 0000000..11a9641 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2010 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 SearchPopupMenuQt_h +#define SearchPopupMenuQt_h + +#include "SearchPopupMenu.h" + +namespace WebCore { + +class SearchPopupMenuQt : public SearchPopupMenu { +public: + SearchPopupMenuQt(PassRefPtr<PopupMenu> popup); + + virtual PopupMenu* popupMenu(); + virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems); + virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems); + virtual bool enabled(); + +private: + RefPtr<PopupMenu> m_popup; +}; + +} + +#endif // SearchPopupMenuQt_h diff --git a/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp new file mode 100644 index 0000000..c67ec2f --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp @@ -0,0 +1,732 @@ +/* + * Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net> + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2008 Collabora Ltd. All rights reserved. + * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010 INdT - Instituto Nokia de Tecnologia + * + * 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 INC. 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 INC. 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 "WebPlatformStrategies.h" + +#include "Chrome.h" +#include "ChromeClientQt.h" +#include <IntSize.h> +#include "NotImplemented.h" +#include <Page.h> +#include <PageGroup.h> +#include <PluginDatabase.h> +#include <QCoreApplication> +#include <QLocale> +#include <qwebpage.h> +#include <qwebpluginfactory.h> +#include <wtf/MathExtras.h> + +using namespace WebCore; + +void WebPlatformStrategies::initialize() +{ + DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ()); + Q_UNUSED(platformStrategies); +} + +WebPlatformStrategies::WebPlatformStrategies() +{ + setPlatformStrategies(this); +} + + +// PluginStrategy + +PluginStrategy* WebPlatformStrategies::createPluginStrategy() +{ + return this; +} + +LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy() +{ + return this; +} + +VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy() +{ + return this; +} + +void WebPlatformStrategies::refreshPlugins() +{ + PluginDatabase::installedPlugins()->refresh(); +} + +void WebPlatformStrategies::getPluginInfo(const WebCore::Page* page, Vector<WebCore::PluginInfo>& outPlugins) +{ + QWebPage* qPage = static_cast<ChromeClientQt*>(page->chrome()->client())->m_webPage; + QWebPluginFactory* factory; + if (qPage && (factory = qPage->pluginFactory())) { + + QList<QWebPluginFactory::Plugin> qplugins = factory->plugins(); + for (int i = 0; i < qplugins.count(); ++i) { + const QWebPluginFactory::Plugin& qplugin = qplugins.at(i); + PluginInfo info; + info.name = qplugin.name; + info.desc = qplugin.description; + + for (int j = 0; j < qplugin.mimeTypes.count(); ++j) { + const QWebPluginFactory::MimeType& mimeType = qplugin.mimeTypes.at(j); + + MimeClassInfo mimeInfo; + mimeInfo.type = mimeType.name; + mimeInfo.desc = mimeType.description; + for (int k = 0; k < mimeType.fileExtensions.count(); ++k) + mimeInfo.extensions.append(mimeType.fileExtensions.at(k)); + + info.mimes.append(mimeInfo); + } + outPlugins.append(info); + } + } + + PluginDatabase* db = PluginDatabase::installedPlugins(); + const Vector<PluginPackage*> &plugins = db->plugins(); + + outPlugins.resize(plugins.size()); + + for (unsigned int i = 0; i < plugins.size(); ++i) { + PluginInfo info; + PluginPackage* package = plugins[i]; + + info.name = package->name(); + info.file = package->fileName(); + info.desc = package->description(); + + const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions(); + MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end(); + for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) { + MimeClassInfo mime; + + mime.type = it->first; + mime.desc = it->second; + mime.extensions = package->mimeToExtensions().get(mime.type); + + info.mimes.append(mime); + } + + outPlugins.append(info); + } + +} + + +// LocalizationStrategy + +String WebPlatformStrategies::inputElementAltText() +{ + return QCoreApplication::translate("QWebPage", "Submit", "Submit (input element) alt text for <input> elements with no alt, title, or value"); +} + +String WebPlatformStrategies::resetButtonDefaultLabel() +{ + return QCoreApplication::translate("QWebPage", "Reset", "default label for Reset buttons in forms on web pages"); +} + +String WebPlatformStrategies::searchableIndexIntroduction() +{ + return QCoreApplication::translate("QWebPage", "This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'"); +} + +String WebPlatformStrategies::submitButtonDefaultLabel() +{ + return QCoreApplication::translate("QWebPage", "Submit", "default label for Submit buttons in forms on web pages"); +} + +String WebPlatformStrategies::fileButtonChooseFileLabel() +{ + return QCoreApplication::translate("QWebPage", "Choose File", "title for file button used in HTML forms"); +} + +String WebPlatformStrategies::fileButtonNoFileSelectedLabel() +{ + return QCoreApplication::translate("QWebPage", "No file selected", "text to display in file button used in HTML forms when no file is selected"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow() +{ + return QCoreApplication::translate("QWebPage", "Open in New Window", "Open in New Window context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk() +{ + return QCoreApplication::translate("QWebPage", "Save Link...", "Download Linked File context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard() +{ + return QCoreApplication::translate("QWebPage", "Copy Link", "Copy Link context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow() +{ + return QCoreApplication::translate("QWebPage", "Open Image", "Open Image in New Window context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk() +{ + return QCoreApplication::translate("QWebPage", "Save Image", "Download Image context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard() +{ + return QCoreApplication::translate("QWebPage", "Copy Image", "Copy Link context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow() +{ + return QCoreApplication::translate("QWebPage", "Open Video", "Open Video in New Window"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow() +{ + return QCoreApplication::translate("QWebPage", "Open Audio", "Open Audio in New Window"); +} + +String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard() +{ + return QCoreApplication::translate("QWebPage", "Copy Video", "Copy Video Link Location"); +} + +String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard() +{ + return QCoreApplication::translate("QWebPage", "Copy Audio", "Copy Audio Link Location"); +} + +String WebPlatformStrategies::contextMenuItemTagToggleMediaControls() +{ + return QCoreApplication::translate("QWebPage", "Toggle Controls", "Toggle Media Controls"); +} + +String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop() +{ + return QCoreApplication::translate("QWebPage", "Toggle Loop", "Toggle Media Loop Playback"); +} + +String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen() +{ + return QCoreApplication::translate("QWebPage", "Enter Fullscreen", "Switch Video to Fullscreen"); +} + +String WebPlatformStrategies::contextMenuItemTagMediaPlay() +{ + return QCoreApplication::translate("QWebPage", "Play", "Play"); +} + +String WebPlatformStrategies::contextMenuItemTagMediaPause() +{ + return QCoreApplication::translate("QWebPage", "Pause", "Pause"); +} + +String WebPlatformStrategies::contextMenuItemTagMediaMute() +{ + return QCoreApplication::translate("QWebPage", "Mute", "Mute"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow() +{ + return QCoreApplication::translate("QWebPage", "Open Frame", "Open Frame in New Window context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCopy() +{ + return QCoreApplication::translate("QWebPage", "Copy", "Copy context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagGoBack() +{ + return QCoreApplication::translate("QWebPage", "Go Back", "Back context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagGoForward() +{ + return QCoreApplication::translate("QWebPage", "Go Forward", "Forward context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagStop() +{ + return QCoreApplication::translate("QWebPage", "Stop", "Stop context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagReload() +{ + return QCoreApplication::translate("QWebPage", "Reload", "Reload context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCut() +{ + return QCoreApplication::translate("QWebPage", "Cut", "Cut context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagPaste() +{ + return QCoreApplication::translate("QWebPage", "Paste", "Paste context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagSelectAll() +{ + return QCoreApplication::translate("QWebPage", "Select All", "Select All context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagNoGuessesFound() +{ + return QCoreApplication::translate("QWebPage", "No Guesses Found", "No Guesses Found context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling() +{ + return QCoreApplication::translate("QWebPage", "Ignore", "Ignore Spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagLearnSpelling() +{ + return QCoreApplication::translate("QWebPage", "Add To Dictionary", "Learn Spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagSearchWeb() +{ + return QCoreApplication::translate("QWebPage", "Search The Web", "Search The Web context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary() +{ + return QCoreApplication::translate("QWebPage", "Look Up In Dictionary", "Look Up in Dictionary context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenLink() +{ + return QCoreApplication::translate("QWebPage", "Open Link", "Open Link context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar() +{ + return QCoreApplication::translate("QWebPage", "Ignore", "Ignore Grammar context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagSpellingMenu() +{ + return QCoreApplication::translate("QWebPage", "Spelling", "Spelling and Grammar context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show) +{ + return show ? QCoreApplication::translate("QWebPage", "Show Spelling and Grammar", "menu item title") : + QCoreApplication::translate("QWebPage", "Hide Spelling and Grammar", "menu item title"); +} + +String WebPlatformStrategies::contextMenuItemTagCheckSpelling() +{ + return QCoreApplication::translate("QWebPage", "Check Spelling", "Check spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping() +{ + return QCoreApplication::translate("QWebPage", "Check Spelling While Typing", "Check spelling while typing context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling() +{ + return QCoreApplication::translate("QWebPage", "Check Grammar With Spelling", "Check grammar with spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagFontMenu() +{ + return QCoreApplication::translate("QWebPage", "Fonts", "Font context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagBold() +{ + return QCoreApplication::translate("QWebPage", "Bold", "Bold context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagItalic() +{ + return QCoreApplication::translate("QWebPage", "Italic", "Italic context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagUnderline() +{ + return QCoreApplication::translate("QWebPage", "Underline", "Underline context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOutline() +{ + return QCoreApplication::translate("QWebPage", "Outline", "Outline context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu() +{ + return QCoreApplication::translate("QWebPage", "Direction", "Writing direction context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu() +{ + return QCoreApplication::translate("QWebPage", "Text Direction", "Text direction context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagDefaultDirection() +{ + return QCoreApplication::translate("QWebPage", "Default", "Default writing direction context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagLeftToRight() +{ + return QCoreApplication::translate("QWebPage", "Left to Right", "Left to Right context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagRightToLeft() +{ + return QCoreApplication::translate("QWebPage", "Right to Left", "Right to Left context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagInspectElement() +{ + return QCoreApplication::translate("QWebPage", "Inspect", "Inspect Element context menu item"); +} + +String WebPlatformStrategies::searchMenuNoRecentSearchesText() +{ + return QCoreApplication::translate("QWebPage", "No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed"); +} + +String WebPlatformStrategies::searchMenuRecentSearchesText() +{ + return QCoreApplication::translate("QWebPage", "Recent searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title"); +} + +String WebPlatformStrategies::searchMenuClearRecentSearchesText() +{ + return QCoreApplication::translate("QWebPage", "Clear recent searches", "menu item in Recent Searches menu that empties menu's contents"); +} + +String WebPlatformStrategies::AXWebAreaText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXLinkText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXListMarkerText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXImageMapText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXHeadingText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXDefinitionListTermText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXDefinitionListDefinitionText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXButtonActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXRadioButtonActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXTextFieldActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXCheckedCheckBoxActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXMenuListActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXMenuListPopupActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::AXLinkActionVerb() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::missingPluginText() +{ + return QCoreApplication::translate("QWebPage", "Missing Plug-in", "Label text to be used when a plug-in is missing"); +} + +String WebPlatformStrategies::crashedPluginText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::multipleFileUploadText(unsigned) +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::unknownFileSizeText() +{ + return QCoreApplication::translate("QWebPage", "Unknown", "Unknown filesize FTP directory listing item"); +} + +String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size) +{ + return QCoreApplication::translate("QWebPage", "%1 (%2x%3 pixels)", "Title string for images").arg(filename).arg(size.width()).arg(size.height()); +} + +String WebPlatformStrategies::mediaElementLoadingStateText() +{ + return QCoreApplication::translate("QWebPage", "Loading...", "Media controller status message when the media is loading"); +} + +String WebPlatformStrategies::mediaElementLiveBroadcastStateText() +{ + return QCoreApplication::translate("QWebPage", "Live Broadcast", "Media controller status message when watching a live broadcast"); +} + +#if ENABLE(VIDEO) + +String WebPlatformStrategies::localizedMediaControlElementString(const String& name) +{ + if (name == "AudioElement") + return QCoreApplication::translate("QWebPage", "Audio Element", "Media controller element"); + if (name == "VideoElement") + return QCoreApplication::translate("QWebPage", "Video Element", "Media controller element"); + if (name == "MuteButton") + return QCoreApplication::translate("QWebPage", "Mute Button", "Media controller element"); + if (name == "UnMuteButton") + return QCoreApplication::translate("QWebPage", "Unmute Button", "Media controller element"); + if (name == "PlayButton") + return QCoreApplication::translate("QWebPage", "Play Button", "Media controller element"); + if (name == "PauseButton") + return QCoreApplication::translate("QWebPage", "Pause Button", "Media controller element"); + if (name == "Slider") + return QCoreApplication::translate("QWebPage", "Slider", "Media controller element"); + if (name == "SliderThumb") + return QCoreApplication::translate("QWebPage", "Slider Thumb", "Media controller element"); + if (name == "RewindButton") + return QCoreApplication::translate("QWebPage", "Rewind Button", "Media controller element"); + if (name == "ReturnToRealtimeButton") + return QCoreApplication::translate("QWebPage", "Return to Real-time Button", "Media controller element"); + if (name == "CurrentTimeDisplay") + return QCoreApplication::translate("QWebPage", "Elapsed Time", "Media controller element"); + if (name == "TimeRemainingDisplay") + return QCoreApplication::translate("QWebPage", "Remaining Time", "Media controller element"); + if (name == "StatusDisplay") + return QCoreApplication::translate("QWebPage", "Status Display", "Media controller element"); + if (name == "FullscreenButton") + return QCoreApplication::translate("QWebPage", "Fullscreen Button", "Media controller element"); + if (name == "SeekForwardButton") + return QCoreApplication::translate("QWebPage", "Seek Forward Button", "Media controller element"); + if (name == "SeekBackButton") + return QCoreApplication::translate("QWebPage", "Seek Back Button", "Media controller element"); + + return String(); +} + +String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name) +{ + if (name == "AudioElement") + return QCoreApplication::translate("QWebPage", "Audio element playback controls and status display", "Media controller element"); + if (name == "VideoElement") + return QCoreApplication::translate("QWebPage", "Video element playback controls and status display", "Media controller element"); + if (name == "MuteButton") + return QCoreApplication::translate("QWebPage", "Mute audio tracks", "Media controller element"); + if (name == "UnMuteButton") + return QCoreApplication::translate("QWebPage", "Unmute audio tracks", "Media controller element"); + if (name == "PlayButton") + return QCoreApplication::translate("QWebPage", "Begin playback", "Media controller element"); + if (name == "PauseButton") + return QCoreApplication::translate("QWebPage", "Pause playback", "Media controller element"); + if (name == "Slider") + return QCoreApplication::translate("QWebPage", "Movie time scrubber", "Media controller element"); + if (name == "SliderThumb") + return QCoreApplication::translate("QWebPage", "Movie time scrubber thumb", "Media controller element"); + if (name == "RewindButton") + return QCoreApplication::translate("QWebPage", "Rewind movie", "Media controller element"); + if (name == "ReturnToRealtimeButton") + return QCoreApplication::translate("QWebPage", "Return streaming movie to real-time", "Media controller element"); + if (name == "CurrentTimeDisplay") + return QCoreApplication::translate("QWebPage", "Current movie time", "Media controller element"); + if (name == "TimeRemainingDisplay") + return QCoreApplication::translate("QWebPage", "Remaining movie time", "Media controller element"); + if (name == "StatusDisplay") + return QCoreApplication::translate("QWebPage", "Current movie status", "Media controller element"); + if (name == "FullscreenButton") + return QCoreApplication::translate("QWebPage", "Play movie in full-screen mode", "Media controller element"); + if (name == "SeekForwardButton") + return QCoreApplication::translate("QWebPage", "Seek quickly back", "Media controller element"); + if (name == "SeekBackButton") + return QCoreApplication::translate("QWebPage", "Seek quickly forward", "Media controller element"); + + ASSERT_NOT_REACHED(); + return String(); +} + +String WebPlatformStrategies::localizedMediaTimeDescription(float time) +{ + if (!isfinite(time)) + return QCoreApplication::translate("QWebPage", "Indefinite time", "Media time description"); + + int seconds = (int)fabsf(time); + int days = seconds / (60 * 60 * 24); + int hours = seconds / (60 * 60); + int minutes = (seconds / 60) % 60; + seconds %= 60; + + if (days) + return QCoreApplication::translate("QWebPage", "%1 days %2 hours %3 minutes %4 seconds", "Media time description").arg(days).arg(hours).arg(minutes).arg(seconds); + + if (hours) + return QCoreApplication::translate("QWebPage", "%1 hours %2 minutes %3 seconds", "Media time description").arg(hours).arg(minutes).arg(seconds); + + if (minutes) + return QCoreApplication::translate("QWebPage", "%1 minutes %2 seconds", "Media time description").arg(minutes).arg(seconds); + + return QCoreApplication::translate("QWebPage", "%1 seconds", "Media time description").arg(seconds); +} + +#else // ENABLE(VIDEO) +// FIXME: #if ENABLE(VIDEO) should be in the base class + +String WebPlatformStrategies::localizedMediaControlElementString(const String& name) +{ + return String(); +} + +String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name) +{ + return String(); +} + +String WebPlatformStrategies::localizedMediaTimeDescription(float time) +{ + return String(); +} + +#endif // ENABLE(VIDEO) + + +String WebPlatformStrategies::validationMessageValueMissingText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::validationMessageTypeMismatchText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::validationMessagePatternMismatchText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::validationMessageTooLongText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::validationMessageRangeUnderflowText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::validationMessageRangeOverflowText() +{ + notImplemented(); + return String(); +} + +String WebPlatformStrategies::validationMessageStepMismatchText() +{ + notImplemented(); + return String(); +} + + +// VisitedLinkStrategy + +bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash) +{ + return page->group().isLinkVisited(hash); +} + +void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash hash) +{ + page->group().addVisitedLinkHash(hash); +} diff --git a/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h new file mode 100644 index 0000000..5f72f46 --- /dev/null +++ b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010 INdT - Instituto Nokia de Tecnologia + * 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 WebPlatformStrategies_h +#define WebPlatformStrategies_h + +#include <LocalizationStrategy.h> +#include <PlatformStrategies.h> +#include <PluginStrategy.h> +#include <VisitedLinkStrategy.h> + +namespace WebCore { +class Page; +} + +class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy { +public: + static void initialize(); + +private: + WebPlatformStrategies(); + + // WebCore::PlatformStrategies + virtual WebCore::PluginStrategy* createPluginStrategy(); + virtual WebCore::LocalizationStrategy* createLocalizationStrategy(); + virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy(); + + // WebCore::PluginStrategy + virtual void refreshPlugins(); + virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&); + + // WebCore::LocalizationStrategy + virtual WTF::String inputElementAltText(); + virtual WTF::String resetButtonDefaultLabel(); + virtual WTF::String searchableIndexIntroduction(); + virtual WTF::String submitButtonDefaultLabel(); + virtual WTF::String fileButtonChooseFileLabel(); + virtual WTF::String fileButtonNoFileSelectedLabel(); + virtual WTF::String contextMenuItemTagOpenLinkInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadLinkToDisk(); + virtual WTF::String contextMenuItemTagCopyLinkToClipboard(); + virtual WTF::String contextMenuItemTagOpenImageInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadImageToDisk(); + virtual WTF::String contextMenuItemTagCopyImageToClipboard(); + virtual WTF::String contextMenuItemTagOpenFrameInNewWindow(); + virtual WTF::String contextMenuItemTagCopy(); + virtual WTF::String contextMenuItemTagGoBack(); + virtual WTF::String contextMenuItemTagGoForward(); + virtual WTF::String contextMenuItemTagStop(); + virtual WTF::String contextMenuItemTagReload(); + virtual WTF::String contextMenuItemTagCut(); + virtual WTF::String contextMenuItemTagPaste(); + virtual WTF::String contextMenuItemTagSelectAll(); + virtual WTF::String contextMenuItemTagNoGuessesFound(); + virtual WTF::String contextMenuItemTagIgnoreSpelling(); + virtual WTF::String contextMenuItemTagLearnSpelling(); + virtual WTF::String contextMenuItemTagSearchWeb(); + virtual WTF::String contextMenuItemTagLookUpInDictionary(); + virtual WTF::String contextMenuItemTagOpenLink(); + virtual WTF::String contextMenuItemTagIgnoreGrammar(); + virtual WTF::String contextMenuItemTagSpellingMenu(); + virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show); + virtual WTF::String contextMenuItemTagCheckSpelling(); + virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping(); + virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling(); + virtual WTF::String contextMenuItemTagFontMenu(); + virtual WTF::String contextMenuItemTagBold(); + virtual WTF::String contextMenuItemTagItalic(); + virtual WTF::String contextMenuItemTagUnderline(); + virtual WTF::String contextMenuItemTagOutline(); + virtual WTF::String contextMenuItemTagWritingDirectionMenu(); + virtual WTF::String contextMenuItemTagTextDirectionMenu(); + virtual WTF::String contextMenuItemTagDefaultDirection(); + virtual WTF::String contextMenuItemTagLeftToRight(); + virtual WTF::String contextMenuItemTagRightToLeft(); + virtual WTF::String contextMenuItemTagInspectElement(); + virtual WTF::String contextMenuItemTagOpenVideoInNewWindow(); + virtual WTF::String contextMenuItemTagOpenAudioInNewWindow(); + virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard(); + virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard(); + virtual WTF::String contextMenuItemTagToggleMediaControls(); + virtual WTF::String contextMenuItemTagToggleMediaLoop(); + virtual WTF::String contextMenuItemTagEnterVideoFullscreen(); + virtual WTF::String contextMenuItemTagMediaPlay(); + virtual WTF::String contextMenuItemTagMediaPause(); + virtual WTF::String contextMenuItemTagMediaMute(); + virtual WTF::String searchMenuNoRecentSearchesText(); + virtual WTF::String searchMenuRecentSearchesText(); + virtual WTF::String searchMenuClearRecentSearchesText(); + virtual WTF::String AXWebAreaText(); + virtual WTF::String AXLinkText(); + virtual WTF::String AXListMarkerText(); + virtual WTF::String AXImageMapText(); + virtual WTF::String AXHeadingText(); + virtual WTF::String AXDefinitionListTermText(); + virtual WTF::String AXDefinitionListDefinitionText(); + virtual WTF::String AXButtonActionVerb(); + virtual WTF::String AXRadioButtonActionVerb(); + virtual WTF::String AXTextFieldActionVerb(); + virtual WTF::String AXCheckedCheckBoxActionVerb(); + virtual WTF::String AXUncheckedCheckBoxActionVerb(); + virtual WTF::String AXMenuListActionVerb(); + virtual WTF::String AXMenuListPopupActionVerb(); + virtual WTF::String AXLinkActionVerb(); + virtual WTF::String missingPluginText(); + virtual WTF::String crashedPluginText(); + virtual WTF::String multipleFileUploadText(unsigned numberOfFiles); + virtual WTF::String unknownFileSizeText(); + virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize&); + virtual WTF::String mediaElementLoadingStateText(); + virtual WTF::String mediaElementLiveBroadcastStateText(); + virtual WTF::String localizedMediaControlElementString(const WTF::String&); + virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&); + virtual WTF::String localizedMediaTimeDescription(float); + virtual WTF::String validationMessageValueMissingText(); + virtual WTF::String validationMessageTypeMismatchText(); + virtual WTF::String validationMessagePatternMismatchText(); + virtual WTF::String validationMessageTooLongText(); + virtual WTF::String validationMessageRangeUnderflowText(); + virtual WTF::String validationMessageRangeOverflowText(); + virtual WTF::String validationMessageStepMismatchText(); + + // WebCore::VisitedLinkStrategy + virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); + virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash); +}; + +#endif // WebPlatformStrategies_h diff --git a/Source/WebKit/qt/WebKit_pch.h b/Source/WebKit/qt/WebKit_pch.h new file mode 100644 index 0000000..f9f0fc1 --- /dev/null +++ b/Source/WebKit/qt/WebKit_pch.h @@ -0,0 +1,80 @@ +/* + * 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 "../../Source/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> +#endif diff --git a/Source/WebKit/qt/declarative/declarative.pro b/Source/WebKit/qt/declarative/declarative.pro new file mode 100644 index 0000000..bc94eed --- /dev/null +++ b/Source/WebKit/qt/declarative/declarative.pro @@ -0,0 +1,73 @@ +TARGET = qmlwebkitplugin +TARGETPATH = QtWebKit + +TEMPLATE = lib +CONFIG += qt plugin + +win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release + +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../.. + +QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir +copy2build.input = QMLDIRFILE +CONFIG(QTDIR_build) { + copy2build.output = $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir +} else { + copy2build.output = $$OUTPUT_DIR/imports/$$TARGETPATH/qmldir +} +!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS +copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy2build.name = COPY ${QMAKE_FILE_IN} +copy2build.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy2build + +TARGET = $$qtLibraryTarget($$TARGET) +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols + +wince*:LIBS += $$QMAKE_LIBS_GUI + +symbian: { + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = All -Tcb + load(armcc_warnings) + TARGET = $$TARGET$${QT_LIBINFIX} +} + +include(../../../../WebKit.pri) + +QT += declarative + +!CONFIG(standalone_package) { + linux-* { + # From Creator's src/rpath.pri: + # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR + # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var. + QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR + MY_RPATH = $$join(QMAKE_RPATHDIR, ":") + + QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\' + QMAKE_RPATHDIR = + } else { + QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR + } +} + +SOURCES += qdeclarativewebview.cpp plugin.cpp +HEADERS += qdeclarativewebview_p.h + +CONFIG(QTDIR_build) { + DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH +} else { + DESTDIR = $$OUTPUT_DIR/imports/$$TARGETPATH +} +target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + + +qmldir.files += $$PWD/qmldir +qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + +symbian:{ + TARGET.UID3 = 0x20021321 +} + +INSTALLS += target qmldir diff --git a/Source/WebKit/qt/declarative/plugin.cpp b/Source/WebKit/qt/declarative/plugin.cpp new file mode 100644 index 0000000..f1f165e --- /dev/null +++ b/Source/WebKit/qt/declarative/plugin.cpp @@ -0,0 +1,43 @@ +/* + 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. +*/ + +#include "qdeclarativewebview_p.h" + +#include <QtDeclarative/qdeclarative.h> +#include <QtDeclarative/qdeclarativeextensionplugin.h> + +QT_BEGIN_NAMESPACE + +class WebKitQmlPlugin : public QDeclarativeExtensionPlugin { + Q_OBJECT +public: + virtual void registerTypes(const char* uri) + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit")); + qmlRegisterType<QDeclarativeWebSettings>(); + qmlRegisterType<QDeclarativeWebView>(uri, 1, 0, "WebView"); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" + +Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin)); + diff --git a/Source/WebKit/qt/declarative/qdeclarativewebview.cpp b/Source/WebKit/qt/declarative/qdeclarativewebview.cpp new file mode 100644 index 0000000..e26889e --- /dev/null +++ b/Source/WebKit/qt/declarative/qdeclarativewebview.cpp @@ -0,0 +1,1061 @@ +/* + 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. +*/ + + +#include "qdeclarativewebview_p.h" + +#include <QtCore/QDebug> +#include <QtCore/QEvent> +#include <QtCore/QFile> +#include <QtDeclarative/QDeclarativeContext> +#include <QtDeclarative/QDeclarativeEngine> +#include <QtDeclarative/qdeclarative.h> +#include <QtGui/QApplication> +#include <QtGui/QGraphicsSceneMouseEvent> +#include <QtGui/QKeyEvent> +#include <QtGui/QMouseEvent> +#include <QtGui/QPen> +#include "qwebelement.h" +#include "qwebframe.h" +#include "qwebpage.h" +#include "qwebsettings.h" + +QT_BEGIN_NAMESPACE + +class QDeclarativeWebViewPrivate { +public: + QDeclarativeWebViewPrivate(QDeclarativeWebView* qq) + : q(qq) + , preferredwidth(0) + , preferredheight(0) + , progress(1.0) + , status(QDeclarativeWebView::Null) + , pending(PendingNone) + , newWindowComponent(0) + , newWindowParent(0) + , rendering(true) + { + } + + QDeclarativeWebView* q; + + QUrl url; // page url might be different if it has not loaded yet + GraphicsWebView* view; + + int preferredwidth, preferredheight; + qreal progress; + QDeclarativeWebView::Status status; + QString statusText; + enum { PendingNone, PendingUrl, PendingHtml, PendingContent } pending; + QUrl pendingUrl; + QString pendingString; + QByteArray pendingData; + mutable QDeclarativeWebSettings settings; + QDeclarativeComponent* newWindowComponent; + QDeclarativeItem* newWindowParent; + + static void windowObjectsAppend(QDeclarativeListProperty<QObject>* prop, QObject* o) + { + static_cast<QDeclarativeWebViewPrivate*>(prop->data)->windowObjects.append(o); + static_cast<QDeclarativeWebViewPrivate*>(prop->data)->updateWindowObjects(); + } + + void updateWindowObjects(); + QObjectList windowObjects; + + bool rendering; +}; + +GraphicsWebView::GraphicsWebView(QDeclarativeWebView* parent) + : QGraphicsWebView(parent) + , parent(parent) + , pressTime(400) +{ +} + +void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event) +{ + pressPoint = event->pos(); + if (pressTime) { + pressTimer.start(pressTime, this); + parent->setKeepMouseGrab(false); + } else { + grabMouse(); + parent->setKeepMouseGrab(true); + } + QGraphicsWebView::mousePressEvent(event); + + QWebHitTestResult hit = page()->mainFrame()->hitTestContent(pressPoint.toPoint()); + if (hit.isContentEditable()) + parent->forceActiveFocus(); + setFocus(); +} + +void GraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) +{ + QGraphicsWebView::mouseReleaseEvent(event); + pressTimer.stop(); + parent->setKeepMouseGrab(false); + ungrabMouse(); +} + +void GraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) +{ + QMouseEvent* me = new QMouseEvent(QEvent::MouseButtonDblClick, (event->pos() / parent->contentsScale()).toPoint(), event->button(), event->buttons(), 0); + emit doubleClick(event->pos().x(), event->pos().y()); + delete me; +} + +void GraphicsWebView::timerEvent(QTimerEvent* event) +{ + if (event->timerId() == pressTimer.timerId()) { + pressTimer.stop(); + grabMouse(); + parent->setKeepMouseGrab(true); + } +} + +void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event) +{ + if (pressTimer.isActive()) { + if ((event->pos() - pressPoint).manhattanLength() > QApplication::startDragDistance()) + pressTimer.stop(); + } + if (parent->keepMouseGrab()) + QGraphicsWebView::mouseMoveEvent(event); +} + +/*! + \qmlclass WebView QDeclarativeWebView + \ingroup qml-view-elements + \since 4.7 + \brief The WebView item allows you to add Web content to a canvas. + \inherits Item + + A WebView renders Web content based on a URL. + + This type is made available by importing the \c QtWebKit module: + + \bold{import QtWebKit 1.0} + + The WebView item includes no scrolling, scaling, toolbars, or other common browser + components. These must be implemented around WebView. See the \l{QML Web Browser} + example for a demonstration of this. + + The page to be displayed by the item is specified using the \l url property, + and this can be changed to fetch and display a new page. While the page loads, + the \l progress property is updated to indicate how much of the page has been + loaded. + + \section1 Appearance + + If the width and height of the item is not set, they will dynamically adjust + to a size appropriate for the content. This width may be large for typical + online web pages, typically greater than 800 by 600 pixels. + + If the \l{Item::}{width} or \l{Item::}{height} is explictly set, the rendered Web site will be + clipped, not scaled, to fit into the set dimensions. + + If the preferredWidth property is set, the width will be this amount or larger, + usually laying out the Web content to fit the preferredWidth. + + The appearance of the content can be controlled to a certain extent by changing + the settings.standardFontFamily property and other settings related to fonts. + + The page can be zoomed by calling the heuristicZoom() method, which performs a + series of tests to determine whether zoomed content will be displayed in an + appropriate way in the space allocated to the item. + + \section1 User Interaction and Navigation + + By default, certain mouse and touch events are delivered to other items in + preference to the Web content. For example, when a scrolling view is created + by placing a WebView in a Flickable, move events are delivered to the Flickable + so that the user can scroll the page. This prevents the user from accidentally + selecting text in a Web page instead of scrolling. + + The pressGrabTime property defines the time the user must touch or press a + mouse button over the WebView before the Web content will receive the move + events it needs to select text and images. + + When this item has keyboard focus, all keyboard input will be sent directly to + the Web page within. + + When the navigates by clicking on links, the item records the pages visited + in its internal history + + Because this item is designed to be used as a component in a browser, it + exposes \l{Action}{actions} for \l back, \l forward, \l reload and \l stop. + These can be triggered to change the current page displayed by the item. + + \section1 Example Usage + + \beginfloatright + \inlineimage webview.png + \endfloat + + The following example displays a scaled down Web page at a fixed size. + + \snippet doc/src/snippets/declarative/webview/webview.qml document + + \clearfloat + + \sa {declarative/modelviews/webview}{WebView example}, {demos/declarative/webbrowser}{Web Browser demo} +*/ + +/*! + \internal + \class QDeclarativeWebView + \brief The QDeclarativeWebView class allows you to add web content to a QDeclarativeView. + + A WebView renders web content base on a URL. + + \image webview.png + + The item includes no scrolling, scaling, + toolbars, etc., those must be implemented around WebView. See the WebBrowser example + for a demonstration of this. + + A QDeclarativeWebView object can be instantiated in Qml using the tag \l WebView. +*/ + +QDeclarativeWebView::QDeclarativeWebView(QDeclarativeItem *parent) : QDeclarativeItem(parent) +{ + init(); +} + +QDeclarativeWebView::~QDeclarativeWebView() +{ + delete d; +} + +void QDeclarativeWebView::init() +{ + d = new QDeclarativeWebViewPrivate(this); + + QWebSettings::enablePersistentStorage(); + + setAcceptedMouseButtons(Qt::LeftButton); + setFlag(QGraphicsItem::ItemHasNoContents, true); + setFlag(QGraphicsItem::ItemIsFocusScope, true); + setClip(true); + + d->view = new GraphicsWebView(this); + d->view->setResizesToContents(true); + d->view->setFocus(); + QWebPage* wp = new QDeclarativeWebPage(this); + setPage(wp); + connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize())); + connect(d->view, SIGNAL(doubleClick(int, int)), this, SIGNAL(doubleClick(int, int))); + connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged())); +} + +void QDeclarativeWebView::componentComplete() +{ + QDeclarativeItem::componentComplete(); + page()->setNetworkAccessManager(qmlEngine(this)->networkAccessManager()); + + switch (d->pending) { + case QDeclarativeWebViewPrivate::PendingUrl: + setUrl(d->pendingUrl); + break; + case QDeclarativeWebViewPrivate::PendingHtml: + setHtml(d->pendingString, d->pendingUrl); + break; + case QDeclarativeWebViewPrivate::PendingContent: + setContent(d->pendingData, d->pendingString, d->pendingUrl); + break; + default: + break; + } + d->pending = QDeclarativeWebViewPrivate::PendingNone; + d->updateWindowObjects(); +} + +QDeclarativeWebView::Status QDeclarativeWebView::status() const +{ + return d->status; +} + + +/*! + \qmlproperty real WebView::progress + This property holds the progress of loading the current URL, from 0 to 1. + + If you just want to know when progress gets to 1, use + WebView::onLoadFinished() or WebView::onLoadFailed() instead. +*/ +qreal QDeclarativeWebView::progress() const +{ + return d->progress; +} + +void QDeclarativeWebView::doLoadStarted() +{ + if (!d->url.isEmpty()) { + d->status = Loading; + emit statusChanged(d->status); + } + emit loadStarted(); +} + +void QDeclarativeWebView::doLoadProgress(int p) +{ + if (d->progress == p / 100.0) + return; + d->progress = p / 100.0; + emit progressChanged(); +} + +void QDeclarativeWebView::pageUrlChanged() +{ + updateContentsSize(); + + if ((d->url.isEmpty() && page()->mainFrame()->url() != QUrl(QLatin1String("about:blank"))) + || (d->url != page()->mainFrame()->url() && !page()->mainFrame()->url().isEmpty())) + { + d->url = page()->mainFrame()->url(); + if (d->url == QUrl(QLatin1String("about:blank"))) + d->url = QUrl(); + emit urlChanged(); + } +} + +void QDeclarativeWebView::doLoadFinished(bool ok) +{ + if (ok) { + d->status = d->url.isEmpty() ? Null : Ready; + emit loadFinished(); + } else { + d->status = Error; + emit loadFailed(); + } + emit statusChanged(d->status); +} + +/*! + \qmlproperty url WebView::url + This property holds the URL to the page displayed in this item. It can be set, + but also can change spontaneously (eg. because of network redirection). + + If the url is empty, the page is blank. + + The url is always absolute (QML will resolve relative URL strings in the context + of the containing QML document). +*/ +QUrl QDeclarativeWebView::url() const +{ + return d->url; +} + +void QDeclarativeWebView::setUrl(const QUrl& url) +{ + if (url == d->url) + return; + + if (isComponentComplete()) { + d->url = url; + updateContentsSize(); + QUrl seturl = url; + if (seturl.isEmpty()) + seturl = QUrl(QLatin1String("about:blank")); + + Q_ASSERT(!seturl.isRelative()); + + page()->mainFrame()->load(seturl); + + emit urlChanged(); + } else { + d->pending = d->PendingUrl; + d->pendingUrl = url; + } +} + +/*! + \qmlproperty int WebView::preferredWidth + This property holds the ideal width for displaying the current URL. +*/ +int QDeclarativeWebView::preferredWidth() const +{ + return d->preferredwidth; +} + +void QDeclarativeWebView::setPreferredWidth(int width) +{ + if (d->preferredwidth == width) + return; + d->preferredwidth = width; + updateContentsSize(); + emit preferredWidthChanged(); +} + +/*! + \qmlproperty int WebView::preferredHeight + This property holds the ideal height for displaying the current URL. + This only affects the area zoomed by heuristicZoom(). +*/ +int QDeclarativeWebView::preferredHeight() const +{ + return d->preferredheight; +} + +void QDeclarativeWebView::setPreferredHeight(int height) +{ + if (d->preferredheight == height) + return; + d->preferredheight = height; + updateContentsSize(); + emit preferredHeightChanged(); +} + +/*! + \qmlmethod bool WebView::evaluateJavaScript(string scriptSource) + + Evaluates the \a scriptSource JavaScript inside the context of the + main web frame, and returns the result of the last executed statement. + + Note that this JavaScript does \e not have any access to QML objects + except as made available as windowObjects. +*/ +QVariant QDeclarativeWebView::evaluateJavaScript(const QString& scriptSource) +{ + return this->page()->mainFrame()->evaluateJavaScript(scriptSource); +} + +void QDeclarativeWebView::updateDeclarativeWebViewSize() +{ + QSizeF size = d->view->geometry().size() * contentsScale(); + setImplicitWidth(size.width()); + setImplicitHeight(size.height()); +} + +void QDeclarativeWebView::initialLayout() +{ + // nothing useful to do at this point +} + +void QDeclarativeWebView::updateContentsSize() +{ + if (page()) { + page()->setPreferredContentsSize(QSize( + d->preferredwidth>0 ? d->preferredwidth : width(), + d->preferredheight>0 ? d->preferredheight : height())); + } +} + +void QDeclarativeWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry) +{ + QWebPage* webPage = page(); + if (newGeometry.size() != oldGeometry.size() && webPage) { + QSize contentSize = webPage->preferredContentsSize(); + if (widthValid()) + contentSize.setWidth(width()); + if (heightValid()) + contentSize.setHeight(height()); + if (contentSize != webPage->preferredContentsSize()) + webPage->setPreferredContentsSize(contentSize); + } + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); +} + +/*! + \qmlproperty list<object> WebView::javaScriptWindowObjects + + A list of QML objects to expose to the web page. + + Each object will be added as a property of the web frame's window object. The + property name is controlled by the value of \c WebView.windowObjectName + attached property. + + Exposing QML objects to a web page allows JavaScript executing in the web + page itself to communicate with QML, by reading and writing properties and + by calling methods of the exposed QML objects. + + This example shows how to call into a QML method using a window object. + + \qml + WebView { + javaScriptWindowObjects: QtObject { + WebView.windowObjectName: "qml" + + function qmlCall() { + console.log("This call is in QML!"); + } + } + + html: "<script>console.log(\"This is in WebKit!\"); window.qml.qmlCall();</script>" + } + \endqml + + The output of the example will be: + \code + This is in WebKit! + This call is in QML! + \endcode + + If Javascript is not enabled for the page, then this property does nothing. +*/ +QDeclarativeListProperty<QObject> QDeclarativeWebView::javaScriptWindowObjects() +{ + return QDeclarativeListProperty<QObject>(this, d, &QDeclarativeWebViewPrivate::windowObjectsAppend); +} + +QDeclarativeWebViewAttached* QDeclarativeWebView::qmlAttachedProperties(QObject* o) +{ + return new QDeclarativeWebViewAttached(o); +} + +void QDeclarativeWebViewPrivate::updateWindowObjects() +{ + if (!q->isComponentCompletePublic() || !q->page()) + return; + + for (int i = 0; i < windowObjects.count(); ++i) { + QObject* object = windowObjects.at(i); + QDeclarativeWebViewAttached* attached = static_cast<QDeclarativeWebViewAttached *>(qmlAttachedPropertiesObject<QDeclarativeWebView>(object)); + if (attached && !attached->windowObjectName().isEmpty()) + q->page()->mainFrame()->addToJavaScriptWindowObject(attached->windowObjectName(), object); + } +} + +bool QDeclarativeWebView::renderingEnabled() const +{ + return d->rendering; +} + +void QDeclarativeWebView::setRenderingEnabled(bool enabled) +{ + if (d->rendering == enabled) + return; + d->rendering = enabled; + emit renderingEnabledChanged(); + d->view->setTiledBackingStoreFrozen(!enabled); +} + +/*! + \qmlsignal WebView::onDoubleClick(int clickx, int clicky) + + The WebView does not pass double-click events to the web engine, but rather + emits this signals. +*/ + +/*! + \qmlmethod bool WebView::heuristicZoom(int clickX, int clickY, real maxzoom) + + Finds a zoom that: + \list + \i shows a whole item + \i includes (\a clickX, \a clickY) + \i fits into the preferredWidth and preferredHeight + \i zooms by no more than \a maxZoom + \i is more than 10% above the current zoom + \endlist + + If such a zoom exists, emits zoomTo(zoom,centerX,centerY) and returns true; otherwise, + no signal is emitted and returns false. +*/ +bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxZoom) +{ + if (contentsScale() >= maxZoom / scale()) + return false; + qreal ozf = contentsScale(); + QRect showArea = elementAreaAt(clickX, clickY, d->preferredwidth / maxZoom, d->preferredheight / maxZoom); + qreal z = qMin(qreal(d->preferredwidth) / showArea.width(), qreal(d->preferredheight) / showArea.height()); + if (z > maxZoom / scale()) + z = maxZoom / scale(); + if (z / ozf > 1.2) { + QRectF r(showArea.left() * z, showArea.top() * z, showArea.width() * z, showArea.height() * z); + emit zoomTo(z, r.x() + r.width() / 2, r.y() + r.height() / 2); + return true; + } + return false; +} + +/*! + \qmlproperty int WebView::pressGrabTime + + The number of milliseconds the user must press before the WebView + starts passing move events through to the Web engine (rather than + letting other QML elements such as a Flickable take them). + + Defaults to 400ms. Set to 0 to always grab and pass move events to + the Web engine. +*/ +int QDeclarativeWebView::pressGrabTime() const +{ + return d->view->pressTime; +} + +void QDeclarativeWebView::setPressGrabTime(int millis) +{ + if (d->view->pressTime == millis) + return; + d->view->pressTime = millis; + emit pressGrabTimeChanged(); +} + +#ifndef QT_NO_ACTION +/*! + \qmlproperty action WebView::back + This property holds the action for causing the previous URL in the history to be displayed. +*/ +QAction* QDeclarativeWebView::backAction() const +{ + return page()->action(QWebPage::Back); +} + +/*! + \qmlproperty action WebView::forward + This property holds the action for causing the next URL in the history to be displayed. +*/ +QAction* QDeclarativeWebView::forwardAction() const +{ + return page()->action(QWebPage::Forward); +} + +/*! + \qmlproperty action WebView::reload + This property holds the action for reloading with the current URL +*/ +QAction* QDeclarativeWebView::reloadAction() const +{ + return page()->action(QWebPage::Reload); +} + +/*! + \qmlproperty action WebView::stop + This property holds the action for stopping loading with the current URL +*/ +QAction* QDeclarativeWebView::stopAction() const +{ + return page()->action(QWebPage::Stop); +} +#endif // QT_NO_ACTION + +/*! + \qmlproperty string WebView::title + This property holds the title of the web page currently viewed + + By default, this property contains an empty string. +*/ +QString QDeclarativeWebView::title() const +{ + return page()->mainFrame()->title(); +} + +/*! + \qmlproperty pixmap WebView::icon + This property holds the icon associated with the web page currently viewed +*/ +QPixmap QDeclarativeWebView::icon() const +{ + return page()->mainFrame()->icon().pixmap(QSize(256, 256)); +} + +/*! + \qmlproperty string WebView::statusText + + This property is the current status suggested by the current web page. In a web browser, + such status is often shown in some kind of status bar. +*/ +void QDeclarativeWebView::setStatusText(const QString& text) +{ + d->statusText = text; + emit statusTextChanged(); +} + +void QDeclarativeWebView::windowObjectCleared() +{ + d->updateWindowObjects(); +} + +QString QDeclarativeWebView::statusText() const +{ + return d->statusText; +} + +QWebPage* QDeclarativeWebView::page() const +{ + return d->view->page(); +} + +// The QObject interface to settings(). +/*! + \qmlproperty string WebView::settings.standardFontFamily + \qmlproperty string WebView::settings.fixedFontFamily + \qmlproperty string WebView::settings.serifFontFamily + \qmlproperty string WebView::settings.sansSerifFontFamily + \qmlproperty string WebView::settings.cursiveFontFamily + \qmlproperty string WebView::settings.fantasyFontFamily + + \qmlproperty int WebView::settings.minimumFontSize + \qmlproperty int WebView::settings.minimumLogicalFontSize + \qmlproperty int WebView::settings.defaultFontSize + \qmlproperty int WebView::settings.defaultFixedFontSize + + \qmlproperty bool WebView::settings.autoLoadImages + \qmlproperty bool WebView::settings.javascriptEnabled + \qmlproperty bool WebView::settings.javaEnabled + \qmlproperty bool WebView::settings.pluginsEnabled + \qmlproperty bool WebView::settings.privateBrowsingEnabled + \qmlproperty bool WebView::settings.javascriptCanOpenWindows + \qmlproperty bool WebView::settings.javascriptCanAccessClipboard + \qmlproperty bool WebView::settings.developerExtrasEnabled + \qmlproperty bool WebView::settings.linksIncludedInFocusChain + \qmlproperty bool WebView::settings.zoomTextOnly + \qmlproperty bool WebView::settings.printElementBackgrounds + \qmlproperty bool WebView::settings.offlineStorageDatabaseEnabled + \qmlproperty bool WebView::settings.offlineWebApplicationCacheEnabled + \qmlproperty bool WebView::settings.localStorageDatabaseEnabled + \qmlproperty bool WebView::settings.localContentCanAccessRemoteUrls + + These properties give access to the settings controlling the web view. + + See QWebSettings for details of these properties. + + \qml + WebView { + settings.pluginsEnabled: true + settings.standardFontFamily: "Arial" + ... + } + \endqml +*/ +QDeclarativeWebSettings* QDeclarativeWebView::settingsObject() const +{ + d->settings.s = page()->settings(); + return &d->settings; +} + +void QDeclarativeWebView::setPage(QWebPage* page) +{ + if (d->view->page() == page) + return; + + d->view->setPage(page); + updateContentsSize(); + page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); + page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); + connect(page->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(pageUrlChanged())); + connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString))); + connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(iconChanged())); + connect(page->mainFrame(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged())); + connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayout())); + connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SIGNAL(contentsSizeChanged(QSize))); + + connect(page, SIGNAL(loadStarted()), this, SLOT(doLoadStarted())); + connect(page, SIGNAL(loadProgress(int)), this, SLOT(doLoadProgress(int))); + connect(page, SIGNAL(loadFinished(bool)), this, SLOT(doLoadFinished(bool))); + connect(page, SIGNAL(statusBarMessage(QString)), this, SLOT(setStatusText(QString))); + + connect(page->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(windowObjectCleared())); + + page->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); + +} + +/*! + \qmlsignal WebView::onLoadStarted() + + This handler is called when the web engine begins loading + a page. Later, WebView::onLoadFinished() or WebView::onLoadFailed() + will be emitted. +*/ + +/*! + \qmlsignal WebView::onLoadFinished() + + This handler is called when the web engine \e successfully + finishes loading a page, including any component content + (WebView::onLoadFailed() will be emitted otherwise). + + \sa progress +*/ + +/*! + \qmlsignal WebView::onLoadFailed() + + This handler is called when the web engine fails loading + a page or any component content + (WebView::onLoadFinished() will be emitted on success). +*/ + +void QDeclarativeWebView::load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation, const QByteArray& body) +{ + page()->mainFrame()->load(request, operation, body); +} + +QString QDeclarativeWebView::html() const +{ + return page()->mainFrame()->toHtml(); +} + +/*! + \qmlproperty string WebView::html + This property holds HTML text set directly + + The html property can be set as a string. + + \qml + WebView { + html: "<p>This is <b>HTML</b>." + } + \endqml +*/ +void QDeclarativeWebView::setHtml(const QString& html, const QUrl& baseUrl) +{ + updateContentsSize(); + if (isComponentComplete()) + page()->mainFrame()->setHtml(html, baseUrl); + else { + d->pending = d->PendingHtml; + d->pendingUrl = baseUrl; + d->pendingString = html; + } + emit htmlChanged(); +} + +void QDeclarativeWebView::setContent(const QByteArray& data, const QString& mimeType, const QUrl& baseUrl) +{ + updateContentsSize(); + + if (isComponentComplete()) + page()->mainFrame()->setContent(data, mimeType, qmlContext(this)->resolvedUrl(baseUrl)); + else { + d->pending = d->PendingContent; + d->pendingUrl = baseUrl; + d->pendingString = mimeType; + d->pendingData = data; + } +} + +QWebHistory* QDeclarativeWebView::history() const +{ + return page()->history(); +} + +QWebSettings* QDeclarativeWebView::settings() const +{ + return page()->settings(); +} + +QDeclarativeWebView* QDeclarativeWebView::createWindow(QWebPage::WebWindowType type) +{ + switch (type) { + case QWebPage::WebBrowserWindow: { + if (!d->newWindowComponent && d->newWindowParent) + qWarning("WebView::newWindowComponent not set - WebView::newWindowParent ignored"); + else if (d->newWindowComponent && !d->newWindowParent) + qWarning("WebView::newWindowParent not set - WebView::newWindowComponent ignored"); + else if (d->newWindowComponent && d->newWindowParent) { + QDeclarativeWebView* webview = 0; + QDeclarativeContext* windowContext = new QDeclarativeContext(qmlContext(this)); + + QObject* newObject = d->newWindowComponent->create(windowContext); + if (newObject) { + windowContext->setParent(newObject); + QDeclarativeItem* item = qobject_cast<QDeclarativeItem *>(newObject); + if (!item) + delete newObject; + else { + webview = item->findChild<QDeclarativeWebView*>(); + if (!webview) + delete item; + else { + newObject->setParent(d->newWindowParent); + static_cast<QGraphicsObject*>(item)->setParentItem(d->newWindowParent); + } + } + } else + delete windowContext; + + return webview; + } + } + break; + case QWebPage::WebModalDialog: { + // Not supported + } + } + return 0; +} + +/*! + \qmlproperty component WebView::newWindowComponent + + This property holds the component to use for new windows. + The component must have a WebView somewhere in its structure. + + When the web engine requests a new window, it will be an instance of + this component. + + The parent of the new window is set by newWindowParent. It must be set. +*/ +QDeclarativeComponent* QDeclarativeWebView::newWindowComponent() const +{ + return d->newWindowComponent; +} + +void QDeclarativeWebView::setNewWindowComponent(QDeclarativeComponent* newWindow) +{ + if (newWindow == d->newWindowComponent) + return; + d->newWindowComponent = newWindow; + emit newWindowComponentChanged(); +} + + +/*! + \qmlproperty item WebView::newWindowParent + + The parent item for new windows. + + \sa newWindowComponent +*/ +QDeclarativeItem* QDeclarativeWebView::newWindowParent() const +{ + return d->newWindowParent; +} + +void QDeclarativeWebView::setNewWindowParent(QDeclarativeItem* parent) +{ + if (parent == d->newWindowParent) + return; + if (d->newWindowParent && parent) { + QList<QGraphicsItem *> children = d->newWindowParent->childItems(); + for (int i = 0; i < children.count(); ++i) + children.at(i)->setParentItem(parent); + } + d->newWindowParent = parent; + emit newWindowParentChanged(); +} + +QSize QDeclarativeWebView::contentsSize() const +{ + return page()->mainFrame()->contentsSize() * contentsScale(); +} + +qreal QDeclarativeWebView::contentsScale() const +{ + return d->view->scale(); +} + +void QDeclarativeWebView::setContentsScale(qreal scale) +{ + if (scale == d->view->scale()) + return; + d->view->setScale(scale); + updateDeclarativeWebViewSize(); + emit contentsScaleChanged(); +} + +/*! + Returns the area of the largest element at position (\a x,\a y) that is no larger + than \a maxWidth by \a maxHeight pixels. + + May return an area larger in the case when no smaller element is at the position. +*/ +QRect QDeclarativeWebView::elementAreaAt(int x, int y, int maxWidth, int maxHeight) const +{ + QWebHitTestResult hit = page()->mainFrame()->hitTestContent(QPoint(x, y)); + QRect hitRect = hit.boundingRect(); + QWebElement element = hit.enclosingBlockElement(); + if (maxWidth <= 0) + maxWidth = INT_MAX; + if (maxHeight <= 0) + maxHeight = INT_MAX; + while (!element.parent().isNull() && element.geometry().width() <= maxWidth && element.geometry().height() <= maxHeight) { + hitRect = element.geometry(); + element = element.parent(); + } + return hitRect; +} + +/*! + \internal + \class QDeclarativeWebPage + \brief The QDeclarativeWebPage class is a QWebPage that can create QML plugins. + + \sa QDeclarativeWebView +*/ +QDeclarativeWebPage::QDeclarativeWebPage(QDeclarativeWebView* parent) : + QWebPage(parent) +{ +} + +QDeclarativeWebPage::~QDeclarativeWebPage() +{ +} + +QString QDeclarativeWebPage::chooseFile(QWebFrame* originatingFrame, const QString& oldFile) +{ + // Not supported (it's modal) + Q_UNUSED(originatingFrame) + Q_UNUSED(oldFile) + return oldFile; +} + +/*! + \qmlsignal WebView::onAlert(string message) + + The handler is called when the web engine sends a JavaScript alert. The \a message is the text + to be displayed in the alert to the user. +*/ + + +void QDeclarativeWebPage::javaScriptAlert(QWebFrame* originatingFrame, const QString& msg) +{ + Q_UNUSED(originatingFrame) + emit viewItem()->alert(msg); +} + +bool QDeclarativeWebPage::javaScriptConfirm(QWebFrame* originatingFrame, const QString& msg) +{ + // Not supported (it's modal) + Q_UNUSED(originatingFrame) + Q_UNUSED(msg) + return false; +} + +bool QDeclarativeWebPage::javaScriptPrompt(QWebFrame* originatingFrame, const QString& msg, const QString& defaultValue, QString* result) +{ + // Not supported (it's modal) + Q_UNUSED(originatingFrame) + Q_UNUSED(msg) + Q_UNUSED(defaultValue) + Q_UNUSED(result) + return false; +} + + +QDeclarativeWebView* QDeclarativeWebPage::viewItem() +{ + return static_cast<QDeclarativeWebView*>(parent()); +} + +QWebPage* QDeclarativeWebPage::createWindow(WebWindowType type) +{ + QDeclarativeWebView* newView = viewItem()->createWindow(type); + if (newView) + return newView->page(); + return 0; +} + +QT_END_NAMESPACE + diff --git a/Source/WebKit/qt/declarative/qdeclarativewebview_p.h b/Source/WebKit/qt/declarative/qdeclarativewebview_p.h new file mode 100644 index 0000000..b2055bf --- /dev/null +++ b/Source/WebKit/qt/declarative/qdeclarativewebview_p.h @@ -0,0 +1,371 @@ +/* + 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. +*/ + + +#ifndef qdeclarativewebview_p_h +#define qdeclarativewebview_p_h + +#include <QtCore/QBasicTimer> +#include <QtCore/QUrl> +#include <QtDeclarative/QDeclarativeItem> +#include <QtGui/QAction> +#include <QtNetwork/QNetworkAccessManager> +#include "qgraphicswebview.h" +#include "qwebpage.h" + + +QT_BEGIN_HEADER + +class QWebHistory; +class QWebSettings; + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) +class QDeclarativeWebSettings; +class QDeclarativeWebViewPrivate; +class QNetworkRequest; +class QDeclarativeWebView; +class QDeclarativeWebViewPrivate; + +class QDeclarativeWebPage : public QWebPage { + Q_OBJECT +public: + explicit QDeclarativeWebPage(QDeclarativeWebView *parent); + ~QDeclarativeWebPage(); +protected: + QWebPage *createWindow(WebWindowType type); + QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile); + void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg); + bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg); + bool javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result); + +private: + QDeclarativeWebView *viewItem(); +}; + +class GraphicsWebView : public QGraphicsWebView { + Q_OBJECT +public: + GraphicsWebView(QDeclarativeWebView* parent = 0); +protected: + void mousePressEvent(QGraphicsSceneMouseEvent* event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); + void mouseMoveEvent(QGraphicsSceneMouseEvent* event); + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + void timerEvent(QTimerEvent* event); +Q_SIGNALS: + void doubleClick(int clickX, int clickY); +private: + QDeclarativeWebView *parent; + QPointF pressPoint; + QBasicTimer pressTimer; + int pressTime; // milliseconds before the touch event becomes a "tap and hold" + friend class QDeclarativeWebView; +}; + +class QDeclarativeWebViewAttached; + +// TODO: browser plugins + +class QDeclarativeWebView : public QDeclarativeItem { + Q_OBJECT + + Q_ENUMS(Status SelectionMode) + + Q_PROPERTY(QString title READ title NOTIFY titleChanged) + Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged) + Q_PROPERTY(QString statusText READ statusText NOTIFY statusTextChanged) + + Q_PROPERTY(QString html READ html WRITE setHtml NOTIFY htmlChanged) + + Q_PROPERTY(int pressGrabTime READ pressGrabTime WRITE setPressGrabTime NOTIFY pressGrabTimeChanged) + + Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged) + Q_PROPERTY(int preferredHeight READ preferredHeight WRITE setPreferredHeight NOTIFY preferredHeightChanged) + Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) + Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) + Q_PROPERTY(Status status READ status NOTIFY statusChanged) + +#ifndef QT_NO_ACTION + Q_PROPERTY(QAction* reload READ reloadAction CONSTANT) + Q_PROPERTY(QAction* back READ backAction CONSTANT) + Q_PROPERTY(QAction* forward READ forwardAction CONSTANT) + Q_PROPERTY(QAction* stop READ stopAction CONSTANT) +#endif + + Q_PROPERTY(QDeclarativeWebSettings* settings READ settingsObject CONSTANT) + + Q_PROPERTY(QDeclarativeListProperty<QObject> javaScriptWindowObjects READ javaScriptWindowObjects CONSTANT) + + Q_PROPERTY(QDeclarativeComponent* newWindowComponent READ newWindowComponent WRITE setNewWindowComponent NOTIFY newWindowComponentChanged) + Q_PROPERTY(QDeclarativeItem* newWindowParent READ newWindowParent WRITE setNewWindowParent NOTIFY newWindowParentChanged) + + Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged) + + Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeChanged) + Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged) + +public: + QDeclarativeWebView(QDeclarativeItem *parent = 0); + ~QDeclarativeWebView(); + + QUrl url() const; + void setUrl(const QUrl &); + + QString title() const; + + QPixmap icon() const; + + Q_INVOKABLE bool heuristicZoom(int clickX, int clickY, qreal maxzoom); + QRect elementAreaAt(int x, int y, int minwidth, int minheight) const; + + int pressGrabTime() const; + void setPressGrabTime(int); + + int preferredWidth() const; + void setPreferredWidth(int); + int preferredHeight() const; + void setPreferredHeight(int); + + enum Status { Null, Ready, Loading, Error }; + Status status() const; + qreal progress() const; + QString statusText() const; + +#ifndef QT_NO_ACTION + QAction *reloadAction() const; + QAction *backAction() const; + QAction *forwardAction() const; + QAction *stopAction() const; +#endif + + QWebPage *page() const; + void setPage(QWebPage *page); + + void load(const QNetworkRequest &request, + QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, + const QByteArray &body = QByteArray()); + + QString html() const; + + 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; + QDeclarativeWebSettings *settingsObject() const; + + bool renderingEnabled() const; + void setRenderingEnabled(bool); + + QDeclarativeListProperty<QObject> javaScriptWindowObjects(); + + static QDeclarativeWebViewAttached* qmlAttachedProperties(QObject*); + + QDeclarativeComponent *newWindowComponent() const; + void setNewWindowComponent(QDeclarativeComponent *newWindow); + QDeclarativeItem* newWindowParent() const; + void setNewWindowParent(QDeclarativeItem* newWindow); + + bool isComponentCompletePublic() const { return isComponentComplete(); } + + QSize contentsSize() const; + + void setContentsScale(qreal scale); + qreal contentsScale() const; + +Q_SIGNALS: + void preferredWidthChanged(); + void preferredHeightChanged(); + void urlChanged(); + void progressChanged(); + void statusChanged(Status); + void titleChanged(const QString&); + void iconChanged(); + void statusTextChanged(); + void htmlChanged(); + void pressGrabTimeChanged(); + void newWindowComponentChanged(); + void newWindowParentChanged(); + void renderingEnabledChanged(); + void contentsSizeChanged(const QSize&); + void contentsScaleChanged(); + + void loadStarted(); + void loadFinished(); + void loadFailed(); + + void doubleClick(int clickX, int clickY); + + void zoomTo(qreal zoom, int centerX, int centerY); + + void alert(const QString& message); + +public Q_SLOTS: + QVariant evaluateJavaScript(const QString&); + +private Q_SLOTS: + void doLoadStarted(); + void doLoadProgress(int p); + void doLoadFinished(bool ok); + void setStatusText(const QString&); + void windowObjectCleared(); + void pageUrlChanged(); + void initialLayout(); + + void updateDeclarativeWebViewSize(); + + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + QDeclarativeWebView* createWindow(QWebPage::WebWindowType type); + +private: + void updateContentsSize(); + void init(); + virtual void componentComplete(); + Q_DISABLE_COPY(QDeclarativeWebView) + QDeclarativeWebViewPrivate* d; + QMouseEvent* sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent*); + QMouseEvent* sceneHoverMoveEventToMouseEvent(QGraphicsSceneHoverEvent*); + friend class QDeclarativeWebPage; +}; + +class QDeclarativeWebViewAttached : public QObject { + Q_OBJECT + Q_PROPERTY(QString windowObjectName READ windowObjectName WRITE setWindowObjectName) +public: + QDeclarativeWebViewAttached(QObject* parent) + : QObject(parent) + { + } + + QString windowObjectName() const + { + return m_windowObjectName; + } + + void setWindowObjectName(const QString &n) + { + m_windowObjectName = n; + } + +private: + QString m_windowObjectName; +}; + +class QDeclarativeWebSettings : public QObject { + Q_OBJECT + + Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily) + Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily) + Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily) + Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily) + Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily) + Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily) + + Q_PROPERTY(int minimumFontSize READ minimumFontSize WRITE setMinimumFontSize) + Q_PROPERTY(int minimumLogicalFontSize READ minimumLogicalFontSize WRITE setMinimumLogicalFontSize) + Q_PROPERTY(int defaultFontSize READ defaultFontSize WRITE setDefaultFontSize) + Q_PROPERTY(int defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize) + + Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages) + Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled) + Q_PROPERTY(bool javaEnabled READ javaEnabled WRITE setJavaEnabled) + Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled) + Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled) + Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows) + Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard) + Q_PROPERTY(bool developerExtrasEnabled READ developerExtrasEnabled WRITE setDeveloperExtrasEnabled) + Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain) + Q_PROPERTY(bool zoomTextOnly READ zoomTextOnly WRITE setZoomTextOnly) + Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds) + Q_PROPERTY(bool offlineStorageDatabaseEnabled READ offlineStorageDatabaseEnabled WRITE setOfflineStorageDatabaseEnabled) + Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled) + Q_PROPERTY(bool localStorageDatabaseEnabled READ localStorageDatabaseEnabled WRITE setLocalStorageDatabaseEnabled) + Q_PROPERTY(bool localContentCanAccessRemoteUrls READ localContentCanAccessRemoteUrls WRITE setLocalContentCanAccessRemoteUrls) + +public: + QDeclarativeWebSettings() {} + + QString standardFontFamily() const { return s->fontFamily(QWebSettings::StandardFont); } + void setStandardFontFamily(const QString& f) { s->setFontFamily(QWebSettings::StandardFont, f); } + QString fixedFontFamily() const { return s->fontFamily(QWebSettings::FixedFont); } + void setFixedFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FixedFont, f); } + QString serifFontFamily() const { return s->fontFamily(QWebSettings::SerifFont); } + void setSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SerifFont, f); } + QString sansSerifFontFamily() const { return s->fontFamily(QWebSettings::SansSerifFont); } + void setSansSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SansSerifFont, f); } + QString cursiveFontFamily() const { return s->fontFamily(QWebSettings::CursiveFont); } + void setCursiveFontFamily(const QString& f) { s->setFontFamily(QWebSettings::CursiveFont, f); } + QString fantasyFontFamily() const { return s->fontFamily(QWebSettings::FantasyFont); } + void setFantasyFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FantasyFont, f); } + + int minimumFontSize() const { return s->fontSize(QWebSettings::MinimumFontSize); } + void setMinimumFontSize(int size) { s->setFontSize(QWebSettings::MinimumFontSize, size); } + int minimumLogicalFontSize() const { return s->fontSize(QWebSettings::MinimumLogicalFontSize); } + void setMinimumLogicalFontSize(int size) { s->setFontSize(QWebSettings::MinimumLogicalFontSize, size); } + int defaultFontSize() const { return s->fontSize(QWebSettings::DefaultFontSize); } + void setDefaultFontSize(int size) { s->setFontSize(QWebSettings::DefaultFontSize, size); } + int defaultFixedFontSize() const { return s->fontSize(QWebSettings::DefaultFixedFontSize); } + void setDefaultFixedFontSize(int size) { s->setFontSize(QWebSettings::DefaultFixedFontSize, size); } + + bool autoLoadImages() const { return s->testAttribute(QWebSettings::AutoLoadImages); } + void setAutoLoadImages(bool on) { s->setAttribute(QWebSettings::AutoLoadImages, on); } + bool javascriptEnabled() const { return s->testAttribute(QWebSettings::JavascriptEnabled); } + void setJavascriptEnabled(bool on) { s->setAttribute(QWebSettings::JavascriptEnabled, on); } + bool javaEnabled() const { return s->testAttribute(QWebSettings::JavaEnabled); } + void setJavaEnabled(bool on) { s->setAttribute(QWebSettings::JavaEnabled, on); } + bool pluginsEnabled() const { return s->testAttribute(QWebSettings::PluginsEnabled); } + void setPluginsEnabled(bool on) { s->setAttribute(QWebSettings::PluginsEnabled, on); } + bool privateBrowsingEnabled() const { return s->testAttribute(QWebSettings::PrivateBrowsingEnabled); } + void setPrivateBrowsingEnabled(bool on) { s->setAttribute(QWebSettings::PrivateBrowsingEnabled, on); } + bool javascriptCanOpenWindows() const { return s->testAttribute(QWebSettings::JavascriptCanOpenWindows); } + void setJavascriptCanOpenWindows(bool on) { s->setAttribute(QWebSettings::JavascriptCanOpenWindows, on); } + bool javascriptCanAccessClipboard() const { return s->testAttribute(QWebSettings::JavascriptCanAccessClipboard); } + void setJavascriptCanAccessClipboard(bool on) { s->setAttribute(QWebSettings::JavascriptCanAccessClipboard, on); } + bool developerExtrasEnabled() const { return s->testAttribute(QWebSettings::DeveloperExtrasEnabled); } + void setDeveloperExtrasEnabled(bool on) { s->setAttribute(QWebSettings::DeveloperExtrasEnabled, on); } + bool linksIncludedInFocusChain() const { return s->testAttribute(QWebSettings::LinksIncludedInFocusChain); } + void setLinksIncludedInFocusChain(bool on) { s->setAttribute(QWebSettings::LinksIncludedInFocusChain, on); } + bool zoomTextOnly() const { return s->testAttribute(QWebSettings::ZoomTextOnly); } + void setZoomTextOnly(bool on) { s->setAttribute(QWebSettings::ZoomTextOnly, on); } + bool printElementBackgrounds() const { return s->testAttribute(QWebSettings::PrintElementBackgrounds); } + void setPrintElementBackgrounds(bool on) { s->setAttribute(QWebSettings::PrintElementBackgrounds, on); } + bool offlineStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled); } + void setOfflineStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, on); } + bool offlineWebApplicationCacheEnabled() const { return s->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled); } + void setOfflineWebApplicationCacheEnabled(bool on) { s->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, on); } + bool localStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::LocalStorageDatabaseEnabled); } + void setLocalStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, on); } + bool localContentCanAccessRemoteUrls() const { return s->testAttribute(QWebSettings::LocalContentCanAccessRemoteUrls); } + void setLocalContentCanAccessRemoteUrls(bool on) { s->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, on); } + + QWebSettings *s; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QDeclarativeWebView) +QML_DECLARE_TYPE(QDeclarativeWebSettings) +QML_DECLARE_TYPEINFO(QDeclarativeWebView, QML_HAS_ATTACHED_PROPERTIES) + +QT_END_HEADER + +#endif diff --git a/Source/WebKit/qt/declarative/qmldir b/Source/WebKit/qt/declarative/qmldir new file mode 100644 index 0000000..dcfdd06 --- /dev/null +++ b/Source/WebKit/qt/declarative/qmldir @@ -0,0 +1 @@ +plugin qmlwebkitplugin diff --git a/Source/WebKit/qt/docs/docs.pri b/Source/WebKit/qt/docs/docs.pri new file mode 100644 index 0000000..d87dcd6 --- /dev/null +++ b/Source/WebKit/qt/docs/docs.pri @@ -0,0 +1,15 @@ +include(../../../../WebKit.pri) + +unix { + QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/bin/qdoc3 +} else { + QDOC = $$(QTDIR)\\bin\\qdoc3.exe +} + +unix { +docs.commands = $$QDOC $$PWD/qtwebkit.qdocconf +} else { +docs.commands = \"$$QDOC $$PWD/qtwebkit.qdocconf\" +} + +QMAKE_EXTRA_TARGETS += docs diff --git a/Source/WebKit/qt/docs/qtwebkit-bridge.qdoc b/Source/WebKit/qt/docs/qtwebkit-bridge.qdoc new file mode 100644 index 0000000..0947a0a --- /dev/null +++ b/Source/WebKit/qt/docs/qtwebkit-bridge.qdoc @@ -0,0 +1,423 @@ +/*! + \inmodule QtWebKit + \page qtwebkit-bridge.html + \title The QtWebKit Bridge + \contentspage QtWebKit + \section1 Overview + \section2 The technology + + The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native + objects represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection, + a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment. + For example \l{QObject} properties map directly to JavaScript properties. + + \section2 Use Cases + + There are two main use cases for the QtWebKit bridge: web content in native applications and thin clients. + + \section3 Web Content in Native Applications + + This is a common use case in classic Qt application, and a design pattern used by several modern + applications like an application that contains a media-player, playlist manager, and music store. + The playlist manager is usually best authored as a classic desktop application, + with the native-looking robust \l{QWidget}s as the application's backbone. + The media-player control usually has a custom look and feel and is best written using the \l{Graphics View framework} + or \l{QtDeclarative}. The music store, which shows dynamic content + from the Internet and gets modified rapidly, is best authored in HTML and maintained on the server. + + With the QtWebKit bridge, the music store component can interact with native parts of the application, + for example, when a file needs to be saved to a specific location. + + \section3 Thin Clients + + The use case uses Qt as a native backend of a full web application, + a so-called thin client. In this use case, the entire UI is driven by + HTML, JavaScript and CSS. Additionally, it uses Qt-based components to + access native features usually not exposed to the web, or to enable helper + components that are best written in C++. + + An example for such a client is a UI for a video-on-demand service on a TV. The entire content and + UI can be kept on the server, served dynamically through HTTP and rendered with WebKit. Additional + native components are used to access hardware-specific features like extracting a list of images + out of a video stream. + + \section2 Difference from Other Bridge Technologies + + Of course, QtWebKit is not the only bridge technology out there. NPAPI, for example, + is a long-time standard for web-native bridging. Due to Qt's meta-object system, full applications + leveraging web technologies are much easier to develop with the QtWebKit bridge than with NPAPI. NPAPI, however, is better + for cross-browser plugins, due to it being an accepted standard. + + When developing a plugin for a browser, NPAPI is recommended. When developing a full application + utilizing HTML-rendering, the QtWebKit bridge is recommended. + + \section2 Relationship with QtScript + + The QtWebKit bridge is similar to \l{QtScript}, especially for some of the features described in the + \l{Making Applications Scriptable} page. However, Qt 4.7 does not provide the full QtScript API for web applications. + Full support is planned for future versions. You might notice that some of the features + described here are an exact copy of the ones described in the \l{Making Applications Scriptable} page. That is because + the QtWebKit bridge is a subset of that functionality, and this page tries to capture the full + capabilities available through the QtWebKit bridge specifically. + + \section1 Accessing QObjects + + \section2 Making QObjects known to JavaScript via QWebFrame + + By default, no QObjects are accessible through the web environment, for security reasons. + When a web application wants to access a native QObject, it must explicitly grant access + to this QObject, using the following call: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 0 + + See \l{QWebFrame::addToJavaScriptWindowObject()} for more information. + + \section2 Using Signals and Slots + + The QtWebKit bridge adapts Qt's central \l{Signals and Slots} feature for + scripting. There are three principal ways to use signals and slots + with the QtWebKit bridge: + + \list + \i \bold{Hybrid C++/script}: C++ application code connects a + signal to a script function. This approach is useful if you have + a QObject but don't want to expose the object itself to the scripting + environment. You just want to define how the script responds to a + signal and leave it up to the C++ side of your application to establish + the connection between the C++ signal and the JavaScript slot. + + \i \bold{Hybrid script/C++}: A script can connect signals and slots + to establish connections between pre-defined objects that the + application exposes to the scripting environment. In this scenario, + the slots themselves are still written in C++, but the definition of + the connections is fully dynamic (script-defined). + + \i \bold{Purely script-defined}: A script can both define signal + handler functions (effectively "slots written in JavaScript"), + \e{and} set up the connections that utilize those handlers. For + example, a script can define a function that will handle the + QLineEdit::returnPressed() signal, and then connect that signal to the + script function. + \endlist + + Note that QtScript functions such as qScriptConnect are unavilable in the web environment. + + \section3 Signal to Function Connections + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 7 + + The call to \c{connect()} establishes a connection between the signal + \c{somethingChanged} and the slot \c{myInterestingScriptFunction}. + Whenever the object \c{myObject} emits the signal \c{somethingChanged}, + the slot \c{myInterestingScriptFunction} gets called automatically. + + The argument of \c{connect()} can be any JavaScript function as in the above + example or a slot of a QObject as in the following example: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 8 + + When the argument is a slot of a QObject, the argument types of the + signal and the slot do not have to be compatible. If possible, the QtWebKit + bridge converts the signal arguments such that they match the slot argument. + + To disconnect a slot from a signal, you call the signal's + \c{disconnect()} function with the slot as its argument: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 9 + + When a script function is invoked in response to a signal, the + \c this object will be the Global Object. + + \section3 Signal to Member Function Connections + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 10 + + The call to \c{connect() establishes a connection between the signal + \c{somethingChanged} and the slot \c{function}. Whenever the object + \c{myObject} emits the signal \c{somethingChanged}, the slot \c{function} + of the object \c{thisObject} gets called automatically. Let's illustrate + this with an example. + + If you have a push button in a form, you typically want the form + to do something in response to the button's \c{clicked} signal. The + call to \c{connect()} makes sure that the function \c{onClicked()} is + called whenever you click on the push button, that is, whenever the + the signal \c{clicked()} is emitted by \c{myButton}. The slot \c{onClicked()} + prints the value of \c{x} as stored in the \c{form}. + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 11 + + To disconnect a slot from a signal, you pass the same arguments to + \c{disconnect()} as you passed to \c{connect()}. In general, this looks + as follows: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 12 + + \section3 Signal to Named Member Function Connections + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 14 + + This form of the \c{connect()} function requires that the first argument \c{thisObject} is + the object that will be bound to \c{this} when the function \c{functionName} is + invoked in response to the signal \c{somethingChanged}. The second argument \c{functionName} specifies the + name of a function that is connected to the signal. It refers to a + member function of the object \c{thisObject}. + + Note that the function is resolved when the connection is made, not + when the signal is emitted. + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 15 + + To disconnect from the signal, pass the same arguments to \c{disconnect()} + as you passed to \c{connect}: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 17 + + \section3 Error Handling + + When \c{connect()} or \c{disconnect()} succeeds, the function will + return \c{undefined}; otherwise, it will throw a script exception. + You can obtain an error message from the resulting \c{Error} object. + Example: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 18 + + \section3 Emitting Signals from Scripts + + To emit a signal from script code, you simply invoke the signal + function, passing the relevant arguments: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 19 + + It is currently not possible to define a new signal in a script; + i.e., all signals must be defined by C++ classes. + + \section3 Overloaded Signals and Slots + + When a signal or slot is overloaded, the QtWebKit bridge will attempt to + pick the right overload based on the actual types of the QScriptValue arguments + involved in the function invocation. For example, if your class has slots + \c{myOverloadedSlot(int)} and \c{myOverloadedSlot(QString)}, the following + script code will behave reasonably: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 20 + + You can specify a particular overload by using array-style property access + with the \l{QMetaObject::normalizedSignature()}{normalized signature} of + the C++ function as the property name: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 21 + + If the overloads have different number of arguments, the QtWebKit bridge will + pick the overload with the argument count that best matches the + actual number of arguments passed to the slot. + + For overloaded signals, JavaScript will throw an error if you try to connect + to the signal by name; you have to refer to the signal with the full + normalized signature of the particular overload you want to connect to. + + \section3 Invokable Methods + + Both slots and signals are invokable from scripts by default. In addition, it is also + possible to define a method that is invokable from scripts, although the method is neither a signal nor a slot. + This is especially useful for functions with return types, as slots normally do not return anything + (it would be meaningless to return a value from a slot, as the connected signals cannot handle return values). + To make a non-slot method invokable, simply add the Q_INVOKABLE macro before its definition: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 22 + + \section2 Accessing Properties + + The properties of a QObject are available as properties + of the corresponding JavaScript object. When you manipulate + a property in script code, the C++ get/set method for that + property will automatically be invoked. For example, if your + C++ class has a property declared as follows: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 23 + + then script code can do things like the following: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 24 + + \section2 Accessing Child QObjects + + Every named child of a QObject (that is, every child for which + QObject::objectName() does not return the empty string) is by default available as + a property of the JavaScript wrapper object. For example, + if you have a QDialog with a child widget whose \c{objectName} property is + \c{"okButton"}, you can access this object in script code through + the expression + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 25 + + Because \c{objectName} is itself a Q_PROPERTY, you can manipulate + the name in script code to rename an object. For example: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 26 + + \section2 Data types + + When calling slots, receiving signals or accessing properties, usually some payload is involved. + For example, a property "text" might return a \l{QString} parameter. + The QtWebKit bridge does the job of converting between a given JavaScript data-type, and the + expected or given Qt type. Each Qt type has a coresponding set of rules of how JavaScript treats it. + + The data type conversions are also applicable for the data returned from non-void invokable methods. + + \section3 Numbers + + All Qt numeric data types are converted to or from a JavaScript number. These include int, short, float, + double, and the portable Qt types (qreal, qint etc). A special case is \l{QChar}. + If a slot expects a QChar, the QtWebKit bridge uses the Unicode value in case of a number and the first character in case of a string. + + Note that non-standard (typedef'ed) number types are not automatically converted to + or from a JavaScript number - we suggest to use standard number types for signals, slots + and properties. + + When a non-number is passed as an argument to a method or property that expects a number, + the appropriate JavaScript conversion function (parseInt / parseFloat) is used. + + \section3 Strings + + When JavaScript accesses methods or properties that expect a \l{QString}, the QtWebKit bridge + will automatically convert the value to a string (if it is not already a string), using the + built-in JavaScript toString method. + + When a QString is passed to JavaScript from a signal or a property, the QtWebKit bridge + converts it into a JavaScript string. + + \section3 Date & Time + + Both \l{QDate}, \l{QTime} and \l{QDateTime} are automatically translated to or from the JavaScript + Date object. If a number is passed as an argument to a method that expects one of the date/time + types, the QtWebKit bridge treats it as a timestamp. If a sting is passed, QtWebKit + tries the different Qt date parsing functions to perform the right translation. + + \section3 Regular Expressions + + The QtWebKit bridge automatically converts a JavaScript RegEx object to a \l{QRegExp}. + If a string is passed to a method expecting a \l{QRegExp}, the string is converted + to a \l{QRegExp}. + + \section3 Lists + + The QtWebKit bridge treats several types of lists in a special way: \l{QVariantList}, \l{QStringList}, + \l{QObjectList} and \l{QList}<int>. When a slot or property expects one of those list types, + the QtWebKit bridge tries to convert a JavaScript array into that type, converting each of + the array's elements to the single-element type of the list. + + The most useful type of list is \l{QVariantList}, which can be converted to and from any + JavaScript array. + + \section3 Compound (JSON) objects + + JavaScript compound objects, also known as JSON objects, are variables that hold a list + of key-value pairs, where all the keys are strings and the values can have any type. + This translates very well to \l{QVariantMap}, which is nothing more than a \l{QMap} from \l{QString} + to \l{QVariant}. + + The seamless conversion between JSON objects and \l{QVariantMap} allows for a very convenient + way of passing arbitrary structured data between C++ and the JavaScript environment. If the native \l{QObject} makes sure that compound values are converted to \l{QVariantMap}s and \l{QVariantList}s, JavaScript is + guaranteed to receive them in a meaningful way. + + Note that types that are not supported by JSON, such as JavaScript functions and getters/setters, + are not converted. + + \section3 QVariants + + When a slot or property accepts a \l{QVariant}, the QtWebKit bridge creates a \l{QVariant} that best + matches the argument passed by JavaScript. A string, for example, becomes a \l{QVariant} holding a \l{QString}, + a normal JSON object becomes a \l{QVariantMap}, and a JavaScript array becomes a \l{QVariantList}. + + Using \l{QVariant}s generously in C++ in that way makes C++ programming feel a bit more like JavaScript programming, + as it adds another level of indirection. Passing \l{QVariant}s around like this is very flexible. The program can figure out + the type of argument at runtime just like JavaScript would do. But doing so also takes away the type safety and robustness of C++. + We recommended to use \l{QVariant}s only for high-level functions, and to keep most of your + \l{QObject}s type-safe. + + \section3 QObjects + + Pointers to a \l{QObject} or a \l{QWidget} can be used in signals, slots and properties. This object + can then be used like an object that is exposed directly. Its slots can be invoked, its signals connected to, etc. + However, this functionality is fairly limited - the type used has to be \l{QObject}* or \l{QWidget}*. If the type + specified is a pointer to a non-\l{QWidget} subclass of \l{QObject}, the QtWebKit bridge does not recognize it as + a \l{QObject}. + + In general its advised to use care when passing \l{QObject}s as arguments, as those objects don't become owned by + the JavaScript engine; That means that the application developer has to be extra careful not to try to access + \l{QObject}s that have already been deleted by the native environment. + + \section3 Pixmaps and Images + + \since 4.7 + + The QtWebKit bridge handles \l{QPixmap}s and \l{QImage}s in a special way. Since QtWebKit stores \l{QPixmap}s to + represent HTML images, \l{QPixmap}s coming from the native environment can be used directly inside WebKit. + A \l{QImage} or a \l{QPixmap} coming from Qt is converted to an intermediate JavaScript object, + which can be represented like this: + + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 1 + + The JavaScript environment can then use the pixmap from Qt and display it inside the HTML environment, + by assigning it to an existing \c{<img>} element with \c{assignToHTMLImageElement()}. It can also use the \c{toDataURL()} function, + which allows using the pixmap as the \c{src} attribute of an image or as a \c{background-image} URL. Note that the \c{toDataURL()} + function is costly and should be used with caution. + + Example code: + + C++: + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 2 + + HTML: + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 3 + + When a Qt object expects a \l{QImage} or a \l{QPixmap} as input, and the argument passed is an HTML image element, + the QtWebKit bridge would convert the pixmap assigned to that image element into a \l{QPixmap} or a \l{QImage}. + + \since 4.7 + + \section3 QWebElement + + A signal, slot or property that expects or returns a \l{QWebElement} can work seamlessly with JavaScript references + to DOM elements. The JavaScript environment can select DOM elements, keep them in variables, then pass them to Qt as + a \l{QWebElement}, and receive them back. Example: + + C++: + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 4 + + HTML: + \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 5 + + This is specifically useful to create custom renderers or extensions to the web environment. Instead of forcing Qt + to select the element, the web environment selects the element and then sends the selected element directly to Qt. + + Note that \l{QWebElement}s are not thread safe - an object handling them has to live in the UI thread. + + \section1 Architecture Issues + + \section2 Limiting the Scope of the Hybrid Layer + + When using QtWebKit's hybrid features, it is a common pitfall to make the API exposed to JavaScript very rich and + use all its features. This, however, leads to complexity and can create bugs that are hard to find. + Instead, it is advisable to keep the hybrid layer small and manageable: create a gate only when + there's an actual need for it, i.e. there's a new native enabler that requires a direct interface + to the application layer. Sometimes new functionality is better handled internally in the native layer + or in the web layer; simplicity is your friend. + + This usually becomes more apparent when the hybrid layer can create or destroy objects, or uses + signals, slots or properties with a \l{QObject}* argument. It is advised to be very careful and to treat + an exposed \l{QObject} as a system - with careful attention to memory management and object ownership. + + \section2 Internet Security + + When exposing native objects to an open web environment, it is important to understand the security + implications. Think whether the exposed object enables the web environment access things that + shouldn't be open, and whether the web content loaded by that web page comes from a trusted source. In general, when + exposing native QObjects that give the web environment access to private information or to functionality + that's potentially harmful to the client, such exposure should be balanced by limiting the web page's + access to trusted URLs only with HTTPS, and by utilizing other measures as part of a security strategy. + + + +*/ diff --git a/Source/WebKit/qt/docs/qtwebkit.qdoc b/Source/WebKit/qt/docs/qtwebkit.qdoc new file mode 100644 index 0000000..df22e65 --- /dev/null +++ b/Source/WebKit/qt/docs/qtwebkit.qdoc @@ -0,0 +1,190 @@ +/*! + \module QtWebKit + \title WebKit in Qt + \contentspage All Qt Modules + \previouspage QtSvg + \nextpage QtXml + \ingroup modules + \ingroup technology-apis + + \brief The QtWebKit module provides a web browser engine as well as + classes to render and interact with web content. + + QtWebKit provides a Web browser engine that makes it easy to embed content + from the World Wide Web into your Qt application. At the same time Web + content can be enhanced with native controls. + + QtWebKit provides facilities for rendering of HyperText Markup Language + (HTML), Extensible HyperText Markup Language (XHTML) and Scalable Vector + Graphics (SVG) documents, styled using Cascading Style Sheets (CSS) and + scripted with JavaScript. + + A bridge between the JavaScript execution environment and the Qt object + model makes it possible for custom QObjects to be scripted. For detailed + documentation see \l{The QtWebkit Bridge}. + Integration with the Qt networking module enables Web pages to be transparently loaded + from Web servers, the local file system or even the Qt resource system. + + In addition to providing pure rendering features, HTML documents can be + made fully editable to the user through the use of the \c{contenteditable} + attribute on HTML elements. + + QtWebKit is based on the Open Source WebKit engine. More information about + WebKit itself can be found on the \l{WebKit Open Source Project} Web site. + + \section1 Including In Your Project + + To include the definitions of the module's classes, use the + following directive: + + \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1 + + To link against the module, add this line to your \l qmake \c + .pro file: + + \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0 + + \section1 Notes + + \note Building the QtWebKit module with debugging symbols is problematic + on many platforms due to the size of the WebKit engine. We recommend + building the module only in release mode for embedded platforms. + Currently QtWebKit will always be compiled without debugging symbols + when using gcc. Take a look at the last lines of + \c{src/3rdparty/webkit/Source/WebCore/WebCore.pro} if you need to change this. + + \note Web site icons, also known as "FavIcons", are currently not supported + on Windows. We plan to address this in a future release. + + \note WebKit has certain minimum requirements that must be met on + Embedded Linux systems. See the \l{Qt for Embedded Linux Requirements} + document for more information. + + \section1 Architecture + + The easiest way to render content is through the QWebView class. As a + widget it can be embedded into your forms or a graphics view, and it + provides convenience functions for downloading and rendering web sites. + + \snippet webkitsnippets/simple/main.cpp Using QWebView + + QWebView is used to view Web pages. An instance of QWebView has one + QWebPage. QWebPage provides access to the document structure in a page, + describing features such as frames, the navigation history, and the + undo/redo stack for editable content. + + HTML documents can be nested using frames in a frameset. An individual + frame in HTML is represented using the QWebFrame class. This class includes the + bridge to the JavaScript window object and can be painted using QPainter. + Each QWebPage has one QWebFrame object as its main frame, and the main frame + may contain many child frames. + + Individual elements of an HTML document can be accessed via DOM JavaScript + interfaces from within a web page. The equivalent of this API in QtWebKit + is represented by QWebElement. QWebElement objects are obtained using QWebFrame's + \l{QWebFrame::}{findAllElements()} and \l{QWebFrame::}{findFirstElement()} + functions with CSS selector queries. + + Common web browser features, defaults and other settings can be configured + through the QWebSettings class. It is possible to provide defaults for all + QWebPage instances through the default settings. Individual attributes + can be overidden by the page specific settings object. + + \section1 Netscape Plugin Support + + \note Netscape plugin support is only available on desktop platforms. + + Since WebKit supports the Netscape Plugin API, Qt applications can display + Web pages that embed common plugins on platforms for which those plugins + are available. To enable plugin support, the user must have the appropriate + binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled} + attribute must be enabled for the application. + + The following locations are searched for plugins: + + \table + \header \o Linux/Unix (X11) \o Windows + \row \o{1,3} + \list + \o \c{.mozilla/plugins} in the user's home directory + \o \c{.netscape/plugins} in the user's home directory + \o System locations, such as + \list + \o \c{/usr/lib/browser/plugins} + \o \c{/usr/local/lib/mozilla/plugins} + \o \c{/usr/lib/firefox/plugins} + \o \c{/usr/lib64/browser-plugins} + \o \c{/usr/lib/browser-plugins} + \o \c{/usr/lib/mozilla/plugins} + \o \c{/usr/local/netscape/plugins} + \o \c{/opt/mozilla/plugins} + \o \c{/opt/mozilla/lib/plugins} + \o \c{/opt/netscape/plugins} + \o \c{/opt/netscape/communicator/plugins} + \o \c{/usr/lib/netscape/plugins} + \o \c{/usr/lib/netscape/plugins-libc5} + \o \c{/usr/lib/netscape/plugins-libc6} + \o \c{/usr/lib64/netscape/plugins} + \o \c{/usr/lib64/mozilla/plugins} + \endlist + \o Locations specified by environment variables: + \list + \o \c{$MOZILLA_HOME/plugins} + \o \c{$MOZ_PLUGIN_PATH} + \o \c{$QTWEBKIT_PLUGIN_PATH} + \endlist + \endlist + + \o + \list + \o The user's \c{Application Data\Mozilla\plugins} directory + \o Standard system locations of plugins for Quicktime, Flash, etc. + \endlist + + \row + \raw HTML + <th class="qt-style">Mac OS X</th> + \endraw + \row + \o + \list + \o \c{Library/Internet Plug-Ins} in the user's home directory + \o The system \c{/Library/Internet Plug-Ins} directory + \endlist + \endtable + + + \section1 License Information + + This is a snapshot of the Qt port of WebKit. The exact version information + can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt. + + Qt Commercial Edition licensees that wish to distribute applications that + use the QtWebKit module need to be aware of their obligations under the + GNU Library General Public License (LGPL). + + Developers using the Open Source Edition can choose to redistribute + the module under the appropriate version of the GNU LGPL. + + \legalese + WebKit is licensed under the GNU Library General Public License. + Individual contributor names and copyright dates can be found + inline in the code. + + 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. + \endlegalese +*/ + diff --git a/Source/WebKit/qt/docs/qtwebkit.qdocconf b/Source/WebKit/qt/docs/qtwebkit.qdocconf new file mode 100644 index 0000000..f1d198d --- /dev/null +++ b/Source/WebKit/qt/docs/qtwebkit.qdocconf @@ -0,0 +1,197 @@ +# Run qdoc from the directory that contains this file. + +project = qtwebkit +description = "Qt WebKit API Documentation" + +headerdirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/declarative +sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/Source/JavaScriptCore/qt/api $SRCDIR/WebKit/qt/declarative +outputdir = $OUTPUT_DIR/doc/html +outputformats = HTML +sources.fileextensions = "*.cpp *.doc *.qdoc *.h" +exampledirs = $SRCDIR/WebKit/qt/docs +imagedirs = $SRCDIR/WebKit/qt/docs + +indexes = $QTDIR/doc/html/qt.index + +# macros.qdocconf + +macro.aring.HTML = "å" +macro.Auml.HTML = "Ä" +macro.author = "\\bold{Author:}" +macro.br.HTML = "<br />" +macro.BR.HTML = "<br />" +macro.aacute.HTML = "á" +macro.eacute.HTML = "é" +macro.iacute.HTML = "í" +macro.gui = "\\bold" +macro.hr.HTML = "<hr />" +macro.key = "\\bold" +macro.menu = "\\bold" +macro.note = "\\bold{Note:}" +macro.oslash.HTML = "ø" +macro.ouml.HTML = "ö" +macro.QA = "\\e{Qt Assistant}" +macro.QD = "\\e{Qt Designer}" +macro.QL = "\\e{Qt Linguist}" +macro.param = "\\e" +macro.raisedaster.HTML = "<sup>*</sup>" +macro.reg.HTML = "<sup>®</sup>" +macro.return = "Returns" +macro.starslash = "\\c{*/}" +macro.uuml.HTML = "ü" +macro.mdash.HTML = "—" + +# compat.qdocconf + +alias.i = e +alias.include = input + +macro.0 = "\\\\0" +macro.b = "\\\\b" +macro.n = "\\\\n" +macro.r = "\\\\r" +macro.i = "\\o" +macro.i11 = "\\o{1,1}" +macro.i12 = "\\o{1,2}" +macro.i13 = "\\o{1,3}" +macro.i14 = "\\o{1,4}" +macro.i15 = "\\o{1,5}" +macro.i16 = "\\o{1,6}" +macro.i17 = "\\o{1,7}" +macro.i18 = "\\o{1,8}" +macro.i19 = "\\o{1,9}" +macro.i21 = "\\o{2,1}" +macro.i31 = "\\o{3,1}" +macro.i41 = "\\o{4,1}" +macro.i51 = "\\o{5,1}" +macro.i61 = "\\o{6,1}" +macro.i71 = "\\o{7,1}" +macro.i81 = "\\o{8,1}" +macro.i91 = "\\o{9,1}" +macro.img = "\\image" +macro.endquote = "\\endquotation" + +spurious = "Missing comma in .*" \ + "Missing pattern .*" + +# Doxygen compatibility commands + +macro.see = "\\sa" +macro.function = "\\fn" + +# qt-cpp-ignore.qdocconf + +Cpp.ignoretokens = QAXFACTORY_EXPORT \ + QDESIGNER_COMPONENTS_LIBRARY \ + QDESIGNER_EXTENSION_LIBRARY \ + QDESIGNER_SDK_LIBRARY \ + QDESIGNER_SHARED_LIBRARY \ + QDESIGNER_UILIB_LIBRARY \ + QM_EXPORT_CANVAS \ + QM_EXPORT_DNS \ + QM_EXPORT_DOM \ + QM_EXPORT_FTP \ + QM_EXPORT_HTTP \ + QM_EXPORT_ICONVIEW \ + QM_EXPORT_NETWORK \ + QM_EXPORT_OPENGL \ + QM_EXPORT_SQL \ + QM_EXPORT_TABLE \ + QM_EXPORT_WORKSPACE \ + QM_EXPORT_XML \ + QT_ASCII_CAST_WARN \ + QT_ASCII_CAST_WARN_CONSTRUCTOR \ + QT_BEGIN_HEADER \ + QT_DESIGNER_STATIC \ + QT_END_HEADER \ + QT_FASTCALL \ + QT_WIDGET_PLUGIN_EXPORT \ + Q_COMPAT_EXPORT \ + Q_CORE_EXPORT \ + Q_EXPLICIT \ + Q_EXPORT \ + Q_EXPORT_CODECS_CN \ + Q_EXPORT_CODECS_JP \ + Q_EXPORT_CODECS_KR \ + Q_EXPORT_PLUGIN \ + Q_GFX_INLINE \ + Q_GUI_EXPORT \ + Q_GUI_EXPORT_INLINE \ + Q_GUI_EXPORT_STYLE_CDE \ + Q_GUI_EXPORT_STYLE_COMPACT \ + Q_GUI_EXPORT_STYLE_MAC \ + Q_GUI_EXPORT_STYLE_MOTIF \ + Q_GUI_EXPORT_STYLE_MOTIFPLUS \ + Q_GUI_EXPORT_STYLE_PLATINUM \ + Q_GUI_EXPORT_STYLE_POCKETPC \ + Q_GUI_EXPORT_STYLE_SGI \ + Q_GUI_EXPORT_STYLE_WINDOWS \ + Q_GUI_EXPORT_STYLE_WINDOWSXP \ + QHELP_EXPORT \ + Q_INLINE_TEMPLATE \ + Q_INTERNAL_WIN_NO_THROW \ + Q_NETWORK_EXPORT \ + Q_OPENGL_EXPORT \ + Q_OUTOFLINE_TEMPLATE \ + Q_SQL_EXPORT \ + Q_SVG_EXPORT \ + Q_SCRIPT_EXPORT \ + Q_TESTLIB_EXPORT \ + Q_TYPENAME \ + Q_XML_EXPORT \ + Q_XMLSTREAM_EXPORT \ + Q_XMLPATTERNS_EXPORT \ + QDBUS_EXPORT \ + QT_BEGIN_NAMESPACE \ + QT_BEGIN_INCLUDE_NAMESPACE \ + QT_END_NAMESPACE \ + QT_END_INCLUDE_NAMESPACE \ + PHONON_EXPORT \ + EXTENSIONSYSTEM_EXPORT \ + QWEBKIT_EXPORT +Cpp.ignoredirectives = Q_DECLARE_HANDLE \ + Q_DECLARE_INTERFACE \ + Q_DECLARE_METATYPE \ + Q_DECLARE_OPERATORS_FOR_FLAGS \ + Q_DECLARE_PRIVATE \ + Q_DECLARE_PUBLIC \ + Q_DECLARE_SHARED \ + Q_DECLARE_TR_FUNCTIONS \ + Q_DECLARE_TYPEINFO \ + Q_DISABLE_COPY \ + QT_FORWARD_DECLARE_CLASS \ + Q_DUMMY_COMPARISON_OPERATOR \ + Q_ENUMS \ + Q_FLAGS \ + Q_INTERFACES \ + __attribute__ \ + K_DECLARE_PRIVATE \ + PHONON_OBJECT \ + PHONON_HEIR + + + +HTML.style = "" \ + "h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }"\ + "a:link { color: #004faf; text-decoration: none }"\ + "a:visited { color: #672967; text-decoration: none }"\ + "td.postheader { font-family: sans-serif }"\ + "tr.address { font-family: sans-serif }"\ + "body { background: #ffffff; color: black }"\ + "table tr.odd { background: #f0f0f0; color: black; }"\ + "table tr.even { background: #e4e4e4; color: black; }"\ + "table.annotated th { padding: 3px; text-align: left }"\ + "table.annotated td { padding: 3px; } "\ + "table tr pre { padding-top: none; padding-bottom: none; padding-left: none; padding-right: none; border: none; background: none }"\ + "tr.qt-style { background: #a2c511; color: black }"\ + "body pre { padding: 0.2em; border: #e7e7e7 1px solid; background: #f1f1f1; color: black }"\ + "span.preprocessor, span.preprocessor a { color: darkblue; }"\ + "span.comment { color: darkred; font-style: italic }"\ + "span.string,span.char { color: darkgreen; }"\ + ".title { text-align: center }"\ + ".subtitle { font-size: 0.8em }"\ + ".small-subtitle { font-size: 0.65em }" + +HTML.postheader = "" + +HTML.footer = "" diff --git a/Source/WebKit/qt/docs/qwebview-diagram.png b/Source/WebKit/qt/docs/qwebview-diagram.png Binary files differnew file mode 100644 index 0000000..ada865e --- /dev/null +++ b/Source/WebKit/qt/docs/qwebview-diagram.png diff --git a/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp new file mode 100644 index 0000000..75aa0a9 --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp @@ -0,0 +1,174 @@ + +void wrapInFunction() +{ + + //! [0] + // ... + QWebFrame *frame = myWebPage->mainFrame(); + frame->addToJavaScriptWindowObject("someNameForMyObject", myObject); + // ... + //! [0] +#if 0 + //! [1] + { + width: ..., + height: ..., + toDataURL: function() { ... }, + assignToHTMLImageElement: function(element) { ... } + } + //! [1] +#endif + //! [2] + class MyObject : QObject { + Q_OBJECT + Q_PROPERTY(QPixmap myPixmap READ getPixmap) + + public: + QPixmap getPixmap() const; + }; + + /* ... */ + + MyObject myObject; + myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject); + + //! [2] +#if 0 + //! [3] + <html> + <head> + <script> + function loadImage() + { + myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement")); + } + </script> + </head> + <body onload="loadImage()"> + <img id="imageElement" width="300" height="200" /> + </body> + </html> +//! [3] +#endif +//! [4] +class MyObject : QObject { + Q_OBJECT + + public slots: + void doSomethingWithWebElement(const QWebElement&); + }; + + /* ... */ + + MyObject myObject; + myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject); + + //! [4] +#if 0 + //! [5] + <html> + <head> + <script> + function runExample() { + myObject.doSomethingWithWebElement(document.getElementById("someElement")); + } + </script> + </head> + <body onload="runExample()"> + <span id="someElement">Text</span> + </body> + </html> + //! [5] + //! [6] + connect(function); + //! [6] + //! [7] + function myInterestingScriptFunction() { ... } + ... + myQObject.somethingChanged.connect(myInterestingScriptFunction); + //! [7] + //! [8] + myQObject.somethingChanged.connect(myOtherQObject.doSomething); + //! [8] + //! [9] + myQObject.somethingChanged.disconnect(myInterestingFunction); + myQObject.somethingChanged.disconnect(myOtherQObject.doSomething); + //! [9] + //! [10] + myQObject.somethingChanged.connect(thisObject, function) + //! [10] + //! [11] + var form = { x: 123 }; + var onClicked = function() { print(this.x); }; + myButton.clicked.connect(form, onClicked); + //! [11] + //! [12] + myQObject.somethingChanged.disconnect(thisObject, function); + //! [12] + //! [13] + connect(function); + //! [13] + //! [14] + myQObject.somethingChanged.connect(thisObject, "functionName") + //! [14] + //! [15] + var obj = { x: 123, fun: function() { print(this.x); } }; + myQObject.somethingChanged.connect(obj, "fun"); + //! [15] + //! [16] + connect(function); + //! [16] + //! [17] + myQObject.somethingChanged.disconnect(thisObject, "functionName"); + //! [17] + //! [18] + try { + myQObject.somethingChanged.connect(myQObject, "slotThatDoesntExist"); + } catch (e) { + print(e); + } + //! [18] + //! [19] + myQObject.somethingChanged("hello"); + //! [19] + //! [20] + myQObject.myOverloadedSlot(10); // will call the int overload + myQObject.myOverloadedSlot("10"); // will call the QString overload + //! [20] + //! [21] + myQObject['myOverloadedSlot(int)']("10"); // call int overload; the argument is converted to an int + myQObject['myOverloadedSlot(QString)'](10); // call QString overload; the argument is converted to a string + //! [21] + //! [22] + class MyObject : public QObject + { + Q_OBJECT + + public: + Q_INVOKABLE void thisMethodIsInvokableInJavaScript(); + void thisMethodIsNotInvokableInJavaScript(); + + ... + }; + //! [22] + //! [23] + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled) + //! [23] + //! [24] + myQObject.enabled = true; + + ... + + myQObject.enabled = !myQObject.enabled; + //! [24] + //! [25] + myDialog.okButton + //! [25] + //! [26] + myDialog.okButton + myDialog.okButton.objectName = "cancelButton"; + // from now on, myDialog.cancelButton references the button + //! [26] +#endif +} + diff --git a/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_build_snippet.qdoc b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_build_snippet.qdoc new file mode 100644 index 0000000..d4fc2bd --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_build_snippet.qdoc @@ -0,0 +1,8 @@ +//! [0] +QT += webkit +//! [0] + + +//! [1] +#include <QtWebKit> +//! [1] diff --git a/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp new file mode 100644 index 0000000..07f1d45 --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp @@ -0,0 +1,15 @@ + +void wrapInFunction() +{ + +//! [0] + // ... + QWebPage *page = new QWebPage; + // ... + + QWebInspector *inspector = new QWebInspector; + inspector->setPage(page); +//! [0] + +} + diff --git a/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp new file mode 100644 index 0000000..f04cd29 --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp @@ -0,0 +1,35 @@ + +void wrapInFunction() +{ + +//! [0] + view->page()->history(); +//! [0] + + +//! [1] + view->page()->settings(); +//! [1] + + +//! [2] + view->triggerAction(QWebPage::Copy); +//! [2] + + +//! [3] + view->page()->triggerPageAction(QWebPage::Stop); +//! [3] + + +//! [4] + view->page()->triggerPageAction(QWebPage::GoBack); +//! [4] + + +//! [5] + view->page()->triggerPageAction(QWebPage::GoForward); +//! [5] + +} + diff --git a/Source/WebKit/qt/docs/webkitsnippets/simple/main.cpp b/Source/WebKit/qt/docs/webkitsnippets/simple/main.cpp new file mode 100644 index 0000000..408630e --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/simple/main.cpp @@ -0,0 +1,34 @@ +/* + 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. +*/ + +#include <QApplication> +#include <QUrl> +#include <QWebView> + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QWidget *parent = 0; +//! [Using QWebView] + QWebView *view = new QWebView(parent); + view->load(QUrl("http://qt.nokia.com/")); + view->show(); +//! [Using QWebView] + return app.exec(); +} diff --git a/Source/WebKit/qt/docs/webkitsnippets/simple/simple.pro b/Source/WebKit/qt/docs/webkitsnippets/simple/simple.pro new file mode 100644 index 0000000..61cd3bf --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/simple/simple.pro @@ -0,0 +1,2 @@ +QT += webkit +SOURCES = main.cpp diff --git a/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp b/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp new file mode 100644 index 0000000..b1781a6 --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp @@ -0,0 +1,125 @@ +/* + 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. +*/ + +#include <QApplication> +#include <QUrl> +#include <qwebview.h> +#include <qwebframe.h> +#include <qwebelement.h> + +static QWebFrame *frame; + +static void traverse() +{ +//! [Traversing with QWebElement] + frame->setHtml("<html><body><p>First Paragraph</p><p>Second Paragraph</p></body></html>"); + QWebElement doc = frame->documentElement(); + QWebElement body = doc.firstChild(); + QWebElement firstParagraph = body.firstChild(); + QWebElement secondParagraph = firstParagraph.nextSibling(); +//! [Traversing with QWebElement] +} + +static void findButtonAndClick() +{ + + frame->setHtml("<form name=\"myform\" action=\"submit_form.asp\" method=\"get\">" + "<input type=\"text\" name=\"myfield\">" + "<input type=\"submit\" value=\"Submit\">" + "</form>"); + +//! [Calling a DOM element method] + + QWebElement document = frame->documentElement(); + /* Assume that the document has the following structure: + + <form name="myform" action="submit_form.asp" method="get"> + <input type="text" name="myfield"> + <input type="submit" value="Submit"> + </form> + + */ + + QWebElement button = document.findFirst("input[type=submit]"); + button.evaluateJavaScript("click()"); + +//! [Calling a DOM element method] + + } + +static void autocomplete1() +{ + QWebElement document = frame->documentElement(); + +//! [autocomplete1] + QWebElement firstTextInput = document.findFirst("input[type=text]"); + QString storedText = firstTextInput.attribute("value"); +//! [autocomplete1] + +} + + +static void autocomplete2() +{ + + QWebElement document = frame->documentElement(); + QString storedText = "text"; + +//! [autocomplete2] + QWebElement firstTextInput = document.findFirst("input[type=text]"); + textInput.setAttribute("value", storedText); +//! [autocomplete2] + +} + + +static void findAll() +{ +//! [FindAll] + QWebElement document = frame->documentElement(); + /* Assume the document has the following structure: + + <p class=intro> + <span>Intro</span> + <span>Snippets</span> + </p> + <p> + <span>Content</span> + <span>Here</span> + </p> + */ + +//! [FindAll intro] + QWebElementCollection allSpans = document.findAll("span"); + QWebElementCollection introSpans = document.findAll("p.intro span"); +//! [FindAll intro] //! [FindAll] +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QWebView *view = new QWebView(0); + frame = view->page()->mainFrame(); + traverse(); + findAll(); + findButtonAndClick(); + autocomplete1(); + autocomplete2(); + return 0; +} diff --git a/Source/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro b/Source/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro new file mode 100644 index 0000000..8ca4b59 --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro @@ -0,0 +1,8 @@ +TEMPLATE = app +CONFIG -= app_bundle +CONFIG(QTDIR_build) { + QT += webkit +} +SOURCES = main.cpp +include(../../../../../WebKit.pri) +QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR diff --git a/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp b/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp new file mode 100644 index 0000000..393b16a --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp @@ -0,0 +1,81 @@ +/* + 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. +*/ + +#include <QtGui> +#include <QWebPage> +#include <QWebFrame> + +//! [0] +class Thumbnailer : public QObject +{ + Q_OBJECT + +public: + Thumbnailer(const QUrl &url); + +signals: + void finished(); + +private slots: + void render(); + +private: + QWebPage page; + +}; +//! [0] + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Thumbnailer thumbnail(QUrl("http://qt.nokia.com")); + + QObject::connect(&thumbnail, SIGNAL(finished()), + &app, SLOT(quit())); + + return app.exec(); +} + +//! [1] +Thumbnailer::Thumbnailer(const QUrl &url) +{ + page.mainFrame()->load(url); + connect(&page, SIGNAL(loadFinished(bool)), + this, SLOT(render())); +} +//! [1] + +//! [2] +void Thumbnailer::render() +{ + page.setViewportSize(page.mainFrame()->contentsSize()); + QImage image(page.viewportSize(), QImage::Format_ARGB32); + QPainter painter(&image); + + page.mainFrame()->render(&painter); + painter.end(); + + QImage thumbnail = image.scaled(400, 400); + thumbnail.save("thumbnail.png"); + + emit finished(); +} +//! [2] +#include "main.moc" diff --git a/Source/WebKit/qt/docs/webkitsnippets/webpage/webpage.pro b/Source/WebKit/qt/docs/webkitsnippets/webpage/webpage.pro new file mode 100644 index 0000000..fcad03b --- /dev/null +++ b/Source/WebKit/qt/docs/webkitsnippets/webpage/webpage.pro @@ -0,0 +1,3 @@ +CONFIG += console +QT += webkit +SOURCES = main.cpp
\ No newline at end of file diff --git a/Source/WebKit/qt/examples/examples.pro b/Source/WebKit/qt/examples/examples.pro new file mode 100644 index 0000000..f8dc589 --- /dev/null +++ b/Source/WebKit/qt/examples/examples.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS = platformplugin
\ No newline at end of file diff --git a/Source/WebKit/qt/examples/platformplugin/README b/Source/WebKit/qt/examples/platformplugin/README new file mode 100644 index 0000000..e220d04 --- /dev/null +++ b/Source/WebKit/qt/examples/platformplugin/README @@ -0,0 +1,14 @@ +Platform plugin example. + +This project will create a shared library named platformplugin in directory $$[QT_INSTALL_PLUGINS]/webkit +that will provide combo boxes popups to QtWebKit. + +QtWebKit will look for the plugins automatically so there is no need to make any other configuration to +put the plugin into use. To stop using the plugin just remove the directory $$[QT_INSTALL_PLUGINS]/webkit. + +A copy of qwebkitplatformplugin.h is provided with the example, as platform plugins should not depend +on the precense of QtWebKit to build. + +This plugin can provide popups for <select multiple> elements but to use this feature QtWebKit must be +compiled with NO_LISTBOX_RENDERING enabled. + diff --git a/Source/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp b/Source/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp new file mode 100644 index 0000000..d991ab1 --- /dev/null +++ b/Source/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2010 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 "WebNotificationPresenter.h" + +WebNotificationWidget::WebNotificationWidget() + : QWidget() +{ +} + +WebNotificationWidget::~WebNotificationWidget() +{ +} + +void WebNotificationWidget::showNotification(const QWebNotificationData* data) +{ + QPixmap mask; + QPainter painter(&mask); + painter.fillRect(0, 0, 300, 100, Qt::lightGray); + QBitmap bitmap(mask); + setMask(bitmap); + QGridLayout* layout = new QGridLayout(this); + layout->addWidget(new QLabel(data->title()), 0, 0, 1, 5); + int messagePosition = 0; + QPixmap pixmap; + if (data->iconData().length() && pixmap.loadFromData(data->iconData())) { + QLabel* label = new QLabel; + label->setPixmap(pixmap); + layout->addWidget(label, 1, 0, 1, 1); + messagePosition++; + } + QLabel* messageLabel = new QLabel(data->message()); + messageLabel->setMask(bitmap); + messageLabel->setWordWrap(true); + layout->addWidget(messageLabel, 1, messagePosition, 1, 5 - messagePosition); + setLayout(layout); + setFixedSize(300, 100); + show(); +} + +bool WebNotificationWidget::event(QEvent* ev) +{ + if (ev->type() == QEvent::MouseButtonRelease) { + emit notificationClicked(); + return true; + } + if (ev->type() == QEvent::Close) { + emit notificationClosed(); + return true; + } + return QWidget::event(ev); +} + diff --git a/Source/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h b/Source/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h new file mode 100644 index 0000000..f46e5cb --- /dev/null +++ b/Source/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 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 WebNotificationPresenter_h +#define WebNotificationPresenter_h + +#include "qwebkitplatformplugin.h" +#include <QtGui> + +class WebNotificationWidget : public QWidget +{ + Q_OBJECT +public: + WebNotificationWidget(); + virtual ~WebNotificationWidget(); + + void showNotification(const QWebNotificationData*); + bool event(QEvent*); + +Q_SIGNALS: + void notificationClosed(); + void notificationClicked(); +}; + +class WebNotificationPresenter : public QWebNotificationPresenter +{ + Q_OBJECT +public: + WebNotificationPresenter() + : QWebNotificationPresenter() + { + m_widget = new WebNotificationWidget(); + connect(m_widget, SIGNAL(notificationClosed()), this, SIGNAL(notificationClosed())); + connect(m_widget, SIGNAL(notificationClicked()), this, SIGNAL(notificationClicked())); + } + virtual ~WebNotificationPresenter() { m_widget->close(); delete m_widget; } + + void showNotification(const QWebNotificationData* data) { m_widget->showNotification(data); } + +private: + WebNotificationWidget* m_widget; +}; + +#endif // WebNotificationsUi_h diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp new file mode 100644 index 0000000..320079f --- /dev/null +++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp @@ -0,0 +1,318 @@ +/* + * Copyright (C) 2010 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 "WebPlugin.h" + +#include <QEvent> +#include <QHBoxLayout> +#include <QKeyEvent> +#include <QListWidget> +#include <QListWidgetItem> +#include <QPainter> +#include <QtPlugin> +#include <QPushButton> +#include <QStyledItemDelegate> +#include <QVBoxLayout> + +static const int gMaemoListItemSize = 70; +static const int gMaemoListPadding = 38; +static const int gMaemoMaxVisibleItems = 5; + +void Popup::populateList() +{ + QListWidgetItem* listItem; + for (int i = 0; i < m_data.itemCount(); ++i) { + if (m_data.itemType(i) == QWebSelectData::Option) { + listItem = new QListWidgetItem(m_data.itemText(i)); + m_list->addItem(listItem); + listItem->setSelected(m_data.itemIsSelected(i)); + } else if (m_data.itemType(i) == QWebSelectData::Group) { + listItem = new QListWidgetItem(m_data.itemText(i)); + m_list->addItem(listItem); + listItem->setSelected(false); + listItem->setFlags(Qt::NoItemFlags); + } + } + connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onItemSelected(QListWidgetItem*))); +} + +void Popup::onItemSelected(QListWidgetItem* item) +{ + if (item->flags() != Qt::NoItemFlags) + emit itemClicked(m_list->row(item)); +} + +WebPopup::WebPopup() + : m_popup(0) +{ +} + +WebPopup::~WebPopup() +{ + if (m_popup) + m_popup->deleteLater(); +} + +Popup* WebPopup::createSingleSelectionPopup(const QWebSelectData& data) +{ + return new SingleSelectionPopup(data); +} + +Popup* WebPopup::createMultipleSelectionPopup(const QWebSelectData& data) +{ + return new MultipleSelectionPopup(data); +} + +Popup* WebPopup::createPopup(const QWebSelectData& data) +{ + Popup* result = data.multiple() ? createMultipleSelectionPopup(data) : createSingleSelectionPopup(data); + connect(result, SIGNAL(finished(int)), this, SLOT(popupClosed())); + connect(result, SIGNAL(itemClicked(int)), this, SLOT(itemClicked(int))); + return result; +} + +void WebPopup::show(const QWebSelectData& data) +{ + if (m_popup) + return; + + m_popup = createPopup(data); + m_popup->show(); +} + +void WebPopup::hide() +{ + if (!m_popup) + return; + + m_popup->accept(); +} + +void WebPopup::popupClosed() +{ + if (!m_popup) + return; + + m_popup->deleteLater(); + m_popup = 0; + emit didHide(); +} + +void WebPopup::itemClicked(int idx) +{ + emit selectItem(idx, true, false); +} + +SingleSelectionPopup::SingleSelectionPopup(const QWebSelectData& data) + : Popup(data) +{ + const char* title = "select"; + if (qstrcmp(title, "weba_ti_texlist_single")) + setWindowTitle(QString::fromUtf8(title)); + else + setWindowTitle("Select item"); + + QHBoxLayout* hLayout = new QHBoxLayout(this); + hLayout->setContentsMargins(0, 0, 0, 0); + + m_list = new QListWidget(this); + populateList(); + + hLayout->addSpacing(gMaemoListPadding); + hLayout->addWidget(m_list); + hLayout->addSpacing(gMaemoListPadding); + + connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(accept())); + + const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count(); + resize(size().width(), visibleItemCount * gMaemoListItemSize); +} + + +class MultipleItemListDelegate : public QStyledItemDelegate { +public: + MultipleItemListDelegate(QObject* parent = 0) + : QStyledItemDelegate(parent) + { + tickMark = QIcon::fromTheme("widgets_tickmark_list").pixmap(48, 48); + } + + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const + { + QStyledItemDelegate::paint(painter, option, index); + + if (option.state & QStyle::State_Selected) + painter->drawPixmap(option.rect.width() - tickMark.rect().width(), option.rect.y() + (option.rect.height() / 2 - tickMark.rect().height() / 2), tickMark); + } + +private: + QPixmap tickMark; +}; + +MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data) + : Popup(data) +{ + const char* title = "select"; + if (qstrcmp(title, "weba_ti_textlist_multi")) + setWindowTitle(QString::fromUtf8(title)); + else + setWindowTitle("Select items"); + + QHBoxLayout* hLayout = new QHBoxLayout(this); + hLayout->setContentsMargins(0, 0, 0, 0); + + m_list = new QListWidget(this); + m_list->setSelectionMode(QAbstractItemView::MultiSelection); + populateList(); + + MultipleItemListDelegate* delegate = new MultipleItemListDelegate(this); + m_list->setItemDelegate(delegate); + + hLayout->addSpacing(gMaemoListPadding); + hLayout->addWidget(m_list); + + QVBoxLayout* vLayout = new QVBoxLayout(); + + const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count(); + vLayout->addSpacing((visibleItemCount - 1) * gMaemoListItemSize); + + QPushButton* done = new QPushButton(this); + title = "done"; + if (qstrcmp(title, "wdgt_bd_done")) + done->setText(QString::fromUtf8(title)); + else + done->setText("Done"); + + done->setMinimumWidth(178); + vLayout->addWidget(done); + + hLayout->addSpacing(8); + hLayout->addLayout(vLayout); + hLayout->addSpacing(18); + + connect(done, SIGNAL(clicked()), this, SLOT(accept())); + resize(size().width(), visibleItemCount * gMaemoListItemSize); +} + +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +FullScreenVideoWidget::FullScreenVideoWidget(QMediaPlayer* player) + : QVideoWidget() + , m_mediaPlayer(player) +{ + Q_ASSERT(m_mediaPlayer); + + setFullScreen(true); + m_mediaPlayer->setVideoOutput(this); +} + +bool FullScreenVideoWidget::event(QEvent* ev) +{ + if (ev->type() == QEvent::MouseButtonDblClick) { + emit fullScreenClosed(); + ev->accept(); + return true; + } + return QWidget::event(ev); +} + +void FullScreenVideoWidget::keyPressEvent(QKeyEvent* ev) +{ + if (ev->key() == Qt::Key_Space) { + if (m_mediaPlayer->state() == QMediaPlayer::PlayingState) + m_mediaPlayer->pause(); + else + m_mediaPlayer->play(); + ev->accept(); + return; + } +} + +FullScreenVideoHandler::FullScreenVideoHandler() + : m_mediaWidget(0) +{ +} + +FullScreenVideoHandler::~FullScreenVideoHandler() +{ + delete m_mediaWidget; +} + +bool FullScreenVideoHandler::requiresFullScreenForVideoPlayback() const +{ + return true; +} + +void FullScreenVideoHandler::enterFullScreen(QMediaPlayer* player) +{ + Q_ASSERT(player); + + m_mediaWidget = new FullScreenVideoWidget(player); + connect(m_mediaWidget, SIGNAL(fullScreenClosed()), this, SIGNAL(fullScreenClosed())); + m_mediaWidget->showFullScreen(); +} + +void FullScreenVideoHandler::exitFullScreen() +{ + m_mediaWidget->hide(); + delete m_mediaWidget; + m_mediaWidget = 0; +} +#endif + +bool WebPlugin::supportsExtension(Extension extension) const +{ + switch (extension) { + case MultipleSelections: + return true; +#if ENABLE_NOTIFICATIONS + case Notifications: + return true; +#endif + case TouchInteraction: + return true; +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA + case FullScreenVideoPlayer: + return true; +#endif + default: + return false; + } +} + +QObject* WebPlugin::createExtension(Extension extension) const +{ + switch (extension) { + case MultipleSelections: + return new WebPopup(); +#if ENABLE_NOTIFICATIONS + case Notifications: + return new WebNotificationPresenter(); +#endif + case TouchInteraction: + return new TouchModifier(); +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA + case FullScreenVideoPlayer: + return new FullScreenVideoHandler(); +#endif + default: + return 0; + } +} + +Q_EXPORT_PLUGIN2(platformplugin, WebPlugin) diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h new file mode 100644 index 0000000..4994669 --- /dev/null +++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2010 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 WEBPLUGIN_H +#define WEBPLUGIN_H + +#include "qwebkitplatformplugin.h" +#include "WebNotificationPresenter.h" + +#include <QDialog> +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#include <QVideoWidget> +#endif + +class QListWidgetItem; +class QListWidget; + +class Popup : public QDialog { + Q_OBJECT +public: + Popup(const QWebSelectData& data) : m_data(data) { setModal(true); } + +signals: + void itemClicked(int idx); + +protected slots: + void onItemSelected(QListWidgetItem* item); + +protected: + void populateList(); + + const QWebSelectData& m_data; + QListWidget* m_list; +}; + + +class SingleSelectionPopup : public Popup { + Q_OBJECT +public: + SingleSelectionPopup(const QWebSelectData& data); +}; + + +class MultipleSelectionPopup : public Popup { + Q_OBJECT +public: + MultipleSelectionPopup(const QWebSelectData& data); +}; + + +class WebPopup : public QWebSelectMethod { + Q_OBJECT +public: + WebPopup(); + ~WebPopup(); + + virtual void show(const QWebSelectData& data); + virtual void hide(); + +private slots: + void popupClosed(); + void itemClicked(int idx); + +private: + Popup* m_popup; + + Popup* createPopup(const QWebSelectData& data); + Popup* createSingleSelectionPopup(const QWebSelectData& data); + Popup* createMultipleSelectionPopup(const QWebSelectData& data); +}; + +class TouchModifier : public QWebTouchModifier +{ + Q_OBJECT +public: + unsigned hitTestPaddingForTouch(const PaddingDirection direction) const { + // Use 10 as padding in each direction but Up. + if (direction == QWebTouchModifier::Up) + return 15; + return 10; + } +}; + +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +class FullScreenVideoWidget : public QVideoWidget { + Q_OBJECT +public: + FullScreenVideoWidget(QMediaPlayer*); + virtual ~FullScreenVideoWidget() {} + +Q_SIGNALS: + void fullScreenClosed(); + +protected: + bool event(QEvent*); + void keyPressEvent(QKeyEvent*); + +private: + QMediaPlayer* m_mediaPlayer; // not owned +}; + +class FullScreenVideoHandler : public QWebFullScreenVideoHandler { + Q_OBJECT +public: + FullScreenVideoHandler(); + virtual ~FullScreenVideoHandler(); + bool requiresFullScreenForVideoPlayback() const; + +public Q_SLOTS: + void enterFullScreen(QMediaPlayer*); + void exitFullScreen(); + +private: + FullScreenVideoWidget* m_mediaWidget; // owned +}; +#endif + +class WebPlugin : public QObject, public QWebKitPlatformPlugin +{ + Q_OBJECT + Q_INTERFACES(QWebKitPlatformPlugin) +public: + virtual bool supportsExtension(Extension extension) const; + virtual QObject* createExtension(Extension extension) const; +}; + +#endif // WEBPLUGIN_H diff --git a/Source/WebKit/qt/examples/platformplugin/platformplugin.pro b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro new file mode 100644 index 0000000..ccc0b3a --- /dev/null +++ b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro @@ -0,0 +1,33 @@ +QT += core gui +TARGET = $$qtLibraryTarget(platformplugin) +TEMPLATE = lib +CONFIG += plugin + +## load mobilityconfig if mobility is available +load(mobilityconfig, true) + +# HTML5 Media Support +# We require QtMultimedia +!contains(DEFINES, ENABLE_VIDEO=.) { + contains(MOBILITY_CONFIG, multimedia) { + CONFIG += mobility + MOBILITY += multimedia + DEFINES -= ENABLE_VIDEO=0 + DEFINES += ENABLE_VIDEO=1 + DEFINES -= ENABLE_QT_MULTIMEDIA=0 + DEFINES += ENABLE_QT_MULTIMEDIA=1 + } +} + +DESTDIR = $$[QT_INSTALL_PLUGINS]/webkit + +SOURCES += \ + WebPlugin.cpp \ + WebNotificationPresenter.cpp + +HEADERS += \ + WebPlugin.h \ + qwebkitplatformplugin.h \ + WebNotificationPresenter.h + +!contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1 diff --git a/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h new file mode 100644 index 0000000..2a94e0c --- /dev/null +++ b/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2010 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 QWEBKITPLATFORMPLUGIN_H +#define QWEBKITPLATFORMPLUGIN_H + +/* + * Warning: The contents of this file is not part of the public QtWebKit API + * and may be changed from version to version or even be completely removed. +*/ + +#include <QObject> +#include <QUrl> +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#include <QMediaPlayer> +#endif + +class QWebSelectData +{ +public: + virtual ~QWebSelectData() {} + + enum ItemType { Option, Group, Separator }; + + virtual ItemType itemType(int) const = 0; + virtual QString itemText(int index) const = 0; + virtual QString itemToolTip(int index) const = 0; + virtual bool itemIsEnabled(int index) const = 0; + virtual bool itemIsSelected(int index) const = 0; + virtual int itemCount() const = 0; + virtual bool multiple() const = 0; +}; + +class QWebSelectMethod : public QObject +{ + Q_OBJECT +public: + virtual ~QWebSelectMethod() {} + + virtual void show(const QWebSelectData&) = 0; + virtual void hide() = 0; + +Q_SIGNALS: + void selectItem(int index, bool allowMultiplySelections, bool shift); + void didHide(); +}; + +class QWebNotificationData +{ +public: + virtual ~QWebNotificationData() {} + + virtual const QString title() const = 0; + virtual const QString message() const = 0; + virtual const QByteArray iconData() const = 0; + virtual const QUrl openerPageUrl() const = 0; +}; + +class QWebNotificationPresenter : public QObject +{ + Q_OBJECT +public: + QWebNotificationPresenter() {} + virtual ~QWebNotificationPresenter() {} + + virtual void showNotification(const QWebNotificationData*) = 0; + +Q_SIGNALS: + void notificationClosed(); + void notificationClicked(); +}; + +class QWebHapticFeedbackPlayer: public QObject +{ + Q_OBJECT +public: + QWebHapticFeedbackPlayer() {} + virtual ~QWebHapticFeedbackPlayer() {} + + enum HapticStrength { + None, Weak, Medium, Strong + }; + + enum HapticEvent { + Press, Release + }; + + virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0; +}; + +class QWebTouchModifier : public QObject +{ + Q_OBJECT +public: + virtual ~QWebTouchModifier() {} + + enum PaddingDirection { + Up, Right, Down, Left + }; + + virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0; +}; + +#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +class QWebFullScreenVideoHandler : public QObject { + Q_OBJECT +public: + QWebFullScreenVideoHandler() {} + virtual ~QWebFullScreenVideoHandler() {} + virtual bool requiresFullScreenForVideoPlayback() const = 0; + +Q_SIGNALS: + void fullScreenClosed(); + +public Q_SLOTS: + virtual void enterFullScreen(QMediaPlayer*) = 0; + virtual void exitFullScreen() = 0; +}; +#endif + +class QWebKitPlatformPlugin +{ +public: + virtual ~QWebKitPlatformPlugin() {} + + enum Extension { + MultipleSelections, + Notifications, + Haptics, + TouchInteraction, + FullScreenVideoPlayer + }; + + virtual bool supportsExtension(Extension extension) const = 0; + virtual QObject* createExtension(Extension extension) const = 0; +}; + +QT_BEGIN_NAMESPACE +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.7"); +QT_END_NAMESPACE + +#endif // QWEBKITPLATFORMPLUGIN_H diff --git a/Source/WebKit/qt/qt_webkit_version.pri b/Source/WebKit/qt/qt_webkit_version.pri new file mode 100644 index 0000000..4147d8f --- /dev/null +++ b/Source/WebKit/qt/qt_webkit_version.pri @@ -0,0 +1,5 @@ +QT_WEBKIT_VERSION = 4.9.0 +QT_WEBKIT_MAJOR_VERSION = 4 +QT_WEBKIT_MINOR_VERSION = 9 +QT_WEBKIT_PATCH_VERSION = 0 +QT_CONFIG += webkit diff --git a/Source/WebKit/qt/symbian/backup_registration.xml b/Source/WebKit/qt/symbian/backup_registration.xml new file mode 100644 index 0000000..e026140 --- /dev/null +++ b/Source/WebKit/qt/symbian/backup_registration.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" standalone="yes"?> +<backup_registration> + <system_backup/> + <restore requires_reboot = "no"/> +</backup_registration> diff --git a/Source/WebKit/qt/symbian/bwins/QtWebKitu.def b/Source/WebKit/qt/symbian/bwins/QtWebKitu.def new file mode 100644 index 0000000..f1a545e --- /dev/null +++ b/Source/WebKit/qt/symbian/bwins/QtWebKitu.def @@ -0,0 +1,653 @@ +EXPORTS + ??0MimeType@QWebPluginFactory@@QAE@ABU01@@Z @ 1 NONAME ; QWebPluginFactory::MimeType::MimeType(struct QWebPluginFactory::MimeType const &) + ??0QGraphicsWebView@@QAE@PAVQGraphicsItem@@@Z @ 2 NONAME ; QGraphicsWebView::QGraphicsWebView(class QGraphicsItem *) + ??0QWebDatabase@@AAE@PAVQWebDatabasePrivate@@@Z @ 3 NONAME ; QWebDatabase::QWebDatabase(class QWebDatabasePrivate *) + ??0QWebDatabase@@QAE@ABV0@@Z @ 4 NONAME ; QWebDatabase::QWebDatabase(class QWebDatabase const &) + ??0QWebElement@@AAE@PAVElement@WebCore@@@Z @ 5 NONAME ; QWebElement::QWebElement(class WebCore::Element *) + ??0QWebElement@@AAE@PAVNode@WebCore@@@Z @ 6 NONAME ; QWebElement::QWebElement(class WebCore::Node *) + ??0QWebElement@@QAE@ABV0@@Z @ 7 NONAME ; QWebElement::QWebElement(class QWebElement const &) + ??0QWebElement@@QAE@XZ @ 8 NONAME ; QWebElement::QWebElement(void) + ??0QWebElementCollection@@QAE@ABV0@@Z @ 9 NONAME ; QWebElementCollection::QWebElementCollection(class QWebElementCollection const &) + ??0QWebElementCollection@@QAE@ABVQWebElement@@ABVQString@@@Z @ 10 NONAME ; QWebElementCollection::QWebElementCollection(class QWebElement const &, class QString const &) + ??0QWebElementCollection@@QAE@XZ @ 11 NONAME ; QWebElementCollection::QWebElementCollection(void) + ??0QWebFrame@@AAE@PAV0@PAVQWebFrameData@@@Z @ 12 NONAME ; QWebFrame::QWebFrame(class QWebFrame *, class QWebFrameData *) + ??0QWebFrame@@AAE@PAVQWebPage@@PAVQWebFrameData@@@Z @ 13 NONAME ; QWebFrame::QWebFrame(class QWebPage *, class QWebFrameData *) + ??0QWebHistory@@AAE@XZ @ 14 NONAME ; QWebHistory::QWebHistory(void) + ??0QWebHistoryInterface@@QAE@PAVQObject@@@Z @ 15 NONAME ; QWebHistoryInterface::QWebHistoryInterface(class QObject *) + ??0QWebHistoryItem@@AAE@PAVQWebHistoryItemPrivate@@@Z @ 16 NONAME ; QWebHistoryItem::QWebHistoryItem(class QWebHistoryItemPrivate *) + ??0QWebHistoryItem@@QAE@ABV0@@Z @ 17 NONAME ; QWebHistoryItem::QWebHistoryItem(class QWebHistoryItem const &) + ??0QWebHitTestResult@@AAE@PAVQWebHitTestResultPrivate@@@Z @ 18 NONAME ; QWebHitTestResult::QWebHitTestResult(class QWebHitTestResultPrivate *) + ??0QWebHitTestResult@@QAE@ABV0@@Z @ 19 NONAME ; QWebHitTestResult::QWebHitTestResult(class QWebHitTestResult const &) + ??0QWebHitTestResult@@QAE@XZ @ 20 NONAME ; QWebHitTestResult::QWebHitTestResult(void) + ??0QWebInspector@@QAE@PAVQWidget@@@Z @ 21 NONAME ; QWebInspector::QWebInspector(class QWidget *) + ??0QWebPage@@QAE@PAVQObject@@@Z @ 22 NONAME ; QWebPage::QWebPage(class QObject *) + ??0QWebPluginDatabase@@AAE@PAVQObject@@@Z @ 23 NONAME ; QWebPluginDatabase::QWebPluginDatabase(class QObject *) + ??0QWebPluginFactory@@QAE@PAVQObject@@@Z @ 24 NONAME ; QWebPluginFactory::QWebPluginFactory(class QObject *) + ??0QWebPluginInfo@@AAE@PAVPluginPackage@WebCore@@@Z @ 25 NONAME ; QWebPluginInfo::QWebPluginInfo(class WebCore::PluginPackage *) + ??0QWebPluginInfo@@QAE@ABV0@@Z @ 26 NONAME ; QWebPluginInfo::QWebPluginInfo(class QWebPluginInfo const &) + ??0QWebPluginInfo@@QAE@XZ @ 27 NONAME ; QWebPluginInfo::QWebPluginInfo(void) + ??0QWebSecurityOrigin@@AAE@PAVQWebSecurityOriginPrivate@@@Z @ 28 NONAME ; QWebSecurityOrigin::QWebSecurityOrigin(class QWebSecurityOriginPrivate *) + ??0QWebSecurityOrigin@@QAE@ABV0@@Z @ 29 NONAME ; QWebSecurityOrigin::QWebSecurityOrigin(class QWebSecurityOrigin const &) + ??0QWebSettings@@AAE@PAVSettings@WebCore@@@Z @ 30 NONAME ; QWebSettings::QWebSettings(class WebCore::Settings *) + ??0QWebSettings@@AAE@XZ @ 31 NONAME ; QWebSettings::QWebSettings(void) + ??0QWebView@@QAE@PAVQWidget@@@Z @ 32 NONAME ; QWebView::QWebView(class QWidget *) + ??1MimeType@QWebPluginFactory@@QAE@XZ @ 33 NONAME ; QWebPluginFactory::MimeType::~MimeType(void) + ??1QGraphicsWebView@@UAE@XZ @ 34 NONAME ; QGraphicsWebView::~QGraphicsWebView(void) + ??1QWebDatabase@@QAE@XZ @ 35 NONAME ; QWebDatabase::~QWebDatabase(void) + ??1QWebElement@@QAE@XZ @ 36 NONAME ; QWebElement::~QWebElement(void) + ??1QWebElementCollection@@QAE@XZ @ 37 NONAME ; QWebElementCollection::~QWebElementCollection(void) + ??1QWebFrame@@EAE@XZ @ 38 NONAME ; QWebFrame::~QWebFrame(void) + ??1QWebHistory@@AAE@XZ @ 39 NONAME ; QWebHistory::~QWebHistory(void) + ??1QWebHistoryInterface@@UAE@XZ @ 40 NONAME ; QWebHistoryInterface::~QWebHistoryInterface(void) + ??1QWebHistoryItem@@QAE@XZ @ 41 NONAME ; QWebHistoryItem::~QWebHistoryItem(void) + ??1QWebHitTestResult@@QAE@XZ @ 42 NONAME ; QWebHitTestResult::~QWebHitTestResult(void) + ??1QWebInspector@@UAE@XZ @ 43 NONAME ; QWebInspector::~QWebInspector(void) + ??1QWebPage@@UAE@XZ @ 44 NONAME ; QWebPage::~QWebPage(void) + ??1QWebPluginDatabase@@EAE@XZ @ 45 NONAME ; QWebPluginDatabase::~QWebPluginDatabase(void) + ??1QWebPluginFactory@@UAE@XZ @ 46 NONAME ; QWebPluginFactory::~QWebPluginFactory(void) + ??1QWebPluginInfo@@QAE@XZ @ 47 NONAME ; QWebPluginInfo::~QWebPluginInfo(void) + ??1QWebSecurityOrigin@@QAE@XZ @ 48 NONAME ; QWebSecurityOrigin::~QWebSecurityOrigin(void) + ??1QWebSettings@@AAE@XZ @ 49 NONAME ; QWebSettings::~QWebSettings(void) + ??1QWebView@@UAE@XZ @ 50 NONAME ; QWebView::~QWebView(void) + ??4QWebDatabase@@QAEAAV0@ABV0@@Z @ 51 NONAME ; class QWebDatabase & QWebDatabase::operator=(class QWebDatabase const &) + ??4QWebElement@@QAEAAV0@ABV0@@Z @ 52 NONAME ; class QWebElement & QWebElement::operator=(class QWebElement const &) + ??4QWebElementCollection@@QAEAAV0@ABV0@@Z @ 53 NONAME ; class QWebElementCollection & QWebElementCollection::operator=(class QWebElementCollection const &) + ??4QWebHistoryItem@@QAEAAV0@ABV0@@Z @ 54 NONAME ; class QWebHistoryItem & QWebHistoryItem::operator=(class QWebHistoryItem const &) + ??4QWebHitTestResult@@QAEAAV0@ABV0@@Z @ 55 NONAME ; class QWebHitTestResult & QWebHitTestResult::operator=(class QWebHitTestResult const &) + ??4QWebPluginInfo@@QAEAAV0@ABV0@@Z @ 56 NONAME ; class QWebPluginInfo & QWebPluginInfo::operator=(class QWebPluginInfo const &) + ??4QWebSecurityOrigin@@QAEAAV0@ABV0@@Z @ 57 NONAME ; class QWebSecurityOrigin & QWebSecurityOrigin::operator=(class QWebSecurityOrigin const &) + ??5@YAAAVQDataStream@@AAV0@AAVQWebHistory@@@Z @ 58 NONAME ; class QDataStream & operator>>(class QDataStream &, class QWebHistory &) + ??6@YAAAVQDataStream@@AAV0@ABVQWebHistory@@@Z @ 59 NONAME ; class QDataStream & operator<<(class QDataStream &, class QWebHistory const &) + ??8MimeType@QWebPluginFactory@@QBE_NABU01@@Z @ 60 NONAME ; bool QWebPluginFactory::MimeType::operator==(struct QWebPluginFactory::MimeType const &) const + ??8QWebElement@@QBE_NABV0@@Z @ 61 NONAME ; bool QWebElement::operator==(class QWebElement const &) const + ??8QWebPluginInfo@@QBE_NABV0@@Z @ 62 NONAME ; bool QWebPluginInfo::operator==(class QWebPluginInfo const &) const + ??9MimeType@QWebPluginFactory@@QBE_NABU01@@Z @ 63 NONAME ; bool QWebPluginFactory::MimeType::operator!=(struct QWebPluginFactory::MimeType const &) const + ??9QWebElement@@QBE_NABV0@@Z @ 64 NONAME ; bool QWebElement::operator!=(class QWebElement const &) const + ??9QWebPluginInfo@@QBE_NABV0@@Z @ 65 NONAME ; bool QWebPluginInfo::operator!=(class QWebPluginInfo const &) const + ??AQWebElementCollection@@QBE?AVQWebElement@@H@Z @ 66 NONAME ; class QWebElement QWebElementCollection::operator[](int) const + ??HQWebElementCollection@@QBE?AV0@ABV0@@Z @ 67 NONAME ; class QWebElementCollection QWebElementCollection::operator+(class QWebElementCollection const &) const + ??YQWebElementCollection@@QAEAAV0@ABV0@@Z @ 68 NONAME ; class QWebElementCollection & QWebElementCollection::operator+=(class QWebElementCollection const &) + ??_EMimeType@QWebPluginFactory@@QAE@I@Z @ 69 NONAME ; QWebPluginFactory::MimeType::~MimeType(unsigned int) + ??_EQGraphicsWebView@@UAE@I@Z @ 70 NONAME ; QGraphicsWebView::~QGraphicsWebView(unsigned int) + ??_EQWebFrame@@UAE@I@Z @ 71 NONAME ; QWebFrame::~QWebFrame(unsigned int) + ??_EQWebHistoryInterface@@UAE@I@Z @ 72 NONAME ; QWebHistoryInterface::~QWebHistoryInterface(unsigned int) + ??_EQWebInspector@@UAE@I@Z @ 73 NONAME ; QWebInspector::~QWebInspector(unsigned int) + ??_EQWebPage@@UAE@I@Z @ 74 NONAME ; QWebPage::~QWebPage(unsigned int) + ??_EQWebPluginDatabase@@UAE@I@Z @ 75 NONAME ; QWebPluginDatabase::~QWebPluginDatabase(unsigned int) + ??_EQWebPluginFactory@@UAE@I@Z @ 76 NONAME ; QWebPluginFactory::~QWebPluginFactory(unsigned int) + ??_EQWebView@@UAE@I@Z @ 77 NONAME ; QWebView::~QWebView(unsigned int) + ?acceptNavigationRequest@QWebPage@@MAE_NPAVQWebFrame@@ABVQNetworkRequest@@W4NavigationType@1@@Z @ 78 NONAME ; bool QWebPage::acceptNavigationRequest(class QWebFrame *, class QNetworkRequest const &, enum QWebPage::NavigationType) + ?action@QWebPage@@QBEPAVQAction@@W4WebAction@1@@Z @ 79 NONAME ; class QAction * QWebPage::action(enum QWebPage::WebAction) const + ?addClass@QWebElement@@QAEXABVQString@@@Z @ 80 NONAME ; void QWebElement::addClass(class QString const &) + ?addLocalScheme@QWebSecurityOrigin@@SAXABVQString@@@Z @ 81 NONAME ; void QWebSecurityOrigin::addLocalScheme(class QString const &) + ?addSearchPath@QWebPluginDatabase@@QAEXABVQString@@@Z @ 82 NONAME ; void QWebPluginDatabase::addSearchPath(class QString const &) + ?addToJavaScriptWindowObject@QWebFrame@@QAEXABVQString@@PAVQObject@@@Z @ 83 NONAME ; void QWebFrame::addToJavaScriptWindowObject(class QString const &, class QObject *) + ?addToJavaScriptWindowObject@QWebFrame@@QAEXABVQString@@PAVQObject@@W4ValueOwnership@QScriptEngine@@@Z @ 84 NONAME ; void QWebFrame::addToJavaScriptWindowObject(class QString const &, class QObject *, enum QScriptEngine::ValueOwnership) + ?allOrigins@QWebSecurityOrigin@@SA?AV?$QList@VQWebSecurityOrigin@@@@XZ @ 85 NONAME ; class QList<class QWebSecurityOrigin> QWebSecurityOrigin::allOrigins(void) + ?alternateText@QWebHitTestResult@@QBE?AVQString@@XZ @ 86 NONAME ; class QString QWebHitTestResult::alternateText(void) const + ?append@QWebElementCollection@@QAEXABV1@@Z @ 87 NONAME ; void QWebElementCollection::append(class QWebElementCollection const &) + ?appendInside@QWebElement@@QAEXABV1@@Z @ 88 NONAME ; void QWebElement::appendInside(class QWebElement const &) + ?appendInside@QWebElement@@QAEXABVQString@@@Z @ 89 NONAME ; void QWebElement::appendInside(class QString const &) + ?appendOutside@QWebElement@@QAEXABV1@@Z @ 90 NONAME ; void QWebElement::appendOutside(class QWebElement const &) + ?appendOutside@QWebElement@@QAEXABVQString@@@Z @ 91 NONAME ; void QWebElement::appendOutside(class QString const &) + ?at@QWebElementCollection@@QBE?AVQWebElement@@H@Z @ 92 NONAME ; class QWebElement QWebElementCollection::at(int) const + ?attribute@QWebElement@@QBE?AVQString@@ABV2@0@Z @ 93 NONAME ; class QString QWebElement::attribute(class QString const &, class QString const &) const + ?attributeNS@QWebElement@@QBE?AVQString@@ABV2@00@Z @ 94 NONAME ; class QString QWebElement::attributeNS(class QString const &, class QString const &, class QString const &) const + ?back@QGraphicsWebView@@QAEXXZ @ 95 NONAME ; void QGraphicsWebView::back(void) + ?back@QWebHistory@@QAEXXZ @ 96 NONAME ; void QWebHistory::back(void) + ?back@QWebView@@QAEXXZ @ 97 NONAME ; void QWebView::back(void) + ?backItem@QWebHistory@@QBE?AVQWebHistoryItem@@XZ @ 98 NONAME ; class QWebHistoryItem QWebHistory::backItem(void) const + ?backItems@QWebHistory@@QBE?AV?$QList@VQWebHistoryItem@@@@H@Z @ 99 NONAME ; class QList<class QWebHistoryItem> QWebHistory::backItems(int) const + ?baseUrl@QWebFrame@@QBE?AVQUrl@@XZ @ 100 NONAME ; class QUrl QWebFrame::baseUrl(void) const + ?begin@QWebElementCollection@@QAE?AViterator@1@XZ @ 101 NONAME ; class QWebElementCollection::iterator QWebElementCollection::begin(void) + ?begin@QWebElementCollection@@QBE?AVconst_iterator@1@XZ @ 102 NONAME ; class QWebElementCollection::const_iterator QWebElementCollection::begin(void) const + ?boundingRect@QWebHitTestResult@@QBE?AVQRect@@XZ @ 103 NONAME ; class QRect QWebHitTestResult::boundingRect(void) const + ?bytesReceived@QWebPage@@QBE_KXZ @ 104 NONAME ; unsigned long long QWebPage::bytesReceived(void) const + ?canGoBack@QWebHistory@@QBE_NXZ @ 105 NONAME ; bool QWebHistory::canGoBack(void) const + ?canGoForward@QWebHistory@@QBE_NXZ @ 106 NONAME ; bool QWebHistory::canGoForward(void) const + ?changeEvent@QWebView@@MAEXPAVQEvent@@@Z @ 107 NONAME ; void QWebView::changeEvent(class QEvent *) + ?childFrames@QWebFrame@@QBE?AV?$QList@PAVQWebFrame@@@@XZ @ 108 NONAME ; class QList<class QWebFrame *> QWebFrame::childFrames(void) const + ?chooseFile@QWebPage@@MAE?AVQString@@PAVQWebFrame@@ABV2@@Z @ 109 NONAME ; class QString QWebPage::chooseFile(class QWebFrame *, class QString const &) + ?classes@QWebElement@@QBE?AVQStringList@@XZ @ 110 NONAME ; class QStringList QWebElement::classes(void) const + ?clear@QWebHistory@@QAEXXZ @ 111 NONAME ; void QWebHistory::clear(void) + ?clearIconDatabase@QWebSettings@@SAXXZ @ 112 NONAME ; void QWebSettings::clearIconDatabase(void) + ?clearMemoryCaches@QWebSettings@@SAXXZ @ 113 NONAME ; void QWebSettings::clearMemoryCaches(void) + ?clone@QWebElement@@QBE?AV1@XZ @ 114 NONAME ; class QWebElement QWebElement::clone(void) const + ?constBegin@QWebElementCollection@@QBE?AVconst_iterator@1@XZ @ 115 NONAME ; class QWebElementCollection::const_iterator QWebElementCollection::constBegin(void) const + ?constEnd@QWebElementCollection@@QBE?AVconst_iterator@1@XZ @ 116 NONAME ; class QWebElementCollection::const_iterator QWebElementCollection::constEnd(void) const + ?contentsChanged@QWebPage@@IAEXXZ @ 117 NONAME ; void QWebPage::contentsChanged(void) + ?contentsSize@QWebFrame@@QBE?AVQSize@@XZ @ 118 NONAME ; class QSize QWebFrame::contentsSize(void) const + ?contentsSizeChanged@QWebFrame@@IAEXABVQSize@@@Z @ 119 NONAME ; void QWebFrame::contentsSizeChanged(class QSize const &) + ?contextMenuEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneContextMenuEvent@@@Z @ 120 NONAME ; void QGraphicsWebView::contextMenuEvent(class QGraphicsSceneContextMenuEvent *) + ?contextMenuEvent@QWebView@@MAEXPAVQContextMenuEvent@@@Z @ 121 NONAME ; void QWebView::contextMenuEvent(class QContextMenuEvent *) + ?count@QWebElementCollection@@QBEHXZ @ 122 NONAME ; int QWebElementCollection::count(void) const + ?count@QWebHistory@@QBEHXZ @ 123 NONAME ; int QWebHistory::count(void) const + ?createPlugin@QWebPage@@MAEPAVQObject@@ABVQString@@ABVQUrl@@ABVQStringList@@2@Z @ 124 NONAME ; class QObject * QWebPage::createPlugin(class QString const &, class QUrl const &, class QStringList const &, class QStringList const &) + ?createStandardContextMenu@QWebPage@@QAEPAVQMenu@@XZ @ 125 NONAME ; class QMenu * QWebPage::createStandardContextMenu(void) + ?createWindow@QWebPage@@MAEPAV1@W4WebWindowType@1@@Z @ 126 NONAME ; class QWebPage * QWebPage::createWindow(enum QWebPage::WebWindowType) + ?createWindow@QWebView@@MAEPAV1@W4WebWindowType@QWebPage@@@Z @ 127 NONAME ; class QWebView * QWebView::createWindow(enum QWebPage::WebWindowType) + ?currentFrame@QWebPage@@QBEPAVQWebFrame@@XZ @ 128 NONAME ; class QWebFrame * QWebPage::currentFrame(void) const + ?currentItem@QWebHistory@@QBE?AVQWebHistoryItem@@XZ @ 129 NONAME ; class QWebHistoryItem QWebHistory::currentItem(void) const + ?currentItemIndex@QWebHistory@@QBEHXZ @ 130 NONAME ; int QWebHistory::currentItemIndex(void) const + ?databaseQuota@QWebSecurityOrigin@@QBE_JXZ @ 131 NONAME ; long long QWebSecurityOrigin::databaseQuota(void) const + ?databaseQuotaExceeded@QWebPage@@IAEXPAVQWebFrame@@VQString@@@Z @ 132 NONAME ; void QWebPage::databaseQuotaExceeded(class QWebFrame *, class QString) + ?databaseUsage@QWebSecurityOrigin@@QBE_JXZ @ 133 NONAME ; long long QWebSecurityOrigin::databaseUsage(void) const + ?databases@QWebSecurityOrigin@@QBE?AV?$QList@VQWebDatabase@@@@XZ @ 134 NONAME ; class QList<class QWebDatabase> QWebSecurityOrigin::databases(void) const + ?defaultInterface@QWebHistoryInterface@@SAPAV1@XZ @ 135 NONAME ; class QWebHistoryInterface * QWebHistoryInterface::defaultInterface(void) + ?defaultSearchPaths@QWebPluginDatabase@@SA?AVQStringList@@XZ @ 136 NONAME ; class QStringList QWebPluginDatabase::defaultSearchPaths(void) + ?defaultTextEncoding@QWebSettings@@QBE?AVQString@@XZ @ 137 NONAME ; class QString QWebSettings::defaultTextEncoding(void) const + ?description@QWebPluginInfo@@QBE?AVQString@@XZ @ 138 NONAME ; class QString QWebPluginInfo::description(void) const + ?displayName@QWebDatabase@@QBE?AVQString@@XZ @ 139 NONAME ; class QString QWebDatabase::displayName(void) const + ?document@QWebElement@@QBE?AV1@XZ @ 140 NONAME ; class QWebElement QWebElement::document(void) const + ?documentElement@QWebFrame@@QBE?AVQWebElement@@XZ @ 141 NONAME ; class QWebElement QWebFrame::documentElement(void) const + ?downloadRequested@QWebPage@@IAEXABVQNetworkRequest@@@Z @ 142 NONAME ; void QWebPage::downloadRequested(class QNetworkRequest const &) + ?dragEnterEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneDragDropEvent@@@Z @ 143 NONAME ; void QGraphicsWebView::dragEnterEvent(class QGraphicsSceneDragDropEvent *) + ?dragEnterEvent@QWebView@@MAEXPAVQDragEnterEvent@@@Z @ 144 NONAME ; void QWebView::dragEnterEvent(class QDragEnterEvent *) + ?dragLeaveEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneDragDropEvent@@@Z @ 145 NONAME ; void QGraphicsWebView::dragLeaveEvent(class QGraphicsSceneDragDropEvent *) + ?dragLeaveEvent@QWebView@@MAEXPAVQDragLeaveEvent@@@Z @ 146 NONAME ; void QWebView::dragLeaveEvent(class QDragLeaveEvent *) + ?dragMoveEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneDragDropEvent@@@Z @ 147 NONAME ; void QGraphicsWebView::dragMoveEvent(class QGraphicsSceneDragDropEvent *) + ?dragMoveEvent@QWebView@@MAEXPAVQDragMoveEvent@@@Z @ 148 NONAME ; void QWebView::dragMoveEvent(class QDragMoveEvent *) + ?dropEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneDragDropEvent@@@Z @ 149 NONAME ; void QGraphicsWebView::dropEvent(class QGraphicsSceneDragDropEvent *) + ?dropEvent@QWebView@@MAEXPAVQDropEvent@@@Z @ 150 NONAME ; void QWebView::dropEvent(class QDropEvent *) + ?element@QWebHitTestResult@@QBE?AVQWebElement@@XZ @ 151 NONAME ; class QWebElement QWebHitTestResult::element(void) const + ?enablePersistentStorage@QWebSettings@@SAXABVQString@@@Z @ 152 NONAME ; void QWebSettings::enablePersistentStorage(class QString const &) + ?encloseContentsWith@QWebElement@@QAEXABV1@@Z @ 153 NONAME ; void QWebElement::encloseContentsWith(class QWebElement const &) + ?encloseContentsWith@QWebElement@@QAEXABVQString@@@Z @ 154 NONAME ; void QWebElement::encloseContentsWith(class QString const &) + ?encloseWith@QWebElement@@QAEXABV1@@Z @ 155 NONAME ; void QWebElement::encloseWith(class QWebElement const &) + ?encloseWith@QWebElement@@QAEXABVQString@@@Z @ 156 NONAME ; void QWebElement::encloseWith(class QString const &) + ?enclosingBlockElement@QWebHitTestResult@@QBE?AVQWebElement@@XZ @ 157 NONAME ; class QWebElement QWebHitTestResult::enclosingBlockElement(void) const + ?enclosingElement@QWebElement@@CA?AV1@PAVNode@WebCore@@@Z @ 158 NONAME ; class QWebElement QWebElement::enclosingElement(class WebCore::Node *) + ?end@QWebElementCollection@@QAE?AViterator@1@XZ @ 159 NONAME ; class QWebElementCollection::iterator QWebElementCollection::end(void) + ?end@QWebElementCollection@@QBE?AVconst_iterator@1@XZ @ 160 NONAME ; class QWebElementCollection::const_iterator QWebElementCollection::end(void) const + ?evaluateJavaScript@QWebElement@@QAE?AVQVariant@@ABVQString@@@Z @ 161 NONAME ; class QVariant QWebElement::evaluateJavaScript(class QString const &) + ?evaluateJavaScript@QWebFrame@@QAE?AVQVariant@@ABVQString@@@Z @ 162 NONAME ; class QVariant QWebFrame::evaluateJavaScript(class QString const &) + ?event@QGraphicsWebView@@UAE_NPAVQEvent@@@Z @ 163 NONAME ; bool QGraphicsWebView::event(class QEvent *) + ?event@QWebFrame@@UAE_NPAVQEvent@@@Z @ 164 NONAME ; bool QWebFrame::event(class QEvent *) + ?event@QWebInspector@@UAE_NPAVQEvent@@@Z @ 165 NONAME ; bool QWebInspector::event(class QEvent *) + ?event@QWebPage@@UAE_NPAVQEvent@@@Z @ 166 NONAME ; bool QWebPage::event(class QEvent *) + ?event@QWebView@@UAE_NPAVQEvent@@@Z @ 167 NONAME ; bool QWebView::event(class QEvent *) + ?expectedSize@QWebDatabase@@QBE_JXZ @ 168 NONAME ; long long QWebDatabase::expectedSize(void) const + ?extension@QWebPage@@UAE_NW4Extension@1@PBVExtensionOption@1@PAVExtensionReturn@1@@Z @ 169 NONAME ; bool QWebPage::extension(enum QWebPage::Extension, class QWebPage::ExtensionOption const *, class QWebPage::ExtensionReturn *) + ?extension@QWebPluginFactory@@UAE_NW4Extension@1@PBVExtensionOption@1@PAVExtensionReturn@1@@Z @ 170 NONAME ; bool QWebPluginFactory::extension(enum QWebPluginFactory::Extension, class QWebPluginFactory::ExtensionOption const *, class QWebPluginFactory::ExtensionReturn *) + ?fileName@QWebDatabase@@QBE?AVQString@@XZ @ 171 NONAME ; class QString QWebDatabase::fileName(void) const + ?findAll@QWebElement@@QBE?AVQWebElementCollection@@ABVQString@@@Z @ 172 NONAME ; class QWebElementCollection QWebElement::findAll(class QString const &) const + ?findAllElements@QWebFrame@@QBE?AVQWebElementCollection@@ABVQString@@@Z @ 173 NONAME ; class QWebElementCollection QWebFrame::findAllElements(class QString const &) const + ?findFirst@QWebElement@@QBE?AV1@ABVQString@@@Z @ 174 NONAME ; class QWebElement QWebElement::findFirst(class QString const &) const + ?findFirstElement@QWebFrame@@QBE?AVQWebElement@@ABVQString@@@Z @ 175 NONAME ; class QWebElement QWebFrame::findFirstElement(class QString const &) const + ?findText@QGraphicsWebView@@QAE_NABVQString@@V?$QFlags@W4FindFlag@QWebPage@@@@@Z @ 176 NONAME ; bool QGraphicsWebView::findText(class QString const &, class QFlags<enum QWebPage::FindFlag>) + ?findText@QWebPage@@QAE_NABVQString@@V?$QFlags@W4FindFlag@QWebPage@@@@@Z @ 177 NONAME ; bool QWebPage::findText(class QString const &, class QFlags<enum QWebPage::FindFlag>) + ?findText@QWebView@@QAE_NABVQString@@V?$QFlags@W4FindFlag@QWebPage@@@@@Z @ 178 NONAME ; bool QWebView::findText(class QString const &, class QFlags<enum QWebPage::FindFlag>) + ?first@QWebElementCollection@@QBE?AVQWebElement@@XZ @ 179 NONAME ; class QWebElement QWebElementCollection::first(void) const + ?firstChild@QWebElement@@QBE?AV1@XZ @ 180 NONAME ; class QWebElement QWebElement::firstChild(void) const + ?focusInEvent@QGraphicsWebView@@MAEXPAVQFocusEvent@@@Z @ 181 NONAME ; void QGraphicsWebView::focusInEvent(class QFocusEvent *) + ?focusInEvent@QWebView@@MAEXPAVQFocusEvent@@@Z @ 182 NONAME ; void QWebView::focusInEvent(class QFocusEvent *) + ?focusNextPrevChild@QGraphicsWebView@@MAE_N_N@Z @ 183 NONAME ; bool QGraphicsWebView::focusNextPrevChild(bool) + ?focusNextPrevChild@QWebPage@@QAE_N_N@Z @ 184 NONAME ; bool QWebPage::focusNextPrevChild(bool) + ?focusNextPrevChild@QWebView@@MAE_N_N@Z @ 185 NONAME ; bool QWebView::focusNextPrevChild(bool) + ?focusOutEvent@QGraphicsWebView@@MAEXPAVQFocusEvent@@@Z @ 186 NONAME ; void QGraphicsWebView::focusOutEvent(class QFocusEvent *) + ?focusOutEvent@QWebView@@MAEXPAVQFocusEvent@@@Z @ 187 NONAME ; void QWebView::focusOutEvent(class QFocusEvent *) + ?fontFamily@QWebSettings@@QBE?AVQString@@W4FontFamily@1@@Z @ 188 NONAME ; class QString QWebSettings::fontFamily(enum QWebSettings::FontFamily) const + ?fontSize@QWebSettings@@QBEHW4FontSize@1@@Z @ 189 NONAME ; int QWebSettings::fontSize(enum QWebSettings::FontSize) const + ?forward@QGraphicsWebView@@QAEXXZ @ 190 NONAME ; void QGraphicsWebView::forward(void) + ?forward@QWebHistory@@QAEXXZ @ 191 NONAME ; void QWebHistory::forward(void) + ?forward@QWebView@@QAEXXZ @ 192 NONAME ; void QWebView::forward(void) + ?forwardItem@QWebHistory@@QBE?AVQWebHistoryItem@@XZ @ 193 NONAME ; class QWebHistoryItem QWebHistory::forwardItem(void) const + ?forwardItems@QWebHistory@@QBE?AV?$QList@VQWebHistoryItem@@@@H@Z @ 194 NONAME ; class QList<class QWebHistoryItem> QWebHistory::forwardItems(int) const + ?forwardUnsupportedContent@QWebPage@@QBE_NXZ @ 195 NONAME ; bool QWebPage::forwardUnsupportedContent(void) const + ?frame@QWebHitTestResult@@QBEPAVQWebFrame@@XZ @ 196 NONAME ; class QWebFrame * QWebHitTestResult::frame(void) const + ?frameAt@QWebPage@@QBEPAVQWebFrame@@ABVQPoint@@@Z @ 197 NONAME ; class QWebFrame * QWebPage::frameAt(class QPoint const &) const + ?frameCreated@QWebPage@@IAEXPAVQWebFrame@@@Z @ 198 NONAME ; void QWebPage::frameCreated(class QWebFrame *) + ?frameName@QWebFrame@@QBE?AVQString@@XZ @ 199 NONAME ; class QString QWebFrame::frameName(void) const + ?geometry@QWebElement@@QBE?AVQRect@@XZ @ 200 NONAME ; class QRect QWebElement::geometry(void) const + ?geometry@QWebFrame@@QBE?AVQRect@@XZ @ 201 NONAME ; class QRect QWebFrame::geometry(void) const + ?geometryChangeRequested@QWebPage@@IAEXABVQRect@@@Z @ 202 NONAME ; void QWebPage::geometryChangeRequested(class QRect const &) + ?getStaticMetaObject@QGraphicsWebView@@SAABUQMetaObject@@XZ @ 203 NONAME ; struct QMetaObject const & QGraphicsWebView::getStaticMetaObject(void) + ?getStaticMetaObject@QWebFrame@@SAABUQMetaObject@@XZ @ 204 NONAME ; struct QMetaObject const & QWebFrame::getStaticMetaObject(void) + ?getStaticMetaObject@QWebHistoryInterface@@SAABUQMetaObject@@XZ @ 205 NONAME ; struct QMetaObject const & QWebHistoryInterface::getStaticMetaObject(void) + ?getStaticMetaObject@QWebInspector@@SAABUQMetaObject@@XZ @ 206 NONAME ; struct QMetaObject const & QWebInspector::getStaticMetaObject(void) + ?getStaticMetaObject@QWebPage@@SAABUQMetaObject@@XZ @ 207 NONAME ; struct QMetaObject const & QWebPage::getStaticMetaObject(void) + ?getStaticMetaObject@QWebPluginDatabase@@SAABUQMetaObject@@XZ @ 208 NONAME ; struct QMetaObject const & QWebPluginDatabase::getStaticMetaObject(void) + ?getStaticMetaObject@QWebPluginFactory@@SAABUQMetaObject@@XZ @ 209 NONAME ; struct QMetaObject const & QWebPluginFactory::getStaticMetaObject(void) + ?getStaticMetaObject@QWebView@@SAABUQMetaObject@@XZ @ 210 NONAME ; struct QMetaObject const & QWebView::getStaticMetaObject(void) + ?globalSettings@QWebSettings@@SAPAV1@XZ @ 211 NONAME ; class QWebSettings * QWebSettings::globalSettings(void) + ?goToItem@QWebHistory@@QAEXABVQWebHistoryItem@@@Z @ 212 NONAME ; void QWebHistory::goToItem(class QWebHistoryItem const &) + ?handle@QWebPage@@QBEPAVQWebPagePrivate@@XZ @ 213 NONAME ; class QWebPagePrivate * QWebPage::handle(void) const + ?handle@QWebSettings@@QBEPAVQWebSettingsPrivate@@XZ @ 214 NONAME ; class QWebSettingsPrivate * QWebSettings::handle(void) const + ?hasAttribute@QWebElement@@QBE_NABVQString@@@Z @ 215 NONAME ; bool QWebElement::hasAttribute(class QString const &) const + ?hasAttributeNS@QWebElement@@QBE_NABVQString@@0@Z @ 216 NONAME ; bool QWebElement::hasAttributeNS(class QString const &, class QString const &) const + ?hasAttributes@QWebElement@@QBE_NXZ @ 217 NONAME ; bool QWebElement::hasAttributes(void) const + ?hasClass@QWebElement@@QBE_NABVQString@@@Z @ 218 NONAME ; bool QWebElement::hasClass(class QString const &) const + ?hasFocus@QWebElement@@QBE_NXZ @ 219 NONAME ; bool QWebElement::hasFocus(void) const + ?hasFocus@QWebFrame@@QBE_NXZ @ 220 NONAME ; bool QWebFrame::hasFocus(void) const + ?hideEvent@QWebInspector@@MAEXPAVQHideEvent@@@Z @ 221 NONAME ; void QWebInspector::hideEvent(class QHideEvent *) + ?history@QGraphicsWebView@@QBEPAVQWebHistory@@XZ @ 222 NONAME ; class QWebHistory * QGraphicsWebView::history(void) const + ?history@QWebPage@@QBEPAVQWebHistory@@XZ @ 223 NONAME ; class QWebHistory * QWebPage::history(void) const + ?history@QWebView@@QBEPAVQWebHistory@@XZ @ 224 NONAME ; class QWebHistory * QWebView::history(void) const + ?hitTestContent@QWebFrame@@QBE?AVQWebHitTestResult@@ABVQPoint@@@Z @ 225 NONAME ; class QWebHitTestResult QWebFrame::hitTestContent(class QPoint const &) const + ?host@QWebSecurityOrigin@@QBE?AVQString@@XZ @ 226 NONAME ; class QString QWebSecurityOrigin::host(void) const + ?hoverLeaveEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneHoverEvent@@@Z @ 227 NONAME ; void QGraphicsWebView::hoverLeaveEvent(class QGraphicsSceneHoverEvent *) + ?hoverMoveEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneHoverEvent@@@Z @ 228 NONAME ; void QGraphicsWebView::hoverMoveEvent(class QGraphicsSceneHoverEvent *) + ?icon@QGraphicsWebView@@QBE?AVQIcon@@XZ @ 229 NONAME ; class QIcon QGraphicsWebView::icon(void) const + ?icon@QWebFrame@@QBE?AVQIcon@@XZ @ 230 NONAME ; class QIcon QWebFrame::icon(void) const + ?icon@QWebHistoryItem@@QBE?AVQIcon@@XZ @ 231 NONAME ; class QIcon QWebHistoryItem::icon(void) const + ?icon@QWebView@@QBE?AVQIcon@@XZ @ 232 NONAME ; class QIcon QWebView::icon(void) const + ?iconChanged@QGraphicsWebView@@IAEXXZ @ 233 NONAME ; void QGraphicsWebView::iconChanged(void) + ?iconChanged@QWebFrame@@IAEXXZ @ 234 NONAME ; void QWebFrame::iconChanged(void) + ?iconChanged@QWebView@@IAEXXZ @ 235 NONAME ; void QWebView::iconChanged(void) + ?iconDatabasePath@QWebSettings@@SA?AVQString@@XZ @ 236 NONAME ; class QString QWebSettings::iconDatabasePath(void) + ?iconForUrl@QWebSettings@@SA?AVQIcon@@ABVQUrl@@@Z @ 237 NONAME ; class QIcon QWebSettings::iconForUrl(class QUrl const &) + ?imageUrl@QWebHitTestResult@@QBE?AVQUrl@@XZ @ 238 NONAME ; class QUrl QWebHitTestResult::imageUrl(void) const + ?initialLayoutCompleted@QWebFrame@@IAEXXZ @ 239 NONAME ; void QWebFrame::initialLayoutCompleted(void) + ?inputMethodEvent@QGraphicsWebView@@MAEXPAVQInputMethodEvent@@@Z @ 240 NONAME ; void QGraphicsWebView::inputMethodEvent(class QInputMethodEvent *) + ?inputMethodEvent@QWebView@@MAEXPAVQInputMethodEvent@@@Z @ 241 NONAME ; void QWebView::inputMethodEvent(class QInputMethodEvent *) + ?inputMethodQuery@QGraphicsWebView@@UBE?AVQVariant@@W4InputMethodQuery@Qt@@@Z @ 242 NONAME ; class QVariant QGraphicsWebView::inputMethodQuery(enum Qt::InputMethodQuery) const + ?inputMethodQuery@QWebPage@@QBE?AVQVariant@@W4InputMethodQuery@Qt@@@Z @ 243 NONAME ; class QVariant QWebPage::inputMethodQuery(enum Qt::InputMethodQuery) const + ?inputMethodQuery@QWebView@@UBE?AVQVariant@@W4InputMethodQuery@Qt@@@Z @ 244 NONAME ; class QVariant QWebView::inputMethodQuery(enum Qt::InputMethodQuery) const + ?isContentEditable@QWebHitTestResult@@QBE_NXZ @ 245 NONAME ; bool QWebHitTestResult::isContentEditable(void) const + ?isContentEditable@QWebPage@@QBE_NXZ @ 246 NONAME ; bool QWebPage::isContentEditable(void) const + ?isContentSelected@QWebHitTestResult@@QBE_NXZ @ 247 NONAME ; bool QWebHitTestResult::isContentSelected(void) const + ?isEnabled@QWebPluginInfo@@QBE_NXZ @ 248 NONAME ; bool QWebPluginInfo::isEnabled(void) const + ?isModified@QGraphicsWebView@@QBE_NXZ @ 249 NONAME ; bool QGraphicsWebView::isModified(void) const + ?isModified@QWebPage@@QBE_NXZ @ 250 NONAME ; bool QWebPage::isModified(void) const + ?isModified@QWebView@@QBE_NXZ @ 251 NONAME ; bool QWebView::isModified(void) const + ?isNull@QWebElement@@QBE_NXZ @ 252 NONAME ; bool QWebElement::isNull(void) const + ?isNull@QWebHitTestResult@@QBE_NXZ @ 253 NONAME ; bool QWebHitTestResult::isNull(void) const + ?isNull@QWebPluginInfo@@QBE_NXZ @ 254 NONAME ; bool QWebPluginInfo::isNull(void) const + ?isValid@QWebHistoryItem@@QBE_NXZ @ 255 NONAME ; bool QWebHistoryItem::isValid(void) const + ?itemAt@QWebHistory@@QBE?AVQWebHistoryItem@@H@Z @ 256 NONAME ; class QWebHistoryItem QWebHistory::itemAt(int) const + ?itemChange@QGraphicsWebView@@UAE?AVQVariant@@W4GraphicsItemChange@QGraphicsItem@@ABV2@@Z @ 257 NONAME ; class QVariant QGraphicsWebView::itemChange(enum QGraphicsItem::GraphicsItemChange, class QVariant const &) + ?items@QWebHistory@@QBE?AV?$QList@VQWebHistoryItem@@@@XZ @ 258 NONAME ; class QList<class QWebHistoryItem> QWebHistory::items(void) const + ?javaScriptAlert@QWebPage@@MAEXPAVQWebFrame@@ABVQString@@@Z @ 259 NONAME ; void QWebPage::javaScriptAlert(class QWebFrame *, class QString const &) + ?javaScriptConfirm@QWebPage@@MAE_NPAVQWebFrame@@ABVQString@@@Z @ 260 NONAME ; bool QWebPage::javaScriptConfirm(class QWebFrame *, class QString const &) + ?javaScriptConsoleMessage@QWebPage@@MAEXABVQString@@H0@Z @ 261 NONAME ; void QWebPage::javaScriptConsoleMessage(class QString const &, int, class QString const &) + ?javaScriptPrompt@QWebPage@@MAE_NPAVQWebFrame@@ABVQString@@1PAV3@@Z @ 262 NONAME ; bool QWebPage::javaScriptPrompt(class QWebFrame *, class QString const &, class QString const &, class QString *) + ?javaScriptWindowObjectCleared@QWebFrame@@IAEXXZ @ 263 NONAME ; void QWebFrame::javaScriptWindowObjectCleared(void) + ?keyPressEvent@QGraphicsWebView@@MAEXPAVQKeyEvent@@@Z @ 264 NONAME ; void QGraphicsWebView::keyPressEvent(class QKeyEvent *) + ?keyPressEvent@QWebView@@MAEXPAVQKeyEvent@@@Z @ 265 NONAME ; void QWebView::keyPressEvent(class QKeyEvent *) + ?keyReleaseEvent@QGraphicsWebView@@MAEXPAVQKeyEvent@@@Z @ 266 NONAME ; void QGraphicsWebView::keyReleaseEvent(class QKeyEvent *) + ?keyReleaseEvent@QWebView@@MAEXPAVQKeyEvent@@@Z @ 267 NONAME ; void QWebView::keyReleaseEvent(class QKeyEvent *) + ?last@QWebElementCollection@@QBE?AVQWebElement@@XZ @ 268 NONAME ; class QWebElement QWebElementCollection::last(void) const + ?lastChild@QWebElement@@QBE?AV1@XZ @ 269 NONAME ; class QWebElement QWebElement::lastChild(void) const + ?lastVisited@QWebHistoryItem@@QBE?AVQDateTime@@XZ @ 270 NONAME ; class QDateTime QWebHistoryItem::lastVisited(void) const + ?linkClicked@QGraphicsWebView@@IAEXABVQUrl@@@Z @ 271 NONAME ; void QGraphicsWebView::linkClicked(class QUrl const &) + ?linkClicked@QWebPage@@IAEXABVQUrl@@@Z @ 272 NONAME ; void QWebPage::linkClicked(class QUrl const &) + ?linkClicked@QWebView@@IAEXABVQUrl@@@Z @ 273 NONAME ; void QWebView::linkClicked(class QUrl const &) + ?linkDelegationPolicy@QWebPage@@QBE?AW4LinkDelegationPolicy@1@XZ @ 274 NONAME ; enum QWebPage::LinkDelegationPolicy QWebPage::linkDelegationPolicy(void) const + ?linkElement@QWebHitTestResult@@QBE?AVQWebElement@@XZ @ 275 NONAME ; class QWebElement QWebHitTestResult::linkElement(void) const + ?linkHovered@QWebPage@@IAEXABVQString@@00@Z @ 276 NONAME ; void QWebPage::linkHovered(class QString const &, class QString const &, class QString const &) + ?linkTargetFrame@QWebHitTestResult@@QBEPAVQWebFrame@@XZ @ 277 NONAME ; class QWebFrame * QWebHitTestResult::linkTargetFrame(void) const + ?linkText@QWebHitTestResult@@QBE?AVQString@@XZ @ 278 NONAME ; class QString QWebHitTestResult::linkText(void) const + ?linkTitle@QWebHitTestResult@@QBE?AVQUrl@@XZ @ 279 NONAME ; class QUrl QWebHitTestResult::linkTitle(void) const + ?linkUrl@QWebHitTestResult@@QBE?AVQUrl@@XZ @ 280 NONAME ; class QUrl QWebHitTestResult::linkUrl(void) const + ?load@QGraphicsWebView@@QAEXABVQNetworkRequest@@W4Operation@QNetworkAccessManager@@ABVQByteArray@@@Z @ 281 NONAME ; void QGraphicsWebView::load(class QNetworkRequest const &, enum QNetworkAccessManager::Operation, class QByteArray const &) + ?load@QGraphicsWebView@@QAEXABVQUrl@@@Z @ 282 NONAME ; void QGraphicsWebView::load(class QUrl const &) + ?load@QWebFrame@@QAEXABVQNetworkRequest@@W4Operation@QNetworkAccessManager@@ABVQByteArray@@@Z @ 283 NONAME ; void QWebFrame::load(class QNetworkRequest const &, enum QNetworkAccessManager::Operation, class QByteArray const &) + ?load@QWebFrame@@QAEXABVQUrl@@@Z @ 284 NONAME ; void QWebFrame::load(class QUrl const &) + ?load@QWebView@@QAEXABVQNetworkRequest@@W4Operation@QNetworkAccessManager@@ABVQByteArray@@@Z @ 285 NONAME ; void QWebView::load(class QNetworkRequest const &, enum QNetworkAccessManager::Operation, class QByteArray const &) + ?load@QWebView@@QAEXABVQUrl@@@Z @ 286 NONAME ; void QWebView::load(class QUrl const &) + ?loadFinished@QGraphicsWebView@@IAEX_N@Z @ 287 NONAME ; void QGraphicsWebView::loadFinished(bool) + ?loadFinished@QWebFrame@@IAEX_N@Z @ 288 NONAME ; void QWebFrame::loadFinished(bool) + ?loadFinished@QWebPage@@IAEX_N@Z @ 289 NONAME ; void QWebPage::loadFinished(bool) + ?loadFinished@QWebView@@IAEX_N@Z @ 290 NONAME ; void QWebView::loadFinished(bool) + ?loadProgress@QGraphicsWebView@@IAEXH@Z @ 291 NONAME ; void QGraphicsWebView::loadProgress(int) + ?loadProgress@QWebPage@@IAEXH@Z @ 292 NONAME ; void QWebPage::loadProgress(int) + ?loadProgress@QWebView@@IAEXH@Z @ 293 NONAME ; void QWebView::loadProgress(int) + ?loadStarted@QGraphicsWebView@@IAEXXZ @ 294 NONAME ; void QGraphicsWebView::loadStarted(void) + ?loadStarted@QWebFrame@@IAEXXZ @ 295 NONAME ; void QWebFrame::loadStarted(void) + ?loadStarted@QWebPage@@IAEXXZ @ 296 NONAME ; void QWebPage::loadStarted(void) + ?loadStarted@QWebView@@IAEXXZ @ 297 NONAME ; void QWebView::loadStarted(void) + ?localName@QWebElement@@QBE?AVQString@@XZ @ 298 NONAME ; class QString QWebElement::localName(void) const + ?localSchemes@QWebSecurityOrigin@@SA?AVQStringList@@XZ @ 299 NONAME ; class QStringList QWebSecurityOrigin::localSchemes(void) + ?localStoragePath@QWebSettings@@QBE?AVQString@@XZ @ 300 NONAME ; class QString QWebSettings::localStoragePath(void) const + ?mainFrame@QWebPage@@QBEPAVQWebFrame@@XZ @ 301 NONAME ; class QWebFrame * QWebPage::mainFrame(void) const + ?maximumItemCount@QWebHistory@@QBEHXZ @ 302 NONAME ; int QWebHistory::maximumItemCount(void) const + ?maximumPagesInCache@QWebSettings@@SAHXZ @ 303 NONAME ; int QWebSettings::maximumPagesInCache(void) + ?menuBarVisibilityChangeRequested@QWebPage@@IAEX_N@Z @ 304 NONAME ; void QWebPage::menuBarVisibilityChangeRequested(bool) + ?metaData@QWebFrame@@QBE?AV?$QMultiMap@VQString@@V1@@@XZ @ 305 NONAME ; class QMultiMap<class QString, class QString> QWebFrame::metaData(void) const + ?metaObject@QGraphicsWebView@@UBEPBUQMetaObject@@XZ @ 306 NONAME ; struct QMetaObject const * QGraphicsWebView::metaObject(void) const + ?metaObject@QWebFrame@@UBEPBUQMetaObject@@XZ @ 307 NONAME ; struct QMetaObject const * QWebFrame::metaObject(void) const + ?metaObject@QWebHistoryInterface@@UBEPBUQMetaObject@@XZ @ 308 NONAME ; struct QMetaObject const * QWebHistoryInterface::metaObject(void) const + ?metaObject@QWebInspector@@UBEPBUQMetaObject@@XZ @ 309 NONAME ; struct QMetaObject const * QWebInspector::metaObject(void) const + ?metaObject@QWebPage@@UBEPBUQMetaObject@@XZ @ 310 NONAME ; struct QMetaObject const * QWebPage::metaObject(void) const + ?metaObject@QWebPluginDatabase@@UBEPBUQMetaObject@@XZ @ 311 NONAME ; struct QMetaObject const * QWebPluginDatabase::metaObject(void) const + ?metaObject@QWebPluginFactory@@UBEPBUQMetaObject@@XZ @ 312 NONAME ; struct QMetaObject const * QWebPluginFactory::metaObject(void) const + ?metaObject@QWebView@@UBEPBUQMetaObject@@XZ @ 313 NONAME ; struct QMetaObject const * QWebView::metaObject(void) const + ?microFocusChanged@QWebPage@@IAEXXZ @ 314 NONAME ; void QWebPage::microFocusChanged(void) + ?mimeTypes@QWebPluginInfo@@QBE?AV?$QList@UMimeType@QWebPluginFactory@@@@XZ @ 315 NONAME ; class QList<struct QWebPluginFactory::MimeType> QWebPluginInfo::mimeTypes(void) const + ?mouseDoubleClickEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 316 NONAME ; void QGraphicsWebView::mouseDoubleClickEvent(class QGraphicsSceneMouseEvent *) + ?mouseDoubleClickEvent@QWebView@@MAEXPAVQMouseEvent@@@Z @ 317 NONAME ; void QWebView::mouseDoubleClickEvent(class QMouseEvent *) + ?mouseMoveEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 318 NONAME ; void QGraphicsWebView::mouseMoveEvent(class QGraphicsSceneMouseEvent *) + ?mouseMoveEvent@QWebView@@MAEXPAVQMouseEvent@@@Z @ 319 NONAME ; void QWebView::mouseMoveEvent(class QMouseEvent *) + ?mousePressEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 320 NONAME ; void QGraphicsWebView::mousePressEvent(class QGraphicsSceneMouseEvent *) + ?mousePressEvent@QWebView@@MAEXPAVQMouseEvent@@@Z @ 321 NONAME ; void QWebView::mousePressEvent(class QMouseEvent *) + ?mouseReleaseEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 322 NONAME ; void QGraphicsWebView::mouseReleaseEvent(class QGraphicsSceneMouseEvent *) + ?mouseReleaseEvent@QWebView@@MAEXPAVQMouseEvent@@@Z @ 323 NONAME ; void QWebView::mouseReleaseEvent(class QMouseEvent *) + ?name@QWebDatabase@@QBE?AVQString@@XZ @ 324 NONAME ; class QString QWebDatabase::name(void) const + ?name@QWebPluginInfo@@QBE?AVQString@@XZ @ 325 NONAME ; class QString QWebPluginInfo::name(void) const + ?namespaceUri@QWebElement@@QBE?AVQString@@XZ @ 326 NONAME ; class QString QWebElement::namespaceUri(void) const + ?networkAccessManager@QWebPage@@QBEPAVQNetworkAccessManager@@XZ @ 327 NONAME ; class QNetworkAccessManager * QWebPage::networkAccessManager(void) const + ?nextSibling@QWebElement@@QBE?AV1@XZ @ 328 NONAME ; class QWebElement QWebElement::nextSibling(void) const + ?offlineStorageDefaultQuota@QWebSettings@@SA_JXZ @ 329 NONAME ; long long QWebSettings::offlineStorageDefaultQuota(void) + ?offlineStoragePath@QWebSettings@@SA?AVQString@@XZ @ 330 NONAME ; class QString QWebSettings::offlineStoragePath(void) + ?offlineWebApplicationCachePath@QWebSettings@@SA?AVQString@@XZ @ 331 NONAME ; class QString QWebSettings::offlineWebApplicationCachePath(void) + ?offlineWebApplicationCacheQuota@QWebSettings@@SA_JXZ @ 332 NONAME ; long long QWebSettings::offlineWebApplicationCacheQuota(void) + ?origin@QWebDatabase@@QBE?AVQWebSecurityOrigin@@XZ @ 333 NONAME ; class QWebSecurityOrigin QWebDatabase::origin(void) const + ?originalUrl@QWebHistoryItem@@QBE?AVQUrl@@XZ @ 334 NONAME ; class QUrl QWebHistoryItem::originalUrl(void) const + ?page@QGraphicsWebView@@QBEPAVQWebPage@@XZ @ 335 NONAME ; class QWebPage * QGraphicsWebView::page(void) const + ?page@QWebFrame@@QBEPAVQWebPage@@XZ @ 336 NONAME ; class QWebPage * QWebFrame::page(void) const + ?page@QWebInspector@@QBEPAVQWebPage@@XZ @ 337 NONAME ; class QWebPage * QWebInspector::page(void) const + ?page@QWebView@@QBEPAVQWebPage@@XZ @ 338 NONAME ; class QWebPage * QWebView::page(void) const + ?pageAction@QGraphicsWebView@@QBEPAVQAction@@W4WebAction@QWebPage@@@Z @ 339 NONAME ; class QAction * QGraphicsWebView::pageAction(enum QWebPage::WebAction) const + ?pageAction@QWebView@@QBEPAVQAction@@W4WebAction@QWebPage@@@Z @ 340 NONAME ; class QAction * QWebView::pageAction(enum QWebPage::WebAction) const + ?paint@QGraphicsWebView@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 341 NONAME ; void QGraphicsWebView::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) + ?paintEvent@QWebView@@MAEXPAVQPaintEvent@@@Z @ 342 NONAME ; void QWebView::paintEvent(class QPaintEvent *) + ?palette@QWebPage@@QBE?AVQPalette@@XZ @ 343 NONAME ; class QPalette QWebPage::palette(void) const + ?parent@QWebElement@@QBE?AV1@XZ @ 344 NONAME ; class QWebElement QWebElement::parent(void) const + ?parentFrame@QWebFrame@@QBEPAV1@XZ @ 345 NONAME ; class QWebFrame * QWebFrame::parentFrame(void) const + ?path@QWebPluginInfo@@QBE?AVQString@@XZ @ 346 NONAME ; class QString QWebPluginInfo::path(void) const + ?pixmap@QWebHitTestResult@@QBE?AVQPixmap@@XZ @ 347 NONAME ; class QPixmap QWebHitTestResult::pixmap(void) const + ?pluginFactory@QWebPage@@QBEPAVQWebPluginFactory@@XZ @ 348 NONAME ; class QWebPluginFactory * QWebPage::pluginFactory(void) const + ?pluginForMimeType@QWebPluginDatabase@@QAE?AVQWebPluginInfo@@ABVQString@@@Z @ 349 NONAME ; class QWebPluginInfo QWebPluginDatabase::pluginForMimeType(class QString const &) + ?plugins@QWebPluginDatabase@@QBE?AV?$QList@VQWebPluginInfo@@@@XZ @ 350 NONAME ; class QList<class QWebPluginInfo> QWebPluginDatabase::plugins(void) const + ?port@QWebSecurityOrigin@@QBEHXZ @ 351 NONAME ; int QWebSecurityOrigin::port(void) const + ?pos@QWebFrame@@QBE?AVQPoint@@XZ @ 352 NONAME ; class QPoint QWebFrame::pos(void) const + ?pos@QWebHitTestResult@@QBE?AVQPoint@@XZ @ 353 NONAME ; class QPoint QWebHitTestResult::pos(void) const + ?preferredContentsSize@QWebPage@@QBE?AVQSize@@XZ @ 354 NONAME ; class QSize QWebPage::preferredContentsSize(void) const + ?prefix@QWebElement@@QBE?AVQString@@XZ @ 355 NONAME ; class QString QWebElement::prefix(void) const + ?prependInside@QWebElement@@QAEXABV1@@Z @ 356 NONAME ; void QWebElement::prependInside(class QWebElement const &) + ?prependInside@QWebElement@@QAEXABVQString@@@Z @ 357 NONAME ; void QWebElement::prependInside(class QString const &) + ?prependOutside@QWebElement@@QAEXABV1@@Z @ 358 NONAME ; void QWebElement::prependOutside(class QWebElement const &) + ?prependOutside@QWebElement@@QAEXABVQString@@@Z @ 359 NONAME ; void QWebElement::prependOutside(class QString const &) + ?previousSibling@QWebElement@@QBE?AV1@XZ @ 360 NONAME ; class QWebElement QWebElement::previousSibling(void) const + ?print@QWebView@@QBEXPAVQPrinter@@@Z @ 361 NONAME ; void QWebView::print(class QPrinter *) const + ?printRequested@QWebPage@@IAEXPAVQWebFrame@@@Z @ 362 NONAME ; void QWebPage::printRequested(class QWebFrame *) + ?printingMaximumShrinkFactor@QWebSettings@@QBEMXZ @ 363 NONAME ABSENT ; float QWebSettings::printingMaximumShrinkFactor(void) const + ?printingMinimumShrinkFactor@QWebSettings@@QBEMXZ @ 364 NONAME ABSENT ; float QWebSettings::printingMinimumShrinkFactor(void) const + ?provisionalLoad@QWebFrame@@IAEXXZ @ 365 NONAME ; void QWebFrame::provisionalLoad(void) + ?qWebKitMajorVersion@@YAHXZ @ 366 NONAME ; int qWebKitMajorVersion(void) + ?qWebKitMinorVersion@@YAHXZ @ 367 NONAME ; int qWebKitMinorVersion(void) + ?qWebKitVersion@@YA?AVQString@@XZ @ 368 NONAME ; class QString qWebKitVersion(void) + ?qt_drt_clearFrameName@@YAXPAVQWebFrame@@@Z @ 369 NONAME ; void qt_drt_clearFrameName(class QWebFrame *) + ?qt_drt_counterValueForElementById@@YA?AVQString@@PAVQWebFrame@@ABV1@@Z @ 370 NONAME ; class QString qt_drt_counterValueForElementById(class QWebFrame *, class QString const &) + ?qt_drt_garbageCollector_collect@@YAXXZ @ 371 NONAME ; void qt_drt_garbageCollector_collect(void) + ?qt_drt_garbageCollector_collectOnAlternateThread@@YAX_N@Z @ 372 NONAME ; void qt_drt_garbageCollector_collectOnAlternateThread(bool) + ?qt_drt_javaScriptObjectsCount@@YAHXZ @ 373 NONAME ; int qt_drt_javaScriptObjectsCount(void) + ?qt_drt_numberOfActiveAnimations@@YAHPAVQWebFrame@@@Z @ 374 NONAME ; int qt_drt_numberOfActiveAnimations(class QWebFrame *) + ?qt_drt_overwritePluginDirectories@@YAXXZ @ 375 NONAME ; void qt_drt_overwritePluginDirectories(void) + ?qt_drt_pauseAnimation@@YA_NPAVQWebFrame@@ABVQString@@N1@Z @ 376 NONAME ; bool qt_drt_pauseAnimation(class QWebFrame *, class QString const &, double, class QString const &) + ?qt_drt_pauseTransitionOfProperty@@YA_NPAVQWebFrame@@ABVQString@@N1@Z @ 377 NONAME ; bool qt_drt_pauseTransitionOfProperty(class QWebFrame *, class QString const &, double, class QString const &) + ?qt_drt_resetOriginAccessWhiteLists@@YAXXZ @ 378 NONAME ; void qt_drt_resetOriginAccessWhiteLists(void) + ?qt_drt_run@@YAX_N@Z @ 379 NONAME ; void qt_drt_run(bool) + ?qt_drt_setJavaScriptProfilingEnabled@@YAXPAVQWebFrame@@_N@Z @ 380 NONAME ; void qt_drt_setJavaScriptProfilingEnabled(class QWebFrame *, bool) + ?qt_drt_whiteListAccessFromOrigin@@YAXABVQString@@00_N@Z @ 381 NONAME ; void qt_drt_whiteListAccessFromOrigin(class QString const &, class QString const &, class QString const &, bool) + ?qt_dump_editing_callbacks@@YAX_N@Z @ 382 NONAME ; void qt_dump_editing_callbacks(bool) + ?qt_dump_frame_loader@@YAX_N@Z @ 383 NONAME ; void qt_dump_frame_loader(bool) + ?qt_dump_resource_load_callbacks@@YAX_N@Z @ 384 NONAME ; void qt_dump_resource_load_callbacks(bool) + ?qt_dump_set_accepts_editing@@YAX_N@Z @ 385 NONAME ; void qt_dump_set_accepts_editing(bool) + ?qt_metacall@QGraphicsWebView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 386 NONAME ; int QGraphicsWebView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QWebFrame@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 387 NONAME ; int QWebFrame::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QWebHistoryInterface@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 388 NONAME ; int QWebHistoryInterface::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QWebInspector@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 389 NONAME ; int QWebInspector::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QWebPage@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 390 NONAME ; int QWebPage::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QWebPluginDatabase@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 391 NONAME ; int QWebPluginDatabase::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QWebPluginFactory@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 392 NONAME ; int QWebPluginFactory::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QWebView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 393 NONAME ; int QWebView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacast@QGraphicsWebView@@UAEPAXPBD@Z @ 394 NONAME ; void * QGraphicsWebView::qt_metacast(char const *) + ?qt_metacast@QWebFrame@@UAEPAXPBD@Z @ 395 NONAME ; void * QWebFrame::qt_metacast(char const *) + ?qt_metacast@QWebHistoryInterface@@UAEPAXPBD@Z @ 396 NONAME ; void * QWebHistoryInterface::qt_metacast(char const *) + ?qt_metacast@QWebInspector@@UAEPAXPBD@Z @ 397 NONAME ; void * QWebInspector::qt_metacast(char const *) + ?qt_metacast@QWebPage@@UAEPAXPBD@Z @ 398 NONAME ; void * QWebPage::qt_metacast(char const *) + ?qt_metacast@QWebPluginDatabase@@UAEPAXPBD@Z @ 399 NONAME ; void * QWebPluginDatabase::qt_metacast(char const *) + ?qt_metacast@QWebPluginFactory@@UAEPAXPBD@Z @ 400 NONAME ; void * QWebPluginFactory::qt_metacast(char const *) + ?qt_metacast@QWebView@@UAEPAXPBD@Z @ 401 NONAME ; void * QWebView::qt_metacast(char const *) + ?qt_webpage_groupName@@YA?AVQString@@PAVQWebPage@@@Z @ 402 NONAME ; class QString qt_webpage_groupName(class QWebPage *) + ?qt_webpage_setGroupName@@YAXPAVQWebPage@@ABVQString@@@Z @ 403 NONAME ; void qt_webpage_setGroupName(class QWebPage *, class QString const &) + ?refresh@QWebPluginDatabase@@QAEXXZ @ 404 NONAME ; void QWebPluginDatabase::refresh(void) + ?refreshPlugins@QWebPluginFactory@@UAEXXZ @ 405 NONAME ; void QWebPluginFactory::refreshPlugins(void) + ?reload@QGraphicsWebView@@QAEXXZ @ 406 NONAME ; void QGraphicsWebView::reload(void) + ?reload@QWebView@@QAEXXZ @ 407 NONAME ; void QWebView::reload(void) + ?removeAllChildren@QWebElement@@QAEXXZ @ 408 NONAME ; void QWebElement::removeAllChildren(void) + ?removeAllDatabases@QWebDatabase@@SAXXZ @ 409 NONAME ; void QWebDatabase::removeAllDatabases(void) + ?removeAttribute@QWebElement@@QAEXABVQString@@@Z @ 410 NONAME ; void QWebElement::removeAttribute(class QString const &) + ?removeAttributeNS@QWebElement@@QAEXABVQString@@0@Z @ 411 NONAME ; void QWebElement::removeAttributeNS(class QString const &, class QString const &) + ?removeClass@QWebElement@@QAEXABVQString@@@Z @ 412 NONAME ; void QWebElement::removeClass(class QString const &) + ?removeDatabase@QWebDatabase@@SAXABV1@@Z @ 413 NONAME ; void QWebDatabase::removeDatabase(class QWebDatabase const &) + ?removeFromDocument@QWebElement@@QAEXXZ @ 414 NONAME ; void QWebElement::removeFromDocument(void) + ?removeLocalScheme@QWebSecurityOrigin@@SAXABVQString@@@Z @ 415 NONAME ; void QWebSecurityOrigin::removeLocalScheme(class QString const &) + ?render@QWebElement@@QAEXPAVQPainter@@@Z @ 416 NONAME ; void QWebElement::render(class QPainter *) + ?render@QWebFrame@@QAEXPAVQPainter@@@Z @ 417 NONAME ; void QWebFrame::render(class QPainter *) + ?render@QWebFrame@@QAEXPAVQPainter@@ABVQRegion@@@Z @ 418 NONAME ; void QWebFrame::render(class QPainter *, class QRegion const &) + ?render@QWebFrame@@QAEXPAVQPainter@@W4RenderLayer@1@ABVQRegion@@@Z @ 419 NONAME ; void QWebFrame::render(class QPainter *, enum QWebFrame::RenderLayer, class QRegion const &) + ?renderHints@QWebView@@QBE?AV?$QFlags@W4RenderHint@QPainter@@@@XZ @ 420 NONAME ; class QFlags<enum QPainter::RenderHint> QWebView::renderHints(void) const + ?renderTreeDump@QWebFrame@@QBE?AVQString@@XZ @ 421 NONAME ; class QString QWebFrame::renderTreeDump(void) const + ?repaintRequested@QWebPage@@IAEXABVQRect@@@Z @ 422 NONAME ; void QWebPage::repaintRequested(class QRect const &) + ?replace@QWebElement@@QAEXABV1@@Z @ 423 NONAME ; void QWebElement::replace(class QWebElement const &) + ?replace@QWebElement@@QAEXABVQString@@@Z @ 424 NONAME ; void QWebElement::replace(class QString const &) + ?requestedUrl@QWebFrame@@QBE?AVQUrl@@XZ @ 425 NONAME ; class QUrl QWebFrame::requestedUrl(void) const + ?resetAttribute@QWebSettings@@QAEXW4WebAttribute@1@@Z @ 426 NONAME ; void QWebSettings::resetAttribute(enum QWebSettings::WebAttribute) + ?resetFontFamily@QWebSettings@@QAEXW4FontFamily@1@@Z @ 427 NONAME ; void QWebSettings::resetFontFamily(enum QWebSettings::FontFamily) + ?resetFontSize@QWebSettings@@QAEXW4FontSize@1@@Z @ 428 NONAME ; void QWebSettings::resetFontSize(enum QWebSettings::FontSize) + ?resizeEvent@QWebInspector@@MAEXPAVQResizeEvent@@@Z @ 429 NONAME ; void QWebInspector::resizeEvent(class QResizeEvent *) + ?resizeEvent@QWebView@@MAEXPAVQResizeEvent@@@Z @ 430 NONAME ; void QWebView::resizeEvent(class QResizeEvent *) + ?restoreFrameStateRequested@QWebPage@@IAEXPAVQWebFrame@@@Z @ 431 NONAME ; void QWebPage::restoreFrameStateRequested(class QWebFrame *) + ?saveFrameStateRequested@QWebPage@@IAEXPAVQWebFrame@@PAVQWebHistoryItem@@@Z @ 432 NONAME ; void QWebPage::saveFrameStateRequested(class QWebFrame *, class QWebHistoryItem *) + ?sceneEvent@QGraphicsWebView@@MAE_NPAVQEvent@@@Z @ 433 NONAME ; bool QGraphicsWebView::sceneEvent(class QEvent *) + ?scheme@QWebSecurityOrigin@@QBE?AVQString@@XZ @ 434 NONAME ; class QString QWebSecurityOrigin::scheme(void) const + ?scroll@QWebFrame@@QAEXHH@Z @ 435 NONAME ; void QWebFrame::scroll(int, int) + ?scrollBarGeometry@QWebFrame@@QBE?AVQRect@@W4Orientation@Qt@@@Z @ 436 NONAME ; class QRect QWebFrame::scrollBarGeometry(enum Qt::Orientation) const + ?scrollBarMaximum@QWebFrame@@QBEHW4Orientation@Qt@@@Z @ 437 NONAME ; int QWebFrame::scrollBarMaximum(enum Qt::Orientation) const + ?scrollBarMinimum@QWebFrame@@QBEHW4Orientation@Qt@@@Z @ 438 NONAME ; int QWebFrame::scrollBarMinimum(enum Qt::Orientation) const + ?scrollBarPolicy@QWebFrame@@QBE?AW4ScrollBarPolicy@Qt@@W4Orientation@3@@Z @ 439 NONAME ; enum Qt::ScrollBarPolicy QWebFrame::scrollBarPolicy(enum Qt::Orientation) const + ?scrollBarValue@QWebFrame@@QBEHW4Orientation@Qt@@@Z @ 440 NONAME ; int QWebFrame::scrollBarValue(enum Qt::Orientation) const + ?scrollPosition@QWebFrame@@QBE?AVQPoint@@XZ @ 441 NONAME ; class QPoint QWebFrame::scrollPosition(void) const + ?scrollRequested@QWebPage@@IAEXHHABVQRect@@@Z @ 442 NONAME ; void QWebPage::scrollRequested(int, int, class QRect const &) + ?searchPaths@QWebPluginDatabase@@QBE?AVQStringList@@XZ @ 443 NONAME ; class QStringList QWebPluginDatabase::searchPaths(void) const + ?securityOrigin@QWebFrame@@QBE?AVQWebSecurityOrigin@@XZ @ 444 NONAME ; class QWebSecurityOrigin QWebFrame::securityOrigin(void) const + ?selectedText@QWebPage@@QBE?AVQString@@XZ @ 445 NONAME ; class QString QWebPage::selectedText(void) const + ?selectedText@QWebView@@QBE?AVQString@@XZ @ 446 NONAME ; class QString QWebView::selectedText(void) const + ?selectionChanged@QWebPage@@IAEXXZ @ 447 NONAME ; void QWebPage::selectionChanged(void) + ?selectionChanged@QWebView@@IAEXXZ @ 448 NONAME ; void QWebView::selectionChanged(void) + ?setAttribute@QWebElement@@QAEXABVQString@@0@Z @ 449 NONAME ; void QWebElement::setAttribute(class QString const &, class QString const &) + ?setAttribute@QWebSettings@@QAEXW4WebAttribute@1@_N@Z @ 450 NONAME ; void QWebSettings::setAttribute(enum QWebSettings::WebAttribute, bool) + ?setAttributeNS@QWebElement@@QAEXABVQString@@00@Z @ 451 NONAME ; void QWebElement::setAttributeNS(class QString const &, class QString const &, class QString const &) + ?setContent@QGraphicsWebView@@QAEXABVQByteArray@@ABVQString@@ABVQUrl@@@Z @ 452 NONAME ; void QGraphicsWebView::setContent(class QByteArray const &, class QString const &, class QUrl const &) + ?setContent@QWebFrame@@QAEXABVQByteArray@@ABVQString@@ABVQUrl@@@Z @ 453 NONAME ; void QWebFrame::setContent(class QByteArray const &, class QString const &, class QUrl const &) + ?setContent@QWebView@@QAEXABVQByteArray@@ABVQString@@ABVQUrl@@@Z @ 454 NONAME ; void QWebView::setContent(class QByteArray const &, class QString const &, class QUrl const &) + ?setContentEditable@QWebPage@@QAEX_N@Z @ 455 NONAME ; void QWebPage::setContentEditable(bool) + ?setDatabaseQuota@QWebSecurityOrigin@@QAEX_J@Z @ 456 NONAME ; void QWebSecurityOrigin::setDatabaseQuota(long long) + ?setDefaultInterface@QWebHistoryInterface@@SAXPAV1@@Z @ 457 NONAME ; void QWebHistoryInterface::setDefaultInterface(class QWebHistoryInterface *) + ?setDefaultTextEncoding@QWebSettings@@QAEXABVQString@@@Z @ 458 NONAME ; void QWebSettings::setDefaultTextEncoding(class QString const &) + ?setEnabled@QWebPluginInfo@@QAEX_N@Z @ 459 NONAME ; void QWebPluginInfo::setEnabled(bool) + ?setFocus@QWebElement@@QAEXXZ @ 460 NONAME ; void QWebElement::setFocus(void) + ?setFocus@QWebFrame@@QAEXXZ @ 461 NONAME ; void QWebFrame::setFocus(void) + ?setFontFamily@QWebSettings@@QAEXW4FontFamily@1@ABVQString@@@Z @ 462 NONAME ; void QWebSettings::setFontFamily(enum QWebSettings::FontFamily, class QString const &) + ?setFontSize@QWebSettings@@QAEXW4FontSize@1@H@Z @ 463 NONAME ; void QWebSettings::setFontSize(enum QWebSettings::FontSize, int) + ?setForwardUnsupportedContent@QWebPage@@QAEX_N@Z @ 464 NONAME ; void QWebPage::setForwardUnsupportedContent(bool) + ?setGeometry@QGraphicsWebView@@UAEXABVQRectF@@@Z @ 465 NONAME ; void QGraphicsWebView::setGeometry(class QRectF const &) + ?setHtml@QGraphicsWebView@@QAEXABVQString@@ABVQUrl@@@Z @ 466 NONAME ; void QGraphicsWebView::setHtml(class QString const &, class QUrl const &) + ?setHtml@QWebFrame@@QAEXABVQString@@ABVQUrl@@@Z @ 467 NONAME ; void QWebFrame::setHtml(class QString const &, class QUrl const &) + ?setHtml@QWebView@@QAEXABVQString@@ABVQUrl@@@Z @ 468 NONAME ; void QWebView::setHtml(class QString const &, class QUrl const &) + ?setIconDatabasePath@QWebSettings@@SAXABVQString@@@Z @ 469 NONAME ; void QWebSettings::setIconDatabasePath(class QString const &) + ?setInnerXml@QWebElement@@QAEXABVQString@@@Z @ 470 NONAME ; void QWebElement::setInnerXml(class QString const &) + ?setLinkDelegationPolicy@QWebPage@@QAEXW4LinkDelegationPolicy@1@@Z @ 471 NONAME ; void QWebPage::setLinkDelegationPolicy(enum QWebPage::LinkDelegationPolicy) + ?setLocalStoragePath@QWebSettings@@QAEXABVQString@@@Z @ 472 NONAME ; void QWebSettings::setLocalStoragePath(class QString const &) + ?setMaximumItemCount@QWebHistory@@QAEXH@Z @ 473 NONAME ; void QWebHistory::setMaximumItemCount(int) + ?setMaximumPagesInCache@QWebSettings@@SAXH@Z @ 474 NONAME ; void QWebSettings::setMaximumPagesInCache(int) + ?setNetworkAccessManager@QWebPage@@QAEXPAVQNetworkAccessManager@@@Z @ 475 NONAME ; void QWebPage::setNetworkAccessManager(class QNetworkAccessManager *) + ?setObjectCacheCapacities@QWebSettings@@SAXHHH@Z @ 476 NONAME ; void QWebSettings::setObjectCacheCapacities(int, int, int) + ?setOfflineStorageDefaultQuota@QWebSettings@@SAX_J@Z @ 477 NONAME ; void QWebSettings::setOfflineStorageDefaultQuota(long long) + ?setOfflineStoragePath@QWebSettings@@SAXABVQString@@@Z @ 478 NONAME ; void QWebSettings::setOfflineStoragePath(class QString const &) + ?setOfflineWebApplicationCachePath@QWebSettings@@SAXABVQString@@@Z @ 479 NONAME ; void QWebSettings::setOfflineWebApplicationCachePath(class QString const &) + ?setOfflineWebApplicationCacheQuota@QWebSettings@@SAX_J@Z @ 480 NONAME ; void QWebSettings::setOfflineWebApplicationCacheQuota(long long) + ?setOuterXml@QWebElement@@QAEXABVQString@@@Z @ 481 NONAME ; void QWebElement::setOuterXml(class QString const &) + ?setPage@QGraphicsWebView@@QAEXPAVQWebPage@@@Z @ 482 NONAME ; void QGraphicsWebView::setPage(class QWebPage *) + ?setPage@QWebInspector@@QAEXPAVQWebPage@@@Z @ 483 NONAME ; void QWebInspector::setPage(class QWebPage *) + ?setPage@QWebView@@QAEXPAVQWebPage@@@Z @ 484 NONAME ; void QWebView::setPage(class QWebPage *) + ?setPalette@QWebPage@@QAEXABVQPalette@@@Z @ 485 NONAME ; void QWebPage::setPalette(class QPalette const &) + ?setPlainText@QWebElement@@QAEXABVQString@@@Z @ 486 NONAME ; void QWebElement::setPlainText(class QString const &) + ?setPluginFactory@QWebPage@@QAEXPAVQWebPluginFactory@@@Z @ 487 NONAME ; void QWebPage::setPluginFactory(class QWebPluginFactory *) + ?setPreferredContentsSize@QWebPage@@QBEXABVQSize@@@Z @ 488 NONAME ; void QWebPage::setPreferredContentsSize(class QSize const &) const + ?setPreferredPluginForMimeType@QWebPluginDatabase@@QAEXABVQString@@ABVQWebPluginInfo@@@Z @ 489 NONAME ; void QWebPluginDatabase::setPreferredPluginForMimeType(class QString const &, class QWebPluginInfo const &) + ?setPrintingMaximumShrinkFactor@QWebSettings@@QAEXM@Z @ 490 NONAME ABSENT ; void QWebSettings::setPrintingMaximumShrinkFactor(float) + ?setPrintingMinimumShrinkFactor@QWebSettings@@QAEXM@Z @ 491 NONAME ABSENT ; void QWebSettings::setPrintingMinimumShrinkFactor(float) + ?setRenderHint@QWebView@@QAEXW4RenderHint@QPainter@@_N@Z @ 492 NONAME ; void QWebView::setRenderHint(enum QPainter::RenderHint, bool) + ?setRenderHints@QWebView@@QAEXV?$QFlags@W4RenderHint@QPainter@@@@@Z @ 493 NONAME ; void QWebView::setRenderHints(class QFlags<enum QPainter::RenderHint>) + ?setScrollBarPolicy@QWebFrame@@QAEXW4Orientation@Qt@@W4ScrollBarPolicy@3@@Z @ 494 NONAME ; void QWebFrame::setScrollBarPolicy(enum Qt::Orientation, enum Qt::ScrollBarPolicy) + ?setScrollBarValue@QWebFrame@@QAEXW4Orientation@Qt@@H@Z @ 495 NONAME ; void QWebFrame::setScrollBarValue(enum Qt::Orientation, int) + ?setScrollPosition@QWebFrame@@QAEXABVQPoint@@@Z @ 496 NONAME ; void QWebFrame::setScrollPosition(class QPoint const &) + ?setSearchPaths@QWebPluginDatabase@@QAEXABVQStringList@@@Z @ 497 NONAME ; void QWebPluginDatabase::setSearchPaths(class QStringList const &) + ?setStyleProperty@QWebElement@@QAEXABVQString@@0@Z @ 498 NONAME ; void QWebElement::setStyleProperty(class QString const &, class QString const &) + ?setTextSizeMultiplier@QWebFrame@@QAEXM@Z @ 499 NONAME ; void QWebFrame::setTextSizeMultiplier(float) + ?setTextSizeMultiplier@QWebView@@QAEXM@Z @ 500 NONAME ; void QWebView::setTextSizeMultiplier(float) + ?setUrl@QGraphicsWebView@@QAEXABVQUrl@@@Z @ 501 NONAME ; void QGraphicsWebView::setUrl(class QUrl const &) + ?setUrl@QWebFrame@@QAEXABVQUrl@@@Z @ 502 NONAME ; void QWebFrame::setUrl(class QUrl const &) + ?setUrl@QWebView@@QAEXABVQUrl@@@Z @ 503 NONAME ; void QWebView::setUrl(class QUrl const &) + ?setUserData@QWebHistoryItem@@QAEXABVQVariant@@@Z @ 504 NONAME ; void QWebHistoryItem::setUserData(class QVariant const &) + ?setUserStyleSheetUrl@QWebSettings@@QAEXABVQUrl@@@Z @ 505 NONAME ; void QWebSettings::setUserStyleSheetUrl(class QUrl const &) + ?setView@QWebPage@@QAEXPAVQWidget@@@Z @ 506 NONAME ; void QWebPage::setView(class QWidget *) + ?setViewportSize@QWebPage@@QBEXABVQSize@@@Z @ 507 NONAME ; void QWebPage::setViewportSize(class QSize const &) const + ?setWebGraphic@QWebSettings@@SAXW4WebGraphic@1@ABVQPixmap@@@Z @ 508 NONAME ; void QWebSettings::setWebGraphic(enum QWebSettings::WebGraphic, class QPixmap const &) + ?setZoomFactor@QGraphicsWebView@@QAEXM@Z @ 509 NONAME ; void QGraphicsWebView::setZoomFactor(float) + ?setZoomFactor@QWebFrame@@QAEXM@Z @ 510 NONAME ; void QWebFrame::setZoomFactor(float) + ?setZoomFactor@QWebView@@QAEXM@Z @ 511 NONAME ; void QWebView::setZoomFactor(float) + ?settings@QGraphicsWebView@@QBEPAVQWebSettings@@XZ @ 512 NONAME ; class QWebSettings * QGraphicsWebView::settings(void) const + ?settings@QWebPage@@QBEPAVQWebSettings@@XZ @ 513 NONAME ; class QWebSettings * QWebPage::settings(void) const + ?settings@QWebView@@QBEPAVQWebSettings@@XZ @ 514 NONAME ; class QWebSettings * QWebView::settings(void) const + ?shouldInterruptJavaScript@QWebPage@@QAE_NXZ @ 515 NONAME ; bool QWebPage::shouldInterruptJavaScript(void) + ?showEvent@QWebInspector@@MAEXPAVQShowEvent@@@Z @ 516 NONAME ; void QWebInspector::showEvent(class QShowEvent *) + ?size@QWebDatabase@@QBE_JXZ @ 517 NONAME ; long long QWebDatabase::size(void) const + ?sizeHint@QGraphicsWebView@@UBE?AVQSizeF@@W4SizeHint@Qt@@ABV2@@Z @ 518 NONAME ; class QSizeF QGraphicsWebView::sizeHint(enum Qt::SizeHint, class QSizeF const &) const + ?sizeHint@QWebInspector@@UBE?AVQSize@@XZ @ 519 NONAME ; class QSize QWebInspector::sizeHint(void) const + ?sizeHint@QWebView@@UBE?AVQSize@@XZ @ 520 NONAME ; class QSize QWebView::sizeHint(void) const + ?statusBarMessage@QGraphicsWebView@@IAEXABVQString@@@Z @ 521 NONAME ; void QGraphicsWebView::statusBarMessage(class QString const &) + ?statusBarMessage@QWebPage@@IAEXABVQString@@@Z @ 522 NONAME ; void QWebPage::statusBarMessage(class QString const &) + ?statusBarMessage@QWebView@@IAEXABVQString@@@Z @ 523 NONAME ; void QWebView::statusBarMessage(class QString const &) + ?statusBarVisibilityChangeRequested@QWebPage@@IAEX_N@Z @ 524 NONAME ; void QWebPage::statusBarVisibilityChangeRequested(bool) + ?stop@QGraphicsWebView@@QAEXXZ @ 525 NONAME ; void QGraphicsWebView::stop(void) + ?stop@QWebView@@QAEXXZ @ 526 NONAME ; void QWebView::stop(void) + ?styleProperty@QWebElement@@QBE?AVQString@@ABV2@W4StyleResolveStrategy@1@@Z @ 527 NONAME ; class QString QWebElement::styleProperty(class QString const &, enum QWebElement::StyleResolveStrategy) const + ?supportsExtension@QWebPage@@UBE_NW4Extension@1@@Z @ 528 NONAME ; bool QWebPage::supportsExtension(enum QWebPage::Extension) const + ?supportsExtension@QWebPluginFactory@@UBE_NW4Extension@1@@Z @ 529 NONAME ; bool QWebPluginFactory::supportsExtension(enum QWebPluginFactory::Extension) const + ?supportsMimeType@QWebPluginInfo@@QBE_NABVQString@@@Z @ 530 NONAME ; bool QWebPluginInfo::supportsMimeType(class QString const &) const + ?swallowContextMenuEvent@QWebPage@@QAE_NPAVQContextMenuEvent@@@Z @ 531 NONAME ; bool QWebPage::swallowContextMenuEvent(class QContextMenuEvent *) + ?tagName@QWebElement@@QBE?AVQString@@XZ @ 532 NONAME ; class QString QWebElement::tagName(void) const + ?takeFromDocument@QWebElement@@QAEAAV1@XZ @ 533 NONAME ; class QWebElement & QWebElement::takeFromDocument(void) + ?testAttribute@QWebSettings@@QBE_NW4WebAttribute@1@@Z @ 534 NONAME ; bool QWebSettings::testAttribute(enum QWebSettings::WebAttribute) const + ?textSizeMultiplier@QWebFrame@@QBEMXZ @ 535 NONAME ; float QWebFrame::textSizeMultiplier(void) const + ?textSizeMultiplier@QWebView@@QBEMXZ @ 536 NONAME ; float QWebView::textSizeMultiplier(void) const + ?title@QGraphicsWebView@@QBE?AVQString@@XZ @ 537 NONAME ; class QString QGraphicsWebView::title(void) const + ?title@QWebFrame@@QBE?AVQString@@XZ @ 538 NONAME ; class QString QWebFrame::title(void) const + ?title@QWebHistoryItem@@QBE?AVQString@@XZ @ 539 NONAME ; class QString QWebHistoryItem::title(void) const + ?title@QWebHitTestResult@@QBE?AVQString@@XZ @ 540 NONAME ; class QString QWebHitTestResult::title(void) const + ?title@QWebView@@QBE?AVQString@@XZ @ 541 NONAME ; class QString QWebView::title(void) const + ?titleChanged@QGraphicsWebView@@IAEXABVQString@@@Z @ 542 NONAME ; void QGraphicsWebView::titleChanged(class QString const &) + ?titleChanged@QWebFrame@@IAEXABVQString@@@Z @ 543 NONAME ; void QWebFrame::titleChanged(class QString const &) + ?titleChanged@QWebView@@IAEXABVQString@@@Z @ 544 NONAME ; void QWebView::titleChanged(class QString const &) + ?toHtml@QWebFrame@@QBE?AVQString@@XZ @ 545 NONAME ; class QString QWebFrame::toHtml(void) const + ?toInnerXml@QWebElement@@QBE?AVQString@@XZ @ 546 NONAME ; class QString QWebElement::toInnerXml(void) const + ?toList@QWebElementCollection@@QBE?AV?$QList@VQWebElement@@@@XZ @ 547 NONAME ; class QList<class QWebElement> QWebElementCollection::toList(void) const + ?toOuterXml@QWebElement@@QBE?AVQString@@XZ @ 548 NONAME ; class QString QWebElement::toOuterXml(void) const + ?toPlainText@QWebElement@@QBE?AVQString@@XZ @ 549 NONAME ; class QString QWebElement::toPlainText(void) const + ?toPlainText@QWebFrame@@QBE?AVQString@@XZ @ 550 NONAME ; class QString QWebFrame::toPlainText(void) const + ?toggleClass@QWebElement@@QAEXABVQString@@@Z @ 551 NONAME ; void QWebElement::toggleClass(class QString const &) + ?toolBarVisibilityChangeRequested@QWebPage@@IAEX_N@Z @ 552 NONAME ; void QWebPage::toolBarVisibilityChangeRequested(bool) + ?totalBytes@QWebPage@@QBE_KXZ @ 553 NONAME ; unsigned long long QWebPage::totalBytes(void) const + ?tr@QGraphicsWebView@@SA?AVQString@@PBD0@Z @ 554 NONAME ; class QString QGraphicsWebView::tr(char const *, char const *) + ?tr@QGraphicsWebView@@SA?AVQString@@PBD0H@Z @ 555 NONAME ; class QString QGraphicsWebView::tr(char const *, char const *, int) + ?tr@QWebFrame@@SA?AVQString@@PBD0@Z @ 556 NONAME ; class QString QWebFrame::tr(char const *, char const *) + ?tr@QWebFrame@@SA?AVQString@@PBD0H@Z @ 557 NONAME ; class QString QWebFrame::tr(char const *, char const *, int) + ?tr@QWebHistoryInterface@@SA?AVQString@@PBD0@Z @ 558 NONAME ; class QString QWebHistoryInterface::tr(char const *, char const *) + ?tr@QWebHistoryInterface@@SA?AVQString@@PBD0H@Z @ 559 NONAME ; class QString QWebHistoryInterface::tr(char const *, char const *, int) + ?tr@QWebInspector@@SA?AVQString@@PBD0@Z @ 560 NONAME ; class QString QWebInspector::tr(char const *, char const *) + ?tr@QWebInspector@@SA?AVQString@@PBD0H@Z @ 561 NONAME ; class QString QWebInspector::tr(char const *, char const *, int) + ?tr@QWebPage@@SA?AVQString@@PBD0@Z @ 562 NONAME ; class QString QWebPage::tr(char const *, char const *) + ?tr@QWebPage@@SA?AVQString@@PBD0H@Z @ 563 NONAME ; class QString QWebPage::tr(char const *, char const *, int) + ?tr@QWebPluginDatabase@@SA?AVQString@@PBD0@Z @ 564 NONAME ; class QString QWebPluginDatabase::tr(char const *, char const *) + ?tr@QWebPluginDatabase@@SA?AVQString@@PBD0H@Z @ 565 NONAME ; class QString QWebPluginDatabase::tr(char const *, char const *, int) + ?tr@QWebPluginFactory@@SA?AVQString@@PBD0@Z @ 566 NONAME ; class QString QWebPluginFactory::tr(char const *, char const *) + ?tr@QWebPluginFactory@@SA?AVQString@@PBD0H@Z @ 567 NONAME ; class QString QWebPluginFactory::tr(char const *, char const *, int) + ?tr@QWebView@@SA?AVQString@@PBD0@Z @ 568 NONAME ; class QString QWebView::tr(char const *, char const *) + ?tr@QWebView@@SA?AVQString@@PBD0H@Z @ 569 NONAME ; class QString QWebView::tr(char const *, char const *, int) + ?trUtf8@QGraphicsWebView@@SA?AVQString@@PBD0@Z @ 570 NONAME ; class QString QGraphicsWebView::trUtf8(char const *, char const *) + ?trUtf8@QGraphicsWebView@@SA?AVQString@@PBD0H@Z @ 571 NONAME ; class QString QGraphicsWebView::trUtf8(char const *, char const *, int) + ?trUtf8@QWebFrame@@SA?AVQString@@PBD0@Z @ 572 NONAME ; class QString QWebFrame::trUtf8(char const *, char const *) + ?trUtf8@QWebFrame@@SA?AVQString@@PBD0H@Z @ 573 NONAME ; class QString QWebFrame::trUtf8(char const *, char const *, int) + ?trUtf8@QWebHistoryInterface@@SA?AVQString@@PBD0@Z @ 574 NONAME ; class QString QWebHistoryInterface::trUtf8(char const *, char const *) + ?trUtf8@QWebHistoryInterface@@SA?AVQString@@PBD0H@Z @ 575 NONAME ; class QString QWebHistoryInterface::trUtf8(char const *, char const *, int) + ?trUtf8@QWebInspector@@SA?AVQString@@PBD0@Z @ 576 NONAME ; class QString QWebInspector::trUtf8(char const *, char const *) + ?trUtf8@QWebInspector@@SA?AVQString@@PBD0H@Z @ 577 NONAME ; class QString QWebInspector::trUtf8(char const *, char const *, int) + ?trUtf8@QWebPage@@SA?AVQString@@PBD0@Z @ 578 NONAME ; class QString QWebPage::trUtf8(char const *, char const *) + ?trUtf8@QWebPage@@SA?AVQString@@PBD0H@Z @ 579 NONAME ; class QString QWebPage::trUtf8(char const *, char const *, int) + ?trUtf8@QWebPluginDatabase@@SA?AVQString@@PBD0@Z @ 580 NONAME ; class QString QWebPluginDatabase::trUtf8(char const *, char const *) + ?trUtf8@QWebPluginDatabase@@SA?AVQString@@PBD0H@Z @ 581 NONAME ; class QString QWebPluginDatabase::trUtf8(char const *, char const *, int) + ?trUtf8@QWebPluginFactory@@SA?AVQString@@PBD0@Z @ 582 NONAME ; class QString QWebPluginFactory::trUtf8(char const *, char const *) + ?trUtf8@QWebPluginFactory@@SA?AVQString@@PBD0H@Z @ 583 NONAME ; class QString QWebPluginFactory::trUtf8(char const *, char const *, int) + ?trUtf8@QWebView@@SA?AVQString@@PBD0@Z @ 584 NONAME ; class QString QWebView::trUtf8(char const *, char const *) + ?trUtf8@QWebView@@SA?AVQString@@PBD0H@Z @ 585 NONAME ; class QString QWebView::trUtf8(char const *, char const *, int) + ?triggerAction@QWebPage@@UAEXW4WebAction@1@_N@Z @ 586 NONAME ; void QWebPage::triggerAction(enum QWebPage::WebAction, bool) + ?triggerPageAction@QGraphicsWebView@@QAEXW4WebAction@QWebPage@@_N@Z @ 587 NONAME ; void QGraphicsWebView::triggerPageAction(enum QWebPage::WebAction, bool) + ?triggerPageAction@QWebView@@QAEXW4WebAction@QWebPage@@_N@Z @ 588 NONAME ; void QWebView::triggerPageAction(enum QWebPage::WebAction, bool) + ?undoStack@QWebPage@@QBEPAVQUndoStack@@XZ @ 589 NONAME ; class QUndoStack * QWebPage::undoStack(void) const + ?unsupportedContent@QWebPage@@IAEXPAVQNetworkReply@@@Z @ 590 NONAME ; void QWebPage::unsupportedContent(class QNetworkReply *) + ?updateGeometry@QGraphicsWebView@@UAEXXZ @ 591 NONAME ; void QGraphicsWebView::updateGeometry(void) + ?updatePositionDependentActions@QWebPage@@QAEXABVQPoint@@@Z @ 592 NONAME ; void QWebPage::updatePositionDependentActions(class QPoint const &) + ?url@QGraphicsWebView@@QBE?AVQUrl@@XZ @ 593 NONAME ; class QUrl QGraphicsWebView::url(void) const + ?url@QWebFrame@@QBE?AVQUrl@@XZ @ 594 NONAME ; class QUrl QWebFrame::url(void) const + ?url@QWebHistoryItem@@QBE?AVQUrl@@XZ @ 595 NONAME ; class QUrl QWebHistoryItem::url(void) const + ?url@QWebView@@QBE?AVQUrl@@XZ @ 596 NONAME ; class QUrl QWebView::url(void) const + ?urlChanged@QGraphicsWebView@@IAEXABVQUrl@@@Z @ 597 NONAME ; void QGraphicsWebView::urlChanged(class QUrl const &) + ?urlChanged@QWebFrame@@IAEXABVQUrl@@@Z @ 598 NONAME ; void QWebFrame::urlChanged(class QUrl const &) + ?urlChanged@QWebView@@IAEXABVQUrl@@@Z @ 599 NONAME ; void QWebView::urlChanged(class QUrl const &) + ?userAgentForUrl@QWebPage@@MBE?AVQString@@ABVQUrl@@@Z @ 600 NONAME ; class QString QWebPage::userAgentForUrl(class QUrl const &) const + ?userData@QWebHistoryItem@@QBE?AVQVariant@@XZ @ 601 NONAME ; class QVariant QWebHistoryItem::userData(void) const + ?userStyleSheetUrl@QWebSettings@@QBE?AVQUrl@@XZ @ 602 NONAME ; class QUrl QWebSettings::userStyleSheetUrl(void) const + ?view@QWebPage@@QBEPAVQWidget@@XZ @ 603 NONAME ; class QWidget * QWebPage::view(void) const + ?viewportSize@QWebPage@@QBE?AVQSize@@XZ @ 604 NONAME ; class QSize QWebPage::viewportSize(void) const + ?webFrame@QWebElement@@QBEPAVQWebFrame@@XZ @ 605 NONAME ; class QWebFrame * QWebElement::webFrame(void) const + ?webGraphic@QWebSettings@@SA?AVQPixmap@@W4WebGraphic@1@@Z @ 606 NONAME ; class QPixmap QWebSettings::webGraphic(enum QWebSettings::WebGraphic) + ?wheelEvent@QGraphicsWebView@@MAEXPAVQGraphicsSceneWheelEvent@@@Z @ 607 NONAME ; void QGraphicsWebView::wheelEvent(class QGraphicsSceneWheelEvent *) + ?wheelEvent@QWebView@@MAEXPAVQWheelEvent@@@Z @ 608 NONAME ; void QWebView::wheelEvent(class QWheelEvent *) + ?windowCloseRequested@QWebPage@@IAEXXZ @ 609 NONAME ; void QWebPage::windowCloseRequested(void) + ?zoomFactor@QGraphicsWebView@@QBEMXZ @ 610 NONAME ; float QGraphicsWebView::zoomFactor(void) const + ?zoomFactor@QWebFrame@@QBEMXZ @ 611 NONAME ; float QWebFrame::zoomFactor(void) const + ?zoomFactor@QWebView@@QBEMXZ @ 612 NONAME ; float QWebView::zoomFactor(void) const + ?staticMetaObject@QWebPluginDatabase@@2UQMetaObject@@B @ 613 NONAME ; struct QMetaObject const QWebPluginDatabase::staticMetaObject + ?staticMetaObject@QWebFrame@@2UQMetaObject@@B @ 614 NONAME ; struct QMetaObject const QWebFrame::staticMetaObject + ?staticMetaObject@QWebHistoryInterface@@2UQMetaObject@@B @ 615 NONAME ; struct QMetaObject const QWebHistoryInterface::staticMetaObject + ?staticMetaObject@QWebInspector@@2UQMetaObject@@B @ 616 NONAME ; struct QMetaObject const QWebInspector::staticMetaObject + ?staticMetaObject@QWebPluginFactory@@2UQMetaObject@@B @ 617 NONAME ; struct QMetaObject const QWebPluginFactory::staticMetaObject + ?staticMetaObject@QGraphicsWebView@@2UQMetaObject@@B @ 618 NONAME ; struct QMetaObject const QGraphicsWebView::staticMetaObject + ?staticMetaObject@QWebPage@@2UQMetaObject@@B @ 619 NONAME ; struct QMetaObject const QWebPage::staticMetaObject + ?staticMetaObject@QWebView@@2UQMetaObject@@B @ 620 NONAME ; struct QMetaObject const QWebView::staticMetaObject + ?attributeNames@QWebElement@@QBE?AVQStringList@@ABVQString@@@Z @ 621 NONAME ; class QStringList QWebElement::attributeNames(class QString const &) const + ?qt_networkAccessAllowed@@YAX_N@Z @ 622 NONAME ; void qt_networkAccessAllowed(bool) + ?qt_resumeActiveDOMObjects@@YAXPAVQWebFrame@@@Z @ 623 NONAME ; void qt_resumeActiveDOMObjects(class QWebFrame *) + ?qt_suspendActiveDOMObjects@@YAXPAVQWebFrame@@@Z @ 624 NONAME ; void qt_suspendActiveDOMObjects(class QWebFrame *) + ?qtwebkit_webframe_scrollRecursively@@YA_NPAVQWebFrame@@HH@Z @ 625 NONAME ABSENT ; bool qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int) + ?closeEvent@QWebInspector@@MAEXPAVQCloseEvent@@@Z @ 626 NONAME ; void QWebInspector::closeEvent(class QCloseEvent *) + ?inspectorUrl@QWebSettings@@QBE?AVQUrl@@XZ @ 627 NONAME ABSENT ; class QUrl QWebSettings::inspectorUrl(void) const + ?isTiledBackingStoreFrozen@QGraphicsWebView@@QBE_NXZ @ 628 NONAME ; bool QGraphicsWebView::isTiledBackingStoreFrozen(void) const + ?pageChanged@QWebFrame@@IAEXXZ @ 629 NONAME ; void QWebFrame::pageChanged(void) + ?qt_drt_enableCaretBrowsing@@YAXPAVQWebPage@@_N@Z @ 630 NONAME ; void qt_drt_enableCaretBrowsing(class QWebPage *, bool) + ?qt_drt_evaluateScriptInIsolatedWorld@@YAXPAVQWebFrame@@HABVQString@@@Z @ 631 NONAME ; void qt_drt_evaluateScriptInIsolatedWorld(class QWebFrame *, int, class QString const &) + ?qt_drt_hasDocumentElement@@YA_NPAVQWebFrame@@@Z @ 632 NONAME ; bool qt_drt_hasDocumentElement(class QWebFrame *) + ?qt_drt_numberOfPages@@YAHPAVQWebFrame@@MM@Z @ 633 NONAME ; int qt_drt_numberOfPages(class QWebFrame *, float, float) + ?qt_drt_pageNumberForElementById@@YAHPAVQWebFrame@@ABVQString@@MM@Z @ 634 NONAME ; int qt_drt_pageNumberForElementById(class QWebFrame *, class QString const &, float, float) + ?qt_drt_pauseSVGAnimation@@YA_NPAVQWebFrame@@ABVQString@@N1@Z @ 635 NONAME ; bool qt_drt_pauseSVGAnimation(class QWebFrame *, class QString const &, double, class QString const &) + ?qt_drt_setDomainRelaxationForbiddenForURLScheme@@YAX_NABVQString@@@Z @ 636 NONAME ; void qt_drt_setDomainRelaxationForbiddenForURLScheme(bool, class QString const &) + ?qt_drt_setFrameFlatteningEnabled@@YAXPAVQWebPage@@_N@Z @ 637 NONAME ; void qt_drt_setFrameFlatteningEnabled(class QWebPage *, bool) + ?qt_drt_setMediaType@@YAXPAVQWebFrame@@ABVQString@@@Z @ 638 NONAME ; void qt_drt_setMediaType(class QWebFrame *, class QString const &) + ?qt_drt_setTimelineProfilingEnabled@@YAXPAVQWebPage@@_N@Z @ 639 NONAME ; void qt_drt_setTimelineProfilingEnabled(class QWebPage *, bool) + ?qt_drt_webinspector_close@@YAXPAVQWebPage@@@Z @ 640 NONAME ; void qt_drt_webinspector_close(class QWebPage *) + ?qt_drt_webinspector_executeScript@@YAXPAVQWebPage@@JABVQString@@@Z @ 641 NONAME ; void qt_drt_webinspector_executeScript(class QWebPage *, long, class QString const &) + ?qt_drt_webinspector_show@@YAXPAVQWebPage@@@Z @ 642 NONAME ; void qt_drt_webinspector_show(class QWebPage *) + ?qt_drt_workerThreadCount@@YAHXZ @ 643 NONAME ; int qt_drt_workerThreadCount(void) + ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) + ?qtwebkit_webframe_scrollRecursively@@YAXPAVQWebFrame@@HHABVQPoint@@@Z @ 645 NONAME ; void qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int, class QPoint const &) + ?resizesToContents@QGraphicsWebView@@QBE_NXZ @ 646 NONAME ; bool QGraphicsWebView::resizesToContents(void) const + ?scrollToAnchor@QWebFrame@@QAEXABVQString@@@Z @ 647 NONAME ; void QWebFrame::scrollToAnchor(class QString const &) + ?setInspectorUrl@QWebSettings@@QAEXABVQUrl@@@Z @ 648 NONAME ABSENT ; void QWebSettings::setInspectorUrl(class QUrl const &) + ?setResizesToContents@QGraphicsWebView@@QAEX_N@Z @ 649 NONAME ; void QGraphicsWebView::setResizesToContents(bool) + ?setTiledBackingStoreFrozen@QGraphicsWebView@@QAEX_N@Z @ 650 NONAME ; void QGraphicsWebView::setTiledBackingStoreFrozen(bool) + ?qtwebkit_webframe_scrollOverflow@@YA_NPAVQWebFrame@@HHABVQPoint@@@Z @ 651 NONAME ; bool qtwebkit_webframe_scrollOverflow(QWebFrame *, int, int, const QPoint&) + ?qtwebkit_setPluginCreatedCallback@@YAXP6AXPAVQWebFrame@@PAX1@Z@Z @ 652 NONAME ; void qtwebkit_setPluginCreatedCallback(void (*)(class QWebFrame *, void *, void *)) diff --git a/Source/WebKit/qt/symbian/eabi/QtWebKitu.def b/Source/WebKit/qt/symbian/eabi/QtWebKitu.def new file mode 100644 index 0000000..1e06c11 --- /dev/null +++ b/Source/WebKit/qt/symbian/eabi/QtWebKitu.def @@ -0,0 +1,838 @@ +EXPORTS
+ _Z10qt_drt_runb @ 1 NONAME
+ _Z14qWebKitVersionv @ 2 NONAME
+ _Z19qWebKitMajorVersionv @ 3 NONAME
+ _Z19qWebKitMinorVersionv @ 4 NONAME
+ _Z20qt_dump_frame_loaderb @ 5 NONAME
+ _Z20qt_webpage_groupNameP8QWebPage @ 6 NONAME
+ _Z21qt_drt_clearFrameNameP9QWebFrame @ 7 NONAME
+ _Z21qt_drt_pauseAnimationP9QWebFrameRK7QStringdS3_ @ 8 NONAME
+ _Z23qt_webpage_setGroupNameP8QWebPageRK7QString @ 9 NONAME
+ _Z25qt_dump_editing_callbacksb @ 10 NONAME
+ _Z27qt_dump_set_accepts_editingb @ 11 NONAME
+ _Z29qt_drt_javaScriptObjectsCountv @ 12 NONAME
+ _Z31qt_drt_garbageCollector_collectv @ 13 NONAME
+ _Z31qt_drt_numberOfActiveAnimationsP9QWebFrame @ 14 NONAME
+ _Z31qt_dump_resource_load_callbacksb @ 15 NONAME
+ _Z32qt_drt_pauseTransitionOfPropertyP9QWebFrameRK7QStringdS3_ @ 16 NONAME
+ _Z33qt_drt_overwritePluginDirectoriesv @ 17 NONAME
+ _Z36qt_drt_setJavaScriptProfilingEnabledP9QWebFrameb @ 18 NONAME
+ _Z48qt_drt_garbageCollector_collectOnAlternateThreadb @ 19 NONAME
+ _ZN11QWebElement11encloseWithERK7QString @ 20 NONAME
+ _ZN11QWebElement11encloseWithERKS_ @ 21 NONAME
+ _ZN11QWebElement11removeClassERK7QString @ 22 NONAME
+ _ZN11QWebElement11setInnerXmlERK7QString @ 23 NONAME
+ _ZN11QWebElement11setOuterXmlERK7QString @ 24 NONAME
+ _ZN11QWebElement11toggleClassERK7QString @ 25 NONAME
+ _ZN11QWebElement12appendInsideERK7QString @ 26 NONAME
+ _ZN11QWebElement12appendInsideERKS_ @ 27 NONAME
+ _ZN11QWebElement12setAttributeERK7QStringS2_ @ 28 NONAME
+ _ZN11QWebElement12setPlainTextERK7QString @ 29 NONAME
+ _ZN11QWebElement13appendOutsideERK7QString @ 30 NONAME
+ _ZN11QWebElement13appendOutsideERKS_ @ 31 NONAME
+ _ZN11QWebElement13prependInsideERK7QString @ 32 NONAME
+ _ZN11QWebElement13prependInsideERKS_ @ 33 NONAME
+ _ZN11QWebElement14prependOutsideERK7QString @ 34 NONAME
+ _ZN11QWebElement14prependOutsideERKS_ @ 35 NONAME
+ _ZN11QWebElement14removeChildrenEv @ 36 NONAME ABSENT
+ _ZN11QWebElement14setAttributeNSERK7QStringS2_S2_ @ 37 NONAME
+ _ZN11QWebElement15removeAttributeERK7QString @ 38 NONAME
+ _ZN11QWebElement16enclosingElementEPN7WebCore4NodeE @ 39 NONAME
+ _ZN11QWebElement16setStylePropertyERK7QStringS2_ @ 40 NONAME
+ _ZN11QWebElement16takeFromDocumentEv @ 41 NONAME
+ _ZN11QWebElement17removeAttributeNSERK7QStringS2_ @ 42 NONAME
+ _ZN11QWebElement18evaluateJavaScriptERK7QString @ 43 NONAME
+ _ZN11QWebElement18removeFromDocumentEv @ 44 NONAME
+ _ZN11QWebElement19encloseContentsWithERK7QString @ 45 NONAME
+ _ZN11QWebElement19encloseContentsWithERKS_ @ 46 NONAME
+ _ZN11QWebElement7replaceERK7QString @ 47 NONAME
+ _ZN11QWebElement7replaceERKS_ @ 48 NONAME
+ _ZN11QWebElement8addClassERK7QString @ 49 NONAME
+ _ZN11QWebElement8setFocusEv @ 50 NONAME
+ _ZN11QWebElementC1EPN7WebCore4NodeE @ 51 NONAME
+ _ZN11QWebElementC1EPN7WebCore7ElementE @ 52 NONAME
+ _ZN11QWebElementC1ERKS_ @ 53 NONAME
+ _ZN11QWebElementC1Ev @ 54 NONAME
+ _ZN11QWebElementC2EPN7WebCore4NodeE @ 55 NONAME
+ _ZN11QWebElementC2EPN7WebCore7ElementE @ 56 NONAME
+ _ZN11QWebElementC2ERKS_ @ 57 NONAME
+ _ZN11QWebElementC2Ev @ 58 NONAME
+ _ZN11QWebElementD1Ev @ 59 NONAME
+ _ZN11QWebElementD2Ev @ 60 NONAME
+ _ZN11QWebElementaSERKS_ @ 61 NONAME
+ _ZN11QWebHistory12restoreStateERK10QByteArray @ 62 NONAME ABSENT
+ _ZN11QWebHistory19setMaximumItemCountEi @ 63 NONAME
+ _ZN11QWebHistory4backEv @ 64 NONAME
+ _ZN11QWebHistory5clearEv @ 65 NONAME
+ _ZN11QWebHistory7forwardEv @ 66 NONAME
+ _ZN11QWebHistory8goToItemERK15QWebHistoryItem @ 67 NONAME
+ _ZN11QWebHistoryC1Ev @ 68 NONAME
+ _ZN11QWebHistoryC2Ev @ 69 NONAME
+ _ZN11QWebHistoryD1Ev @ 70 NONAME
+ _ZN11QWebHistoryD2Ev @ 71 NONAME
+ _ZN12QWebDatabase14removeDatabaseERKS_ @ 72 NONAME
+ _ZN12QWebDatabase18removeAllDatabasesEv @ 73 NONAME
+ _ZN12QWebDatabaseC1EP19QWebDatabasePrivate @ 74 NONAME
+ _ZN12QWebDatabaseC1ERKS_ @ 75 NONAME
+ _ZN12QWebDatabaseC2EP19QWebDatabasePrivate @ 76 NONAME
+ _ZN12QWebDatabaseC2ERKS_ @ 77 NONAME
+ _ZN12QWebDatabaseD1Ev @ 78 NONAME
+ _ZN12QWebDatabaseD2Ev @ 79 NONAME
+ _ZN12QWebDatabaseaSERKS_ @ 80 NONAME
+ _ZN12QWebSettings10iconForUrlERK4QUrl @ 81 NONAME
+ _ZN12QWebSettings10webGraphicENS_10WebGraphicE @ 82 NONAME
+ _ZN12QWebSettings11setFontSizeENS_8FontSizeEi @ 83 NONAME
+ _ZN12QWebSettings12setAttributeENS_12WebAttributeEb @ 84 NONAME
+ _ZN12QWebSettings13resetFontSizeENS_8FontSizeE @ 85 NONAME
+ _ZN12QWebSettings13setFontFamilyENS_10FontFamilyERK7QString @ 86 NONAME
+ _ZN12QWebSettings13setWebGraphicENS_10WebGraphicERK7QPixmap @ 87 NONAME
+ _ZN12QWebSettings14globalSettingsEv @ 88 NONAME
+ _ZN12QWebSettings14pluginDatabaseEv @ 89 NONAME ABSENT
+ _ZN12QWebSettings14resetAttributeENS_12WebAttributeE @ 90 NONAME
+ _ZN12QWebSettings15resetFontFamilyENS_10FontFamilyE @ 91 NONAME
+ _ZN12QWebSettings16iconDatabasePathEv @ 92 NONAME
+ _ZN12QWebSettings17clearIconDatabaseEv @ 93 NONAME
+ _ZN12QWebSettings17clearMemoryCachesEv @ 94 NONAME
+ _ZN12QWebSettings18offlineStoragePathEv @ 95 NONAME
+ _ZN12QWebSettings19maximumPagesInCacheEv @ 96 NONAME
+ _ZN12QWebSettings19setIconDatabasePathERK7QString @ 97 NONAME
+ _ZN12QWebSettings19setLocalStoragePathERK7QString @ 98 NONAME
+ _ZN12QWebSettings20setUserStyleSheetUrlERK4QUrl @ 99 NONAME
+ _ZN12QWebSettings21setOfflineStoragePathERK7QString @ 100 NONAME
+ _ZN12QWebSettings22setDefaultTextEncodingERK7QString @ 101 NONAME
+ _ZN12QWebSettings22setMaximumPagesInCacheEi @ 102 NONAME
+ _ZN12QWebSettings23enablePersistentStorageERK7QString @ 103 NONAME
+ _ZN12QWebSettings24setObjectCacheCapacitiesEiii @ 104 NONAME
+ _ZN12QWebSettings26offlineStorageDefaultQuotaEv @ 105 NONAME
+ _ZN12QWebSettings29setOfflineStorageDefaultQuotaEx @ 106 NONAME
+ _ZN12QWebSettings30offlineWebApplicationCachePathEv @ 107 NONAME
+ _ZN12QWebSettings31offlineWebApplicationCacheQuotaEv @ 108 NONAME
+ _ZN12QWebSettings33setOfflineWebApplicationCachePathERK7QString @ 109 NONAME
+ _ZN12QWebSettings34setOfflineWebApplicationCacheQuotaEx @ 110 NONAME
+ _ZN12QWebSettingsC1EPN7WebCore8SettingsE @ 111 NONAME
+ _ZN12QWebSettingsC1Ev @ 112 NONAME
+ _ZN12QWebSettingsC2EPN7WebCore8SettingsE @ 113 NONAME
+ _ZN12QWebSettingsC2Ev @ 114 NONAME
+ _ZN12QWebSettingsD1Ev @ 115 NONAME
+ _ZN12QWebSettingsD2Ev @ 116 NONAME
+ _ZN13QWebInspector11qt_metacallEN11QMetaObject4CallEiPPv @ 117 NONAME
+ _ZN13QWebInspector11qt_metacastEPKc @ 118 NONAME
+ _ZN13QWebInspector11resizeEventEP12QResizeEvent @ 119 NONAME
+ _ZN13QWebInspector16staticMetaObjectE @ 120 NONAME DATA 16
+ _ZN13QWebInspector18windowTitleChangedERK7QString @ 121 NONAME ABSENT
+ _ZN13QWebInspector19getStaticMetaObjectEv @ 122 NONAME
+ _ZN13QWebInspector5eventEP6QEvent @ 123 NONAME
+ _ZN13QWebInspector7setPageEP8QWebPage @ 124 NONAME
+ _ZN13QWebInspector9hideEventEP10QHideEvent @ 125 NONAME
+ _ZN13QWebInspector9showEventEP10QShowEvent @ 126 NONAME
+ _ZN13QWebInspectorC1EP7QWidget @ 127 NONAME
+ _ZN13QWebInspectorC2EP7QWidget @ 128 NONAME
+ _ZN13QWebInspectorD0Ev @ 129 NONAME
+ _ZN13QWebInspectorD1Ev @ 130 NONAME
+ _ZN13QWebInspectorD2Ev @ 131 NONAME
+ _ZN14QWebPluginInfo10setEnabledEb @ 132 NONAME
+ _ZN14QWebPluginInfoC1EPN7WebCore13PluginPackageE @ 133 NONAME
+ _ZN14QWebPluginInfoC1ERKS_ @ 134 NONAME
+ _ZN14QWebPluginInfoC1Ev @ 135 NONAME
+ _ZN14QWebPluginInfoC2EPN7WebCore13PluginPackageE @ 136 NONAME
+ _ZN14QWebPluginInfoC2ERKS_ @ 137 NONAME
+ _ZN14QWebPluginInfoC2Ev @ 138 NONAME
+ _ZN14QWebPluginInfoD1Ev @ 139 NONAME
+ _ZN14QWebPluginInfoD2Ev @ 140 NONAME
+ _ZN14QWebPluginInfoaSERKS_ @ 141 NONAME
+ _ZN15QWebHistoryItem11setUserDataERK8QVariant @ 142 NONAME
+ _ZN15QWebHistoryItemC1EP22QWebHistoryItemPrivate @ 143 NONAME
+ _ZN15QWebHistoryItemC1ERKS_ @ 144 NONAME
+ _ZN15QWebHistoryItemC2EP22QWebHistoryItemPrivate @ 145 NONAME
+ _ZN15QWebHistoryItemC2ERKS_ @ 146 NONAME
+ _ZN15QWebHistoryItemD1Ev @ 147 NONAME
+ _ZN15QWebHistoryItemD2Ev @ 148 NONAME
+ _ZN15QWebHistoryItemaSERKS_ @ 149 NONAME
+ _ZN16QGraphicsWebView10loadFailedEv @ 150 NONAME ABSENT
+ _ZN16QGraphicsWebView10sceneEventEP6QEvent @ 151 NONAME
+ _ZN16QGraphicsWebView10setContentERK10QByteArrayRK7QStringRK4QUrl @ 152 NONAME
+ _ZN16QGraphicsWebView10urlChangedERK4QUrl @ 153 NONAME
+ _ZN16QGraphicsWebView10wheelEventEP24QGraphicsSceneWheelEvent @ 154 NONAME
+ _ZN16QGraphicsWebView11iconChangedEv @ 155 NONAME
+ _ZN16QGraphicsWebView11loadStartedEv @ 156 NONAME
+ _ZN16QGraphicsWebView11qt_metacallEN11QMetaObject4CallEiPPv @ 157 NONAME
+ _ZN16QGraphicsWebView11qt_metacastEPKc @ 158 NONAME
+ _ZN16QGraphicsWebView11setGeometryERK6QRectF @ 159 NONAME
+ _ZN16QGraphicsWebView12focusInEventEP11QFocusEvent @ 160 NONAME
+ _ZN16QGraphicsWebView12loadFinishedEv @ 161 NONAME ABSENT
+ _ZN16QGraphicsWebView12titleChangedERK7QString @ 162 NONAME
+ _ZN16QGraphicsWebView13dragMoveEventEP27QGraphicsSceneDragDropEvent @ 163 NONAME
+ _ZN16QGraphicsWebView13focusOutEventEP11QFocusEvent @ 164 NONAME
+ _ZN16QGraphicsWebView13keyPressEventEP9QKeyEvent @ 165 NONAME
+ _ZN16QGraphicsWebView13setZoomFactorEf @ 166 NONAME
+ _ZN16QGraphicsWebView13statusChangedEv @ 167 NONAME ABSENT
+ _ZN16QGraphicsWebView14dragEnterEventEP27QGraphicsSceneDragDropEvent @ 168 NONAME
+ _ZN16QGraphicsWebView14dragLeaveEventEP27QGraphicsSceneDragDropEvent @ 169 NONAME
+ _ZN16QGraphicsWebView14hoverMoveEventEP24QGraphicsSceneHoverEvent @ 170 NONAME
+ _ZN16QGraphicsWebView14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 171 NONAME
+ _ZN16QGraphicsWebView14setInteractiveEb @ 172 NONAME ABSENT
+ _ZN16QGraphicsWebView14updateGeometryEv @ 173 NONAME
+ _ZN16QGraphicsWebView15hoverLeaveEventEP24QGraphicsSceneHoverEvent @ 174 NONAME
+ _ZN16QGraphicsWebView15keyReleaseEventEP9QKeyEvent @ 175 NONAME
+ _ZN16QGraphicsWebView15mousePressEventEP24QGraphicsSceneMouseEvent @ 176 NONAME
+ _ZN16QGraphicsWebView15progressChangedEf @ 177 NONAME ABSENT
+ _ZN16QGraphicsWebView16contextMenuEventEP30QGraphicsSceneContextMenuEvent @ 178 NONAME
+ _ZN16QGraphicsWebView16inputMethodEventEP17QInputMethodEvent @ 179 NONAME
+ _ZN16QGraphicsWebView16staticMetaObjectE @ 180 NONAME DATA 16
+ _ZN16QGraphicsWebView17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 181 NONAME
+ _ZN16QGraphicsWebView17zoomFactorChangedEv @ 182 NONAME ABSENT
+ _ZN16QGraphicsWebView18focusNextPrevChildEb @ 183 NONAME
+ _ZN16QGraphicsWebView19getStaticMetaObjectEv @ 184 NONAME
+ _ZN16QGraphicsWebView20interactivityChangedEv @ 185 NONAME ABSENT
+ _ZN16QGraphicsWebView21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent @ 186 NONAME
+ _ZN16QGraphicsWebView4backEv @ 187 NONAME
+ _ZN16QGraphicsWebView4loadERK15QNetworkRequestN21QNetworkAccessManager9OperationERK10QByteArray @ 188 NONAME
+ _ZN16QGraphicsWebView4loadERK4QUrl @ 189 NONAME
+ _ZN16QGraphicsWebView4stopEv @ 190 NONAME
+ _ZN16QGraphicsWebView5eventEP6QEvent @ 191 NONAME
+ _ZN16QGraphicsWebView5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 192 NONAME
+ _ZN16QGraphicsWebView6reloadEv @ 193 NONAME
+ _ZN16QGraphicsWebView6setUrlERK4QUrl @ 194 NONAME
+ _ZN16QGraphicsWebView7forwardEv @ 195 NONAME
+ _ZN16QGraphicsWebView7setHtmlERK7QStringRK4QUrl @ 196 NONAME
+ _ZN16QGraphicsWebView7setPageEP8QWebPage @ 197 NONAME
+ _ZN16QGraphicsWebView9dropEventEP27QGraphicsSceneDragDropEvent @ 198 NONAME
+ _ZN16QGraphicsWebViewC1EP13QGraphicsItem @ 199 NONAME
+ _ZN16QGraphicsWebViewC2EP13QGraphicsItem @ 200 NONAME
+ _ZN16QGraphicsWebViewD0Ev @ 201 NONAME
+ _ZN16QGraphicsWebViewD1Ev @ 202 NONAME
+ _ZN16QGraphicsWebViewD2Ev @ 203 NONAME
+ _ZN17QWebHitTestResultC1EP24QWebHitTestResultPrivate @ 204 NONAME
+ _ZN17QWebHitTestResultC1ERKS_ @ 205 NONAME
+ _ZN17QWebHitTestResultC1Ev @ 206 NONAME
+ _ZN17QWebHitTestResultC2EP24QWebHitTestResultPrivate @ 207 NONAME
+ _ZN17QWebHitTestResultC2ERKS_ @ 208 NONAME
+ _ZN17QWebHitTestResultC2Ev @ 209 NONAME
+ _ZN17QWebHitTestResultD1Ev @ 210 NONAME
+ _ZN17QWebHitTestResultD2Ev @ 211 NONAME
+ _ZN17QWebHitTestResultaSERKS_ @ 212 NONAME
+ _ZN17QWebPluginFactory11qt_metacallEN11QMetaObject4CallEiPPv @ 213 NONAME
+ _ZN17QWebPluginFactory11qt_metacastEPKc @ 214 NONAME
+ _ZN17QWebPluginFactory14refreshPluginsEv @ 215 NONAME
+ _ZN17QWebPluginFactory16staticMetaObjectE @ 216 NONAME DATA 16
+ _ZN17QWebPluginFactory19getStaticMetaObjectEv @ 217 NONAME
+ _ZN17QWebPluginFactory9extensionENS_9ExtensionEPKNS_15ExtensionOptionEPNS_15ExtensionReturnE @ 218 NONAME
+ _ZN17QWebPluginFactoryC2EP7QObject @ 219 NONAME
+ _ZN17QWebPluginFactoryD0Ev @ 220 NONAME
+ _ZN17QWebPluginFactoryD1Ev @ 221 NONAME
+ _ZN17QWebPluginFactoryD2Ev @ 222 NONAME
+ _ZN18QWebPluginDatabase11qt_metacallEN11QMetaObject4CallEiPPv @ 223 NONAME
+ _ZN18QWebPluginDatabase11qt_metacastEPKc @ 224 NONAME
+ _ZN18QWebPluginDatabase13addSearchPathERK7QString @ 225 NONAME
+ _ZN18QWebPluginDatabase14setSearchPathsERK11QStringList @ 226 NONAME
+ _ZN18QWebPluginDatabase16staticMetaObjectE @ 227 NONAME DATA 16
+ _ZN18QWebPluginDatabase17pluginForMimeTypeERK7QString @ 228 NONAME
+ _ZN18QWebPluginDatabase18defaultSearchPathsEv @ 229 NONAME
+ _ZN18QWebPluginDatabase19getStaticMetaObjectEv @ 230 NONAME
+ _ZN18QWebPluginDatabase29setPreferredPluginForMimeTypeERK7QStringRK14QWebPluginInfo @ 231 NONAME
+ _ZN18QWebPluginDatabase7refreshEv @ 232 NONAME
+ _ZN18QWebPluginDatabaseC1EP7QObject @ 233 NONAME
+ _ZN18QWebPluginDatabaseC2EP7QObject @ 234 NONAME
+ _ZN18QWebPluginDatabaseD0Ev @ 235 NONAME
+ _ZN18QWebPluginDatabaseD1Ev @ 236 NONAME
+ _ZN18QWebPluginDatabaseD2Ev @ 237 NONAME
+ _ZN18QWebSecurityOrigin10allOriginsEv @ 238 NONAME
+ _ZN18QWebSecurityOrigin12localSchemesEv @ 239 NONAME
+ _ZN18QWebSecurityOrigin14addLocalSchemeERK7QString @ 240 NONAME
+ _ZN18QWebSecurityOrigin16setDatabaseQuotaEx @ 241 NONAME
+ _ZN18QWebSecurityOrigin17removeLocalSchemeERK7QString @ 242 NONAME
+ _ZN18QWebSecurityOrigin25whiteListAccessFromOriginERK7QStringS2_S2_b @ 243 NONAME ABSENT
+ _ZN18QWebSecurityOrigin27resetOriginAccessWhiteListsEv @ 244 NONAME ABSENT
+ _ZN18QWebSecurityOriginC1EP25QWebSecurityOriginPrivate @ 245 NONAME
+ _ZN18QWebSecurityOriginC1ERKS_ @ 246 NONAME
+ _ZN18QWebSecurityOriginC2EP25QWebSecurityOriginPrivate @ 247 NONAME
+ _ZN18QWebSecurityOriginC2ERKS_ @ 248 NONAME
+ _ZN18QWebSecurityOriginD1Ev @ 249 NONAME
+ _ZN18QWebSecurityOriginD2Ev @ 250 NONAME
+ _ZN18QWebSecurityOriginaSERKS_ @ 251 NONAME
+ _ZN20QWebHistoryInterface11qt_metacallEN11QMetaObject4CallEiPPv @ 252 NONAME
+ _ZN20QWebHistoryInterface11qt_metacastEPKc @ 253 NONAME
+ _ZN20QWebHistoryInterface16defaultInterfaceEv @ 254 NONAME
+ _ZN20QWebHistoryInterface16staticMetaObjectE @ 255 NONAME DATA 16
+ _ZN20QWebHistoryInterface19getStaticMetaObjectEv @ 256 NONAME
+ _ZN20QWebHistoryInterface19setDefaultInterfaceEPS_ @ 257 NONAME
+ _ZN20QWebHistoryInterfaceC2EP7QObject @ 258 NONAME
+ _ZN20QWebHistoryInterfaceD0Ev @ 259 NONAME
+ _ZN20QWebHistoryInterfaceD1Ev @ 260 NONAME
+ _ZN20QWebHistoryInterfaceD2Ev @ 261 NONAME
+ _ZN8QWebPage10chooseFileEP9QWebFrameRK7QString @ 262 NONAME
+ _ZN8QWebPage10setPaletteERK8QPalette @ 263 NONAME
+ _ZN8QWebPage11linkClickedERK4QUrl @ 264 NONAME
+ _ZN8QWebPage11linkHoveredERK7QStringS2_S2_ @ 265 NONAME
+ _ZN8QWebPage11loadStartedEv @ 266 NONAME
+ _ZN8QWebPage11qt_metacallEN11QMetaObject4CallEiPPv @ 267 NONAME
+ _ZN8QWebPage11qt_metacastEPKc @ 268 NONAME
+ _ZN8QWebPage12createPluginERK7QStringRK4QUrlRK11QStringListS8_ @ 269 NONAME
+ _ZN8QWebPage12createWindowENS_13WebWindowTypeE @ 270 NONAME
+ _ZN8QWebPage12frameCreatedEP9QWebFrame @ 271 NONAME
+ _ZN8QWebPage12loadFinishedEb @ 272 NONAME
+ _ZN8QWebPage12loadProgressEi @ 273 NONAME
+ _ZN8QWebPage13triggerActionENS_9WebActionEb @ 274 NONAME
+ _ZN8QWebPage14printRequestedEP9QWebFrame @ 275 NONAME
+ _ZN8QWebPage15contentsChangedEv @ 276 NONAME
+ _ZN8QWebPage15javaScriptAlertEP9QWebFrameRK7QString @ 277 NONAME
+ _ZN8QWebPage15scrollRequestedEiiRK5QRect @ 278 NONAME
+ _ZN8QWebPage16javaScriptPromptEP9QWebFrameRK7QStringS4_PS2_ @ 279 NONAME
+ _ZN8QWebPage16repaintRequestedERK5QRect @ 280 NONAME
+ _ZN8QWebPage16selectionChangedEv @ 281 NONAME
+ _ZN8QWebPage16setPluginFactoryEP17QWebPluginFactory @ 282 NONAME
+ _ZN8QWebPage16staticMetaObjectE @ 283 NONAME DATA 16
+ _ZN8QWebPage16statusBarMessageERK7QString @ 284 NONAME
+ _ZN8QWebPage17downloadRequestedERK15QNetworkRequest @ 285 NONAME
+ _ZN8QWebPage17javaScriptConfirmEP9QWebFrameRK7QString @ 286 NONAME
+ _ZN8QWebPage17microFocusChangedEv @ 287 NONAME
+ _ZN8QWebPage18focusNextPrevChildEb @ 288 NONAME
+ _ZN8QWebPage18setContentEditableEb @ 289 NONAME
+ _ZN8QWebPage18unsupportedContentEP13QNetworkReply @ 290 NONAME
+ _ZN8QWebPage19getStaticMetaObjectEv @ 291 NONAME
+ _ZN8QWebPage20windowCloseRequestedEv @ 292 NONAME
+ _ZN8QWebPage21databaseQuotaExceededEP9QWebFrame7QString @ 293 NONAME
+ _ZN8QWebPage21webInspectorTriggeredERK11QWebElement @ 294 NONAME ABSENT
+ _ZN8QWebPage23acceptNavigationRequestEP9QWebFrameRK15QNetworkRequestNS_14NavigationTypeE @ 295 NONAME
+ _ZN8QWebPage23geometryChangeRequestedERK5QRect @ 296 NONAME
+ _ZN8QWebPage23saveFrameStateRequestedEP9QWebFrameP15QWebHistoryItem @ 297 NONAME
+ _ZN8QWebPage23setLinkDelegationPolicyENS_20LinkDelegationPolicyE @ 298 NONAME
+ _ZN8QWebPage23setNetworkAccessManagerEP21QNetworkAccessManager @ 299 NONAME
+ _ZN8QWebPage23swallowContextMenuEventEP17QContextMenuEvent @ 300 NONAME
+ _ZN8QWebPage24javaScriptConsoleMessageERK7QStringiS2_ @ 301 NONAME
+ _ZN8QWebPage25createStandardContextMenuEv @ 302 NONAME
+ _ZN8QWebPage25shouldInterruptJavaScriptEv @ 303 NONAME
+ _ZN8QWebPage26restoreFrameStateRequestedEP9QWebFrame @ 304 NONAME
+ _ZN8QWebPage28setForwardUnsupportedContentEb @ 305 NONAME
+ _ZN8QWebPage30updatePositionDependentActionsERK6QPoint @ 306 NONAME
+ _ZN8QWebPage32menuBarVisibilityChangeRequestedEb @ 307 NONAME
+ _ZN8QWebPage32toolBarVisibilityChangeRequestedEb @ 308 NONAME
+ _ZN8QWebPage34statusBarVisibilityChangeRequestedEb @ 309 NONAME
+ _ZN8QWebPage5eventEP6QEvent @ 310 NONAME
+ _ZN8QWebPage7setViewEP7QWidget @ 311 NONAME
+ _ZN8QWebPage8findTextERK7QString6QFlagsINS_8FindFlagEE @ 312 NONAME
+ _ZN8QWebPage9extensionENS_9ExtensionEPKNS_15ExtensionOptionEPNS_15ExtensionReturnE @ 313 NONAME
+ _ZN8QWebPageC1EP7QObject @ 314 NONAME
+ _ZN8QWebPageC2EP7QObject @ 315 NONAME
+ _ZN8QWebPageD0Ev @ 316 NONAME
+ _ZN8QWebPageD1Ev @ 317 NONAME
+ _ZN8QWebPageD2Ev @ 318 NONAME
+ _ZN8QWebView10paintEventEP11QPaintEvent @ 319 NONAME
+ _ZN8QWebView10setContentERK10QByteArrayRK7QStringRK4QUrl @ 320 NONAME
+ _ZN8QWebView10urlChangedERK4QUrl @ 321 NONAME
+ _ZN8QWebView10wheelEventEP11QWheelEvent @ 322 NONAME
+ _ZN8QWebView11changeEventEP6QEvent @ 323 NONAME
+ _ZN8QWebView11iconChangedEv @ 324 NONAME
+ _ZN8QWebView11linkClickedERK4QUrl @ 325 NONAME
+ _ZN8QWebView11loadStartedEv @ 326 NONAME
+ _ZN8QWebView11qt_metacallEN11QMetaObject4CallEiPPv @ 327 NONAME
+ _ZN8QWebView11qt_metacastEPKc @ 328 NONAME
+ _ZN8QWebView11resizeEventEP12QResizeEvent @ 329 NONAME
+ _ZN8QWebView12createWindowEN8QWebPage13WebWindowTypeE @ 330 NONAME
+ _ZN8QWebView12focusInEventEP11QFocusEvent @ 331 NONAME
+ _ZN8QWebView12loadFinishedEb @ 332 NONAME
+ _ZN8QWebView12loadProgressEi @ 333 NONAME
+ _ZN8QWebView12titleChangedERK7QString @ 334 NONAME
+ _ZN8QWebView13dragMoveEventEP14QDragMoveEvent @ 335 NONAME
+ _ZN8QWebView13focusOutEventEP11QFocusEvent @ 336 NONAME
+ _ZN8QWebView13keyPressEventEP9QKeyEvent @ 337 NONAME
+ _ZN8QWebView13setRenderHintEN8QPainter10RenderHintEb @ 338 NONAME
+ _ZN8QWebView13setZoomFactorEf @ 339 NONAME
+ _ZN8QWebView14dragEnterEventEP15QDragEnterEvent @ 340 NONAME
+ _ZN8QWebView14dragLeaveEventEP15QDragLeaveEvent @ 341 NONAME
+ _ZN8QWebView14mouseMoveEventEP11QMouseEvent @ 342 NONAME
+ _ZN8QWebView14setRenderHintsE6QFlagsIN8QPainter10RenderHintEE @ 343 NONAME
+ _ZN8QWebView15keyReleaseEventEP9QKeyEvent @ 344 NONAME
+ _ZN8QWebView15mousePressEventEP11QMouseEvent @ 345 NONAME
+ _ZN8QWebView16contextMenuEventEP17QContextMenuEvent @ 346 NONAME
+ _ZN8QWebView16inputMethodEventEP17QInputMethodEvent @ 347 NONAME
+ _ZN8QWebView16selectionChangedEv @ 348 NONAME
+ _ZN8QWebView16staticMetaObjectE @ 349 NONAME DATA 16
+ _ZN8QWebView16statusBarMessageERK7QString @ 350 NONAME
+ _ZN8QWebView17mouseReleaseEventEP11QMouseEvent @ 351 NONAME
+ _ZN8QWebView17triggerPageActionEN8QWebPage9WebActionEb @ 352 NONAME
+ _ZN8QWebView18focusNextPrevChildEb @ 353 NONAME
+ _ZN8QWebView18guessUrlFromStringERK7QString @ 354 NONAME ABSENT
+ _ZN8QWebView19getStaticMetaObjectEv @ 355 NONAME
+ _ZN8QWebView21mouseDoubleClickEventEP11QMouseEvent @ 356 NONAME
+ _ZN8QWebView21setTextSizeMultiplierEf @ 357 NONAME
+ _ZN8QWebView4backEv @ 358 NONAME
+ _ZN8QWebView4loadERK15QNetworkRequestN21QNetworkAccessManager9OperationERK10QByteArray @ 359 NONAME
+ _ZN8QWebView4loadERK4QUrl @ 360 NONAME
+ _ZN8QWebView4stopEv @ 361 NONAME
+ _ZN8QWebView5eventEP6QEvent @ 362 NONAME
+ _ZN8QWebView6reloadEv @ 363 NONAME
+ _ZN8QWebView6setUrlERK4QUrl @ 364 NONAME
+ _ZN8QWebView7forwardEv @ 365 NONAME
+ _ZN8QWebView7setHtmlERK7QStringRK4QUrl @ 366 NONAME
+ _ZN8QWebView7setPageEP8QWebPage @ 367 NONAME
+ _ZN8QWebView8findTextERK7QString6QFlagsIN8QWebPage8FindFlagEE @ 368 NONAME
+ _ZN8QWebView9dropEventEP10QDropEvent @ 369 NONAME
+ _ZN8QWebViewC1EP7QWidget @ 370 NONAME
+ _ZN8QWebViewC2EP7QWidget @ 371 NONAME
+ _ZN8QWebViewD0Ev @ 372 NONAME
+ _ZN8QWebViewD1Ev @ 373 NONAME
+ _ZN8QWebViewD2Ev @ 374 NONAME
+ _ZN9QWebFrame10setContentERK10QByteArrayRK7QStringRK4QUrl @ 375 NONAME
+ _ZN9QWebFrame10urlChangedERK4QUrl @ 376 NONAME
+ _ZN9QWebFrame11iconChangedEv @ 377 NONAME
+ _ZN9QWebFrame11loadStartedEv @ 378 NONAME
+ _ZN9QWebFrame11qt_metacallEN11QMetaObject4CallEiPPv @ 379 NONAME
+ _ZN9QWebFrame11qt_metacastEPKc @ 380 NONAME
+ _ZN9QWebFrame12loadFinishedEb @ 381 NONAME
+ _ZN9QWebFrame12titleChangedERK7QString @ 382 NONAME
+ _ZN9QWebFrame13setZoomFactorEf @ 383 NONAME
+ _ZN9QWebFrame15provisionalLoadEv @ 384 NONAME
+ _ZN9QWebFrame16staticMetaObjectE @ 385 NONAME DATA 16
+ _ZN9QWebFrame17setScrollBarValueEN2Qt11OrientationEi @ 386 NONAME
+ _ZN9QWebFrame17setScrollPositionERK6QPoint @ 387 NONAME
+ _ZN9QWebFrame18evaluateJavaScriptERK7QString @ 388 NONAME
+ _ZN9QWebFrame18setScrollBarPolicyEN2Qt11OrientationENS0_15ScrollBarPolicyE @ 389 NONAME
+ _ZN9QWebFrame19contentsSizeChangedERK5QSize @ 390 NONAME
+ _ZN9QWebFrame19getStaticMetaObjectEv @ 391 NONAME
+ _ZN9QWebFrame21setTextSizeMultiplierEf @ 392 NONAME
+ _ZN9QWebFrame22initialLayoutCompletedEv @ 393 NONAME
+ _ZN9QWebFrame23setClipRenderToViewportEb @ 394 NONAME ABSENT
+ _ZN9QWebFrame27addToJavaScriptWindowObjectERK7QStringP7QObject @ 395 NONAME
+ _ZN9QWebFrame27addToJavaScriptWindowObjectERK7QStringP7QObjectN13QScriptEngine14ValueOwnershipE @ 396 NONAME
+ _ZN9QWebFrame29javaScriptWindowObjectClearedEv @ 397 NONAME
+ _ZN9QWebFrame4loadERK15QNetworkRequestN21QNetworkAccessManager9OperationERK10QByteArray @ 398 NONAME
+ _ZN9QWebFrame4loadERK4QUrl @ 399 NONAME
+ _ZN9QWebFrame5eventEP6QEvent @ 400 NONAME
+ _ZN9QWebFrame6renderEP8QPainter @ 401 NONAME
+ _ZN9QWebFrame6renderEP8QPainterRK7QRegion @ 402 NONAME
+ _ZN9QWebFrame6scrollEii @ 403 NONAME
+ _ZN9QWebFrame6setUrlERK4QUrl @ 404 NONAME
+ _ZN9QWebFrame7setHtmlERK7QStringRK4QUrl @ 405 NONAME
+ _ZN9QWebFrame8setFocusEv @ 406 NONAME
+ _ZN9QWebFrameC1EP8QWebPageP13QWebFrameData @ 407 NONAME
+ _ZN9QWebFrameC1EPS_P13QWebFrameData @ 408 NONAME
+ _ZN9QWebFrameC2EP8QWebPageP13QWebFrameData @ 409 NONAME
+ _ZN9QWebFrameC2EPS_P13QWebFrameData @ 410 NONAME
+ _ZN9QWebFrameD0Ev @ 411 NONAME
+ _ZN9QWebFrameD1Ev @ 412 NONAME
+ _ZN9QWebFrameD2Ev @ 413 NONAME
+ _ZNK11QWebElement10firstChildEv @ 414 NONAME
+ _ZNK11QWebElement10toInnerXmlEv @ 415 NONAME
+ _ZNK11QWebElement10toOuterXmlEv @ 416 NONAME
+ _ZNK11QWebElement11attributeNSERK7QStringS2_S2_ @ 417 NONAME
+ _ZNK11QWebElement11nextSiblingEv @ 418 NONAME
+ _ZNK11QWebElement11toPlainTextEv @ 419 NONAME
+ _ZNK11QWebElement12hasAttributeERK7QString @ 420 NONAME
+ _ZNK11QWebElement12namespaceUriEv @ 421 NONAME
+ _ZNK11QWebElement13hasAttributesEv @ 422 NONAME
+ _ZNK11QWebElement13stylePropertyERK7QStringNS_20StyleResolveStrategyE @ 423 NONAME
+ _ZNK11QWebElement14hasAttributeNSERK7QStringS2_ @ 424 NONAME
+ _ZNK11QWebElement15previousSiblingEv @ 425 NONAME
+ _ZNK11QWebElement5cloneEv @ 426 NONAME
+ _ZNK11QWebElement6isNullEv @ 427 NONAME
+ _ZNK11QWebElement6parentEv @ 428 NONAME
+ _ZNK11QWebElement6prefixEv @ 429 NONAME
+ _ZNK11QWebElement7classesEv @ 430 NONAME
+ _ZNK11QWebElement7findAllERK7QString @ 431 NONAME
+ _ZNK11QWebElement7tagNameEv @ 432 NONAME
+ _ZNK11QWebElement8documentEv @ 433 NONAME
+ _ZNK11QWebElement8geometryEv @ 434 NONAME
+ _ZNK11QWebElement8hasClassERK7QString @ 435 NONAME
+ _ZNK11QWebElement8hasFocusEv @ 436 NONAME
+ _ZNK11QWebElement8webFrameEv @ 437 NONAME
+ _ZNK11QWebElement9attributeERK7QStringS2_ @ 438 NONAME
+ _ZNK11QWebElement9findFirstERK7QString @ 439 NONAME
+ _ZNK11QWebElement9lastChildEv @ 440 NONAME
+ _ZNK11QWebElement9localNameEv @ 441 NONAME
+ _ZNK11QWebElementeqERKS_ @ 442 NONAME
+ _ZNK11QWebElementneERKS_ @ 443 NONAME
+ _ZNK11QWebHistory11currentItemEv @ 444 NONAME
+ _ZNK11QWebHistory11forwardItemEv @ 445 NONAME
+ _ZNK11QWebHistory12canGoForwardEv @ 446 NONAME
+ _ZNK11QWebHistory12forwardItemsEi @ 447 NONAME
+ _ZNK11QWebHistory16currentItemIndexEv @ 448 NONAME
+ _ZNK11QWebHistory16maximumItemCountEv @ 449 NONAME
+ _ZNK11QWebHistory5countEv @ 450 NONAME
+ _ZNK11QWebHistory5itemsEv @ 451 NONAME
+ _ZNK11QWebHistory6itemAtEi @ 452 NONAME
+ _ZNK11QWebHistory8backItemEv @ 453 NONAME
+ _ZNK11QWebHistory9backItemsEi @ 454 NONAME
+ _ZNK11QWebHistory9canGoBackEv @ 455 NONAME
+ _ZNK11QWebHistory9saveStateENS_19HistoryStateVersionE @ 456 NONAME ABSENT
+ _ZNK12QWebDatabase11displayNameEv @ 457 NONAME
+ _ZNK12QWebDatabase12expectedSizeEv @ 458 NONAME
+ _ZNK12QWebDatabase4nameEv @ 459 NONAME
+ _ZNK12QWebDatabase4sizeEv @ 460 NONAME
+ _ZNK12QWebDatabase6originEv @ 461 NONAME
+ _ZNK12QWebDatabase8fileNameEv @ 462 NONAME
+ _ZNK12QWebSettings10fontFamilyENS_10FontFamilyE @ 463 NONAME
+ _ZNK12QWebSettings13testAttributeENS_12WebAttributeE @ 464 NONAME
+ _ZNK12QWebSettings16localStoragePathEv @ 465 NONAME
+ _ZNK12QWebSettings17userStyleSheetUrlEv @ 466 NONAME
+ _ZNK12QWebSettings19defaultTextEncodingEv @ 467 NONAME
+ _ZNK12QWebSettings8fontSizeENS_8FontSizeE @ 468 NONAME
+ _ZNK13QWebInspector10metaObjectEv @ 469 NONAME
+ _ZNK13QWebInspector4pageEv @ 470 NONAME
+ _ZNK13QWebInspector8sizeHintEv @ 471 NONAME
+ _ZNK14QWebPluginInfo11descriptionEv @ 472 NONAME
+ _ZNK14QWebPluginInfo16supportsMimeTypeERK7QString @ 473 NONAME
+ _ZNK14QWebPluginInfo4nameEv @ 474 NONAME
+ _ZNK14QWebPluginInfo4pathEv @ 475 NONAME
+ _ZNK14QWebPluginInfo6isNullEv @ 476 NONAME
+ _ZNK14QWebPluginInfo9isEnabledEv @ 477 NONAME
+ _ZNK14QWebPluginInfo9mimeTypesEv @ 478 NONAME
+ _ZNK14QWebPluginInfoeqERKS_ @ 479 NONAME
+ _ZNK14QWebPluginInfoneERKS_ @ 480 NONAME
+ _ZNK15QWebHistoryItem11lastVisitedEv @ 481 NONAME
+ _ZNK15QWebHistoryItem11originalUrlEv @ 482 NONAME
+ _ZNK15QWebHistoryItem3urlEv @ 483 NONAME
+ _ZNK15QWebHistoryItem4iconEv @ 484 NONAME
+ _ZNK15QWebHistoryItem5titleEv @ 485 NONAME
+ _ZNK15QWebHistoryItem7isValidEv @ 486 NONAME
+ _ZNK15QWebHistoryItem8userDataEv @ 487 NONAME
+ _ZNK16QGraphicsWebView10metaObjectEv @ 488 NONAME
+ _ZNK16QGraphicsWebView10zoomFactorEv @ 489 NONAME
+ _ZNK16QGraphicsWebView13isInteractiveEv @ 490 NONAME ABSENT
+ _ZNK16QGraphicsWebView3urlEv @ 491 NONAME
+ _ZNK16QGraphicsWebView4iconEv @ 492 NONAME
+ _ZNK16QGraphicsWebView4pageEv @ 493 NONAME
+ _ZNK16QGraphicsWebView5titleEv @ 494 NONAME
+ _ZNK16QGraphicsWebView6statusEv @ 495 NONAME ABSENT
+ _ZNK16QGraphicsWebView6toHtmlEv @ 496 NONAME ABSENT
+ _ZNK16QGraphicsWebView7historyEv @ 497 NONAME
+ _ZNK16QGraphicsWebView8progressEv @ 498 NONAME ABSENT
+ _ZNK16QGraphicsWebView8settingsEv @ 499 NONAME
+ _ZNK17QWebHitTestResult11linkElementEv @ 500 NONAME
+ _ZNK17QWebHitTestResult12boundingRectEv @ 501 NONAME
+ _ZNK17QWebHitTestResult13alternateTextEv @ 502 NONAME
+ _ZNK17QWebHitTestResult15linkTargetFrameEv @ 503 NONAME
+ _ZNK17QWebHitTestResult17isContentEditableEv @ 504 NONAME
+ _ZNK17QWebHitTestResult17isContentSelectedEv @ 505 NONAME
+ _ZNK17QWebHitTestResult21enclosingBlockElementEv @ 506 NONAME
+ _ZNK17QWebHitTestResult3posEv @ 507 NONAME
+ _ZNK17QWebHitTestResult5frameEv @ 508 NONAME
+ _ZNK17QWebHitTestResult5titleEv @ 509 NONAME
+ _ZNK17QWebHitTestResult6isNullEv @ 510 NONAME
+ _ZNK17QWebHitTestResult6pixmapEv @ 511 NONAME
+ _ZNK17QWebHitTestResult7elementEv @ 512 NONAME
+ _ZNK17QWebHitTestResult7linkUrlEv @ 513 NONAME
+ _ZNK17QWebHitTestResult8imageUrlEv @ 514 NONAME
+ _ZNK17QWebHitTestResult8linkTextEv @ 515 NONAME
+ _ZNK17QWebHitTestResult9linkTitleEv @ 516 NONAME
+ _ZNK17QWebPluginFactory10metaObjectEv @ 517 NONAME
+ _ZNK17QWebPluginFactory17supportsExtensionENS_9ExtensionE @ 518 NONAME
+ _ZNK17QWebPluginFactory8MimeTypeeqERKS0_ @ 519 NONAME
+ _ZNK18QWebPluginDatabase10metaObjectEv @ 520 NONAME
+ _ZNK18QWebPluginDatabase11searchPathsEv @ 521 NONAME
+ _ZNK18QWebPluginDatabase7pluginsEv @ 522 NONAME
+ _ZNK18QWebSecurityOrigin13databaseQuotaEv @ 523 NONAME
+ _ZNK18QWebSecurityOrigin13databaseUsageEv @ 524 NONAME
+ _ZNK18QWebSecurityOrigin4hostEv @ 525 NONAME
+ _ZNK18QWebSecurityOrigin4portEv @ 526 NONAME
+ _ZNK18QWebSecurityOrigin6schemeEv @ 527 NONAME
+ _ZNK18QWebSecurityOrigin9databasesEv @ 528 NONAME
+ _ZNK20QWebHistoryInterface10metaObjectEv @ 529 NONAME
+ _ZNK8QWebPage10isModifiedEv @ 530 NONAME
+ _ZNK8QWebPage10metaObjectEv @ 531 NONAME
+ _ZNK8QWebPage10totalBytesEv @ 532 NONAME
+ _ZNK8QWebPage12currentFrameEv @ 533 NONAME
+ _ZNK8QWebPage12selectedTextEv @ 534 NONAME
+ _ZNK8QWebPage12viewportSizeEv @ 535 NONAME
+ _ZNK8QWebPage13bytesReceivedEv @ 536 NONAME
+ _ZNK8QWebPage13pluginFactoryEv @ 537 NONAME
+ _ZNK8QWebPage15setViewportSizeERK5QSize @ 538 NONAME
+ _ZNK8QWebPage15userAgentForUrlERK4QUrl @ 539 NONAME
+ _ZNK8QWebPage16inputMethodQueryEN2Qt16InputMethodQueryE @ 540 NONAME
+ _ZNK8QWebPage17fixedContentsSizeEv @ 541 NONAME ABSENT
+ _ZNK8QWebPage17isContentEditableEv @ 542 NONAME
+ _ZNK8QWebPage17supportsExtensionENS_9ExtensionE @ 543 NONAME
+ _ZNK8QWebPage20linkDelegationPolicyEv @ 544 NONAME
+ _ZNK8QWebPage20networkAccessManagerEv @ 545 NONAME
+ _ZNK8QWebPage20setFixedContentsSizeERK5QSize @ 546 NONAME ABSENT
+ _ZNK8QWebPage25forwardUnsupportedContentEv @ 547 NONAME
+ _ZNK8QWebPage4viewEv @ 548 NONAME
+ _ZNK8QWebPage6actionENS_9WebActionE @ 549 NONAME
+ _ZNK8QWebPage7frameAtERK6QPoint @ 550 NONAME
+ _ZNK8QWebPage7historyEv @ 551 NONAME
+ _ZNK8QWebPage7paletteEv @ 552 NONAME
+ _ZNK8QWebPage8settingsEv @ 553 NONAME
+ _ZNK8QWebPage9mainFrameEv @ 554 NONAME
+ _ZNK8QWebPage9undoStackEv @ 555 NONAME
+ _ZNK8QWebView10isModifiedEv @ 556 NONAME
+ _ZNK8QWebView10metaObjectEv @ 557 NONAME
+ _ZNK8QWebView10pageActionEN8QWebPage9WebActionE @ 558 NONAME
+ _ZNK8QWebView10zoomFactorEv @ 559 NONAME
+ _ZNK8QWebView11renderHintsEv @ 560 NONAME
+ _ZNK8QWebView12selectedTextEv @ 561 NONAME
+ _ZNK8QWebView16inputMethodQueryEN2Qt16InputMethodQueryE @ 562 NONAME
+ _ZNK8QWebView18textSizeMultiplierEv @ 563 NONAME
+ _ZNK8QWebView3urlEv @ 564 NONAME
+ _ZNK8QWebView4iconEv @ 565 NONAME
+ _ZNK8QWebView4pageEv @ 566 NONAME
+ _ZNK8QWebView5printEP8QPrinter @ 567 NONAME
+ _ZNK8QWebView5titleEv @ 568 NONAME
+ _ZNK8QWebView7historyEv @ 569 NONAME
+ _ZNK8QWebView8settingsEv @ 570 NONAME
+ _ZNK8QWebView8sizeHintEv @ 571 NONAME
+ _ZNK9QWebFrame10metaObjectEv @ 572 NONAME
+ _ZNK9QWebFrame10zoomFactorEv @ 573 NONAME
+ _ZNK9QWebFrame11childFramesEv @ 574 NONAME
+ _ZNK9QWebFrame11parentFrameEv @ 575 NONAME
+ _ZNK9QWebFrame11toPlainTextEv @ 576 NONAME
+ _ZNK9QWebFrame12contentsSizeEv @ 577 NONAME
+ _ZNK9QWebFrame12requestedUrlEv @ 578 NONAME
+ _ZNK9QWebFrame14hitTestContentERK6QPoint @ 579 NONAME
+ _ZNK9QWebFrame14renderTreeDumpEv @ 580 NONAME
+ _ZNK9QWebFrame14scrollBarValueEN2Qt11OrientationE @ 581 NONAME
+ _ZNK9QWebFrame14scrollPositionEv @ 582 NONAME
+ _ZNK9QWebFrame14securityOriginEv @ 583 NONAME
+ _ZNK9QWebFrame15documentElementEv @ 584 NONAME
+ _ZNK9QWebFrame15findAllElementsERK7QString @ 585 NONAME
+ _ZNK9QWebFrame15scrollBarPolicyEN2Qt11OrientationE @ 586 NONAME
+ _ZNK9QWebFrame16findFirstElementERK7QString @ 587 NONAME
+ _ZNK9QWebFrame16scrollBarMaximumEN2Qt11OrientationE @ 588 NONAME
+ _ZNK9QWebFrame16scrollBarMinimumEN2Qt11OrientationE @ 589 NONAME
+ _ZNK9QWebFrame17scrollBarGeometryEN2Qt11OrientationE @ 590 NONAME
+ _ZNK9QWebFrame18textSizeMultiplierEv @ 591 NONAME
+ _ZNK9QWebFrame20clipRenderToViewportEv @ 592 NONAME ABSENT
+ _ZNK9QWebFrame3posEv @ 593 NONAME
+ _ZNK9QWebFrame3urlEv @ 594 NONAME
+ _ZNK9QWebFrame4iconEv @ 595 NONAME
+ _ZNK9QWebFrame4pageEv @ 596 NONAME
+ _ZNK9QWebFrame5titleEv @ 597 NONAME
+ _ZNK9QWebFrame6toHtmlEv @ 598 NONAME
+ _ZNK9QWebFrame7baseUrlEv @ 599 NONAME
+ _ZNK9QWebFrame8geometryEv @ 600 NONAME
+ _ZNK9QWebFrame8hasFocusEv @ 601 NONAME
+ _ZNK9QWebFrame8metaDataEv @ 602 NONAME
+ _ZNK9QWebFrame9frameNameEv @ 603 NONAME
+ _ZTI13QWebInspector @ 604 NONAME
+ _ZTI16QGraphicsWebView @ 605 NONAME
+ _ZTI17QWebPluginFactory @ 606 NONAME
+ _ZTI18QWebPluginDatabase @ 607 NONAME
+ _ZTI20QWebHistoryInterface @ 608 NONAME
+ _ZTI8QWebPage @ 609 NONAME
+ _ZTI8QWebView @ 610 NONAME
+ _ZTI9QWebFrame @ 611 NONAME
+ _ZTV13QWebInspector @ 612 NONAME
+ _ZTV16QGraphicsWebView @ 613 NONAME
+ _ZTV17QWebPluginFactory @ 614 NONAME
+ _ZTV18QWebPluginDatabase @ 615 NONAME
+ _ZTV20QWebHistoryInterface @ 616 NONAME
+ _ZTV8QWebPage @ 617 NONAME
+ _ZTV8QWebView @ 618 NONAME
+ _ZTV9QWebFrame @ 619 NONAME
+ _ZThn16_N16QGraphicsWebView11setGeometryERK6QRectF @ 620 NONAME
+ _ZThn16_N16QGraphicsWebView14updateGeometryEv @ 621 NONAME
+ _ZThn16_N16QGraphicsWebViewD0Ev @ 622 NONAME
+ _ZThn16_N16QGraphicsWebViewD1Ev @ 623 NONAME
+ _ZThn8_N13QWebInspectorD0Ev @ 624 NONAME
+ _ZThn8_N13QWebInspectorD1Ev @ 625 NONAME
+ _ZThn8_N16QGraphicsWebView10sceneEventEP6QEvent @ 626 NONAME
+ _ZThn8_N16QGraphicsWebView10wheelEventEP24QGraphicsSceneWheelEvent @ 627 NONAME
+ _ZThn8_N16QGraphicsWebView12focusInEventEP11QFocusEvent @ 628 NONAME
+ _ZThn8_N16QGraphicsWebView13dragMoveEventEP27QGraphicsSceneDragDropEvent @ 629 NONAME
+ _ZThn8_N16QGraphicsWebView13focusOutEventEP11QFocusEvent @ 630 NONAME
+ _ZThn8_N16QGraphicsWebView13keyPressEventEP9QKeyEvent @ 631 NONAME
+ _ZThn8_N16QGraphicsWebView14dragEnterEventEP27QGraphicsSceneDragDropEvent @ 632 NONAME
+ _ZThn8_N16QGraphicsWebView14dragLeaveEventEP27QGraphicsSceneDragDropEvent @ 633 NONAME
+ _ZThn8_N16QGraphicsWebView14hoverMoveEventEP24QGraphicsSceneHoverEvent @ 634 NONAME
+ _ZThn8_N16QGraphicsWebView14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 635 NONAME
+ _ZThn8_N16QGraphicsWebView15hoverLeaveEventEP24QGraphicsSceneHoverEvent @ 636 NONAME
+ _ZThn8_N16QGraphicsWebView15keyReleaseEventEP9QKeyEvent @ 637 NONAME
+ _ZThn8_N16QGraphicsWebView15mousePressEventEP24QGraphicsSceneMouseEvent @ 638 NONAME
+ _ZThn8_N16QGraphicsWebView16contextMenuEventEP30QGraphicsSceneContextMenuEvent @ 639 NONAME
+ _ZThn8_N16QGraphicsWebView16inputMethodEventEP17QInputMethodEvent @ 640 NONAME
+ _ZThn8_N16QGraphicsWebView17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 641 NONAME
+ _ZThn8_N16QGraphicsWebView21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent @ 642 NONAME
+ _ZThn8_N16QGraphicsWebView5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 643 NONAME
+ _ZThn8_N16QGraphicsWebView9dropEventEP27QGraphicsSceneDragDropEvent @ 644 NONAME
+ _ZThn8_N16QGraphicsWebViewD0Ev @ 645 NONAME
+ _ZThn8_N16QGraphicsWebViewD1Ev @ 646 NONAME
+ _ZThn8_N8QWebViewD0Ev @ 647 NONAME
+ _ZThn8_N8QWebViewD1Ev @ 648 NONAME
+ _ZlsR11QDataStreamRK11QWebHistory @ 649 NONAME
+ _ZrsR11QDataStreamR11QWebHistory @ 650 NONAME
+ _Z32qt_drt_whiteListAccessFromOriginRK7QStringS1_S1_b @ 651 NONAME
+ _Z33qt_drt_counterValueForElementByIdP9QWebFrameRK7QString @ 652 NONAME ABSENT
+ _Z34qt_drt_resetOriginAccessWhiteListsv @ 653 NONAME
+ _ZN11QWebElement17removeAllChildrenEv @ 654 NONAME
+ _ZN11QWebElement6renderEP8QPainter @ 655 NONAME
+ _ZN12QWebSettings30setPrintingMaximumShrinkFactorEf @ 656 NONAME ABSENT
+ _ZN12QWebSettings30setPrintingMinimumShrinkFactorEf @ 657 NONAME ABSENT
+ _ZN16QGraphicsWebView10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 658 NONAME
+ _ZN16QGraphicsWebView11linkClickedERK4QUrl @ 659 NONAME
+ _ZN16QGraphicsWebView12loadFinishedEb @ 660 NONAME
+ _ZN16QGraphicsWebView12loadProgressEi @ 661 NONAME
+ _ZN16QGraphicsWebView16statusBarMessageERK7QString @ 662 NONAME
+ _ZN16QGraphicsWebView17triggerPageActionEN8QWebPage9WebActionEb @ 663 NONAME
+ _ZN16QGraphicsWebView8findTextERK7QString6QFlagsIN8QWebPage8FindFlagEE @ 664 NONAME
+ _ZN21QWebElementCollection6appendERKS_ @ 665 NONAME
+ _ZN21QWebElementCollectionC1ERK11QWebElementRK7QString @ 666 NONAME
+ _ZN21QWebElementCollectionC1ERKS_ @ 667 NONAME
+ _ZN21QWebElementCollectionC1Ev @ 668 NONAME
+ _ZN21QWebElementCollectionC2ERK11QWebElementRK7QString @ 669 NONAME
+ _ZN21QWebElementCollectionC2ERKS_ @ 670 NONAME
+ _ZN21QWebElementCollectionC2Ev @ 671 NONAME
+ _ZN21QWebElementCollectionD1Ev @ 672 NONAME
+ _ZN21QWebElementCollectionD2Ev @ 673 NONAME
+ _ZN21QWebElementCollectionaSERKS_ @ 674 NONAME
+ _ZN9QWebFrame6renderEP8QPainterNS_11RenderLayerERK7QRegion @ 675 NONAME
+ _ZNK12QWebSettings27printingMaximumShrinkFactorEv @ 676 NONAME ABSENT
+ _ZNK12QWebSettings27printingMinimumShrinkFactorEv @ 677 NONAME ABSENT
+ _ZNK16QGraphicsWebView10isModifiedEv @ 678 NONAME
+ _ZNK16QGraphicsWebView10pageActionEN8QWebPage9WebActionE @ 679 NONAME
+ _ZNK16QGraphicsWebView16inputMethodQueryEN2Qt16InputMethodQueryE @ 680 NONAME
+ _ZNK16QGraphicsWebView8sizeHintEN2Qt8SizeHintERK6QSizeF @ 681 NONAME
+ _ZNK21QWebElementCollection2atEi @ 682 NONAME
+ _ZNK21QWebElementCollection5countEv @ 683 NONAME
+ _ZNK21QWebElementCollection6toListEv @ 684 NONAME
+ _ZNK21QWebElementCollectionplERKS_ @ 685 NONAME
+ _ZNK8QWebPage21preferredContentsSizeEv @ 686 NONAME
+ _ZNK8QWebPage24setPreferredContentsSizeERK5QSize @ 687 NONAME
+ _ZThn16_NK16QGraphicsWebView8sizeHintEN2Qt8SizeHintERK6QSizeF @ 688 NONAME
+ _ZThn8_N16QGraphicsWebView10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 689 NONAME
+ _ZThn8_NK16QGraphicsWebView16inputMethodQueryEN2Qt16InputMethodQueryE @ 690 NONAME
+ _ZNK11QWebElement14attributeNamesERK7QString @ 691 NONAME
+ _Z23qt_networkAccessAllowedb @ 692 NONAME
+ _Z25qt_resumeActiveDOMObjectsP9QWebFrame @ 693 NONAME
+ _Z26qt_suspendActiveDOMObjectsP9QWebFrame @ 694 NONAME
+ _Z35qtwebkit_webframe_scrollRecursivelyP9QWebFrameii @ 695 NONAME ABSENT
+ _Z35qtwebkit_webframe_scrollRecursivelyP9QWebFrameiiRK6QPoint @ 696 NONAME
+ _ZN9QWebFrame17scrollRecursivelyEii @ 697 NONAME ABSENT
+ _ZN16QGraphicsWebView20setResizesToContentsEb @ 698 NONAME
+ _ZNK16QGraphicsWebView17resizesToContentsEv @ 699 NONAME
+ _Z20qt_drt_numberOfPagesP9QWebFrameff @ 700 NONAME ABSENT
+ _Z24qt_drt_pauseSVGAnimationP9QWebFrameRK7QStringdS3_ @ 701 NONAME ABSENT
+ _Z24qt_drt_webinspector_showP8QWebPage @ 702 NONAME ABSENT
+ _Z24qt_drt_workerThreadCountv @ 703 NONAME ABSENT
+ _Z25qt_drt_hasDocumentElementP9QWebFrame @ 704 NONAME ABSENT
+ _Z25qt_drt_webinspector_closeP8QWebPage @ 705 NONAME ABSENT
+ _Z31qt_drt_pageNumberForElementByIdP9QWebFrameRK7QStringff @ 706 NONAME ABSENT
+ _Z33qt_drt_webinspector_executeScriptP8QWebPagelRK7QString @ 707 NONAME ABSENT
+ _Z34qt_drt_setTimelineProfilingEnabledP8QWebPageb @ 708 NONAME ABSENT
+ _Z32qt_drt_setFrameFlatteningEnabledP8QWebPageb @ 709 NONAME ABSENT
+ _Z36qt_drt_evaluateScriptInIsolatedWorldP9QWebFrameiRK7QString @ 710 NONAME ABSENT
+ _Z47qt_drt_setDomainRelaxationForbiddenForURLSchemebRK7QString @ 711 NONAME ABSENT
+ _ZN9QWebFrame11pageChangedEv @ 712 NONAME
+ _ZN9QWebFrame14scrollToAnchorERK7QString @ 713 NONAME
+ _ZN12QWebSettings15setInspectorUrlERK4QUrl @ 714 NONAME ABSENT
+ _ZN13QWebInspector10closeEventEP11QCloseEvent @ 715 NONAME
+ _ZN16QGraphicsWebView26setTiledBackingStoreFrozenEb @ 716 NONAME
+ _ZNK16QGraphicsWebView25isTiledBackingStoreFrozenEv @ 717 NONAME
+ _Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME ABSENT
+ _Z19qt_drt_setMediaTypeP9QWebFrameRK7QString @ 719 NONAME ABSENT
+ _Z26qt_drt_enableCaretBrowsingP8QWebPageb @ 720 NONAME ABSENT
+ _ZNK12QWebSettings12inspectorUrlEv @ 721 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt19webPageSetGroupNameEP8QWebPageRK7QString @ 722 NONAME
+ _ZN23DumpRenderTreeSupportQt16webPageGroupNameEP8QWebPage @ 723 NONAME
+ _ZN23DumpRenderTreeSupportQt23garbageCollectorCollectEv @ 724 NONAME
+ _Z32qtwebkit_webframe_scrollOverflowP9QWebFrameiiRK6QPoint @ 725 NONAME
+ _ZN23DumpRenderTreeSupportQt12setMediaTypeEP9QWebFrameRK7QString @ 726 NONAME
+ _ZN23DumpRenderTreeSupportQt13numberOfPagesEP9QWebFrameff @ 727 NONAME
+ _ZN23DumpRenderTreeSupportQt13selectedRangeEP8QWebPage @ 728 NONAME
+ _ZN23DumpRenderTreeSupportQt14clearFrameNameEP9QWebFrame @ 729 NONAME
+ _ZN23DumpRenderTreeSupportQt14pauseAnimationEP9QWebFrameRK7QStringdS4_ @ 730 NONAME
+ _ZN23DumpRenderTreeSupportQt15dumpFrameLoaderEb @ 731 NONAME
+ _ZN23DumpRenderTreeSupportQt16dumpNotificationEb @ 732 NONAME
+ _ZN23DumpRenderTreeSupportQt16isCommandEnabledEP8QWebPageRK7QString @ 733 NONAME
+ _ZN23DumpRenderTreeSupportQt16webInspectorShowEP8QWebPage @ 734 NONAME
+ _ZN23DumpRenderTreeSupportQt17pauseSVGAnimationEP9QWebFrameRK7QStringdS4_ @ 735 NONAME
+ _ZN23DumpRenderTreeSupportQt17webInspectorCloseEP8QWebPage @ 736 NONAME
+ _ZN23DumpRenderTreeSupportQt17workerThreadCountEv @ 737 NONAME
+ _ZN23DumpRenderTreeSupportQt18hasDocumentElementEP9QWebFrame @ 738 NONAME
+ _ZN23DumpRenderTreeSupportQt20dumpEditingCallbacksEb @ 739 NONAME
+ _ZN23DumpRenderTreeSupportQt21markerTextForListItemERK11QWebElement @ 740 NONAME
+ _ZN23DumpRenderTreeSupportQt22javaScriptObjectsCountEv @ 741 NONAME
+ _ZN23DumpRenderTreeSupportQt23setCaretBrowsingEnabledEP8QWebPageb @ 742 NONAME
+ _ZN23DumpRenderTreeSupportQt24executeCoreCommandByNameEP8QWebPageRK7QStringS4_ @ 743 NONAME
+ _ZN23DumpRenderTreeSupportQt21dumpSetAcceptsEditingEb @ 744 NONAME
+ _ZN23DumpRenderTreeSupportQt22resumeActiveDOMObjectsEP9QWebFrame @ 745 NONAME
+ _ZN23DumpRenderTreeSupportQt23suspendActiveDOMObjectsEP9QWebFrame @ 746 NONAME
+ _ZN23DumpRenderTreeSupportQt24numberOfActiveAnimationsEP9QWebFrame @ 747 NONAME
+ _ZN23DumpRenderTreeSupportQt24pageNumberForElementByIdEP9QWebFrameRK7QStringff @ 748 NONAME
+ _ZN23DumpRenderTreeSupportQt25dumpResourceLoadCallbacksEb @ 749 NONAME
+ _ZN23DumpRenderTreeSupportQt25pauseTransitionOfPropertyEP9QWebFrameRK7QStringdS4_ @ 750 NONAME
+ _ZN23DumpRenderTreeSupportQt25setFrameFlatteningEnabledEP8QWebPageb @ 751 NONAME
+ _ZN23DumpRenderTreeSupportQt25webInspectorExecuteScriptEP8QWebPagelRK7QString @ 752 NONAME
+ _ZN23DumpRenderTreeSupportQt25whiteListAccessFromOriginERK7QStringS2_S2_b @ 753 NONAME
+ _ZN23DumpRenderTreeSupportQt26counterValueForElementByIdEP9QWebFrameRK7QString @ 754 NONAME
+ _ZN23DumpRenderTreeSupportQt26firstRectForCharacterRangeEP8QWebPageii @ 755 NONAME
+ _ZN23DumpRenderTreeSupportQt26overwritePluginDirectoriesEv @ 756 NONAME
+ _ZN23DumpRenderTreeSupportQt27resetOriginAccessWhiteListsEv @ 757 NONAME
+ _ZN23DumpRenderTreeSupportQt27setSmartInsertDeleteEnabledEP8QWebPageb @ 758 NONAME
+ _ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @ 759 NONAME
+ _ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @ 760 NONAME
+ _ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @ 761 NONAME
+ _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @ 762 NONAME
+ _ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @ 763 NONAME
+ _ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @ 764 NONAME
+ _ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @ 765 NONAME
+ _ZN23DumpRenderTreeSupportQt33computedStyleIncludingVisitedInfoERK11QWebElement @ 766 NONAME
+ _ZN23DumpRenderTreeSupportQt34setSelectTrailingWhitespaceEnabledEP8QWebPageb @ 767 NONAME
+ _ZN23DumpRenderTreeSupportQt39elementDoesAutoCompleteForElementWithIdEP9QWebFrameRK7QString @ 768 NONAME
+ _ZN23DumpRenderTreeSupportQt39setWillSendRequestReturnsNullOnRedirectEb @ 769 NONAME
+ _ZN23DumpRenderTreeSupportQt40garbageCollectorCollectOnAlternateThreadEb @ 770 NONAME
+ _ZN23DumpRenderTreeSupportQt40setDomainRelaxationForbiddenForURLSchemeEbRK7QString @ 771 NONAME
+ _ZN23DumpRenderTreeSupportQt18setEditingBehaviorEP8QWebPageRK7QString @ 772 NONAME
+ _ZN23DumpRenderTreeSupportQt24setNotificationsReceiverEP7QObject @ 773 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt26allowNotificationForOriginERK7QString @ 774 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt26setCheckPermissionFunctionEPFvP7QObjectRK4QUrlR22NotificationPermissionE @ 775 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt28setRequestPermissionFunctionEPFvP7QObjectRK7QStringE @ 776 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt31removeWhiteListAccessFromOriginERK7QStringS2_S2_b @ 777 NONAME
+ _ZN23DumpRenderTreeSupportQt11shouldCloseEP9QWebFrame @ 778 NONAME
+ _ZN23DumpRenderTreeSupportQt12isTargetItemERK15QWebHistoryItem @ 779 NONAME
+ _ZN23DumpRenderTreeSupportQt17historyItemTargetERK15QWebHistoryItem @ 780 NONAME
+ _ZN23DumpRenderTreeSupportQt20getChildHistoryItemsERK15QWebHistoryItem @ 781 NONAME
+ _ZN23DumpRenderTreeSupportQt23setMockGeolocationErrorEiRK7QString @ 782 NONAME
+ _ZN23DumpRenderTreeSupportQt26setMockGeolocationPositionEddd @ 783 NONAME
+ _ZN23DumpRenderTreeSupportQt17clearScriptWorldsEv @ 784 NONAME
+ _ZN23DumpRenderTreeSupportQt23setCustomPolicyDelegateEbb @ 785 NONAME
+ _ZN15QWebScriptWorldC1ERKS_ @ 786 NONAME
+ _ZN15QWebScriptWorldC1Ev @ 787 NONAME
+ _ZN15QWebScriptWorldC2ERKS_ @ 788 NONAME
+ _ZN15QWebScriptWorldC2Ev @ 789 NONAME
+ _ZN15QWebScriptWorldD1Ev @ 790 NONAME
+ _ZN15QWebScriptWorldD2Ev @ 791 NONAME
+ _ZN15QWebScriptWorldaSERKS_ @ 792 NONAME
+ _ZN23DumpRenderTreeSupportQt29dumpResourceResponseMIMETypesEb @ 793 NONAME
+ _ZN23DumpRenderTreeSupportQtC1Ev @ 794 NONAME
+ _ZN23DumpRenderTreeSupportQtC2Ev @ 795 NONAME
+ _ZN23DumpRenderTreeSupportQtD1Ev @ 796 NONAME
+ _ZN23DumpRenderTreeSupportQtD2Ev @ 797 NONAME
+ _ZN8QWebPage23allowGeolocationRequestEP9QWebFrame @ 798 NONAME ABSENT
+ _ZN8QWebPage23viewportChangeRequestedERKNS_13ViewportHintsE @ 799 NONAME ABSENT
+ _ZNK15QWebScriptWorld5worldEv @ 800 NONAME
+ _ZN16QGraphicsWebView13setDeviceSizeERK5QSize @ 801 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt12pagePropertyEP9QWebFrameRK7QStringi @ 802 NONAME
+ _ZN23DumpRenderTreeSupportQt16isPageBoxVisibleEP9QWebFramei @ 803 NONAME
+ _ZN23DumpRenderTreeSupportQt16resumeAnimationsEP9QWebFrame @ 804 NONAME
+ _ZN23DumpRenderTreeSupportQt17addUserStyleSheetEP8QWebPageRK7QString @ 805 NONAME
+ _ZN23DumpRenderTreeSupportQt17suspendAnimationsEP9QWebFrame @ 806 NONAME
+ _ZN23DumpRenderTreeSupportQt26pageSizeAndMarginsInPixelsEP9QWebFrameiiiiiii @ 807 NONAME
+ _ZN23DumpRenderTreeSupportQt28setDeferMainResourceDataLoadEb @ 808 NONAME
+ _ZN8QWebPage17setUserPermissionEP9QWebFrameNS_16PermissionDomainENS_16PermissionPolicyE @ 809 NONAME ABSENT
+ _ZN8QWebPage23checkPermissionFromUserEP9QWebFrameNS_16PermissionDomainERNS_16PermissionPolicyE @ 810 NONAME ABSENT
+ _ZN8QWebPage25requestPermissionFromUserEP9QWebFrameNS_16PermissionDomainE @ 811 NONAME ABSENT
+ _ZN8QWebPage27cancelRequestsForPermissionEP9QWebFrameNS_16PermissionDomainE @ 812 NONAME ABSENT
+ _ZNK16QGraphicsWebView10deviceSizeEv @ 813 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt14viewportAsTextEP8QWebPageRK5QSize @ 814 NONAME
+ _ZN23DumpRenderTreeSupportQt32simulateDesktopNotificationClickERK7QString @ 815 NONAME
+ _ZN8QWebPage23viewportChangeRequestedEv @ 816 NONAME
+ _ZNK8QWebPage28viewportConfigurationForSizeERK5QSize @ 817 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt20dumpHistoryCallbacksEb @ 818 NONAME
+ _ZN23DumpRenderTreeSupportQt25dumpVisitedLinksCallbacksEb @ 819 NONAME
+ _ZN23DumpRenderTreeSupportQt9plainTextERK8QVariant @ 820 NONAME
+ _ZNK8QWebPage25viewportAttributesForSizeERK5QSize @ 821 NONAME
+ _ZN8QWebPage18ViewportAttributesC1ERKS0_ @ 822 NONAME
+ _ZN8QWebPage18ViewportAttributesC1Ev @ 823 NONAME
+ _ZN8QWebPage18ViewportAttributesC2ERKS0_ @ 824 NONAME
+ _ZN8QWebPage18ViewportAttributesC2Ev @ 825 NONAME
+ _ZN8QWebPage18ViewportAttributesD1Ev @ 826 NONAME
+ _ZN8QWebPage18ViewportAttributesD2Ev @ 827 NONAME
+ _ZN8QWebPage18ViewportAttributesaSERKS0_ @ 828 NONAME
+ _ZN23DumpRenderTreeSupportQt13nodesFromRectERK11QWebElementiijjjjb @ 829 NONAME
+ _ZN23DumpRenderTreeSupportQt28dumpUserGestureInFrameLoaderEb @ 830 NONAME
+ _ZNK8QWebPage19supportsContentTypeERK7QString @ 831 NONAME
+ _ZNK8QWebPage21supportedContentTypesEv @ 832 NONAME
+ _ZNK8QWebPage27setActualVisibleContentRectERK5QRect @ 833 NONAME
+ _ZN8QWebPage20setFeaturePermissionEP9QWebFrameNS_7FeatureENS_16PermissionPolicyE @ 834 NONAME
+ _ZN8QWebPage26featurePermissionRequestedEP9QWebFrameNS_7FeatureE @ 835 NONAME
+ _ZN8QWebPage32featurePermissionRequestCanceledEP9QWebFrameNS_7FeatureE @ 836 NONAME
+ _Z33qtwebkit_setPluginCreatedCallbackPFvP9QWebFramePvS1_E @ 837 NONAME
diff --git a/Source/WebKit/qt/tests/benchmarks/loading/loading.pro b/Source/WebKit/qt/tests/benchmarks/loading/loading.pro new file mode 100644 index 0000000..99c64a5 --- /dev/null +++ b/Source/WebKit/qt/tests/benchmarks/loading/loading.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../../.. +include(../../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp b/Source/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp new file mode 100644 index 0000000..0bc87f7 --- /dev/null +++ b/Source/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2009 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 <qwebframe.h> +#include <qwebview.h> +#include <qpainter.h> + +/** + * 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_Loading : public QObject +{ + Q_OBJECT + +public: + +public Q_SLOTS: + void init(); + void cleanup(); + +private Q_SLOTS: + void load_data(); + void load(); + +private: + QWebView* m_view; + QWebPage* m_page; +}; + +void tst_Loading::init() +{ + m_view = new QWebView; + m_page = m_view->page(); + + QSize viewportSize(1024, 768); + m_view->setFixedSize(viewportSize); + m_page->setViewportSize(viewportSize); +} + +void tst_Loading::cleanup() +{ + delete m_view; +} + +void tst_Loading::load_data() +{ + QTest::addColumn<QUrl>("url"); + QTest::newRow("amazon") << QUrl("http://www.amazon.com"); + QTest::newRow("kde") << QUrl("http://www.kde.org"); + QTest::newRow("apple") << QUrl("http://www.apple.com"); +} + +void tst_Loading::load() +{ + QFETCH(QUrl, url); + + + QBENCHMARK { + m_view->load(url); + + // really wait for loading, painting is in another test + ::waitForSignal(m_view, SIGNAL(loadFinished(bool))); + } +} + +QTEST_MAIN(tst_Loading) +#include "tst_loading.moc" diff --git a/Source/WebKit/qt/tests/benchmarks/painting/painting.pro b/Source/WebKit/qt/tests/benchmarks/painting/painting.pro new file mode 100644 index 0000000..99c64a5 --- /dev/null +++ b/Source/WebKit/qt/tests/benchmarks/painting/painting.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../../.. +include(../../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp b/Source/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp new file mode 100644 index 0000000..fc5b8e3 --- /dev/null +++ b/Source/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2009 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 <qwebelement.h> +#include <qwebframe.h> +#include <qwebview.h> +#include <qpainter.h> + +/** + * 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_Painting : public QObject +{ + Q_OBJECT + +public: + +public Q_SLOTS: + void init(); + void cleanup(); + +private Q_SLOTS: + void paint_data(); + void paint(); + void textAreas(); + +private: + QWebView* m_view; + QWebPage* m_page; +}; + +void tst_Painting::init() +{ + m_view = new QWebView; + m_page = m_view->page(); + + QSize viewportSize(1024, 768); + m_view->setFixedSize(viewportSize); + m_page->setViewportSize(viewportSize); +} + +void tst_Painting::cleanup() +{ + delete m_view; +} + +void tst_Painting::paint_data() +{ + QTest::addColumn<QUrl>("url"); + QTest::newRow("amazon") << QUrl("http://www.amazon.com"); +} + +void tst_Painting::paint() +{ + QFETCH(QUrl, url); + + m_view->load(url); + ::waitForSignal(m_view, SIGNAL(loadFinished(bool))); + + /* force a layout */ + QWebFrame* mainFrame = m_page->mainFrame(); + mainFrame->toPlainText(); + + QPixmap pixmap(m_page->viewportSize()); + QBENCHMARK { + QPainter painter(&pixmap); + mainFrame->render(&painter, QRect(QPoint(0, 0), m_page->viewportSize())); + painter.end(); + } +} + +void tst_Painting::textAreas() +{ + m_view->load(QUrl("data:text/html;<html><body></body></html>")); + ::waitForSignal(m_view, SIGNAL(loadFinished(bool))); + + QWebElement bodyElement = m_page->mainFrame()->findFirstElement("body"); + + int count = 100; + while (count--) { + QString markup("<textarea cols='1' rows='1'></textarea>"); + bodyElement.appendInside(markup); + } + + /* force a layout */ + QWebFrame* mainFrame = m_page->mainFrame(); + mainFrame->toPlainText(); + + QPixmap pixmap(mainFrame->contentsSize()); + QBENCHMARK { + QPainter painter(&pixmap); + mainFrame->render(&painter, QRect(QPoint(0, 0), mainFrame->contentsSize())); + painter.end(); + } +} + +QTEST_MAIN(tst_Painting) +#include "tst_painting.moc" diff --git a/Source/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro b/Source/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro new file mode 100644 index 0000000..9e80870 --- /dev/null +++ b/Source/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro @@ -0,0 +1,11 @@ +# ------------------------------------------------- +# Project created by QtCreator 2009-12-10T11:25:02 +# ------------------------------------------------- +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +TARGET = hybridPixmap +SOURCES += widget.cpp +HEADERS += widget.h +FORMS += widget.ui +RESOURCES += resources.qrc +CONFIG += console diff --git a/Source/WebKit/qt/tests/hybridPixmap/resources.qrc b/Source/WebKit/qt/tests/hybridPixmap/resources.qrc new file mode 100644 index 0000000..5fd47e3 --- /dev/null +++ b/Source/WebKit/qt/tests/hybridPixmap/resources.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>test.html</file> + </qresource> +</RCC> diff --git a/Source/WebKit/qt/tests/hybridPixmap/test.html b/Source/WebKit/qt/tests/hybridPixmap/test.html new file mode 100644 index 0000000..0f2c345 --- /dev/null +++ b/Source/WebKit/qt/tests/hybridPixmap/test.html @@ -0,0 +1,65 @@ +<html> + <head> + <style> + img { display: block; border-style: groove} + </style> + <script> + function startTest() + { + var obj = myWidget.image; + var pxm = myWidget.pixmap; + + var img = new Image; + obj.assignToHTMLImageElement(img); + var img1 = document.getElementById("img1"); + var img2 = document.getElementById("img2"); + var img3 = document.getElementById("img3"); + var img4 = document.getElementById("img4"); + document.body.appendChild(img); + obj.assignToHTMLImageElement(img3); + pxm.assignToHTMLImageElement(img4); + myWidget.compare(pxm.width, img4.width); + myWidget.compare(obj.width, img3.width); + var signalsFired = 0; + myWidget.compare(obj.toString(),"[Qt Native Pixmap "+obj.width+","+obj.height+"]"); + myWidget.compare(String(pxm),"[Qt Native Pixmap "+pxm.width+","+pxm.height+"]"); + + // this shouldn't work but shouldn't crash + myWidget.randomSlot("foobar"); + + myWidget.pixmapSignal.connect(function(imgFromSignal) { + myWidget.compare(imgFromSignal.height, img2.height); + if (++signalsFired == 2) + myWidget.completeTest(); + }); + + myWidget.imageSignal.connect(function(imgFromSignal) { + myWidget.compare(pxm.height, img2.height); + if (++signalsFired == 2) + myWidget.completeTest(); + }); + + function continueTestAfterImagesAreLoaded() + { + if (img1.complete && img2.complete) { + myWidget.compare(pxm.height, img2.height); + myWidget.pixmapSlot(img); + myWidget.imageSlot(pxm); + } + } + img1.onload = continueTestAfterImagesAreLoaded; + img2.onload = continueTestAfterImagesAreLoaded; + img1.src = obj.toDataUrl(); + img2.src = myWidget.pixmap.toDataUrl(); + myWidget.image = pxm; + myWidget.pixmap = img; + } + </script> + </head> + <body onload="startTest()"> + <img id="img1" /> + <img id="img2" /> + <img id="img3" /> + <img id="img4" /> + </body> +</html> diff --git a/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp b/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp new file mode 100644 index 0000000..72dbb3b --- /dev/null +++ b/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp @@ -0,0 +1,52 @@ +/* + * 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 Lesser 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "../util.h" + +#include "widget.h" +#include <QtTest/QtTest> + +class tst_hybridPixmap : public QObject { + Q_OBJECT + +public: + tst_hybridPixmap(QObject* o = 0) : QObject(o) {} + +public slots: + void init() + { + } + + void cleanup() + { + } + +private slots: + void hybridPixmap() + { + Widget widget; + widget.show(); + widget.start(); + waitForSignal(&widget, SIGNAL(testComplete())); + } +}; + +QTEST_MAIN(tst_hybridPixmap) + +#include <tst_hybridPixmap.moc> diff --git a/Source/WebKit/qt/tests/hybridPixmap/widget.cpp b/Source/WebKit/qt/tests/hybridPixmap/widget.cpp new file mode 100644 index 0000000..cfdb1d6 --- /dev/null +++ b/Source/WebKit/qt/tests/hybridPixmap/widget.cpp @@ -0,0 +1,119 @@ +/* + * 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 Lesser 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "widget.h" + +#include "qwebelement.h" +#include "qwebframe.h" +#include "ui_widget.h" +#include <QPainter> +#include <QtTest/QtTest> + +Widget::Widget(QWidget* parent) : + QWidget(parent), + ui(new Ui::Widget) +{ + ui->setupUi(this); +} + +void Widget::refreshJS() +{ + ui->webView->page()->mainFrame()->addToJavaScriptWindowObject("myWidget", this); +} +void Widget::start() +{ + ui->webView->load(QUrl("qrc:///test.html")); + connect(ui->webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(refreshJS())); + ui->webView->page()->mainFrame()->addToJavaScriptWindowObject("myWidget", this); +} + +void Widget::completeTest() +{ + QCOMPARE(ui->lbl1->pixmap()->size(), ui->lbl2->size()); + QCOMPARE(ui->lbl3->size(), ui->lbl4->pixmap()->size()); + QCOMPARE(ui->lbl2->size().width(), ui->webView->page()->mainFrame()->findFirstElement("#img1").evaluateJavaScript("this.width").toInt()); + QCOMPARE(ui->lbl3->size().width(), ui->webView->page()->mainFrame()->findFirstElement("#img2").evaluateJavaScript("this.width").toInt()); + emit testComplete(); +} + +void Widget::setPixmap(const QPixmap& p) +{ + ui->lbl1->setPixmap(p); +} +QPixmap Widget::pixmap() const +{ + QPixmap px(ui->lbl3->size()); + { + QPainter p(&px); + ui->lbl3->render(&p); + } + return px; +} +void Widget::setImage(const QImage& img) +{ + ui->lbl4->setPixmap(QPixmap::fromImage(img)); +} + +QImage Widget::image() const +{ + QImage img(ui->lbl2->size(), QImage::Format_ARGB32); + { + QPainter p(&img); + ui->lbl2->render(&p); + } + return img; +} + +Widget::~Widget() +{ + delete ui; +} + +void Widget::changeEvent(QEvent* e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} +void Widget::compare(const QVariant& a, const QVariant& b) +{ + QCOMPARE(a, b); +} + +void Widget::imageSlot(const QImage& img) +{ + QCOMPARE(img.size(), ui->lbl3->size()); + emit pixmapSignal(QPixmap::fromImage(img)); +} + +void Widget::pixmapSlot(const QPixmap& pxm) +{ + QCOMPARE(pxm.size(), ui->lbl2->size()); + emit imageSignal(ui->lbl4->pixmap()->toImage()); +} + +void Widget::randomSlot(const QPixmap& pxm) +{ + QVERIFY(pxm.isNull()); +} diff --git a/Source/WebKit/qt/tests/hybridPixmap/widget.h b/Source/WebKit/qt/tests/hybridPixmap/widget.h new file mode 100644 index 0000000..2ac8a06 --- /dev/null +++ b/Source/WebKit/qt/tests/hybridPixmap/widget.h @@ -0,0 +1,72 @@ +/* + * 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 Lesser 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef widget_h +#define widget_h + +#include <QImage> +#include <QPixmap> +#include <QWidget> +#include "qwebview.h" + +typedef QWebView WebView; + +QT_BEGIN_NAMESPACE +namespace Ui { +class Widget; +} +QT_END_NAMESPACE + +class Widget : public QWidget { + Q_OBJECT + Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) + Q_PROPERTY(QImage image READ image WRITE setImage) + +public: + Widget(QWidget* parent = 0); + ~Widget(); + void setPixmap(const QPixmap&); + QPixmap pixmap() const; + void setImage(const QImage&); + QImage image() const; + +private slots: + void refreshJS(); + +public slots: + void completeTest(); + void start(); + void compare(const QVariant& a, const QVariant& b); + void imageSlot(const QImage&); + void pixmapSlot(const QPixmap&); + void randomSlot(const QPixmap&); + +signals: + void testComplete(); + void imageSignal(const QImage&); + void pixmapSignal(const QPixmap&); + +protected: + void changeEvent(QEvent* e); + +private: + Ui::Widget* ui; +}; + +#endif // widget_h diff --git a/Source/WebKit/qt/tests/hybridPixmap/widget.ui b/Source/WebKit/qt/tests/hybridPixmap/widget.ui new file mode 100644 index 0000000..272d6a7 --- /dev/null +++ b/Source/WebKit/qt/tests/hybridPixmap/widget.ui @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Widget</class> + <widget class="QWidget" name="Widget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>400</height> + </rect> + </property> + <property name="windowTitle"> + <string notr="true">Widget</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="WebView" name="webView" native="true"> + <property name="url" stdset="0"> + <url> + <string notr="true">about:blank</string> + </url> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="lbl1"> + <property name="text"> + <string notr="true"/> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="lbl2"> + <property name="minimumSize"> + <size> + <width>120</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>120</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string notr="true">Image from Qt to HTML</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="lbl3"> + <property name="text"> + <string notr="true">Pixmap from Qt to HTML</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="lbl4"> + <property name="text"> + <string notr="true"/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <layoutdefault spacing="6" margin="11"/> + <customwidgets> + <customwidget> + <class>WebView</class> + <extends>QWidget</extends> + <header>widget.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/Source/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/Source/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qgraphicswebview/resources/input_types.html b/Source/WebKit/qt/tests/qgraphicswebview/resources/input_types.html new file mode 100644 index 0000000..18ab314 --- /dev/null +++ b/Source/WebKit/qt/tests/qgraphicswebview/resources/input_types.html @@ -0,0 +1,8 @@ +<html><body> +<input type='text' maxlength='20' style='position: absolute; left: 10px; top: 0px; height: 50px; width: 100px;'/><br> +<input type='password' style='position: absolute; left: 10px; top: 50px; height: 50px; width: 100px;'/><br> +<input type='tel' style='position: absolute; left: 10px; top: 100px; height: 50px; width: 100px;'/><br> +<input type='number' style='position: absolute; left: 10px; top: 150px; height: 50px; width: 100px;'/><br> +<input type='email' style='position: absolute; left: 10px; top: 200px; height: 50px; width: 100px;'/><br> +<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br>" +</body></html>
\ No newline at end of file diff --git a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp new file mode 100644 index 0000000..09a21e1 --- /dev/null +++ b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp @@ -0,0 +1,266 @@ +/* + Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com> + + 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 "../util.h" +#include <QtTest/QtTest> +#include <QGraphicsSceneMouseEvent> +#include <QGraphicsView> +#include <qgraphicswebview.h> +#include <qwebpage.h> +#include <qwebframe.h> + +class tst_QGraphicsWebView : public QObject +{ + Q_OBJECT + +private slots: + void qgraphicswebview(); + void crashOnViewlessWebPages(); + void microFocusCoordinates(); + void focusInputTypes(); + void crashOnSetScaleBeforeSetUrl(); + void widgetsRenderingThroughCache(); +}; + +void tst_QGraphicsWebView::qgraphicswebview() +{ + QGraphicsWebView item; + item.url(); + item.title(); + item.icon(); + item.zoomFactor(); + item.history(); + item.settings(); + item.page(); + item.setPage(0); + item.page(); + item.setUrl(QUrl()); + item.setZoomFactor(0); + item.load(QUrl()); + item.setHtml(QString()); + item.setContent(QByteArray()); + item.isModified(); +} + +class WebPage : public QWebPage +{ + Q_OBJECT + +public: + WebPage(QObject* parent = 0): QWebPage(parent) + { + } + + QGraphicsWebView* webView; + +private slots: + // Force a webview deletion during the load. + // It should not cause WebPage to crash due to + // it accessing invalid pageClient pointer. + void aborting() + { + delete webView; + } +}; + +class GraphicsWebView : public QGraphicsWebView +{ + Q_OBJECT + +public: + GraphicsWebView(QGraphicsItem* parent = 0): QGraphicsWebView(parent) + { + } + + void fireMouseClick(QPointF point) { + QGraphicsSceneMouseEvent presEv(QEvent::GraphicsSceneMousePress); + presEv.setPos(point); + presEv.setButton(Qt::LeftButton); + presEv.setButtons(Qt::LeftButton); + QGraphicsSceneMouseEvent relEv(QEvent::GraphicsSceneMouseRelease); + relEv.setPos(point); + relEv.setButton(Qt::LeftButton); + relEv.setButtons(Qt::LeftButton); + QGraphicsWebView::sceneEvent(&presEv); + QGraphicsWebView::sceneEvent(&relEv); + } +}; + +void tst_QGraphicsWebView::crashOnViewlessWebPages() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + + QGraphicsWebView* webView = new QGraphicsWebView; + WebPage* page = new WebPage; + webView->setPage(page); + page->webView = webView; + scene.addItem(webView); + + view.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + view.resize(600, 480); + webView->resize(view.geometry().size()); + + QCoreApplication::processEvents(); + view.show(); + + // Resizing the page will resize and layout the empty "about:blank" + // page, so we first connect the signal afterward. + connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting())); + + page->mainFrame()->load(QUrl("data:text/html," + "<frameset cols=\"25%,75%\">" + "<frame src=\"data:text/html,foo \">" + "<frame src=\"data:text/html,bar\">" + "</frameset>")); + + QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool)))); + delete page; +} + +void tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl() +{ + QGraphicsWebView* webView = new QGraphicsWebView; + webView->setScale(2.0); + delete webView; +} + +void tst_QGraphicsWebView::widgetsRenderingThroughCache() +{ + // Widgets should be rendered the same way with and without + // intermediate cache (tiling for example). + // See bug https://bugs.webkit.org/show_bug.cgi?id=47767 where + // widget are rendered as disabled when caching is using. + + QGraphicsWebView* webView = new QGraphicsWebView; + webView->setHtml(QLatin1String("<body style=\"background-color: white\"><input type=range></input><input type=checkbox></input><input type=radio></input><input type=file></input></body>")); + + QGraphicsView view; + view.show(); + QGraphicsScene* scene = new QGraphicsScene(&view); + view.setScene(scene); + scene->addItem(webView); + view.setGeometry(QRect(0, 0, 500, 500)); + QWidget *const widget = &view; + QTest::qWaitForWindowShown(widget); + + // 1. Reference without tiling. + webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, false); + QPixmap referencePixmap(view.size()); + widget->render(&referencePixmap); + + // 2. With tiling. + webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); + QPixmap viewWithTiling(view.size()); + widget->render(&viewWithTiling); + QApplication::processEvents(); + viewWithTiling.fill(); + widget->render(&viewWithTiling); + + QCOMPARE(referencePixmap.toImage(), viewWithTiling.toImage()); +} + +void tst_QGraphicsWebView::microFocusCoordinates() +{ + QWebPage* page = new QWebPage; + QGraphicsWebView* webView = new QGraphicsWebView; + webView->setPage( page ); + QGraphicsView* view = new QGraphicsView; + QGraphicsScene* scene = new QGraphicsScene(view); + view->setScene(scene); + scene->addItem(webView); + view->setGeometry(QRect(0,0,500,500)); + + page->mainFrame()->setHtml("<html><body>" \ + "<input type='text' id='input1' style='font--family: serif' value='' maxlength='20'/><br>" \ + "<canvas id='canvas1' width='500' height='500'/>" \ + "<input type='password'/><br>" \ + "<canvas id='canvas2' width='500' height='500'/>" \ + "</body></html>"); + + page->mainFrame()->setFocus(); + + QVariant initialMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus); + QVERIFY(initialMicroFocus.isValid()); + + page->mainFrame()->scroll(0,300); + + QVariant currentMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus); + QVERIFY(currentMicroFocus.isValid()); + + QCOMPARE(initialMicroFocus.toRect().translated(QPoint(0,-300)), currentMicroFocus.toRect()); + + delete view; +} + +void tst_QGraphicsWebView::focusInputTypes() +{ + QWebPage* page = new QWebPage; + GraphicsWebView* webView = new GraphicsWebView; + webView->setPage( page ); + QGraphicsView* view = new QGraphicsView; + QGraphicsScene* scene = new QGraphicsScene(view); + view->setScene(scene); + scene->addItem(webView); + view->setGeometry(QRect(0,0,500,500)); + QCoreApplication::processEvents(); + QUrl url("qrc:///resources/input_types.html"); + page->mainFrame()->load(url); + page->mainFrame()->setFocus(); + + QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool)))); + + // 'text' type + webView->fireMouseClick(QPointF(20.0, 10.0)); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + QVERIFY(webView->inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView->inputMethodHints() & Qt::ImhNoPredictiveText); +#else + QVERIFY(webView->inputMethodHints() == Qt::ImhNone); +#endif + + // 'password' field + webView->fireMouseClick(QPointF(20.0, 60.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhHiddenText); + + // 'tel' field + webView->fireMouseClick(QPointF(20.0, 110.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhDialableCharactersOnly); + + // 'number' field + webView->fireMouseClick(QPointF(20.0, 160.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhDigitsOnly); + + // 'email' field + webView->fireMouseClick(QPointF(20.0, 210.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhEmailCharactersOnly); + + // 'url' field + webView->fireMouseClick(QPointF(20.0, 260.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhUrlCharactersOnly); + + delete webView; + delete view; +} + + + +QTEST_MAIN(tst_QGraphicsWebView) + +#include "tst_qgraphicswebview.moc" diff --git a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc new file mode 100644 index 0000000..c91bb9c --- /dev/null +++ b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>resources/input_types.html</file> +</qresource> +</RCC> + diff --git a/Source/WebKit/qt/tests/qwebelement/qwebelement.pro b/Source/WebKit/qt/tests/qwebelement/qwebelement.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebelement/qwebelement.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebelement/resources/image.png b/Source/WebKit/qt/tests/qwebelement/resources/image.png Binary files differnew file mode 100644 index 0000000..8d70364 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebelement/resources/image.png diff --git a/Source/WebKit/qt/tests/qwebelement/resources/style.css b/Source/WebKit/qt/tests/qwebelement/resources/style.css new file mode 100644 index 0000000..2713dfd --- /dev/null +++ b/Source/WebKit/qt/tests/qwebelement/resources/style.css @@ -0,0 +1 @@ +#idP {color: black !important} diff --git a/Source/WebKit/qt/tests/qwebelement/resources/style2.css b/Source/WebKit/qt/tests/qwebelement/resources/style2.css new file mode 100644 index 0000000..6575dcb --- /dev/null +++ b/Source/WebKit/qt/tests/qwebelement/resources/style2.css @@ -0,0 +1 @@ +#idP {color: green ! important} diff --git a/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp new file mode 100644 index 0000000..88816e8 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp @@ -0,0 +1,1028 @@ +/* + 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 <qwebelement.h> +#include <util.h> +//TESTED_CLASS= +//TESTED_FILES= + +class tst_QWebElement : public QObject +{ + Q_OBJECT + +public: + tst_QWebElement(); + virtual ~tst_QWebElement(); + +public slots: + void init(); + void cleanup(); + +private slots: + void textHtml(); + void simpleCollection(); + void attributes(); + void attributesNS(); + void listAttributes(); + void classes(); + void namespaceURI(); + void iteration(); + void nonConstIterator(); + void constIterator(); + void foreachManipulation(); + void emptyCollection(); + void appendCollection(); + void evaluateJavaScript(); + void documentElement(); + void frame(); + void style(); + void computedStyle(); + void appendAndPrepend(); + void insertBeforeAndAfter(); + void remove(); + void clear(); + void replaceWith(); + void encloseWith(); + void encloseContentsWith(); + void nullSelect(); + void firstChildNextSibling(); + void lastChildPreviousSibling(); + void hasSetFocus(); + void render(); + void addElementToHead(); + +private: + QWebView* m_view; + QWebPage* m_page; + QWebFrame* m_mainFrame; +}; + +tst_QWebElement::tst_QWebElement() +{ +} + +tst_QWebElement::~tst_QWebElement() +{ +} + +void tst_QWebElement::init() +{ + m_view = new QWebView(); + m_page = m_view->page(); + m_mainFrame = m_page->mainFrame(); +} + +void tst_QWebElement::cleanup() +{ + delete m_view; +} + +void tst_QWebElement::textHtml() +{ + QString html = "<head></head><body><p>test</p></body>"; + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement(); + QVERIFY(!body.isNull()); + + QCOMPARE(body.toPlainText(), QString("test")); + QCOMPARE(body.toPlainText(), m_mainFrame->toPlainText()); + + QCOMPARE(body.toInnerXml(), html); +} + +void tst_QWebElement::simpleCollection() +{ + QString html = "<body><p>first para</p><p>second para</p></body>"; + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement(); + + QWebElementCollection list = body.findAll("p"); + QCOMPARE(list.count(), 2); + QCOMPARE(list.at(0).toPlainText(), QString("first para")); + QCOMPARE(list.at(1).toPlainText(), QString("second para")); +} + +void tst_QWebElement::attributes() +{ + m_mainFrame->setHtml("<body><p>Test"); + QWebElement body = m_mainFrame->documentElement(); + + QVERIFY(!body.hasAttribute("title")); + QVERIFY(!body.hasAttributes()); + + body.setAttribute("title", "test title"); + + QVERIFY(body.hasAttributes()); + QVERIFY(body.hasAttribute("title")); + + QCOMPARE(body.attribute("title"), QString("test title")); + + body.removeAttribute("title"); + + QVERIFY(!body.hasAttribute("title")); + QVERIFY(!body.hasAttributes()); + + QCOMPARE(body.attribute("does-not-exist", "testvalue"), QString("testvalue")); +} + +void tst_QWebElement::attributesNS() +{ + QString content = "<html xmlns=\"http://www.w3.org/1999/xhtml\" " + "xmlns:svg=\"http://www.w3.org/2000/svg\">" + "<body><svg:svg id=\"foobar\" width=\"400px\" height=\"300px\">" + "</svg:svg></body></html>"; + + m_mainFrame->setContent(content.toUtf8(), "application/xhtml+xml"); + + QWebElement svg = m_mainFrame->findFirstElement("svg"); + QVERIFY(!svg.isNull()); + + QVERIFY(!svg.hasAttributeNS("http://www.w3.org/2000/svg", "foobar")); + QCOMPARE(svg.attributeNS("http://www.w3.org/2000/svg", "foobar", "defaultblah"), QString("defaultblah")); + svg.setAttributeNS("http://www.w3.org/2000/svg", "svg:foobar", "true"); + QVERIFY(svg.hasAttributeNS("http://www.w3.org/2000/svg", "foobar")); + QCOMPARE(svg.attributeNS("http://www.w3.org/2000/svg", "foobar", "defaultblah"), QString("true")); +} + +void tst_QWebElement::listAttributes() +{ + QString content = "<html xmlns=\"http://www.w3.org/1999/xhtml\" " + "xmlns:svg=\"http://www.w3.org/2000/svg\">" + "<body><svg:svg foo=\"\" svg:bar=\"\">" + "</svg:svg></body></html>"; + + m_mainFrame->setContent(content.toUtf8(), "application/xhtml+xml"); + + QWebElement svg = m_mainFrame->findFirstElement("svg"); + QVERIFY(!svg.isNull()); + + QVERIFY(svg.attributeNames().contains("foo")); + QVERIFY(svg.attributeNames("http://www.w3.org/2000/svg").contains("bar")); + + svg.setAttributeNS("http://www.w3.org/2000/svg", "svg:foobar", "true"); + QVERIFY(svg.attributeNames().contains("foo")); + QStringList attributes = svg.attributeNames("http://www.w3.org/2000/svg"); + QCOMPARE(attributes.size(), 2); + QVERIFY(attributes.contains("bar")); + QVERIFY(attributes.contains("foobar")); +} + +void tst_QWebElement::classes() +{ + m_mainFrame->setHtml("<body><p class=\"a b c d a c\">Test"); + + QWebElement body = m_mainFrame->documentElement(); + QCOMPARE(body.classes().count(), 0); + + QWebElement p = m_mainFrame->documentElement().findAll("p").at(0); + QStringList classes = p.classes(); + QCOMPARE(classes.count(), 4); + QCOMPARE(classes[0], QLatin1String("a")); + QCOMPARE(classes[1], QLatin1String("b")); + QCOMPARE(classes[2], QLatin1String("c")); + QCOMPARE(classes[3], QLatin1String("d")); + QVERIFY(p.hasClass("a")); + QVERIFY(p.hasClass("b")); + QVERIFY(p.hasClass("c")); + QVERIFY(p.hasClass("d")); + QVERIFY(!p.hasClass("e")); + + p.addClass("f"); + QVERIFY(p.hasClass("f")); + p.addClass("a"); + QCOMPARE(p.classes().count(), 5); + QVERIFY(p.hasClass("a")); + QVERIFY(p.hasClass("b")); + QVERIFY(p.hasClass("c")); + QVERIFY(p.hasClass("d")); + + p.toggleClass("a"); + QVERIFY(!p.hasClass("a")); + QVERIFY(p.hasClass("b")); + QVERIFY(p.hasClass("c")); + QVERIFY(p.hasClass("d")); + QVERIFY(p.hasClass("f")); + QCOMPARE(p.classes().count(), 4); + p.toggleClass("f"); + QVERIFY(!p.hasClass("f")); + QCOMPARE(p.classes().count(), 3); + p.toggleClass("a"); + p.toggleClass("f"); + QVERIFY(p.hasClass("a")); + QVERIFY(p.hasClass("f")); + QCOMPARE(p.classes().count(), 5); + + p.removeClass("f"); + QVERIFY(!p.hasClass("f")); + QCOMPARE(p.classes().count(), 4); + p.removeClass("d"); + QVERIFY(!p.hasClass("d")); + QCOMPARE(p.classes().count(), 3); + p.removeClass("not-exist"); + QCOMPARE(p.classes().count(), 3); + p.removeClass("c"); + QVERIFY(!p.hasClass("c")); + QCOMPARE(p.classes().count(), 2); + p.removeClass("b"); + QVERIFY(!p.hasClass("b")); + QCOMPARE(p.classes().count(), 1); + p.removeClass("a"); + QVERIFY(!p.hasClass("a")); + QCOMPARE(p.classes().count(), 0); + p.removeClass("foobar"); + QCOMPARE(p.classes().count(), 0); +} + +void tst_QWebElement::namespaceURI() +{ + QString content = "<html xmlns=\"http://www.w3.org/1999/xhtml\" " + "xmlns:svg=\"http://www.w3.org/2000/svg\">" + "<body><svg:svg id=\"foobar\" width=\"400px\" height=\"300px\">" + "</svg:svg></body></html>"; + + m_mainFrame->setContent(content.toUtf8(), "application/xhtml+xml"); + QWebElement body = m_mainFrame->documentElement(); + QCOMPARE(body.namespaceUri(), QLatin1String("http://www.w3.org/1999/xhtml")); + + QWebElement svg = body.findAll("*#foobar").at(0); + QCOMPARE(svg.prefix(), QLatin1String("svg")); + QCOMPARE(svg.localName(), QLatin1String("svg")); + QCOMPARE(svg.tagName(), QLatin1String("svg:svg")); + QCOMPARE(svg.namespaceUri(), QLatin1String("http://www.w3.org/2000/svg")); + +} + +void tst_QWebElement::iteration() +{ + QString html = "<body><p>first para</p><p>second para</p></body>"; + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement(); + + QWebElementCollection paras = body.findAll("p"); + QList<QWebElement> referenceList = paras.toList(); + + QList<QWebElement> foreachList; + foreach(QWebElement p, paras) { + foreachList.append(p); + } + QVERIFY(foreachList.count() == 2); + QCOMPARE(foreachList.count(), referenceList.count()); + QCOMPARE(foreachList.at(0), referenceList.at(0)); + QCOMPARE(foreachList.at(1), referenceList.at(1)); + + QList<QWebElement> forLoopList; + for (int i = 0; i < paras.count(); ++i) { + forLoopList.append(paras.at(i)); + } + QVERIFY(foreachList.count() == 2); + QCOMPARE(foreachList.count(), referenceList.count()); + QCOMPARE(foreachList.at(0), referenceList.at(0)); + QCOMPARE(foreachList.at(1), referenceList.at(1)); + + for (int i = 0; i < paras.count(); ++i) { + QCOMPARE(paras.at(i), paras[i]); + } + + QCOMPARE(paras.at(0), paras.first()); + QCOMPARE(paras.at(1), paras.last()); +} + +void tst_QWebElement::nonConstIterator() +{ + QString html = "<body><p>first para</p><p>second para</p></body>"; + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement(); + QWebElementCollection paras = body.findAll("p"); + + QWebElementCollection::iterator it = paras.begin(); + QCOMPARE(*it, paras.at(0)); + ++it; + (*it).encloseWith("<div>"); + QCOMPARE(*it, paras.at(1)); + ++it; + QCOMPARE(it, paras.end()); +} + +void tst_QWebElement::constIterator() +{ + QString html = "<body><p>first para</p><p>second para</p></body>"; + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement(); + const QWebElementCollection paras = body.findAll("p"); + + QWebElementCollection::const_iterator it = paras.begin(); + QCOMPARE(*it, paras.at(0)); + ++it; + QCOMPARE(*it, paras.at(1)); + ++it; + QCOMPARE(it, paras.end()); +} + +void tst_QWebElement::foreachManipulation() +{ + QString html = "<body><p>first para</p><p>second para</p></body>"; + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement(); + + foreach(QWebElement p, body.findAll("p")) { + p.setInnerXml("<div>foo</div><div>bar</div>"); + } + + QCOMPARE(body.findAll("div").count(), 4); +} + +void tst_QWebElement::emptyCollection() +{ + QWebElementCollection emptyCollection; + QCOMPARE(emptyCollection.count(), 0); +} + +void tst_QWebElement::appendCollection() +{ + QString html = "<body><span class='a'>aaa</span><p>first para</p><div>foo</div>" + "<span class='b'>bbb</span><p>second para</p><div>bar</div></body>"; + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement(); + + QWebElementCollection collection = body.findAll("p"); + QCOMPARE(collection.count(), 2); + + collection.append(body.findAll("div")); + QCOMPARE(collection.count(), 4); + + collection += body.findAll("span.a"); + QCOMPARE(collection.count(), 5); + + QWebElementCollection all = collection + body.findAll("span.b"); + QCOMPARE(all.count(), 6); + QCOMPARE(collection.count(), 5); + + all += collection; + QCOMPARE(all.count(), 11); + + QCOMPARE(collection.count(), 5); + QWebElementCollection test; + test.append(collection); + QCOMPARE(test.count(), 5); + test.append(QWebElementCollection()); + QCOMPARE(test.count(), 5); +} + +void tst_QWebElement::evaluateJavaScript() +{ + QVariant result; + m_mainFrame->setHtml("<body><p>test"); + QWebElement para = m_mainFrame->findFirstElement("p"); + + result = para.evaluateJavaScript("this.tagName"); + QVERIFY(result.isValid()); + QVERIFY(result.type() == QVariant::String); + QCOMPARE(result.toString(), QLatin1String("P")); + + result = para.evaluateJavaScript("this.hasAttributes()"); + QVERIFY(result.isValid()); + QVERIFY(result.type() == QVariant::Bool); + QVERIFY(!result.toBool()); + + para.evaluateJavaScript("this.setAttribute('align', 'left');"); + QCOMPARE(para.attribute("align"), QLatin1String("left")); + + result = para.evaluateJavaScript("this.hasAttributes()"); + QVERIFY(result.isValid()); + QVERIFY(result.type() == QVariant::Bool); + QVERIFY(result.toBool()); +} + +void tst_QWebElement::documentElement() +{ + m_mainFrame->setHtml("<body><p>Test"); + + QWebElement para = m_mainFrame->documentElement().findAll("p").at(0); + QVERIFY(para.parent().parent() == m_mainFrame->documentElement()); + QVERIFY(para.document() == m_mainFrame->documentElement()); +} + +void tst_QWebElement::frame() +{ + m_mainFrame->setHtml("<body><p>test"); + + QWebElement doc = m_mainFrame->documentElement(); + QVERIFY(doc.webFrame() == m_mainFrame); + + m_mainFrame->load(QUrl("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html," + "<p>frame1\">" + "<frame src=\"data:text/html,<p>frame2\"></frameset>")); + + waitForSignal(m_page, SIGNAL(loadFinished(bool))); + + QCOMPARE(m_mainFrame->childFrames().count(), 2); + + QWebFrame* firstFrame = m_mainFrame->childFrames().at(0); + QWebFrame* secondFrame = m_mainFrame->childFrames().at(1); + + QCOMPARE(firstFrame->toPlainText(), QString("frame1")); + QCOMPARE(secondFrame->toPlainText(), QString("frame2")); + + QWebElement firstPara = firstFrame->documentElement().findAll("p").at(0); + QWebElement secondPara = secondFrame->documentElement().findAll("p").at(0); + + QVERIFY(firstPara.webFrame() == firstFrame); + QVERIFY(secondPara.webFrame() == secondFrame); +} + +void tst_QWebElement::style() +{ + QString html = "<head>" + "<style type='text/css'>" + "p { color: green !important }" + "#idP { color: red }" + ".classP { color : yellow ! important }" + "</style>" + "</head>" + "<body>" + "<p id='idP' class='classP' style='color: blue;'>some text</p>" + "</body>"; + + m_mainFrame->setHtml(html); + + QWebElement p = m_mainFrame->documentElement().findAll("p").at(0); + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); + QVERIFY(p.styleProperty("cursor", QWebElement::InlineStyle).isEmpty()); + + p.setStyleProperty("color", "red"); + p.setStyleProperty("cursor", "auto"); + + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("red")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("yellow")); + QCOMPARE(p.styleProperty("cursor", QWebElement::InlineStyle), QLatin1String("auto")); + + p.setStyleProperty("color", "green !important"); + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green")); + + p.setStyleProperty("color", "blue"); + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green")); + + p.setStyleProperty("color", "blue !important"); + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue")); + + QString html2 = "<head>" + "<style type='text/css'>" + "p { color: green }" + "#idP { color: red }" + ".classP { color: yellow }" + "</style>" + "</head>" + "<body>" + "<p id='idP' class='classP' style='color: blue;'>some text</p>" + "</body>"; + + m_mainFrame->setHtml(html2); + p = m_mainFrame->documentElement().findAll("p").at(0); + + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue")); + + QString html3 = "<head>" + "<style type='text/css'>" + "p { color: green !important }" + "#idP { color: red !important}" + ".classP { color: yellow !important}" + "</style>" + "</head>" + "<body>" + "<p id='idP' class='classP' style='color: blue !important;'>some text</p>" + "</body>"; + + m_mainFrame->setHtml(html3); + p = m_mainFrame->documentElement().findAll("p").at(0); + + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue")); + + QString html5 = "<head>" + "<style type='text/css'>" + "p { color: green }" + "#idP { color: red }" + ".classP { color: yellow }" + "</style>" + "</head>" + "<body>" + "<p id='idP' class='classP'>some text</p>" + "</body>"; + + m_mainFrame->setHtml(html5); + p = m_mainFrame->documentElement().findAll("p").at(0); + + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red")); + + QString html6 = "<head>" + "<link rel='stylesheet' href='qrc:/style.css' type='text/css' />" + "<style type='text/css'>" + "p { color: green }" + "#idP { color: red }" + ".classP { color: yellow ! important}" + "</style>" + "</head>" + "<body>" + "<p id='idP' class='classP' style='color: blue;'>some text</p>" + "</body>"; + + // in few seconds, the CSS should be completey loaded + m_mainFrame->setHtml(html6); + waitForSignal(m_page, SIGNAL(loadFinished(bool)), 200); + + p = m_mainFrame->documentElement().findAll("p").at(0); + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black")); + + QString html7 = "<head>" + "<style type='text/css'>" + "@import url(qrc:/style2.css);" + "</style>" + "<link rel='stylesheet' href='qrc:/style.css' type='text/css' />" + "</head>" + "<body>" + "<p id='idP' style='color: blue;'>some text</p>" + "</body>"; + + // in few seconds, the style should be completey loaded + m_mainFrame->setHtml(html7); + waitForSignal(m_page, SIGNAL(loadFinished(bool)), 200); + + p = m_mainFrame->documentElement().findAll("p").at(0); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black")); + + QString html8 = "<body><p>some text</p></body>"; + + m_mainFrame->setHtml(html8); + p = m_mainFrame->documentElement().findAll("p").at(0); + + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("")); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("")); +} + +void tst_QWebElement::computedStyle() +{ + QString html = "<body><p>some text</p></body>"; + m_mainFrame->setHtml(html); + + QWebElement p = m_mainFrame->documentElement().findAll("p").at(0); + QCOMPARE(p.styleProperty("cursor", QWebElement::ComputedStyle), QLatin1String("auto")); + QVERIFY(!p.styleProperty("cursor", QWebElement::ComputedStyle).isEmpty()); + QVERIFY(p.styleProperty("cursor", QWebElement::InlineStyle).isEmpty()); + + p.setStyleProperty("cursor", "text"); + p.setStyleProperty("color", "red"); + + QCOMPARE(p.styleProperty("cursor", QWebElement::ComputedStyle), QLatin1String("text")); + QCOMPARE(p.styleProperty("color", QWebElement::ComputedStyle), QLatin1String("rgb(255, 0, 0)")); + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("red")); +} + +void tst_QWebElement::appendAndPrepend() +{ + QString html = "<body>" + "<p>" + "foo" + "</p>" + "<p>" + "bar" + "</p>" + "</body>"; + + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement().findFirst("body"); + + QCOMPARE(body.findAll("p").count(), 2); + body.appendInside(body.findFirst("p")); + QCOMPARE(body.findAll("p").count(), 2); + QCOMPARE(body.findFirst("p").toPlainText(), QString("bar")); + QCOMPARE(body.findAll("p").last().toPlainText(), QString("foo")); + + body.appendInside(body.findFirst("p").clone()); + QCOMPARE(body.findAll("p").count(), 3); + QCOMPARE(body.findFirst("p").toPlainText(), QString("bar")); + QCOMPARE(body.findAll("p").last().toPlainText(), QString("bar")); + + body.prependInside(body.findAll("p").at(1).clone()); + QCOMPARE(body.findAll("p").count(), 4); + QCOMPARE(body.findFirst("p").toPlainText(), QString("foo")); + + body.findFirst("p").appendInside("<div>booyakasha</div>"); + QCOMPARE(body.findAll("p div").count(), 1); + QCOMPARE(body.findFirst("p div").toPlainText(), QString("booyakasha")); + + body.findFirst("div").prependInside("<code>yepp</code>"); + QCOMPARE(body.findAll("p div code").count(), 1); + QCOMPARE(body.findFirst("p div code").toPlainText(), QString("yepp")); +} + +void tst_QWebElement::insertBeforeAndAfter() +{ + QString html = "<body>" + "<p>" + "foo" + "</p>" + "<div>" + "yeah" + "</div>" + "<p>" + "bar" + "</p>" + "</body>"; + + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement().findFirst("body"); + QWebElement div = body.findFirst("div"); + + QCOMPARE(body.findAll("p").count(), 2); + QCOMPARE(body.findAll("div").count(), 1); + + div.prependOutside(body.findAll("p").last().clone()); + QCOMPARE(body.findAll("p").count(), 3); + QCOMPARE(body.findAll("p").at(0).toPlainText(), QString("foo")); + QCOMPARE(body.findAll("p").at(1).toPlainText(), QString("bar")); + QCOMPARE(body.findAll("p").at(2).toPlainText(), QString("bar")); + + div.appendOutside(body.findFirst("p").clone()); + QCOMPARE(body.findAll("p").count(), 4); + QCOMPARE(body.findAll("p").at(0).toPlainText(), QString("foo")); + QCOMPARE(body.findAll("p").at(1).toPlainText(), QString("bar")); + QCOMPARE(body.findAll("p").at(2).toPlainText(), QString("foo")); + QCOMPARE(body.findAll("p").at(3).toPlainText(), QString("bar")); + + div.prependOutside("<span>hey</span>"); + QCOMPARE(body.findAll("span").count(), 1); + + div.appendOutside("<span>there</span>"); + QCOMPARE(body.findAll("span").count(), 2); + QCOMPARE(body.findAll("span").at(0).toPlainText(), QString("hey")); + QCOMPARE(body.findAll("span").at(1).toPlainText(), QString("there")); +} + +void tst_QWebElement::remove() +{ + QString html = "<body>" + "<p>" + "foo" + "</p>" + "<div>" + "<p>yeah</p>" + "</div>" + "<p>" + "bar" + "</p>" + "</body>"; + + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement().findFirst("body"); + + QCOMPARE(body.findAll("div").count(), 1); + QCOMPARE(body.findAll("p").count(), 3); + + QWebElement div = body.findFirst("div"); + div.takeFromDocument(); + + QCOMPARE(div.isNull(), false); + QCOMPARE(body.findAll("div").count(), 0); + QCOMPARE(body.findAll("p").count(), 2); + + body.appendInside(div); + + QCOMPARE(body.findAll("div").count(), 1); + QCOMPARE(body.findAll("p").count(), 3); +} + +void tst_QWebElement::clear() +{ + QString html = "<body>" + "<p>" + "foo" + "</p>" + "<div>" + "<p>yeah</p>" + "</div>" + "<p>" + "bar" + "</p>" + "</body>"; + + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement().findFirst("body"); + + QCOMPARE(body.findAll("div").count(), 1); + QCOMPARE(body.findAll("p").count(), 3); + body.findFirst("div").removeAllChildren(); + QCOMPARE(body.findAll("div").count(), 1); + QCOMPARE(body.findAll("p").count(), 2); +} + + +void tst_QWebElement::replaceWith() +{ + QString html = "<body>" + "<p>" + "foo" + "</p>" + "<div>" + "yeah" + "</div>" + "<p>" + "<span>haba</span>" + "</p>" + "</body>"; + + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement().findFirst("body"); + + QCOMPARE(body.findAll("div").count(), 1); + QCOMPARE(body.findAll("span").count(), 1); + body.findFirst("div").replace(body.findFirst("span").clone()); + QCOMPARE(body.findAll("div").count(), 0); + QCOMPARE(body.findAll("span").count(), 2); + QCOMPARE(body.findAll("p").count(), 2); + + body.findFirst("span").replace("<p><code>wow</code></p>"); + QCOMPARE(body.findAll("p").count(), 3); + QCOMPARE(body.findAll("p code").count(), 1); + QCOMPARE(body.findFirst("p code").toPlainText(), QString("wow")); +} + +void tst_QWebElement::encloseContentsWith() +{ + QString html = "<body>" + "<div>" + "<i>" + "yeah" + "</i>" + "<i>" + "hello" + "</i>" + "</div>" + "<p>" + "<span>foo</span>" + "<span>bar</span>" + "</p>" + "<u></u>" + "<b></b>" + "<em>hey</em>" + "</body>"; + + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement().findFirst("body"); + + body.findFirst("p").encloseContentsWith(body.findFirst("b")); + QCOMPARE(body.findAll("p b span").count(), 2); + QCOMPARE(body.findFirst("p b span").toPlainText(), QString("foo")); + + body.findFirst("u").encloseContentsWith("<i></i>"); + QCOMPARE(body.findAll("u i").count(), 1); + QCOMPARE(body.findFirst("u i").toPlainText(), QString()); + + body.findFirst("div").encloseContentsWith("<span></span>"); + QCOMPARE(body.findAll("div span i").count(), 2); + QCOMPARE(body.findFirst("div span i").toPlainText(), QString("yeah")); + + QString snippet = "" + "<table>" + "<tbody>" + "<tr>" + "<td></td>" + "<td></td>" + "</tr>" + "<tr>" + "<td></td>" + "<td></td>" + "<tr>" + "</tbody>" + "</table>"; + + body.findFirst("em").encloseContentsWith(snippet); + QCOMPARE(body.findFirst("em table tbody tr td").toPlainText(), QString("hey")); +} + +void tst_QWebElement::encloseWith() +{ + QString html = "<body>" + "<p>" + "foo" + "</p>" + "<div>" + "yeah" + "</div>" + "<p>" + "<span>bar</span>" + "</p>" + "<em>hey</em>" + "<h1>hello</h1>" + "</body>"; + + m_mainFrame->setHtml(html); + QWebElement body = m_mainFrame->documentElement().findFirst("body"); + + body.findFirst("p").encloseWith("<br>"); + QCOMPARE(body.findAll("br").count(), 0); + + QCOMPARE(body.findAll("div").count(), 1); + body.findFirst("div").encloseWith(body.findFirst("span").clone()); + QCOMPARE(body.findAll("div").count(), 1); + QCOMPARE(body.findAll("span").count(), 2); + QCOMPARE(body.findAll("p").count(), 2); + + body.findFirst("div").encloseWith("<code></code>"); + QCOMPARE(body.findAll("code").count(), 1); + QCOMPARE(body.findAll("code div").count(), 1); + QCOMPARE(body.findFirst("code div").toPlainText(), QString("yeah")); + + QString snippet = "" + "<table>" + "<tbody>" + "<tr>" + "<td></td>" + "<td></td>" + "</tr>" + "<tr>" + "<td></td>" + "<td></td>" + "<tr>" + "</tbody>" + "</table>"; + + body.findFirst("em").encloseWith(snippet); + QCOMPARE(body.findFirst("table tbody tr td em").toPlainText(), QString("hey")); +} + +void tst_QWebElement::nullSelect() +{ + m_mainFrame->setHtml("<body><p>Test"); + + QWebElementCollection collection = m_mainFrame->findAllElements("invalid{syn(tax;;%#$f223e>>"); + QVERIFY(collection.count() == 0); +} + +void tst_QWebElement::firstChildNextSibling() +{ + m_mainFrame->setHtml("<body><!--comment--><p>Test</p><!--another comment--><table>"); + + QWebElement body = m_mainFrame->findFirstElement("body"); + QVERIFY(!body.isNull()); + QWebElement p = body.firstChild(); + QVERIFY(!p.isNull()); + QCOMPARE(p.tagName(), QString("P")); + QWebElement table = p.nextSibling(); + QVERIFY(!table.isNull()); + QCOMPARE(table.tagName(), QString("TABLE")); + QVERIFY(table.nextSibling().isNull()); +} + +void tst_QWebElement::lastChildPreviousSibling() +{ + m_mainFrame->setHtml("<body><!--comment--><p>Test</p><!--another comment--><table>"); + + QWebElement body = m_mainFrame->findFirstElement("body"); + QVERIFY(!body.isNull()); + QWebElement table = body.lastChild(); + QVERIFY(!table.isNull()); + QCOMPARE(table.tagName(), QString("TABLE")); + QWebElement p = table.previousSibling(); + QVERIFY(!p.isNull()); + QCOMPARE(p.tagName(), QString("P")); + QVERIFY(p.previousSibling().isNull()); +} + +void tst_QWebElement::hasSetFocus() +{ + m_mainFrame->setHtml("<html><body>" \ + "<input type='text' id='input1'/>" \ + "<br>"\ + "<input type='text' id='input2'/>" \ + "</body></html>"); + + QWebElementCollection inputs = m_mainFrame->documentElement().findAll("input"); + QWebElement input1 = inputs.at(0); + input1.setFocus(); + QVERIFY(input1.hasFocus()); + + QWebElement input2 = inputs.at(1); + input2.setFocus(); + QVERIFY(!input1.hasFocus()); + QVERIFY(input2.hasFocus()); +} + +void tst_QWebElement::render() +{ + QString html( "<html>" + "<head><style>" + "body, iframe { margin: 0px; border: none; }" + "</style></head>" + "<body><table width='300px' height='300px' border='1'>" + "<tr>" + "<td>test" + "</td>" + "<td><img src='qrc:///image.png'>" + "</td>" + "</tr>" + "</table>" + "</body>" + "</html>" + ); + + QWebPage page; + QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool))); + page.mainFrame()->setHtml(html); + + waitForSignal(&page, SIGNAL(loadFinished(bool))); + QCOMPARE(loadSpy.count(), 1); + + QSize size = page.mainFrame()->contentsSize(); + page.setViewportSize(size); + + QWebElementCollection imgs = page.mainFrame()->findAllElements("img"); + QCOMPARE(imgs.count(), 1); + + QImage resource(":/image.png"); + QRect imageRect(0, 0, resource.width(), resource.height()); + + QImage testImage(resource.width(), resource.height(), QImage::Format_ARGB32); + QPainter painter0(&testImage); + painter0.fillRect(imageRect, Qt::white); + // render() uses pixmaps internally, and pixmaps might have bit depths + // other than 32, giving different pixel values due to rounding. + QPixmap pix = QPixmap::fromImage(resource); + painter0.drawPixmap(0, 0, pix); + painter0.end(); + + QImage image1(resource.width(), resource.height(), QImage::Format_ARGB32); + QPainter painter1(&image1); + painter1.fillRect(imageRect, Qt::white); + imgs[0].render(&painter1); + painter1.end(); + + QVERIFY(image1 == testImage); + + // render image 2nd time to make sure that cached rendering works fine + QImage image2(resource.width(), resource.height(), QImage::Format_ARGB32); + QPainter painter2(&image2); + painter2.fillRect(imageRect, Qt::white); + imgs[0].render(&painter2); + painter2.end(); + + QVERIFY(image2 == testImage); + + // compare table rendered through QWebElement::render to whole page table rendering + QRect tableRect(0, 0, 300, 300); + QWebElementCollection tables = page.mainFrame()->findAllElements("table"); + QCOMPARE(tables.count(), 1); + + QImage image3(300, 300, QImage::Format_ARGB32); + QPainter painter3(&image3); + painter3.fillRect(tableRect, Qt::white); + tables[0].render(&painter3); + painter3.end(); + + QImage image4(300, 300, QImage::Format_ARGB32); + QPainter painter4(&image4); + page.mainFrame()->render(&painter4, tableRect); + painter4.end(); + + QVERIFY(image3 == image4); +} + +void tst_QWebElement::addElementToHead() +{ + m_mainFrame->setHtml("<html><head></head><body></body></html>"); + QWebElement head = m_mainFrame->findFirstElement("head"); + QVERIFY(!head.isNull()); + QString append = "<script type=\"text/javascript\">var t = 0;</script>"; + head.appendInside(append); + QCOMPARE(head.toInnerXml(), append); +} + +QTEST_MAIN(tst_QWebElement) +#include "tst_qwebelement.moc" diff --git a/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc new file mode 100644 index 0000000..7384c76 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc @@ -0,0 +1,7 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/"> +<file alias="style.css">resources/style.css</file> +<file alias="style2.css">resources/style2.css</file> +<file alias="image.png">resources/image.png</file> +</qresource> +</RCC> diff --git a/Source/WebKit/qt/tests/qwebframe/qwebframe.pro b/Source/WebKit/qt/tests/qwebframe/qwebframe.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/qwebframe.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebframe/resources/image.png b/Source/WebKit/qt/tests/qwebframe/resources/image.png Binary files differnew file mode 100644 index 0000000..8d70364 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/resources/image.png diff --git a/Source/WebKit/qt/tests/qwebframe/resources/style.css b/Source/WebKit/qt/tests/qwebframe/resources/style.css new file mode 100644 index 0000000..c05b747 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/resources/style.css @@ -0,0 +1 @@ +#idP {color: red !important} diff --git a/Source/WebKit/qt/tests/qwebframe/resources/test1.html b/Source/WebKit/qt/tests/qwebframe/resources/test1.html new file mode 100644 index 0000000..b323f96 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/resources/test1.html @@ -0,0 +1 @@ +<html><body><p>Some text 1</p></body></html> diff --git a/Source/WebKit/qt/tests/qwebframe/resources/test2.html b/Source/WebKit/qt/tests/qwebframe/resources/test2.html new file mode 100644 index 0000000..63ac1f6 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/resources/test2.html @@ -0,0 +1 @@ +<html><body> <p>Some text 2</p></body></html> diff --git a/Source/WebKit/qt/tests/qwebframe/resources/testiframe.html b/Source/WebKit/qt/tests/qwebframe/resources/testiframe.html new file mode 100644 index 0000000..203d3d3 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/resources/testiframe.html @@ -0,0 +1,54 @@ +</html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+<!--
+#header {
+ background: #0f0;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 800px;
+ height: 100px;
+}
+#content1 {
+ background: #ff0;
+ position: absolute;
+ top: 101px;
+ left: 0px;
+ width: 400px;
+ height: 400px;
+ overflow: scroll;
+}
+#content2 {
+ background: #ff7;
+ position: absolute;
+ top: 101px;
+ left: 401px;
+ width: 400px;
+ height: 400px;
+}
+#footer {
+ background: #0f0;
+ position: absolute;
+ top: 502px;
+ left: 0px;
+ width: 800px;
+ height: 200px;
+}
+-->
+</style>
+</head>
+<body>
+<div id="header"></div>
+<div id="content1">You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.</div>
+<iframe id="content2" name="control" src="testiframe2.html"> </iframe>
+<div id="footer"></div>
+</body>
+</html>
\ No newline at end of file diff --git a/Source/WebKit/qt/tests/qwebframe/resources/testiframe2.html b/Source/WebKit/qt/tests/qwebframe/resources/testiframe2.html new file mode 100644 index 0000000..0d3a22f --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/resources/testiframe2.html @@ -0,0 +1,21 @@ +</html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+<!--
+#content {
+ background: #fff;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 800px;
+ height: 800px;
+}
+-->
+</style>
+</head>
+<body>
+<div id="content"> </div>
+</body>
+</html>
\ No newline at end of file diff --git a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp new file mode 100644 index 0000000..6b0b58d --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -0,0 +1,3261 @@ +/* + 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 <qwebelement.h> +#include <qwidget.h> +#include <qwebview.h> +#include <qwebframe.h> +#include <qwebhistory.h> +#include <QAbstractItemView> +#include <QApplication> +#include <QComboBox> +#include <QPaintEngine> +#include <QPicture> +#include <QRegExp> +#include <QNetworkRequest> +#include <QNetworkReply> +#include <QTextCodec> +#ifndef QT_NO_OPENSSL +#include <qsslerror.h> +#endif +#include "../util.h" + +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(QVariantMap variantMapProperty READ variantMapProperty WRITE setVariantMapProperty) + 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_PROPERTY(QWebElement webElementProperty READ webElementProperty WRITE setWebElementProperty) + Q_PROPERTY(QObject* objectStarProperty READ objectStarProperty WRITE setObjectStarProperty) + 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_objectStar(0), + m_qtFunctionInvoked(-1) + { + m_variantMapValue.insert("a", QVariant(123)); + m_variantMapValue.insert("b", QVariant(QLatin1String("foo"))); + m_variantMapValue.insert("c", QVariant::fromValue<QObject*>(this)); + } + + ~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; + } + + QVariantMap variantMapProperty() const { + return m_variantMapValue; + } + void setVariantMapProperty(const QVariantMap &value) { + m_variantMapValue = 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; + } + + QWebElement webElementProperty() const { + return m_webElement; + } + + void setWebElementProperty(const QWebElement& element) { + m_webElement = element; + } + + CustomType propWithCustomType() const { + return m_customType; + } + void setPropWithCustomType(const CustomType &c) { + m_customType = c; + } + + QObject* objectStarProperty() const { + return m_objectStar; + } + + void setObjectStarProperty(QObject* object) { + m_objectStar = object; + } + + + 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 myOverloadedSlot(const QWebElement &arg) { + m_qtFunctionInvoked = 36; + m_actuals << QVariant::fromValue<QWebElement>(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; + QVariantMap m_variantMapValue; + QString m_stringValue; + QStringList m_stringListValue; + QByteArray m_byteArrayValue; + QBrush m_brushValue; + double m_hiddenValue; + int m_writeOnlyValue; + int m_readOnlyValue; + QKeySequence m_shortcut; + QWebElement m_webElement; + CustomType m_customType; + QObject* m_objectStar; + 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 arrayObjectEnumerable(); + void symmetricUrl(); + void progressSignal(); + void urlChange(); + void domCycles(); + void requestedUrl(); + void javaScriptWindowObjectCleared_data(); + void javaScriptWindowObjectCleared(); + void javaScriptWindowObjectClearedOnEvaluate(); + void setHtml(); + void setHtmlWithResource(); + void setHtmlWithBaseURL(); + void setHtmlWithJSAlert(); + void ipv6HostEncoding(); + void metaData(); +#if !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_COMBOBOX) + // as maemo 5 && symbian do not use QComboBoxes to implement the popups + // this test does not make sense for it. + void popupFocus(); +#endif + void inputFieldFocus(); + void hitTestContent(); + void jsByteArray(); + void ownership(); + void nullValue(); + void baseUrl_data(); + void baseUrl(); + void hasSetFocus(); + void render(); + void renderHints(); + void scrollPosition(); + void scrollToAnchor(); + void scrollbarsOff(); + void evaluateWillCauseRepaint(); + void qObjectWrapperWithSameIdentity(); + void introspectQtMethods_data(); + void introspectQtMethods(); + void setContent_data(); + void setContent(); + void setCacheLoadControlAttribute(); + +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_inputFieldsTestView; + int m_inputFieldTestPaintCount; +}; + +tst_QWebFrame::tst_QWebFrame() + : sTrue("true"), sFalse("false"), sUndefined("undefined"), sArray("array"), sFunction("function"), sError("error"), + sString("string"), sObject("object"), sNumber("number"), m_inputFieldsTestView(0), m_inputFieldTestPaintCount(0) +{ +} + +tst_QWebFrame::~tst_QWebFrame() +{ +} + +bool tst_QWebFrame::eventFilter(QObject* watched, QEvent* event) +{ + // used on the inputFieldFocus test + if (watched == m_inputFieldsTestView) { + if (event->type() == QEvent::Paint) + m_inputFieldTestPaintCount++; + } + 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() +{ + m_page->mainFrame()->setHtml("<html><head><body></body></html>"); + 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.variantMapProperty", type); + QCOMPARE(type, sObject); + QCOMPARE(ret.type(), QVariant::Map); + QVariantMap vm = ret.value<QVariantMap>(); + QCOMPARE(vm.size(), 3); + QCOMPARE(vm.value("a").toInt(), 123); + QCOMPARE(vm.value("b").toString(), QLatin1String("foo")); + QCOMPARE(vm.value("c").value<QObject*>(), static_cast<QObject*>(m_myObject)); + } + QCOMPARE(evalJS("myObject.variantMapProperty.a === 123"), sTrue); + QCOMPARE(evalJS("myObject.variantMapProperty.b === 'foo'"), sTrue); + QCOMPARE(evalJS("myObject.variantMapProperty.c.variantMapProperty.b === '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")); + evalJS("myObject.webElementProperty=document.body;"); + QCOMPARE(evalJS("myObject.webElementProperty.tagName"), QLatin1String("BODY")); + + // 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); + + // QObject* property + m_myObject->setObjectStarProperty(0); + QCOMPARE(m_myObject->objectStarProperty(), (QObject*)0); + QCOMPARE(evalJS("myObject.objectStarProperty == null"), sTrue); + QCOMPARE(evalJS("typeof myObject.objectStarProperty"), sObject); + QCOMPARE(evalJS("Boolean(myObject.objectStarProperty)"), sFalse); + QCOMPARE(evalJS("String(myObject.objectStarProperty) == 'null'"), sTrue); + QCOMPARE(evalJS("myObject.objectStarProperty.objectStarProperty"), + sUndefined); + m_myObject->setObjectStarProperty(this); + QCOMPARE(evalJS("myObject.objectStarProperty != null"), sTrue); + QCOMPARE(evalJS("typeof myObject.objectStarProperty"), sObject); + QCOMPARE(evalJS("Boolean(myObject.objectStarProperty)"), sTrue); + QCOMPARE(evalJS("String(myObject.objectStarProperty) != 'null'"), sTrue); +} + +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: '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: 'undefined' is not a function")); + } + + { + QString type; + QString ret = evalJS("(function() { }).connect(123)", type); + QCOMPARE(type, sError); + QCOMPARE(ret, QLatin1String("TypeError: '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: '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(QRegExp) + m_myObject->resetQtFunctionInvoked(); + evalJS("myObject.myOverloadedSlot(document.body)"); + QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=37319", Continue); + QCOMPARE(m_myObject->qtFunctionInvoked(), 36); + + // 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 +} + +class StringListTestObject : public QObject { + Q_OBJECT +public Q_SLOTS: + QVariant stringList() + { + return QStringList() << "Q" << "t"; + }; +}; + +void tst_QWebFrame::arrayObjectEnumerable() +{ + QWebPage page; + QWebFrame* frame = page.mainFrame(); + QObject* qobject = new StringListTestObject(); + frame->addToJavaScriptWindowObject("test", qobject, QScriptEngine::ScriptOwnership); + + const QString script("var stringArray = test.stringList();" + "var result = '';" + "for (var i in stringArray) {" + " result += stringArray[i];" + "}" + "result;"); + QCOMPARE(frame->evaluateJavaScript(script).toString(), QString::fromLatin1("Qt")); +} + +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::urlChange() +{ + QSignalSpy urlSpy(m_page->mainFrame(), SIGNAL(urlChanged(QUrl))); + + QUrl dataUrl("data:text/html,<h1>Test"); + m_view->setUrl(dataUrl); + + ::waitForSignal(m_page->mainFrame(), SIGNAL(urlChanged(QUrl))); + + QCOMPARE(urlSpy.size(), 1); + + QUrl dataUrl2("data:text/html,<html><head><title>title</title></head><body><h1>Test</body></html>"); + m_view->setUrl(dataUrl2); + + ::waitForSignal(m_page->mainFrame(), SIGNAL(urlChanged(QUrl))); + + QCOMPARE(urlSpy.size(), 2); +} + + +void tst_QWebFrame::domCycles() +{ + m_view->setHtml("<html><body>"); + QVariant v = m_page->mainFrame()->evaluateJavaScript("document"); + QVERIFY(v.type() == QVariant::Map); +} + +class FakeReply : public QNetworkReply { + Q_OBJECT + +public: + FakeReply(const QNetworkRequest& request, QObject* parent = 0) + : QNetworkReply(parent) + { + setOperation(QNetworkAccessManager::GetOperation); + setRequest(request); + if (request.url() == QUrl("qrc:/test1.html")) { + setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html")); + setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html")); + } +#ifndef QT_NO_OPENSSL + else if (request.url() == QUrl("qrc:/fake-ssl-error.html")) + setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error !")); // force a ssl error +#endif + else if (request.url() == QUrl("http://abcdef.abcdef/")) + setError(QNetworkReply::HostNotFoundError, tr("Invalid URL")); + + open(QIODevice::ReadOnly); + QTimer::singleShot(0, this, SLOT(timeout())); + } + ~FakeReply() + { + close(); + } + virtual void abort() {} + virtual void close() {} + +protected: + qint64 readData(char*, qint64) + { + return 0; + } + +private slots: + void timeout() + { + if (request().url() == QUrl("qrc://test1.html")) + emit error(this->error()); + else if (request().url() == QUrl("http://abcdef.abcdef/")) + emit metaDataChanged(); +#ifndef QT_NO_OPENSSL + else if (request().url() == QUrl("qrc:/fake-ssl-error.html")) + return; +#endif + + emit readyRead(); + emit finished(); + } +}; + +class FakeNetworkManager : public QNetworkAccessManager { + Q_OBJECT + +public: + FakeNetworkManager(QObject* parent) : QNetworkAccessManager(parent) { } + +protected: + virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData) + { + QString url = request.url().toString(); + if (op == QNetworkAccessManager::GetOperation) { + if (url == "qrc:/test1.html" || url == "http://abcdef.abcdef/") + return new FakeReply(request, this); +#ifndef QT_NO_OPENSSL + else if (url == "qrc:/fake-ssl-error.html") { + FakeReply* reply = new FakeReply(request, this); + QList<QSslError> errors; + emit sslErrors(reply, errors << QSslError(QSslError::UnspecifiedError)); + return reply; + } +#endif + } + + return QNetworkAccessManager::createRequest(op, request, outgoingData); + } +}; + +void tst_QWebFrame::requestedUrl() +{ + QWebPage page; + QWebFrame* frame = page.mainFrame(); + + // in few seconds, the image should be completely loaded + QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); + FakeNetworkManager* networkManager = new FakeNetworkManager(&page); + page.setNetworkAccessManager(networkManager); + + frame->setUrl(QUrl("qrc:/test1.html")); + waitForSignal(frame, SIGNAL(loadFinished(bool)), 200); + QCOMPARE(spy.count(), 1); + QCOMPARE(frame->requestedUrl(), QUrl("qrc:/test1.html")); + QCOMPARE(frame->url(), QUrl("qrc:/test2.html")); + + frame->setUrl(QUrl("qrc:/non-existent.html")); + waitForSignal(frame, SIGNAL(loadFinished(bool)), 200); + QCOMPARE(spy.count(), 2); + QCOMPARE(frame->requestedUrl(), QUrl("qrc:/non-existent.html")); + QCOMPARE(frame->url(), QUrl("qrc:/non-existent.html")); + + frame->setUrl(QUrl("http://abcdef.abcdef")); + waitForSignal(frame, SIGNAL(loadFinished(bool)), 200); + QCOMPARE(spy.count(), 3); + QCOMPARE(frame->requestedUrl(), QUrl("http://abcdef.abcdef/")); + QCOMPARE(frame->url(), QUrl("http://abcdef.abcdef/")); + +#ifndef QT_NO_OPENSSL + qRegisterMetaType<QList<QSslError> >("QList<QSslError>"); + qRegisterMetaType<QNetworkReply* >("QNetworkReply*"); + + QSignalSpy spy2(page.networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>))); + frame->setUrl(QUrl("qrc:/fake-ssl-error.html")); + waitForSignal(frame, SIGNAL(loadFinished(bool)), 200); + QCOMPARE(spy2.count(), 1); + QCOMPARE(frame->requestedUrl(), QUrl("qrc:/fake-ssl-error.html")); + QCOMPARE(frame->url(), QUrl("qrc:/fake-ssl-error.html")); +#endif +} + +void tst_QWebFrame::javaScriptWindowObjectCleared_data() +{ + QTest::addColumn<QString>("html"); + QTest::addColumn<int>("signalCount"); + QTest::newRow("with <script>") << "<html><body><script>i=0</script><p>hello world</p></body></html>" << 1; + // NOTE: Empty scripts no longer cause this signal to be emitted. + QTest::newRow("with empty <script>") << "<html><body><script></script><p>hello world</p></body></html>" << 0; + QTest::newRow("without <script>") << "<html><body><p>hello world</p></body></html>" << 0; +} + +void tst_QWebFrame::javaScriptWindowObjectCleared() +{ + QWebPage page; + QWebFrame* frame = page.mainFrame(); + QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared())); + QFETCH(QString, html); + frame->setHtml(html); + + QFETCH(int, signalCount); + QCOMPARE(spy.count(), signalCount); +} + +void tst_QWebFrame::javaScriptWindowObjectClearedOnEvaluate() +{ + QWebPage page; + QWebFrame* frame = page.mainFrame(); + QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared())); + frame->setHtml("<html></html>"); + QCOMPARE(spy.count(), 0); + frame->evaluateJavaScript("var a = 'a';"); + QCOMPARE(spy.count(), 1); + // no new clear for a new script: + frame->evaluateJavaScript("var a = 1;"); + QCOMPARE(spy.count(), 1); +} + +void tst_QWebFrame::setHtml() +{ + QString html("<html><head></head><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); + waitForSignal(frame, SIGNAL(loadFinished(bool)), 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); + + QString html2 = + "<html>" + "<head>" + "<link rel='stylesheet' href='qrc:/style.css' type='text/css' />" + "</head>" + "<body>" + "<p id='idP'>some text</p>" + "</body>" + "</html>"; + + // in few seconds, the CSS should be completey loaded + frame->setHtml(html2); + waitForSignal(frame, SIGNAL(loadFinished(bool)), 200); + QCOMPARE(spy.size(), 2); + + QWebElement p = frame->documentElement().findAll("p").at(0); + QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red")); +} + +void tst_QWebFrame::setHtmlWithBaseURL() +{ + if (!QDir(TESTS_SOURCE_DIR).exists()) + QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); + + QDir::setCurrent(TESTS_SOURCE_DIR); + + QString html("<html><body><p>hello world</p><img src='resources/image2.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, QUrl::fromLocalFile(TESTS_SOURCE_DIR)); + waitForSignal(frame, SIGNAL(loadFinished(bool)), 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); + + // no history item has to be added. + QCOMPARE(m_view->page()->history()->count(), 0); +} + +class MyPage : public QWebPage +{ +public: + MyPage() : QWebPage(), alerts(0) {} + int alerts; + +protected: + virtual void javaScriptAlert(QWebFrame*, const QString& msg) + { + alerts++; + QCOMPARE(msg, QString("foo")); + // Should not be enough to trigger deferred loading, since we've upped the HTML + // tokenizer delay in the Qt frameloader. See HTMLTokenizer::continueProcessing() + QTest::qWait(1000); + } +}; + +void tst_QWebFrame::setHtmlWithJSAlert() +{ + QString html("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>"); + MyPage page; + m_view->setPage(&page); + page.mainFrame()->setHtml(html); + QCOMPARE(page.alerts, 1); + QCOMPARE(m_view->page()->mainFrame()->toHtml(), html); +} + +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()); +} + +#if !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_COMBOBOX) +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); + // Call setFocus before show to work around http://bugreports.qt.nokia.com/browse/QTBUG-14762 + view.setFocus(); + view.show(); + QTest::qWaitForWindowShown(&view); + view.activateWindow(); + QTRY_VERIFY(view.hasFocus()); + + // open the popup by clicking. check if focus is on the popup + const QWebElement webCombo = view.page()->mainFrame()->documentElement().findFirst(QLatin1String("select[name=select]")); + QTest::mouseClick(&view, Qt::LeftButton, 0, webCombo.geometry().center()); + QObject* webpopup = firstChildByClassName(&view, "QComboBox"); + QComboBox* combo = qobject_cast<QComboBox*>(webpopup); + QVERIFY(combo != 0); + QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup + + // hide the popup and check if focus is on the page + combo->hidePopup(); + QTRY_VERIFY(view.hasFocus()); // Focus should be back on the WebView +} +#endif + +void tst_QWebFrame::inputFieldFocus() +{ + QWebView view; + view.setHtml("<html><body><input type=\"text\"></input></body></html>"); + view.resize(400, 100); + view.show(); + QTest::qWaitForWindowShown(&view); + view.activateWindow(); + view.setFocus(); + QTRY_VERIFY(view.hasFocus()); + + // double the flashing time, should at least blink once already + int delay = qApp->cursorFlashTime() * 2; + + // focus the lineedit and check if it blinks + const QWebElement inputElement = view.page()->mainFrame()->documentElement().findFirst(QLatin1String("input[type=text]")); + QTest::mouseClick(&view, Qt::LeftButton, 0, inputElement.geometry().center()); + m_inputFieldsTestView = &view; + view.installEventFilter( this ); + QTest::qWait(delay); + QVERIFY2(m_inputFieldTestPaintCount >= 3, + "The input field should have a blinking caret"); +} + +void tst_QWebFrame::hitTestContent() +{ + QString html("<html><body><p>A paragraph</p><br/><br/><br/><a href=\"about:blank\" target=\"_foo\" id=\"link\">link text</a></body></html>"); + + QWebPage page; + QWebFrame* frame = page.mainFrame(); + frame->setHtml(html); + page.setViewportSize(QSize(200, 0)); //no height so link is not visible + const QWebElement linkElement = frame->documentElement().findFirst(QLatin1String("a#link")); + QWebHitTestResult result = frame->hitTestContent(linkElement.geometry().center()); + QCOMPARE(result.linkText(), QString("link text")); + QWebElement link = result.linkElement(); + QCOMPARE(link.attribute("target"), QString("_foo")); +} + +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; + } +} + +void tst_QWebFrame::nullValue() +{ + QVariant v = m_view->page()->mainFrame()->evaluateJavaScript("null"); + QVERIFY(v.isNull()); +} + +void tst_QWebFrame::baseUrl_data() +{ + QTest::addColumn<QString>("html"); + QTest::addColumn<QUrl>("loadUrl"); + QTest::addColumn<QUrl>("url"); + QTest::addColumn<QUrl>("baseUrl"); + + QTest::newRow("null") << QString() << QUrl() + << QUrl("about:blank") << QUrl("about:blank"); + + QTest::newRow("foo") << QString() << QUrl("http://foobar.baz/") + << QUrl("http://foobar.baz/") << QUrl("http://foobar.baz/"); + + QString html = "<html>" + "<head>" + "<base href=\"http://foobaz.bar/\" />" + "</head>" + "</html>"; + QTest::newRow("customBaseUrl") << html << QUrl("http://foobar.baz/") + << QUrl("http://foobar.baz/") << QUrl("http://foobaz.bar/"); +} + +void tst_QWebFrame::baseUrl() +{ + QFETCH(QString, html); + QFETCH(QUrl, loadUrl); + QFETCH(QUrl, url); + QFETCH(QUrl, baseUrl); + + m_page->mainFrame()->setHtml(html, loadUrl); + QCOMPARE(m_page->mainFrame()->url(), url); + QCOMPARE(m_page->mainFrame()->baseUrl(), baseUrl); +} + +void tst_QWebFrame::hasSetFocus() +{ + QString html("<html><body><p>top</p>" \ + "<iframe width='80%' height='30%'/>" \ + "</body></html>"); + + QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool))); + m_page->mainFrame()->setHtml(html); + + waitForSignal(m_page->mainFrame(), SIGNAL(loadFinished(bool)), 200); + QCOMPARE(loadSpy.size(), 1); + + QList<QWebFrame*> children = m_page->mainFrame()->childFrames(); + QWebFrame* frame = children.at(0); + QString innerHtml("<html><body><p>another iframe</p>" \ + "<iframe width='80%' height='30%'/>" \ + "</body></html>"); + frame->setHtml(innerHtml); + + waitForSignal(frame, SIGNAL(loadFinished(bool)), 200); + QCOMPARE(loadSpy.size(), 2); + + m_page->mainFrame()->setFocus(); + QTRY_VERIFY(m_page->mainFrame()->hasFocus()); + + for (int i = 0; i < children.size(); ++i) { + children.at(i)->setFocus(); + QTRY_VERIFY(children.at(i)->hasFocus()); + QVERIFY(!m_page->mainFrame()->hasFocus()); + } + + m_page->mainFrame()->setFocus(); + QTRY_VERIFY(m_page->mainFrame()->hasFocus()); +} + +void tst_QWebFrame::render() +{ + QString html("<html>" \ + "<head><style>" \ + "body, iframe { margin: 0px; border: none; }" \ + "</style></head>" \ + "<body><iframe width='100px' height='100px'/></body>" \ + "</html>"); + + QWebPage page; + page.mainFrame()->setHtml(html); + + QList<QWebFrame*> frames = page.mainFrame()->childFrames(); + QWebFrame *frame = frames.at(0); + QString innerHtml("<body style='margin: 0px;'><img src='qrc:/image.png'/></body>"); + frame->setHtml(innerHtml); + + QPicture picture; + + QSize size = page.mainFrame()->contentsSize(); + page.setViewportSize(size); + + // render contents layer only (the iframe is smaller than the image, so it will have scrollbars) + QPainter painter1(&picture); + frame->render(&painter1, QWebFrame::ContentsLayer); + painter1.end(); + + QCOMPARE(size.width(), picture.boundingRect().width() + frame->scrollBarGeometry(Qt::Vertical).width()); + QCOMPARE(size.height(), picture.boundingRect().height() + frame->scrollBarGeometry(Qt::Horizontal).height()); + + // render everything, should be the size of the iframe + QPainter painter2(&picture); + frame->render(&painter2, QWebFrame::AllLayers); + painter2.end(); + + QCOMPARE(size.width(), picture.boundingRect().width()); // width: 100px + QCOMPARE(size.height(), picture.boundingRect().height()); // height: 100px +} + + +class DummyPaintEngine: public QPaintEngine { +public: + + DummyPaintEngine() + : QPaintEngine(QPaintEngine::AllFeatures) + , renderHints(0) + { + } + + bool begin(QPaintDevice*) + { + setActive(true); + return true; + } + + bool end() + { + setActive(false); + return false; + } + + void updateState(const QPaintEngineState& state) + { + renderHints = state.renderHints(); + } + + void drawPath(const QPainterPath&) { } + void drawPixmap(const QRectF&, const QPixmap&, const QRectF&) { } + + QPaintEngine::Type type() const + { + return static_cast<QPaintEngine::Type>(QPaintEngine::User + 2); + } + + QPainter::RenderHints renderHints; +}; + +class DummyPaintDevice: public QPaintDevice { +public: + DummyPaintDevice() + : QPaintDevice() + , m_engine(new DummyPaintEngine) + { + } + + ~DummyPaintDevice() + { + delete m_engine; + } + + QPaintEngine* paintEngine() const + { + return m_engine; + } + + QPainter::RenderHints renderHints() const + { + return m_engine->renderHints; + } + +protected: + int metric(PaintDeviceMetric metric) const; + +private: + DummyPaintEngine* m_engine; + friend class DummyPaintEngine; +}; + + +int DummyPaintDevice::metric(PaintDeviceMetric metric) const +{ + switch (metric) { + case PdmWidth: + return 400; + break; + + case PdmHeight: + return 200; + break; + + case PdmNumColors: + return INT_MAX; + break; + + case PdmDepth: + return 32; + break; + + default: + break; + } + return 0; +} + +void tst_QWebFrame::renderHints() +{ + QString html("<html><body><p>Hello, world!</p></body></html>"); + + QWebPage page; + page.mainFrame()->setHtml(html); + page.setViewportSize(page.mainFrame()->contentsSize()); + + // We will call frame->render and trap the paint engine state changes + // to ensure that GraphicsContext does not clobber the render hints. + DummyPaintDevice buffer; + QPainter painter(&buffer); + + painter.setRenderHint(QPainter::TextAntialiasing, false); + page.mainFrame()->render(&painter); + QVERIFY(!(buffer.renderHints() & QPainter::TextAntialiasing)); + QVERIFY(!(buffer.renderHints() & QPainter::SmoothPixmapTransform)); + QVERIFY(!(buffer.renderHints() & QPainter::HighQualityAntialiasing)); + + painter.setRenderHint(QPainter::TextAntialiasing, true); + page.mainFrame()->render(&painter); + QVERIFY(buffer.renderHints() & QPainter::TextAntialiasing); + QVERIFY(!(buffer.renderHints() & QPainter::SmoothPixmapTransform)); + QVERIFY(!(buffer.renderHints() & QPainter::HighQualityAntialiasing)); + + painter.setRenderHint(QPainter::SmoothPixmapTransform, true); + page.mainFrame()->render(&painter); + QVERIFY(buffer.renderHints() & QPainter::TextAntialiasing); + QVERIFY(buffer.renderHints() & QPainter::SmoothPixmapTransform); + QVERIFY(!(buffer.renderHints() & QPainter::HighQualityAntialiasing)); + + painter.setRenderHint(QPainter::HighQualityAntialiasing, true); + page.mainFrame()->render(&painter); + QVERIFY(buffer.renderHints() & QPainter::TextAntialiasing); + QVERIFY(buffer.renderHints() & QPainter::SmoothPixmapTransform); + QVERIFY(buffer.renderHints() & QPainter::HighQualityAntialiasing); +} + +void tst_QWebFrame::scrollPosition() +{ + // enlarged image in a small viewport, to provoke the scrollbars to appear + QString html("<html><body><img src='qrc:/image.png' height=500 width=500/></body></html>"); + + QWebPage page; + page.setViewportSize(QSize(200, 200)); + + QWebFrame* frame = page.mainFrame(); + frame->setHtml(html); + frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); + frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); + + // try to set the scroll offset programmatically + frame->setScrollPosition(QPoint(23, 29)); + QCOMPARE(frame->scrollPosition().x(), 23); + QCOMPARE(frame->scrollPosition().y(), 29); + + int x = frame->evaluateJavaScript("window.scrollX").toInt(); + int y = frame->evaluateJavaScript("window.scrollY").toInt(); + QCOMPARE(x, 23); + QCOMPARE(y, 29); +} + +void tst_QWebFrame::scrollToAnchor() +{ + QWebPage page; + page.setViewportSize(QSize(480, 800)); + QWebFrame* frame = page.mainFrame(); + + QString html("<html><body><p style=\"margin-bottom: 1500px;\">Hello.</p>" + "<p><a id=\"foo\">This</a> is an anchor</p>" + "<p style=\"margin-bottom: 1500px;\"><a id=\"bar\">This</a> is another anchor</p>" + "</body></html>"); + frame->setHtml(html); + frame->setScrollPosition(QPoint(0, 0)); + QCOMPARE(frame->scrollPosition().x(), 0); + QCOMPARE(frame->scrollPosition().y(), 0); + + QWebElement fooAnchor = frame->findFirstElement("a[id=foo]"); + + frame->scrollToAnchor("foo"); + QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().top()); + + frame->scrollToAnchor("bar"); + frame->scrollToAnchor("foo"); + QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().top()); + + frame->scrollToAnchor("top"); + QCOMPARE(frame->scrollPosition().y(), 0); + + frame->scrollToAnchor("bar"); + frame->scrollToAnchor("notexist"); + QVERIFY(frame->scrollPosition().y() != 0); +} + + +void tst_QWebFrame::scrollbarsOff() +{ + QWebView view; + QWebFrame* mainFrame = view.page()->mainFrame(); + + mainFrame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); + mainFrame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); + + QString html("<script>" \ + " function checkScrollbar() {" \ + " if (innerWidth === document.documentElement.offsetWidth)" \ + " document.getElementById('span1').innerText = 'SUCCESS';" \ + " else" \ + " document.getElementById('span1').innerText = 'FAIL';" \ + " }" \ + "</script>" \ + "<body>" \ + " <div style='margin-top:1000px ; margin-left:1000px'>" \ + " <a id='offscreen' href='a'>End</a>" \ + " </div>" \ + "<span id='span1'></span>" \ + "</body>"); + + + view.setHtml(html); + ::waitForSignal(&view, SIGNAL(loadFinished(bool))); + + mainFrame->evaluateJavaScript("checkScrollbar();"); + QCOMPARE(mainFrame->documentElement().findAll("span").at(0).toPlainText(), QString("SUCCESS")); +} + +void tst_QWebFrame::evaluateWillCauseRepaint() +{ + QWebView view; + QString html("<html><body>top<div id=\"junk\" style=\"display: block;\">" + "junk</div>bottom</body></html>"); + view.setHtml(html); + view.show(); + + QTest::qWaitForWindowShown(&view); + view.page()->mainFrame()->evaluateJavaScript( + "document.getElementById('junk').style.display = 'none';"); + + ::waitForSignal(view.page(), SIGNAL(repaintRequested(QRect))); +} + +class TestFactory : public QObject +{ + Q_OBJECT +public: + TestFactory() + : obj(0), counter(0) + {} + + Q_INVOKABLE QObject* getNewObject() + { + delete obj; + obj = new QObject(this); + obj->setObjectName(QLatin1String("test") + QString::number(++counter)); + return obj; + + } + + QObject* obj; + int counter; +}; + +void tst_QWebFrame::qObjectWrapperWithSameIdentity() +{ + m_view->setHtml("<script>function triggerBug() { document.getElementById('span1').innerText = test.getNewObject().objectName; }</script>" + "<body><span id='span1'>test</span></body>"); + + QWebFrame* mainFrame = m_view->page()->mainFrame(); + QCOMPARE(mainFrame->toPlainText(), QString("test")); + + mainFrame->addToJavaScriptWindowObject("test", new TestFactory, QScriptEngine::ScriptOwnership); + + mainFrame->evaluateJavaScript("triggerBug();"); + QCOMPARE(mainFrame->toPlainText(), QString("test1")); + + mainFrame->evaluateJavaScript("triggerBug();"); + QCOMPARE(mainFrame->toPlainText(), QString("test2")); +} + +void tst_QWebFrame::introspectQtMethods_data() +{ + QTest::addColumn<QString>("objectExpression"); + QTest::addColumn<QString>("methodName"); + QTest::addColumn<QStringList>("expectedPropertyNames"); + + QTest::newRow("myObject.mySignal") + << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "length" << "name"); + QTest::newRow("myObject.mySlot") + << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "length" << "name"); + QTest::newRow("myObject.myInvokable") + << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "length" << "name"); + QTest::newRow("myObject.mySignal.connect") + << "myObject.mySignal" << "connect" << (QStringList() << "length" << "name"); + QTest::newRow("myObject.mySignal.disconnect") + << "myObject.mySignal" << "disconnect" << (QStringList() << "length" << "name"); +} + +void tst_QWebFrame::introspectQtMethods() +{ + QFETCH(QString, objectExpression); + QFETCH(QString, methodName); + QFETCH(QStringList, expectedPropertyNames); + + QString methodLookup = QString::fromLatin1("%0['%1']").arg(objectExpression).arg(methodName); + QCOMPARE(evalJSV(QString::fromLatin1("Object.getOwnPropertyNames(%0).sort()").arg(methodLookup)).toStringList(), expectedPropertyNames); + + for (int i = 0; i < expectedPropertyNames.size(); ++i) { + QString name = expectedPropertyNames.at(i); + QCOMPARE(evalJS(QString::fromLatin1("%0.hasOwnProperty('%1')").arg(methodLookup).arg(name)), sTrue); + evalJS(QString::fromLatin1("var descriptor = Object.getOwnPropertyDescriptor(%0, '%1')").arg(methodLookup).arg(name)); + QCOMPARE(evalJS("typeof descriptor"), QString::fromLatin1("object")); + QCOMPARE(evalJS("descriptor.get"), sUndefined); + QCOMPARE(evalJS("descriptor.set"), sUndefined); + QCOMPARE(evalJS(QString::fromLatin1("descriptor.value === %0['%1']").arg(methodLookup).arg(name)), sTrue); + QCOMPARE(evalJS(QString::fromLatin1("descriptor.enumerable")), sFalse); + QCOMPARE(evalJS(QString::fromLatin1("descriptor.configurable")), sFalse); + } + + QVERIFY(evalJSV("var props=[]; for (var p in myObject.deleteLater) {props.push(p);}; props.sort()").toStringList().isEmpty()); +} + +void tst_QWebFrame::setContent_data() +{ + QTest::addColumn<QString>("mimeType"); + QTest::addColumn<QByteArray>("testContents"); + QTest::addColumn<QString>("expected"); + + QString str = QString::fromUtf8("ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει"); + QTest::newRow("UTF-8 plain text") << "text/plain; charset=utf-8" << str.toUtf8() << str; + + QTextCodec *utf16 = QTextCodec::codecForName("UTF-16"); + if (utf16) + QTest::newRow("UTF-16 plain text") << "text/plain; charset=utf-16" << utf16->fromUnicode(str) << str; + + str = QString::fromUtf8("Une chaîne de caractères à sa façon."); + QTest::newRow("latin-1 plain text") << "text/plain; charset=iso-8859-1" << str.toLatin1() << str; + + +} + +void tst_QWebFrame::setContent() +{ + QFETCH(QString, mimeType); + QFETCH(QByteArray, testContents); + QFETCH(QString, expected); + m_view->setContent(testContents, mimeType); + QWebFrame* mainFrame = m_view->page()->mainFrame(); + QCOMPARE(expected , mainFrame->toPlainText()); +} + +class CacheNetworkAccessManager : public QNetworkAccessManager { +public: + CacheNetworkAccessManager(QObject* parent = 0) + : QNetworkAccessManager(parent) + , m_lastCacheLoad(QNetworkRequest::PreferNetwork) + { + } + + virtual QNetworkReply* createRequest(Operation, const QNetworkRequest& request, QIODevice*) + { + QVariant cacheLoad = request.attribute(QNetworkRequest::CacheLoadControlAttribute); + if (cacheLoad.isValid()) + m_lastCacheLoad = static_cast<QNetworkRequest::CacheLoadControl>(cacheLoad.toUInt()); + else + m_lastCacheLoad = QNetworkRequest::PreferNetwork; // default value + return new FakeReply(request, this); + } + + QNetworkRequest::CacheLoadControl lastCacheLoad() const + { + return m_lastCacheLoad; + } + +private: + QNetworkRequest::CacheLoadControl m_lastCacheLoad; +}; + +void tst_QWebFrame::setCacheLoadControlAttribute() +{ + QWebPage page; + CacheNetworkAccessManager* manager = new CacheNetworkAccessManager(&page); + page.setNetworkAccessManager(manager); + QWebFrame* frame = page.mainFrame(); + + QNetworkRequest request(QUrl("http://abcdef.abcdef/")); + + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysCache); + frame->load(request); + QCOMPARE(manager->lastCacheLoad(), QNetworkRequest::AlwaysCache); + + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); + frame->load(request); + QCOMPARE(manager->lastCacheLoad(), QNetworkRequest::PreferCache); + + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); + frame->load(request); + QCOMPARE(manager->lastCacheLoad(), QNetworkRequest::AlwaysNetwork); + + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork); + frame->load(request); + QCOMPARE(manager->lastCacheLoad(), QNetworkRequest::PreferNetwork); +} + +QTEST_MAIN(tst_QWebFrame) +#include "tst_qwebframe.moc" diff --git a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc new file mode 100644 index 0000000..2a7d0b9 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc @@ -0,0 +1,10 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/"> +<file alias="image.png">resources/image.png</file> +<file alias="style.css">resources/style.css</file> +<file alias="test1.html">resources/test1.html</file> +<file alias="test2.html">resources/test2.html</file> +<file alias="testiframe.html">resources/testiframe.html</file> +<file alias="testiframe2.html">resources/testiframe2.html</file> +</qresource> +</RCC> diff --git a/Source/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/Source/WebKit/qt/tests/qwebhistory/qwebhistory.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/qwebhistory.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebhistory/resources/page1.html b/Source/WebKit/qt/tests/qwebhistory/resources/page1.html new file mode 100644 index 0000000..82fa4af --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/resources/page1.html @@ -0,0 +1 @@ +<title>page1</title><body><h1>page1</h1></body> diff --git a/Source/WebKit/qt/tests/qwebhistory/resources/page2.html b/Source/WebKit/qt/tests/qwebhistory/resources/page2.html new file mode 100644 index 0000000..5307bdc --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/resources/page2.html @@ -0,0 +1 @@ +<title>page2</title><body><h1>page2</h1></body> diff --git a/Source/WebKit/qt/tests/qwebhistory/resources/page3.html b/Source/WebKit/qt/tests/qwebhistory/resources/page3.html new file mode 100644 index 0000000..4e5547c --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/resources/page3.html @@ -0,0 +1 @@ +<title>page3</title><body><h1>page3</h1></body> diff --git a/Source/WebKit/qt/tests/qwebhistory/resources/page4.html b/Source/WebKit/qt/tests/qwebhistory/resources/page4.html new file mode 100644 index 0000000..3c57aed --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/resources/page4.html @@ -0,0 +1 @@ +<title>page4</title><body><h1>page4</h1></body> diff --git a/Source/WebKit/qt/tests/qwebhistory/resources/page5.html b/Source/WebKit/qt/tests/qwebhistory/resources/page5.html new file mode 100644 index 0000000..8593552 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/resources/page5.html @@ -0,0 +1 @@ +<title>page5</title><body><h1>page5</h1></body> diff --git a/Source/WebKit/qt/tests/qwebhistory/resources/page6.html b/Source/WebKit/qt/tests/qwebhistory/resources/page6.html new file mode 100644 index 0000000..c5bbc6f --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/resources/page6.html @@ -0,0 +1 @@ +<title>page6</title><body><h1>page6</h1></body> diff --git a/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp new file mode 100644 index 0000000..783214c --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp @@ -0,0 +1,397 @@ +/* + 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 <QAction> + +#include "qwebpage.h" +#include "qwebview.h" +#include "qwebframe.h" +#include "qwebhistory.h" +#include "qdebug.h" + +class tst_QWebHistory : public QObject +{ + Q_OBJECT + +public: + tst_QWebHistory(); + virtual ~tst_QWebHistory(); + +protected : + void loadPage(int nr) + { + frame->load(QUrl("qrc:/resources/page" + QString::number(nr) + ".html")); + waitForLoadFinished.exec(); + } + +public slots: + void init(); + void cleanup(); + +private slots: + void title(); + void count(); + void back(); + void forward(); + void itemAt(); + void goToItem(); + void items(); + void serialize_1(); //QWebHistory countity + void serialize_2(); //QWebHistory index + void serialize_3(); //QWebHistoryItem + void saveAndRestore_crash_1(); + void saveAndRestore_crash_2(); + void saveAndRestore_crash_3(); + void popPushState_data(); + void popPushState(); + void clear(); + + +private: + QWebPage* page; + QWebFrame* frame; + QWebHistory* hist; + QEventLoop waitForLoadFinished; //operation on history are asynchronous! + int histsize; +}; + +tst_QWebHistory::tst_QWebHistory() +{ +} + +tst_QWebHistory::~tst_QWebHistory() +{ +} + +void tst_QWebHistory::init() +{ + page = new QWebPage(this); + frame = page->mainFrame(); + connect(page, SIGNAL(loadFinished(bool)), &waitForLoadFinished, SLOT(quit()), Qt::QueuedConnection); + + for (int i = 1;i < 6;i++) { + loadPage(i); + } + hist = page->history(); + histsize = 5; +} + +void tst_QWebHistory::cleanup() +{ + delete page; +} + +/** + * Check QWebHistoryItem::title() method + */ +void tst_QWebHistory::title() +{ + QCOMPARE(hist->currentItem().title(), QString("page5")); +} + +/** + * Check QWebHistory::count() method + */ +void tst_QWebHistory::count() +{ + QCOMPARE(hist->count(), histsize); +} + +/** + * Check QWebHistory::back() method + */ +void tst_QWebHistory::back() +{ + for (int i = histsize;i > 1;i--) { + QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(i)); + hist->back(); + waitForLoadFinished.exec(); + } + //try one more time (too many). crash test + hist->back(); + QCOMPARE(page->mainFrame()->toPlainText(), QString("page1")); +} + +/** + * Check QWebHistory::forward() method + */ +void tst_QWebHistory::forward() +{ + //rewind history :-) + while (hist->canGoBack()) { + hist->back(); + waitForLoadFinished.exec(); + } + + for (int i = 1;i < histsize;i++) { + QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(i)); + hist->forward(); + waitForLoadFinished.exec(); + } + //try one more time (too many). crash test + hist->forward(); + QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(histsize)); +} + +/** + * Check QWebHistory::itemAt() method + */ +void tst_QWebHistory::itemAt() +{ + for (int i = 1;i < histsize;i++) { + QCOMPARE(hist->itemAt(i - 1).title(), QString("page") + QString::number(i)); + QVERIFY(hist->itemAt(i - 1).isValid()); + } + //check out of range values + QVERIFY(!hist->itemAt(-1).isValid()); + QVERIFY(!hist->itemAt(histsize).isValid()); +} + +/** + * Check QWebHistory::goToItem() method + */ +void tst_QWebHistory::goToItem() +{ + QWebHistoryItem current = hist->currentItem(); + hist->back(); + waitForLoadFinished.exec(); + hist->back(); + waitForLoadFinished.exec(); + QVERIFY(hist->currentItem().title() != current.title()); + hist->goToItem(current); + waitForLoadFinished.exec(); + QCOMPARE(hist->currentItem().title(), current.title()); +} + +/** + * Check QWebHistory::items() method + */ +void tst_QWebHistory::items() +{ + QList<QWebHistoryItem> items = hist->items(); + //check count + QCOMPARE(histsize, items.count()); + + //check order + for (int i = 1;i <= histsize;i++) { + QCOMPARE(items.at(i - 1).title(), QString("page") + QString::number(i)); + } +} + +/** + * Check history state after serialization (pickle, persistent..) method + * Checks history size, history order + */ +void tst_QWebHistory::serialize_1() +{ + QByteArray tmp; //buffer + QDataStream save(&tmp, QIODevice::WriteOnly); //here data will be saved + QDataStream load(&tmp, QIODevice::ReadOnly); //from here data will be loaded + + save << *hist; + QVERIFY(save.status() == QDataStream::Ok); + QCOMPARE(hist->count(), histsize); + + //check size of history + //load next page to find differences + loadPage(6); + QCOMPARE(hist->count(), histsize + 1); + load >> *hist; + QVERIFY(load.status() == QDataStream::Ok); + QCOMPARE(hist->count(), histsize); + + //check order of historyItems + QList<QWebHistoryItem> items = hist->items(); + for (int i = 1;i <= histsize;i++) { + QCOMPARE(items.at(i - 1).title(), QString("page") + QString::number(i)); + } +} + +/** + * Check history state after serialization (pickle, persistent..) method + * Checks history currentIndex value + */ +void tst_QWebHistory::serialize_2() +{ + QByteArray tmp; //buffer + QDataStream save(&tmp, QIODevice::WriteOnly); //here data will be saved + QDataStream load(&tmp, QIODevice::ReadOnly); //from here data will be loaded + + int oldCurrentIndex = hist->currentItemIndex(); + + hist->back(); + waitForLoadFinished.exec(); + hist->back(); + waitForLoadFinished.exec(); + //check if current index was changed (make sure that it is not last item) + QVERIFY(hist->currentItemIndex() != oldCurrentIndex); + //save current index + oldCurrentIndex = hist->currentItemIndex(); + + save << *hist; + QVERIFY(save.status() == QDataStream::Ok); + load >> *hist; + QVERIFY(load.status() == QDataStream::Ok); + + //check current index + QCOMPARE(hist->currentItemIndex(), oldCurrentIndex); +} + +/** + * Check history state after serialization (pickle, persistent..) method + * Checks QWebHistoryItem public property after serialization + */ +void tst_QWebHistory::serialize_3() +{ + QByteArray tmp; //buffer + QDataStream save(&tmp, QIODevice::WriteOnly); //here data will be saved + QDataStream load(&tmp, QIODevice::ReadOnly); //from here data will be loaded + + //prepare two different history items + QWebHistoryItem a = hist->currentItem(); + a.setUserData("A - user data"); + + //check properties BEFORE serialization + QString title(a.title()); + QDateTime lastVisited(a.lastVisited()); + QUrl originalUrl(a.originalUrl()); + QUrl url(a.url()); + QVariant userData(a.userData()); + + save << *hist; + QVERIFY(save.status() == QDataStream::Ok); + QVERIFY(!load.atEnd()); + hist->clear(); + QVERIFY(hist->count() == 1); + load >> *hist; + QVERIFY(load.status() == QDataStream::Ok); + QWebHistoryItem b = hist->currentItem(); + + //check properties AFTER serialization + QCOMPARE(b.title(), title); + QCOMPARE(b.lastVisited(), lastVisited); + QCOMPARE(b.originalUrl(), originalUrl); + QCOMPARE(b.url(), url); + QCOMPARE(b.userData(), userData); + + //Check if all data was read + QVERIFY(load.atEnd()); +} + +static void saveHistory(QWebHistory* history, QByteArray* in) +{ + in->clear(); + QDataStream save(in, QIODevice::WriteOnly); + save << *history; +} + +static void restoreHistory(QWebHistory* history, QByteArray* out) +{ + QDataStream load(out, QIODevice::ReadOnly); + load >> *history; +} + +/** The test shouldn't crash */ +void tst_QWebHistory::saveAndRestore_crash_1() +{ + QByteArray buffer; + saveHistory(hist, &buffer); + for (unsigned i = 0; i < 5; i++) { + restoreHistory(hist, &buffer); + saveHistory(hist, &buffer); + } +} + +/** The test shouldn't crash */ +void tst_QWebHistory::saveAndRestore_crash_2() +{ + QByteArray buffer; + saveHistory(hist, &buffer); + QWebPage* page2 = new QWebPage(this); + QWebHistory* hist2 = page2->history(); + for (unsigned i = 0; i < 5; i++) { + restoreHistory(hist2, &buffer); + saveHistory(hist2, &buffer); + } + delete page2; +} + +/** The test shouldn't crash */ +void tst_QWebHistory::saveAndRestore_crash_3() +{ + QByteArray buffer; + saveHistory(hist, &buffer); + QWebPage* page2 = new QWebPage(this); + QWebHistory* hist1 = hist; + QWebHistory* hist2 = page2->history(); + for (unsigned i = 0; i < 5; i++) { + restoreHistory(hist1, &buffer); + restoreHistory(hist2, &buffer); + QVERIFY(hist1->count() == hist2->count()); + QVERIFY(hist1->count() == histsize); + hist2->back(); + saveHistory(hist2, &buffer); + hist2->clear(); + } + delete page2; +} + +void tst_QWebHistory::popPushState_data() +{ + QTest::addColumn<QString>("script"); + QTest::newRow("pushState") << "history.pushState(123, \"foo\");"; + QTest::newRow("replaceState") << "history.replaceState(\"a\", \"b\");"; + QTest::newRow("back") << "history.back();"; + QTest::newRow("forward") << "history.forward();"; + QTest::newRow("clearState") << "history.clearState();"; +} + +/** Crash test, WebKit bug 38840 (https://bugs.webkit.org/show_bug.cgi?id=38840) */ +void tst_QWebHistory::popPushState() +{ + QFETCH(QString, script); + QWebPage page; + page.mainFrame()->setHtml("<html><body>long live Qt!</body></html>"); + page.mainFrame()->evaluateJavaScript(script); +} + +/** ::clear */ +void tst_QWebHistory::clear() +{ + QByteArray buffer; + + QAction* actionBack = page->action(QWebPage::Back); + QVERIFY(actionBack->isEnabled()); + saveHistory(hist, &buffer); + QVERIFY(hist->count() > 1); + hist->clear(); + QVERIFY(hist->count() == 1); // Leave current item. + QVERIFY(!actionBack->isEnabled()); + + QWebPage* page2 = new QWebPage(this); + QWebHistory* hist2 = page2->history(); + QVERIFY(hist2->count() == 0); + hist2->clear(); + QVERIFY(hist2->count() == 0); // Do not change anything. + delete page2; +} + +QTEST_MAIN(tst_QWebHistory) +#include "tst_qwebhistory.moc" diff --git a/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc new file mode 100644 index 0000000..6e2f50a --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc @@ -0,0 +1,11 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>resources/page1.html</file> + <file>resources/page2.html</file> + <file>resources/page3.html</file> + <file>resources/page4.html</file> + <file>resources/page5.html</file> + <file>resources/page6.html</file> +</qresource> +</RCC> + diff --git a/Source/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/Source/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp b/Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp new file mode 100644 index 0000000..84b12d2 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp @@ -0,0 +1,96 @@ +/* + 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 <qwebelement.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><style>:link{color:green}:visited{color:red}</style><body><a href='http://www.trolltech.com' id='vlink'>Trolltech</a></body></html>"); + QWebElement anchor = m_view->page()->mainFrame()->findFirstElement("a[id=vlink]"); + QString linkColor = anchor.styleProperty("color", QWebElement::ComputedStyle); + QCOMPARE(linkColor, QString::fromLatin1("rgb(255, 0, 0)")); +} + +QTEST_MAIN(tst_QWebHistoryInterface) +#include "tst_qwebhistoryinterface.moc" diff --git a/Source/WebKit/qt/tests/qwebinspector/qwebinspector.pro b/Source/WebKit/qt/tests/qwebinspector/qwebinspector.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebinspector/qwebinspector.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp new file mode 100644 index 0000000..12cd630 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp @@ -0,0 +1,68 @@ +/* + 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 <qdir.h> +#include <qwebinspector.h> +#include <qwebpage.h> +#include <qwebsettings.h> + +class tst_QWebInspector : public QObject { + Q_OBJECT + +private slots: + void attachAndDestroy(); +}; + +void tst_QWebInspector::attachAndDestroy() +{ + { // External inspector + manual destruction of page first + QWebPage* page = new QWebPage(); + page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + QWebInspector* inspector = new QWebInspector(); + inspector->setPage(page); + page->updatePositionDependentActions(QPoint(0, 0)); + page->triggerAction(QWebPage::InspectElement); + + delete page; + delete inspector; + } + { // External inspector + manual destruction of inspector first + QWebPage* page = new QWebPage(); + page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + QWebInspector* inspector = new QWebInspector(); + inspector->setPage(page); + page->updatePositionDependentActions(QPoint(0, 0)); + page->triggerAction(QWebPage::InspectElement); + + delete inspector; + delete page; + } + { // Internal inspector + QWebPage page; + page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + page.updatePositionDependentActions(QPoint(0, 0)); + page.triggerAction(QWebPage::InspectElement); + } +} + +QTEST_MAIN(tst_QWebInspector) + +#include "tst_qwebinspector.moc" diff --git a/Source/WebKit/qt/tests/qwebpage/qwebpage.pro b/Source/WebKit/qt/tests/qwebpage/qwebpage.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/qwebpage.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebpage/resources/frame_a.html b/Source/WebKit/qt/tests/qwebpage/resources/frame_a.html new file mode 100644 index 0000000..9ff68f1 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/resources/frame_a.html @@ -0,0 +1,2 @@ +<a href="http://google.com" target="frame_b"><img src="" width=100 height=100 alt="Google"></a> +<a href="http://yahoo.com" target="frame_b"><img src="" width=100 height=100 alt="Yahoo"></a> diff --git a/Source/WebKit/qt/tests/qwebpage/resources/iframe.html b/Source/WebKit/qt/tests/qwebpage/resources/iframe.html new file mode 100644 index 0000000..f17027c --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/resources/iframe.html @@ -0,0 +1,6 @@ +<html> +<body> +<p>top</p> +<iframe src="iframe2.html" width="80%" height="30%"/> +</body> +</html> diff --git a/Source/WebKit/qt/tests/qwebpage/resources/iframe2.html b/Source/WebKit/qt/tests/qwebpage/resources/iframe2.html new file mode 100644 index 0000000..5017435 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/resources/iframe2.html @@ -0,0 +1,7 @@ +<html> +<body> +<p>another iframe</p> +<iframe src="iframe3.html" width="80%" height="30%"></iframe> +</body> +</html> + diff --git a/Source/WebKit/qt/tests/qwebpage/resources/iframe3.html b/Source/WebKit/qt/tests/qwebpage/resources/iframe3.html new file mode 100644 index 0000000..ed6ac5b --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/resources/iframe3.html @@ -0,0 +1,5 @@ +<html> +<body> +<p>inner</p> +</body> +</html> diff --git a/Source/WebKit/qt/tests/qwebpage/resources/index.html b/Source/WebKit/qt/tests/qwebpage/resources/index.html new file mode 100644 index 0000000..c53ad09 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/resources/index.html @@ -0,0 +1,4 @@ +<frameset cols="25%,75%"> + <frame src="frame_a.html" name="frame_a"> + <frame src="frame_b.html" name="frame_b"> +</frameset> diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp new file mode 100644 index 0000000..ec1f336 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -0,0 +1,2759 @@ +/* + Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) + Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> + Copyright (C) 2010 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 "../util.h" +#include "../WebCoreSupport/DumpRenderTreeSupportQt.h" +#include <QClipboard> +#include <QDir> +#include <QGraphicsWidget> +#include <QLineEdit> +#include <QLocale> +#include <QMenu> +#include <QPushButton> +#include <QStyle> +#include <QtTest/QtTest> +#include <QTextCharFormat> +#include <qgraphicsscene.h> +#include <qgraphicsview.h> +#include <qgraphicswebview.h> +#include <qnetworkcookiejar.h> +#include <qnetworkrequest.h> +#include <qwebdatabase.h> +#include <qwebelement.h> +#include <qwebframe.h> +#include <qwebhistory.h> +#include <qwebpage.h> +#include <qwebsecurityorigin.h> +#include <qwebview.h> +#include <qimagewriter.h> + +class EventSpy : public QObject, public QList<QEvent::Type> +{ + Q_OBJECT +public: + EventSpy(QObject* objectToSpy) + { + objectToSpy->installEventFilter(this); + } + + virtual bool eventFilter(QObject* receiver, QEvent* event) + { + append(event->type()); + return false; + } +}; + +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 geolocationRequestJS(); + void loadFinished(); + void acceptNavigationRequestWithNewWindow(); + void userStyleSheet(); + void modified(); + void contextMenuCrash(); + void database(); + void createPluginWithPluginsEnabled(); + void createPluginWithPluginsDisabled(); + void destroyPlugin_data(); + void destroyPlugin(); + void createViewlessPlugin_data(); + void createViewlessPlugin(); + void graphicsWidgetPlugin(); + void multiplePageGroupsAndLocalStorage(); + void cursorMovements(); + void textSelection(); + void textEditing(); + void backActionUpdate(); + void frameAt(); + void requestCache(); + void loadCachedPage(); + void protectBindingsRuntimeObjectsFromCollector(); + void localURLSchemes(); + void testOptionalJSObjects(); + void testEnablePersistentStorage(); + void consoleOutput(); + void inputMethods_data(); + void inputMethods(); + void inputMethodsTextFormat_data(); + void inputMethodsTextFormat(); + void defaultTextEncoding(); + void errorPageExtension(); + void errorPageExtensionInIFrames(); + void errorPageExtensionInFrameset(); + void userAgentApplicationName(); + void userAgentLocaleChange(); + + void viewModes(); + + void crashTests_LazyInitializationOfMainFrame(); + + void screenshot_data(); + void screenshot(); + + void originatingObjectInNetworkRequests(); + void testJSPrompt(); + void showModalDialog(); + void testStopScheduledPageRefresh(); + void findText(); + void supportedContentType(); + void infiniteLoopJS(); + void networkAccessManagerOnDifferentThread(); + void navigatorCookieEnabled(); + +#ifdef Q_OS_MAC + void macCopyUnicodeToClipboard(); +#endif + +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); +} + +class JSTestPage : public QWebPage +{ +Q_OBJECT +public: + JSTestPage(QObject* parent = 0) + : QWebPage(parent) {} + +public slots: + bool shouldInterruptJavaScript() { + return true; + } + void requestPermission(QWebFrame* frame, QWebPage::Feature feature) + { + if (m_allowGeolocation) + setFeaturePermission(frame, feature, PermissionGrantedByUser); + else + setFeaturePermission(frame, feature, PermissionDeniedByUser); + } + +public: + void setGeolocationPermission(bool allow) + { + m_allowGeolocation = allow; + } + +private: + bool m_allowGeolocation; +}; + +void tst_QWebPage::infiniteLoopJS() +{ + JSTestPage* newPage = new JSTestPage(m_view); + m_view->setPage(newPage); + m_view->setHtml(QString("<html><body>test</body></html>"), QUrl()); + m_view->page()->mainFrame()->evaluateJavaScript("var run = true;var a = 1;while(run){a++;}"); + delete newPage; +} + +void tst_QWebPage::geolocationRequestJS() +{ + JSTestPage* newPage = new JSTestPage(m_view); + + if (newPage->mainFrame()->evaluateJavaScript(QLatin1String("!navigator.geolocation")).toBool()) { + delete newPage; + QSKIP("Geolocation is not supported.", SkipSingle); + } + + connect(newPage, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), + newPage, SLOT(requestPermission(QWebFrame*, QWebPage::Feature))); + + newPage->setGeolocationPermission(false); + m_view->setPage(newPage); + m_view->setHtml(QString("<html><body>test</body></html>"), QUrl()); + m_view->page()->mainFrame()->evaluateJavaScript("var errorCode = 0; function error(err) { errorCode = err.code; } function success(pos) { } navigator.geolocation.getCurrentPosition(success, error)"); + QTest::qWait(2000); + QVariant empty = m_view->page()->mainFrame()->evaluateJavaScript("errorCode"); + + QVERIFY(empty.type() == QVariant::Double && empty.toInt() != 0); + + newPage->setGeolocationPermission(true); + m_view->page()->mainFrame()->evaluateJavaScript("errorCode = 0; navigator.geolocation.getCurrentPosition(success, error);"); + empty = m_view->page()->mainFrame()->evaluateJavaScript("errorCode"); + + //http://dev.w3.org/geo/api/spec-source.html#position + //PositionError: const unsigned short PERMISSION_DENIED = 1; + QVERIFY(empty.type() == QVariant::Double && empty.toInt() != 1); + delete newPage; +} + +void tst_QWebPage::loadFinished() +{ + qRegisterMetaType<QWebFrame*>("QWebFrame*"); + qRegisterMetaType<QNetworkRequest*>("QNetworkRequest*"); + QSignalSpy spyLoadStarted(m_view, SIGNAL(loadStarted())); + QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); + + m_view->page()->mainFrame()->load(QUrl("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>")); + QTRY_COMPARE(spyLoadFinished.count(), 1); + + QTRY_VERIFY(spyLoadStarted.count() > 1); + QTRY_VERIFY(spyLoadFinished.count() > 1); + + spyLoadFinished.clear(); + + m_view->page()->mainFrame()->load(QUrl("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html," + "foo \"><frame src=\"data:text/html,bar\"></frameset>")); + QTRY_COMPARE(spyLoadFinished.count(), 1); + QCOMPARE(spyLoadFinished.count(), 1); +} + +class ConsolePage : public QWebPage +{ +public: + ConsolePage(QObject* parent = 0) : QWebPage(parent) {} + + virtual void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID) + { + messages.append(message); + lineNumbers.append(lineNumber); + sourceIDs.append(sourceID); + } + + QStringList messages; + QList<int> lineNumbers; + QStringList sourceIDs; +}; + +void tst_QWebPage::consoleOutput() +{ + ConsolePage page; + page.mainFrame()->evaluateJavaScript("this is not valid JavaScript"); + QCOMPARE(page.messages.count(), 1); + QCOMPARE(page.lineNumbers.at(0), 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; + QList<QNetworkRequest> requests; + +protected: + virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) { + requests.append(request); + 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;charset=utf-8;base64," + + QByteArray("p { background-image: url('http://does.not/exist.png');}").toBase64())); + m_view->setHtml("<p>hello world</p>"); + QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool)))); + + QVERIFY(networkManager->requestedUrls.count() >= 1); + QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png")); +} + +void tst_QWebPage::viewModes() +{ + m_view->setHtml("<body></body>"); + m_page->setProperty("_q_viewMode", "minimized"); + + QVariant empty = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode)\")"); + QVERIFY(empty.type() == QVariant::Bool && empty.toBool()); + + QVariant minimized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: minimized)\")"); + QVERIFY(minimized.type() == QVariant::Bool && minimized.toBool()); + + QVariant maximized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: maximized)\")"); + QVERIFY(maximized.type() == QVariant::Bool && !maximized.toBool()); +} + +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); + + m_page->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true); + m_page->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); + + 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); + + // Remove all databases. + QWebSecurityOrigin origin = m_page->mainFrame()->securityOrigin(); + QList<QWebDatabase> dbs = origin.databases(); + for (int i = 0; i < dbs.count(); i++) { + QString fileName = dbs[i].fileName(); + QVERIFY(QFile::exists(fileName)); + QWebDatabase::removeDatabase(dbs[i]); + QVERIFY(!QFile::exists(fileName)); + } + QVERIFY(!origin.databases().size()); + // Remove removed test :-) + QWebDatabase::removeAllDatabases(); + QVERIFY(!origin.databases().size()); +} + +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 ¶mNames, + const QStringList ¶mValues) + { + QObject *result = 0; + if (classid == "pushbutton") + result = new QPushButton(); +#ifndef QT_NO_INPUTDIALOG + else if (classid == "lineedit") + result = new QLineEdit(); +#endif + else if (classid == "graphicswidget") + result = new QGraphicsWidget(); + if (result) + result->setObjectName(classid); + calls.append(CallInfo(classid, url, paramNames, paramValues, result)); + return result; + } +}; + +static void createPlugin(QWebView *view) +{ + QSignalSpy loadSpy(view, SIGNAL(loadFinished(bool))); + + PluginPage* newPage = new PluginPage(view); + view->setPage(newPage); + + // type has to be application/x-qt-plugin + view->setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='pushbutton' id='mybutton'/></body></html>")); + QTRY_COMPARE(loadSpy.count(), 1); + QCOMPARE(newPage->calls.count(), 0); + + view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>")); + QTRY_COMPARE(loadSpy.count(), 2); + 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}")); + + 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(), 3); + 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")); + } +} + +void tst_QWebPage::graphicsWidgetPlugin() +{ + m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true); + QGraphicsWebView webView; + + QSignalSpy loadSpy(&webView, SIGNAL(loadFinished(bool))); + + PluginPage* newPage = new PluginPage(&webView); + webView.setPage(newPage); + + // type has to be application/x-qt-plugin + webView.setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='graphicswidget' id='mygraphicswidget'/></body></html>")); + QTRY_COMPARE(loadSpy.count(), 1); + QCOMPARE(newPage->calls.count(), 0); + + webView.setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='graphicswidget' id='mygraphicswidget'/></body></html>")); + QTRY_COMPARE(loadSpy.count(), 2); + QCOMPARE(newPage->calls.count(), 1); + { + PluginPage::CallInfo ci = newPage->calls.takeFirst(); + QCOMPARE(ci.classid, QString::fromLatin1("graphicswidget")); + 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("graphicswidget")); + QCOMPARE(ci.paramNames.at(2), QString::fromLatin1("id")); + QCOMPARE(ci.paramValues.at(2), QString::fromLatin1("mygraphicswidget")); + QVERIFY(ci.returnValue); + QVERIFY(ci.returnValue->inherits("QGraphicsWidget")); + } + // test JS bindings + QCOMPARE(newPage->mainFrame()->evaluateJavaScript("document.getElementById('mygraphicswidget').toString()").toString(), + QString::fromLatin1("[object HTMLObjectElement]")); + QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mygraphicswidget.toString()").toString(), + QString::fromLatin1("[object HTMLObjectElement]")); + QCOMPARE(newPage->mainFrame()->evaluateJavaScript("typeof mygraphicswidget.objectName").toString(), + QString::fromLatin1("string")); + QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mygraphicswidget.objectName").toString(), + QString::fromLatin1("graphicswidget")); + QCOMPARE(newPage->mainFrame()->evaluateJavaScript("typeof mygraphicswidget.geometryChanged").toString(), + QString::fromLatin1("function")); + QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mygraphicswidget.geometryChanged.toString()").toString(), + QString::fromLatin1("function geometryChanged() {\n [native code]\n}")); +} + +void tst_QWebPage::createPluginWithPluginsEnabled() +{ + m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true); + createPlugin(m_view); +} + +void tst_QWebPage::createPluginWithPluginsDisabled() +{ + // Qt Plugins should be loaded by QtWebKit even when PluginsEnabled is + // false. The client decides whether a Qt plugin is enabled or not when + // it decides whether or not to instantiate it. + m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, false); + createPlugin(m_view); +} + +// Standard base class for template PluginTracerPage. In tests it is used as interface. +class PluginCounterPage : public QWebPage { +public: + int m_count; + QPointer<QObject> m_widget; + QObject* m_pluginParent; + PluginCounterPage(QObject* parent = 0) + : QWebPage(parent) + , m_count(0) + , m_widget(0) + , m_pluginParent(0) + { + settings()->setAttribute(QWebSettings::PluginsEnabled, true); + } + ~PluginCounterPage() + { + if (m_pluginParent) + m_pluginParent->deleteLater(); + } +}; + +template<class T> +class PluginTracerPage : public PluginCounterPage { +public: + PluginTracerPage(QObject* parent = 0) + : PluginCounterPage(parent) + { + // this is a dummy parent object for the created plugin + m_pluginParent = new T; + } + virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) + { + m_count++; + m_widget = new T; + // need a cast to the specific type, as QObject::setParent cannot be called, + // because it is not virtual. Instead it is necesary to call QWidget::setParent, + // which also takes a QWidget* instead of a QObject*. Therefore we need to + // upcast to T*, which is a QWidget. + static_cast<T*>(m_widget.data())->setParent(static_cast<T*>(m_pluginParent)); + return m_widget; + } +}; + +class PluginFactory { +public: + enum FactoredType {QWidgetType, QGraphicsWidgetType}; + static PluginCounterPage* create(FactoredType type, QObject* parent = 0) + { + PluginCounterPage* result = 0; + switch (type) { + case QWidgetType: + result = new PluginTracerPage<QWidget>(parent); + break; + case QGraphicsWidgetType: + result = new PluginTracerPage<QGraphicsWidget>(parent); + break; + default: {/*Oops*/}; + } + return result; + } + + static void prepareTestData() + { + QTest::addColumn<int>("type"); + QTest::newRow("QWidget") << (int)PluginFactory::QWidgetType; + QTest::newRow("QGraphicsWidget") << (int)PluginFactory::QGraphicsWidgetType; + } +}; + +void tst_QWebPage::destroyPlugin_data() +{ + PluginFactory::prepareTestData(); +} + +void tst_QWebPage::destroyPlugin() +{ + QFETCH(int, type); + PluginCounterPage* page = PluginFactory::create((PluginFactory::FactoredType)type, 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->m_widget); + QCOMPARE(page->m_count, 1); + + // navigate away, the plugin widget should be destructed + m_view->setHtml("<html><body>Hi</body></html>"); + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!page->m_widget); +} + +void tst_QWebPage::createViewlessPlugin_data() +{ + PluginFactory::prepareTestData(); +} + +void tst_QWebPage::createViewlessPlugin() +{ + QFETCH(int, type); + PluginCounterPage* page = PluginFactory::create((PluginFactory::FactoredType)type); + QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>"); + page->mainFrame()->setHtml(content); + QCOMPARE(page->m_count, 1); + QVERIFY(page->m_widget); + QVERIFY(page->m_pluginParent); + QVERIFY(page->m_widget->parent() == page->m_pluginParent); + delete page; + +} + +void tst_QWebPage::multiplePageGroupsAndLocalStorage() +{ + QDir dir(QDir::currentPath()); + dir.mkdir("path1"); + dir.mkdir("path2"); + + QWebView view1; + QWebView view2; + + view1.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true); + view1.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path1")); + DumpRenderTreeSupportQt::webPageSetGroupName(view1.page(), "group1"); + view2.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true); + view2.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path2")); + DumpRenderTreeSupportQt::webPageSetGroupName(view2.page(), "group2"); + QCOMPARE(DumpRenderTreeSupportQt::webPageGroupName(view1.page()), QString("group1")); + QCOMPARE(DumpRenderTreeSupportQt::webPageGroupName(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")); + QCOMPARE(page->selectedHtml().trimmed(), QString::fromLatin1("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \"><p id=\"one\">The quick brown fox</p></span>")); + + // 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(), 0); + + // 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); + + // these actions must exist + QVERIFY(page->action(QWebPage::SelectAll) != 0); + 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 and + // there isn't an existing selection to modify + 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); + + // ..but SelectAll is awalys enabled + QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true); + + // Verify hasSelection returns false since there is no selection yet... + QCOMPARE(page->hasSelection(), false); + + // this will select the first paragraph + QString selectScript = "var range = document.createRange(); " \ + "var node = document.getElementById(\"one\"); " \ + "range.selectNode(node); " \ + "getSelection().addRange(range);"; + page->mainFrame()->evaluateJavaScript(selectScript); + QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox")); + QCOMPARE(page->selectedHtml().trimmed(), QString::fromLatin1("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \"><p id=\"one\">The quick brown fox</p></span>")); + + // Make sure hasSelection returns true, since there is selected text now... + QCOMPARE(page->hasSelection(), true); + + // here the actions are enabled after a selection has been created + 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); + + // make it editable before navigating the cursor + page->setContentEditable(true); + + // cursor will be before the word "The", this makes sure there is a charet + page->triggerAction(QWebPage::MoveToStartOfDocument); + QVERIFY(page->isSelectionCollapsed()); + QCOMPARE(page->selectionStartOffset(), 0); + + // 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); + + // these actions must exist + QVERIFY(page->action(QWebPage::Cut) != 0); + QVERIFY(page->action(QWebPage::Copy) != 0); + QVERIFY(page->action(QWebPage::Paste) != 0); + 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); + QVERIFY(page->action(QWebPage::InsertParagraphSeparator) != 0); + QVERIFY(page->action(QWebPage::InsertLineSeparator) != 0); + QVERIFY(page->action(QWebPage::PasteAndMatchStyle) != 0); + QVERIFY(page->action(QWebPage::RemoveFormat) != 0); + QVERIFY(page->action(QWebPage::ToggleStrikethrough) != 0); + QVERIFY(page->action(QWebPage::ToggleSubscript) != 0); + QVERIFY(page->action(QWebPage::ToggleSuperscript) != 0); + QVERIFY(page->action(QWebPage::InsertUnorderedList) != 0); + QVERIFY(page->action(QWebPage::InsertOrderedList) != 0); + QVERIFY(page->action(QWebPage::Indent) != 0); + QVERIFY(page->action(QWebPage::Outdent) != 0); + QVERIFY(page->action(QWebPage::AlignCenter) != 0); + QVERIFY(page->action(QWebPage::AlignJustified) != 0); + QVERIFY(page->action(QWebPage::AlignLeft) != 0); + QVERIFY(page->action(QWebPage::AlignRight) != 0); + + // right now they are disabled because contentEditable is false + QCOMPARE(page->action(QWebPage::Cut)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::Paste)->isEnabled(), 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); + QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::PasteAndMatchStyle)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::RemoveFormat)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::ToggleStrikethrough)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::ToggleSubscript)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::ToggleSuperscript)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::InsertUnorderedList)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::InsertOrderedList)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::Indent)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::Outdent)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::AlignCenter)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::AlignJustified)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::AlignLeft)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::AlignRight)->isEnabled(), false); + + // Select everything + page->triggerAction(QWebPage::SelectAll); + + // make sure it is enabled since there is a selection + QCOMPARE(page->action(QWebPage::Copy)->isEnabled(), true); + + // make it editable before navigating the cursor + page->setContentEditable(true); + + // clear the selection + page->triggerAction(QWebPage::MoveToStartOfDocument); + QVERIFY(page->isSelectionCollapsed()); + QCOMPARE(page->selectionStartOffset(), 0); + + // make sure it is disabled since there isn't a selection + QCOMPARE(page->action(QWebPage::Copy)->isEnabled(), false); + + // here the actions are enabled after contentEditable is true + QCOMPARE(page->action(QWebPage::Paste)->isEnabled(), 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); + QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::PasteAndMatchStyle)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::ToggleStrikethrough)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::ToggleSubscript)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::ToggleSuperscript)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::InsertUnorderedList)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::InsertOrderedList)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::Indent)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::Outdent)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::AlignCenter)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::AlignJustified)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::AlignLeft)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::AlignRight)->isEnabled(), true); + + // make sure these are disabled since there isn't a selection + QCOMPARE(page->action(QWebPage::Cut)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::RemoveFormat)->isEnabled(), false); + + // make sure everything is selected + page->triggerAction(QWebPage::SelectAll); + + // this is only true if there is an editable selection + QCOMPARE(page->action(QWebPage::Cut)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::RemoveFormat)->isEnabled(), true); + + delete page; +} + +void tst_QWebPage::requestCache() +{ + TestPage page; + QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool))); + + page.mainFrame()->setUrl(QString("data:text/html,<a href=\"data:text/html,Reached\" target=\"_blank\">Click me</a>")); + QTRY_COMPARE(loadSpy.count(), 1); + QTRY_COMPARE(page.navigations.count(), 1); + + page.mainFrame()->setUrl(QString("data:text/html,<a href=\"data:text/html,Reached\" target=\"_blank\">Click me2</a>")); + QTRY_COMPARE(loadSpy.count(), 2); + QTRY_COMPARE(page.navigations.count(), 2); + + page.triggerAction(QWebPage::Stop); + QVERIFY(page.history()->canGoBack()); + page.triggerAction(QWebPage::Back); + + QTRY_COMPARE(loadSpy.count(), 3); + QTRY_COMPARE(page.navigations.count(), 3); + QCOMPARE(page.navigations.at(0).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), + (int)QNetworkRequest::PreferNetwork); + QCOMPARE(page.navigations.at(1).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), + (int)QNetworkRequest::PreferNetwork); + QCOMPARE(page.navigations.at(2).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), + (int)QNetworkRequest::PreferCache); +} + +void tst_QWebPage::loadCachedPage() +{ + TestPage page; + QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool))); + page.settings()->setMaximumPagesInCache(3); + + page.mainFrame()->load(QUrl("data:text/html,This is first page")); + + QTRY_COMPARE(loadSpy.count(), 1); + QTRY_COMPARE(page.navigations.count(), 1); + + QUrl firstPageUrl = page.mainFrame()->url(); + page.mainFrame()->load(QUrl("data:text/html,This is second page")); + + QTRY_COMPARE(loadSpy.count(), 2); + QTRY_COMPARE(page.navigations.count(), 2); + + page.triggerAction(QWebPage::Stop); + QVERIFY(page.history()->canGoBack()); + + QSignalSpy urlSpy(page.mainFrame(), SIGNAL(urlChanged(QUrl))); + QVERIFY(urlSpy.isValid()); + + page.triggerAction(QWebPage::Back); + ::waitForSignal(page.mainFrame(), SIGNAL(urlChanged(QUrl))); + QCOMPARE(urlSpy.size(), 1); + + QList<QVariant> arguments1 = urlSpy.takeFirst(); + QCOMPARE(arguments1.at(0).toUrl(), firstPageUrl); + +} +void tst_QWebPage::backActionUpdate() +{ + QWebView view; + QWebPage *page = view.page(); + QAction *action = page->action(QWebPage::Back); + QVERIFY(!action->isEnabled()); + QSignalSpy loadSpy(page, SIGNAL(loadFinished(bool))); + QUrl url = QUrl("qrc:///resources/index.html"); + page->mainFrame()->load(url); + QTRY_COMPARE(loadSpy.count(), 1); + QVERIFY(!action->isEnabled()); + QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(10, 10)); + QTRY_COMPARE(loadSpy.count(), 2); + + QVERIFY(action->isEnabled()); +} + +void frameAtHelper(QWebPage* webPage, QWebFrame* webFrame, QPoint framePosition) +{ + if (!webFrame) + return; + + framePosition += QPoint(webFrame->pos()); + QList<QWebFrame*> children = webFrame->childFrames(); + for (int i = 0; i < children.size(); ++i) { + if (children.at(i)->childFrames().size() > 0) + frameAtHelper(webPage, children.at(i), framePosition); + + QRect frameRect(children.at(i)->pos() + framePosition, children.at(i)->geometry().size()); + QVERIFY(children.at(i) == webPage->frameAt(frameRect.topLeft())); + } +} + +void tst_QWebPage::frameAt() +{ + QWebView webView; + QWebPage* webPage = webView.page(); + QSignalSpy loadSpy(webPage, SIGNAL(loadFinished(bool))); + QUrl url = QUrl("qrc:///resources/iframe.html"); + webPage->mainFrame()->load(url); + QTRY_COMPARE(loadSpy.count(), 1); + frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos()); +} + +void tst_QWebPage::inputMethods_data() +{ + QTest::addColumn<QString>("viewType"); + QTest::newRow("QWebView") << "QWebView"; + QTest::newRow("QGraphicsWebView") << "QGraphicsWebView"; +} + +static Qt::InputMethodHints inputMethodHints(QObject* object) +{ + if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object)) + return o->inputMethodHints(); + if (QWidget* w = qobject_cast<QWidget*>(object)) + return w->inputMethodHints(); + return Qt::InputMethodHints(); +} + +static bool inputMethodEnabled(QObject* object) +{ + if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object)) + return o->flags() & QGraphicsItem::ItemAcceptsInputMethod; + if (QWidget* w = qobject_cast<QWidget*>(object)) + return w->testAttribute(Qt::WA_InputMethodEnabled); + return false; +} + +static void clickOnPage(QWebPage* page, const QPoint& position) +{ + QMouseEvent evpres(QEvent::MouseButtonPress, position, Qt::LeftButton, Qt::NoButton, Qt::NoModifier); + page->event(&evpres); + QMouseEvent evrel(QEvent::MouseButtonRelease, position, Qt::LeftButton, Qt::NoButton, Qt::NoModifier); + page->event(&evrel); +} + +void tst_QWebPage::inputMethods() +{ + QFETCH(QString, viewType); + QWebPage* page = new QWebPage; + QObject* view = 0; + QObject* container = 0; + if (viewType == "QWebView") { + QWebView* wv = new QWebView; + wv->setPage(page); + view = wv; + container = view; + } else if (viewType == "QGraphicsWebView") { + QGraphicsWebView* wv = new QGraphicsWebView; + wv->setPage(page); + view = wv; + + QGraphicsView* gv = new QGraphicsView; + QGraphicsScene* scene = new QGraphicsScene(gv); + gv->setScene(scene); + scene->addItem(wv); + wv->setGeometry(QRect(0, 0, 500, 500)); + + container = gv; + } else + QVERIFY2(false, "Unknown view type"); + + page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont"); + page->mainFrame()->setHtml("<html><body>" \ + "<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/><br>" \ + "<input type='password'/>" \ + "</body></html>"); + page->mainFrame()->setFocus(); + + EventSpy viewEventSpy(container); + + QWebElementCollection inputs = page->mainFrame()->documentElement().findAll("input"); + QPoint textInputCenter = inputs.at(0).geometry().center(); + + clickOnPage(page, textInputCenter); + + // This part of the test checks if the SIP (Software Input Panel) is triggered, + // which normally happens on mobile platforms, when a user input form receives + // a mouse click. + int inputPanel = 0; + if (viewType == "QWebView") { + if (QWebView* wv = qobject_cast<QWebView*>(view)) + inputPanel = wv->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel); + } else if (viewType == "QGraphicsWebView") { + if (QGraphicsWebView* wv = qobject_cast<QGraphicsWebView*>(view)) + inputPanel = wv->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel); + } + + // For non-mobile platforms RequestSoftwareInputPanel event is not called + // because there is no SIP (Software Input Panel) triggered. In the case of a + // mobile platform, an input panel, e.g. virtual keyboard, is usually invoked + // and the RequestSoftwareInputPanel event is called. For these two situations + // this part of the test can verified as the checks below. + if (inputPanel) + QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); + else + QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); + viewEventSpy.clear(); + + clickOnPage(page, textInputCenter); + QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); + + //ImMicroFocus + QVariant variant = page->inputMethodQuery(Qt::ImMicroFocus); + QRect focusRect = variant.toRect(); + QVERIFY(inputs.at(0).geometry().contains(variant.toRect().topLeft())); + + //ImFont + variant = page->inputMethodQuery(Qt::ImFont); + QFont font = variant.value<QFont>(); + QCOMPARE(page->settings()->fontFamily(QWebSettings::SerifFont), font.family()); + + QList<QInputMethodEvent::Attribute> inputAttributes; + + //Insert text. + { + QInputMethodEvent eventText("QtWebKit", inputAttributes); + QSignalSpy signalSpy(page, SIGNAL(microFocusChanged())); + page->event(&eventText); + QCOMPARE(signalSpy.count(), 0); + } + + { + QInputMethodEvent eventText("", inputAttributes); + eventText.setCommitString(QString("QtWebKit"), 0, 0); + page->event(&eventText); + } + + //ImMaximumTextLength + variant = page->inputMethodQuery(Qt::ImMaximumTextLength); + QCOMPARE(20, variant.toInt()); + + //Set selection + inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 3, 2, QVariant()); + QInputMethodEvent eventSelection("",inputAttributes); + page->event(&eventSelection); + + //ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + int anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 3); + + //ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + int cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 5); + + //ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + QString selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("eb")); + + //Set selection with negative length + inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 6, -5, QVariant()); + QInputMethodEvent eventSelection3("",inputAttributes); + page->event(&eventSelection3); + + //ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 1); + + //ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 6); + + //ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("tWebK")); + + //ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + QString value = variant.value<QString>(); + QCOMPARE(value, QString("QtWebKit")); + + { + QList<QInputMethodEvent::Attribute> attributes; + // Clear the selection, so the next test does not clear any contents. + QInputMethodEvent::Attribute newSelection(QInputMethodEvent::Selection, 0, 0, QVariant()); + attributes.append(newSelection); + QInputMethodEvent event("composition", attributes); + page->event(&event); + } + + // A ongoing composition should not change the surrounding text before it is committed. + variant = page->inputMethodQuery(Qt::ImSurroundingText); + value = variant.value<QString>(); + QCOMPARE(value, QString("QtWebKit")); + + // Cancel current composition first + inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant()); + QInputMethodEvent eventSelection4("", inputAttributes); + page->event(&eventSelection4); + + // START - Tests for Selection when the Editor is NOT in Composition mode + + // LEFT to RIGHT selection + // Deselect the selection by sending MouseButtonPress events + // This moves the current cursor to the end of the text + clickOnPage(page, textInputCenter); + + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event(QString(), attributes); + event.setCommitString("XXX", 0, 0); + page->event(&event); + event.setCommitString(QString(), -2, 2); // Erase two characters. + page->event(&event); + event.setCommitString(QString(), -1, 1); // Erase one character. + page->event(&event); + variant = page->inputMethodQuery(Qt::ImSurroundingText); + value = variant.value<QString>(); + QCOMPARE(value, QString("QtWebKit")); + } + + //Move to the start of the line + page->triggerAction(QWebPage::MoveToStartOfLine); + + QKeyEvent keyRightEventPress(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier); + QKeyEvent keyRightEventRelease(QEvent::KeyRelease, Qt::Key_Right, Qt::NoModifier); + + //Move 2 characters RIGHT + for (int j = 0; j < 2; ++j) { + page->event(&keyRightEventPress); + page->event(&keyRightEventRelease); + } + + //Select to the end of the line + page->triggerAction(QWebPage::SelectEndOfLine); + + //ImAnchorPosition QtWebKit + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 2); + + //ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 8); + + //ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("WebKit")); + + //RIGHT to LEFT selection + //Deselect the selection (this moves the current cursor to the end of the text) + clickOnPage(page, textInputCenter); + + //ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 8); + + //ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 8); + + //ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + QKeyEvent keyLeftEventPress(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier); + QKeyEvent keyLeftEventRelease(QEvent::KeyRelease, Qt::Key_Left, Qt::NoModifier); + + //Move 2 characters LEFT + for (int i = 0; i < 2; ++i) { + page->event(&keyLeftEventPress); + page->event(&keyLeftEventRelease); + } + + //Select to the start of the line + page->triggerAction(QWebPage::SelectStartOfLine); + + //ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 6); + + //ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 0); + + //ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("QtWebK")); + + //END - Tests for Selection when the Editor is not in Composition mode + + //ImhHiddenText + QPoint passwordInputCenter = inputs.at(1).geometry().center(); + clickOnPage(page, passwordInputCenter); + + QVERIFY(inputMethodEnabled(view)); + QVERIFY(inputMethodHints(view) & Qt::ImhHiddenText); + + clickOnPage(page, textInputCenter); + QVERIFY(!(inputMethodHints(view) & Qt::ImhHiddenText)); + + page->mainFrame()->setHtml("<html><body><p>nothing to input here"); + viewEventSpy.clear(); + + QWebElement para = page->mainFrame()->findFirstElement("p"); + clickOnPage(page, para.geometry().center()); + + QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); + + //START - Test for sending empty QInputMethodEvent + page->mainFrame()->setHtml("<html><body>" \ + "<input type='text' id='input3' value='QtWebKit2'/>" \ + "</body></html>"); + page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input3'); inputEle.focus(); inputEle.select();"); + + //Send empty QInputMethodEvent + QInputMethodEvent emptyEvent; + page->event(&emptyEvent); + + QString inputValue = page->mainFrame()->evaluateJavaScript("document.getElementById('input3').value").toString(); + QCOMPARE(inputValue, QString("QtWebKit2")); + //END - Test for sending empty QInputMethodEvent + + page->mainFrame()->setHtml("<html><body>" \ + "<input type='text' id='input4' value='QtWebKit inputMethod'/>" \ + "</body></html>"); + page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input4'); inputEle.focus(); inputEle.select();"); + + // Clear the selection, also cancel the ongoing composition if there is one. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent::Attribute newSelection(QInputMethodEvent::Selection, 0, 0, QVariant()); + attributes.append(newSelection); + QInputMethodEvent event("", attributes); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + variant = page->inputMethodQuery(Qt::ImSurroundingText); + QString surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("QtWebKit inputMethod")); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 0); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 0); + + // 1. Insert a character to the begining of the line. + // Send temporary text, which makes the editor has composition 'm'. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("m", attributes); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("QtWebKit inputMethod")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 0); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 0); + + // Send temporary text, which makes the editor has composition 'n'. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("n", attributes); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("QtWebKit inputMethod")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 0); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 0); + + // Send commit text, which makes the editor conforms composition. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("o"); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oQtWebKit inputMethod")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 1); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 1); + + // 2. insert a character to the middle of the line. + // Send temporary text, which makes the editor has composition 'd'. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("d", attributes); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oQtWebKit inputMethod")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 1); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 1); + + // Send commit text, which makes the editor conforms composition. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("e"); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oeQtWebKit inputMethod")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 2); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 2); + + // 3. Insert a character to the end of the line. + page->triggerAction(QWebPage::MoveToEndOfLine); + + // Send temporary text, which makes the editor has composition 't'. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("t", attributes); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oeQtWebKit inputMethod")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 22); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 22); + + // Send commit text, which makes the editor conforms composition. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("t"); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oeQtWebKit inputMethodt")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 23); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 23); + + // 4. Replace the selection. + page->triggerAction(QWebPage::SelectPreviousWord); + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("inputMethodt")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oeQtWebKit inputMethodt")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 11); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 23); + + // Send temporary text, which makes the editor has composition 'w'. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("w", attributes); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oeQtWebKit ")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 11); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 11); + + // Send commit text, which makes the editor conforms composition. + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("2"); + page->event(&event); + } + + // ImCurrentSelection + variant = page->inputMethodQuery(Qt::ImCurrentSelection); + selectionValue = variant.value<QString>(); + QCOMPARE(selectionValue, QString("")); + + // ImSurroundingText + variant = page->inputMethodQuery(Qt::ImSurroundingText); + surroundingValue = variant.value<QString>(); + QCOMPARE(surroundingValue, QString("oeQtWebKit 2")); + + // ImCursorPosition + variant = page->inputMethodQuery(Qt::ImCursorPosition); + cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 12); + + // ImAnchorPosition + variant = page->inputMethodQuery(Qt::ImAnchorPosition); + anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 12); + + // Check sending RequestSoftwareInputPanel event + page->mainFrame()->setHtml("<html><body>" \ + "<input type='text' id='input5' value='QtWebKit inputMethod'/>" \ + "<div id='btnDiv' onclick='i=document.getElementById("input5"); i.focus();'>abc</div>"\ + "</body></html>"); + QWebElement inputElement = page->mainFrame()->findFirstElement("div"); + clickOnPage(page, inputElement.geometry().center()); + + QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); + delete container; +} + +void tst_QWebPage::inputMethodsTextFormat_data() +{ + QTest::addColumn<QString>("string"); + QTest::addColumn<int>("start"); + QTest::addColumn<int>("length"); + + QTest::newRow("") << QString("") << 0 << 0; + QTest::newRow("Q") << QString("Q") << 0 << 1; + QTest::newRow("Qt") << QString("Qt") << 0 << 1; + QTest::newRow("Qt") << QString("Qt") << 0 << 2; + QTest::newRow("Qt") << QString("Qt") << 1 << 1; + QTest::newRow("Qt ") << QString("Qt ") << 0 << 1; + QTest::newRow("Qt ") << QString("Qt ") << 1 << 1; + QTest::newRow("Qt ") << QString("Qt ") << 2 << 1; + QTest::newRow("Qt ") << QString("Qt ") << 2 << -1; + QTest::newRow("Qt ") << QString("Qt ") << -2 << 3; + QTest::newRow("Qt ") << QString("Qt ") << 0 << 3; + QTest::newRow("Qt by") << QString("Qt by") << 0 << 1; + QTest::newRow("Qt by Nokia") << QString("Qt by Nokia") << 0 << 1; +} + + +void tst_QWebPage::inputMethodsTextFormat() +{ + QWebPage* page = new QWebPage; + QWebView* view = new QWebView; + view->setPage(page); + page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont"); + page->mainFrame()->setHtml("<html><body>" \ + "<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/>"); + page->mainFrame()->evaluateJavaScript("document.getElementById('input1').focus()"); + page->mainFrame()->setFocus(); + view->show(); + + QFETCH(QString, string); + QFETCH(int, start); + QFETCH(int, length); + + QList<QInputMethodEvent::Attribute> attrs; + QTextCharFormat format; + format.setUnderlineStyle(QTextCharFormat::SingleUnderline); + format.setUnderlineColor(Qt::red); + attrs.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, start, length, format)); + QInputMethodEvent im(string, attrs); + page->event(&im); + + QTest::qWait(1000); + + delete view; +} + +void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector() +{ + QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool))); + + PluginPage* newPage = new PluginPage(m_view); + m_view->setPage(newPage); + + m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true); + + m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='lineedit' id='mylineedit'/></body></html>")); + QTRY_COMPARE(loadSpy.count(), 1); + + newPage->mainFrame()->evaluateJavaScript("function testme(text) { var lineedit = document.getElementById('mylineedit'); lineedit.setText(text); lineedit.selectAll(); }"); + + newPage->mainFrame()->evaluateJavaScript("testme('foo')"); + + DumpRenderTreeSupportQt::garbageCollectorCollect(); + + // don't crash! + newPage->mainFrame()->evaluateJavaScript("testme('bar')"); +} + +void tst_QWebPage::localURLSchemes() +{ + int i = QWebSecurityOrigin::localSchemes().size(); + + QWebSecurityOrigin::removeLocalScheme("file"); + QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); + QWebSecurityOrigin::addLocalScheme("file"); + QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); + + QWebSecurityOrigin::removeLocalScheme("qrc"); + QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i - 1); + QWebSecurityOrigin::addLocalScheme("qrc"); + QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); + + QString myscheme = "myscheme"; + QWebSecurityOrigin::addLocalScheme(myscheme); + QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i + 1); + QVERIFY(QWebSecurityOrigin::localSchemes().contains(myscheme)); + QWebSecurityOrigin::removeLocalScheme(myscheme); + QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); + QWebSecurityOrigin::removeLocalScheme(myscheme); + QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); +} + +static inline bool testFlag(QWebPage& webPage, QWebSettings::WebAttribute settingAttribute, const QString& jsObjectName, bool settingValue) +{ + webPage.settings()->setAttribute(settingAttribute, settingValue); + return webPage.mainFrame()->evaluateJavaScript(QString("(window.%1 != undefined)").arg(jsObjectName)).toBool(); +} + +void tst_QWebPage::testOptionalJSObjects() +{ + // Once a feature is enabled and the JS object is accessed turning off the setting will not turn off + // the visibility of the JS object any more. For this reason this test uses two QWebPage instances. + // Part of the test is to make sure that the QWebPage instances do not interfere with each other so turning on + // a feature for one instance will not turn it on for another. + + QWebPage webPage1; + QWebPage webPage2; + + webPage1.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl()); + webPage2.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl()); + + QEXPECT_FAIL("","Feature enabled/disabled checking problem. Look at bugs.webkit.org/show_bug.cgi?id=29867", Continue); + QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false); + QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", true), true); + QEXPECT_FAIL("","Feature enabled/disabled checking problem. Look at bugs.webkit.org/show_bug.cgi?id=29867", Continue); + QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false); + QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), true); + + QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false); + QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", true), true); + QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false); + QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", false), true); +} + +void tst_QWebPage::testEnablePersistentStorage() +{ + QWebPage webPage; + + // By default all persistent options should be disabled + QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), false); + QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), false); + QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), false); + QVERIFY(webPage.settings()->iconDatabasePath().isEmpty()); + + QWebSettings::enablePersistentStorage(); + + + QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true); + QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true); + QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true); + + QTRY_VERIFY(!webPage.settings()->offlineStoragePath().isEmpty()); + QTRY_VERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty()); + QTRY_VERIFY(!webPage.settings()->iconDatabasePath().isEmpty()); +} + +void tst_QWebPage::defaultTextEncoding() +{ + QWebFrame* mainFrame = m_page->mainFrame(); + + QString defaultCharset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); + QVERIFY(!defaultCharset.isEmpty()); + QCOMPARE(QWebSettings::globalSettings()->defaultTextEncoding(), defaultCharset); + + m_page->settings()->setDefaultTextEncoding(QString("utf-8")); + QString charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); + QCOMPARE(charset, QString("utf-8")); + QCOMPARE(m_page->settings()->defaultTextEncoding(), charset); + + m_page->settings()->setDefaultTextEncoding(QString()); + charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); + QVERIFY(!charset.isEmpty()); + QCOMPARE(charset, defaultCharset); + + QWebSettings::globalSettings()->setDefaultTextEncoding(QString("utf-8")); + charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); + QCOMPARE(charset, QString("utf-8")); + QCOMPARE(QWebSettings::globalSettings()->defaultTextEncoding(), charset); +} + +class ErrorPage : public QWebPage +{ +public: + + ErrorPage(QWidget* parent = 0): QWebPage(parent) + { + } + + virtual bool supportsExtension(Extension extension) const + { + return extension == ErrorPageExtension; + } + + virtual bool extension(Extension, const ExtensionOption* option, ExtensionReturn* output) + { + ErrorPageExtensionReturn* errorPage = static_cast<ErrorPageExtensionReturn*>(output); + + errorPage->contentType = "text/html"; + errorPage->content = "error"; + return true; + } +}; + +void tst_QWebPage::errorPageExtension() +{ + ErrorPage* page = new ErrorPage; + m_view->setPage(page); + + QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); + + m_view->setUrl(QUrl("data:text/html,foo")); + QTRY_COMPARE(spyLoadFinished.count(), 1); + + page->mainFrame()->setUrl(QUrl("http://non.existent/url")); + QTRY_COMPARE(spyLoadFinished.count(), 2); + QCOMPARE(page->mainFrame()->toPlainText(), QString("error")); + QCOMPARE(page->history()->count(), 2); + QCOMPARE(page->history()->currentItem().url(), QUrl("http://non.existent/url")); + QCOMPARE(page->history()->canGoBack(), true); + QCOMPARE(page->history()->canGoForward(), false); + + page->triggerAction(QWebPage::Back); + QTRY_COMPARE(page->history()->canGoBack(), false); + QTRY_COMPARE(page->history()->canGoForward(), true); + + page->triggerAction(QWebPage::Forward); + QTRY_COMPARE(page->history()->canGoBack(), true); + QTRY_COMPARE(page->history()->canGoForward(), false); + + page->triggerAction(QWebPage::Back); + QTRY_COMPARE(page->history()->canGoBack(), false); + QTRY_COMPARE(page->history()->canGoForward(), true); + QTRY_COMPARE(page->history()->currentItem().url(), QUrl("data:text/html,foo")); + + m_view->setPage(0); +} + +void tst_QWebPage::errorPageExtensionInIFrames() +{ + ErrorPage* page = new ErrorPage; + m_view->setPage(page); + + m_view->page()->mainFrame()->load(QUrl( + "data:text/html," + "<h1>h1</h1>" + "<iframe src='data:text/html,<p/>p'></iframe>" + "<iframe src='http://non.existent/url'></iframe>")); + QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); + QTRY_COMPARE(spyLoadFinished.count(), 1); + + QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("error")); + + m_view->setPage(0); +} + +void tst_QWebPage::errorPageExtensionInFrameset() +{ + ErrorPage* page = new ErrorPage; + m_view->setPage(page); + + m_view->load(QUrl("qrc:///resources/index.html")); + + QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); + QTRY_COMPARE(spyLoadFinished.count(), 1); + QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("error")); + + m_view->setPage(0); +} + +class FriendlyWebPage : public QWebPage +{ +public: + friend class tst_QWebPage; +}; + +void tst_QWebPage::userAgentApplicationName() +{ + const QString oldApplicationName = QCoreApplication::applicationName(); + FriendlyWebPage page; + + const QString applicationNameMarker = QString::fromUtf8("StrangeName\342\210\236"); + QCoreApplication::setApplicationName(applicationNameMarker); + QVERIFY(page.userAgentForUrl(QUrl()).contains(applicationNameMarker)); + + QCoreApplication::setApplicationName(oldApplicationName); +} + +void tst_QWebPage::userAgentLocaleChange() +{ + FriendlyWebPage page; + m_view->setPage(&page); + + const QString markerString = QString::fromLatin1(" nn-NO)"); + + if (page.userAgentForUrl(QUrl()).contains(markerString)) + QSKIP("marker string already present", SkipSingle); + + m_view->setLocale(QLocale(QString::fromLatin1("nn_NO"))); + QVERIFY(page.userAgentForUrl(QUrl()).contains(markerString)); +} + +void tst_QWebPage::crashTests_LazyInitializationOfMainFrame() +{ + { + QWebPage webPage; + } + { + QWebPage webPage; + webPage.selectedText(); + } + { + QWebPage webPage; + webPage.selectedHtml(); + } + { + QWebPage webPage; + webPage.triggerAction(QWebPage::Back, true); + } + { + QWebPage webPage; + QPoint pos(10,10); + webPage.updatePositionDependentActions(pos); + } +} + +static void takeScreenshot(QWebPage* page) +{ + QWebFrame* mainFrame = page->mainFrame(); + page->setViewportSize(mainFrame->contentsSize()); + QImage image(page->viewportSize(), QImage::Format_ARGB32); + QPainter painter(&image); + mainFrame->render(&painter); + painter.end(); +} + +void tst_QWebPage::screenshot_data() +{ + QTest::addColumn<QString>("html"); + QTest::newRow("WithoutPlugin") << "<html><body id='b'>text</body></html>"; + QTest::newRow("WindowedPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf'></embed></body></html>"); + QTest::newRow("WindowlessPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf' wmode='transparent'></embed></body></html>"); +} + +void tst_QWebPage::screenshot() +{ + if (!QDir(TESTS_SOURCE_DIR).exists()) + QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); + + QDir::setCurrent(TESTS_SOURCE_DIR); + + QFETCH(QString, html); + QWebPage* page = new QWebPage; + page->settings()->setAttribute(QWebSettings::PluginsEnabled, true); + QWebFrame* mainFrame = page->mainFrame(); + mainFrame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR)); + ::waitForSignal(mainFrame, SIGNAL(loadFinished(bool)), 2000); + + // take screenshot without a view + takeScreenshot(page); + + QWebView* view = new QWebView; + view->setPage(page); + + // take screenshot when attached to a view + takeScreenshot(page); + + delete page; + delete view; + + QDir::setCurrent(QApplication::applicationDirPath()); +} + +void tst_QWebPage::originatingObjectInNetworkRequests() +{ + TestNetworkManager* networkManager = new TestNetworkManager(m_page); + m_page->setNetworkAccessManager(networkManager); + networkManager->requests.clear(); + + m_view->setHtml(QString("<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()); + QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool)))); + + QCOMPARE(networkManager->requests.count(), 2); + + QList<QWebFrame*> childFrames = m_page->mainFrame()->childFrames(); + QCOMPARE(childFrames.count(), 2); + + for (int i = 0; i < 2; ++i) + QVERIFY(qobject_cast<QWebFrame*>(networkManager->requests.at(i).originatingObject()) == childFrames.at(i)); +} + +/** + * Test fixups for https://bugs.webkit.org/show_bug.cgi?id=30914 + * + * From JS we test the following conditions. + * + * OK + QString() => SUCCESS, empty string (but not null) + * OK + "text" => SUCCESS, "text" + * CANCEL + QString() => CANCEL, null string + * CANCEL + "text" => CANCEL, null string + */ +class JSPromptPage : public QWebPage { + Q_OBJECT +public: + JSPromptPage() + {} + + bool javaScriptPrompt(QWebFrame* frame, const QString& msg, const QString& defaultValue, QString* result) + { + if (msg == QLatin1String("test1")) { + *result = QString(); + return true; + } else if (msg == QLatin1String("test2")) { + *result = QLatin1String("text"); + return true; + } else if (msg == QLatin1String("test3")) { + *result = QString(); + return false; + } else if (msg == QLatin1String("test4")) { + *result = QLatin1String("text"); + return false; + } + + qFatal("Unknown msg."); + return QWebPage::javaScriptPrompt(frame, msg, defaultValue, result); + } +}; + +void tst_QWebPage::testJSPrompt() +{ + JSPromptPage page; + bool res; + + // OK + QString() + res = page.mainFrame()->evaluateJavaScript( + "var retval = prompt('test1');" + "retval=='' && retval.length == 0;").toBool(); + QVERIFY(res); + + // OK + "text" + res = page.mainFrame()->evaluateJavaScript( + "var retval = prompt('test2');" + "retval=='text' && retval.length == 4;").toBool(); + QVERIFY(res); + + // Cancel + QString() + res = page.mainFrame()->evaluateJavaScript( + "var retval = prompt('test3');" + "retval===null;").toBool(); + QVERIFY(res); + + // Cancel + "text" + res = page.mainFrame()->evaluateJavaScript( + "var retval = prompt('test4');" + "retval===null;").toBool(); + QVERIFY(res); +} + +class TestModalPage : public QWebPage +{ + Q_OBJECT +public: + TestModalPage(QObject* parent = 0) : QWebPage(parent) { + } + virtual QWebPage* createWindow(WebWindowType) { + QWebPage* page = new TestModalPage(); + connect(page, SIGNAL(windowCloseRequested()), page, SLOT(deleteLater())); + return page; + } +}; + +void tst_QWebPage::showModalDialog() +{ + TestModalPage page; + page.mainFrame()->setHtml(QString("<html></html>")); + QString res = page.mainFrame()->evaluateJavaScript("window.showModalDialog('javascript:window.returnValue=dialogArguments; window.close();', 'This is a test');").toString(); + QCOMPARE(res, QString("This is a test")); +} + +void tst_QWebPage::testStopScheduledPageRefresh() +{ + // Without QWebPage::StopScheduledPageRefresh + QWebPage page1; + page1.setNetworkAccessManager(new TestNetworkManager(&page1)); + page1.mainFrame()->setHtml("<html><head>" + "<meta http-equiv=\"refresh\"content=\"0;URL=qrc:///resources/index.html\">" + "</head><body><h1>Page redirects immediately...</h1>" + "</body></html>"); + QVERIFY(::waitForSignal(&page1, SIGNAL(loadFinished(bool)))); + QTest::qWait(500); + QCOMPARE(page1.mainFrame()->url(), QUrl(QLatin1String("qrc:///resources/index.html"))); + + // With QWebPage::StopScheduledPageRefresh + QWebPage page2; + page2.setNetworkAccessManager(new TestNetworkManager(&page2)); + page2.mainFrame()->setHtml("<html><head>" + "<meta http-equiv=\"refresh\"content=\"1;URL=qrc:///resources/index.html\">" + "</head><body><h1>Page redirect test with 1 sec timeout...</h1>" + "</body></html>"); + page2.triggerAction(QWebPage::StopScheduledPageRefresh); + QTest::qWait(1500); + QCOMPARE(page2.mainFrame()->url().toString(), QLatin1String("about:blank")); +} + +void tst_QWebPage::findText() +{ + m_view->setHtml(QString("<html><head></head><body><div>foo bar</div></body></html>")); + m_page->triggerAction(QWebPage::SelectAll); + QVERIFY(!m_page->selectedText().isEmpty()); + QVERIFY(!m_page->selectedHtml().isEmpty()); + m_page->findText(""); + QVERIFY(m_page->selectedText().isEmpty()); + QVERIFY(m_page->selectedHtml().isEmpty()); + QStringList words = (QStringList() << "foo" << "bar"); + foreach (QString subString, words) { + m_page->findText(subString, QWebPage::FindWrapsAroundDocument); + QCOMPARE(m_page->selectedText(), subString); + QCOMPARE(m_page->selectedHtml(), QString("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \">%1</span>").arg(subString)); + m_page->findText(""); + QVERIFY(m_page->selectedText().isEmpty()); + QVERIFY(m_page->selectedHtml().isEmpty()); + } +} + +struct ImageExtensionMap { + const char* extension; + const char* mimeType; +}; + +static const ImageExtensionMap extensionMap[] = { + { "bmp", "image/bmp" }, + { "css", "text/css" }, + { "gif", "image/gif" }, + { "html", "text/html" }, + { "htm", "text/html" }, + { "ico", "image/x-icon" }, + { "jpeg", "image/jpeg" }, + { "jpg", "image/jpeg" }, + { "js", "application/x-javascript" }, + { "mng", "video/x-mng" }, + { "pbm", "image/x-portable-bitmap" }, + { "pgm", "image/x-portable-graymap" }, + { "pdf", "application/pdf" }, + { "png", "image/png" }, + { "ppm", "image/x-portable-pixmap" }, + { "rss", "application/rss+xml" }, + { "svg", "image/svg+xml" }, + { "text", "text/plain" }, + { "tif", "image/tiff" }, + { "tiff", "image/tiff" }, + { "txt", "text/plain" }, + { "xbm", "image/x-xbitmap" }, + { "xml", "text/xml" }, + { "xpm", "image/x-xpm" }, + { "xsl", "text/xsl" }, + { "xhtml", "application/xhtml+xml" }, + { "wml", "text/vnd.wap.wml" }, + { "wmlc", "application/vnd.wap.wmlc" }, + { 0, 0 } +}; + +static QString getMimeTypeForExtension(const QString &ext) +{ + const ImageExtensionMap *e = extensionMap; + while (e->extension) { + if (ext.compare(QLatin1String(e->extension), Qt::CaseInsensitive) == 0) + return QLatin1String(e->mimeType); + ++e; + } + + return QString(); +} + +void tst_QWebPage::supportedContentType() +{ + QStringList contentTypes; + + // Add supported non image types... + contentTypes << "text/html" << "text/xml" << "text/xsl" << "text/plain" << "text/" + << "application/xml" << "application/xhtml+xml" << "application/vnd.wap.xhtml+xml" + << "application/rss+xml" << "application/atom+xml" << "application/json"; + + // Add supported image types... + Q_FOREACH(const QByteArray& imageType, QImageWriter::supportedImageFormats()) { + const QString mimeType = getMimeTypeForExtension(imageType); + if (!mimeType.isEmpty()) + contentTypes << mimeType; + } + + // Get the mime types supported by webkit... + const QStringList supportedContentTypes = m_page->supportedContentTypes(); + + Q_FOREACH(const QString& mimeType, contentTypes) + QVERIFY2(supportedContentTypes.contains(mimeType), QString("'%1' is not a supported content type!").arg(mimeType).toLatin1()); + + Q_FOREACH(const QString& mimeType, contentTypes) + QVERIFY2(m_page->supportsContentType(mimeType), QString("Cannot handle content types '%1'!").arg(mimeType).toLatin1()); +} + +class QtNAMThread : public QThread { +public: + QtNAMThread() + : m_qnam(0) + { + } + ~QtNAMThread() + { + quit(); + wait(); + } + + QNetworkAccessManager* networkAccessManager() + { + QMutexLocker lock(&m_mutex); + while (!m_qnam) + m_waitCondition.wait(&m_mutex); + return m_qnam; + } +protected: + void run() + { + Q_ASSERT(!m_qnam); + { + QMutexLocker lock(&m_mutex); + m_qnam = new QNetworkAccessManager; + m_waitCondition.wakeAll(); + } + exec(); + delete m_qnam; + } +private: + QNetworkAccessManager* m_qnam; + QMutex m_mutex; + QWaitCondition m_waitCondition; +}; + +void tst_QWebPage::networkAccessManagerOnDifferentThread() +{ + QtNAMThread qnamThread; + qnamThread.start(); + m_page->setNetworkAccessManager(qnamThread.networkAccessManager()); + QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool))); + QUrl url = QUrl("qrc:///resources/index.html"); + m_page->mainFrame()->load(url); + QTRY_COMPARE(loadSpy.count(), 1); + QCOMPARE(m_page->mainFrame()->childFrames()[0]->url(), QUrl("qrc:///resources/frame_a.html")); +} + +void tst_QWebPage::navigatorCookieEnabled() +{ + m_page->networkAccessManager()->setCookieJar(0); + QVERIFY(!m_page->networkAccessManager()->cookieJar()); + QVERIFY(!m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool()); + + m_page->networkAccessManager()->setCookieJar(new QNetworkCookieJar()); + QVERIFY(m_page->networkAccessManager()->cookieJar()); + QVERIFY(m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool()); +} + +#ifdef Q_OS_MAC +void tst_QWebPage::macCopyUnicodeToClipboard() +{ + QString unicodeText = QString::fromUtf8("αβγδεζηθικλμπ"); + m_page->mainFrame()->setHtml(QString("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>%1</body></html>").arg(unicodeText)); + m_page->triggerAction(QWebPage::SelectAll); + m_page->triggerAction(QWebPage::Copy); + + QString clipboardData = QString::fromUtf8(QApplication::clipboard()->mimeData()->data(QLatin1String("text/html"))); + + QVERIFY(clipboardData.contains(QLatin1String("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"))); + QVERIFY(clipboardData.contains(unicodeText)); +} +#endif + +QTEST_MAIN(tst_QWebPage) +#include "tst_qwebpage.moc" diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc new file mode 100644 index 0000000..0627cb4 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc @@ -0,0 +1,10 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>resources/index.html</file> + <file>resources/frame_a.html</file> + <file>resources/iframe.html</file> + <file>resources/iframe2.html</file> + <file>resources/iframe3.html</file> +</qresource> +</RCC> + diff --git a/Source/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/Source/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp b/Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp new file mode 100644 index 0000000..1ee6206 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp @@ -0,0 +1,437 @@ +/* + Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com> + + 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 <qdir.h> +#include <qwebframe.h> +#include <qwebpage.h> +#include <qwebplugindatabase.h> +#include <qwebsettings.h> +#include <qvariant.h> + +class tst_QWebPluginDatabase : public QObject +{ + Q_OBJECT + +private slots: + void installedPlugins(); + void searchPaths(); + void null_data(); + void null(); + void pluginForMimeType(); + void enabled(); + void operatorequal_data(); + void operatorequal(); + void preferredPlugin(); + void operatorassign_data(); + void operatorassign(); +}; + +typedef QWebPluginInfo::MimeType MimeType; + +void tst_QWebPluginDatabase::installedPlugins() +{ + QWebPage page; + page.settings()->setAttribute(QWebSettings::PluginsEnabled, true); + QWebFrame* frame = page.mainFrame(); + + QVariantMap jsPluginsMap = frame->evaluateJavaScript("window.navigator.plugins").toMap(); + QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins(); + QCOMPARE(plugins, QWebSettings::pluginDatabase()->plugins()); + + int length = jsPluginsMap["length"].toInt(); + QCOMPARE(length, plugins.count()); + + for (int i = 0; i < length; ++i) { + QWebPluginInfo plugin = plugins.at(i); + + QVariantMap jsPlugin = frame->evaluateJavaScript(QString("window.navigator.plugins[%1]").arg(i)).toMap(); + QString name = jsPlugin["name"].toString(); + QString description = jsPlugin["description"].toString(); + QString fileName = jsPlugin["filename"].toString(); + + QCOMPARE(plugin.name(), name); + QCOMPARE(plugin.description(), description); + QCOMPARE(QFileInfo(plugin.path()).fileName(), fileName); + + QList<MimeType> mimeTypes; + int mimeTypesCount = jsPlugin["length"].toInt(); + + for (int j = 0; j < mimeTypesCount; ++j) { + QVariantMap jsMimeType = frame->evaluateJavaScript(QString("window.navigator.plugins[%1][%2]").arg(i).arg(j)).toMap(); + + MimeType mimeType; + mimeType.name = jsMimeType["type"].toString(); + mimeType.description = jsMimeType["description"].toString(); + mimeType.fileExtensions = jsMimeType["suffixes"].toString().split(',', QString::SkipEmptyParts); + + mimeTypes.append(mimeType); + QVERIFY(plugin.supportsMimeType(mimeType.name)); + } + + QCOMPARE(plugin.mimeTypes(), mimeTypes); + + QVERIFY(!plugin.isNull()); + QVERIFY(plugin.isEnabled()); + } +} + +void tst_QWebPluginDatabase::searchPaths() +{ + QWebPluginDatabase* database = QWebSettings::pluginDatabase(); + QList<QWebPluginInfo> plugins = database->plugins(); + QStringList directories = database->searchPaths(); + QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories); + + database->setSearchPaths(directories); + QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories); + QCOMPARE(database->searchPaths(), directories); + QCOMPARE(database->plugins(), plugins); + database->refresh(); + QCOMPARE(database->plugins(), plugins); + + database->setSearchPaths(QStringList()); + QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories); + QCOMPARE(database->searchPaths(), QStringList()); + QCOMPARE(database->plugins().count(), 0); + + database->setSearchPaths(directories); + QCOMPARE(database->searchPaths(), directories); + database->addSearchPath(QDir::tempPath()); + QCOMPARE(database->searchPaths().count(), directories.count() + 1); + QVERIFY(database->searchPaths().contains(QDir::tempPath())); + directories.append(QDir::tempPath()); + QCOMPARE(database->searchPaths(), directories); + + // As an empty set of search paths has been set, the database has been rebuilt + // from scratch after bringing the old path set back. + // Because the QWebPlugins no longer point to the same PluginPackages, + // the list is also no longer equal to the older one, even though it contains + // the same information. + QCOMPARE(database->plugins().count(), plugins.count()); + plugins = database->plugins(); + QCOMPARE(database->plugins(), plugins); + + for (int i = (directories.count() - 1); i >= 0; --i) { + QDir directory(directories.at(i)); + if (!directory.exists() || !directory.count()) + directories.removeAt(i); + } + + database->setSearchPaths(directories); + QCOMPARE(database->plugins(), plugins); + database->refresh(); + QCOMPARE(database->plugins(), plugins); + + database->setSearchPaths(QWebPluginDatabase::defaultSearchPaths()); + directories = QWebPluginDatabase::defaultSearchPaths(); + QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories); + QCOMPARE(database->searchPaths(), directories); + QCOMPARE(database->plugins(), plugins); +} + +Q_DECLARE_METATYPE(QWebPluginInfo) +void tst_QWebPluginDatabase::null_data() +{ + QTest::addColumn<QWebPluginInfo>("plugin"); + QTest::addColumn<bool>("null"); + + QTest::newRow("null") << QWebPluginInfo() << true; + QTest::newRow("foo") << QWebSettings::pluginDatabase()->pluginForMimeType("foobarbaz") << true; + + QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins(); + for (int i = 0; i < plugins.count(); ++i) + QTest::newRow(QString::number(i).toUtf8().constData()) << plugins.at(i) << false; +} + +void tst_QWebPluginDatabase::null() +{ + QFETCH(QWebPluginInfo, plugin); + QFETCH(bool, null); + + QCOMPARE(plugin.isNull(), null); +} + +void tst_QWebPluginDatabase::pluginForMimeType() +{ + QMultiMap<QString, QWebPluginInfo> pluginsMap; + QWebPluginDatabase* database = QWebSettings::pluginDatabase(); + QList<QWebPluginInfo> plugins = database->plugins(); + + for (int i = 0; i < plugins.count(); ++i) { + QWebPluginInfo plugin = plugins.at(i); + + QList<MimeType> mimeTypes = plugin.mimeTypes(); + for (int j = 0; j < mimeTypes.count(); ++j) { + QString mimeType = mimeTypes.at(j).name; + pluginsMap.insert(mimeType, plugin); + QVERIFY(plugin.supportsMimeType(mimeType)); + } + } + + for (int i = 0; i < plugins.count(); ++i) { + QWebPluginInfo plugin = plugins.at(i); + + QList<MimeType> mimeTypes = plugin.mimeTypes(); + for (int j = 0; j < mimeTypes.count(); ++j) { + QString mimeType = mimeTypes.at(j).name; + + QVERIFY(pluginsMap.count(mimeType) > 0); + if (pluginsMap.count(mimeType) > 1) + continue; + + QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType); + QCOMPARE(pluginForMimeType, plugin); + database->setSearchPaths(database->searchPaths()); + QCOMPARE(pluginForMimeType, plugin); + QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toUpper())); + QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toLower())); + QVERIFY(plugin.supportsMimeType(mimeType)); + QVERIFY(!pluginForMimeType.isNull()); + QVERIFY(!plugin.isNull()); + } + } +} + +void tst_QWebPluginDatabase::enabled() +{ + QMultiMap<QString, QWebPluginInfo> pluginsMap; + QWebPluginDatabase* database = QWebSettings::pluginDatabase(); + QList<QWebPluginInfo> plugins = database->plugins(); + + for (int i = 0; i < plugins.count(); ++i) { + QWebPluginInfo plugin = plugins.at(i); + + QList<MimeType> mimeTypes = plugin.mimeTypes(); + for (int j = 0; j < mimeTypes.count(); ++j) { + QString mimeType = mimeTypes.at(j).name; + pluginsMap.insert(mimeType, plugin); + QVERIFY(plugin.supportsMimeType(mimeType)); + } + } + + QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin(); + while (it != pluginsMap.end()) { + QString mimeType = it.key(); + QWebPluginInfo plugin = it.value(); + QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType); + + QVERIFY(pluginsMap.count(mimeType) > 0); + + if (pluginsMap.count(mimeType) == 1) { + QCOMPARE(plugin, pluginForMimeType); + + QVERIFY(plugin.isEnabled()); + QVERIFY(pluginForMimeType.isEnabled()); + plugin.setEnabled(false); + QVERIFY(!plugin.isEnabled()); + QVERIFY(!pluginForMimeType.isEnabled()); + } else { + QVERIFY(plugin.isEnabled()); + QVERIFY(pluginForMimeType.isEnabled()); + plugin.setEnabled(false); + QVERIFY(!plugin.isEnabled()); + } + + QVERIFY(!plugin.isNull()); + QVERIFY(!pluginForMimeType.isNull()); + + QWebPluginInfo pluginForMimeType2 = database->pluginForMimeType(mimeType); + if (pluginsMap.count(mimeType) == 1) { + QVERIFY(pluginForMimeType2 != plugin); + QVERIFY(pluginForMimeType2.isNull()); + } else { + QVERIFY(pluginForMimeType2 != plugin); + QVERIFY(!pluginForMimeType2.isNull()); + } + + plugin.setEnabled(true); + + ++it; + } +} + +void tst_QWebPluginDatabase::operatorequal_data() +{ + QTest::addColumn<QWebPluginInfo>("first"); + QTest::addColumn<QWebPluginInfo>("second"); + QTest::addColumn<bool>("equal"); + + QWebPluginDatabase* database = QWebSettings::pluginDatabase(); + QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo() << true; + QTest::newRow("application/x-shockwave-flash") << database->pluginForMimeType("application/x-shockwave-flash") + << database->pluginForMimeType("application/x-shockwave-flash") << true; + QTest::newRow("foo/bar-baz") << database->pluginForMimeType("foo/bar-baz") + << database->pluginForMimeType("foo/bar-baz") << true; + + QList<QWebPluginInfo> plugins = database->plugins(); + for (int i = 0; i < (plugins.count() - 1); ++i) { + QWebPluginInfo first = plugins.at(i); + QWebPluginInfo second = plugins.at(i + 1); + + QTest::newRow(QString("%1==%2").arg(first.name(), second.name()).toUtf8().constData()) + << first << second << false; + } +} + +void tst_QWebPluginDatabase::operatorequal() +{ + QFETCH(QWebPluginInfo, first); + QFETCH(QWebPluginInfo, second); + QFETCH(bool, equal); + + QCOMPARE(first == second, equal); +} + +void tst_QWebPluginDatabase::preferredPlugin() +{ + QMultiMap<QString, QWebPluginInfo> pluginsMap; + QWebPluginDatabase* database = QWebSettings::pluginDatabase(); + QList<QWebPluginInfo> plugins = database->plugins(); + + for (int i = 0; i < plugins.count(); ++i) { + QWebPluginInfo plugin = plugins.at(i); + + QList<MimeType> mimeTypes = plugin.mimeTypes(); + for (int j = 0; j < mimeTypes.count(); ++j) { + QString mimeType = mimeTypes.at(j).name; + pluginsMap.insert(mimeType, plugin); + } + } + + QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin(); + while (it != pluginsMap.end()) { + QString mimeType = it.key(); + + if (pluginsMap.count(mimeType) > 1) { + QList<QWebPluginInfo> pluginsForMimeType = pluginsMap.values(mimeType); + QWebPluginInfo plugin = database->pluginForMimeType(mimeType); + QVERIFY(plugin.supportsMimeType(mimeType)); + + pluginsForMimeType.removeAll(plugin); + for (int i = 0; i < pluginsForMimeType.count(); ++i) { + QWebPluginInfo anotherPlugin = pluginsForMimeType.at(i); + QVERIFY(plugin.supportsMimeType(mimeType)); + QVERIFY(plugin != anotherPlugin); + + QCOMPARE(database->pluginForMimeType(mimeType), plugin); + database->setPreferredPluginForMimeType(mimeType, anotherPlugin); + QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin); + + anotherPlugin.setEnabled(false); + QCOMPARE(database->pluginForMimeType(mimeType), plugin); + + anotherPlugin.setEnabled(true); + QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin); + database->setSearchPaths(database->searchPaths()); + QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin); + + database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo()); + QCOMPARE(database->pluginForMimeType(mimeType), plugin); + } + } else { + QWebPluginInfo plugin = database->pluginForMimeType(mimeType); + QCOMPARE(pluginsMap.value(mimeType), plugin); + + database->setPreferredPluginForMimeType(mimeType, plugin); + QCOMPARE(database->pluginForMimeType(mimeType), plugin); + + plugin.setEnabled(false); + QCOMPARE(database->pluginForMimeType(mimeType), QWebPluginInfo()); + plugin.setEnabled(true); + + database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo()); + QCOMPARE(database->pluginForMimeType(mimeType), plugin); + } + + ++it; + } + + if (pluginsMap.keys().count() >= 2) { + QStringList mimeTypes = pluginsMap.uniqueKeys(); + + QString mimeType1 = mimeTypes.at(0); + QString mimeType2 = mimeTypes.at(1); + QWebPluginInfo plugin1 = database->pluginForMimeType(mimeType1); + QWebPluginInfo plugin2 = database->pluginForMimeType(mimeType2); + + int i = 2; + while (plugin2.supportsMimeType(mimeType1) + && !mimeType2.isEmpty() + && i < mimeTypes.count()) { + mimeType2 = mimeTypes.at(i); + plugin2 = database->pluginForMimeType(mimeType2); + ++i; + } + + plugin1 = database->pluginForMimeType(mimeType1); + QVERIFY(plugin1.supportsMimeType(mimeType1)); + QVERIFY(!plugin1.isNull()); + plugin2 = database->pluginForMimeType(mimeType2); + QVERIFY(plugin2.supportsMimeType(mimeType2)); + QVERIFY(!plugin2.isNull()); + + database->setPreferredPluginForMimeType(mimeType2, plugin1); + QVERIFY(!plugin1.supportsMimeType(mimeType2)); + QCOMPARE(database->pluginForMimeType(mimeType2), plugin2); + + database->setPreferredPluginForMimeType(mimeType1, plugin1); + QVERIFY(!plugin2.supportsMimeType(mimeType1)); + QCOMPARE(database->pluginForMimeType(mimeType2), plugin2); + } +} + +void tst_QWebPluginDatabase::operatorassign_data() +{ + QTest::addColumn<QWebPluginInfo>("first"); + QTest::addColumn<QWebPluginInfo>("second"); + + QWebPluginDatabase* database = QWebSettings::pluginDatabase(); + QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo(); + + QList<QWebPluginInfo> plugins = database->plugins(); + for (int i = 0; i < (plugins.count() - 1); ++i) { + QWebPluginInfo first = plugins.at(i); + QWebPluginInfo second = plugins.at(i + 1); + + QTest::newRow(QString("%1=%2").arg(first.name(), second.name()).toUtf8().constData()) << first << second; + } +} + +void tst_QWebPluginDatabase::operatorassign() +{ + QFETCH(QWebPluginInfo, first); + QFETCH(QWebPluginInfo, second); + + QWebPluginInfo info; + QCOMPARE(info.mimeTypes(), QList<MimeType>()); + QCOMPARE(info = first, first); + QCOMPARE(info, first); + QCOMPARE(info.mimeTypes(), first.mimeTypes()); + QCOMPARE(info = second, second); + QCOMPARE(info, second); + QCOMPARE(info.mimeTypes(), second.mimeTypes()); + QCOMPARE(info = QWebPluginInfo(), QWebPluginInfo()); + QCOMPARE(info.mimeTypes(), QList<MimeType>()); +} + +QTEST_MAIN(tst_QWebPluginDatabase) + +#include "tst_qwebplugindatabase.moc" diff --git a/Source/WebKit/qt/tests/qwebview/.gitignore b/Source/WebKit/qt/tests/qwebview/.gitignore new file mode 100644 index 0000000..444afe6 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebview/.gitignore @@ -0,0 +1 @@ +qwebview diff --git a/Source/WebKit/qt/tests/qwebview/qwebview.pro b/Source/WebKit/qt/tests/qwebview/qwebview.pro new file mode 100644 index 0000000..e915d60 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebview/qwebview.pro @@ -0,0 +1,3 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc diff --git a/Source/WebKit/qt/tests/qwebview/resources/frame_a.html b/Source/WebKit/qt/tests/qwebview/resources/frame_a.html new file mode 100644 index 0000000..9ff68f1 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebview/resources/frame_a.html @@ -0,0 +1,2 @@ +<a href="http://google.com" target="frame_b"><img src="" width=100 height=100 alt="Google"></a> +<a href="http://yahoo.com" target="frame_b"><img src="" width=100 height=100 alt="Yahoo"></a> diff --git a/Source/WebKit/qt/tests/qwebview/resources/index.html b/Source/WebKit/qt/tests/qwebview/resources/index.html new file mode 100644 index 0000000..c53ad09 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebview/resources/index.html @@ -0,0 +1,4 @@ +<frameset cols="25%,75%"> + <frame src="frame_a.html" name="frame_a"> + <frame src="frame_b.html" name="frame_b"> +</frameset> diff --git a/Source/WebKit/qt/tests/qwebview/resources/input_types.html b/Source/WebKit/qt/tests/qwebview/resources/input_types.html new file mode 100644 index 0000000..2e893af --- /dev/null +++ b/Source/WebKit/qt/tests/qwebview/resources/input_types.html @@ -0,0 +1,9 @@ +<html><body> +<input type='text' maxlength='20' style='position: absolute; left: 10px; top: 0px; height: 50px; width: 100px;'/><br> +<input type='password' style='position: absolute; left: 10px; top: 50px; height: 50px; width: 100px;'/><br> +<input type='tel' style='position: absolute; left: 10px; top: 100px; height: 50px; width: 100px;'/><br> +<input type='number' style='position: absolute; left: 10px; top: 150px; height: 50px; width: 100px;'/><br> +<input type='email' style='position: absolute; left: 10px; top: 200px; height: 50px; width: 100px;'/><br> +<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br> +<textarea style='position: absolute; left: 10px; top: 310px; height: 50px; width: 100px;' rows="2" cols="20">blah blah blah blah</textarea><br> +</body></html> diff --git a/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp new file mode 100644 index 0000000..7bf66b7 --- /dev/null +++ b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -0,0 +1,311 @@ +/* + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + Copyright (C) 2009 Torch Mobile Inc. + Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> + + 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 <qtest.h> +#include "../util.h" + +#include <qpainter.h> +#include <qwebview.h> +#include <qwebpage.h> +#include <qnetworkrequest.h> +#include <qdiriterator.h> +#include <qwebkitversion.h> +#include <qwebelement.h> +#include <qwebframe.h> + +class tst_QWebView : public QObject +{ + Q_OBJECT + +public slots: + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + +private slots: + void renderHints(); + void getWebKitVersion(); + + void reusePage_data(); + void reusePage(); + void microFocusCoordinates(); + void focusInputTypes(); + + void crashTests(); +}; + +// This will be called before the first test function is executed. +// It is only called once. +void tst_QWebView::initTestCase() +{ +} + +// This will be called after the last test function is executed. +// It is only called once. +void tst_QWebView::cleanupTestCase() +{ +} + +// This will be called before each test function is executed. +void tst_QWebView::init() +{ +} + +// This will be called after every test function. +void tst_QWebView::cleanup() +{ +} + +void tst_QWebView::renderHints() +{ + QWebView webView; + + // default is only text antialiasing + smooth pixmap transform + QVERIFY(!(webView.renderHints() & QPainter::Antialiasing)); + QVERIFY(webView.renderHints() & QPainter::TextAntialiasing); + QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform); + QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing)); + + webView.setRenderHint(QPainter::Antialiasing, true); + QVERIFY(webView.renderHints() & QPainter::Antialiasing); + QVERIFY(webView.renderHints() & QPainter::TextAntialiasing); + QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform); + QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing)); + + webView.setRenderHint(QPainter::Antialiasing, false); + QVERIFY(!(webView.renderHints() & QPainter::Antialiasing)); + QVERIFY(webView.renderHints() & QPainter::TextAntialiasing); + QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform); + QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing)); + + webView.setRenderHint(QPainter::SmoothPixmapTransform, true); + QVERIFY(!(webView.renderHints() & QPainter::Antialiasing)); + QVERIFY(webView.renderHints() & QPainter::TextAntialiasing); + QVERIFY(webView.renderHints() & QPainter::SmoothPixmapTransform); + QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing)); + + webView.setRenderHint(QPainter::SmoothPixmapTransform, false); + QVERIFY(webView.renderHints() & QPainter::TextAntialiasing); + QVERIFY(!(webView.renderHints() & QPainter::SmoothPixmapTransform)); + QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing)); +} + +void tst_QWebView::getWebKitVersion() +{ + QVERIFY(qWebKitVersion().toDouble() > 0); +} + +void tst_QWebView::reusePage_data() +{ + QTest::addColumn<QString>("html"); + QTest::newRow("WithoutPlugin") << "<html><body id='b'>text</body></html>"; + QTest::newRow("WindowedPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf'></embed></body></html>"); + QTest::newRow("WindowlessPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf' wmode=\"transparent\"></embed></body></html>"); +} + +void tst_QWebView::reusePage() +{ + if (!QDir(TESTS_SOURCE_DIR).exists()) + QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); + + QDir::setCurrent(TESTS_SOURCE_DIR); + + QFETCH(QString, html); + QWebView* view1 = new QWebView; + QPointer<QWebPage> page = new QWebPage; + view1->setPage(page); + page->settings()->setAttribute(QWebSettings::PluginsEnabled, true); + QWebFrame* mainFrame = page->mainFrame(); + mainFrame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR)); + if (html.contains("</embed>")) { + // some reasonable time for the PluginStream to feed test.swf to flash and start painting + waitForSignal(view1, SIGNAL(loadFinished(bool)), 2000); + } + + view1->show(); + QTest::qWaitForWindowShown(view1); + delete view1; + QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view + + QWebView *view2 = new QWebView; + view2->setPage(page); + view2->show(); // in Windowless mode, you should still be able to see the plugin here + QTest::qWaitForWindowShown(view2); + delete view2; + + delete page; // must not crash + + QDir::setCurrent(QApplication::applicationDirPath()); +} + +// Class used in crashTests +class WebViewCrashTest : public QObject { + Q_OBJECT + QWebView* m_view; +public: + bool m_executed; + + + WebViewCrashTest(QWebView* view) + : m_view(view) + , m_executed(false) + { + view->connect(view, SIGNAL(loadProgress(int)), this, SLOT(loading(int))); + } + +private slots: + void loading(int progress) + { + if (progress >= 20 && progress < 90) { + QVERIFY(!m_executed); + m_view->stop(); + m_executed = true; + } + } +}; + + +// Should not crash. +void tst_QWebView::crashTests() +{ + // Test if loading can be stopped in loadProgress handler without crash. + // Test page should have frames. + QWebView view; + WebViewCrashTest tester(&view); + QUrl url("qrc:///resources/index.html"); + view.load(url); + QTRY_VERIFY(tester.m_executed); // If fail it means that the test wasn't executed. +} + +void tst_QWebView::microFocusCoordinates() +{ + QWebPage* page = new QWebPage; + QWebView* webView = new QWebView; + webView->setPage( page ); + + page->mainFrame()->setHtml("<html><body>" \ + "<input type='text' id='input1' style='font--family: serif' value='' maxlength='20'/><br>" \ + "<canvas id='canvas1' width='500' height='500'/>" \ + "<input type='password'/><br>" \ + "<canvas id='canvas2' width='500' height='500'/>" \ + "</body></html>"); + + page->mainFrame()->setFocus(); + + QVariant initialMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus); + QVERIFY(initialMicroFocus.isValid()); + + page->mainFrame()->scroll(0,50); + + QVariant currentMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus); + QVERIFY(currentMicroFocus.isValid()); + + QCOMPARE(initialMicroFocus.toRect().translated(QPoint(0,-50)), currentMicroFocus.toRect()); +} + +void tst_QWebView::focusInputTypes() +{ + QWebView webView; + webView.show(); + QTest::qWaitForWindowShown(&webView); + + QUrl url("qrc:///resources/input_types.html"); + QWebFrame* const mainFrame = webView.page()->mainFrame(); + mainFrame->load(url); + mainFrame->setFocus(); + + QVERIFY(waitForSignal(&webView, SIGNAL(loadFinished(bool)))); + + // 'text' type + QWebElement inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=text]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + QVERIFY(webView.inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView.inputMethodHints() & Qt::ImhNoPredictiveText); +#else + QVERIFY(webView.inputMethodHints() == Qt::ImhNone); +#endif + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'password' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'tel' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=tel]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhDialableCharactersOnly); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'number' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=number]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhDigitsOnly); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'email' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=email]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhEmailCharactersOnly); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'url' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=url]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhUrlCharactersOnly); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'password' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'text' type + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=text]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + QVERIFY(webView.inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView.inputMethodHints() & Qt::ImhNoPredictiveText); +#else + QVERIFY(webView.inputMethodHints() == Qt::ImhNone); +#endif + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'password' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); + + // 'text area' field + inputElement = mainFrame->documentElement().findFirst(QLatin1String("textarea")); + QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); + QVERIFY(webView.inputMethodHints() == Qt::ImhNone); + QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); +} + +QTEST_MAIN(tst_QWebView) +#include "tst_qwebview.moc" + diff --git a/Source/WebKit/qt/tests/qwebview/tst_qwebview.qrc b/Source/WebKit/qt/tests/qwebview/tst_qwebview.qrc new file mode 100644 index 0000000..8710a9a --- /dev/null +++ b/Source/WebKit/qt/tests/qwebview/tst_qwebview.qrc @@ -0,0 +1,8 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>resources/index.html</file> + <file>resources/frame_a.html</file> + <file>resources/input_types.html</file> +</qresource> +</RCC> + diff --git a/Source/WebKit/qt/tests/resources/image2.png b/Source/WebKit/qt/tests/resources/image2.png Binary files differnew file mode 100644 index 0000000..8d70364 --- /dev/null +++ b/Source/WebKit/qt/tests/resources/image2.png diff --git a/Source/WebKit/qt/tests/resources/test.swf b/Source/WebKit/qt/tests/resources/test.swf Binary files differnew file mode 100644 index 0000000..8952982 --- /dev/null +++ b/Source/WebKit/qt/tests/resources/test.swf diff --git a/Source/WebKit/qt/tests/tests.pri b/Source/WebKit/qt/tests/tests.pri new file mode 100644 index 0000000..2e30dd0 --- /dev/null +++ b/Source/WebKit/qt/tests/tests.pri @@ -0,0 +1,24 @@ +TEMPLATE = app +CONFIG -= app_bundle + +VPATH += $$_PRO_FILE_PWD_ +# Add the tst_ prefix, In QTDIR_build it's done by qttest_p4.prf +CONFIG(QTDIR_build) { load(qttest_p4) } +ELSE { TARGET = tst_$$TARGET } +SOURCES += $${TARGET}.cpp +INCLUDEPATH += \ + $$PWD \ + $$PWD/../Api + +include(../../../../WebKit.pri) +QT += testlib network + +QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR + +symbian { + TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices +} + +# This define is used by some tests to look up resources in the source tree +!symbian: DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\" + diff --git a/Source/WebKit/qt/tests/tests.pro b/Source/WebKit/qt/tests/tests.pro new file mode 100644 index 0000000..22fece5 --- /dev/null +++ b/Source/WebKit/qt/tests/tests.pro @@ -0,0 +1,4 @@ + +TEMPLATE = subdirs +SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector hybridPixmap +SUBDIRS += benchmarks/painting benchmarks/loading diff --git a/Source/WebKit/qt/tests/util.h b/Source/WebKit/qt/tests/util.h new file mode 100644 index 0000000..c61bc6b --- /dev/null +++ b/Source/WebKit/qt/tests/util.h @@ -0,0 +1,78 @@ +/* + 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. +*/ +// Functions and macros that really need to be in QTestLib + +#include <QEventLoop> +#include <QSignalSpy> +#include <QTimer> + +#if !defined(TESTS_SOURCE_DIR) +#define TESTS_SOURCE_DIR "" +#endif + +/** + * 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 = 10000) +{ + 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(); +} + +// Will try to wait for the condition while allowing event processing +#define QTRY_VERIFY(__expr) \ + do { \ + const int __step = 50; \ + const int __timeout = 5000; \ + if (!(__expr)) { \ + QTest::qWait(0); \ + } \ + for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \ + QTest::qWait(__step); \ + } \ + QVERIFY(__expr); \ + } while(0) + +// 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) |