summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebKit')
-rw-r--r--src/3rdparty/webkit/WebKit/ChangeLog149
-rw-r--r--src/3rdparty/webkit/WebKit/LICENSE22
-rw-r--r--src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/headers.pri1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp391
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h38
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp651
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h115
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp189
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h19
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp149
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h15
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp12
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp272
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h (renamed from src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp28
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp27
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp198
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog1794
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp460
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h52
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp144
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/docs.pri4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp82
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.pngbin0 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp220
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.pngbin0 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp80
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp80
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp436
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp140
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/resources/test.swfbin0 -> 10085 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pro2
59 files changed, 4515 insertions, 1390 deletions
diff --git a/src/3rdparty/webkit/WebKit/ChangeLog b/src/3rdparty/webkit/WebKit/ChangeLog
index 2f8f18f39e..5006da7f66 100644
--- a/src/3rdparty/webkit/WebKit/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/ChangeLog
@@ -1,3 +1,152 @@
+2009-10-27 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Updated license
+
+ * LICENSE:
+
+2009-10-26 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Move some WebView event handling code into its own file, WebViewEventHandling.mm
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-10-19 John Gregg <johnnyg@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ set ENABLE_NOTIFICATIONS=1 for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=29949
+
+ * chromium/features.gypi:
+
+2009-10-13 Drew Wilson <atwilson@atwilson-macpro.local>
+
+ Reviewed by David Levin.
+
+ Enable SHARED_WORKERS for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=30289
+
+ * chromium/features.gypi:
+ Turned on ENABLE_SHARED_WORKERS by default. This doesn't actually turn on
+ SharedWorkers yet, as Chromium overrides this flag in its feature_overrides.gypi.
+
+2009-10-12 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Chromium Port - Windows
+ https://bugs.webkit.org/show_bug.cgi?id=29969
+
+ * chromium/DEPS: Added gtest dep required by windows and incremented some of the deps revisions.
+
+2009-10-06 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ accessibility/media-element.html crashes (and has incorrect result)
+ https://bugs.webkit.org/show_bug.cgi?id=30108
+
+ Fix up the accessibilty label for the newly added fullscreen button,
+ and update the test result accordingly.
+
+ * English.lproj/Localizable.strings:
+
+2009-10-05 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ * WebKit.xcodeproj/project.pbxproj: Add WebPluginHalterClient to the project.
+
+2009-10-05 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ One of the dependencies' SVN url was missing a @ before the revision number.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30101
+
+ * chromium/DEPS:
+
+2009-10-05 Pierre d'Herbemont <pdherbemont@webkit.org>
+
+ Reviewed by Simon Fraser
+
+ Support fullscreen in MediaPlayer (Mac)
+ https://bugs.webkit.org/show_bug.cgi?id=26742
+
+ Add new files for video fullscreen.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-10-05 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add testing harness for Web Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30010
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-10-04 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel
+
+ Enable Web Sockets in chromium build.
+ https://bugs.webkit.org/show_bug.cgi?id=29917
+
+ * chromium/features.gypi:
+
+2009-10-02 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added gyp_webkit that does a subset of the things gyp_chromium does
+ plus some specialization for an upstream chromium build.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29986
+
+ * chromium/DEPS: Points to gyp_webkit instead of gyp_chromium.
+ * chromium/gyp_webkit: A new python file.
+
+2009-10-01 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Make it possible to override the list of feature defines when building
+ downstream.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29979
+
+ * chromium/features.gypi:
+
+2009-10-01 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added windows-specific dependencies, updated some revisions and
+ re-organized file to make revision tracking easier. Also removed
+ extensions/v8 dependency that is no longer needed upstream.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29973
+
+ * chromium/DEPS:
+
+2009-09-30 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ 1. Keeping up with downstream revisions.
+ 2. Turning off v8 snapshot build step.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29928
+
+ * chromium/DEPS
+
2009-09-29 Brady Eidson <beidson@apple.com>
Reviewed by John Sullivan.
diff --git a/src/3rdparty/webkit/WebKit/LICENSE b/src/3rdparty/webkit/WebKit/LICENSE
index 47dee862ee..f29b41c3b2 100644
--- a/src/3rdparty/webkit/WebKit/LICENSE
+++ b/src/3rdparty/webkit/WebKit/LICENSE
@@ -1,25 +1,21 @@
-Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+Copyright (C) 2005, 2006, 2007, 2008, 2009 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.
+ 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.
+ documentation and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+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 OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+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.
+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.
diff --git a/src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig b/src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig
index 3229ab5c64..fabc00986e 100644
--- a/src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig
+++ b/src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 532;
-MINOR_VERSION = 1;
+MINOR_VERSION = 4;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
@@ -36,6 +36,7 @@ SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_V
SYSTEM_VERSION_PREFIX_1040 = 4;
SYSTEM_VERSION_PREFIX_1050 = 5;
SYSTEM_VERSION_PREFIX_1060 = 6;
+SYSTEM_VERSION_PREFIX_1070 = 7;
// The production build always uses the full version with a system version prefix.
BUNDLE_VERSION_Production = $(SYSTEM_VERSION_PREFIX)$(FULL_VERSION);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
index 5a95c67670..1a42597332 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
+++ b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
@@ -8,7 +8,6 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
$$PWD/qwebdatabase.h \
$$PWD/qwebsecurityorigin.h \
$$PWD/qwebelement.h \
- $$PWD/qwebplugindatabase.h \
$$PWD/qwebpluginfactory.h \
$$PWD/qwebhistory.h \
$$PWD/qwebinspector.h \
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index b11890de0c..640a924b09 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -1,5 +1,6 @@
/*
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
@@ -38,43 +39,36 @@ public:
QGraphicsWebViewPrivate(QGraphicsWebView* parent)
: q(parent)
, page(0)
- , interactive(true)
- , progress(1.0)
{}
+ virtual ~QGraphicsWebViewPrivate();
virtual void scroll(int dx, int dy, const QRect&);
virtual void update(const QRect& dirtyRect);
virtual void setInputMethodEnabled(bool enable);
+ virtual bool inputMethodEnabled() const;
#if QT_VERSION >= 0x040600
virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
#endif
+#ifndef QT_NO_CURSOR
virtual QCursor cursor() const;
virtual void updateCursor(const QCursor& cursor);
+#endif
+ virtual QPalette palette() const;
virtual int screenNumber() const;
- virtual WId winId() const;
+ virtual QWidget* ownerWidget() const;
+
+ virtual QObject* pluginParent() const;
- void _q_doLoadProgress(int progress);
void _q_doLoadFinished(bool success);
- void _q_setStatusBarMessage(const QString& message);
QGraphicsWebView* q;
QWebPage* page;
-
- QString statusBarMessage;
- bool interactive;
- qreal progress;
};
-void QGraphicsWebViewPrivate::_q_doLoadProgress(int progress)
+QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate()
{
- if (qFuzzyCompare(this->progress, qreal(progress / 100.)))
- return;
-
- this->progress = progress / 100.;
-
- emit q->progressChanged(this->progress);
}
void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success)
@@ -83,10 +77,7 @@ void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success)
if (q->title().isEmpty())
emit q->urlChanged(q->url());
- if (success)
- emit q->loadFinished();
- else
- emit q->loadFailed();
+ emit q->loadFinished(success);
}
void QGraphicsWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll)
@@ -99,9 +90,21 @@ void QGraphicsWebViewPrivate::update(const QRect & dirtyRect)
q->update(QRectF(dirtyRect));
}
+
void QGraphicsWebViewPrivate::setInputMethodEnabled(bool enable)
{
- q->setAttribute(Qt::WA_InputMethodEnabled, enable);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ q->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
+#endif
+}
+
+bool QGraphicsWebViewPrivate::inputMethodEnabled() const
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ return q->flags() & QGraphicsItem::ItemAcceptsInputMethod;
+#else
+ return false;
+#endif
}
#if QT_VERSION >= 0x040600
@@ -113,7 +116,7 @@ void QGraphicsWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool
q->setInputMethodHints(q->inputMethodHints() & ~hint);
}
#endif
-
+#ifndef QT_NO_CURSOR
QCursor QGraphicsWebViewPrivate::cursor() const
{
return q->cursor();
@@ -123,6 +126,12 @@ void QGraphicsWebViewPrivate::updateCursor(const QCursor& cursor)
{
q->setCursor(cursor);
}
+#endif
+
+QPalette QGraphicsWebViewPrivate::palette() const
+{
+ return q->palette();
+}
int QGraphicsWebViewPrivate::screenNumber() const
{
@@ -136,32 +145,89 @@ int QGraphicsWebViewPrivate::screenNumber() const
return 0;
}
-WId QGraphicsWebViewPrivate::winId() const
+QWidget* QGraphicsWebViewPrivate::ownerWidget() const
{
const QList<QGraphicsView*> views = q->scene()->views();
-
- if (!views.isEmpty())
- return views.at(0)->winId();
-
- return 0;
+ return views.value(0);
}
-void QGraphicsWebViewPrivate::_q_setStatusBarMessage(const QString& s)
+QObject* QGraphicsWebViewPrivate::pluginParent() const
{
- statusBarMessage = s;
- emit q->statusChanged();
+ return q;
}
/*!
\class QGraphicsWebView
- \brief The QGraphicsWebView class allows web content to be added to a GraphicsView.
+ \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView.
\since 4.6
- A WebGraphicsItem renders web content based on a URL or set data.
+ 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.
- 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 (eg. 980) for typical online web pages.
+ \sa loadStarted()
*/
/*!
@@ -181,12 +247,18 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
}
/*!
- Destroys the web graphicsitem.
+ Destroys the item.
*/
QGraphicsWebView::~QGraphicsWebView()
{
- if (d->page)
+ if (d->page) {
+#if QT_VERSION >= 0x040600
+ d->page->d->view.clear();
+#else
d->page->d->view = 0;
+#endif
+ d->page->d->client = 0; // unset the page client
+ }
if (d->page && d->page->parent() == this)
delete d->page;
@@ -234,26 +306,83 @@ bool QGraphicsWebView::sceneEvent(QEvent* 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;
+ }
+
+ 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 QT_VERSION >= 0x040400
- } else 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->resetCursor();
+ 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->resetCursor();
+ }
#endif
#endif
+ }
}
return QGraphicsWidget::event(event);
}
@@ -299,11 +428,13 @@ void QGraphicsWebView::setPage(QWebPage* page)
connect(d->page, SIGNAL(loadStarted()),
this, SIGNAL(loadStarted()));
connect(d->page, SIGNAL(loadProgress(int)),
- this, SLOT(_q_doLoadProgress(int)));
+ this, SIGNAL(loadProgress(int)));
connect(d->page, SIGNAL(loadFinished(bool)),
this, SLOT(_q_doLoadFinished(bool)));
connect(d->page, SIGNAL(statusBarMessage(const QString&)),
- this, SLOT(_q_setStatusBarMessage(const QString&)));
+ this, SIGNAL(statusBarMessage(const QString&)));
+ connect(d->page, SIGNAL(linkClicked(const QUrl &)),
+ this, SIGNAL(linkClicked(const QUrl &)));
}
/*!
@@ -374,7 +505,6 @@ void QGraphicsWebView::setZoomFactor(qreal factor)
return;
page()->mainFrame()->setZoomFactor(factor);
- emit zoomFactorChanged();
}
qreal QGraphicsWebView::zoomFactor() const
@@ -411,21 +541,6 @@ void QGraphicsWebView::setGeometry(const QRectF& rect)
}
/*!
- \property QGraphicsWebView::status
- \brief the load status message.
-
- Provides the latest status message set during the load of a URL.
- Commonly shown by Status Bar widgets.
-
- \sa statusChanged()
-*/
-
-QString QGraphicsWebView::status() const
-{
- return d->statusBarMessage;
-}
-
-/*!
Convenience slot that stops loading the document.
\sa reload(), loadFinished()
@@ -472,15 +587,6 @@ void QGraphicsWebView::reload()
}
/*!
- \property QGraphicsWebView::progress
- \brief the progress of loading the current URL, from 0 to 1.
-*/
-qreal QGraphicsWebView::progress() const
-{
- return d->progress;
-}
-
-/*!
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.
@@ -512,15 +618,14 @@ void QGraphicsWebView::load(const QNetworkRequest& request,
}
/*!
- \property QGraphicsWebView::html
- This property provides an HTML interface to the text in the webview.
+ Sets the content of the web view to the specified \a html.
- When setting this property, external objects such as stylesheets or images
- referenced in the HTML document are located relative to \a baseUrl.
+ 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 these methods, WebKit assumes that external resources such as
+ 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
@@ -533,11 +638,6 @@ void QGraphicsWebView::setHtml(const QString& html, const QUrl& baseUrl)
page()->mainFrame()->setHtml(html, baseUrl);
}
-QString QGraphicsWebView::toHtml() const
-{
- return page()->mainFrame()->toHtml();
-}
-
/*!
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
@@ -567,22 +667,19 @@ QWebHistory* QGraphicsWebView::history() const
}
/*!
- \property QGraphicsWebView::interactive
- \brief controls whether the item responds to mouse and key events.
-*/
+ \property QGraphicsWebView::modified
+ \brief whether the document was modified by the user
-bool QGraphicsWebView::isInteractive() const
-{
- return d->interactive;
-}
+ Parts of HTML documents can be editable for example through the
+ \c{contenteditable} attribute on HTML elements.
-void QGraphicsWebView::setInteractive(bool allowed)
+ By default, this property is false.
+*/
+bool QGraphicsWebView::isModified() const
{
- if (d->interactive == allowed)
- return;
-
- d->interactive = allowed;
- emit interactivityChanged();
+ if (d->page)
+ return d->page->isModified();
+ return false;
}
/*!
@@ -599,16 +696,57 @@ 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
+{
+ return page()->action(action);
+}
+
+/*!
+ 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;
+}
+
/*! \reimp
*/
void QGraphicsWebView::hoverMoveEvent(QGraphicsSceneHoverEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
QMouseEvent me = QMouseEvent(QEvent::MouseMove,
ev->pos().toPoint(), Qt::NoButton,
Qt::NoButton, Qt::NoModifier);
- d->page->setView(ev->widget());
d->page->event(&me);
ev->setAccepted(accepted);
}
@@ -628,7 +766,7 @@ void QGraphicsWebView::hoverLeaveEvent(QGraphicsSceneHoverEvent* ev)
*/
void QGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -642,7 +780,7 @@ void QGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -656,7 +794,7 @@ void QGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -670,7 +808,7 @@ void QGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -684,7 +822,7 @@ void QGraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::keyPressEvent(QKeyEvent* ev)
{
- if (d->interactive && d->page)
+ if (d->page)
d->page->event(ev);
if (!ev->isAccepted())
@@ -695,7 +833,7 @@ void QGraphicsWebView::keyPressEvent(QKeyEvent* ev)
*/
void QGraphicsWebView::keyReleaseEvent(QKeyEvent* ev)
{
- if (d->interactive && d->page)
+ if (d->page)
d->page->event(ev);
if (!ev->isAccepted())
@@ -751,7 +889,7 @@ void QGraphicsWebView::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
void QGraphicsWebView::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -769,7 +907,7 @@ void QGraphicsWebView::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
void QGraphicsWebView::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -787,7 +925,7 @@ void QGraphicsWebView::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
void QGraphicsWebView::dropEvent(QGraphicsSceneDragDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -818,7 +956,7 @@ void QGraphicsWebView::contextMenuEvent(QGraphicsSceneContextMenuEvent* ev)
*/
void QGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -833,11 +971,40 @@ void QGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent* ev)
*/
void QGraphicsWebView::inputMethodEvent(QInputMethodEvent* ev)
{
- if (d->interactive && d->page)
+ 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()
+*/
+
#include "moc_qgraphicswebview.cpp"
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
index a8478d86e5..f3afb4ce6a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
@@ -21,6 +21,7 @@
#define QGraphicsWebView_h
#include "qwebkitglobal.h"
+#include "qwebpage.h"
#include <QtCore/qurl.h>
#include <QtGui/qevent.h>
#include <QtGui/qgraphicswidget.h>
@@ -39,17 +40,14 @@ class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget {
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
- Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged)
- Q_PROPERTY(QString status READ status NOTIFY statusChanged)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
- Q_PROPERTY(QString html READ toHtml WRITE setHtml)
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
- Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
- Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactivityChanged)
+ Q_PROPERTY(bool modified READ isModified)
public:
- QGraphicsWebView(QGraphicsItem* parent = 0);
+ explicit QGraphicsWebView(QGraphicsItem* parent = 0);
~QGraphicsWebView();
QWebPage* page() const;
@@ -64,15 +62,11 @@ public:
qreal zoomFactor() const;
void setZoomFactor(qreal);
- bool isInteractive() const;
- void setInteractive(bool);
-
- qreal progress() const;
+ bool isModified() const;
void load(const QUrl &url);
void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray());
- QString toHtml() const;
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());
@@ -80,13 +74,21 @@ public:
QWebHistory* history() const;
QWebSettings* settings() const;
- QString status() const;
+ QAction* pageAction(QWebPage::WebAction action) const;
+ void triggerPageAction(QWebPage::WebAction action, bool checked = false);
+
+ bool findText(const QString& subString, QWebPage::FindFlags options = 0);
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();
@@ -95,16 +97,14 @@ public Q_SLOTS:
Q_SIGNALS:
void loadStarted();
- void loadFinished();
- void loadFailed();
+ void loadFinished(bool);
- void progressChanged(qreal);
- void interactivityChanged();
+ void loadProgress(int progress);
void urlChanged(const QUrl&);
void titleChanged(const QString&);
void iconChanged();
- void statusChanged();
- void zoomFactorChanged();
+ void statusBarMessage(const QString& message);
+ void linkClicked(const QUrl&);
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
@@ -133,9 +133,7 @@ protected:
virtual bool sceneEvent(QEvent*);
private:
- Q_PRIVATE_SLOT(d, void _q_doLoadProgress(int progress))
Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success))
- Q_PRIVATE_SLOT(d, void _q_setStatusBarMessage(const QString& message))
QGraphicsWebViewPrivate* const d;
friend class QGraphicsWebViewPrivate;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
index 939d881c04..8922150160 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
@@ -30,12 +30,14 @@
#include "Document.h"
#include "DocumentFragment.h"
#include "FrameView.h"
+#include "GraphicsContext.h"
#include "HTMLElement.h"
#include "JSGlobalObject.h"
#include "JSHTMLElement.h"
#include "JSObject.h"
#include "NodeList.h"
#include "PropertyNameArray.h"
+#include "RenderImage.h"
#include "ScriptFunctionCall.h"
#include "StaticNodeList.h"
#include "qt_runtime.h"
@@ -45,6 +47,8 @@
#include <parser/SourceCode.h>
#include <wtf/Vector.h>
+#include <QPainter>
+
using namespace WebCore;
class QWebElementPrivate {
@@ -198,23 +202,9 @@ bool QWebElement::isNull() const
\sa findFirst()
*/
-QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const
+QWebElementCollection QWebElement::findAll(const QString &selectorQuery) const
{
- QList<QWebElement> elements;
- if (!m_element)
- return elements;
-
- ExceptionCode exception = 0; // ###
- RefPtr<NodeList> nodes = m_element->querySelectorAll(selectorQuery, exception);
- if (!nodes)
- return elements;
-
- for (unsigned i = 0; i < nodes->length(); ++i) {
- WebCore::Node* n = nodes->item(i);
- elements.append(QWebElement(static_cast<Element*>(n)));
- }
-
- return elements;
+ return QWebElementCollection(*this, selectorQuery);
}
/*!
@@ -463,6 +453,30 @@ bool QWebElement::hasAttributes() const
}
/*!
+ 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()
@@ -678,7 +692,7 @@ static bool setupScriptContext(WebCore::Element* element, JSC::JSValue& thisValu
if (!scriptController)
return false;
- state = scriptController->globalObject()->globalExec();
+ state = scriptController->globalObject(mainThreadNormalWorld())->globalExec();
if (!state)
return false;
@@ -1133,7 +1147,7 @@ QWebElement QWebElement::clone() const
The element is still valid after removal, and can be inserted into other
parts of the document.
- \sa removeChildren(), removeFromDocument()
+ \sa removeAllChildren(), removeFromDocument()
*/
QWebElement &QWebElement::takeFromDocument()
{
@@ -1149,7 +1163,7 @@ QWebElement &QWebElement::takeFromDocument()
/*!
Removes this element from the document and makes it a null element.
- \sa removeChildren(), takeFromDocument()
+ \sa removeAllChildren(), takeFromDocument()
*/
void QWebElement::removeFromDocument()
{
@@ -1167,7 +1181,7 @@ void QWebElement::removeFromDocument()
\sa removeFromDocument(), takeFromDocument()
*/
-void QWebElement::removeChildren()
+void QWebElement::removeAllChildren()
{
if (!m_element)
return;
@@ -1411,3 +1425,600 @@ QWebElement QWebElement::enclosingElement(WebCore::Node* node)
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->layoutIfNeededRecursive();
+
+ 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/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
index 3db46379de..3833070b5f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
@@ -21,6 +21,7 @@
#define QWEBELEMENT_H
#include <QString>
+#include <QStringList>
#include <QRect>
#include <QVariant>
#include <QExplicitlySharedDataPointer>
@@ -31,7 +32,12 @@ namespace WebCore {
class Node;
}
+QT_BEGIN_NAMESPACE
+class QPainter;
+QT_END_NAMESPACE
+
class QWebFrame;
+class QWebElementCollection;
class QWebElementPrivate;
class QWEBKIT_EXPORT QWebElement {
@@ -46,8 +52,8 @@ public:
bool isNull() const;
- QList<QWebElement> findAll(const QString& selectorQuery) const;
- QWebElement findFirst(const QString& selectorQuery) const;
+ QWebElementCollection findAll(const QString &selectorQuery) const;
+ QWebElement findFirst(const QString &selectorQuery) const;
void setPlainText(const QString& text);
QString toPlainText() const;
@@ -67,6 +73,7 @@ public:
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;
@@ -92,7 +99,7 @@ public:
QWebElement document() const;
QWebFrame *webFrame() const;
- // TODO: Add QList<QWebElement> overloads
+ // TODO: Add QWebElementCollection overloads
// docs need example snippet
void appendInside(const QString& markup);
void appendInside(const QWebElement& element);
@@ -121,7 +128,7 @@ public:
QWebElement clone() const;
QWebElement& takeFromDocument();
void removeFromDocument();
- void removeChildren();
+ void removeAllChildren();
QVariant evaluateJavaScript(const QString& scriptSource);
@@ -133,6 +140,8 @@ public:
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*);
@@ -140,6 +149,7 @@ private:
static QWebElement enclosingElement(WebCore::Node*);
friend class QWebFrame;
+ friend class QWebElementCollection;
friend class QWebHitTestResult;
friend class QWebHitTestResultPrivate;
friend class QWebPage;
@@ -148,4 +158,101 @@ private:
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;
+};
+
#endif // QWEBELEMENT_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 780f862b75..e84b8dffed 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -185,6 +185,17 @@ void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUn
gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
}
+// Returns the value of counter in the element specified by \a id.
+QString QWEBKIT_EXPORT qt_drt_counterValueForElementById(QWebFrame* qFrame, const QString& id)
+{
+ Frame* frame = QWebFramePrivate::core(qFrame);
+ if (Document* document = frame->document()) {
+ Element* element = document->getElementById(id);
+ return WebCore::counterValueForElement(element);
+ }
+ return QString();
+}
+
QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame,
WebCore::HTMLFrameOwnerElement* ownerFrameElement,
const WebCore::String& frameName)
@@ -232,7 +243,7 @@ WebCore::Scrollbar* QWebFramePrivate::verticalScrollBar() const
return frame->view()->verticalScrollbar();
}
-void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
+void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer layer, const QRegion &clip)
{
if (!frame->view() || !frame->contentRenderer())
return;
@@ -241,24 +252,58 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
if (vector.isEmpty())
return;
- WebCore::FrameView* view = frame->view();
- view->layoutIfNeededRecursive();
-
GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
- if (clipRenderToViewport)
- view->paint(&context, vector.first());
- else
- view->paintContents(&context, vector.first());
+ WebCore::FrameView* view = frame->view();
+ view->layoutIfNeededRecursive();
- for (int i = 1; i < vector.size(); ++i) {
+ 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);
- if (clipRenderToViewport)
- view->paint(&context, clipRect);
- else
- view->paintContents(&context, clipRect);
+
+ int x = view->x();
+ int y = view->y();
+
+ if (layer & QWebFrame::ContentsLayer) {
+ context.save();
+
+ 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();
+ }
+
+ 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 (layer & QWebFrame::PanIconLayer)
+ view->paintPanScrollIcon(&context);
+
painter->restore();
}
}
@@ -279,7 +324,7 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
the HTML content readily available, you can use setHtml() instead.
The page() function returns a pointer to the web page object. See
- \l{Elements of QWebView} for an explanation of how web
+ \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
@@ -311,6 +356,19 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
\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)
@@ -386,7 +444,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
return;
JSC::JSLock lock(JSC::SilenceAssertionsOnly);
- JSDOMWindow* window = toJSDOMWindow(d->frame);
+ JSDOMWindow* window = toJSDOMWindow(d->frame, mainThreadNormalWorld());
JSC::Bindings::RootObject* root = d->frame->script()->bindingRootObject();
if (!window) {
qDebug() << "Warning: couldn't get window object";
@@ -426,7 +484,9 @@ QString QWebFrame::toPlainText() const
d->frame->view()->layout();
Element *documentElement = d->frame->document()->documentElement();
- return documentElement->innerText();
+ if (documentElement)
+ return documentElement->innerText();
+ return QString();
}
/*!
@@ -540,15 +600,26 @@ QUrl QWebFrame::url() const
*/
QUrl QWebFrame::requestedUrl() const
{
- // In the following edge cases (where the failing document
- // loader does not get commited by the frame loader) it is
- // safer to rely on outgoingReferrer than originalRequest.
- if (!d->frame->loader()->activeDocumentLoader()
- || (!d->frameLoaderClient->m_loadError.isNull()
- && !d->frame->loader()->outgoingReferrer().isEmpty()))
- return QUrl(d->frame->loader()->outgoingReferrer());
+ // 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 d->frame->loader()->originalRequest().url();
+ return loader->originalRequest().url();
}
/*!
\since 4.6
@@ -678,6 +749,11 @@ void QWebFrame::load(const QNetworkRequest &req,
case QNetworkAccessManager::PostOperation:
request.setHTTPMethod("POST");
break;
+#if QT_VERSION >= 0x040600
+ case QNetworkAccessManager::DeleteOperation:
+ request.setHTTPMethod("DELETE");
+ break;
+#endif
case QNetworkAccessManager::UnknownOperation:
// eh?
break;
@@ -705,12 +781,18 @@ void QWebFrame::load(const QNetworkRequest &req,
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.
- \sa toHtml()
+ \note This method will not affect session or global history for the frame.
+
+ \sa toHtml(), setContent()
*/
void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
{
@@ -718,7 +800,7 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
WebCore::ResourceRequest request(kurl);
const QByteArray utf8 = html.toUtf8();
WTF::RefPtr<WebCore::SharedBuffer> data = WebCore::SharedBuffer::create(utf8.constData(), utf8.length());
- WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), kurl);
+ WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), KURL());
d->frame->loader()->load(request, substituteData, false);
}
@@ -731,7 +813,9 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
The \a data is loaded immediately; external objects are loaded asynchronously.
- \sa toHtml()
+ \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)
{
@@ -741,11 +825,10 @@ void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, cons
QString actualMimeType = mimeType;
if (actualMimeType.isEmpty())
actualMimeType = QLatin1String("text/html");
- WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), kurl);
+ WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), 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.
@@ -932,44 +1015,37 @@ void QWebFrame::setScrollPosition(const QPoint &pos)
}
/*!
- Render the frame into \a painter clipping to \a clip.
+ \since 4.6
+ Render the \a layer of the frame using \a painter clipping to \a clip.
\sa print()
*/
-void QWebFrame::render(QPainter *painter, const QRegion &clip)
-{
- d->renderPrivate(painter, clip);
-}
-/*!
- Render the frame into \a painter.
-*/
-void QWebFrame::render(QPainter *painter)
+void QWebFrame::render(QPainter* painter, RenderLayer layer, const QRegion& clip)
{
- if (!d->frame->view())
- return;
-
- d->renderPrivate(painter, QRegion(d->frame->view()->frameRect()));
+ if (!clip.isEmpty())
+ d->renderPrivate(painter, layer, clip);
+ else if (d->frame->view())
+ d->renderPrivate(painter, layer, QRegion(d->frame->view()->frameRect()));
}
/*!
- \since 4.6
- \property QWebFrame::clipRenderToViewport
-
- Returns true if render will clip content to viewport; otherwise returns false.
+ Render the frame into \a painter clipping to \a clip.
*/
-bool QWebFrame::clipRenderToViewport() const
+void QWebFrame::render(QPainter *painter, const QRegion &clip)
{
- return d->clipRenderToViewport;
+ d->renderPrivate(painter, AllLayers, clip);
}
/*!
- \since 4.6
- Sets whether the content of a frame will be clipped to viewport when rendered.
+ Render the frame into \a painter.
*/
-void QWebFrame::setClipRenderToViewport(bool clipRenderToViewport)
+void QWebFrame::render(QPainter *painter)
{
- d->clipRenderToViewport = clipRenderToViewport;
+ if (!d->frame->view())
+ return;
+
+ d->renderPrivate(painter, AllLayers, QRegion(d->frame->view()->frameRect()));
}
/*!
@@ -1100,7 +1176,7 @@ QWebElement QWebFrame::documentElement() const
\sa QWebElement::findAll()
*/
-QList<QWebElement> QWebFrame::findAllElements(const QString &selectorQuery) const
+QWebElementCollection QWebFrame::findAllElements(const QString &selectorQuery) const
{
return documentElement().findAll(selectorQuery);
}
@@ -1248,9 +1324,9 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
ScriptController *proxy = d->frame->script();
QVariant rc;
if (proxy) {
- JSC::JSValue v = d->frame->loader()->executeScript(ScriptSourceCode(scriptSource)).jsValue();
+ JSC::JSValue v = d->frame->script()->executeScript(ScriptSourceCode(scriptSource)).jsValue();
int distance = 0;
- rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject()->globalExec(), v, QMetaType::Void, &distance);
+ rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance);
}
return rc;
}
@@ -1388,7 +1464,6 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult
if (!hitTest.innerNode())
return;
pos = hitTest.point();
- boundingRect = hitTest.boundingBox();
WebCore::TextDirection dir;
title = hitTest.title(dir);
linkText = hitTest.textContent();
@@ -1398,6 +1473,7 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult
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();
@@ -1645,4 +1721,3 @@ QWebFrame *QWebHitTestResult::frame() const
return 0;
return d->frame;
}
-
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
index 55c73b4132..08285f84ad 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -50,6 +50,7 @@ class QWebHitTestResult;
class QWebHistoryItem;
class QWebSecurityOrigin;
class QWebElement;
+class QWebElementCollection;
namespace WebCore {
class WidgetPrivate;
@@ -112,7 +113,6 @@ class QWEBKIT_EXPORT QWebFrame : public QObject {
Q_PROPERTY(QIcon icon READ icon)
Q_PROPERTY(QSize contentsSize READ contentsSize)
Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition)
- Q_PROPERTY(bool clipRenderToViewport READ clipRenderToViewport WRITE setClipRenderToViewport)
Q_PROPERTY(bool focus READ hasFocus)
private:
QWebFrame(QWebPage *parent, QWebFrameData *frameData);
@@ -165,10 +165,17 @@ public:
QPoint scrollPosition() const;
void setScrollPosition(const QPoint &pos);
- void render(QPainter *painter, const QRegion &clip);
- void render(QPainter *painter);
- bool clipRenderToViewport() const;
- void setClipRenderToViewport(bool clipRenderToViewport);
+ 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;
@@ -184,7 +191,7 @@ public:
QSize contentsSize() const;
QWebElement documentElement() const;
- QList<QWebElement> findAllElements(const QString &selectorQuery) const;
+ QWebElementCollection findAllElements(const QString &selectorQuery) const;
QWebElement findFirstElement(const QString &selectorQuery) const;
QWebHitTestResult hitTestContent(const QPoint &pos) const;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
index 632f83a268..081e65de7d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -70,7 +70,6 @@ public:
, allowsScrolling(true)
, marginWidth(-1)
, marginHeight(-1)
- , clipRenderToViewport(true)
{}
void init(QWebFrame* qframe, QWebFrameData* frameData);
@@ -82,7 +81,7 @@ public:
static WebCore::Frame* core(QWebFrame*);
static QWebFrame* kit(WebCore::Frame*);
- void renderPrivate(QPainter *painter, const QRegion &clip);
+ void renderPrivate(QPainter*, QWebFrame::RenderLayer, const QRegion& clip);
QWebFrame *q;
Qt::ScrollBarPolicy horizontalScrollBarPolicy;
@@ -94,7 +93,6 @@ public:
bool allowsScrolling;
int marginWidth;
int marginHeight;
- bool clipRenderToViewport;
};
class QWebHitTestResultPrivate {
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
index 5752d6697b..d852012b66 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
@@ -31,6 +31,11 @@
#include <QSharedData>
#include <QDebug>
+enum {
+ InitialHistoryVersion = 1,
+ DefaultHistoryVersion = InitialHistoryVersion
+};
+
/*!
\class QWebHistoryItem
\since 4.4
@@ -226,7 +231,8 @@ bool QWebHistoryItem::isValid() const
number of items is given by count(), and the history can be cleared with the
clear() function.
- QWebHistory's state can be saved with saveState() and loaded with restoreState().
+ QWebHistory's state can be saved to a QDataStream using the >> operator and loaded
+ by using the << operator.
\sa QWebHistoryItem, QWebHistoryInterface, QWebPage
*/
@@ -475,135 +481,72 @@ void QWebHistory::setMaximumItemCount(int count)
}
/*!
- \enum QWebHistory::HistoryStateVersion
+ \since 4.6
+ \fn QDataStream& operator<<(QDataStream& stream, const QWebHistory& history)
+ \relates QWebHistory
- This enum describes the versions available for QWebHistory's saveState() function:
+ \brief The operator<< function streams a history into a data stream.
- \value HistoryVersion_1 Version 1 (Qt 4.6)
- \value DefaultHistoryVersion The current default version in 1.
+ 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
- Restores the state of QWebHistory from the given \a buffer. Returns true
- if the history was successfully restored; otherwise returns false.
+ \brief The operator>> function loads a history from a data stream.
- \sa saveState()
+ Loads a QWebHistory from the specified \a stream into the given \a history.
*/
-bool QWebHistory::restoreState(const QByteArray& buffer)
+
+QDataStream& operator>>(QDataStream& source, QWebHistory& history)
{
- QDataStream stream(buffer);
+ QWebHistoryPrivate* d = history.d;
+
int version;
- bool result = false;
- stream >> version;
- switch (version) {
- case HistoryVersion_1: {
+ source >> version;
+
+ if (version == 1) {
int count;
int currentIndex;
- stream >> count >> currentIndex;
+ source >> count >> currentIndex;
- clear();
+ 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++) {
+ WebCore::HistoryItem* nullItem = d->lst->currentItem();
+ for (int i = 0; i < count; i++) {
WTF::PassRefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create();
- item->restoreState(stream, version);
+ item->restoreState(source, version);
d->lst->addItem(item);
}
d->lst->removeItem(nullItem);
- goToItem(itemAt(currentIndex));
- result = stream.status() == QDataStream::Ok;
+ history.goToItem(history.itemAt(currentIndex));
}
- break;
- }
- default: {} // result is false;
}
d->page()->updateNavigationActions();
- return result;
-};
-
-/*!
- \since 4.6
- Saves the state of this QWebHistory into a QByteArray.
-
- Saves the current state of this QWebHistory. The version number, \a version, is
- stored as part of the data.
-
- To restore the saved state, pass the return value to restoreState().
-
- \sa restoreState()
-*/
-QByteArray QWebHistory::saveState(HistoryStateVersion version) const
-{
- QByteArray buffer;
- QDataStream stream(&buffer, QIODevice::WriteOnly);
- stream << version;
-
- switch (version) {
- case HistoryVersion_1: {
- stream << count() << currentItemIndex();
-
- const WebCore::HistoryItemVector &items = d->lst->entries();
- for (unsigned i = 0; i < items.size(); i++)
- items[i].get()->saveState(stream, version);
-
- if (stream.status() != QDataStream::Ok)
- buffer = QByteArray(); // make buffer isNull()==true and isEmpty()==true
- break;
- }
- default:
- buffer.clear();
-
- }
-
- return buffer;
-}
-
-/*!
- \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. This is a
- convenience function and is equivalent to calling the saveState()
- method.
-
- \sa QWebHistory::saveState()
-*/
-
-QDataStream& operator<<(QDataStream& stream, const QWebHistory& history)
-{
- return stream << history.saveState();
-}
-
-/*!
- \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.
- This is a convenience function and it is equivalent to calling the restoreState()
- method.
-
- \sa QWebHistory::restoreState()
-*/
-
-QDataStream& operator>>(QDataStream& stream, QWebHistory& history)
-{
- QByteArray buffer;
- stream >> buffer;
- history.restoreState(buffer);
- return stream;
+ return source;
}
QWebPagePrivate* QWebHistoryPrivate::page()
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
index e46f124c05..cce4553565 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
@@ -42,9 +42,6 @@ public:
QWebHistoryItem &operator=(const QWebHistoryItem &other);
~QWebHistoryItem();
- //bool restoreState(QByteArray& buffer);
- //QByteArray saveState(QWebHistory::HistoryStateVersion version = DefaultHistoryVersion) const;
-
QUrl originalUrl() const;
QUrl url() const;
@@ -69,22 +66,10 @@ private:
QExplicitlySharedDataPointer<QWebHistoryItemPrivate> d;
};
-//QWEBKIT_EXPORT QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist);
-//QWEBKIT_EXPORT QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist);
-
class QWebHistoryPrivate;
class QWEBKIT_EXPORT QWebHistory {
public:
- enum HistoryStateVersion {
- HistoryVersion_1,
- /*, HistoryVersion_2, */
- DefaultHistoryVersion = HistoryVersion_1
- };
-
- bool restoreState(const QByteArray& buffer);
- QByteArray saveState(HistoryStateVersion version = DefaultHistoryVersion) const;
-
void clear();
QList<QWebHistoryItem> items() const;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
index 4578dc9a9d..f43cbbfd5b 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
@@ -50,6 +50,7 @@
\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
@@ -57,11 +58,6 @@
\o the QWebInspector is shown.
\endlist
- This class acts mostly as a container and a controller for the inspector.
- You can defer the creation and association of the QWebInspector until
- the first emission of QWebPage::webInspectorTriggered() to save additional
- resources.
-
\section1 Inspector configuration persistence
The inspector allows the user to configure some options through its
@@ -188,9 +184,3 @@ void QWebInspectorPrivate::adjustFrontendSize(const QSize& size)
frontend->resize(size);
}
-/*!
- \fn void QWebInspector::windowTitleChanged(const QString& newTitle);
-
- This is emitted to signal that this widget's title changed to \a newTitle.
-*/
-
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
index bb5bd64a48..a5c1ed5b4a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
@@ -39,9 +39,6 @@ public:
QSize sizeHint() const;
bool event(QEvent*);
-Q_SIGNALS:
- void windowTitleChanged(const QString& newTitle);
-
protected:
void resizeEvent(QResizeEvent* event);
void showEvent(QShowEvent* event);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 655fd0e376..aedf95a86b 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -77,6 +77,8 @@
#include "LocalizedStrings.h"
#include "Cache.h"
#include "runtime/InitializeThreading.h"
+#include "PageGroup.h"
+#include "QWebPageClient.h"
#include <QApplication>
#include <QBasicTimer>
@@ -106,6 +108,9 @@
#else
#include "qwebnetworkinterface.h"
#endif
+#if defined(Q_WS_X11)
+#include <QX11Info>
+#endif
using namespace WebCore;
@@ -137,6 +142,102 @@ QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
return page->handle()->page->groupName();
}
+class QWebPageWidgetClient : public QWebPageClient {
+public:
+ QWebPageWidgetClient(QWidget* view)
+ : view(view)
+ {
+ Q_ASSERT(view);
+ }
+
+ virtual void scroll(int dx, int dy, const QRect&);
+ virtual void update(const QRect& dirtyRect);
+ virtual void setInputMethodEnabled(bool enable);
+ virtual bool inputMethodEnabled() const;
+#if QT_VERSION >= 0x040600
+ virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+#endif
+
+#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 QObject* pluginParent() const;
+
+ QWidget* view;
+};
+
+void QWebPageWidgetClient::scroll(int dx, int dy, const QRect& rectToScroll)
+{
+ view->scroll(qreal(dx), qreal(dy), rectToScroll);
+}
+
+void QWebPageWidgetClient::update(const QRect & dirtyRect)
+{
+ view->update(dirtyRect);
+}
+
+void QWebPageWidgetClient::setInputMethodEnabled(bool enable)
+{
+ view->setAttribute(Qt::WA_InputMethodEnabled, enable);
+}
+
+bool QWebPageWidgetClient::inputMethodEnabled() const
+{
+ return view->testAttribute(Qt::WA_InputMethodEnabled);
+}
+
+#if QT_VERSION >= 0x040600
+void QWebPageWidgetClient::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+{
+ if (enable)
+ view->setInputMethodHints(view->inputMethodHints() | hint);
+ else
+ view->setInputMethodHints(view->inputMethodHints() & ~hint);
+}
+#endif
+#ifndef QT_NO_CURSOR
+QCursor QWebPageWidgetClient::cursor() const
+{
+ return view->cursor();
+}
+
+void QWebPageWidgetClient::updateCursor(const QCursor& cursor)
+{
+ view->setCursor(cursor);
+}
+#endif
+
+QPalette QWebPageWidgetClient::palette() const
+{
+ return view->palette();
+}
+
+int QWebPageWidgetClient::screenNumber() const
+{
+#if defined(Q_WS_X11)
+ if (view)
+ return view->x11Info().screen();
+#endif
+
+ return 0;
+}
+
+QWidget* QWebPageWidgetClient::ownerWidget() const
+{
+ return view;
+}
+
+QObject* QWebPageWidgetClient::pluginParent() const
+{
+ return view;
+}
+
// Lookup table mapping QWebPage::WebActions to the associated Editor commands
static const char* editorCommandWebActions[] =
{
@@ -262,7 +363,9 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions)
QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
: q(qq)
, client(0)
+#if QT_VERSION < 0x040600
, view(0)
+#endif
, inspectorFrontend(0)
, inspector(0)
, inspectorIsInternalOnly(false)
@@ -271,7 +374,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
{
WebCore::InitializeLoggingChannelsIfNecessary();
JSC::initializeThreading();
- WebCore::FrameLoader::setLocalLoadPolicy(WebCore::FrameLoader::AllowLocalLoadsForLocalAndSubstituteData);
+ WebCore::SecurityOrigin::setLocalLoadPolicy(WebCore::SecurityOrigin::AllowLocalLoadsForLocalAndSubstituteData);
chromeClient = new ChromeClientQt(q);
contextMenuClient = new ContextMenuClientQt();
@@ -279,9 +382,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
page = new Page(chromeClient, contextMenuClient, editorClient,
new DragClientQt(q), new InspectorClientQt(q), 0);
- // ### should be configurable
- page->settings()->setDefaultTextEncodingName("iso-8859-1");
-
settings = new QWebSettings(page->settings());
#ifndef QT_NO_UNDOSTACK
@@ -305,6 +405,8 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
history.d = new QWebHistoryPrivate(page->backForwardList());
memset(actions, 0, sizeof(actions));
+
+ PageGroup::setShouldTrackVisitedLinks(true);
}
QWebPagePrivate::~QWebPagePrivate()
@@ -381,7 +483,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMenu,
const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions)
{
- QMenu* menu = new QMenu(view);
+ QMenu* menu = new QMenu(q->view());
for (int i = 0; i < items->count(); ++i) {
const ContextMenuItem &item = items->at(i);
switch (item.type()) {
@@ -461,10 +563,10 @@ void QWebPagePrivate::updateAction(QWebPage::WebAction action)
switch (action) {
case QWebPage::Back:
- enabled = loader->canGoBackOrForward(-1);
+ enabled = page->canGoBackOrForward(-1);
break;
case QWebPage::Forward:
- enabled = loader->canGoBackOrForward(1);
+ enabled = page->canGoBackOrForward(1);
break;
case QWebPage::Stop:
enabled = loader->isLoading();
@@ -584,8 +686,6 @@ void QWebPagePrivate::timerEvent(QTimerEvent *ev)
void QWebPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
{
- q->setView(ev->widget());
-
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
@@ -606,8 +706,6 @@ void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev)
void QWebPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev)
{
- q->setView(ev->widget());
-
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
@@ -663,8 +761,6 @@ void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
void QWebPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev)
{
- q->setView(ev->widget());
-
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
@@ -750,8 +846,6 @@ void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button)
void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
{
- q->setView(ev->widget());
-
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
@@ -770,13 +864,13 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button)
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- if (view && view->testAttribute(Qt::WA_InputMethodEnabled)
+ if (client && client->inputMethodEnabled()
&& button == Qt::LeftButton && qApp->autoSipEnabled()) {
QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
- view->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
+ client->ownerWidget()->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) {
QEvent event(QEvent::RequestSoftwareInputPanel);
- QApplication::sendEvent(view, &event);
+ QApplication::sendEvent(client->ownerWidget(), &event);
}
}
@@ -833,8 +927,6 @@ QMenu *QWebPage::createStandardContextMenu()
#ifndef QT_NO_WHEELEVENT
void QWebPagePrivate::wheelEvent(QGraphicsSceneWheelEvent* ev)
{
- q->setView(ev->widget());
-
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
@@ -922,8 +1014,8 @@ void QWebPagePrivate::keyPressEvent(QKeyEvent *ev)
if (!handled) {
handled = true;
QFont defaultFont;
- if (view)
- defaultFont = view->font();
+ if (q->view())
+ defaultFont = q->view()->font();
QFontMetrics fm(defaultFont);
if (!handleScrolling(ev, frame)) {
switch (ev->key()) {
@@ -970,11 +1062,9 @@ void QWebPagePrivate::keyReleaseEvent(QKeyEvent *ev)
void QWebPagePrivate::focusInEvent(QFocusEvent*)
{
FocusController *focusController = page->focusController();
- Frame *frame = focusController->focusedFrame();
focusController->setActive(true);
- if (frame)
- focusController->setFocused(true);
- else
+ focusController->setFocused(true);
+ if (!focusController->focusedFrame())
focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame));
}
@@ -990,8 +1080,6 @@ void QWebPagePrivate::focusOutEvent(QFocusEvent*)
void QWebPagePrivate::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
{
- q->setView(ev->widget());
-
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos().toPoint(),
QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
@@ -1016,8 +1104,6 @@ void QWebPagePrivate::dragEnterEvent(QDragEnterEvent* ev)
void QWebPagePrivate::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
{
- q->setView(ev->widget());
-
#ifndef QT_NO_DRAGANDDROP
DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone);
page->dragController()->dragExited(&dragData);
@@ -1036,8 +1122,6 @@ void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent* ev)
void QWebPagePrivate::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
{
- q->setView(ev->widget());
-
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos().toPoint(),
QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
@@ -1392,8 +1476,6 @@ QWebInspector* QWebPagePrivate::getOrCreateInspector()
if (!inspector) {
QWebInspector* insp = new QWebInspector;
insp->setPage(q);
- insp->connect(q, SIGNAL(webInspectorTriggered(const QWebElement&)), SLOT(show()));
- insp->show(); // The inspector is expected to be shown on inspection
inspectorIsInternalOnly = true;
Q_ASSERT(inspector); // Associated through QWebInspector::setPage(q)
@@ -1598,7 +1680,7 @@ InspectorController* QWebPagePrivate::inspectorController()
*/
/*!
- Constructs an empty QWebView with parent \a parent.
+ Constructs an empty QWebPage with parent \a parent.
*/
QWebPage::QWebPage(QObject *parent)
: QObject(parent)
@@ -1684,8 +1766,17 @@ QWebHistory *QWebPage::history() const
*/
void QWebPage::setView(QWidget *view)
{
- if (d->view != view) {
+ if (this->view() != view) {
d->view = view;
+ if (!view) {
+ delete d->client;
+ d->client = 0;
+ } else {
+ if (!d->client)
+ d->client = new QWebPageWidgetClient(view);
+ else
+ static_cast<QWebPageWidgetClient*>(d->client)->view = view;
+ }
setViewportSize(view ? view->size() : QSize(0, 0));
}
}
@@ -1697,7 +1788,11 @@ void QWebPage::setView(QWidget *view)
*/
QWidget *QWebPage::view() const
{
+#if QT_VERSION < 0x040600
return d->view;
+#else
+ return d->view.data();
+#endif
}
/*!
@@ -1724,7 +1819,7 @@ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
{
Q_UNUSED(frame)
#ifndef QT_NO_MESSAGEBOX
- QMessageBox::information(d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
+ QMessageBox::information(view(), tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
#endif
}
@@ -1740,7 +1835,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
#ifdef QT_NO_MESSAGEBOX
return true;
#else
- return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No);
+ return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No);
#endif
}
@@ -1758,7 +1853,7 @@ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QStr
Q_UNUSED(frame)
bool ok = false;
#ifndef QT_NO_INPUTDIALOG
- QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);
+ QString x = QInputDialog::getText(view(), tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);
if (ok && result)
*result = x;
#endif
@@ -1783,7 +1878,7 @@ bool QWebPage::shouldInterruptJavaScript()
#ifdef QT_NO_MESSAGEBOX
return false;
#else
- return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
+ return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
#endif
}
@@ -1800,7 +1895,7 @@ bool QWebPage::shouldInterruptJavaScript()
*/
QWebPage *QWebPage::createWindow(WebWindowType type)
{
- QWebView *webView = qobject_cast<QWebView *>(d->view);
+ QWebView *webView = qobject_cast<QWebView *>(view());
if (webView) {
QWebView *newView = webView->createWindow(type);
if (newView)
@@ -1863,7 +1958,7 @@ void QWebPage::triggerAction(WebAction action, bool)
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);
+ /*FormState*/ 0, SendReferrer);
break;
}
// fall through
@@ -1926,11 +2021,9 @@ void QWebPage::triggerAction(WebAction action, bool)
editor->setBaseWritingDirection(RightToLeftWritingDirection);
break;
case InspectElement: {
- QWebElement inspectedElement(QWebElement::enclosingElement(d->hitTestResult.d->innerNonSharedNode.get()));
- emit webInspectorTriggered(inspectedElement);
-
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());
}
break;
@@ -1975,7 +2068,7 @@ void QWebPage::setViewportSize(const QSize &size) const
}
}
-QSize QWebPage::fixedContentsSize() const
+QSize QWebPage::preferredContentsSize() const
{
QWebFrame* frame = d->mainFrame;
if (frame) {
@@ -1988,7 +2081,7 @@ QSize QWebPage::fixedContentsSize() const
}
/*!
- \property QWebPage::fixedContentsSize
+ \property QWebPage::preferredContentsSize
\since 4.6
\brief the size of the fixed layout
@@ -1996,7 +2089,7 @@ QSize QWebPage::fixedContentsSize() const
1024x768 for example then webkit will layout the page as if the viewport were that size
rather than something different.
*/
-void QWebPage::setFixedContentsSize(const QSize &size) const
+void QWebPage::setPreferredContentsSize(const QSize &size) const
{
d->fixedLayoutSize = size;
@@ -2671,6 +2764,17 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
as a result of the user clicking on a "file upload" button in a HTML form where multiple
file selection is allowed.
+ \omitvalue ErrorPageExtension (introduced in Qt 4.6)
+*/
+
+/*!
+ \enum QWebPage::ErrorDomain
+ \since 4.6
+ \internal
+
+ \value QtNetwork
+ \value Http
+ \value WebKit
*/
/*!
@@ -2684,6 +2788,49 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
*/
/*!
+ \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 occoured 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::ErrorPageExtensionReturn
+*/
+
+/*!
+ \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::ErrorPageExtensionOption, QString::toUtf8()
+*/
+
+/*!
+ \fn QWebPage::ErrorPageExtensionReturn::ErrorPageExtensionReturn()
+
+ Constructs a new error page object.
+*/
+
+/*!
\class QWebPage::ChooseMultipleFilesExtensionOption
\since 4.5
\brief The ChooseMultipleFilesExtensionOption class describes the option
@@ -2729,7 +2876,7 @@ bool QWebPage::extension(Extension extension, const ExtensionOption *option, Ext
if (extension == ChooseMultipleFilesExtension) {
// FIXME: do not ignore suggestedFiles
QStringList suggestedFiles = static_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFileNames;
- QStringList names = QFileDialog::getOpenFileNames(d->view, QString::null);
+ QStringList names = QFileDialog::getOpenFileNames(view(), QString::null);
static_cast<ChooseMultipleFilesExtensionReturn*>(output)->fileNames = names;
return true;
}
@@ -2811,7 +2958,7 @@ QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFil
{
Q_UNUSED(parentFrame)
#ifndef QT_NO_FILEDIALOG
- return QFileDialog::getOpenFileName(d->view, QString::null, suggestedFile);
+ return QFileDialog::getOpenFileName(view(), QString::null, suggestedFile);
#else
return QString::null;
#endif
@@ -2850,6 +2997,9 @@ QNetworkProxy QWebPage::networkProxy() const
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)
@@ -3071,8 +3221,8 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
// Language
QLocale locale;
- if (d->view)
- locale = d->view->locale();
+ if (view())
+ locale = view()->locale();
QString name = locale.name();
name[2] = QLatin1Char('-');
ua.append(name);
@@ -3291,24 +3441,6 @@ quint64 QWebPage::bytesReceived() const
*/
/*!
- \fn void QWebPage::webInspectorTriggered(const QWebElement& inspectedElement);
- \since 4.6
-
- This signal is emitted when the user triggered an inspection through the
- context menu. If a QWebInspector is associated to this page, it should be
- visible to the user after this signal has been emitted.
-
- If still no QWebInspector is associated to this QWebPage after the emission
- of this signal, a privately owned inspector will be shown to the user.
-
- \note \a inspectedElement contains the QWebElement under the context menu.
- It is not garanteed to be the same as the focused element in the web
- inspector.
-
- \sa QWebInspector
-*/
-
-/*!
\fn void QWebPage::toolBarVisibilityChangeRequested(bool visible)
This signal is emitted whenever the visibility of the toolbar in a web browser
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index 41d1835911..8c455b1490 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -56,6 +56,7 @@ namespace WebCore {
class InspectorClientQt;
class ResourceHandle;
class HitTestResult;
+ class QNetworkReplyHandler;
struct FrameLoadRequest;
}
@@ -66,7 +67,7 @@ class QWEBKIT_EXPORT QWebPage : public QObject {
Q_PROPERTY(bool modified READ isModified)
Q_PROPERTY(QString selectedText READ selectedText)
Q_PROPERTY(QSize viewportSize READ viewportSize WRITE setViewportSize)
- Q_PROPERTY(QSize fixedContentsSize READ fixedContentsSize WRITE setFixedContentsSize)
+ 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)
@@ -236,8 +237,8 @@ public:
QSize viewportSize() const;
void setViewportSize(const QSize &size) const;
- QSize fixedContentsSize() const;
- void setFixedContentsSize(const QSize &size) const;
+ QSize preferredContentsSize() const;
+ void setPreferredContentsSize(const QSize &size) const;
virtual bool event(QEvent*);
bool focusNextPrevChild(bool next);
@@ -288,6 +289,8 @@ public:
enum ErrorDomain { QtNetwork, Http, WebKit };
class ErrorPageExtensionOption : public ExtensionOption {
public:
+ QUrl url;
+ QWebFrame* frame;
ErrorDomain domain;
int error;
QString errorString;
@@ -326,7 +329,6 @@ Q_SIGNALS:
void windowCloseRequested();
void printRequested(QWebFrame *frame);
void linkClicked(const QUrl &url);
- void webInspectorTriggered(const QWebElement& inspectedElement);
void toolBarVisibilityChangeRequested(bool visible);
void statusBarVisibilityChangeRequested(bool visible);
@@ -378,6 +380,7 @@ private:
friend class WebCore::FrameLoaderClientQt;
friend class WebCore::InspectorClientQt;
friend class WebCore::ResourceHandle;
+ friend class WebCore::QNetworkReplyHandler;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QWebPage::FindFlags)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index b9571fab42..f0f842d099 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -135,7 +135,12 @@ public:
#ifndef QT_NO_UNDOSTACK
QUndoStack *undoStack;
#endif
+
+#if QT_VERSION >= 0x040600
+ QWeakPointer<QWidget> view;
+#else
QWidget* view;
+#endif
bool insideOpenCall;
quint64 m_totalBytes;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp
index 623895f388..758e2573df 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp
@@ -18,7 +18,7 @@
*/
#include "config.h"
-#include "qwebplugindatabase.h"
+#include "qwebplugindatabase_p.h"
#include "PluginDatabase.h"
#include "PluginPackage.h"
@@ -26,6 +26,7 @@
using namespace WebCore;
/*!
+ \internal
\typedef QWebPluginInfo::MimeType
\since 4.6
\brief Represents a single MIME type supported by a plugin.
@@ -33,6 +34,7 @@ using namespace WebCore;
/*!
\class QWebPluginInfo
+ \internal
\since 4.6
\brief The QWebPluginInfo class represents a single Netscape plugin.
@@ -232,6 +234,7 @@ QWebPluginInfo &QWebPluginInfo::operator=(const QWebPluginInfo& other)
/*!
\class QWebPluginDatabase
+ \internal
\since 4.6
\brief The QWebPluginDatabase class provides an interface for managing
Netscape plugins used by WebKit in QWebPages.
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h
index b22c3de59e..b22c3de59e 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
index 7c44e37ee4..2a225c5765 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -30,6 +30,16 @@
using namespace WebCore;
+void QWEBKIT_EXPORT qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+{
+ SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
+void QWEBKIT_EXPORT qt_drt_resetOriginAccessWhiteLists()
+{
+ SecurityOrigin::resetOriginAccessWhiteLists();
+}
+
/*!
\class QWebSecurityOrigin
\since 4.5
@@ -239,21 +249,3 @@ QStringList QWebSecurityOrigin::localSchemes()
}
return list;
}
-
-/*!
- \since 4.6
- \internal
-*/
-void QWebSecurityOrigin::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
-{
- SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
-}
-
-/*!
- \since 4.6
- \internal
-*/
-void QWebSecurityOrigin::resetOriginAccessWhiteLists()
-{
- SecurityOrigin::resetOriginAccessWhiteLists();
-}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
index 94b96f0aa3..16f8bc1d4d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
@@ -40,8 +40,6 @@ public:
static void addLocalScheme(const QString& scheme);
static void removeLocalScheme(const QString& scheme);
static QStringList localSchemes();
- static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
- static void resetOriginAccessWhiteLists();
~QWebSecurityOrigin();
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index eedf7d1571..b637d04531 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -22,7 +22,7 @@
#include "qwebpage.h"
#include "qwebpage_p.h"
-#include "qwebplugindatabase.h"
+#include "qwebplugindatabase_p.h"
#include "Cache.h"
#include "CrossOriginPreflightResultCache.h"
@@ -198,10 +198,7 @@ void QWebSettingsPrivate::apply()
value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls,
global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls));
settings->setAllowUniversalAccessFromFileURLs(value);
-
- value = attributes.value(QWebSettings::SessionStorageEnabled,
- global->attributes.value(QWebSettings::SessionStorageEnabled));
- settings->setSessionStorageEnabled(value);
+ settings->setUsesPageCache(WebCore::pageCache()->capacity());
} else {
QList<QWebSettingsPrivate*> settings = *::allSettings();
for (int i = 0; i < settings.count(); ++i)
@@ -265,7 +262,7 @@ QWebSettings* QWebSettings::globalSettings()
setOfflineStoragePath() with an appropriate file path, and can limit the quota
for each application by calling setOfflineStorageDefaultQuota().
- \sa QWebPage::settings(), QWebView::settings(), {Browser}
+ \sa QWebPage::settings(), QWebView::settings(), {Web Browser}
*/
/*!
@@ -342,9 +339,9 @@ QWebSettings* QWebSettings::globalSettings()
web application cache feature is enabled or not. Disabled by default.
\value LocalStorageEnabled Specifies whether support for the HTML 5
local storage feature is enabled or not. 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.
- \value SessionStorageEnabled Specifies whether support for the HTML 5
- session storage feature is enabled or not. Enabled by default.
*/
/*!
@@ -375,8 +372,8 @@ QWebSettings::QWebSettings()
d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, false);
d->attributes.insert(QWebSettings::LocalStorageEnabled, false);
d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false);
- d->attributes.insert(QWebSettings::SessionStorageEnabled, true);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
+ d->defaultTextEncoding = QLatin1String("iso-8859-1");
}
/*!
@@ -560,9 +557,9 @@ QIcon QWebSettings::iconForUrl(const QUrl& url)
return* icon;
}
-/*!
+/*
Returns the plugin database object.
-*/
+
QWebPluginDatabase *QWebSettings::pluginDatabase()
{
static QWebPluginDatabase* database = 0;
@@ -570,6 +567,7 @@ QWebPluginDatabase *QWebSettings::pluginDatabase()
database = new QWebPluginDatabase();
return database;
}
+*/
/*!
Sets \a graphic to be drawn when QtWebKit needs to draw an image of the
@@ -628,11 +626,6 @@ void QWebSettings::clearMemoryCaches()
// Invalidating the font cache and freeing all inactive font data.
WebCore::fontCache()->invalidate();
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
- // Empty the application cache.
- WebCore::cacheStorage().empty();
-#endif
-
// Empty the Cross-Origin Preflight cache
WebCore::CrossOriginPreflightResultCache::shared().empty();
}
@@ -650,7 +643,9 @@ void QWebSettings::clearMemoryCaches()
*/
void QWebSettings::setMaximumPagesInCache(int pages)
{
+ QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;
WebCore::pageCache()->setCapacity(qMax(0, pages));
+ global->apply();
}
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
index 4790823e89..50cf424397 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
@@ -67,7 +67,6 @@ public:
LocalStorageDatabaseEnabled = LocalStorageEnabled,
#endif
LocalContentCanAccessRemoteUrls,
- SessionStorageEnabled,
DnsPrefetchEnabled
};
enum WebGraphic {
@@ -108,7 +107,7 @@ public:
static void clearIconDatabase();
static QIcon iconForUrl(const QUrl &url);
- static QWebPluginDatabase *pluginDatabase();
+ //static QWebPluginDatabase *pluginDatabase();
static void setWebGraphic(WebGraphic type, const QPixmap &graphic);
static QPixmap webGraphic(WebGraphic type);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index b06b93a6f2..8ee43a102f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -1,6 +1,7 @@
/*
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
@@ -31,11 +32,8 @@
#include "qprinter.h"
#include "qdir.h"
#include "qfile.h"
-#if defined(Q_WS_X11)
-#include <QX11Info>
-#endif
-class QWebViewPrivate : public QWebPageClient {
+class QWebViewPrivate {
public:
QWebViewPrivate(QWebView *view)
: view(view)
@@ -45,19 +43,6 @@ public:
Q_ASSERT(view);
}
- virtual void scroll(int dx, int dy, const QRect&);
- virtual void update(const QRect& dirtyRect);
- virtual void setInputMethodEnabled(bool enable);
-#if QT_VERSION >= 0x040600
- virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
-#endif
-
- virtual QCursor cursor() const;
- virtual void updateCursor(const QCursor& cursor);
-
- virtual int screenNumber() const;
- virtual WId winId() const;
-
void _q_pageDestroyed();
QWebView *view;
@@ -66,58 +51,6 @@ public:
QPainter::RenderHints renderHints;
};
-void QWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll)
-{
- view->scroll(qreal(dx), qreal(dy), rectToScroll);
-}
-
-void QWebViewPrivate::update(const QRect & dirtyRect)
-{
- view->update(dirtyRect);
-}
-
-void QWebViewPrivate::setInputMethodEnabled(bool enable)
-{
- view->setAttribute(Qt::WA_InputMethodEnabled, enable);
-}
-#if QT_VERSION >= 0x040600
-void QWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
-{
- if (enable)
- view->setInputMethodHints(view->inputMethodHints() | hint);
- else
- view->setInputMethodHints(view->inputMethodHints() & ~hint);
-}
-#endif
-
-QCursor QWebViewPrivate::cursor() const
-{
- return view->cursor();
-}
-
-void QWebViewPrivate::updateCursor(const QCursor& cursor)
-{
- view->setCursor(cursor);
-}
-
-int QWebViewPrivate::screenNumber() const
-{
-#if defined(Q_WS_X11)
- if (view)
- return view->x11Info().screen();
-#endif
-
- return 0;
-}
-
-WId QWebViewPrivate::winId() const
-{
- if (view)
- return view->winId();
-
- return 0;
-}
-
void QWebViewPrivate::_q_pageDestroyed()
{
page = 0;
@@ -137,7 +70,7 @@ void QWebViewPrivate::_q_pageDestroyed()
It can be used in various applications to display web content live from the
Internet.
- The image below shows QWebView previewed in \QD with the Trolltech website.
+ The image below shows QWebView previewed in \QD with a Nokia website.
\image qwebview-url.png
@@ -231,8 +164,15 @@ QWebView::QWebView(QWidget *parent)
*/
QWebView::~QWebView()
{
- if (d->page)
+ if (d->page) {
+#if QT_VERSION >= 0x040600
+ d->page->d->view.clear();
+#else
d->page->d->view = 0;
+#endif
+ delete d->page->d->client;
+ d->page->d->client = 0;
+ }
if (d->page && d->page->parent() == this)
delete d->page;
@@ -276,7 +216,6 @@ void QWebView::setPage(QWebPage* page)
d->page = page;
if (d->page) {
d->page->setView(this);
- d->page->d->client = d; // set the page client
d->page->setPalette(palette());
// #### connect signals
QWebFrame *mainFrame = d->page->mainFrame();
@@ -308,84 +247,11 @@ void QWebView::setPage(QWebPage* page)
}
/*!
- Returns a valid URL from a user supplied \a string if one can be deducted.
- In the case that is not possible, an invalid QUrl() is returned.
-
- \since 4.6
-
- Most applications that can browse the web, allow the user to input a URL
- in the form of a plain string. This string can be manually typed into
- a location bar, obtained from the clipboard, or passed in via command
- line arguments.
-
- When the string is not already a valid URL, a best guess is performed,
- making various web related assumptions.
-
- In the case the string corresponds to a valid file path on the system,
- a file:// URL is constructed, using QUrl::fromLocalFile().
-
- If that is not the case, an attempt is made to turn the string into a
- http:// or ftp:// URL. The latter in the case the string starts with
- 'ftp'. The result is then passed through QUrl's tolerant parser, and
- in the case or success, a valid QUrl is returned, or else a QUrl().
-
- \section1 Examples:
-
- \list
- \o webkit.org becomes http://webkit.org
- \o ftp.webkit.org becomes ftp://ftp.webkit.org
- \o localhost becomes http://localhost
- \o /home/user/test.html becomes file:///home/user/test.html (if exists)
- \endlist
-
- \section2 Tips when dealing with URLs and strings:
-
- \list
- \o When creating a QString from a QByteArray or a char*, always use
- QString::fromUtf8().
- \o Do not use QUrl(string), nor QUrl::toString() anywhere where the URL might
- be used, such as in the location bar, as those functions loose data.
- Instead use QUrl::fromEncoded() and QUrl::toEncoded(), respectively.
- \endlist
- */
-QUrl QWebView::guessUrlFromString(const QString &string)
-{
- QString trimmedString = string.trimmed();
-
- // Check the most common case of a valid url with scheme and host first
- QUrl url = QUrl::fromEncoded(trimmedString.toUtf8(), QUrl::TolerantMode);
- if (url.isValid() && !url.scheme().isEmpty() && !url.host().isEmpty())
- return url;
-
- // Absolute files that exists
- if (QDir::isAbsolutePath(trimmedString) && QFile::exists(trimmedString))
- return QUrl::fromLocalFile(trimmedString);
-
- // If the string is missing the scheme or the scheme is not valid prepend a scheme
- QString scheme = url.scheme();
- if (scheme.isEmpty() || scheme.contains(QLatin1Char('.')) || scheme == QLatin1String("localhost")) {
- // Do not do anything for strings such as "foo", only "foo.com"
- int dotIndex = trimmedString.indexOf(QLatin1Char('.'));
- if (dotIndex != -1 || trimmedString.startsWith(QLatin1String("localhost"))) {
- const QString hostscheme = trimmedString.left(dotIndex).toLower();
- QByteArray scheme = (hostscheme == QLatin1String("ftp")) ? "ftp" : "http";
- trimmedString = QLatin1String(scheme) + QLatin1String("://") + trimmedString;
- }
- url = QUrl::fromEncoded(trimmedString.toUtf8(), QUrl::TolerantMode);
- }
-
- if (url.isValid())
- return url;
-
- return QUrl();
-}
-
-/*!
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(), guessUrlFromString()
+ \sa setUrl(), url(), urlChanged(), QUrl::fromUserInput()
*/
void QWebView::load(const QUrl &url)
{
@@ -668,24 +534,38 @@ qreal QWebView::textSizeMultiplier() const
return page()->mainFrame()->textSizeMultiplier();
}
-#if !defined(Q_OS_SYMBIAN)
/*!
\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.
+ These hints are used to initialize QPainter before painting the Web page.
QPainter::TextAntialiasing is 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()
*/
-#endif
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)
@@ -695,11 +575,11 @@ void QWebView::setRenderHints(QPainter::RenderHints hints)
}
/*!
- If \a enabled is true, the render hint \a hint is enabled; otherwise it
- is disabled.
-
\since 4.6
- \sa renderHints
+ 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)
{
@@ -767,7 +647,7 @@ bool QWebView::event(QEvent *e)
// WebCore.
// FIXME: Add a QEvent::CursorUnset or similar to Qt.
if (cursor().shape() == Qt::ArrowCursor)
- d->resetCursor();
+ d->page->d->client->resetCursor();
#endif
#endif
} else if (e->type() == QEvent::Leave)
@@ -879,8 +759,12 @@ void QWebView::paintEvent(QPaintEvent *ev)
}
/*!
- This function is called whenever WebKit wants to create a new window of the given \a type, for example as a result of
- a JavaScript request to open a document in a new window.
+ 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.
\sa QWebPage::createWindow()
*/
@@ -1094,7 +978,7 @@ void QWebView::changeEvent(QEvent *e)
/*!
\fn void QWebView::statusBarMessage(const QString& text)
- This signal is emitted when the statusbar \a text is changed by the page.
+ This signal is emitted when the status bar \a text is changed by the page.
*/
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
index 15b583679c..e9c1ec8e05 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
@@ -53,9 +53,8 @@ class QWEBKIT_EXPORT QWebView : public QWidget {
// FIXME: temporary work around for elftran issue that it couldn't find the QPainter::staticMetaObject
// symbol from Qt lib; it should be reverted after the right symbol is exported.
-// remember to revert the qdoc \property comment as well.
// See bug: http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=258893
-#if !defined(Q_OS_SYMBIAN)
+#if defined(Q_QDOC) || !defined(Q_OS_SYMBIAN)
Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints)
#endif
Q_FLAGS(QPainter::RenderHints)
@@ -66,8 +65,6 @@ public:
QWebPage* page() const;
void setPage(QWebPage* page);
- static QUrl guessUrlFromString(const QString& string);
-
void load(const QUrl& url);
#if QT_VERSION < 0x040400 && !defined(qdoc)
void load(const QWebNetworkRequest& request);
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 85d0e4f782..1294d66821 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,1478 @@
+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-16 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by NOBODY (OOPS!).
+
+ [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 is shown.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::QtPluginWidget::show): Override WebCore::Widget
+ (WebCore::QtPluginWidget::hide): Override WebCore::Widget
+ (WebCore::QtPluginWidget::handleVisibility): New method to call setVisible when we are visible
+ (FrameLoaderClientQt::createPlugin): Hide the QWidget by default
+
+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-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 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 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-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-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-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ [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
+
+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-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 Liang QI <liang.qi@nokia.com>
+ 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.
+
+
+ [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-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-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-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 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-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.
@@ -24,6 +1499,130 @@
* 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.
@@ -37,6 +1636,159 @@
* 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ø.
@@ -49,6 +1801,37 @@
(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.
@@ -85,6 +1868,17 @@
* 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ø.
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp
deleted file mode 100644
index d7fae07ca6..0000000000
--- a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * kimgio import filter for MS Windows .ico files
- *
- * Distributed under the terms of the LGPL
- * Copyright (c) 2000 Malte Starostik <malte@kde.org>
- *
- */
-
-#include "config.h"
-#include "ICOHandler.h"
-
-#include <cstring>
-#include <cstdlib>
-#include <algorithm>
-#include <vector>
-
-#include <QtGui/QImage>
-#include <QtGui/QBitmap>
-#include <QtGui/QApplication>
-#include <QtCore/QVector>
-#include <QtGui/QDesktopWidget>
-
-namespace
-{
- // Global header (see http://www.daubnet.com/formats/ICO.html)
- struct IcoHeader
- {
- enum Type { Icon = 1, Cursor };
- quint16 reserved;
- quint16 type;
- quint16 count;
- };
-
- inline QDataStream& operator >>( QDataStream& s, IcoHeader& h )
- {
- return s >> h.reserved >> h.type >> h.count;
- }
-
- // Based on qt_read_dib et al. from qimage.cpp
- // (c) 1992-2002 Nokia Corporation and/or its subsidiary(-ies).
- struct BMP_INFOHDR
- {
- static const quint32 Size = 40;
- quint32 biSize; // size of this struct
- quint32 biWidth; // pixmap width
- quint32 biHeight; // pixmap height
- quint16 biPlanes; // should be 1
- quint16 biBitCount; // number of bits per pixel
- enum Compression { RGB = 0 };
- quint32 biCompression; // compression method
- quint32 biSizeImage; // size of image
- quint32 biXPelsPerMeter; // horizontal resolution
- quint32 biYPelsPerMeter; // vertical resolution
- quint32 biClrUsed; // number of colors used
- quint32 biClrImportant; // number of important colors
- };
- const quint32 BMP_INFOHDR::Size;
-
- QDataStream& operator >>( QDataStream &s, BMP_INFOHDR &bi )
- {
- s >> bi.biSize;
- if ( bi.biSize == BMP_INFOHDR::Size )
- {
- s >> bi.biWidth >> bi.biHeight >> bi.biPlanes >> bi.biBitCount;
- s >> bi.biCompression >> bi.biSizeImage;
- s >> bi.biXPelsPerMeter >> bi.biYPelsPerMeter;
- s >> bi.biClrUsed >> bi.biClrImportant;
- }
- return s;
- }
-
-#if 0
- QDataStream &operator<<( QDataStream &s, const BMP_INFOHDR &bi )
- {
- s << bi.biSize;
- s << bi.biWidth << bi.biHeight;
- s << bi.biPlanes;
- s << bi.biBitCount;
- s << bi.biCompression;
- s << bi.biSizeImage;
- s << bi.biXPelsPerMeter << bi.biYPelsPerMeter;
- s << bi.biClrUsed << bi.biClrImportant;
- return s;
- }
-#endif
-
- // Header for every icon in the file
- struct IconRec
- {
- unsigned char width;
- unsigned char height;
- quint16 colors;
- quint16 hotspotX;
- quint16 hotspotY;
- quint32 size;
- quint32 offset;
- };
-
- inline QDataStream& operator >>( QDataStream& s, IconRec& r )
- {
- return s >> r.width >> r.height >> r.colors
- >> r.hotspotX >> r.hotspotY >> r.size >> r.offset;
- }
-
- struct LessDifference
- {
- LessDifference( unsigned s, unsigned c )
- : size( s ), colors( c ) {}
-
- bool operator ()( const IconRec& lhs, const IconRec& rhs ) const
- {
- // closest size match precedes everything else
- if ( std::abs( int( lhs.width - size ) ) <
- std::abs( int( rhs.width - size ) ) ) return true;
- else if ( std::abs( int( lhs.width - size ) ) >
- std::abs( int( rhs.width - size ) ) ) return false;
- else if ( colors == 0 )
- {
- // high/true color requested
- if ( lhs.colors == 0 ) return true;
- else if ( rhs.colors == 0 ) return false;
- else return lhs.colors > rhs.colors;
- }
- else
- {
- // indexed icon requested
- if ( lhs.colors == 0 && rhs.colors == 0 ) return false;
- else if ( lhs.colors == 0 ) return false;
- else return std::abs( int( lhs.colors - colors ) ) <
- std::abs( int( rhs.colors - colors ) );
- }
- }
- unsigned size;
- unsigned colors;
- };
-
- bool loadFromDIB( QDataStream& stream, const IconRec& rec, QImage& icon )
- {
- BMP_INFOHDR header;
- stream >> header;
- if ( stream.atEnd() || header.biSize != BMP_INFOHDR::Size ||
- header.biSize > rec.size ||
- header.biCompression != BMP_INFOHDR::RGB ||
- ( header.biBitCount != 1 && header.biBitCount != 4 &&
- header.biBitCount != 8 && header.biBitCount != 24 &&
- header.biBitCount != 32 ) ) return false;
-
- unsigned paletteSize, paletteEntries;
-
- if (header.biBitCount > 8)
- {
- paletteEntries = 0;
- paletteSize = 0;
- }
- else
- {
- paletteSize = (1 << header.biBitCount);
- paletteEntries = paletteSize;
- if (header.biClrUsed && header.biClrUsed < paletteSize)
- paletteEntries = header.biClrUsed;
- }
-
- // Always create a 32-bit image to get the mask right
- // Note: this is safe as rec.width, rec.height are bytes
- icon = QImage( rec.width, rec.height, QImage::Format_ARGB32 );
- if ( icon.isNull() ) return false;
-
- QVector< QRgb > colorTable( paletteSize );
-
- colorTable.fill( QRgb( 0 ) );
- for ( unsigned i = 0; i < paletteEntries; ++i )
- {
- unsigned char rgb[ 4 ];
- stream.readRawData( reinterpret_cast< char* >( &rgb ),
- sizeof( rgb ) );
- colorTable[ i ] = qRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] );
- }
-
- unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4;
-
- unsigned char* buf = new unsigned char[ bpl ];
- for ( unsigned y = rec.height; !stream.atEnd() && y--; )
- {
- stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
- unsigned char* pixel = buf;
- QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) );
- switch ( header.biBitCount )
- {
- case 1:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = colorTable[
- ( pixel[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ];
- break;
- case 4:
- for ( unsigned x = 0; x < rec.width; ++x )
- if ( x & 1 ) *p++ = colorTable[ pixel[ x / 2 ] & 0x0f ];
- else *p++ = colorTable[ pixel[ x / 2 ] >> 4 ];
- break;
- case 8:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = colorTable[ pixel[ x ] ];
- break;
- case 24:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = qRgb( pixel[ 3 * x + 2 ],
- pixel[ 3 * x + 1 ],
- pixel[ 3 * x ] );
- break;
- case 32:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = qRgba( pixel[ 4 * x + 2 ],
- pixel[ 4 * x + 1 ],
- pixel[ 4 * x ],
- pixel[ 4 * x + 3] );
- break;
- }
- }
- delete[] buf;
-
- if ( header.biBitCount < 32 )
- {
- // Traditional 1-bit mask
- bpl = ( rec.width + 31 ) / 32 * 4;
- buf = new unsigned char[ bpl ];
- for ( unsigned y = rec.height; y--; )
- {
- stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
- QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) );
- for ( unsigned x = 0; x < rec.width; ++x, ++p )
- if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) )
- *p &= RGB_MASK;
- }
- delete[] buf;
- }
- return true;
- }
-}
-
-ICOHandler::ICOHandler()
-{
-}
-
-bool ICOHandler::canRead() const
-{
- return canRead(device());
-}
-
-bool ICOHandler::read(QImage *outImage)
-{
-
- qint64 offset = device()->pos();
-
- QDataStream stream( device() );
- stream.setByteOrder( QDataStream::LittleEndian );
- IcoHeader header;
- stream >> header;
- if ( stream.atEnd() || !header.count ||
- ( header.type != IcoHeader::Icon && header.type != IcoHeader::Cursor) )
- return false;
-
- unsigned requestedSize = 32;
- unsigned requestedColors = QApplication::desktop()->depth() > 8 ? 0 : QApplication::desktop()->depth();
- int requestedIndex = -1;
-#if 0
- if ( io->parameters() )
- {
- QStringList params = QString(io->parameters()).split( ';', QString::SkipEmptyParts );
- QMap< QString, QString > options;
- for ( QStringList::ConstIterator it = params.begin();
- it != params.end(); ++it )
- {
- QStringList tmp = (*it).split( '=', QString::SkipEmptyParts );
- if ( tmp.count() == 2 ) options[ tmp[ 0 ] ] = tmp[ 1 ];
- }
- if ( options[ "index" ].toUInt() )
- requestedIndex = options[ "index" ].toUInt();
- if ( options[ "size" ].toUInt() )
- requestedSize = options[ "size" ].toUInt();
- if ( options[ "colors" ].toUInt() )
- requestedColors = options[ "colors" ].toUInt();
- }
-#endif
-
- typedef std::vector< IconRec > IconList;
- IconList icons;
- for ( unsigned i = 0; i < header.count; ++i )
- {
- if ( stream.atEnd() )
- return false;
- IconRec rec;
- stream >> rec;
- icons.push_back( rec );
- }
- IconList::const_iterator selected;
- if (requestedIndex >= 0) {
- selected = std::min( icons.begin() + requestedIndex, icons.end() );
- } else {
- selected = std::min_element( icons.begin(), icons.end(),
- LessDifference( requestedSize, requestedColors ) );
- }
- if ( stream.atEnd() || selected == icons.end() ||
- offset + selected->offset > device()->size() )
- return false;
-
- device()->seek( offset + selected->offset );
- QImage icon;
- if ( loadFromDIB( stream, *selected, icon ) )
- {
-#ifndef QT_NO_IMAGE_TEXT
- icon.setText( "X-Index", 0, QString::number( selected - icons.begin() ) );
- if ( header.type == IcoHeader::Cursor )
- {
- icon.setText( "X-HotspotX", 0, QString::number( selected->hotspotX ) );
- icon.setText( "X-HotspotY", 0, QString::number( selected->hotspotY ) );
- }
-#endif
- *outImage = icon;
- return true;
- }
- return false;
-}
-
-bool ICOHandler::write(const QImage &/*image*/)
-{
-#if 0
- if (image.isNull())
- return;
-
- QByteArray dibData;
- QDataStream dib(dibData, QIODevice::ReadWrite);
- dib.setByteOrder(QDataStream::LittleEndian);
-
- QImage pixels = image;
- QImage mask;
- if (io->image().hasAlphaBuffer())
- mask = image.createAlphaMask();
- else
- mask = image.createHeuristicMask();
- mask.invertPixels();
- for ( int y = 0; y < pixels.height(); ++y )
- for ( int x = 0; x < pixels.width(); ++x )
- if ( mask.pixel( x, y ) == 0 ) pixels.setPixel( x, y, 0 );
-
- if (!qt_write_dib(dib, pixels))
- return;
-
- uint hdrPos = dib.device()->at();
- if (!qt_write_dib(dib, mask))
- return;
- memmove(dibData.data() + hdrPos, dibData.data() + hdrPos + BMP_WIN + 8, dibData.size() - hdrPos - BMP_WIN - 8);
- dibData.resize(dibData.size() - BMP_WIN - 8);
-
- QDataStream ico(device());
- ico.setByteOrder(QDataStream::LittleEndian);
- IcoHeader hdr;
- hdr.reserved = 0;
- hdr.type = Icon;
- hdr.count = 1;
- ico << hdr.reserved << hdr.type << hdr.count;
- IconRec rec;
- rec.width = image.width();
- rec.height = image.height();
- if (image.numColors() <= 16)
- rec.colors = 16;
- else if (image.depth() <= 8)
- rec.colors = 256;
- else
- rec.colors = 0;
- rec.hotspotX = 0;
- rec.hotspotY = 0;
- rec.dibSize = dibData.size();
- ico << rec.width << rec.height << rec.colors
- << rec.hotspotX << rec.hotspotY << rec.dibSize;
- rec.dibOffset = ico.device()->at() + sizeof(rec.dibOffset);
- ico << rec.dibOffset;
-
- BMP_INFOHDR dibHeader;
- dib.device()->at(0);
- dib >> dibHeader;
- dibHeader.biHeight = image.height() << 1;
- dib.device()->at(0);
- dib << dibHeader;
-
- ico.writeRawBytes(dibData.data(), dibData.size());
- return true;
-#endif
- return false;
-}
-
-QByteArray ICOHandler::name() const
-{
- return "ico";
-}
-
-bool ICOHandler::canRead(QIODevice *device)
-{
- if (!device) {
- qWarning("ICOHandler::canRead() called with no device");
- return false;
- }
-
- const qint64 oldPos = device->pos();
-
- char head[8];
- qint64 readBytes = device->read(head, sizeof(head));
- const bool readOk = readBytes == sizeof(head);
-
- if (device->isSequential()) {
- while (readBytes > 0)
- device->ungetChar(head[readBytes-- - 1]);
- } else {
- device->seek(oldPos);
- }
-
- if ( !readOk )
- return false;
-
- return head[2] == '\001' && head[3] == '\000' && // type should be 1
- ( head[6] == 16 || head[6] == 32 || head[6] == 64 ) && // width can only be one of those
- ( head[7] == 16 || head[7] == 32 || head[7] == 64 ); // same for height
-}
-
-class ICOPlugin : public QImageIOPlugin
-{
-public:
- QStringList keys() const;
- Capabilities capabilities(QIODevice *device, const QByteArray &format) const;
- QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const;
-};
-
-QStringList ICOPlugin::keys() const
-{
- return QStringList() << "ico" << "ICO";
-}
-
-QImageIOPlugin::Capabilities ICOPlugin::capabilities(QIODevice *device, const QByteArray &format) const
-{
- if (format == "ico" || format == "ICO")
- return Capabilities(CanRead);
- if (!format.isEmpty())
- return 0;
- if (!device->isOpen())
- return 0;
-
- Capabilities cap;
- if (device->isReadable() && ICOHandler::canRead(device))
- cap |= CanRead;
- return cap;
-}
-
-QImageIOHandler *ICOPlugin::create(QIODevice *device, const QByteArray &format) const
-{
- QImageIOHandler *handler = new ICOHandler;
- handler->setDevice(device);
- handler->setFormat(format);
- return handler;
-}
-
-Q_EXPORT_STATIC_PLUGIN(ICOPlugin)
-Q_EXPORT_PLUGIN2(qtwebico, ICOPlugin)
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h
deleted file mode 100644
index 4f1f1d6b18..0000000000
--- a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * ico.h - kimgio import filter for MS Windows .ico files
- *
- * Distributed under the terms of the LGPL
- * Copyright (c) 2000 Malte Starostik <malte@kde.org>
- *
- */
-
-// You can use QImageIO::setParameters() to request a specific
-// Icon out of an .ico file:
-//
-// Options consist of a name=value pair and are separated by a semicolon.
-// Available options are:
-// size=<size> select the icon that most closely matches <size> (pixels)
-// default: 32
-// colors=<num> select the icon that has <num> colors (or comes closest)
-// default: 1 << display depth or 0 (RGB) if display depth > 8
-// index=<index> select the indexth icon from the file. If this option
-// is present, the size and colors options will be ignored.
-// default: none
-// If both size and colors are given, size takes precedence.
-//
-// The old format is still supported:
-// the parameters consist of a single string in the form
-// "<size>[:<colors>]" which correspond to the options above
-//
-// If an icon was returned (i.e. the file is valid and the index option
-// if present was not out of range), the icon's index within the .ico
-// file is returned in the text tag "X-Index" of the image.
-// If the icon is in fact a cursor, its hotspot coordinates are returned
-// in the text tags "X-HotspotX" and "X-HotspotY".
-
-#ifndef _ICOHANDLER_H_
-#define _ICOHANDLER_H_
-
-#include <QtGui/QImageIOPlugin>
-
-class ICOHandler : public QImageIOHandler
-{
-public:
- ICOHandler();
-
- bool canRead() const;
- bool read(QImage *image);
- bool write(const QImage &image);
-
- QByteArray name() const;
-
- static bool canRead(QIODevice *device);
-};
-
-#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro b/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro
deleted file mode 100644
index a9b4f82f62..0000000000
--- a/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TEMPLATE = lib
-TARGET = qtwebico
-CONFIG += plugin
-HEADERS += ICOHandler.h
-SOURCES += ICOHandler.cpp
-
-include(../../WebKit.pri)
-
-contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
-unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
-
-target.path = $$[QT_INSTALL_PLUGINS]/imageformats
-INSTALLS += target
-
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
index 0df0768add..99e438d50f 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
@@ -66,6 +66,8 @@ void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Cli
QWidget* view = m_webPage->view();
if (view) {
QDrag *drag = new QDrag(view);
+ if (clipboardData->hasImage())
+ drag->setPixmap(qvariant_cast<QPixmap>(clipboardData->imageData()));
drag->setMimeData(clipboardData);
drag->start();
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 905e11d11d..9e13339363 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -37,6 +37,7 @@
#include "FrameTree.h"
#include "FrameView.h"
#include "DocumentLoader.h"
+#include "JSDOMWindowBase.h"
#include "MIMETypeRegistry.h"
#include "ResourceResponse.h"
#include "Page.h"
@@ -55,8 +56,10 @@
#include "ResourceHandle.h"
#include "Settings.h"
#include "ScriptString.h"
+#include "QWebPageClient.h"
#include "qwebpage.h"
+#include "qwebpage_p.h"
#include "qwebframe.h"
#include "qwebframe_p.h"
#include "qwebhistoryinterface.h"
@@ -67,6 +70,8 @@
#include <QCoreApplication>
#include <QDebug>
#if QT_VERSION >= 0x040400
+#include <QGraphicsScene>
+#include <QGraphicsWidget>
#include <QNetworkRequest>
#include <QNetworkReply>
#else
@@ -183,7 +188,7 @@ QWebFrame* FrameLoaderClientQt::webFrame() const
void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, PolicyAction action)
{
- (m_frame->loader()->*function)(action);
+ (m_frame->loader()->policyChecker()->*function)(action);
}
bool FrameLoaderClientQt::hasWebView() const
@@ -210,12 +215,12 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor();
QWebPage* page = m_webFrame->page();
- const QSize fixedLayoutSize = page->fixedContentsSize();
+ const QSize preferredLayoutSize = page->preferredContentsSize();
m_frame->createView(m_webFrame->page()->viewportSize(),
backgroundColor, !backgroundColor.alpha(),
- fixedLayoutSize.isValid() ? IntSize(fixedLayoutSize) : IntSize(),
- fixedLayoutSize.isValid(),
+ preferredLayoutSize.isValid() ? IntSize(preferredLayoutSize) : IntSize(),
+ preferredLayoutSize.isValid(),
(ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
(ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
}
@@ -374,7 +379,8 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
if (dumpFrameLoaderCallbacks)
printf("%s - didFinishLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- m_loadError = ResourceError(); // clears the previous error
+ // Clears the previous error.
+ m_loadError = ResourceError();
if (!m_webFrame)
return;
@@ -428,6 +434,8 @@ void FrameLoaderClientQt::revertToProvisionalState(DocumentLoader*)
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();
}
@@ -763,8 +771,16 @@ bool FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError&)
WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
{
RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData);
- if (substituteData.isValid())
+ if (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.
+ double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f;
+ m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay);
+ } else {
+ m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1);
+ }
return loader.release();
}
@@ -875,6 +891,8 @@ void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& e
else
return;
+ option.url = QUrl(error.failingURL());
+ option.frame = m_webFrame;
option.error = error.errorCode();
option.errorString = error.localizedDescription();
@@ -883,7 +901,7 @@ void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& e
return;
KURL baseUrl(output.baseUrl);
- KURL failingUrl(QUrl(error.failingURL()));
+ KURL failingUrl(option.url);
WebCore::ResourceRequest request(baseUrl);
WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(output.content.constData(), output.content.length());
@@ -937,7 +955,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunc
#if QT_VERSION < 0x040400
QWebNetworkRequest r(request);
#else
- QNetworkRequest r(request.toNetworkRequest());
+ QNetworkRequest r(request.toNetworkRequest(m_webFrame));
#endif
QWebPage* page = m_webFrame->page();
@@ -962,7 +980,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun
#if QT_VERSION < 0x040400
QWebNetworkRequest r(request);
#else
- QNetworkRequest r(request.toNetworkRequest());
+ QNetworkRequest r(request.toNetworkRequest(m_webFrame));
#endif
QWebPage*page = m_webFrame->page();
@@ -992,7 +1010,7 @@ void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request)
if (!m_webFrame)
return;
- emit m_webFrame->page()->downloadRequested(request.toNetworkRequest());
+ emit m_webFrame->page()->downloadRequested(request.toNetworkRequest(m_webFrame));
#endif
}
@@ -1079,7 +1097,11 @@ const unsigned numqStyleSheetProperties = sizeof(qstyleSheetProperties) / sizeof
class QtPluginWidget: public Widget
{
public:
- QtPluginWidget(QWidget* w = 0): Widget(w) {}
+ QtPluginWidget(QWidget* w = 0)
+ : Widget(w)
+ , m_visible(false)
+ {}
+
~QtPluginWidget()
{
if (platformWidget())
@@ -1110,11 +1132,85 @@ public:
QRegion clipRegion = QRegion(clipRect);
platformWidget()->setMask(clipRegion);
+ handleVisibility();
+ }
+
+ virtual void hide()
+ {
+ m_visible = false;
+ Widget::hide();
+ }
+
+ virtual void show()
+ {
+ m_visible = true;
+ if (!platformWidget())
+ return;
+
+ handleVisibility();
+ }
+
+private:
+ void handleVisibility()
+ {
+ if (!m_visible)
+ return;
+
// if setMask is set with an empty QRegion, no clipping will
// be performed, so in that case we hide the platformWidget
- platformWidget()->setVisible(!clipRegion.isEmpty());
+ QRegion mask = platformWidget()->mask();
+ platformWidget()->setVisible(!mask.isEmpty());
+ }
+
+ bool m_visible;
+};
+
+#if QT_VERSION >= 0x040600
+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) {}
+
+ QGraphicsWidget* graphicsWidget;
};
+#endif
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)
@@ -1177,15 +1273,33 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
if (object) {
QWidget* widget = qobject_cast<QWidget*>(object);
if (widget) {
- QWidget* view = m_webFrame->page()->view();
- if (view)
- widget->setParent(view);
+ 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 QT_VERSION >= 0x040600
+ 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
// FIXME: make things work for widgetless plugins as well
delete object;
} else { // NPAPI Plugins
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 3931a85267..7a1bfd579e 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -84,9 +84,6 @@ void InspectorClientQt::inspectorDestroyed()
Page* InspectorClientQt::createPage()
{
- if (m_inspectorView)
- return m_inspectorView->page()->d->page;
-
QWebView* inspectorView = new QWebView;
InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
inspectorView->setPage(inspectorPage);
@@ -169,7 +166,6 @@ void InspectorClientQt::updateWindowTitle()
if (m_inspectedWebPage->d->inspector) {
QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL);
m_inspectedWebPage->d->inspector->setWindowTitle(caption);
- emit m_inspectedWebPage->d->inspector->windowTitleChanged(caption);
}
}
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
index 4a8c165a35..804817b12e 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
+++ b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
@@ -1,9 +1,9 @@
include(../../../WebKit.pri)
unix {
- QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/tools/qdoc3/qdoc3
+ QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/bin/qdoc3
} else {
- QDOC = $$(QTDIR)\tools\qdoc3\release\qdoc3.exe
+ QDOC = $$(QTDIR)\bin\qdoc3.exe
}
unix {
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
index 09dfae5195..411762abea 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
@@ -25,13 +25,10 @@
Qt Commercial Edition licensees that wish to distribute applications that
use the QtWebKit module need to be aware of their obligations under the
- GNU Lesser General Public License (LGPL).
+ 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; version 2.1
- for applications and libraries licensed under the GNU GPL version 2,
- or version 3 for applications and libraries licensed under the GNU
- GPL version 2.
+ the module under the appropriate version of the GNU LGPL.
\legalese
WebKit is licensed under the GNU Library General Public License.
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
index 80717c24c4..bc5e75f208 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
@@ -5,4 +5,7 @@ SOURCES += tst_loading.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-symbian:TARGET.UID3 = 0xA000E541
+symbian {
+ TARGET.UID3 = 0xA000E541
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
index f45d80429e..48c7072279 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
@@ -5,4 +5,7 @@ SOURCES += tst_painting.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-symbian:TARGET.UID3 = 0xA000E542
+symbian {
+ TARGET.UID3 = 0xA000E542
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
index cba6f11fab..57b44375ff 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
@@ -4,3 +4,7 @@ include(../../../../WebKit.pri)
SOURCES += tst_qgraphicswebview.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index 1a572860fe..a52e167c2e 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -19,7 +19,33 @@
#include <QtTest/QtTest>
+#include <QGraphicsView>
#include <qgraphicswebview.h>
+#include <qwebpage.h>
+#include <qwebframe.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 = 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();
+}
class tst_QGraphicsWebView : public QObject
{
@@ -27,6 +53,7 @@ class tst_QGraphicsWebView : public QObject
private slots:
void qgraphicswebview();
+ void crashOnViewlessWebPages();
};
void tst_QGraphicsWebView::qgraphicswebview()
@@ -36,21 +63,66 @@ void tst_QGraphicsWebView::qgraphicswebview()
item.title();
item.icon();
item.zoomFactor();
- item.isInteractive();
- item.progress();
- item.toHtml();
item.history();
item.settings();
- item.status();
item.page();
item.setPage(0);
item.page();
item.setUrl(QUrl());
item.setZoomFactor(0);
- item.setInteractive(true);
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;
+ }
+};
+
+void tst_QGraphicsWebView::crashOnViewlessWebPages()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+
+ QGraphicsWebView* webView = new QGraphicsWebView;
+ WebPage* page = new WebPage;
+ webView->setPage(page);
+ page->webView = webView;
+ connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
+
+ scene.addItem(webView);
+
+ view.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ view.resize(600, 480);
+ webView->resize(view.geometry().size());
+ QTest::qWait(200);
+ view.show();
+
+ page->mainFrame()->setHtml(QString("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))));
}
QTEST_MAIN(tst_QGraphicsWebView)
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png
new file mode 100644
index 0000000000..8d703640c1
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
index 0a140ad63c..c45a9ac5a1 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -6,4 +6,7 @@ RESOURCES += qwebelement.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-symbian:TARGET.UID3 = 0xA000E53A
+symbian {
+ TARGET.UID3 = 0xA000E53A
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
index ed014407a2..28b9d7b3a1 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
@@ -2,5 +2,6 @@
<qresource prefix="/">
<file>style.css</file>
<file>style2.css</file>
+<file>image.png</file>
</qresource>
</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
index 00783d12e6..a04e66110a 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
@@ -68,9 +68,15 @@ private slots:
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();
@@ -87,6 +93,7 @@ private slots:
void firstChildNextSibling();
void lastChildPreviousSibling();
void hasSetFocus();
+ void render();
private:
QWebView* m_view;
@@ -133,7 +140,7 @@ void tst_QWebElement::simpleCollection()
m_mainFrame->setHtml(html);
QWebElement body = m_mainFrame->documentElement();
- QList<QWebElement> list = body.findAll("p");
+ 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"));
@@ -181,6 +188,29 @@ void tst_QWebElement::attributesNS()
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");
@@ -266,6 +296,72 @@ void tst_QWebElement::namespaceURI()
}
+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>";
@@ -279,6 +375,43 @@ void tst_QWebElement::foreachManipulation()
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;
@@ -628,7 +761,7 @@ void tst_QWebElement::clear()
QCOMPARE(body.findAll("div").count(), 1);
QCOMPARE(body.findAll("p").count(), 3);
- body.findFirst("div").removeChildren();
+ body.findFirst("div").removeAllChildren();
QCOMPARE(body.findAll("div").count(), 1);
QCOMPARE(body.findAll("p").count(), 2);
}
@@ -772,7 +905,7 @@ void tst_QWebElement::nullSelect()
{
m_mainFrame->setHtml("<body><p>Test");
- QList<QWebElement> collection = m_mainFrame->findAllElements("invalid{syn(tax;;%#$f223e>>");
+ QWebElementCollection collection = m_mainFrame->findAllElements("invalid{syn(tax;;%#$f223e>>");
QVERIFY(collection.count() == 0);
}
@@ -814,7 +947,7 @@ void tst_QWebElement::hasSetFocus()
"<input type='text' id='input2'/>" \
"</body></html>");
- QList<QWebElement> inputs = m_mainFrame->documentElement().findAll("input");
+ QWebElementCollection inputs = m_mainFrame->documentElement().findAll("input");
QWebElement input1 = inputs.at(0);
input1.setFocus();
QVERIFY(input1.hasFocus());
@@ -825,5 +958,84 @@ void tst_QWebElement::hasSetFocus()
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);
+}
+
QTEST_MAIN(tst_QWebElement)
#include "tst_qwebelement.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index 81037c30ec..b8734cd751 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -5,5 +5,9 @@ SOURCES += tst_qwebframe.cpp
RESOURCES += qwebframe.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
-symbian:TARGET.UID3 = 0xA000E53D
+symbian {
+ TARGET.UID3 = 0xA000E53D
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png
new file mode 100644
index 0000000000..8d703640c1
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 797446b988..b00cf0930b 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -38,6 +38,10 @@
#endif
#include "../util.h"
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -586,6 +590,8 @@ private slots:
void javaScriptWindowObjectClearedOnEvaluate();
void setHtml();
void setHtmlWithResource();
+ void setHtmlWithBaseURL();
+ void setHtmlWithJSAlert();
void ipv6HostEncoding();
void metaData();
void popupFocus();
@@ -699,6 +705,7 @@ void tst_QWebFrame::init()
m_page = m_view->page();
m_myObject = new MyQObject();
m_page->mainFrame()->addToJavaScriptWindowObject("myObject", m_myObject);
+ QDir::setCurrent(SRCDIR);
}
void tst_QWebFrame::cleanup()
@@ -2370,6 +2377,55 @@ void tst_QWebFrame::setHtmlWithResource()
QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red"));
}
+void tst_QWebFrame::setHtmlWithBaseURL()
+{
+ 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(QDir::currentPath()));
+ QTest::qWait(200);
+ QCOMPARE(spy.count(), 1);
+
+ QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1);
+ QCOMPARE(frame->evaluateJavaScript("document.images[0].width").toInt(), 128);
+ QCOMPARE(frame->evaluateJavaScript("document.images[0].height").toInt(), 128);
+
+ // 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:
@@ -2667,26 +2723,24 @@ void tst_QWebFrame::render()
QPicture picture;
- // render clipping to Viewport
- frame->setClipRenderToViewport(true);
+ 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);
+ frame->render(&painter1, QWebFrame::ContentsLayer);
painter1.end();
- QSize size = page.mainFrame()->contentsSize();
- page.setViewportSize(size);
- QCOMPARE(size.width(), picture.boundingRect().width()); // 100px
- QCOMPARE(size.height(), picture.boundingRect().height()); // 100px
+ QCOMPARE(size.width(), picture.boundingRect().width() + frame->scrollBarGeometry(Qt::Vertical).width());
+ QCOMPARE(size.height(), picture.boundingRect().height() + frame->scrollBarGeometry(Qt::Horizontal).height());
- // render without clipping to Viewport
- frame->setClipRenderToViewport(false);
+ // render everything, should be the size of the iframe
QPainter painter2(&picture);
- frame->render(&painter2);
+ frame->render(&painter2, QWebFrame::AllLayers);
painter2.end();
- QImage resource(":/image.png");
- QCOMPARE(resource.width(), picture.boundingRect().width()); // resource width: 128px
- QCOMPARE(resource.height(), picture.boundingRect().height()); // resource height: 128px
+ QCOMPARE(size.width(), picture.boundingRect().width()); // width: 100px
+ QCOMPARE(size.height(), picture.boundingRect().height()); // height: 100px
}
void tst_QWebFrame::scrollPosition()
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index 8ee63cc6ac..7445e3bac8 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -6,4 +6,7 @@ RESOURCES += tst_qwebhistory.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-symbian:TARGET.UID3 = 0xA000E53B
+symbian {
+ TARGET.UID3 = 0xA000E53B
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index 4f4d3c4836..ec2d497b0c 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -56,9 +56,6 @@ private slots:
void serialize_1(); //QWebHistory countity
void serialize_2(); //QWebHistory index
void serialize_3(); //QWebHistoryItem
- void saveAndRestore_1(); //simple checks saveState and restoreState
- void saveAndRestore_2(); //bad parameters saveState and restoreState
- void saveAndRestore_3(); //try use different version
void saveAndRestore_crash_1();
void saveAndRestore_crash_2();
void saveAndRestore_crash_3();
@@ -294,67 +291,40 @@ void tst_QWebHistory::serialize_3()
QVERIFY(load.atEnd());
}
-/** Simple checks should be a bit redundant to streaming operators */
-void tst_QWebHistory::saveAndRestore_1()
+static void saveHistory(QWebHistory* history, QByteArray* in)
{
- QAction* actionBack = page->action(QWebPage::Back);
- hist->back();
- waitForLoadFinished.exec();
- QVERIFY(actionBack->isEnabled());
- QByteArray buffer(hist->saveState());
- hist->clear();
- QVERIFY(!actionBack->isEnabled());
- QVERIFY(hist->count() == 1);
- hist->restoreState(buffer);
-
- //check only few values, do not make full test
- //because most of the code is shared with streaming operators
- //and these are checked before
- QCOMPARE(hist->count(), histsize);
- QCOMPARE(hist->currentItemIndex(), histsize - 2);
- QCOMPARE(hist->itemAt(0).title(), QString("page1"));
- QCOMPARE(hist->itemAt(histsize - 1).title(), QString("page") + QString::number(histsize));
- QVERIFY(actionBack->isEnabled());
+ in->clear();
+ QDataStream save(in, QIODevice::WriteOnly);
+ save << *history;
}
-/** Check returns value if there are bad parameters. Actually, result
- * is no so importent. The test shouldn't crash :-) */
-void tst_QWebHistory::saveAndRestore_2()
+static void restoreHistory(QWebHistory* history, QByteArray* out)
{
- QByteArray buffer;
- hist->restoreState(buffer);
- QVERIFY(hist->count() == 1);
- QVERIFY(hist->itemAt(0).isValid());
-}
-
-/** Try to use bad version value */
-void tst_QWebHistory::saveAndRestore_3()
-{
- QByteArray tmp = hist->saveState((QWebHistory::HistoryStateVersion)29999);
- QVERIFY(hist->saveState((QWebHistory::HistoryStateVersion)29999).isEmpty());
- QVERIFY(hist->count() == histsize);
- QVERIFY(hist->itemAt(3).isValid());
+ QDataStream load(out, QIODevice::ReadOnly);
+ load >> *history;
}
/** The test shouldn't crash */
void tst_QWebHistory::saveAndRestore_crash_1()
{
- QByteArray tmp = hist->saveState();
- for (unsigned i = 0; i < 5; i++){
- hist->restoreState(tmp);
- hist->saveState();
+ 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 tmp = hist->saveState();
+ QByteArray buffer;
+ saveHistory(hist, &buffer);
QWebPage* page2 = new QWebPage(this);
QWebHistory* hist2 = page2->history();
- for (unsigned i = 0; i < 5; i++){
- hist2->restoreState(tmp);
- hist2->saveState();
+ for (unsigned i = 0; i < 5; i++) {
+ restoreHistory(hist2, &buffer);
+ saveHistory(hist2, &buffer);
}
delete page2;
}
@@ -362,17 +332,18 @@ void tst_QWebHistory::saveAndRestore_crash_2()
/** The test shouldn't crash */
void tst_QWebHistory::saveAndRestore_crash_3()
{
- QByteArray tmp = hist->saveState();
+ QByteArray buffer;
+ saveHistory(hist, &buffer);
QWebPage* page2 = new QWebPage(this);
QWebHistory* hist1 = hist;
QWebHistory* hist2 = page2->history();
- for (unsigned i = 0; i < 5; i++){
- hist1->restoreState(tmp);
- hist2->restoreState(tmp);
+ for (unsigned i = 0; i < 5; i++) {
+ restoreHistory(hist1, &buffer);
+ restoreHistory(hist2, &buffer);
QVERIFY(hist1->count() == hist2->count());
QVERIFY(hist1->count() == histsize);
hist2->back();
- tmp = hist2->saveState();
+ saveHistory(hist2, &buffer);
hist2->clear();
}
delete page2;
@@ -381,15 +352,16 @@ void tst_QWebHistory::saveAndRestore_crash_3()
/** ::clear */
void tst_QWebHistory::clear()
{
+ QByteArray buffer;
+
QAction* actionBack = page->action(QWebPage::Back);
QVERIFY(actionBack->isEnabled());
- hist->saveState();
+ 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);
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index 53e1afe5d4..764f806df1 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -5,4 +5,7 @@ SOURCES += tst_qwebhistoryinterface.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-symbian:TARGET.UID3 = 0xA000E53C
+symbian {
+ TARGET.UID3 = 0xA000E53C
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 82ffac68d6..7853b28767 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -5,5 +5,9 @@ SOURCES += tst_qwebpage.cpp
RESOURCES += tst_qwebpage.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
-symbian:TARGET.UID3 = 0xA000E53E
+symbian {
+ TARGET.UID3 = 0xA000E53E
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index bdcc27ff83..7fc364028f 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -1,5 +1,6 @@
/*
Copyright (C) 2008 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
@@ -20,9 +21,13 @@
#include <QtTest/QtTest>
+#include <qgraphicsscene.h>
+#include <qgraphicsview.h>
+#include <qgraphicswebview.h>
#include <qwebelement.h>
#include <qwebpage.h>
#include <qwidget.h>
+#include <QGraphicsWidget>
#include <qwebview.h>
#include <qwebframe.h>
#include <qwebhistory.h>
@@ -33,6 +38,11 @@
#include <qwebsecurityorigin.h>
#include <qwebdatabase.h>
#include <QPushButton>
+#include <QDir>
+
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
// Will try to wait for the condition while allowing event processing
#define QTRY_COMPARE(__expr, __expected) \
@@ -75,6 +85,22 @@ static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
return timeoutSpy.isEmpty();
}
+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
@@ -101,7 +127,9 @@ private slots:
void contextMenuCrash();
void database();
void createPlugin();
+ void destroyPlugin_data();
void destroyPlugin();
+ void createViewlessPlugin_data();
void createViewlessPlugin();
void multiplePageGroupsAndLocalStorage();
void cursorMovements();
@@ -115,10 +143,18 @@ private slots:
void testOptionalJSObjects();
void testEnablePersistentStorage();
void consoleOutput();
+ void inputMethods_data();
void inputMethods();
+ void defaultTextEncoding();
+ void errorPageExtension();
void crashTests_LazyInitializationOfMainFrame();
+ void screenshot_data();
+ void screenshot();
+
+ void originatingObjectInNetworkRequests();
+
private:
QWebView* m_view;
QWebPage* m_page;
@@ -222,6 +258,8 @@ void tst_QWebPage::infiniteLoopJS()
void tst_QWebPage::loadFinished()
{
+ qRegisterMetaType<QWebFrame*>("QWebFrame*");
+ qRegisterMetaType<QNetworkRequest*>("QNetworkRequest*");
QSignalSpy spyLoadStarted(m_view, SIGNAL(loadStarted()));
QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
@@ -332,9 +370,11 @@ 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);
}
@@ -436,7 +476,6 @@ void tst_QWebPage::database()
QVERIFY(QWebSettings::offlineStorageDefaultQuota() == 1024 * 1024);
m_page->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
- m_page->settings()->setAttribute(QWebSettings::SessionStorageEnabled, true);
m_page->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
QString dbFileName = path + "Databases.db";
@@ -617,50 +656,116 @@ void tst_QWebPage::createPlugin()
QCOMPARE(newPage->calls.count(), 0);
}
-class PluginTrackedPage : public QWebPage
-{
+
+// 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();
+ }
+};
- int count;
- QPointer<QWidget> widget;
+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;
+ }
+};
- PluginTrackedPage(QWidget *parent = 0) : QWebPage(parent), count(0) {
- settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+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;
}
- virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) {
- count++;
- QWidget *w = new QWidget;
- widget = w;
- return w;
+ 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()
{
- PluginTrackedPage* page = new PluginTrackedPage(m_view);
+ 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->widget != 0);
- QCOMPARE(page->count, 1);
+ 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->widget == 0);
+ QVERIFY(!page->m_widget);
+}
+
+void tst_QWebPage::createViewlessPlugin_data()
+{
+ PluginFactory::prepareTestData();
}
void tst_QWebPage::createViewlessPlugin()
{
- PluginTrackedPage* page = new PluginTrackedPage;
+ 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->count, 1);
- QVERIFY(page->widget != 0);
+ QCOMPARE(page->m_count, 1);
+ QVERIFY(page->m_widget);
+ QVERIFY(page->m_pluginParent);
+ QVERIFY(page->m_widget->parent() == page->m_pluginParent);
delete page;
+
}
// import private API
@@ -1205,75 +1310,148 @@ void tst_QWebPage::frameAt()
frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos());
}
+void tst_QWebPage::inputMethods_data()
+{
+ QTest::addColumn<QString>("viewType");
+ QTest::newRow("QWebView") << "QWebView";
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QTest::newRow("QGraphicsWebView") << "QGraphicsWebView";
+#endif
+}
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+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();
+}
+#endif
+
+static bool inputMethodEnabled(QObject* object)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
+ return o->flags() & QGraphicsItem::ItemAcceptsInputMethod;
+#endif
+ if (QWidget* w = qobject_cast<QWidget*>(object))
+ return w->testAttribute(Qt::WA_InputMethodEnabled);
+ return false;
+}
+
void tst_QWebPage::inputMethods()
{
- m_view->page()->mainFrame()->setHtml("<html><body>" \
+ 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;
+ }
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ 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;
+ }
+#endif
+ else
+ QVERIFY2(false, "Unknown view type");
+
+ page->mainFrame()->setHtml("<html><body>" \
"<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/><br>" \
"<input type='password'/>" \
"</body></html>");
- m_view->page()->mainFrame()->setFocus();
+ page->mainFrame()->setFocus();
+
+ EventSpy viewEventSpy(container);
- QList<QWebElement> inputs = m_view->page()->mainFrame()->documentElement().findAll("input");
+ QWebElementCollection inputs = page->mainFrame()->documentElement().findAll("input");
QMouseEvent evpres(QEvent::MouseButtonPress, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evpres);
+ page->event(&evpres);
QMouseEvent evrel(QEvent::MouseButtonRelease, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evrel);
+ page->event(&evrel);
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+#endif
+ viewEventSpy.clear();
+
+ page->event(&evpres);
+ page->event(&evrel);
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+#endif
//ImMicroFocus
- QVariant variant = m_view->page()->inputMethodQuery(Qt::ImMicroFocus);
+ QVariant variant = page->inputMethodQuery(Qt::ImMicroFocus);
QRect focusRect = variant.toRect();
QVERIFY(inputs.at(0).geometry().contains(variant.toRect().topLeft()));
//ImFont
- variant = m_view->page()->inputMethodQuery(Qt::ImFont);
- QFont font = variant.value<QFont>();
- QCOMPARE(QString("-webkit-serif"), font.family());
+ //variant = page->inputMethodQuery(Qt::ImFont);
+ //QFont font = variant.value<QFont>();
+ //QCOMPARE(QString("-webkit-serif"), font.family());
QList<QInputMethodEvent::Attribute> inputAttributes;
//Insert text.
{
QInputMethodEvent eventText("QtWebKit", inputAttributes);
- QSignalSpy signalSpy(m_view->page(), SIGNAL(microFocusChanged()));
- m_view->page()->event(&eventText);
+ QSignalSpy signalSpy(page, SIGNAL(microFocusChanged()));
+ page->event(&eventText);
QCOMPARE(signalSpy.count(), 0);
}
{
QInputMethodEvent eventText("", inputAttributes);
eventText.setCommitString(QString("QtWebKit"), 0, 0);
- m_view->page()->event(&eventText);
+ page->event(&eventText);
}
#if QT_VERSION >= 0x040600
//ImMaximumTextLength
- variant = m_view->page()->inputMethodQuery(Qt::ImMaximumTextLength);
+ variant = page->inputMethodQuery(Qt::ImMaximumTextLength);
QCOMPARE(20, variant.toInt());
//Set selection
inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 3, 2, QVariant());
QInputMethodEvent eventSelection("",inputAttributes);
- m_view->page()->event(&eventSelection);
+ page->event(&eventSelection);
//ImAnchorPosition
- variant = m_view->page()->inputMethodQuery(Qt::ImAnchorPosition);
+ variant = page->inputMethodQuery(Qt::ImAnchorPosition);
int anchorPosition = variant.toInt();
QCOMPARE(anchorPosition, 3);
//ImCursorPosition
- variant = m_view->page()->inputMethodQuery(Qt::ImCursorPosition);
+ variant = page->inputMethodQuery(Qt::ImCursorPosition);
int cursorPosition = variant.toInt();
QCOMPARE(cursorPosition, 5);
//ImCurrentSelection
- variant = m_view->page()->inputMethodQuery(Qt::ImCurrentSelection);
+ variant = page->inputMethodQuery(Qt::ImCurrentSelection);
QString selectionValue = variant.value<QString>();
QCOMPARE(selectionValue, QString("eb"));
#endif
//ImSurroundingText
- variant = m_view->page()->inputMethodQuery(Qt::ImSurroundingText);
+ variant = page->inputMethodQuery(Qt::ImSurroundingText);
QString value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
@@ -1284,29 +1462,31 @@ void tst_QWebPage::inputMethods()
QInputMethodEvent::Attribute newSelection(QInputMethodEvent::Selection, 0, 0, QVariant());
attributes.append(newSelection);
QInputMethodEvent event("composition", attributes);
- m_view->page()->event(&event);
+ page->event(&event);
}
// A ongoing composition should not change the surrounding text before it is committed.
- variant = m_view->page()->inputMethodQuery(Qt::ImSurroundingText);
+ variant = page->inputMethodQuery(Qt::ImSurroundingText);
value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
#endif
//ImhHiddenText
QMouseEvent evpresPassword(QEvent::MouseButtonPress, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evpresPassword);
+ page->event(&evpresPassword);
QMouseEvent evrelPassword(QEvent::MouseButtonRelease, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evrelPassword);
+ page->event(&evrelPassword);
- QVERIFY(m_view->testAttribute(Qt::WA_InputMethodEnabled));
+ QVERIFY(inputMethodEnabled(view));
#if QT_VERSION >= 0x040600
- QVERIFY(m_view->inputMethodHints() & Qt::ImhHiddenText);
+ QVERIFY(inputMethodHints(view) & Qt::ImhHiddenText);
- m_view->page()->event(&evpres);
- m_view->page()->event(&evrel);
- QVERIFY(!(m_view->inputMethodHints() & Qt::ImhHiddenText));
+ page->event(&evpres);
+ page->event(&evrel);
+ QVERIFY(!(inputMethodHints(view) & Qt::ImhHiddenText));
#endif
+
+ delete container;
}
// import a little DRT helper function to trigger the garbage collector
@@ -1370,8 +1550,10 @@ void tst_QWebPage::testOptionalJSObjects()
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);
@@ -1379,11 +1561,6 @@ void tst_QWebPage::testOptionalJSObjects()
QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", true), true);
QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false);
QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", false), true);
-
- QCOMPARE(testFlag(webPage1, QWebSettings::SessionStorageEnabled, "sessionStorage", false), false);
- QCOMPARE(testFlag(webPage2, QWebSettings::SessionStorageEnabled, "sessionStorage", true), true);
- QCOMPARE(testFlag(webPage1, QWebSettings::SessionStorageEnabled, "sessionStorage", false), false);
- QCOMPARE(testFlag(webPage2, QWebSettings::SessionStorageEnabled, "sessionStorage", false), true);
}
void tst_QWebPage::testEnablePersistentStorage()
@@ -1410,6 +1587,95 @@ void tst_QWebPage::testEnablePersistentStorage()
QVERIFY(!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)
+ {
+ const ErrorPageExtensionOption* info = static_cast<const ErrorPageExtensionOption*>(option);
+ ErrorPageExtensionReturn* errorPage = static_cast<ErrorPageExtensionReturn*>(output);
+
+ if (info->frame == mainFrame()) {
+ errorPage->content = "data:text/html,error";
+ return true;
+ }
+
+ return false;
+ }
+};
+
+void tst_QWebPage::errorPageExtension()
+{
+ ErrorPage* page = new ErrorPage;
+ m_view->setPage(page);
+
+ QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
+
+ page->mainFrame()->load(QUrl("qrc:///frametest/index.html"));
+ QTRY_COMPARE(spyLoadFinished.count(), 1);
+
+ page->mainFrame()->setUrl(QUrl("http://non.existent/url"));
+ QTest::qWait(2000);
+ QTRY_COMPARE(spyLoadFinished.count(), 2);
+ QCOMPARE(page->mainFrame()->toPlainText(), QString("data:text/html,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);
+ QTest::qWait(2000);
+ QCOMPARE(page->history()->canGoBack(), false);
+ QCOMPARE(page->history()->canGoForward(), true);
+
+ page->triggerAction(QWebPage::Forward);
+ QTest::qWait(2000);
+ QCOMPARE(page->history()->canGoBack(), true);
+ QCOMPARE(page->history()->canGoForward(), false);
+
+ page->triggerAction(QWebPage::Back);
+ QTest::qWait(2000);
+ QCOMPARE(page->history()->canGoBack(), false);
+ QCOMPARE(page->history()->canGoForward(), true);
+ QCOMPARE(page->history()->currentItem().url(), QUrl("qrc:///frametest/index.html"));
+
+ m_view->setPage(0);
+}
+
void tst_QWebPage::crashTests_LazyInitializationOfMainFrame()
{
{
@@ -1430,6 +1696,74 @@ void tst_QWebPage::crashTests_LazyInitializationOfMainFrame()
}
}
+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()
+{
+ QDir::setCurrent(SRCDIR);
+
+ QFETCH(QString, html);
+ QWebPage* page = new QWebPage;
+ page->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebFrame* mainFrame = page->mainFrame();
+ mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+ if (html.contains("</embed>")) {
+ // some reasonable time for the PluginStream to feed test.swf to flash and start painting
+ QTest::qWait(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("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
+ "<head><meta http-equiv='refresh' content='1'></head>foo \">"
+ "<frame src=\"data:text/html,bar\"></frameset>"), QUrl());
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ QCOMPARE(networkManager->requests.count(), 2);
+
+ QList<QWebFrame*> childFrames = m_page->mainFrame()->childFrames();
+ QCOMPARE(childFrames.count(), 2);
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ for (int i = 0; i < 2; ++i)
+ QVERIFY(qobject_cast<QWebFrame*>(networkManager->requests.at(i).originatingObject()) == childFrames.at(i));
+#endif
+}
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
index 1376ca5879..569146abdc 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -5,4 +5,7 @@ SOURCES += tst_qwebplugindatabase.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-symbian:TARGET.UID3 = 0xA000E540
+symbian {
+ TARGET.UID3 = 0xA000E540
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html
new file mode 100644
index 0000000000..9ff68f13a4
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/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/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html
new file mode 100644
index 0000000000..c53ad09a7a
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/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/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
index d9d122c8b1..735537ba2c 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
@@ -4,5 +4,10 @@ include(../../../../WebKit.pri)
SOURCES += tst_qwebview.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+RESOURCES += tst_qwebview.qrc
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
-symbian:TARGET.UID3 = 0xA000E53F
+symbian {
+ TARGET.UID3 = 0xA000E53F
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index 01d0e9295e..27daf38417 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -1,6 +1,7 @@
/*
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
@@ -19,6 +20,7 @@
*/
#include <qtest.h>
+#include "../util.h"
#include <qpainter.h>
#include <qwebview.h>
@@ -26,6 +28,7 @@
#include <qnetworkrequest.h>
#include <qdiriterator.h>
#include <qwebkitversion.h>
+#include <qwebframe.h>
class tst_QWebView : public QObject
{
@@ -39,9 +42,12 @@ public slots:
private slots:
void renderHints();
- void guessUrlFromString_data();
- void guessUrlFromString();
void getWebKitVersion();
+
+ void reusePage_data();
+ void reusePage();
+
+ void crashTests();
};
// This will be called before the first test function is executed.
@@ -100,73 +106,91 @@ void tst_QWebView::renderHints()
QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing));
}
-void tst_QWebView::guessUrlFromString_data()
+void tst_QWebView::getWebKitVersion()
{
- QTest::addColumn<QString>("string");
- QTest::addColumn<QUrl>("guessUrlFromString");
-
- // Null
- QTest::newRow("null") << QString() << QUrl();
-
- // File
- QDirIterator it(QDir::homePath());
- QString fileString;
- int c = 0;
- while (it.hasNext()) {
- it.next();
- QTest::newRow(QString("file-%1").arg(c++).toLatin1()) << it.filePath() << QUrl::fromLocalFile(it.filePath());
- }
+ QVERIFY(qWebKitVersion().toDouble() > 0);
+}
- // basic latin1
- QTest::newRow("unicode-0") << QString::fromUtf8("å.com/") << QUrl::fromEncoded(QString::fromUtf8("http://å.com/").toUtf8(), QUrl::TolerantMode);
- // unicode
- QTest::newRow("unicode-1") << QString::fromUtf8("λ.com/") << QUrl::fromEncoded(QString::fromUtf8("http://λ.com/").toUtf8(), QUrl::TolerantMode);
-
- // no scheme
- QTest::newRow("add scheme-0") << "webkit.org" << QUrl("http://webkit.org");
- QTest::newRow("add scheme-1") << "www.webkit.org" << QUrl("http://www.webkit.org");
- QTest::newRow("add scheme-2") << "ftp.webkit.org" << QUrl("ftp://ftp.webkit.org");
- QTest::newRow("add scheme-3") << "webkit" << QUrl("webkit");
-
- // QUrl's tolerant parser should already handle this
- QTest::newRow("not-encoded-0") << "http://webkit.org/test page.html" << QUrl("http://webkit.org/test%20page.html");
-
- // Make sure the :80, i.e. port doesn't screw anything up
- QUrl portUrl("http://webkit.org");
- portUrl.setPort(80);
- QTest::newRow("port-0") << "webkit.org:80" << portUrl;
- QTest::newRow("port-1") << "http://webkit.org:80" << portUrl;
-
- // mailto doesn't have a ://, but is valid
- QUrl mailto("ben@meyerhome.net");
- mailto.setScheme("mailto");
- QTest::newRow("mailto") << "mailto:ben@meyerhome.net" << mailto;
-
- // misc
- QTest::newRow("localhost-0") << "localhost" << QUrl("http://localhost");
- QTest::newRow("localhost-1") << "localhost:80" << QUrl("http://localhost:80");
- QTest::newRow("spaces-0") << " http://webkit.org/test page.html " << QUrl("http://webkit.org/test%20page.html");
-
- // FYI: The scheme in the resulting url user
- QUrl authUrl("user:pass@domain.com");
- QTest::newRow("misc-1") << "user:pass@domain.com" << authUrl;
+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>");
}
-// public static QUrl guessUrlFromString(QString const& string)
-void tst_QWebView::guessUrlFromString()
+void tst_QWebView::reusePage()
{
- QFETCH(QString, string);
- QFETCH(QUrl, guessUrlFromString);
+ QDir::setCurrent(SRCDIR);
+
+ 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(QDir::currentPath()));
+ if (html.contains("</embed>")) {
+ // some reasonable time for the PluginStream to feed test.swf to flash and start painting
+ QTest::qWait(2000);
+ }
+
+ view1->show();
+ QTest::qWait(2000);
+ delete view1;
+ QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
- QUrl url = QWebView::guessUrlFromString(string);
- QCOMPARE(url, guessUrlFromString);
+ QWebView *view2 = new QWebView;
+ view2->setPage(page);
+ view2->show(); // in Windowless mode, you should still be able to see the plugin here
+ QTest::qWait(2000);
+ delete view2;
+
+ delete page; // must not crash
+
+ QDir::setCurrent(QApplication::applicationDirPath());
}
-void tst_QWebView::getWebKitVersion()
+// 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()
{
- QVERIFY(qWebKitVersion().toDouble() > 0);
+ // Test if loading can be stopped in loadProgress handler without crash.
+ // Test page should have frames.
+ QWebView view;
+ WebViewCrashTest tester(&view);
+ QUrl url("qrc:///data/index.html");
+ view.load(url);
+ QTRY_VERIFY(tester.m_executed); // If fail it means that the test wasn't executed.
}
+
QTEST_MAIN(tst_QWebView)
#include "tst_qwebview.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc
new file mode 100644
index 0000000000..ede34a9831
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>data/index.html</file>
+ <file>data/frame_a.html</file>
+</qresource>
+</RCC>
+
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/resources/test.swf b/src/3rdparty/webkit/WebKit/qt/tests/resources/test.swf
new file mode 100644
index 0000000000..895298271a
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/resources/test.swf
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
index 81cc8f347b..939cd224ab 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebplugindatabase qwebview qwebhistory
+SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory
greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro