summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro108
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp267
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h8
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h9
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp237
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp219
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h18
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h18
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp20
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h8
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp169
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.h6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog2035
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp68
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h21
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp39
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp22
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp143
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp97
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp169
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h65
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/resources.qrc5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/test.html65
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp52
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.cpp119
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.h70
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui95
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp29
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro13
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/image.png (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebframe/image.png)bin14743 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/style.css (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebelement/style.css)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/style2.css (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebelement/style2.css)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp30
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image.png (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png)bin14743 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/style.css (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebframe/style.css)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/test1.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test1.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/test2.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test2.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/testiframe.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe.html)106
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/testiframe2.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe2.html)40
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp216
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro13
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page1.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page1.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page2.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page2.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page3.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page3.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page4.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page4.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page5.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page5.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page6.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page6.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc12
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro12
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp68
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/frame_a.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe2.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe2.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe3.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe3.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/index.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp196
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro12
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/frame_a.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/frame_a.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/index.html (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/index.html)0
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp25
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/resources/image2.png (renamed from src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png)bin14743 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pri23
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pro4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/util.h32
93 files changed, 4172 insertions, 1022 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro
new file mode 100644
index 0000000..a8f2684
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro
@@ -0,0 +1,108 @@
+TEMPLATE = lib
+TARGET = dummy
+
+include(headers.pri)
+
+CONFIG -= debug_and_release
+
+DESTDIR = ../../../include/QtWebKit
+
+QUOTE = ""
+DOUBLE_ESCAPED_QUOTE = ""
+ESCAPE = ""
+win32-msvc*|symbian {
+ ESCAPE = "^"
+} else:win32-g++:isEmpty(QMAKE_SH) {
+ # MinGW's make will run makefile commands using sh, even if make
+ # was run from the Windows shell, if it finds sh in the path.
+ ESCAPE = "^"
+} else {
+ QUOTE = "\'"
+ DOUBLE_ESCAPED_QUOTE = "\\\'"
+}
+
+qtheader_module.target = $${DESTDIR}/QtWebKit
+qtheader_module.depends = $${_PRO_FILE_}
+qtheader_module.commands = echo $${QUOTE}$${LITERAL_HASH}ifndef QT_QTWEBKIT_MODULE_H$${QUOTE} > $${qtheader_module.target} &&
+qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}define QT_QTWEBKIT_MODULE_H$${QUOTE} >> $${qtheader_module.target} &&
+qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}include $${ESCAPE}<QtNetwork/QtNetwork$${ESCAPE}>$${QUOTE} >> $${qtheader_module.target} &&
+WEBKIT_CLASS_HEADERS = $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/QtWebKit
+
+regex = ".*\sclass\sQWEBKIT_EXPORT\s(\w+)\s(.*)"
+
+for(HEADER, WEBKIT_API_HEADERS) {
+ # 1. Append to QtWebKit header that includes all other header files
+
+ qtheader_module.depends += $$HEADER
+ # Quotes need to be escaped once more when placed in eval()
+ eval(qtheader_module.commands += echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$basename(HEADER)\\\"$${DOUBLE_ESCAPED_QUOTE} >> $${qtheader_module.target} &&)
+
+ HEADER_NAME = $$basename(HEADER)
+ HEADER_TARGET = $$replace(HEADER_NAME, [^a-zA-Z0-9_], -)
+ HEADER_TARGET = "qtheader-$${HEADER_TARGET}"
+
+ # 2. Create forwarding header files for qwebframe.h, etc.
+ # Normally they contain absolute paths, for package builds we make the path relative so that
+ # the package sources are relocatable.
+
+ PATH_TO_HEADER = $$HEADER
+ CONFIG(standalone_package): PATH_TO_HEADER = ../../WebKit/qt/Api/$$basename(HEADER)
+
+ eval($${HEADER_TARGET}.target = $${DESTDIR}/$${HEADER_NAME})
+ eval($${HEADER_TARGET}.depends = $$HEADER)
+ eval($${HEADER_TARGET}.commands = echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$PATH_TO_HEADER\\\"$${DOUBLE_ESCAPED_QUOTE} > $$eval($${HEADER_TARGET}.target))
+
+ QMAKE_EXTRA_TARGETS += $$HEADER_TARGET
+
+ # 3. Extract class names of exported classes from the headers and generate
+ # the class name header files
+
+ src_words = $$cat($$HEADER)
+ # Really make sure we're dealing with words
+ src_words = $$split(src_words, " ")
+
+ src = $$join(src_words, $${LITERAL_WHITESPACE})
+ for(ever) {
+ # Looking up by line is faster, so we try that first
+ res = $$find(src_words, "QWEBKIT_EXPORT")
+ isEmpty(res):break()
+
+ # Then do a slow lookup to ensure we're dealing with an exported class
+ res = $$find(src, $$regex)
+ isEmpty(res):break()
+
+ exp = $$replace(src, $$regex, "EXPORTED_CLASS = \1")
+ eval($$exp)
+
+ CLASS_TARGET = "qtheader_$${EXPORTED_CLASS}"
+
+ eval($${CLASS_TARGET}.target = $${DESTDIR}/$${EXPORTED_CLASS})
+ eval($${CLASS_TARGET}.depends = $$eval($${HEADER_TARGET}.target))
+ eval($${CLASS_TARGET}.commands = echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$basename(HEADER)\\\"$${DOUBLE_ESCAPED_QUOTE} > $$eval($${CLASS_TARGET}.target))
+
+ QMAKE_EXTRA_TARGETS += $$CLASS_TARGET
+ WEBKIT_CLASS_HEADERS += $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/$${EXPORTED_CLASS}
+
+ generated_files.depends += $$eval($${CLASS_TARGET}.target)
+ qtheader_pri.depends += $$eval($${CLASS_TARGET}.target)
+
+ # Qt's QRegExp does not support inline non-greedy matching,
+ # so we'll have to work around it by updating the haystack
+ src = $$replace(src, $$regex, "\2")
+ src_words = $$join(src, $${LITERAL_WHITESPACE})
+ }
+}
+
+qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}endif // QT_QTWEBKIT_MODULE_H$${QUOTE} >> $${qtheader_module.target}
+QMAKE_EXTRA_TARGETS += qtheader_module
+
+qtheader_pri.target = $${DESTDIR}/classheaders.pri
+qtheader_pri.depends = $${WEBKIT_API_HEADERS} $${_PRO_FILE_}
+qtheader_pri.commands = echo $${QUOTE}WEBKIT_CLASS_HEADERS = $${WEBKIT_CLASS_HEADERS}$${QUOTE} > $${qtheader_pri.target}
+QMAKE_EXTRA_TARGETS += qtheader_pri
+
+generated_files.depends += $${qtheader_module.target} $${qtheader_pri.target}
+QMAKE_EXTRA_TARGETS += generated_files
+
+
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index ceb5ee1..9720e0c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -22,24 +22,74 @@
#include "qgraphicswebview.h"
#include "qwebframe.h"
+#include "qwebframe_p.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
#include "QWebPageClient.h"
-#include <QtGui/QGraphicsScene>
-#include <QtGui/QGraphicsView>
+#include <FrameView.h>
+#include <QtCore/qmetaobject.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qtimer.h>
#include <QtGui/qapplication.h>
+#include <QtGui/qgraphicsscene.h>
#include <QtGui/qgraphicssceneevent.h>
+#include <QtGui/qgraphicsview.h>
+#include <QtGui/qpixmapcache.h>
#include <QtGui/qstyleoption.h>
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
+#include <Settings.h>
+
+#if USE(ACCELERATED_COMPOSITING)
+
+// the overlay is here for one reason only: to have the scroll-bars and other
+// extra UI elements appear on top of any QGraphicsItems created by CSS compositing layers
+class QGraphicsWebViewOverlay : public QGraphicsItem {
+ public:
+ QGraphicsWebViewOverlay(QGraphicsWebView* view)
+ :QGraphicsItem(view)
+ , q(view)
+ {
+ setPos(0, 0);
+ setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
+ setCacheMode(QGraphicsItem::DeviceCoordinateCache);
+ }
+
+ QRectF boundingRect() const
+ {
+ return q->boundingRect();
+ }
+
+ void paint(QPainter* painter, const QStyleOptionGraphicsItem* options, QWidget*)
+ {
+ q->page()->mainFrame()->render(painter, static_cast<QWebFrame::RenderLayer>(QWebFrame::AllLayers&(~QWebFrame::ContentsLayer)), options->exposedRect.toRect());
+ }
+
+ friend class QGraphicsWebView;
+ QGraphicsWebView* q;
+};
+
+#endif
class QGraphicsWebViewPrivate : public QWebPageClient {
public:
QGraphicsWebViewPrivate(QGraphicsWebView* parent)
: q(parent)
, page(0)
- {}
+ , resizesToContents(false)
+#if USE(ACCELERATED_COMPOSITING)
+ , rootGraphicsLayer(0)
+ , shouldSync(false)
+#endif
+ {
+#if USE(ACCELERATED_COMPOSITING)
+ // the overlay and stays alive for the lifetime of
+ // this QGraphicsWebView as the scrollbars are needed when there's no compositing
+ q->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption);
+ syncMetaMethod = q->metaObject()->method(q->metaObject()->indexOfMethod("syncLayers()"));
+#endif
+ }
virtual ~QGraphicsWebViewPrivate();
virtual void scroll(int dx, int dy, const QRect&);
@@ -61,14 +111,106 @@ public:
virtual QObject* pluginParent() const;
+ virtual QStyle* style() const;
+
+#if USE(ACCELERATED_COMPOSITING)
+ virtual void setRootGraphicsLayer(QGraphicsItem* layer);
+ virtual void markForSync(bool scheduleSync);
+ void updateCompositingScrollPosition();
+#endif
+
+ void updateResizesToContentsForPage();
+
+ void syncLayers();
void _q_doLoadFinished(bool success);
+ void _q_contentsSizeChanged(const QSize&);
QGraphicsWebView* q;
QWebPage* page;
+
+ bool resizesToContents;
+
+#if USE(ACCELERATED_COMPOSITING)
+ QGraphicsItem* rootGraphicsLayer;
+
+ // the overlay gets instantiated when the root layer is attached, and get deleted when it's detached
+ QSharedPointer<QGraphicsWebViewOverlay> overlay;
+
+ // we need to sync the layers if we get a special call from the WebCore
+ // compositor telling us to do so. We'll get that call from ChromeClientQt
+ bool shouldSync;
+
+ // we have to flush quite often, so we use a meta-method instead of QTimer::singleShot for putting the event in the queue
+ QMetaMethod syncMetaMethod;
+
+ // we need to put the root graphics layer behind the overlay (which contains the scrollbar)
+ enum { RootGraphicsLayerZValue, OverlayZValue };
+#endif
};
QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate()
{
+#if USE(ACCELERATED_COMPOSITING)
+ if (rootGraphicsLayer) {
+ // we don't need to delete the root graphics layer
+ // The lifecycle is managed in GraphicsLayerQt.cpp
+ rootGraphicsLayer->setParentItem(0);
+ q->scene()->removeItem(rootGraphicsLayer);
+ }
+#endif
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+void QGraphicsWebViewPrivate::setRootGraphicsLayer(QGraphicsItem* layer)
+{
+ if (rootGraphicsLayer) {
+ rootGraphicsLayer->setParentItem(0);
+ q->scene()->removeItem(rootGraphicsLayer);
+ QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive();
+ }
+
+ rootGraphicsLayer = layer;
+
+ if (layer) {
+ layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
+ layer->setParentItem(q);
+ layer->setZValue(RootGraphicsLayerZValue);
+ if (!overlay) {
+ overlay = QSharedPointer<QGraphicsWebViewOverlay>(new QGraphicsWebViewOverlay(q));
+ overlay->setZValue(OverlayZValue);
+ }
+ updateCompositingScrollPosition();
+ } else {
+ // we don't have compositing layers, we can render the scrollbars and content in one go
+ overlay.clear();
+ }
+}
+
+void QGraphicsWebViewPrivate::markForSync(bool scheduleSync)
+{
+ shouldSync = true;
+ if (scheduleSync)
+ syncMetaMethod.invoke(q, Qt::QueuedConnection);
+}
+
+void QGraphicsWebViewPrivate::updateCompositingScrollPosition()
+{
+ if (rootGraphicsLayer && q->page() && q->page()->mainFrame()) {
+ const QPoint scrollPosition = q->page()->mainFrame()->scrollPosition();
+ rootGraphicsLayer->setPos(-scrollPosition);
+ }
+}
+
+#endif
+
+void QGraphicsWebViewPrivate::syncLayers()
+{
+#if USE(ACCELERATED_COMPOSITING)
+ if (shouldSync) {
+ QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive();
+ shouldSync = false;
+ }
+#endif
}
void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success)
@@ -83,11 +225,19 @@ void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success)
void QGraphicsWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll)
{
q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll));
+#if USE(ACCELERATED_COMPOSITING)
+ updateCompositingScrollPosition();
+#endif
}
void QGraphicsWebViewPrivate::update(const QRect & dirtyRect)
{
q->update(QRectF(dirtyRect));
+#if USE(ACCELERATED_COMPOSITING)
+ if (overlay)
+ overlay->update(QRectF(dirtyRect));
+ syncLayers();
+#endif
}
@@ -156,6 +306,40 @@ QObject* QGraphicsWebViewPrivate::pluginParent() const
return q;
}
+QStyle* QGraphicsWebViewPrivate::style() const
+{
+ return q->style();
+}
+
+void QGraphicsWebViewPrivate::updateResizesToContentsForPage()
+{
+ ASSERT(page);
+
+ if (resizesToContents) {
+ // resizes to contents mode requires preferred contents size to be set
+ if (!page->preferredContentsSize().isValid())
+ page->setPreferredContentsSize(QSize(960, 800));
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
+ q, SLOT(_q_contentsSizeChanged(const QSize&)), Qt::UniqueConnection);
+#else
+ QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
+ q, SLOT(_q_contentsSizeChanged(const QSize&)));
+#endif
+ } else {
+ QObject::disconnect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
+ q, SLOT(_q_contentsSizeChanged(const QSize&)));
+ }
+}
+
+void QGraphicsWebViewPrivate::_q_contentsSizeChanged(const QSize& size)
+{
+ if (!resizesToContents)
+ return;
+ q->setGeometry(QRectF(q->geometry().topLeft(), size));
+}
+
/*!
\class QGraphicsWebView
\brief The QGraphicsWebView class allows Web content to be added to a GraphicsView.
@@ -242,8 +426,13 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
#if QT_VERSION >= 0x040600
setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
#endif
+ setAcceptDrops(true);
setAcceptHoverEvents(true);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ setAcceptTouchEvents(true);
+#endif
setFocusPolicy(Qt::StrongFocus);
+ setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
}
/*!
@@ -293,7 +482,11 @@ QWebPage* QGraphicsWebView::page() const
*/
void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*)
{
- page()->mainFrame()->render(painter, option->exposedRect.toRect());
+#if USE(ACCELERATED_COMPOSITING)
+ page()->mainFrame()->render(painter, d->overlay ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
+#else
+ page()->mainFrame()->render(painter, QWebFrame::AllLayers, option->exposedRect.toRect());
+#endif
}
/*! \reimp
@@ -301,6 +494,17 @@ void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem*
bool QGraphicsWebView::sceneEvent(QEvent* event)
{
// Re-implemented in order to allows fixing event-related bugs in patch releases.
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ if (d->page && (event->type() == QEvent::TouchBegin
+ || event->type() == QEvent::TouchEnd
+ || event->type() == QEvent::TouchUpdate)) {
+ d->page->event(event);
+ if (event->isAccepted())
+ return true;
+ }
+#endif
+
return QGraphicsWidget::sceneEvent(event);
}
@@ -367,7 +571,6 @@ bool QGraphicsWebView::event(QEvent* event)
#endif // QT_NO_CONTEXTMENU
{
#ifndef QT_NO_CURSOR
-#if QT_VERSION >= 0x040400
if (event->type() == QEvent::CursorChange) {
// An unsetCursor will set the cursor to Qt::ArrowCursor.
// Thus this cursor change might be a QWidget::unsetCursor()
@@ -381,7 +584,6 @@ bool QGraphicsWebView::event(QEvent* event)
d->resetCursor();
}
#endif
-#endif
}
}
return QGraphicsWidget::event(event);
@@ -412,10 +614,17 @@ void QGraphicsWebView::setPage(QWebPage* page)
d->page = page;
if (!d->page)
return;
+#if USE(ACCELERATED_COMPOSITING)
+ if (d->overlay)
+ d->overlay->prepareGeometryChange();
+#endif
d->page->d->client = d; // set the page client
QSize size = geometry().size().toSize();
page->setViewportSize(size);
+
+ if (d->resizesToContents)
+ d->updateResizesToContentsForPage();
QWebFrame* mainFrame = d->page->mainFrame();
@@ -495,7 +704,6 @@ QIcon QGraphicsWebView::icon() const
/*!
\property QGraphicsWebView::zoomFactor
- \since 4.5
\brief the zoom factor for the view
*/
@@ -516,6 +724,12 @@ qreal QGraphicsWebView::zoomFactor() const
*/
void QGraphicsWebView::updateGeometry()
{
+
+#if USE(ACCELERATED_COMPOSITING)
+ if (d->overlay)
+ d->overlay->prepareGeometryChange();
+#endif
+
QGraphicsWidget::updateGeometry();
if (!d->page)
@@ -531,6 +745,11 @@ void QGraphicsWebView::setGeometry(const QRectF& rect)
{
QGraphicsWidget::setGeometry(rect);
+#if USE(ACCELERATED_COMPOSITING)
+ if (d->overlay)
+ d->overlay->prepareGeometryChange();
+#endif
+
if (!d->page)
return;
@@ -738,6 +957,34 @@ bool QGraphicsWebView::findText(const QString &subString, QWebPage::FindFlags op
return false;
}
+/*!
+ \property QGraphicsWebView::resizesToContents
+ \brief whether the size of the QGraphicsWebView and its viewport changes to match the contents size
+ \since 4.7
+
+ If this property is set, the QGraphicsWebView will automatically change its
+ size to match the size of the main frame contents. As a result the top level frame
+ will never have scrollbars.
+
+ This property should be used in conjunction with the QWebPage::preferredContentsSize property.
+ If not explicitly set, the preferredContentsSize is automatically set to a reasonable value.
+
+ \sa QWebPage::setPreferredContentsSize
+*/
+void QGraphicsWebView::setResizesToContents(bool enabled)
+{
+ if (d->resizesToContents == enabled)
+ return;
+ d->resizesToContents = enabled;
+ if (d->page)
+ d->updateResizesToContentsForPage();
+}
+
+bool QGraphicsWebView::resizesToContents() const
+{
+ return d->resizesToContents;
+}
+
/*! \reimp
*/
void QGraphicsWebView::hoverMoveEvent(QGraphicsSceneHoverEvent* ev)
@@ -875,10 +1122,8 @@ bool QGraphicsWebView::focusNextPrevChild(bool next)
void QGraphicsWebView::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
- //if (d->page)
- // d->page->event(ev);
- //Just remove this line below when the code above is working
- Q_UNUSED(ev);
+ if (d->page)
+ d->page->event(ev);
#else
Q_UNUSED(ev);
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
index f3afb4c..14de9d5 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
@@ -45,6 +45,7 @@ class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget {
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
Q_PROPERTY(bool modified READ isModified)
+ Q_PROPERTY(bool resizesToContents READ resizesToContents WRITE setResizesToContents)
public:
explicit QGraphicsWebView(QGraphicsItem* parent = 0);
@@ -79,6 +80,9 @@ public:
bool findText(const QString& subString, QWebPage::FindFlags options = 0);
+ bool resizesToContents() const;
+ void setResizesToContents(bool enabled);
+
virtual void setGeometry(const QRectF& rect);
virtual void updateGeometry();
virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0);
@@ -134,6 +138,10 @@ protected:
private:
Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success))
+ // we don't want to change the moc based on USE() macro, so this function is here
+ // but will be empty if ACCLERATED_COMPOSITING is disabled
+ Q_PRIVATE_SLOT(d, void syncLayers())
+ Q_PRIVATE_SLOT(d, void _q_contentsSizeChanged(const QSize&))
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 441bec7..9d4d0d0 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
@@ -38,7 +38,6 @@
#include "NodeList.h"
#include "PropertyNameArray.h"
#include "RenderImage.h"
-#include "ScriptFunctionCall.h"
#include "StaticNodeList.h"
#include "qt_runtime.h"
#include "qwebframe.h"
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
index 3833070..156d24b 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
@@ -32,6 +32,12 @@ namespace WebCore {
class Node;
}
+namespace JSC {
+namespace Bindings {
+ class QtWebElementRuntime;
+}
+}
+
QT_BEGIN_NAMESPACE
class QPainter;
QT_END_NAMESPACE
@@ -153,6 +159,7 @@ private:
friend class QWebHitTestResult;
friend class QWebHitTestResultPrivate;
friend class QWebPage;
+ friend class JSC::Bindings::QtWebElementRuntime;
QWebElementPrivate* d;
WebCore::Element* m_element;
@@ -255,4 +262,6 @@ private:
QExplicitlySharedDataPointer<QWebElementCollectionPrivate> d;
};
+Q_DECLARE_METATYPE(QWebElement)
+
#endif // QWEBELEMENT_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index e4c2afc..8d23417 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include "qwebframe.h"
+#include "Bridge.h"
#include "CallFrame.h"
#include "Document.h"
#include "DocumentLoader.h"
@@ -56,6 +57,7 @@
#include "Scrollbar.h"
#include "SelectionController.h"
#include "SubstituteData.h"
+#include "SVGSMILElement.h"
#include "htmlediting.h"
#include "markup.h"
#include "qt_instance.h"
@@ -66,7 +68,6 @@
#include "qwebpage_p.h"
#include "qwebsecurityorigin.h"
#include "qwebsecurityorigin_p.h"
-#include "runtime.h"
#include "runtime_object.h"
#include "runtime_root.h"
#include "wtf/HashMap.h"
@@ -77,14 +78,7 @@
#include <qpainter.h>
#include <qprinter.h>
#include <qregion.h>
-
-#if QT_VERSION < 0x040400
-#include "qwebnetworkinterface.h"
-#endif
-
-#if QT_VERSION >= 0x040400
#include <qnetworkrequest.h>
-#endif
using namespace WebCore;
@@ -93,6 +87,11 @@ QT_BEGIN_NAMESPACE
extern Q_GUI_EXPORT int qt_defaultDpi();
QT_END_NAMESPACE
+bool QWEBKIT_EXPORT qt_drt_hasDocumentElement(QWebFrame* qframe)
+{
+ return QWebFramePrivate::core(qframe)->document()->documentElement();
+}
+
void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* qframe, bool enabled)
{
#if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -150,6 +149,31 @@ bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame *qframe, const QS
return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time);
}
+// Pause a given SVG animation on the target node at a specific time.
+// This method is only intended to be used for testing the SVG animation system.
+bool QWEBKIT_EXPORT qt_drt_pauseSVGAnimation(QWebFrame *qframe, const QString &animationId, double time, const QString &elementId)
+{
+#if !ENABLE(SVG)
+ return false;
+#else
+ Frame* frame = QWebFramePrivate::core(qframe);
+ if (!frame)
+ return false;
+
+ Document* doc = frame->document();
+ Q_ASSERT(doc);
+
+ if (!doc->svgExtensions())
+ return false;
+
+ Node* coreNode = doc->getElementById(animationId);
+ if (!coreNode || !SVGSMILElement::isSMILElement(coreNode))
+ return false;
+
+ return doc->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<SVGSMILElement*>(coreNode), time);
+#endif
+}
+
// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame *qframe)
{
@@ -196,6 +220,28 @@ QString QWEBKIT_EXPORT qt_drt_counterValueForElementById(QWebFrame* qFrame, cons
return QString();
}
+int QWEBKIT_EXPORT qt_drt_pageNumberForElementById(QWebFrame* qFrame, const QString& id, float width, float height)
+{
+ Frame* frame = QWebFramePrivate::core(qFrame);
+ if (!frame)
+ return -1;
+
+ Element* element = frame->document()->getElementById(AtomicString(id));
+ if (!element)
+ return -1;
+
+ return PrintContext::pageNumberForElement(element, FloatSize(width, height));
+}
+
+int QWEBKIT_EXPORT qt_drt_numberOfPages(QWebFrame* qFrame, float width, float height)
+{
+ Frame* frame = QWebFramePrivate::core(qFrame);
+ if (!frame)
+ return -1;
+
+ return PrintContext::numberOfPages(frame, FloatSize(width, height));
+}
+
// Suspend active DOM objects in this frame.
void QWEBKIT_EXPORT qt_suspendActiveDOMObjects(QWebFrame* qFrame)
{
@@ -212,6 +258,13 @@ void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* qFrame)
frame->document()->resumeActiveDOMObjects();
}
+void QWEBKIT_EXPORT qt_drt_evaluateScriptInIsolatedWorld(QWebFrame* qFrame, int worldId, const QString& script)
+{
+ Frame* frame = QWebFramePrivate::core(qFrame);
+ if (frame)
+ JSC::JSValue result = frame->script()->executeScriptInWorld(mainThreadNormalWorld(), script, true).jsValue();
+}
+
QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame,
WebCore::HTMLFrameOwnerElement* ownerFrameElement,
const WebCore::String& frameName)
@@ -245,6 +298,21 @@ void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData)
frame->init();
}
+void QWebFramePrivate::setPage(QWebPage* newPage)
+{
+ if (page == newPage)
+ return;
+
+ // The QWebFrame is created as a child of QWebPage or a parent QWebFrame.
+ // That adds it to QObject's internal children list and ensures it will be
+ // deleted when parent QWebPage is deleted. Reparent if needed.
+ if (q->parent() == qobject_cast<QObject*>(page))
+ q->setParent(newPage);
+
+ page = newPage;
+ emit q->pageChanged();
+}
+
WebCore::Scrollbar* QWebFramePrivate::horizontalScrollBar() const
{
if (!frame->view())
@@ -259,7 +327,7 @@ WebCore::Scrollbar* QWebFramePrivate::verticalScrollBar() const
return frame->view()->verticalScrollbar();
}
-void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer layer, const QRegion &clip)
+void QWebFramePrivate::renderContentsLayerAbsoluteCoords(GraphicsContext* context, const QRegion& clip)
{
if (!frame->view() || !frame->contentRenderer())
return;
@@ -268,15 +336,42 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer l
if (vector.isEmpty())
return;
- GraphicsContext context(painter);
- if (context.paintingDisabled() && !context.updatingControlTints())
+ QPainter* painter = context->platformContext();
+
+ WebCore::FrameView* view = frame->view();
+ view->layoutIfNeededRecursive();
+
+ for (int i = 0; i < vector.size(); ++i) {
+ const QRect& clipRect = vector.at(i);
+
+ painter->save();
+ painter->setClipRect(clipRect, Qt::IntersectClip);
+
+ context->save();
+ view->paintContents(context, clipRect);
+ context->restore();
+
+ painter->restore();
+ }
+}
+
+void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame::RenderLayer layer, const QRegion& clip)
+{
+ if (!frame->view() || !frame->contentRenderer())
+ return;
+
+ QVector<QRect> vector = clip.rects();
+ if (vector.isEmpty())
return;
+ QPainter* painter = context->platformContext();
+
WebCore::FrameView* view = frame->view();
view->layoutIfNeededRecursive();
for (int i = 0; i < vector.size(); ++i) {
const QRect& clipRect = vector.at(i);
+
QRect intersectedRect = clipRect.intersected(view->frameRect());
painter->save();
@@ -286,45 +381,47 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer l
int y = view->y();
if (layer & QWebFrame::ContentsLayer) {
- context.save();
+ context->save();
int scrollX = view->scrollX();
int scrollY = view->scrollY();
QRect rect = intersectedRect;
- context.translate(x, y);
+ context->translate(x, y);
rect.translate(-x, -y);
- context.translate(-scrollX, -scrollY);
+ context->translate(-scrollX, -scrollY);
rect.translate(scrollX, scrollY);
- context.clip(view->visibleContentRect());
+ context->clip(view->visibleContentRect());
- view->paintContents(&context, rect);
+ view->paintContents(context, rect);
- context.restore();
+ context->restore();
}
if (layer & QWebFrame::ScrollBarLayer
&& !view->scrollbarsSuppressed()
&& (view->horizontalScrollbar() || view->verticalScrollbar())) {
- context.save();
+ context->save();
QRect rect = intersectedRect;
- context.translate(x, y);
+ context->translate(x, y);
rect.translate(-x, -y);
- view->paintScrollbars(&context, rect);
+ view->paintScrollbars(context, rect);
- context.restore();
+ context->restore();
}
+#if ENABLE(PAN_SCROLLING)
if (layer & QWebFrame::PanIconLayer)
- view->paintPanScrollIcon(&context);
+ view->paintPanScrollIcon(context);
+#endif
painter->restore();
}
}
-static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy)
+bool QWebFramePrivate::scrollOverflow(int dx, int dy)
{
if (!frame || !frame->document() || !frame->eventHandler())
return false;
@@ -553,7 +650,7 @@ QString QWebFrame::renderTreeDump() const
if (d->frame->view() && d->frame->view()->layoutPending())
d->frame->view()->layout();
- return externalRepresentation(d->frame->contentRenderer());
+ return externalRepresentation(d->frame);
}
/*!
@@ -725,51 +822,9 @@ QWebPage *QWebFrame::page() const
*/
void QWebFrame::load(const QUrl &url)
{
-#if QT_VERSION < 0x040400
- load(QWebNetworkRequest(ensureAbsoluteUrl(url)));
-#else
load(QNetworkRequest(ensureAbsoluteUrl(url)));
-#endif
}
-#if QT_VERSION < 0x040400
-/*!
- Loads a network request, \a req, into this frame.
-
- \note The view remains the same until enough data has arrived to display the new url.
-*/
-void QWebFrame::load(const QWebNetworkRequest &req)
-{
- if (d->parentFrame())
- d->page->d->insideOpenCall = true;
-
- QUrl url = ensureAbsoluteUrl(req.url());
- QHttpRequestHeader httpHeader = req.httpHeader();
- QByteArray postData = req.postData();
-
- WebCore::ResourceRequest request(url);
-
- QString method = httpHeader.method();
- if (!method.isEmpty())
- request.setHTTPMethod(method);
-
- QList<QPair<QString, QString> > values = httpHeader.values();
- for (int i = 0; i < values.size(); ++i) {
- const QPair<QString, QString> &val = values.at(i);
- request.addHTTPHeaderField(val.first, val.second);
- }
-
- if (!postData.isEmpty())
- request.setHTTPBody(WebCore::FormData::create(postData.constData(), postData.size()));
-
- d->frame->loader()->load(request, false);
-
- if (d->parentFrame())
- d->page->d->insideOpenCall = false;
-}
-
-#else
-
/*!
Loads a network request, \a req, into this frame, using the method specified in \a
operation.
@@ -828,7 +883,6 @@ void QWebFrame::load(const QNetworkRequest &req,
if (d->parentFrame())
d->page->d->insideOpenCall = false;
}
-#endif
/*!
Sets the content of this frame to \a html. \a baseUrl is optional and used to resolve relative
@@ -941,11 +995,13 @@ void QWebFrame::setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPol
d->horizontalScrollBarPolicy = policy;
if (d->frame->view()) {
d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
+ d->frame->view()->updateCanHaveScrollbars();
}
} else {
d->verticalScrollBarPolicy = policy;
if (d->frame->view()) {
d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
+ d->frame->view()->updateCanHaveScrollbars();
}
}
}
@@ -1048,7 +1104,6 @@ void QWebFrame::scroll(int dx, int dy)
/*!
\since 4.7
- \internal
Scrolls nested frames starting at this frame, \a dx pixels to the right
and \a dy pixels downward. Both \a dx and \a dy may be negative. First attempts
to scroll elements with CSS overflow followed by this frame. If this
@@ -1056,14 +1111,14 @@ void QWebFrame::scroll(int dx, int dy)
\sa QWebFrame::scroll
*/
-bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy)
+bool QWebFrame::scrollRecursively(int dx, int dy)
{
- Frame* frame = QWebFramePrivate::core(qFrame);
bool scrolledHorizontal = false;
bool scrolledVertical = false;
- bool scrolledOverflow = webframe_scrollOverflow(frame, dx, dy);
+ bool scrolledOverflow = d->scrollOverflow(dx, dy);
if (!scrolledOverflow) {
+ Frame* frame = d->frame;
if (!frame || !frame->view())
return false;
@@ -1091,6 +1146,11 @@ bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d
return (scrolledHorizontal || scrolledVertical || scrolledOverflow);
}
+bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy)
+{
+ return qFrame->scrollRecursively(dx, dy);
+}
+
/*!
\property QWebFrame::scrollPosition
\since 4.5
@@ -1115,6 +1175,17 @@ void QWebFrame::setScrollPosition(const QPoint &pos)
}
/*!
+ \since 4.7
+ Scrolls the frame to the given \a anchor name.
+*/
+void QWebFrame::scrollToAnchor(const QString& anchor)
+{
+ FrameView *view = d->frame->view();
+ if (view)
+ view->scrollToAnchor(anchor);
+}
+
+/*!
\since 4.6
Render the \a layer of the frame using \a painter clipping to \a clip.
@@ -1123,29 +1194,41 @@ void QWebFrame::setScrollPosition(const QPoint &pos)
void QWebFrame::render(QPainter* painter, RenderLayer layer, const QRegion& clip)
{
+ GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
+
if (!clip.isEmpty())
- d->renderPrivate(painter, layer, clip);
+ d->renderRelativeCoords(&context, layer, clip);
else if (d->frame->view())
- d->renderPrivate(painter, layer, QRegion(d->frame->view()->frameRect()));
+ d->renderRelativeCoords(&context, layer, QRegion(d->frame->view()->frameRect()));
}
/*!
Render the frame into \a painter clipping to \a clip.
*/
-void QWebFrame::render(QPainter *painter, const QRegion &clip)
+void QWebFrame::render(QPainter* painter, const QRegion& clip)
{
- d->renderPrivate(painter, AllLayers, clip);
+ GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
+
+ d->renderRelativeCoords(&context, AllLayers, clip);
}
/*!
Render the frame into \a painter.
*/
-void QWebFrame::render(QPainter *painter)
+void QWebFrame::render(QPainter* painter)
{
if (!d->frame->view())
return;
- d->renderPrivate(painter, AllLayers, QRegion(d->frame->view()->frameRect()));
+ GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
+
+ d->renderRelativeCoords(&context, AllLayers, QRegion(d->frame->view()->frameRect()));
}
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
index 08285f8..68594fd 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -26,9 +26,7 @@
#include <QtCore/qvariant.h>
#include <QtGui/qicon.h>
#include <QtScript/qscriptengine.h>
-#if QT_VERSION >= 0x040400
#include <QtNetwork/qnetworkaccessmanager.h>
-#endif
#include "qwebkitglobal.h"
QT_BEGIN_NAMESPACE
@@ -123,13 +121,9 @@ public:
QWebPage *page() const;
void load(const QUrl &url);
-#if QT_VERSION < 0x040400
- void load(const QWebNetworkRequest &request);
-#else
void load(const QNetworkRequest &request,
QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
const QByteArray &body = QByteArray());
-#endif
void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
@@ -162,9 +156,12 @@ public:
QRect scrollBarGeometry(Qt::Orientation orientation) const;
void scroll(int, int);
+ bool scrollRecursively(int, int);
QPoint scrollPosition() const;
void setScrollPosition(const QPoint &pos);
+ void scrollToAnchor(const QString& anchor);
+
enum RenderLayer {
ContentsLayer = 0x10,
ScrollBarLayer = 0x20,
@@ -222,6 +219,8 @@ Q_SIGNALS:
void loadStarted();
void loadFinished(bool ok);
+ void pageChanged();
+
private:
friend class QWebPage;
friend class QWebPagePrivate;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
index 095d134..7d79474 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -25,6 +25,7 @@
#include "qwebpage_p.h"
#include "EventHandler.h"
+#include "GraphicsContext.h"
#include "KURL.h"
#include "PlatformString.h"
#include "qwebelement.h"
@@ -72,6 +73,7 @@ public:
, marginHeight(-1)
{}
void init(QWebFrame* qframe, QWebFrameData* frameData);
+ void setPage(QWebPage*);
inline QWebFrame *parentFrame() { return qobject_cast<QWebFrame*>(q->parent()); }
@@ -81,7 +83,8 @@ public:
static WebCore::Frame* core(QWebFrame*);
static QWebFrame* kit(WebCore::Frame*);
- void renderPrivate(QPainter*, QWebFrame::RenderLayer, const QRegion& clip);
+ void renderRelativeCoords(WebCore::GraphicsContext*, QWebFrame::RenderLayer, const QRegion& clip);
+ void renderContentsLayerAbsoluteCoords(WebCore::GraphicsContext*, const QRegion& clip);
bool scrollOverflow(int dx, int dy);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
index 1145744..c3ef530 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
@@ -139,9 +139,6 @@ QSize QWebInspector::sizeHint() const
/*! \reimp */
bool QWebInspector::event(QEvent* ev)
{
- if (ev->type() == QEvent::Close && d->page)
- d->page->d->inspectorController()->setWindowVisible(false);
-
return QWidget::event(ev);
}
@@ -154,9 +151,11 @@ void QWebInspector::resizeEvent(QResizeEvent* event)
/*! \reimp */
void QWebInspector::showEvent(QShowEvent* event)
{
+#if ENABLE(INSPECTOR)
// Allows QWebInspector::show() to init the inspector.
if (d->page)
d->page->d->inspectorController()->show();
+#endif
}
/*! \reimp */
@@ -164,6 +163,15 @@ void QWebInspector::hideEvent(QHideEvent* event)
{
}
+/*! \reimp */
+void QWebInspector::closeEvent(QCloseEvent* event)
+{
+#if ENABLE(INSPECTOR)
+ if (d->page)
+ d->page->d->inspectorController()->setWindowVisible(false);
+#endif
+}
+
/*! \internal */
void QWebInspectorPrivate::setFrontend(QWidget* newFrontend)
{
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
index a5c1ed5..6cda479 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
@@ -43,6 +43,7 @@ protected:
void resizeEvent(QResizeEvent* event);
void showEvent(QShowEvent* event);
void hideEvent(QHideEvent* event);
+ void closeEvent(QCloseEvent* event);
private:
QWebInspectorPrivate* d;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
index 0885bdc..9e8979f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
@@ -40,15 +40,4 @@
# endif
#endif
-#if QT_VERSION < 0x040400
- #ifndef QT_BEGIN_NAMESPACE
- #define QT_BEGIN_NAMESPACE
- #endif
-
- #ifndef QT_END_NAMESPACE
- #define QT_END_NAMESPACE
- #endif
-#endif
-
-
#endif // QWEBKITGLOBAL_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index a289ec0..2a8aced 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -32,6 +32,8 @@
#include "qwebsettings.h"
#include "qwebkitversion.h"
+#include "Chrome.h"
+#include "ContextMenuController.h"
#include "Frame.h"
#include "FrameTree.h"
#include "FrameLoader.h"
@@ -79,6 +81,7 @@
#include "runtime/InitializeThreading.h"
#include "PageGroup.h"
#include "QWebPageClient.h"
+#include "WorkerThread.h"
#include <QApplication>
#include <QBasicTimer>
@@ -102,16 +105,18 @@
#include <QStyle>
#include <QSysInfo>
#include <QTextCharFormat>
-#if QT_VERSION >= 0x040400
+#include <QTextDocument>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
-#else
-#include "qwebnetworkinterface.h"
-#endif
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+#include <QTouchEvent>
+#include "PlatformTouchEvent.h"
+#endif
+
using namespace WebCore;
void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
@@ -126,12 +131,26 @@ void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
db->refresh();
}
+int QWEBKIT_EXPORT qt_drt_workerThreadCount()
+{
+#if ENABLE(WORKERS)
+ return WebCore::WorkerThread::workerThreadCount();
+#else
+ return 0;
+#endif
+}
+
bool QWebPagePrivate::drtRun = false;
void QWEBKIT_EXPORT qt_drt_run(bool b)
{
QWebPagePrivate::drtRun = b;
}
+void QWEBKIT_EXPORT qt_drt_setFrameSetFlatteningEnabled(QWebPage* page, bool enabled)
+{
+ QWebPagePrivate::core(page)->settings()->setFrameSetFlatteningEnabled(enabled);
+}
+
void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName)
{
page->handle()->page->setGroupName(groupName);
@@ -142,6 +161,40 @@ QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
return page->handle()->page->groupName();
}
+#if ENABLE(INSPECTOR)
+void QWEBKIT_EXPORT qt_drt_webinspector_executeScript(QWebPage* page, long callId, const QString& script)
+{
+ if (!page->handle()->page->inspectorController())
+ return;
+ page->handle()->page->inspectorController()->evaluateForTestInFrontend(callId, script);
+}
+
+void QWEBKIT_EXPORT qt_drt_webinspector_close(QWebPage* page)
+{
+ if (!page->handle()->page->inspectorController())
+ return;
+ page->handle()->page->inspectorController()->close();
+}
+
+void QWEBKIT_EXPORT qt_drt_webinspector_show(QWebPage* page)
+{
+ if (!page->handle()->page->inspectorController())
+ return;
+ page->handle()->page->inspectorController()->show();
+}
+
+void QWEBKIT_EXPORT qt_drt_setTimelineProfilingEnabled(QWebPage* page, bool enabled)
+{
+ InspectorController* controller = page->handle()->page->inspectorController();
+ if (!controller)
+ return;
+ if (enabled)
+ controller->startTimelineProfiler();
+ else
+ controller->stopTimelineProfiler();
+}
+#endif
+
class QWebPageWidgetClient : public QWebPageClient {
public:
QWebPageWidgetClient(QWidget* view)
@@ -169,6 +222,8 @@ public:
virtual QObject* pluginParent() const;
+ virtual QStyle* style() const;
+
QWidget* view;
};
@@ -238,6 +293,11 @@ QObject* QWebPageWidgetClient::pluginParent() const
return view;
}
+QStyle* QWebPageWidgetClient::style() const
+{
+ return view->style();
+}
+
// Lookup table mapping QWebPage::WebActions to the associated Editor commands
static const char* editorCommandWebActions[] =
{
@@ -341,8 +401,10 @@ static inline DragOperation dropActionToDragOp(Qt::DropActions actions)
unsigned result = 0;
if (actions & Qt::CopyAction)
result |= DragOperationCopy;
+ // DragOperationgeneric represents InternetExplorer's equivalent of Move operation,
+ // hence it should be considered as "move"
if (actions & Qt::MoveAction)
- result |= DragOperationMove;
+ result |= (DragOperationMove | DragOperationGeneric);
if (actions & Qt::LinkAction)
result |= DragOperationLink;
return (DragOperation)result;
@@ -355,6 +417,10 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions)
result = Qt::CopyAction;
else if (actions & DragOperationMove)
result = Qt::MoveAction;
+ // DragOperationgeneric represents InternetExplorer's equivalent of Move operation,
+ // hence it should be considered as "move"
+ else if (actions & DragOperationGeneric)
+ result = Qt::MoveAction;
else if (actions & DragOperationLink)
result = Qt::LinkAction;
return result;
@@ -366,11 +432,11 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
#if QT_VERSION < 0x040600
, view(0)
#endif
+ , clickCausedFocus(false)
+ , viewportSize(QSize(0, 0))
, inspectorFrontend(0)
, inspector(0)
, inspectorIsInternalOnly(false)
- , viewportSize(QSize(0, 0))
- , clickCausedFocus(false)
{
WebCore::InitializeLoggingChannelsIfNecessary();
JSC::initializeThreading();
@@ -380,7 +446,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
contextMenuClient = new ContextMenuClientQt();
editorClient = new EditorClientQt(q);
page = new Page(chromeClient, contextMenuClient, editorClient,
- new DragClientQt(q), new InspectorClientQt(q), 0);
+ new DragClientQt(q), new InspectorClientQt(q), 0, 0);
settings = new QWebSettings(page->settings());
@@ -388,11 +454,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
undoStack = 0;
#endif
mainFrame = 0;
-#if QT_VERSION < 0x040400
- networkInterface = 0;
-#else
networkManager = 0;
-#endif
pluginFactory = 0;
insideOpenCall = false;
forwardUnsupportedContent = false;
@@ -421,15 +483,11 @@ QWebPagePrivate::~QWebPagePrivate()
delete page;
}
-#if QT_VERSION < 0x040400
-bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type)
+WebCore::Page* QWebPagePrivate::core(QWebPage* page)
{
- if (insideOpenCall
- && frame == mainFrame)
- return true;
- return q->acceptNavigationRequest(frame, request, type);
+ return page->d->page;
}
-#else
+
bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
{
if (insideOpenCall
@@ -437,7 +495,6 @@ bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRe
return true;
return q->acceptNavigationRequest(frame, request, type);
}
-#endif
void QWebPagePrivate::createMainFrame()
{
@@ -473,7 +530,9 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
case WebCore::ContextMenuItemTagBold: return QWebPage::ToggleBold;
case WebCore::ContextMenuItemTagItalic: return QWebPage::ToggleItalic;
case WebCore::ContextMenuItemTagUnderline: return QWebPage::ToggleUnderline;
+#if ENABLE(INSPECTOR)
case WebCore::ContextMenuItemTagInspectElement: return QWebPage::InspectElement;
+#endif
default: break;
}
return QWebPage::NoWebAction;
@@ -1079,8 +1138,9 @@ void QWebPagePrivate::focusOutEvent(QFocusEvent*)
// and the focus frame. But don't tell the focus controller so that upon
// focusInEvent() we can re-activate the frame.
FocusController *focusController = page->focusController();
- focusController->setActive(false);
+ // Call setFocused first so that window.onblur doesn't get called twice
focusController->setFocused(false);
+ focusController->setActive(false);
}
void QWebPagePrivate::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
@@ -1102,8 +1162,9 @@ void QWebPagePrivate::dragEnterEvent(QDragEnterEvent* ev)
dropActionToDragOp(ev->possibleActions()));
Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData));
ev->setDropAction(action);
- if (action != Qt::IgnoreAction)
- ev->accept();
+ // We must accept this event in order to receive the drag move events that are sent
+ // while the drag and drop action is in progress.
+ ev->accept();
#endif
}
@@ -1143,9 +1204,11 @@ void QWebPagePrivate::dragMoveEvent(QDragMoveEvent* ev)
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
dropActionToDragOp(ev->possibleActions()));
Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData));
+ m_lastDropAction = action;
ev->setDropAction(action);
- if (action != Qt::IgnoreAction)
- ev->accept();
+ // We must accept this event in order to receive the drag move events that are sent
+ // while the drag and drop action is in progress.
+ ev->accept();
#endif
}
@@ -1154,8 +1217,7 @@ void QWebPagePrivate::dropEvent(QGraphicsSceneDragDropEvent* ev)
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos().toPoint(),
QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
- Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData));
- if (action != Qt::IgnoreAction)
+ if (page->dragController()->performDrag(&dragData))
ev->accept();
#endif
}
@@ -1163,10 +1225,11 @@ void QWebPagePrivate::dropEvent(QGraphicsSceneDragDropEvent* ev)
void QWebPagePrivate::dropEvent(QDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
+ // Overwrite the defaults set by QDragManager::defaultAction()
+ ev->setDropAction(m_lastDropAction);
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
- dropActionToDragOp(ev->possibleActions()));
- Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData));
- if (action != Qt::IgnoreAction)
+ dropActionToDragOp(Qt::DropAction(ev->dropAction())));
+ if (page->dragController()->performDrag(&dragData))
ev->accept();
#endif
}
@@ -1235,7 +1298,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
break;
}
case QInputMethodEvent::Cursor: {
- frame->setCaretVisible(a.length); //if length is 0 cursor is invisible
+ frame->selection()->setCaretVisible(a.length); //if length is 0 cursor is invisible
if (a.length > 0) {
RenderObject* caretRenderer = frame->selection()->caretRenderer();
if (caretRenderer) {
@@ -1313,16 +1376,16 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
granularity = ScrollByPage;
direction = ScrollDown;
} else if (ev == QKeySequence::MoveToPreviousPage
- || (ev->key() == Qt::Key_Space) && (ev->modifiers() & Qt::ShiftModifier)) {
+ || ((ev->key() == Qt::Key_Space) && (ev->modifiers() & Qt::ShiftModifier))) {
granularity = ScrollByPage;
direction = ScrollUp;
} else
#endif // QT_NO_SHORTCUT
- if (ev->key() == Qt::Key_Up && ev->modifiers() & Qt::ControlModifier
+ if ((ev->key() == Qt::Key_Up && ev->modifiers() & Qt::ControlModifier)
|| ev->key() == Qt::Key_Home) {
granularity = ScrollByDocument;
direction = ScrollUp;
- } else if (ev->key() == Qt::Key_Down && ev->modifiers() & Qt::ControlModifier
+ } else if ((ev->key() == Qt::Key_Down && ev->modifiers() & Qt::ControlModifier)
|| ev->key() == Qt::Key_End) {
granularity = ScrollByDocument;
direction = ScrollDown;
@@ -1352,6 +1415,18 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
return frame->eventHandler()->scrollRecursively(direction, granularity);
}
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+void QWebPagePrivate::touchEvent(QTouchEvent* event)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event));
+ event->setAccepted(accepted);
+}
+#endif
+
/*!
This method is used by the input method to query a set of properties of the page
to be able to support complex input method operations as support for surrounding
@@ -1380,6 +1455,11 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
switch (property) {
case Qt::ImMicroFocus: {
+ WebCore::FrameView* view = frame->view();
+ if (view && view->needsLayout()) {
+ // We can't access absoluteCaretBounds() while the view needs to layout.
+ return QVariant();
+ }
return QVariant(frame->selection()->absoluteCaretBounds());
}
case Qt::ImFont: {
@@ -1478,6 +1558,7 @@ void QWebPagePrivate::setInspector(QWebInspector* insp)
*/
QWebInspector* QWebPagePrivate::getOrCreateInspector()
{
+#if ENABLE(INSPECTOR)
if (!inspector) {
QWebInspector* insp = new QWebInspector;
insp->setPage(q);
@@ -1485,13 +1566,18 @@ QWebInspector* QWebPagePrivate::getOrCreateInspector()
Q_ASSERT(inspector); // Associated through QWebInspector::setPage(q)
}
+#endif
return inspector;
}
/*! \internal */
InspectorController* QWebPagePrivate::inspectorController()
{
+#if ENABLE(INSPECTOR)
return page->inspectorController();
+#else
+ return 0;
+#endif
}
@@ -1830,7 +1916,7 @@ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
{
Q_UNUSED(frame)
#ifndef QT_NO_MESSAGEBOX
- QMessageBox::information(view(), tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
+ QMessageBox::information(view(), tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QMessageBox::Ok);
#endif
}
@@ -1846,7 +1932,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
#ifdef QT_NO_MESSAGEBOX
return true;
#else
- return QMessageBox::Yes == QMessageBox::information(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()), Qt::escape(msg), QMessageBox::Yes, QMessageBox::No);
#endif
}
@@ -1865,7 +1951,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(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()), Qt::escape(msg), QLineEdit::Normal, defaultValue, &ok);
if (ok && result)
*result = x;
#endif
@@ -1903,6 +1989,8 @@ bool QWebPage::shouldInterruptJavaScript()
If the view associated with the web page is a QWebView object, then the default implementation forwards
the request to QWebView's createWindow() function; otherwise it returns a null pointer.
+ If \a type is WebModalDialog, the application must call setWindowModality(Qt::ApplicationModal) on the new window.
+
\sa acceptNavigationRequest()
*/
QWebPage *QWebPage::createWindow(WebWindowType type)
@@ -2033,11 +2121,13 @@ void QWebPage::triggerAction(WebAction action, bool)
editor->setBaseWritingDirection(RightToLeftWritingDirection);
break;
case InspectElement: {
+#if ENABLE(INSPECTOR)
if (!d->hitTestResult.isNull()) {
d->getOrCreateInspector(); // Make sure the inspector is created
d->inspector->show(); // The inspector is expected to be shown on inspection
d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get());
}
+#endif
break;
}
default:
@@ -2134,11 +2224,7 @@ void QWebPage::setPreferredContentsSize(const QSize &size) const
\sa createWindow()
*/
-#if QT_VERSION >= 0x040400
bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
-#else
-bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type)
-#endif
{
Q_UNUSED(frame)
if (type == NavigationTypeLinkClicked) {
@@ -2226,27 +2312,19 @@ QAction *QWebPage::action(WebAction action) const
case Back:
text = contextMenuItemTagGoBack();
-#if QT_VERSION >= 0x040400
icon = style->standardIcon(QStyle::SP_ArrowBack);
-#endif
break;
case Forward:
text = contextMenuItemTagGoForward();
-#if QT_VERSION >= 0x040400
icon = style->standardIcon(QStyle::SP_ArrowForward);
-#endif
break;
case Stop:
text = contextMenuItemTagStop();
-#if QT_VERSION >= 0x040400
icon = style->standardIcon(QStyle::SP_BrowserStop);
-#endif
break;
case Reload:
text = contextMenuItemTagReload();
-#if QT_VERSION >= 0x040400
icon = style->standardIcon(QStyle::SP_BrowserReload);
-#endif
break;
case Cut:
@@ -2579,6 +2657,13 @@ bool QWebPage::event(QEvent *ev)
case QEvent::Leave:
d->leaveEvent(ev);
break;
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ d->touchEvent(static_cast<QTouchEvent*>(ev));
+ break;
+#endif
default:
return QObject::event(ev);
}
@@ -2736,8 +2821,11 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result));
WebCore::ContextMenu menu(result);
menu.populate();
+
+#if ENABLE(INSPECTOR)
if (d->page->inspectorController()->enabled())
menu.addInspectElementItem();
+#endif
QBitArray visitedWebActions(QWebPage::WebActionCount);
@@ -2976,35 +3064,6 @@ QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFil
#endif
}
-#if QT_VERSION < 0x040400 && !defined qdoc
-
-void QWebPage::setNetworkInterface(QWebNetworkInterface *interface)
-{
- d->networkInterface = interface;
-}
-
-QWebNetworkInterface *QWebPage::networkInterface() const
-{
- if (d->networkInterface)
- return d->networkInterface;
- else
- return QWebNetworkInterface::defaultInterface();
-}
-
-#ifndef QT_NO_NETWORKPROXY
-void QWebPage::setNetworkProxy(const QNetworkProxy& proxy)
-{
- d->networkProxy = proxy;
-}
-
-QNetworkProxy QWebPage::networkProxy() const
-{
- return d->networkProxy;
-}
-#endif
-
-#else
-
/*!
Sets the QNetworkAccessManager \a manager responsible for serving network requests for this
QWebPage.
@@ -3038,8 +3097,6 @@ QNetworkAccessManager *QWebPage::networkAccessManager() const
return d->networkManager;
}
-#endif
-
/*!
Sets the QWebPluginFactory \a factory responsible for creating plugins embedded into this
QWebPage.
@@ -3294,11 +3351,9 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
QString appName = QCoreApplication::applicationName();
if (!appName.isEmpty()) {
ua.append(appName);
-#if QT_VERSION >= 0x040400
QString appVer = QCoreApplication::applicationVersion();
if (!appVer.isEmpty())
ua.append(QLatin1Char('/') + appVer);
-#endif
} else {
// Qt version
ua.append(QLatin1String("Qt/"));
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index 8c455b1..4766cbd 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -208,20 +208,8 @@ public:
QUndoStack *undoStack() const;
#endif
-#if QT_VERSION < 0x040400 && !defined(qdoc)
- void setNetworkInterface(QWebNetworkInterface *interface);
- QWebNetworkInterface *networkInterface() const;
-
- // #### why is this in the page itself?
-#ifndef QT_NO_NETWORKPROXY
- void setNetworkProxy(const QNetworkProxy& proxy);
- QNetworkProxy networkProxy() const;
-#endif
-
-#else
void setNetworkAccessManager(QNetworkAccessManager *manager);
QNetworkAccessManager *networkAccessManager() const;
-#endif
void setPluginFactory(QWebPluginFactory *factory);
QWebPluginFactory *pluginFactory() const;
@@ -334,10 +322,8 @@ Q_SIGNALS:
void statusBarVisibilityChangeRequested(bool visible);
void menuBarVisibilityChangeRequested(bool visible);
-#if QT_VERSION >= 0x040400
void unsupportedContent(QNetworkReply *reply);
void downloadRequested(const QNetworkRequest &request);
-#endif
void microFocusChanged();
void contentsChanged();
@@ -350,11 +336,7 @@ protected:
virtual QWebPage *createWindow(WebWindowType type);
virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
-#if QT_VERSION >= 0x040400
virtual bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type);
-#else
- virtual bool acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, NavigationType type);
-#endif
virtual QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile);
virtual void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg);
virtual bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index f0f842d..15ddfb2 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -62,6 +62,9 @@ class QWebPagePrivate {
public:
QWebPagePrivate(QWebPage*);
~QWebPagePrivate();
+
+ static WebCore::Page* core(QWebPage*);
+
void createMainFrame();
#ifndef QT_NO_CONTEXTMENU
QMenu* createContextMenu(const WebCore::ContextMenu* webcoreMenu, const QList<WebCore::ContextMenuItem>* items, QBitArray* visitedWebActions);
@@ -114,6 +117,10 @@ public:
void handleSoftwareInputPanel(Qt::MouseButton);
bool handleScrolling(QKeyEvent*, WebCore::Frame*);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ void touchEvent(QTouchEvent*);
+#endif
+
void setInspector(QWebInspector*);
QWebInspector* getOrCreateInspector();
WebCore::InspectorController* inspectorController();
@@ -151,18 +158,8 @@ public:
bool clickCausedFocus;
-#if QT_VERSION < 0x040400
- bool acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type);
-
- QWebNetworkInterface *networkInterface;
-#ifndef QT_NO_NETWORKPROXY
- QNetworkProxy networkProxy;
-#endif
-
-#else
bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type);
QNetworkAccessManager *networkManager;
-#endif
bool forwardUnsupportedContent;
QWebPage::LinkDelegationPolicy linkPolicy;
@@ -186,6 +183,7 @@ public:
QWidget* inspectorFrontend;
QWebInspector* inspector;
bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
+ Qt::DropAction m_lastDropAction;
static bool drtRun;
};
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
index 2a225c5..6c26bd7 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -40,6 +40,11 @@ void QWEBKIT_EXPORT qt_drt_resetOriginAccessWhiteLists()
SecurityOrigin::resetOriginAccessWhiteLists();
}
+void QWEBKIT_EXPORT qt_drt_setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
+{
+ SecurityOrigin::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
+}
+
/*!
\class QWebSecurityOrigin
\since 4.5
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index 79ef16f..d60f09c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -90,6 +90,7 @@ static WebGraphicHash* graphics()
hash->insert(QWebSettings::MissingPluginGraphic, QPixmap(QLatin1String(":webkit/resources/nullPlugin.png")));
hash->insert(QWebSettings::DefaultFrameIconGraphic, QPixmap(QLatin1String(":webkit/resources/urlIcon.png")));
hash->insert(QWebSettings::TextAreaSizeGripCornerGraphic, QPixmap(QLatin1String(":webkit/resources/textAreaResizeCorner.png")));
+ hash->insert(QWebSettings::DeleteButtonGraphic, QPixmap(QLatin1String(":webkit/resources/deleteButton.png")));
}
return hash;
@@ -151,7 +152,12 @@ void QWebSettingsPrivate::apply()
value = attributes.value(QWebSettings::JavascriptEnabled,
global->attributes.value(QWebSettings::JavascriptEnabled));
settings->setJavaScriptEnabled(value);
+#if USE(ACCELERATED_COMPOSITING)
+ value = attributes.value(QWebSettings::AcceleratedCompositingEnabled,
+ global->attributes.value(QWebSettings::AcceleratedCompositingEnabled));
+ settings->setAcceleratedCompositingEnabled(value);
+#endif
value = attributes.value(QWebSettings::JavascriptCanOpenWindows,
global->attributes.value(QWebSettings::JavascriptCanOpenWindows));
settings->setJavaScriptCanOpenWindowsAutomatically(value);
@@ -203,12 +209,20 @@ void QWebSettingsPrivate::apply()
value = attributes.value(QWebSettings::LocalStorageEnabled,
global->attributes.value(QWebSettings::LocalStorageEnabled));
-
settings->setLocalStorageEnabled(value);
value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls,
global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls));
settings->setAllowUniversalAccessFromFileURLs(value);
+
+ value = attributes.value(QWebSettings::LocalContentCanAccessFileUrls,
+ global->attributes.value(QWebSettings::LocalContentCanAccessFileUrls));
+ settings->setAllowFileAccessFromFileURLs(value);
+
+ value = attributes.value(QWebSettings::XSSAuditorEnabled,
+ global->attributes.value(QWebSettings::XSSAuditorEnabled));
+ settings->setXSSAuditorEnabled(value);
+
settings->setUsesPageCache(WebCore::pageCache()->capacity());
} else {
QList<QWebSettingsPrivate*> settings = *::allSettings();
@@ -353,6 +367,8 @@ QWebSettings* QWebSettings::globalSettings()
\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 LocalContentCanAccessFileUrls Specifies whether locally loaded documents are allowed to access other local urls.
+ \value XSSAuditorEnabled Specifies whether load requests should be monitored for cross-site scripting attempts.
*/
/*!
@@ -383,6 +399,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::LocalContentCanAccessFileUrls, true);
+ d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, false);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
d->defaultTextEncoding = QLatin1String("iso-8859-1");
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
index 50cf424..b1f5cf2 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
@@ -67,13 +67,17 @@ public:
LocalStorageDatabaseEnabled = LocalStorageEnabled,
#endif
LocalContentCanAccessRemoteUrls,
- DnsPrefetchEnabled
+ LocalContentCanAccessFileUrls,
+ DnsPrefetchEnabled,
+ XSSAuditorEnabled,
+ AcceleratedCompositingEnabled
};
enum WebGraphic {
MissingImageGraphic,
MissingPluginGraphic,
DefaultFrameIconGraphic,
- TextAreaSizeGripCornerGraphic
+ TextAreaSizeGripCornerGraphic,
+ DeleteButtonGraphic
};
enum FontSize {
MinimumFontSize,
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index 79538ff..79c16c7 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -22,10 +22,11 @@
#include "config.h"
#include "qwebview.h"
+#include "Page.h"
#include "QWebPageClient.h"
+#include "Settings.h"
#include "qwebframe.h"
#include "qwebpage_p.h"
-
#include "qbitmap.h"
#include "qevent.h"
#include "qpainter.h"
@@ -59,96 +60,141 @@ void QWebViewPrivate::_q_pageDestroyed()
#ifdef Q_WS_MAEMO_5
#include "qabstractkineticscroller.h"
+#include "qapplication.h"
-class QWebViewKineticScroller : public QAbstractKineticScroller {
+// QCoreApplication::sendSpontaneousEvent() is private, hence this friend wrapper
+bool qt_sendSpontaneousEvent(QObject* receiver, QEvent* ev)
+{
+ return QCoreApplication::sendSpontaneousEvent(receiver, ev);
+}
+
+class QWebViewKineticScroller : public QObject, public QAbstractKineticScroller {
public:
- QWebViewKineticScroller() : QAbstractKineticScroller() {}
- // remember the frame where the button was pressed
+ QWebViewKineticScroller()
+ : QObject()
+ , QAbstractKineticScroller()
+ , m_view(0)
+ , m_ignoreEvents(false)
+ {
+ }
+
+ void setWidget(QWebView* widget)
+ {
+ if (m_view) {
+ m_view->removeEventFilter(this);
+ QWebFrame* frame = m_view->page()->mainFrame();
+ frame->setScrollBarPolicy(Qt::Vertical, m_oldVerticalScrollBarPolicy);
+ frame->setScrollBarPolicy(Qt::Horizontal, m_oldHorizontalScrollBarPolicy);
+ }
+
+ m_view = widget;
+ setParent(m_view);
+ if (m_view) {
+ QWebFrame* frame = m_view->page()->mainFrame();
+ m_oldHorizontalScrollBarPolicy = frame->scrollBarPolicy(Qt::Horizontal);
+ m_oldVerticalScrollBarPolicy = frame->scrollBarPolicy(Qt::Vertical);
+ frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
+ frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+ m_view->installEventFilter(this);
+ }
+ }
+
+protected:
bool eventFilter(QObject* o, QEvent* ev)
{
+ if (!o || m_view != o || m_ignoreEvents || !m_view->isEnabled())
+ return QObject::eventFilter(o, ev);
+
+ bool res = false;
+
switch (ev->type()) {
case QEvent::MouseButtonPress: {
+ // remember the frame where the button was pressed
QWebFrame* hitFrame = scrollingFrameAt(static_cast<QMouseEvent*>(ev)->pos());
if (hitFrame)
m_frame = hitFrame;
- break;
+ // fall through
}
+ case QEvent::MouseMove:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonDblClick:
+ res = handleMouseEvent(static_cast<QMouseEvent*>(ev));
+ break;
default:
break;
}
- return QAbstractKineticScroller::eventFilter(o, ev);
+ return res ? true : QObject::eventFilter(o, ev);
}
-protected:
- QWebFrame* currentFrame() const
+ void cancelLeftMouseButtonPress(const QPoint& /* globalPressPos */)
{
- if (!m_frame.isNull())
- return m_frame.data();
-
- QWebView* view = static_cast<QWebView*>(widget());
- QWebFrame* frame = view->page()->mainFrame();
- return frame;
+ QMouseEvent cmem(QEvent::MouseMove, QPoint(-INT_MAX, -INT_MAX), Qt::LeftButton, QApplication::mouseButtons() | Qt::LeftButton, QApplication::keyboardModifiers());
+ sendEvent(m_view, &cmem);
+ QMouseEvent cmer(QEvent::MouseButtonRelease, QPoint(-INT_MAX, -INT_MAX), Qt::LeftButton, QApplication::mouseButtons() & ~Qt::LeftButton, QApplication::keyboardModifiers());
+ sendEvent(m_view, &cmer);
}
- // Returns the innermost frame at the given position that can scroll.
- QWebFrame* scrollingFrameAt(const QPoint& pos) const
+ QWebFrame* currentFrame() const
{
- QWebView* view = static_cast<QWebView*>(widget());
- QWebFrame* mainFrame = view->page()->mainFrame();
- QWebFrame* hitFrame = mainFrame->hitTestContent(pos).frame();
- QSize range = hitFrame->contentsSize() - hitFrame->geometry().size();
+ if (m_frame)
+ return m_frame;
- while (hitFrame && range.width() <= 1 && range.height() <= 1)
- hitFrame = hitFrame->parentFrame();
+ if (m_view)
+ return m_view->page()->mainFrame();
- return hitFrame;
+ return 0;
}
- void attachToWidget()
+ // Returns the innermost frame at the given position that can scroll.
+ QWebFrame* scrollingFrameAt(const QPoint& pos) const
{
- QWebView* view = static_cast<QWebView*>(widget());
- QWebFrame* mainFrame = view->page()->mainFrame();
- m_oldHorizontalScrollBarPolicy = mainFrame->scrollBarPolicy(Qt::Horizontal);
- m_oldVerticalScrollBarPolicy = mainFrame->scrollBarPolicy(Qt::Vertical);
- mainFrame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
- mainFrame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
- view->installEventFilter(this);
- }
+ QWebFrame* hitFrame = 0;
+ if (m_view) {
+ QWebFrame* frame = m_view->page()->mainFrame();
+ hitFrame = frame->hitTestContent(pos).frame();
+ QSize range = hitFrame->contentsSize() - hitFrame->geometry().size();
- void removeFromWidget()
- {
- QWebView* view = static_cast<QWebView*>(widget());
- view->removeEventFilter(this);
- QWebFrame* mainFrame = view->page()->mainFrame();
- mainFrame->setScrollBarPolicy(Qt::Vertical, m_oldVerticalScrollBarPolicy);
- mainFrame->setScrollBarPolicy(Qt::Horizontal, m_oldHorizontalScrollBarPolicy);
+ while (hitFrame && range.width() <= 1 && range.height() <= 1)
+ hitFrame = hitFrame->parentFrame();
+
+ return hitFrame;
+ }
}
- QRect positionRange() const
+ QPoint maximumScrollPosition() const
{
- QRect r;
QWebFrame* frame = currentFrame();
- r.setSize(frame->contentsSize() - frame->geometry().size());
- return r;
+ QSize s = frame ? frame->contentsSize() - frame->geometry().size() : QSize(0, 0);
+ return QPoint(qMax(0, s.width()), qMax(0, s.height()));
}
- QPoint position() const
+ QPoint scrollPosition() const
{
QWebFrame* frame = currentFrame();
- return frame->scrollPosition();
+ return frame ? frame->scrollPosition() : QPoint();
}
QSize viewportSize() const
{
- return static_cast<QWebView*>(widget())->page()->viewportSize();
+ return m_view ? m_view->page()->viewportSize() : QSize();
}
- void setPosition(const QPoint& point, const QPoint& /* overShootDelta */)
+ void setScrollPosition(const QPoint& point, const QPoint& /* overShootDelta */)
{
QWebFrame* frame = currentFrame();
- frame->setScrollPosition(point);
+ if (frame)
+ frame->setScrollPosition(point);
}
+ void sendEvent(QWidget* w, QEvent* ev)
+ {
+ m_ignoreEvents = true;
+ qt_sendSpontaneousEvent(w, ev);
+ m_ignoreEvents = false;
+ }
+
+ QWebView* m_view;
+ bool m_ignoreEvents;
QPointer<QWebFrame> m_frame;
Qt::ScrollBarPolicy m_oldVerticalScrollBarPolicy;
Qt::ScrollBarPolicy m_oldHorizontalScrollBarPolicy;
@@ -253,9 +299,13 @@ QWebView::QWebView(QWidget *parent)
setAttribute(Qt::WA_InputMethodEnabled);
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ setAttribute(Qt::WA_AcceptTouchEvents);
+#endif
#if defined(Q_WS_MAEMO_5)
QAbstractKineticScroller* scroller = new QWebViewKineticScroller();
- scroller->setWidget(this);
+ static_cast<QWebViewKineticScroller*>(scroller)->setWidget(this);
+ setProperty("kineticScroller", QVariant::fromValue(scroller));
#endif
setAcceptDrops(true);
@@ -347,6 +397,9 @@ void QWebView::setPage(QWebPage* page)
this, SLOT(_q_pageDestroyed()));
}
setAttribute(Qt::WA_OpaquePaintEvent, d->page);
+#if USE(ACCELERATED_COMPOSITING)
+ d->page->d->page->settings()->setAcceleratedCompositingEnabled(false);
+#endif
update();
}
@@ -374,19 +427,11 @@ void QWebView::load(const QUrl &url)
\sa url(), urlChanged()
*/
-#if QT_VERSION < 0x040400 && !defined(qdoc)
-void QWebView::load(const QWebNetworkRequest &request)
-#else
void QWebView::load(const QNetworkRequest &request,
QNetworkAccessManager::Operation operation,
const QByteArray &body)
-#endif
{
- page()->mainFrame()->load(request
-#if QT_VERSION >= 0x040400
- , operation, body
-#endif
- );
+ page()->mainFrame()->load(request, operation, body);
}
/*!
@@ -740,7 +785,6 @@ bool QWebView::event(QEvent *e)
if (e->type() == QEvent::ShortcutOverride) {
d->page->event(e);
#ifndef QT_NO_CURSOR
-#if QT_VERSION >= 0x040400
} else if (e->type() == QEvent::CursorChange) {
// An unsetCursor will set the cursor to Qt::ArrowCursor.
// Thus this cursor change might be a QWidget::unsetCursor()
@@ -753,6 +797,13 @@ bool QWebView::event(QEvent *e)
if (cursor().shape() == Qt::ArrowCursor)
d->page->d->client->resetCursor();
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ } else if (e->type() == QEvent::TouchBegin
+ || e->type() == QEvent::TouchEnd
+ || e->type() == QEvent::TouchUpdate) {
+ d->page->event(e);
+ if (e->isAccepted())
+ return true;
#endif
} else if (e->type() == QEvent::Leave)
d->page->event(e);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
index 0f79c70..f681fbc 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
@@ -27,9 +27,7 @@
#include <QtGui/qicon.h>
#include <QtGui/qpainter.h>
#include <QtCore/qurl.h>
-#if QT_VERSION >= 0x040400
#include <QtNetwork/qnetworkaccessmanager.h>
-#endif
QT_BEGIN_NAMESPACE
class QNetworkRequest;
@@ -61,13 +59,9 @@ public:
void setPage(QWebPage* page);
void load(const QUrl& url);
-#if QT_VERSION < 0x040400 && !defined(qdoc)
- void load(const QWebNetworkRequest& request);
-#else
void load(const QNetworkRequest& request,
QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
const QByteArray &body = QByteArray());
-#endif
void setHtml(const QString& html, const QUrl& baseUrl = QUrl());
void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl());
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 1026ac5..c367bbb 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,12 +1,534 @@
-2010-01-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+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
+
+2010-02-18 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Minor improvement to hybrid QPixmap
+ https://bugs.webkit.org/show_bug.cgi?id=34507
+
+ * tests/hybridPixmap/test.html: use assignToHTMLImageElement on an
+ existing element instead of toHTMLImageElement which creates a new one
+
+2010-02-17 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by David Levin, Darin Fisher, Simon Hausmann.
+
+ When a live iframe element is moved between pages, it still depends on the old page.
+ https://bugs.webkit.org/show_bug.cgi?id=34382
+
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::setPage): Added.
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didTransferChildFrameToNewDocument):
+ The QWebFrame caches a QWebPage which should be replaced when Frame is re-parented.
+ Also, the QWebFrame is a child (in QT terms) of QWebPage - so update that relationship as well.
+ Emit a signal that QWebFrame moved to a different QWebPage.
+
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-02-17 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Introduces new Icon loading interface in order to support
+ asynchronous loading.
+ https://bugs.webkit.org/show_bug.cgi?id=32054
+
+ Add an empty implementation of ChromeClient::iconForFiles().
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::iconForFiles):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2010-02-17 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Make possible Qt DRT to get total number of pages to be printed
+
+ LayoutTests:
+ printing/numberOfPages.html
+
+ [Qt] DRT: Get total number of pages to be printed
+ https://bugs.webkit.org/show_bug.cgi?id=34955
+
+ * Api/qwebframe.cpp:
+ (qt_drt_numberOfPages):
+ (qt_drt_evaluateScriptInIsolatedWorld):
+
+2010-02-16 Ariya Hidayat <ariya.hidayat@gmail.com>
Reviewed by Simon Hausmann.
- Do not set the combobox font on Maemo5 and S60; use the
- default instead.
+ [Qt] Allow scrolling to an anchor programmatically.
+ https://bugs.webkit.org/show_bug.cgi?id=29856
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::scrollToAnchor): New API function.
+ * Api/qwebframe.h:
+ * tests/qwebframe/tst_qwebframe.cpp: New tests for scrollToAnchor().
+
+2010-02-16 Ariya Hidayat <ariya.hidayat@gmail.com>
+
+ Reviewed by Laszlo Gombos.
+
+ Fix building with Qt < 4.6.
+ https://bugs.webkit.org/show_bug.cgi?id=34885
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::updateResizesToContentsForPage):
+
+2010-02-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Symbian build fix.
+
+ Updated the def file with two new exports used by QtLauncher.
+
+ * symbian/eabi/QtWebKitu.def:
+
+2010-02-16 Ismail Donmez <ismail@namtrac.org>
+
+ Reviewed by Pavel Feldman.
+
+ Fix compilation with inspector disabled.
+ https://bugs.webkit.org/show_bug.cgi?id=32724
+
+ * Api/qwebpage.cpp:
+ (qt_drt_webinspector_executeScript):
+ (qt_drt_webinspector_close):
+ (qt_drt_webinspector_show):
+ (qt_drt_setTimelineProfilingEnabled):
+
+2010-02-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausman.
+
+ [Qt] Fix include paths for forwarding headers in standalone builds.
+
+ * Api/DerivedSources.pro: Use relative paths for package builds and added some
+ documentation.
+
+2010-02-15 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtWebkit bridge: enable passing a QWebElement to a signal/slot/property
+ Add Q_DECLARE_METATYPE to QWebElement, add relevant tests to
+ tst_qwebframe
+ https://bugs.webkit.org/show_bug.cgi?id=34901
+
+ * Api/qwebelement.h: declare metatype
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (MyQObject::webElementProperty): new test for QWebElement
+ (MyQObject::setWebElementProperty): new test for QWebElement
+ (MyQObject::myOverloadedSlot): new test for QWebElement
+
+2010-02-15 Robert Hogan <robert@roberthogan.net>, Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] DRT: Support evaluateInWebInspector(), setTimelineProfilingEnabled().
+
+ Support LayoutTestController.evaluateInWebInspector(), setTimelineProfilingEnabled() in Qt DRT.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33096
+
+ This allows the following tests to pass:
+
+ inspector/console-format-collections.html
+ inspector/styles-iframe.html
+ inspector/syntax-highlight-css.html
+ inspector/syntax-highlight-javascript.html
+ inspector/timeline-enum-stability.html
+ inspector/timeline-layout.html
+ inspector/timeline-mark-timeline.html
+ inspector/timeline-paint.html
+ inspector/timeline-parse-html.html
+ inspector/timeline-recalculate-styles.html
+ inspector/timeline-script-tag-1.html
+ inspector/timeline-script-tag-2.html
+ inspector/timeline-trivial.html
+ inspector/cookie-resource-match.html
+ inspector/elements-img-tooltip.html
+ inspector/elements-panel-selection-on-refresh.html
+ inspector/inspected-objects-not-overriden.html
+ inspector/timeline-event-dispatch.html
+ inspector/timeline-network-resource.html
+ inspector/elements-panel-rewrite-href.html
+ inspector/console-dir.html
+ inspector/console-dirxml.html
+ inspector/console-format.html
+ inspector/console-tests.html
+ inspector/elements-panel-structure.html
+ inspector/evaluate-in-frontend.html
+ inspector/console-clear.html
+
+ * Api/qwebpage.cpp:
+ (qt_drt_webinspector_executeScript):
+ (qt_drt_webinspector_close):
+ (qt_drt_webinspector_show):
+ (qt_drt_setTimelineProfilingEnabled):
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (InspectorClientQt::createPage)
+
+2010-02-12 Antti Koivisto <koivisto@iki.fi>
+
+ Reviewed by Kenneth Rohde Christiansen and Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34885
+ Add a QGraphicsWebView mode that makes it automatically resize itself to the size of the content.
+
+ This is useful for cases where the client wants to implement page panning and zooming by manipulating
+ the graphics item.
+
+ Add a option to QGVLauncher to test this mode.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::updateResizesToContentsForPage):
+ (QGraphicsWebViewPrivate::_q_contentsSizeChanged):
+ (QGraphicsWebView::setPage):
+ (QGraphicsWebView::setResizesToContents):
+ (QGraphicsWebView::resizesToContents):
+ * Api/qgraphicswebview.h:
+ * QGVLauncher/main.cpp:
+ (WebView::WebView):
+ (MainView::MainView):
+ (MainView::setMainWidget):
+ (MainView::resizeEvent):
+ (main):
+
+2010-02-12 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Qt DRT now dump the frame loader callbacks when LayoutTestController()
+ method is called.
+
+ LayoutTests:
+ http/tests/security/mixedContent/data-url-script-in-iframe.html
+ http/tests/security/mixedContent/empty-url-plugin-in-frame.html
+ http/tests/security/mixedContent/insecure-css-in-iframe.html
+ http/tests/security/mixedContent/insecure-iframe-in-iframe.html
+ http/tests/security/mixedContent/insecure-image-in-iframe.html
+ http/tests/security/mixedContent/insecure-plugin-in-iframe.html
+ http/tests/security/mixedContent/insecure-script-in-iframe.html
+ http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe.html
+ http/tests/security/mixedContent/redirect-https-to-http-script-in-iframe.html
+
+ [Qt] Make possible Qt DRT dump frame load callbacks
+ https://bugs.webkit.org/show_bug.cgi?id=34702
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didDisplayInsecureContent):
+ (WebCore::FrameLoaderClientQt::didRunInsecureContent):
+
+2010-02-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Make qtlauncher and qgvlauncher use the generated headers
+ path to make sure they are correctly generated.
+
+ * tests/tests.pri:
+
+2010-02-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Ensure relative paths in generated .pri files to ensure that
+ a source package with pre-generated derived sources can be compiled.
+
+ - Re-add a separate headers.pri file for WEBKIT_API_HEADERS
+ - Rename the generated headers.pri to classheaders.pri to avoid
+ confusion with the one generated by synqt since they don't have the
+ same content.
+ - Remove private headers list variable from classheaders.pri
+ - Use $$PWD in classheaders.pri
+ - Remove classheaders.pri from the installed files
+
+ * Api/DerivedSources.pro:
+
+2010-02-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Minor fixes on QtWebKit headers generation.
+
+ - Adds QtWebKit to the generated headers destination path
+ - Improve compatibility with MinGW
+
+ * Api/DerivedSources.pro:
+
+2010-02-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by nobody, build fix.
+
+ [Qt] Fix standalone build with MinGW.
+
+ * tests/qwebelement/tst_qwebelement.cpp:
+ * tests/tests.pri:
+
+2010-02-10 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Implement pageNumberForElementById() method in Qt DRT LayoutTestController,
+ to make Qt DRT able to get page number.
+
+ LayoutTests:
+ printing/page-break-always.html
+ printing/pageNumerForElementById.html
+ printing/css2.1/page-break-before-000.html
+ printing/css2.1/page-break-after-000.html
+ printing/css2.1/page-break-after-004.html
+ printing/css2.1/page-break-before-001.html
+ printing/css2.1/page-break-after-001.html
+ printing/css2.1/page-break-after-002.html
+ printing/css2.1/page-break-before-002.html
+ printing/css2.1/page-break-inside-000.html
+
+ [Qt] Make possible Qt DRT get a page number for element by ID
+ https://bugs.webkit.org/show_bug.cgi?id=34777
+
+ * Api/qwebframe.cpp:
+ (qt_drt_pageNumberForElementById):
+
+2010-02-09 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Unit test for window.runModalDialog
+ https://bugs.webkit.org/show_bug.cgi?id=34755
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (TestModalPage::TestModalPage):
+ (TestModalPage::createWindow):
+ (tst_QWebPage::showModalDialog):
+
+2010-02-09 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Sync with API changes in Maemo 5 kinetic scrolling
+
+ https://bugs.webkit.org/show_bug.cgi?id=34747
+
+ This is a forward-port of http://qt.gitorious.org/+qt-developers/qt/x11-maemo/commit/08497561
+
+ * Api/qwebview.cpp:
+ (qt_sendSpontaneousEvent):
+ (QWebViewKineticScroller::QWebViewKineticScroller):
+ (QWebViewKineticScroller::setWidget):
+ (QWebViewKineticScroller::eventFilter):
+ (QWebViewKineticScroller::cancelLeftMouseButtonPress):
+ (QWebViewKineticScroller::currentFrame):
+ (QWebViewKineticScroller::scrollingFrameAt):
+ (QWebViewKineticScroller::maximumScrollPosition):
+ (QWebViewKineticScroller::scrollPosition):
+ (QWebViewKineticScroller::viewportSize):
+ (QWebViewKineticScroller::setScrollPosition):
+ (QWebViewKineticScroller::sendEvent):
+ (QWebView::QWebView):
+
+2010-02-09 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Webkit in Qt does not have window.showModalDialog
+ https://bugs.webkit.org/show_bug.cgi?id=25585
+
+ Create a new eventloop when runModal() is called.
+ Added comemnt in QWebPage::createWindow that the application is responsible
+ for setting the modality of the appropriate window.
+
+ * Api/qwebpage.cpp:
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::ChromeClientQt):
+ (WebCore::ChromeClientQt::~ChromeClientQt):
+ (WebCore::ChromeClientQt::canRunModal):
+ (WebCore::ChromeClientQt::runModal):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2010-01-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Dave Hyatt.
+
+ Implement flattening of framesets
+ https://bugs.webkit.org/show_bug.cgi?id=32717
+
+ Privately export the setFrameSetFlatteningEnabled setting for
+ use with the Qt DRT.
+
+ * Api/qwebpage.cpp:
+ (qt_drt_setFrameSetFlatteningEnabled):
+ (QWebPagePrivate::core):
+ * Api/qwebpage_p.h:
+
+2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ [Qt] Fix build on Windows
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ DerivedSources for our API headers failed on Windows,
+ due to Windows not accepting ; as a command separator,
+ not needing quotes for echo, and needing < and > escaped.
+
+ We now detect Windows and set these quote markers and
+ escape markers accordingly, as well as use && for separating
+ individual commands.
+
+ * Api/DerivedSources.pro:
+
+2010-02-05 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Remove unused inmport of ScriptFunctionCall.h
+
+ https://bugs.webkit.org/show_bug.cgi?id=33592
+
+ * Api/qwebelement.cpp:
+
+2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Generate convenience headers (QWebView, etc) using qmake
+
+ In Qt this is done using syncqt, but we use a pro-file instead
+ that generates makefile-rules for each of the extra headers.
+
+ These extra headers are installed alongside the normal headers.
+
+ * Api/DerivedSources.pro: Added. List of headers + pro file magic
+ * Api/headers.pri: Removed, list of headers is now in the above file
+
+2010-02-04 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Tuning and optimizations to GraphicsLayerQt. Mainly reduced usage
+ of QTimer::singleShot, and moved syncLayers() from paint() to update()
+ https://bugs.webkit.org/show_bug.cgi?id=34062
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::update): Moved the sync operation to update
+ (QGraphicsWebView::paint): Moved the sync operation to update
+
+2010-02-03 Andras Becsi <abecsi@webkit.org>
+
+ Unreviewed build fix.
+
+ [Qt] Roll-out r54281 because it broke the build on the Qt Release bot.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::markForSync):
+ (QGraphicsWebViewPrivate::update):
+ (QGraphicsWebView::paint):
+
+2010-02-02 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Do not use a proxy widget for the QComboBox on Maemo 5, as it
+ is not working properly and it is not needed at all, as the
+ comboboxes comes up in their full width on the screen and
+ do not depend on view.
* WebCoreSupport/QtFallbackWebPopup.cpp:
- (WebCore::QtFallbackWebPopup::populate):
+ (WebCore::QtFallbackWebPopup::show):
+
+2010-02-02 Jessie Berlin <jberlin@webkit.org>
+
+ Rubber Stamped by Holger Freyther.
+
+ [Qt] Fix style issue identified in bug:
+ https://bugs.webkit.org/show_bug.cgi?id=34329
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::InspectorClientWebPage):
+ Fix indentation.
+
+2010-02-01 Jessie Berlin <jberlin@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Enable inspecting the Web Inspector in QtLauncher
+
+ https://bugs.webkit.org/show_bug.cgi?id=34329
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::InspectorClientWebPage):
+ Allow the DeveloperExtrasEnabled setting to default to true for the page containing the Web Inspector.
+
+2010-02-02 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Display HTML tags verbatim in JS alert/confirm/prompt boxes
+
+ https://bugs.webkit.org/show_bug.cgi?id=34429
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+
+2010-02-02 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Enable a way to measure FPS in QGVLauncher
+ run QGVLauncher with --show-fps to see ongoing fps measurements
+ This is not meant as accurate FPS, but rather as a way to find
+ improvements/regressions
+ https://bugs.webkit.org/show_bug.cgi?id=34450
+
+ * QGVLauncher/main.cpp:
+ (MainView::MainView): initialize FPS values
+ (MainView::paintEvent): count a painted frame here
+ (MainView::printFps): we print the fps with qDebug every 5 seconds.
+
+2010-01-29 Ben Murdoch <benm@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage.
+ https://bugs.webkit.org/show_bug.cgi?id=34215
+
+ Add needTouchEvents() to the ChromeClient which is called when the page decides it needs or no longer needs to be informed of touch events.
+
+ * WebCoreSupport/ChromeClientQt.h:
+ (WebCore::ChromeClientQt::needTouchEvents): Add an empty implementation.
+
+2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann
+
+ Disable auto-uppercase and predictive text on Maemo5, just like the
+ build-in MicroB Browser.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
2010-01-28 Andreas Kling <andreas.kling@nokia.com>
@@ -32,15 +554,15 @@
(QWebViewKineticScroller::setPosition):
(QWebView::QWebView):
-2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-01-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
- Reviewed by Simon Hausmann
+ Reviewed by Simon Hausmann.
- Disable auto-uppercase and predictive text on Maemo5, just like the
- build-in MicroB Browser.
+ Do not set the combobox font on Maemo5 and S60; use the
+ default instead.
- * WebCoreSupport/EditorClientQt.cpp:
- (WebCore::EditorClientQt::setInputMethodState):
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopup::populate):
2010-01-28 Trond Kjernåsen <trond@trolltech.com>
@@ -51,6 +573,44 @@
* Api/qwebframe.cpp:
(QWebFrame::print):
+2010-01-27 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DRT Provide worker thread ability to track counters
+ https://bugs.webkit.org/show_bug.cgi?id=34221
+
+ Implement workerThreadCount() in LayoutTestController of Qt DRT
+
+ Tests:
+ fast/workers/dedicated-worker-lifecycle.html
+ fast/workers/shared-worker-frame-lifecycle.html
+ fast/workers/shared-worker-lifecycle.html
+ fast/workers/worker-lifecycle.html
+
+ * Api/qwebpage.cpp:
+ (qt_drt_workerThreadCount):
+
+2010-01-27 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Update the .def files with exported symbols
+
+ * symbian/eabi/QtWebKitu.def: Add two mangled missing new symbols for arm eabi.
+
+2010-01-27 Kent Hansen <kent.hansen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Meta-methods can't be introspected using ES5 API
+ https://bugs.webkit.org/show_bug.cgi?id=34087
+
+ Test that Object.getOwnPropertyDescriptor and
+ Object.getOwnPropertyNames work with meta-methods.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
2010-01-26 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
@@ -65,6 +625,24 @@
* WebCoreSupport/QtFallbackWebPopup.cpp:
(WebCore::QtFallbackWebPopup::show):
+2010-01-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ First steps of the QtScript API.
+
+ Two new classes were created; QScriptEngine and QScriptValue.
+ The first should encapsulate a javascript context and the second a script
+ value.
+
+ This API is still in development, so it isn't compiled by default.
+ To trigger compilation, pass --qmakearg="CONFIG+=build-qtscript" to
+ build-webkit.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32565
+
+ * docs/qtwebkit.qdocconf:
+
2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann.
@@ -93,6 +671,19 @@
(JSPromptPage::javaScriptPrompt):
(tst_QWebPage::testJSPrompt):
+2010-01-25 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] In RenderThemeQt determine the QStyle from the page client instead of the page's view
+ https://bugs.webkit.org/show_bug.cgi?id=34053
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::style): Implement QWebPageClient::style() and return the graphics
+ widget's style.
+ * Api/qwebpage.cpp:
+ (QWebPageWidgetClient::style): Implement QWebPageClient::style() and return the widget's style.
+
2010-01-25 Janne Koskinen <janne.p.koskinen@digia.com>
Reviewed by Simon Hausmann.
@@ -102,15 +693,240 @@
* symbian/backup_registration.xml: Added.
-2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+2010-01-23 Girish Ramakrishnan <girish@forwardbias.in>
Reviewed by Kenneth Rohde Christiansen.
- [Qt] Fix QWebInspector destruction problem.
- https://bugs.webkit.org/show_bug.cgi?id=31664
+ [Qt] Fix positioning of ComboBox popup in QGraphicsWebView.
+
+ Wrap the popup in a QGraphicsProxyWidget, so that the popup
+ transforms with the item.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33887
- * Api/qwebpage.cpp:
- (QWebPage::~QWebPage):
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopupCombo::hidePopup):
+ (WebCore::QtFallbackWebPopup::QtFallbackWebPopup):
+ (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup):
+ (WebCore::QtFallbackWebPopup::show):
+ * WebCoreSupport/QtFallbackWebPopup.h:
+
+2010-01-22 Peter Kasting <pkasting@google.com>
+
+ Not reviewed, backout.
+
+ Back out r52673, which caused several regressions.
+ https://bugs.webkit.org/show_bug.cgi?id=32533
+
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopupCombo::hidePopup):
+
+2010-01-22 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Save the QWebPageClient instead of the ownerWidget in QtAbstractWebPopup
+
+ The QWebPageClient is required for the QtFallbackWebPopup. QtFallbackWebPopup will
+ need it to create a QGraphicsProxyWidget (in a future commit) for the
+ QGraphicsWebView's web popup.
+
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopup::show):
+
+2010-01-22 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ QState::polished() was renamed to QState::propertiesAssigned() when
+ Qt 4.6.0 was released.
+
+ * QGVLauncher/main.cpp:
+ (MainWindow::init):
+
+2010-01-21 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] add setDomainRelaxationForbiddenForURLScheme in Qt DRT
+ https://bugs.webkit.org/show_bug.cgi?id=33945
+
+ * Api/qwebsecurityorigin.cpp:
+ (qt_drt_setDomainRelaxationForbiddenForURLScheme):
+
+2010-01-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Antti Koivisto.
+
+ [Qt] Implement GraphicsLayer for accelerated layer compositing
+ https://bugs.webkit.org/show_bug.cgi?id=33514
+
+ Here we have the QGraphicsWebView support for accelerated compositing
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewOverlay::q): access to container object
+ (QGraphicsWebViewOverlay::boundingRect): overlay has same rect as the
+ webview
+ (QGraphicsWebViewOverlay::paint): paint everything but the contents
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): some vars needed
+ for accelerated compositing
+ (QGraphicsWebViewPrivate::):
+ (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::setRootGraphicsLayer): make sure we have a
+ scrollbar overlay, and that the new graphics layer is parented by the
+ web-view
+ (QGraphicsWebViewPrivate::markForSync): flush changes at earliest
+ convenience or during the next draw
+
+ (QGraphicsWebViewPrivate::updateCompositingScrollPosition): sync the
+ position of the compositing layer with the scroll position
+ (QGraphicsWebViewPrivate::syncLayers): flush changes now
+ (QGraphicsWebViewPrivate::scroll): make sure we also move the
+ compositing layer
+ (QGraphicsWebViewPrivate::update): also update the overlay if needed
+ (QGraphicsWebView::QGraphicsWebView): initialize overlay with 0
+ (QGraphicsWebView::paint): paint only contents if we have an overlay,
+ sync the compositing layers now if needed
+ (QGraphicsWebView::setPage): also clean up the compositing
+ (QGraphicsWebView::updateGeometry): also update overlay geo
+ (QGraphicsWebView::setGeometry): also update overlay geo
+ * Api/qgraphicswebview.h: reimp compositing stuff from QWebPageClient
+ * Api/qwebsettings.cpp: init new settings flag for compositing as
+ false
+ (QWebSettingsPrivate::apply): apply new settings flag for compositing
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h: new settings flag for compositing
+ * Api/qwebview.cpp:
+ (QWebView::setPage): qwebview doesn't support compositing: always false
+ * QGVLauncher/main.cpp:
+ (WebView::WebView): some more cmdline arguments + compositing
+ (MainWindow::init): some more cmdline arguments
+ (main): ditto
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::attachRootGraphicsLayer): reimp for
+ accel-compositing
+ (WebCore::ChromeClientQt::setNeedsOneShotDrawingSynchronization):
+ reimp for accel compositing
+ (WebCore::ChromeClientQt::scheduleCompositingLayerSync): reimp for
+ accel compositing
+ * WebCoreSupport/ChromeClientQt.h: reimps for accel compositing
+
+2010-01-21 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Improve the autotests of QtWebkit
+ https://bugs.webkit.org/show_bug.cgi?id=32216
+
+ Remove qWait() of the test when possible.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::loadFinished):
+ (tst_QWebPage::database):
+ (tst_QWebPage::testEnablePersistentStorage):
+ (tst_QWebPage::errorPageExtension):
+ (tst_QWebPage::screenshot):
+
+2010-01-21 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Prospective build fix for the Qt build.
+
+ Fix compilation against Qt without WebKit support by not including QtWebKit/QWebView
+ but widget.h instead and instantiating QWebView through a typedef, to ensure we're using
+ our locally built WebKit.
+
+ * tests/hybridPixmap/widget.h:
+ * tests/hybridPixmap/widget.ui:
+
+2010-01-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Adding QPixmap/QImage support for the Qt hybrid layer
+ https://bugs.webkit.org/show_bug.cgi?id=32461
+
+ * tests/hybridPixmap: Added.
+ * tests/hybridPixmap/hybridPixmap.pro: Added.
+ * tests/hybridPixmap/resources.qrc: Added.
+ * tests/hybridPixmap/test.html: Added.
+ * tests/hybridPixmap/tst_hybridPixmap.cpp: Added.
+ (tst_hybridPixmap::tst_hybridPixmap): tests most of the use cases for
+ hybrid pixmap/image manipulation
+ (tst_hybridPixmap::init): QTestLib initialization
+ (tst_hybridPixmap::cleanup): QTestLib cleanup
+ (tst_hybridPixmap::hybridPixmap): run the html file
+ * tests/hybridPixmap/widget.cpp: Added.
+ (Widget::Widget):
+ (Widget::refreshJS):
+ (Widget::start):
+ (Widget::completeTest):
+ (Widget::setPixmap):
+ (Widget::pixmap):
+ (Widget::setImage):
+ (Widget::image):
+ (Widget::~Widget):
+ (Widget::changeEvent):
+ (Widget::compare):
+ (Widget::imageSlot):
+ (Widget::pixmapSlot):
+ (Widget::randomSlot):
+ * tests/hybridPixmap/widget.h: Added.
+ * tests/hybridPixmap/widget.ui: Added.
+ * tests/tests.pro:
+
+2010-01-21 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Custom select popups.
+ https://bugs.webkit.org/show_bug.cgi?id=33418
+
+ Adjusting QtFallbackWebPopupCombo to the changes in WebCore layer.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createSelectPopup):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopupCombo::QtFallbackWebPopupCombo):
+ (WebCore::QtFallbackWebPopupCombo::showPopup):
+ (WebCore::QtFallbackWebPopupCombo::hidePopup):
+ (WebCore::QtFallbackWebPopup::QtFallbackWebPopup):
+ (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup):
+ (WebCore::QtFallbackWebPopup::show):
+ (WebCore::QtFallbackWebPopup::hide):
+ (WebCore::QtFallbackWebPopup::populate):
+ * WebCoreSupport/QtFallbackWebPopup.h:
+
+2010-01-19 Steve Block <steveblock@google.com>
+
+ Reviewed by Adam Barth.
+
+ Renames WebCore/bridge/runtime.[cpp|h] to WebCore/bridge/Bridge.[cpp|h]
+ https://bugs.webkit.org/show_bug.cgi?id=33801
+
+ * Api/qwebframe.cpp:
+
+2010-01-14 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Drag and Drop source/destination code needs cleanup.
+ <https://bugs.webkit.org/show_bug.cgi?id=33691>.
+
+ Update to new way of calling sourceOperation.
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::startDrag):
+
+2010-01-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Symbian build fixes.
+
+ * tests/qwebpage/tst_qwebpage.cpp: Include util.h
+ * tests/tests.pri: Don't define TESTS_SOURCE_DIR, it doesn't work.
+ * tests/util.h: Define TESTS_SOURCE_DIR here, just like it's done in Qt.
2010-01-14 Simon Hausmann <simon.hausmann@nokia.com>
@@ -121,23 +937,89 @@
* symbian/bwins/QtWebKitu.def:
* symbian/eabi/QtWebKitu.def:
-2009-12-18 Joe Ligman <joseph.ligman@nokia.com>
+2010-01-13 Darin Adler <darin@apple.com>
- Reviewed by Kenneth Rohde Christiansen.
+ Reviewed by Dan Bernstein.
- [Qt] Add new API to QWebFrame to scrollRecursively starting with any css overflow
- then checking current frame and then ancestors
- https://bugs.webkit.org/show_bug.cgi?id=32668
+ Move more of the selection and caret painting code from Frame to SelectionController.
+ https://bugs.webkit.org/show_bug.cgi?id=33619
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::inputMethodEvent): Seems possibly wrong to be directly invoking this
+ setCaretVisible here, but I updated it to call it in its new location.
+
+2010-01-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Add private API for QWebFrame scrolling, to maintain binary compatibility with Qt 4.6.
+
+ This is just a temporary addition until we have introduced #ifdefs to allow
+ safely removing the private API again.
* Api/qwebframe.cpp:
- (QWebFramePrivate::scrollOverflow):
- (QWebFrame::scrollRecursively):
- * Api/qwebframe.h:
- * Api/qwebframe_p.h:
- * tests/qwebframe/qwebframe.qrc:
- * tests/qwebframe/testiframe.html: Added.
- * tests/qwebframe/testiframe2.html: Added.
- * tests/qwebframe/tst_qwebframe.cpp:
+ (qtwebkit_webframe_scrollRecursively):
+
+2010-01-10 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Add enableXSSAuditor support to QWebSettings and DRT.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33419
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ * Api/qwebsettings.h:
+
+2010-01-09 Daniel Bates <dbates@webkit.org>
+
+ No review, rolling out r53044.
+ http://trac.webkit.org/changeset/53044
+ https://bugs.webkit.org/show_bug.cgi?id=33419
+
+ We need to look into this some more because the Qt
+ bot is failing the XSSAuditor tests. See bug #33419
+ for more details.
+
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+
+2010-01-09 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33419
+
+ Adds support for the XSSAuditor to the Qt DRT.
+
+ * Api/qwebsettings.cpp: Updated comment to reflect added key XSSAuditorEnabled.
+ * Api/qwebsettings.h: Adds settings key XSSAuditorEnabled.
+
+2010-01-08 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Delegation client
+ https://bugs.webkit.org/show_bug.cgi?id=32826
+
+ Added method createPopup to ChromeClientQt used to create popups.
+ QtFallbackWebPopup moved from WebCore/platform/qt to
+ WebKit/qt/WebCoreSupport.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createPopup):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/QtFallbackWebPopup.cpp: Added.
+ (WebCore::QtFallbackWebPopup::QtFallbackWebPopup):
+ (WebCore::QtFallbackWebPopup::show):
+ (WebCore::QtFallbackWebPopup::populate):
+ (WebCore::QtFallbackWebPopup::showPopup):
+ (WebCore::QtFallbackWebPopup::hidePopup):
+ (WebCore::QtFallbackWebPopup::activeChanged):
+ (WebCore::QtFallbackWebPopup::setParent):
+ * WebCoreSupport/QtFallbackWebPopup.h: Added.
+ (WebCore::QtFallbackWebPopup::hide):
2010-01-07 Yael Aharon <yael.aharon@nokia.com>
@@ -166,6 +1048,93 @@
(qt_suspendActiveDOMObjects):
(qt_resumeActiveDOMObjects):
+2010-01-06 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Return an invalid Qt::ImMicroFocus if queried while the view needs to layout.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33204
+
+ * Api/qwebpage.cpp:
+ (QWebPage::inputMethodQuery):
+
+2010-01-05 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Drag & drop layout tests fail even when run manually
+ https://bugs.webkit.org/show_bug.cgi?id=33055
+
+ No new tests. Fix 3 layout tests when run manually.
+ fast/events/drag-and-drop.html
+ fast/events/drag-and-drop-dataTransfer-types-nocrash.html
+ fast/events/drag-and-drop-fire-drag-dragover.html
+ Running these tests in DRT will be fixed in 31332.
+
+ * Api/qwebpage.cpp:
+ (dropActionToDragOp):
+ (dragOpToDropAction):
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragMoveEvent):
+ (QWebPagePrivate::dropEvent):
+ Accept drag events even if they are not over a drop target.
+ This is to ensure that drag events will continue to be delivered.
+
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::dragOperationToDropActions):
+ (WebCore::dropActionToDragOperation):
+ (WebCore::DragClientQt::startDrag):
+ Send dragEnd event.
+
+2010-01-04 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33097
+
+ Cleans up the File menu to better conform to the File menu in Safari
+ both in terms of options and keyboard shortcuts. Adds a "Quit" menu
+ options to close all open windows.
+
+ * QGVLauncher/main.cpp:
+ (MainWindow::buildUI):
+
+2009-12-31 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Enable all HTML5 persistent features for QGVLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=33086
+
+ * QGVLauncher/main.cpp: Call enablePersistentStorage()
+ (main):
+
+2009-12-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] It should be possible to disable inspector
+ https://bugs.webkit.org/show_bug.cgi?id=32724
+
+ This change fixes the build break. Some QtWebKit interfaces
+ will not be fully functional (most notable QWebInspector) if
+ INSPECTOR is disabled.
+
+ * Api/qwebinspector.cpp:
+ (QWebInspector::showEvent):
+ (QWebInspector::closeEvent):
+ * Api/qwebpage.cpp:
+ (webActionForContextMenuAction):
+ (QWebPagePrivate::getOrCreateInspector):
+ (QWebPagePrivate::inspectorController):
+ (QWebPage::triggerAction):
+ (QWebPage::updatePositionDependentActions):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::showWindow):
+ (WebCore::InspectorClientQt::closeWindow):
+
2009-12-30 Janne Koskinen <janne.p.koskinen@digia.com>
Reviewed by Simon Hausmann.
@@ -177,6 +1146,267 @@
* symbian/bwins/QtWebKitu.def: Added.
* symbian/eabi/QtWebKitu.def: Added.
+2009-12-29 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32925
+
+ Adds an Open File dialog to make it convenient to open a file
+ to view in the browser.
+
+ * QGVLauncher/main.cpp:
+ (MainWindow::load): Modified to call loadURL.
+ (MainWindow::openFile): Added.
+ (MainWindow::loadURL): Added.
+ (MainWindow::buildUI): Added menu item Open File.
+
+2009-12-29 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Fix crash on LayoutTests/fast/loader/empty-embed-src-attribute.html
+
+ Related to https://bugs.webkit.org/show_bug.cgi?id=23806
+
+ If an embedded document is loaded within a page and it has an empty
+ URL, use a blank URL for the load request.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33017
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2009-12-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Rubber-stamped by Simon Hausmann and Holger Freyther.
+
+ [Qt] Remove WebKit/qt/WebKitPart empty directory
+
+ The content of the directory has been removed by r34888.
+
+ * WebKitPart: Removed.
+
+2009-12-29 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] DRT: Frame loader callbacks differ from the Mac port
+ https://bugs.webkit.org/show_bug.cgi?id=32989
+
+ Remove messages from the callbacks that should not dump them to match
+ the expected results for the http/loading tests.
+
+ Unskip some http/loading tests which succeed now.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchWillClose):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveIcon):
+ (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld):
+
+2009-12-29 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] fix fast/dom/Window/window-onFocus.html
+
+ Add support for layouttestcontroller.windowIsKey to Qt DRT and fix issue where
+ window.onblur was getting dispatched twice from QtWebKit.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32990
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusOutEvent):
+
+2009-12-24 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Gustavo Noronha.
+
+ Doc : QGraphicsWebView::zoomFactor was introduced in 4.6.
+
+ * Api/qgraphicswebview.cpp:
+
+2009-12-22 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Holger Freyther.
+
+ Moved QtLauncher to WebKitTools/
+
+ * QtLauncher: Removed.
+ * QtLauncher/QtLauncher.pro: Removed.
+ * QtLauncher/main.cpp: Removed.
+
+2009-12-21 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Minor fixes to language.
+
+ * Api/qwebpage.cpp:
+
+2009-12-21 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Clean up the WebKit layer unit-tests
+
+ - Use tests.pri for common options
+ - Standardize file naming
+ - Move all resources to 'resources' subdir
+ - Standardize how TESTS_SOURCE_DIR is used
+ - Get rid of UID3 for symbian (autogenerated)
+ - Don't build app bundles on Mac OS X
+
+ * tests/benchmarks/loading/loading.pro: Added.
+ * tests/benchmarks/loading/tst_loading.pro: Removed.
+ * tests/benchmarks/painting/painting.pro: Added.
+ * tests/benchmarks/painting/tst_painting.pro: Removed.
+ * tests/qgraphicswebview/qgraphicswebview.pro:
+ * tests/qwebelement/qwebelement.pro:
+ * tests/qwebelement/qwebelement.qrc: Removed.
+ * tests/qwebelement/resources/image.png: Renamed from WebKit/qt/tests/qwebelement/image.png.
+ * tests/qwebelement/resources/style.css: Renamed from WebKit/qt/tests/qwebelement/style.css.
+ * tests/qwebelement/resources/style2.css: Renamed from WebKit/qt/tests/qwebelement/style2.css.
+ * tests/qwebelement/tst_qwebelement.qrc: Added.
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebframe/qwebframe.qrc: Removed.
+ * tests/qwebframe/resources/image.png: Renamed from WebKit/qt/tests/qwebframe/image.png.
+ * tests/qwebframe/resources/style.css: Renamed from WebKit/qt/tests/qwebframe/style.css.
+ * tests/qwebframe/resources/test1.html: Renamed from WebKit/qt/tests/qwebframe/test1.html.
+ * tests/qwebframe/resources/test2.html: Renamed from WebKit/qt/tests/qwebframe/test2.html.
+ * tests/qwebframe/resources/testiframe.html: Renamed from WebKit/qt/tests/qwebframe/testiframe.html.
+ * tests/qwebframe/resources/testiframe2.html: Renamed from WebKit/qt/tests/qwebframe/testiframe2.html.
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/qwebframe/tst_qwebframe.qrc: Added.
+ * tests/qwebhistory/qwebhistory.pro:
+ * tests/qwebhistory/resources/page1.html: Renamed from WebKit/qt/tests/qwebhistory/data/page1.html.
+ * tests/qwebhistory/resources/page2.html: Renamed from WebKit/qt/tests/qwebhistory/data/page2.html.
+ * tests/qwebhistory/resources/page3.html: Renamed from WebKit/qt/tests/qwebhistory/data/page3.html.
+ * tests/qwebhistory/resources/page4.html: Renamed from WebKit/qt/tests/qwebhistory/data/page4.html.
+ * tests/qwebhistory/resources/page5.html: Renamed from WebKit/qt/tests/qwebhistory/data/page5.html.
+ * tests/qwebhistory/resources/page6.html: Renamed from WebKit/qt/tests/qwebhistory/data/page6.html.
+ * tests/qwebhistory/tst_qwebhistory.cpp:
+ (tst_QWebHistory::):
+ * tests/qwebhistory/tst_qwebhistory.qrc:
+ * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
+ * tests/qwebinspector/qwebinspector.pro:
+ * tests/qwebpage/qwebpage.pro:
+ * tests/qwebpage/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebpage/frametest/frame_a.html.
+ * tests/qwebpage/resources/iframe.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe.html.
+ * tests/qwebpage/resources/iframe2.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe2.html.
+ * tests/qwebpage/resources/iframe3.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe3.html.
+ * tests/qwebpage/resources/index.html: Renamed from WebKit/qt/tests/qwebpage/frametest/index.html.
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::backActionUpdate):
+ (tst_QWebPage::frameAt):
+ (tst_QWebPage::errorPageExtensionInFrameset):
+ (tst_QWebPage::screenshot):
+ * tests/qwebpage/tst_qwebpage.qrc:
+ * tests/qwebplugindatabase/qwebplugindatabase.pro:
+ * tests/qwebview/qwebview.pro:
+ * tests/qwebview/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebview/data/frame_a.html.
+ * tests/qwebview/resources/index.html: Renamed from WebKit/qt/tests/qwebview/data/index.html.
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::reusePage):
+ (tst_QWebView::crashTests):
+ * tests/qwebview/tst_qwebview.qrc:
+ * tests/resources/image2.png: Renamed from WebKit/qt/tests/qwebframe/resources/image2.png.
+ * tests/tests.pri: Added.
+ * tests/tests.pro:
+
+2009-12-18 Ariya Hidayat <ariya.hidayat@gmail.com>
+
+ Build fix, not reviewed.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::setTouchMocking): Leave setTouchMocking as an empty
+ function for Qt < 4.6 so that moc still creates a slot for that.
+ Otherwise, it would have generated a linker error.
+
+2009-12-18 Adam Roben <aroben@apple.com>
+
+ Qt build fix
+
+ * Api/qwebpage.cpp: Added #include.
+
+2009-12-18 Adam Roben <aroben@apple.com>
+
+ Qt build fix
+
+ * Api/qwebpage.cpp:
+ Added #includes.
+
+2009-12-18 Joe Ligman <joseph.ligman@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add new API to QWebFrame to scrollRecursively starting with any css overflow
+ then checking current frame and then ancestors
+ https://bugs.webkit.org/show_bug.cgi?id=32668
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::scrollOverflow):
+ (QWebFrame::scrollRecursively):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * tests/qwebframe/qwebframe.qrc:
+ * tests/qwebframe/testiframe.html: Added.
+ * tests/qwebframe/testiframe2.html: Added.
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-12-18 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Fix infinite recursion in touch mocking.
+
+ Don't send the fake touch events to the view, as that'll trigger the
+ event filter again.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::sendTouchEvent):
+
+2009-12-17 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add support for mocking touch events with Q(GV)Launcher
+ https://bugs.webkit.org/show_bug.cgi?id=32434
+
+ The event delivery should go through QCoreApplication::sendEvent()
+
+ * QtLauncher/main.cpp:
+ (MainWindow::sendTouchEvent):
+
+2009-12-17 Kim Grönholm <kim.gronholm@nomovok.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add support for touch events in QWebView and QGraphicsWebView
+ https://bugs.webkit.org/show_bug.cgi?id=32432
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::QGraphicsWebView):
+ (QGraphicsWebView::sceneEvent):
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+ (QWebView::event):
+
+2009-12-17 Kim Grönholm <kim.gronholm@nomovok.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add support for mocking touch events with QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=32434
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::sendTouchEvent):
+ (MainWindow::eventFilter):
+ (MainWindow::setTouchMocking):
+ (MainWindow::setupUI):
+
2009-12-14 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Kenneth Rohde Christiansen.
@@ -202,18 +1432,10 @@
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::runJavaScriptPrompt): Fixup null QString
-2009-12-21 David Boddie <dboddie@trolltech.com>
+2009-11-24 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann.
- Doc: Minor fixes to language.
-
- * Api/qwebpage.cpp:
-
-2009-12-15 Holger Hans Peter Freyther <zecke@selfish.org>
-
- Reviewed by NOBODY (OOPS!).
-
[Qt] Do not disable the inspector on show and hide
https://bugs.webkit.org/show_bug.cgi?id=31851
@@ -226,8 +1448,58 @@
user of the inspector client.
* Api/qwebinspector.cpp:
- (QWebInspector::event):
(QWebInspector::hideEvent):
+ (QWebInspector::closeEvent):
+ * Api/qwebinspector.h:
+
+2009-12-14 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Improve the autotests of QtWebkit
+ https://bugs.webkit.org/show_bug.cgi?id=32216
+
+ Refactor tst_qwebelement to remove the qWait()
+
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::style):
+
+2009-12-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix the QWebPage inputMethods() autotest after r51758
+ to compare the Qt::ImFont property's family against an explicitly
+ previously configured family.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32491
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2009-12-13 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=32499
+ Add client based Geolocation provider
+
+ Add first cut of a client based Geolocation provider. This is guarded by
+ ENABLE(CLIENT_BASED_GEOLOCATION) and is off by default for now. This adds a
+ GeolocationControllerClient interface that no-one currently implements,
+ but will in a subsequent patch.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2009-12-13 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add a test in Qt for https://bugs.webkit.org/show_bug.cgi?id=29005
+ https://bugs.webkit.org/show_bug.cgi?id=29008
+
+ * tests/qwebframe/tst_qwebframe.cpp:
2009-12-13 Simon Hausmann <hausmann@webkit.org>
@@ -242,6 +1514,263 @@
* Api/qwebview.h:
+2009-12-11 Yael Aharon <yael.aharon@nokia.com>
+
+ Unreviewed build fix for Qt versions < 4.6.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::reusePage):
+
+2009-12-11 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Updated QWebElement documentation
+
+ findAll() returns a QWebElementCollection, not QList<QWebElement>.
+
+ * docs/webkitsnippets/webelement/main.cpp:
+ (findAll):
+
+2009-12-11 Simon Hausmann <hausmann@webkit.org>, Kim Grönholm <kim.gronholm@nomovok.com>
+
+ Reviewed by Antti Koivisto.
+
+ Forward Qt touch events to the event handler as platform touch events.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32114
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::touchEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+
+2009-12-07 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Improve the autotests of QtWebkit
+ https://bugs.webkit.org/show_bug.cgi?id=32216
+
+ Remove the calls to qWait() of the autotest of QWebView
+
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::reusePage):
+
+2009-12-07 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Improve the autotests of QtWebkit
+ https://bugs.webkit.org/show_bug.cgi?id=32216
+
+ Refactor tst_qwebframe to remove qWait() and use
+ the function waitForSignal() from util.h
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-12-07 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Improve the autotests of QtWebkit
+ https://bugs.webkit.org/show_bug.cgi?id=32216
+
+ Refactor the test of QGraphicsWebView:
+ -make waitForSignal() available to all the tests.
+ -remove QTest::qWait()
+
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::crashOnViewlessWebPages):
+ * tests/util.h:
+ (waitForSignal):
+
+2009-12-07 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Plugins: Force windowless mode when there is no native window handle
+
+ Inject wmode=opaque while instantiating the plugin for the case when the
+ webpage is not backed by a native window handle.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32059
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2009-12-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Corrects QtLauncher style
+
+ * QtLauncher/main.cpp:
+ (WebPage::acceptNavigationRequest):
+ (MainWindow::MainWindow):
+ (MainWindow::webPage):
+ (MainWindow::webView):
+ (MainWindow::changeLocation):
+ (MainWindow::loadFinished):
+ (MainWindow::showLinkHover):
+ (MainWindow::zoomIn):
+ (MainWindow::zoomOut):
+ (MainWindow::print):
+ (MainWindow::setEditable):
+ (MainWindow::dumpHtml):
+ (MainWindow::selectElements):
+ (MainWindow::newWindow):
+ (MainWindow::setupUI):
+ (WebPage::createWindow):
+ (WebPage::createPlugin):
+ (main):
+
+2009-12-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QtLauncher: add a menu to show or hide the web inspector.
+ https://bugs.webkit.org/show_bug.cgi?id=32149
+
+ * QtLauncher/main.cpp:
+ (WebInspector::WebInspector):
+ (WebInspector::showEvent):
+ (WebInspector::hideEvent):
+ (MainWindow::MainWindow):
+ (MainWindow::setupUI):
+
+2009-12-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Antti Koivisto.
+
+ Split out the renderPrivate in two methods, one for working on
+ relative coordinates (relative to the viewport) and one for
+ working on absolute coordinates. The latter is more effecient
+ for implementing tiling, as you don't need translate the coords,
+ and because it avoid clipping to the viewport.
+
+ No behaviour changes, so no new tests.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::renderContentsLayerAbsoluteCoords):
+ (QWebFramePrivate::renderRelativeCoords):
+ (QWebFrame::render):
+ * Api/qwebframe_p.h:
+
+2009-12-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Allow removing 'qrc' as a local security origin scheme
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+
+2009-12-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Clean up argument parsing in the QtLauncher
+
+ * QtLauncher/main.cpp:
+
+2009-12-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Prevent the inspector from closing its wrapping widget.
+ This is not necessary anymore since we now hide the embedded
+ close button.
+ https://bugs.webkit.org/show_bug.cgi?id=32149
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::showWindow):
+ (WebCore::InspectorClientQt::closeWindow):
+
+2009-12-03 İsmail Dönmez <ismail@namtrac.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix compilation when SVG is disabled.
+
+ * Api/qwebframe.cpp:
+ (qt_drt_pauseSVGAnimation):
+
+2009-12-03 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <rdar://problem/7214236> and http://webkit.org/b/32052 - Implement HTML5 state object history API
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidPushStateWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchDidReplaceStateWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-12-03 Pavel Feldman <pfeldman@dhcp-172-28-174-220.spb.corp.google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Simplify the settings support in inspector controller.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32076
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::populateSetting):
+ (WebCore::InspectorClientQt::storeSetting):
+ (WebCore::variantToSetting):
+ (WebCore::settingToVariant):
+ * WebCoreSupport/InspectorClientQt.h:
+
+2009-12-03 Ben Murdoch <benm@google.com>
+
+ Reviewed by Brady Eidson.
+
+ [Android] The FrameLoaderClient is unaware of BackForwardList changes.
+ https://bugs.webkit.org/show_bug.cgi?id=31914
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidAddBackForwardItem): Add an empty implementation. Method added to FrameLoaderClient by Android (see bug).
+ (WebCore::FrameLoaderClientQt::dispatchDidRemoveBackForwardItem): ditto.
+ (WebCore::FrameLoaderClientQt::dispatchDidChangeBackForwardIndex): ditto.
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Not reviewed. Try to fix Qt build.
+
+ * Api/qwebframe.cpp:
+ (qt_drt_pauseSVGAnimation):
+
+2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Simon Fraser.
+
+ Add SVG animation test framework with 'snapshot' functionality
+ https://bugs.webkit.org/show_bug.cgi?id=31897
+
+ Add API used by the new 'sampleSVGAnimationForElementAtTime' DRT method,
+ forwarding the call to SVGDocumentExtensions, if SVG is enabled.
+
+ Implemented just like the existing pauseAnimation* methods for CSS animations.
+
+ * Api/qwebframe.cpp:
+ (qt_drt_pauseSVGAnimation):
+
+2009-12-01 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31898
+
+ Makes QtLauncher default to the http scheme for URLs.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::changeLocation):
+ (main):
+
2009-11-30 Abhinav Mithal <abhinav.mithal@nokia.com>
Reviewed by Simon Hausmann.
@@ -252,6 +1781,17 @@
* Api/qwebpage.cpp:
(QWebPage::userAgentForUrl):
+2009-11-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix minor waning in QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=31963
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (ErrorPage::extension): Remove info wariable as it is
+ not used.
+
2009-11-28 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
@@ -268,6 +1808,32 @@
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::inputMethods):
+2009-11-26 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Holger Freyther.
+
+ Removed unused ICO image plugin handler.
+
+ * Plugins/ICOHandler.cpp: Removed.
+ * Plugins/ICOHandler.h: Removed.
+ * Plugins/Plugins.pro: Removed.
+
+2009-11-12 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Do not show the QWidget when the WebCore::Widget is hidden
+ https://bugs.webkit.org/show_bug.cgi?id=31203
+
+ The clipping code was making a QWidget visible even if the
+ WebCore::Widget was hidden. Fix the bug by calling setVisible
+ only if the WebCore::Widget Widget::isSelfVisible.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::QtPluginWidget::show): Override WebCore::Widget::show to call handleVisibility
+ (WebCore::QtPluginWidget::handleVisibility): New method to call setVisible when we are visible
+ (FrameLoaderClientQt::createPlugin): Hide the QWidget by default
+
2009-11-23 David Boddie <dboddie@trolltech.com>
Reviewed by Simon Hausmann.
@@ -296,6 +1862,27 @@
* tests/qwebframe/tst_qwebframe.cpp:
+2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add instantiation tests for QWebInspector.
+
+ * tests/qwebinspector/qwebinspector.pro: Added.
+ * tests/qwebinspector/tst_qwebinspector.cpp: Added.
+ (tst_QWebInspector::attachAndDestroy):
+ * tests/tests.pro:
+
+2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix QWebInspector destruction problem.
+ https://bugs.webkit.org/show_bug.cgi?id=31664
+
+ * Api/qwebpage.cpp:
+ (QWebPage::~QWebPage):
+
2009-11-19 Olivier Goffart <ogoffart@trolltech.com>
Reviewed by Simon Hausmann.
@@ -315,6 +1902,60 @@
(tst_QWebPage::modified):
(tst_QWebPage::database):
+2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove support for Qt v4.3 or older versions
+ https://bugs.webkit.org/show_bug.cgi?id=29469
+
+ * Api/qcookiejar.cpp: Removed.
+ * Api/qcookiejar.h: Removed.
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::event):
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+ * Api/qwebframe.h:
+ * Api/qwebkitglobal.h:
+ * Api/qwebnetworkinterface.cpp: Removed.
+ * Api/qwebnetworkinterface.h: Removed.
+ * Api/qwebnetworkinterface_p.h: Removed.
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::acceptNavigationRequest):
+ (QWebPage::acceptNavigationRequest):
+ (QWebPage::action):
+ (QWebPage::userAgentForUrl):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::load):
+ (QWebView::event):
+ * Api/qwebview.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::print):
+ (MainWindow::setupUI):
+ (main):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::download):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientQt::startDownload):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2009-11-18 Shu Chang <Chang.Shu@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Add support for displaying deleteButton.
+ https://bugs.webkit.org/show_bug.cgi?id=31560
+
+ Test: LayoutTests/editing/deleting/5408255.html
+
+ * Api/qwebsettings.cpp:
+ (graphics):
+ * Api/qwebsettings.h:
+
2009-11-18 Paul Olav Tvete <paul.tvete@nokia.com>
Reviewed by Simon Hausmann.
@@ -333,16 +1974,49 @@
* docs/qtwebkit.qdoc:
-2009-11-18 Simon Hausmann <simon.hausmann@nokia.com>
+2009-11-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
- Reviewed and suggested by Tor Arne Vestbø.
+ Reviewed by Simon Hausmann.
- Fix the autotest after commit ecbb2c0dd21bfc197e1f7b53150ec9b1a1d8cb8f
- to compare the Qt::ImFont property's family against an explicitly
- previously configured family.
+ [Qt] Add QtLauncher support for opening links in the default browser
+
+ This can be triggered by either the context menu or by clicking a link
+ while holding down the Alt key. Opening a link in a new windows is
+ triggered by holding down Shift.
+
+ * QtLauncher/main.cpp:
+
+2009-11-17 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QGLLauncher does not support drag&drop of local files
+ https://bugs.webkit.org/show_bug.cgi?id=31057
+
+ Enable accepting files in QGraphicsWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::QGraphicsWebView):
+ (QGraphicsWebView::dragEnterEvent):
+
+2009-11-17 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] better test coverage for ErrorPageExtension
+ https://bugs.webkit.org/show_bug.cgi?id=31583
+
+ Improved the coverage of current ErrorPageExtension tests by
+ adding autotests involving frameset and iframes.
* tests/qwebpage/tst_qwebpage.cpp:
- (tst_QWebPage::inputMethods):
+ (ErrorPage::extension): Make the ErrorPageExtension
+ to work for all frames, not only the main frame.
+ (tst_QWebPage::errorPageExtension): Stop using
+ the 'frameset.html' resouce in this method since
+ an autotest specific for frameset's is being added.
+ (tst_QWebPage::errorPageExtensionInIFrames): Added.
+ (tst_QWebPage::errorPageExtensionInFrameset): Added.
2009-11-16 Simon Hausmann <simon.hausmann@nokia.com>
@@ -367,35 +2041,20 @@
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::errorPageExtension):
-2009-11-16 Holger Hans Peter Freyther <zecke@selfish.org>
+2009-11-13 Adam Roben <aroben@apple.com>
- Reviewed by NOBODY (OOPS!).
+ Update for changes to FrameLoaderClient
- [Qt] Do not show the QWidget when the WebCore::Widget is hidden
- https://bugs.webkit.org/show_bug.cgi?id=31203
+ Fixes <http://webkit.org/b/31124> Tell the WebFrameLoadDelegate when
+ window objects in isolated worlds are cleared
- 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.
+ Reviewed by Dave Hyatt.
* 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):
+ (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ Replaced windowObjectCleared with this function. Does nothing if the
+ passed-in world is not the mainThreadNormalWorld().
2009-11-13 Andras Becsi <becsi.andras@stud.u-szeged.hu>
@@ -408,6 +2067,18 @@
(QWebSettingsPrivate::apply):
(QWebSettings::setMaximumPagesInCache):
+2009-11-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix initial QWebView focus behavior.
+
+ focusController->setFocused(true) was not always called.
+ https://bugs.webkit.org/show_bug.cgi?id=31466
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusInEvent):
+
2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed by Simon Hausmann.
@@ -428,6 +2099,18 @@
* docs/docs.pri:
+2009-11-12 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ externalRepresentation should take Frame as the argument
+ https://bugs.webkit.org/show_bug.cgi?id=31393
+
+ No new tests as this is just a refactoring.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::renderTreeDump):
+
2009-11-12 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Jan Alonzo.
@@ -440,6 +2123,21 @@
* Api/qwebpage.cpp:
+2009-11-12 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Custom printing shrink factors
+ https://bugs.webkit.org/show_bug.cgi?id=29042
+
+ This reverts commit r49769. The public API for this needs to be reviewed
+ before its inclusion in Qt.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+
2009-11-11 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Kenneth Christiansen.
@@ -467,73 +2165,17 @@
* 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.
+2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
- * Api/qwebsettings.cpp:
- (QWebSettingsPrivate::apply):
- (QWebSettings::QWebSettings):
- * Api/qwebsettings.h:
+ Unreviewed buildbot fix.
-2009-11-11 Liang QI <liang.qi@nokia.com>
- Update documentation for the Qt API
+ Export a method to the DRT to know if the document has a
+ document element.
- * 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_drt_hasDocumentElement):
+2009-11-11 Liang QI <liang.qi@nokia.com>
[Qt] Fix tst_qwebpage and tst_qwebframe compilation on Symbian.
@@ -582,6 +2224,38 @@
* Api/qwebview.cpp:
+2009-11-11 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31323
+ Fix a few compiler warnings
+
+ * tests/qwebframe/tst_qwebframe.cpp: Add extra brackets
+ to make it explicit where the else case belongs
+
+2009-11-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix enabling of software input panel when activating editable elements
+ in QGraphicsWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::inputMethodEnabled): Implement method to
+ query for input method support.
+ * Api/qwebpage.cpp:
+ (QWebPageWidgetClient::inputMethodEnabled): Ditto for QWidget.
+ (QWebPagePrivate::handleSoftwareInputPanel): Don't use view() to
+ test for input method support. Instead query using QWebPageClient
+ and send the SIPR event to the ownerWidget() instead of the view().
+ The latter is null for QGraphicsWebView.
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (EventSpy::EventSpy):
+ (EventSpy::eventFilter):
+ (tst_QWebPage::inputMethods): Modify the test to verify that SIPR
+ events are dispatched when activating focusable content.
+
2009-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
Unreviewed documentation fixes.
@@ -604,27 +2278,58 @@
* Api/qwebview.cpp:
-2009-11-11 Simon Hausmann <simon.hausmann@nokia.com>
+2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
- Reviewed by Tor Arne Vestbø.
+ Reviewed by Kenneth Rohde Christiansen.
- Fix enabling of software input panel when activating editable elements
- in QGraphicsWebView.
+ [Qt] Few classes have virtual functions but non-virtual destructor
+ https://bugs.webkit.org/show_bug.cgi?id=31269
* Api/qgraphicswebview.cpp:
- (QGraphicsWebViewPrivate::inputMethodEnabled): Implement method to
- query for input method support.
+ (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): Add virtual
+ destructor.
+
+2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30628
+ Add an API to get all the attributes from a QWebElement.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::attributesName):
+ * Api/qwebelement.h:
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::listAttributes):
+
+2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Use explicit parentheses to silence gcc 4.4 -Wparentheses warnings
+ https://bugs.webkit.org/show_bug.cgi?id=31040
+
* Api/qwebpage.cpp:
- (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.
+ (QWebPagePrivate::handleScrolling):
+
+2009-11-09 Mark Mentovai <mark@chromium.org>
+
+ Reviewed by Dan Bernstein.
+
+ Track "can have scrollbar" state within FrameView independently of the
+ individual scrollbar states in ScrollView.
+
+ rdar://problem/7215132, https://bugs.webkit.org/show_bug.cgi?id=29167
+ REGRESSION (r48064): mint.com loses scrollbars after coming out of
+ edit mode.
+
+ rdar://problem/7314421, https://bugs.webkit.org/show_bug.cgi?id=30517
+ REGRESSION (r48064): Extra scroll bars in GarageBand Lesson Store.
+
+ Test: fast/overflow/scrollbar-restored.html
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setScrollBarPolicy):
2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com>
@@ -799,6 +2504,18 @@
* Api/qgraphicswebview.h:
+2009-11-05 Shu Chang <Chang.Shu@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Add support for Shift-PageUp and Shift-PageDown key events.
+ https://bugs.webkit.org/show_bug.cgi?id=31166
+
+ Test: LayoutTests/editing/selection/shrink-selection-after-shift-pagedown.html
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::handleKeyboardEvent):
+
2009-11-05 Simon Hausmann <hausmann@webkit.org>
Last Qt 4.5 build fix (*sigh*)
@@ -978,6 +2695,32 @@
(WebViewCrashTest::loading):
(tst_QWebView::crashTests):
+2009-11-01 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Turn on warnings for QtWebKit for gcc
+ https://bugs.webkit.org/show_bug.cgi?id=30958
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate): Reorder initialization list
+ to fix compiler warnings.
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): Ditto.
+
+2009-10-30 Evan Stade <estade@chromium.org>
+
+ Reviewed by David Levin.
+
+ Notify the chrome when the focused node has changed.
+ https://bugs.webkit.org/show_bug.cgi?id=30832
+
+ Added stub implementation for new ChromeClient function.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::focusedNodeChanged):
+ * WebCoreSupport/ChromeClientQt.h:
+
2009-10-30 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Tor Arne Vestbø.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 0c5df4a..ecbabe4 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -25,6 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "config.h"
#include "ChromeClientQt.h"
@@ -38,8 +39,14 @@
#include "NotImplemented.h"
#include "WindowFeatures.h"
#include "DatabaseTracker.h"
-#include "SecurityOrigin.h"
+#include "QtFallbackWebPopup.h"
#include "QWebPageClient.h"
+#include "SecurityOrigin.h"
+
+#include <qdebug.h>
+#include <qeventloop.h>
+#include <qtextdocument.h>
+#include <qtooltip.h>
#include "qwebpage.h"
#include "qwebpage_p.h"
@@ -48,22 +55,23 @@
#include "qwebsecurityorigin_p.h"
#include "qwebview.h"
-#include <qtooltip.h>
-#include <qtextdocument.h>
-
-namespace WebCore
-{
+#if USE(ACCELERATED_COMPOSITING)
+#include "GraphicsLayerQt.h"
+#endif
+namespace WebCore {
ChromeClientQt::ChromeClientQt(QWebPage* webPage)
: m_webPage(webPage)
+ , m_eventLoop(0)
{
toolBarsVisible = statusBarVisible = menuBarVisible = true;
}
ChromeClientQt::~ChromeClientQt()
{
-
+ if (m_eventLoop)
+ m_eventLoop->exit();
}
void ChromeClientQt::setWindowRect(const FloatRect& rect)
@@ -141,6 +149,11 @@ void ChromeClientQt::takeFocus(FocusDirection)
}
+void ChromeClientQt::focusedNodeChanged(WebCore::Node*)
+{
+}
+
+
Page* ChromeClientQt::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
{
QWebPage *newPage = m_webPage->createWindow(features.dialog ? QWebPage::WebModalDialog : QWebPage::WebBrowserWindow);
@@ -163,14 +176,16 @@ void ChromeClientQt::show()
bool ChromeClientQt::canRunModal()
{
- notImplemented();
- return false;
+ return true;
}
void ChromeClientQt::runModal()
{
- notImplemented();
+ m_eventLoop = new QEventLoop();
+ QEventLoop* eventLoop = m_eventLoop;
+ m_eventLoop->exec();
+ delete eventLoop;
}
@@ -448,6 +463,12 @@ void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileC
}
}
+void ChromeClientQt::iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>)
+{
+ // FIXME: Move the code of Icon::createIconForFiles() here.
+ notImplemented();
+}
+
bool ChromeClientQt::setCursor(PlatformCursorHandle)
{
notImplemented();
@@ -460,4 +481,31 @@ void ChromeClientQt::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
notImplemented();
}
+#if USE(ACCELERATED_COMPOSITING)
+void ChromeClientQt::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
+{
+ if (platformPageClient())
+ platformPageClient()->setRootGraphicsLayer(graphicsLayer ? graphicsLayer->nativeLayer() : 0);
+}
+
+void ChromeClientQt::setNeedsOneShotDrawingSynchronization()
+{
+ // we want the layers to synchronize next time we update the screen anyway
+ if (platformPageClient())
+ platformPageClient()->markForSync(false);
+}
+
+void ChromeClientQt::scheduleCompositingLayerSync()
+{
+ // we want the layers to synchronize ASAP
+ if (platformPageClient())
+ platformPageClient()->markForSync(true);
+}
+#endif
+
+QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
+{
+ return new QtFallbackWebPopup;
+}
+
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 196c4fc..3d5cbe9 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -34,6 +34,7 @@
#include "KURL.h"
#include "PlatformString.h"
+class QEventLoop;
class QWebPage;
namespace WebCore {
@@ -42,6 +43,7 @@ namespace WebCore {
class FloatRect;
class Page;
struct FrameLoadRequest;
+ class QtAbstractWebPopup;
class ChromeClientQt : public ChromeClient
{
@@ -63,6 +65,8 @@ namespace WebCore {
virtual bool canTakeFocus(FocusDirection);
virtual void takeFocus(FocusDirection);
+ virtual void focusedNodeChanged(Node*);
+
virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
virtual void show();
@@ -120,7 +124,21 @@ namespace WebCore {
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
#endif
+
+#if USE(ACCELERATED_COMPOSITING)
+ // see ChromeClient.h
+ // this is a hook for WebCore to tell us what we need to do with the GraphicsLayers
+ virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
+ virtual void setNeedsOneShotDrawingSynchronization();
+ virtual void scheduleCompositingLayerSync();
+#endif
+
+#if ENABLE(TOUCH_EVENTS)
+ virtual void needTouchEvents(bool) { }
+#endif
+
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
+ virtual void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>);
virtual void formStateDidChange(const Node*) { }
@@ -132,6 +150,8 @@ namespace WebCore {
virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
+ QtAbstractWebPopup* createSelectPopup();
+
QWebPage* m_webPage;
WebCore::KURL lastHoverURL;
WebCore::String lastHoverTitle;
@@ -140,6 +160,7 @@ namespace WebCore {
bool toolBarsVisible;
bool statusBarVisible;
bool menuBarVisible;
+ QEventLoop* m_eventLoop;
};
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
index 99e438d..e48c3e3 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
@@ -27,6 +27,8 @@
#include "DragClientQt.h"
#include "ClipboardQt.h"
+#include "Frame.h"
+#include "PlatformMouseEvent.h"
#include "qwebpage.h"
#include <QDrag>
@@ -35,6 +37,32 @@
namespace WebCore {
+static inline Qt::DropActions dragOperationsToDropActions(unsigned op)
+{
+ Qt::DropActions result = Qt::IgnoreAction;
+ if (op & DragOperationCopy)
+ result = Qt::CopyAction;
+ if (op & DragOperationMove)
+ result |= Qt::MoveAction;
+ if (op & DragOperationGeneric)
+ result |= Qt::MoveAction;
+ if (op & DragOperationLink)
+ result |= Qt::LinkAction;
+ return result;
+}
+
+static inline DragOperation dropActionToDragOperation(Qt::DropActions action)
+{
+ DragOperation result = DragOperationNone;
+ if (action & Qt::CopyAction)
+ result = DragOperationCopy;
+ if (action & Qt::LinkAction)
+ result = DragOperationLink;
+ if (action & Qt::MoveAction)
+ result = DragOperationMove;
+ return result;
+}
+
DragDestinationAction DragClientQt::actionMaskForDrag(DragData*)
{
return DragDestinationActionAny;
@@ -58,7 +86,7 @@ void DragClientQt::willPerformDragSourceAction(DragSourceAction, const IntPoint&
{
}
-void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard* clipboard, Frame*, bool)
+void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard* clipboard, Frame* frame, bool)
{
#ifndef QT_NO_DRAGANDDROP
QMimeData* clipboardData = static_cast<ClipboardQt*>(clipboard)->clipboardData();
@@ -66,10 +94,15 @@ void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Cli
QWidget* view = m_webPage->view();
if (view) {
QDrag *drag = new QDrag(view);
- if (clipboardData->hasImage())
+ if (clipboardData && clipboardData->hasImage())
drag->setPixmap(qvariant_cast<QPixmap>(clipboardData->imageData()));
+ DragOperation dragOperationMask = clipboard->sourceOperation();
drag->setMimeData(clipboardData);
- drag->start();
+ Qt::DropAction actualDropAction = drag->exec(dragOperationsToDropActions(dragOperationMask));
+
+ // Send dragEnd event
+ PlatformMouseEvent me(m_webPage->view()->mapFromGlobal(QCursor::pos()), QCursor::pos(), LeftButton, MouseEventMoved, 0, false, false, false, false, 0);
+ frame->eventHandler()->dragSourceEndedAt(me, dropActionToDragOperation(actualDropAction));
}
#endif
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 2d1a1eb..90ebb1d 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -407,28 +407,38 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
case VK_LEFT:
if (kevent->shiftKey())
frame->editor()->command("MoveLeftAndModifySelection").execute();
- else frame->editor()->command("MoveLeft").execute();
+ else
+ frame->editor()->command("MoveLeft").execute();
break;
case VK_RIGHT:
if (kevent->shiftKey())
frame->editor()->command("MoveRightAndModifySelection").execute();
- else frame->editor()->command("MoveRight").execute();
+ else
+ frame->editor()->command("MoveRight").execute();
break;
case VK_UP:
if (kevent->shiftKey())
frame->editor()->command("MoveUpAndModifySelection").execute();
- else frame->editor()->command("MoveUp").execute();
+ else
+ frame->editor()->command("MoveUp").execute();
break;
case VK_DOWN:
if (kevent->shiftKey())
frame->editor()->command("MoveDownAndModifySelection").execute();
- else frame->editor()->command("MoveDown").execute();
+ else
+ frame->editor()->command("MoveDown").execute();
break;
case VK_PRIOR: // PageUp
- frame->editor()->command("MovePageUp").execute();
+ if (kevent->shiftKey())
+ frame->editor()->command("MovePageUpAndModifySelection").execute();
+ else
+ frame->editor()->command("MovePageUp").execute();
break;
case VK_NEXT: // PageDown
- frame->editor()->command("MovePageDown").execute();
+ if (kevent->shiftKey())
+ frame->editor()->command("MovePageDownAndModifySelection").execute();
+ else
+ frame->editor()->command("MovePageDown").execute();
break;
case VK_TAB:
return;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 5cabca0..9c1aeff 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -1,9 +1,10 @@
/*
* Copyright (C) 2006 Zack Rusin <zack@kde.org>
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
* Coypright (C) 2008 Holger Hans Peter Freyther
+ * Coypright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
*
* All rights reserved.
*
@@ -54,8 +55,9 @@
#include "QNetworkReplyHandler.h"
#include "ResourceHandleInternal.h"
#include "ResourceHandle.h"
-#include "Settings.h"
+#include "ScriptController.h"
#include "ScriptString.h"
+#include "Settings.h"
#include "QWebPageClient.h"
#include "qwebpage.h"
@@ -69,14 +71,10 @@
#include <QCoreApplication>
#include <QDebug>
-#if QT_VERSION >= 0x040400
#include <QGraphicsScene>
#include <QGraphicsWidget>
#include <QNetworkRequest>
#include <QNetworkReply>
-#else
-#include "qwebnetworkinterface_p.h"
-#endif
#include "qwebhistory_p.h"
static bool dumpFrameLoaderCallbacks = false;
@@ -146,9 +144,9 @@ namespace WebCore
FrameLoaderClientQt::FrameLoaderClientQt()
: m_frame(0)
, m_webFrame(0)
+ , m_firstData(false)
, m_pluginView(0)
, m_hasSentResponseToPlugin(false)
- , m_firstData(false)
, m_loadError (ResourceError())
{
}
@@ -308,11 +306,32 @@ void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage()
m_webFrame->page()->d->updateNavigationActions();
}
+void FrameLoaderClientQt::dispatchDidPushStateWithinPage()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - dispatchDidPushStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ notImplemented();
+}
-void FrameLoaderClientQt::dispatchWillClose()
+void FrameLoaderClientQt::dispatchDidReplaceStateWithinPage()
+{
+ if (dumpFrameLoaderCallbacks)
+ printf("%s - dispatchDidReplaceStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ notImplemented();
+}
+
+void FrameLoaderClientQt::dispatchDidPopStateWithinPage()
{
if (dumpFrameLoaderCallbacks)
- printf("%s - willCloseFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+ printf("%s - dispatchDidPopStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
+ notImplemented();
+}
+
+void FrameLoaderClientQt::dispatchWillClose()
+{
}
@@ -579,9 +598,6 @@ String FrameLoaderClientQt::userAgent(const KURL& url)
void FrameLoaderClientQt::dispatchDidReceiveIcon()
{
- if (dumpFrameLoaderCallbacks)
- printf("%s - didReceiveIconForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
-
if (m_webFrame) {
emit m_webFrame->iconChanged();
}
@@ -601,10 +617,10 @@ bool FrameLoaderClientQt::canHandleRequest(const WebCore::ResourceRequest&) cons
return true;
}
-void FrameLoaderClientQt::windowObjectCleared()
+void FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
{
- if (dumpFrameLoaderCallbacks)
- printf("%s - didClearWindowObjectForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+ if (world != mainThreadNormalWorld())
+ return;
if (m_webFrame)
emit m_webFrame->javaScriptWindowObjectCleared();
@@ -643,13 +659,31 @@ bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const
return true;
}
+void FrameLoaderClientQt::dispatchDidAddBackForwardItem(WebCore::HistoryItem*) const
+{
+}
+
+void FrameLoaderClientQt::dispatchDidRemoveBackForwardItem(WebCore::HistoryItem*) const
+{
+}
+
+void FrameLoaderClientQt::dispatchDidChangeBackForwardIndex() const
+{
+}
+
void FrameLoaderClientQt::didDisplayInsecureContent()
{
+ if (dumpFrameLoaderCallbacks)
+ printf("didDisplayInsecureContent\n");
+
notImplemented();
}
void FrameLoaderClientQt::didRunInsecureContent(WebCore::SecurityOrigin*)
{
+ if (dumpFrameLoaderCallbacks)
+ printf("didRunInsecureContent\n");
+
notImplemented();
}
@@ -786,7 +820,6 @@ WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoad
void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&)
{
-#if QT_VERSION >= 0x040400
if (!m_webFrame)
return;
@@ -799,7 +832,6 @@ void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCor
else
reply->abort();
}
-#endif
}
void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest& request)
@@ -952,11 +984,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForMIMEType(FramePolicyFunction fu
void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>, const WebCore::String&)
{
Q_ASSERT(m_webFrame);
-#if QT_VERSION < 0x040400
- QWebNetworkRequest r(request);
-#else
QNetworkRequest r(request.toNetworkRequest(m_webFrame));
-#endif
QWebPage* page = m_webFrame->page();
if (!page->d->acceptNavigationRequest(0, r, QWebPage::NavigationType(action.type()))) {
@@ -977,11 +1005,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunc
void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>)
{
Q_ASSERT(m_webFrame);
-#if QT_VERSION < 0x040400
- QWebNetworkRequest r(request);
-#else
QNetworkRequest r(request.toNetworkRequest(m_webFrame));
-#endif
QWebPage*page = m_webFrame->page();
if (!page->d->acceptNavigationRequest(m_webFrame, r, QWebPage::NavigationType(action.type()))) {
@@ -1006,12 +1030,10 @@ void FrameLoaderClientQt::dispatchUnableToImplementPolicy(const WebCore::Resourc
void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request)
{
-#if QT_VERSION >= 0x040400
if (!m_webFrame)
return;
emit m_webFrame->page()->downloadRequested(request.toNetworkRequest(m_webFrame));
-#endif
}
PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
@@ -1021,7 +1043,12 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
return 0;
QWebFrameData frameData(m_frame->page(), m_frame, ownerElement, name);
- frameData.url = url;
+
+ if (url.isEmpty())
+ frameData.url = blankURL();
+ else
+ frameData.url = url;
+
frameData.referrer = referrer;
frameData.allowsScrolling = allowsScrolling;
frameData.marginWidth = marginWidth;
@@ -1048,6 +1075,24 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
return frameData.frame.release();
}
+void FrameLoaderClientQt::didTransferChildFrameToNewDocument()
+{
+ ASSERT(m_frame->ownerElement());
+
+ if (!m_webFrame)
+ return;
+
+ Frame* parentFrame = m_webFrame->d->frame->tree()->parent();
+ ASSERT(parentFrame);
+
+ if (QWebFrame* parent = QWebFramePrivate::kit(parentFrame)) {
+ m_webFrame->d->setPage(parent->page());
+
+ if (m_webFrame->parent() != qobject_cast<QObject*>(parent))
+ m_webFrame->setParent(parent);
+ }
+}
+
ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& _mimeType)
{
// qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<_mimeType;
@@ -1097,11 +1142,7 @@ const unsigned numqStyleSheetProperties = sizeof(qstyleSheetProperties) / sizeof
class QtPluginWidget: public Widget
{
public:
- QtPluginWidget(QWidget* w = 0)
- : Widget(w)
- , m_visible(false)
- {}
-
+ QtPluginWidget(QWidget* w = 0): Widget(w) {}
~QtPluginWidget()
{
if (platformWidget())
@@ -1135,25 +1176,16 @@ public:
handleVisibility();
}
- virtual void hide()
- {
- m_visible = false;
- Widget::hide();
- }
-
virtual void show()
{
- m_visible = true;
- if (!platformWidget())
- return;
-
- handleVisibility();
+ Widget::show();
+ handleVisibility();
}
private:
void handleVisibility()
{
- if (!m_visible)
+ if (!isVisible())
return;
// if setMask is set with an empty QRegion, no clipping will
@@ -1161,8 +1193,6 @@ private:
QRegion mask = platformWidget()->mask();
platformWidget()->setVisible(!mask.isEmpty());
}
-
- bool m_visible;
};
#if QT_VERSION >= 0x040600
@@ -1262,13 +1292,11 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
#endif // QT_NO_STYLE_STYLESHEET
}
-#if QT_VERSION >= 0x040400
if (!object) {
QWebPluginFactory* factory = m_webFrame->page()->pluginFactory();
if (factory)
object = factory->create(mimeType, qurl, params, values);
}
-#endif
if (object) {
QWidget* widget = qobject_cast<QWidget*>(object);
@@ -1303,8 +1331,23 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
// FIXME: make things work for widgetless plugins as well
delete object;
} else { // NPAPI Plugins
+ Vector<String> params = paramNames;
+ Vector<String> values = paramValues;
+ if (mimeType == "application/x-shockwave-flash") {
+ QWebPageClient* client = m_webFrame->page()->d->client;
+ if (!client || !qobject_cast<QWidget*>(client->pluginParent())) {
+ // inject wmode=opaque when there is no client or the client is not a QWebView
+ size_t wmodeIndex = params.find("wmode");
+ if (wmodeIndex == -1) {
+ params.append("wmode");
+ values.append("opaque");
+ } else
+ values[wmodeIndex] = "opaque";
+ }
+ }
+
RefPtr<PluginView> pluginView = PluginView::create(m_frame, pluginSize, element, url,
- paramNames, paramValues, mimeType, loadManually);
+ params, values, mimeType, loadManually);
return pluginView;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 66c4252..adeb31c 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -103,6 +103,9 @@ namespace WebCore {
virtual void dispatchDidCancelClientRedirect();
virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate);
virtual void dispatchDidChangeLocationWithinPage();
+ virtual void dispatchDidPushStateWithinPage();
+ virtual void dispatchDidReplaceStateWithinPage();
+ virtual void dispatchDidPopStateWithinPage();
virtual void dispatchWillClose();
virtual void dispatchDidReceiveIcon();
virtual void dispatchDidStartProvisionalLoad();
@@ -148,7 +151,9 @@ namespace WebCore {
virtual void updateGlobalHistory();
virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
-
+ virtual void dispatchDidAddBackForwardItem(HistoryItem*) const;
+ virtual void dispatchDidRemoveBackForwardItem(HistoryItem*) const;
+ virtual void dispatchDidChangeBackForwardIndex() const;
virtual void didDisplayInsecureContent();
virtual void didRunInsecureContent(SecurityOrigin*);
@@ -189,6 +194,7 @@ namespace WebCore {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) ;
+ virtual void didTransferChildFrameToNewDocument();
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);
virtual void redirectDataToPlugin(Widget* pluginWidget);
@@ -197,7 +203,7 @@ namespace WebCore {
virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
virtual String overrideMediaType() const;
- virtual void windowObjectCleared();
+ virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*);
virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 7a1bfd5..5f343ff 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -50,17 +50,16 @@ namespace WebCore {
static const QLatin1String settingStoragePrefix("Qt/QtWebKit/QWebInspector/");
static const QLatin1String settingStorageTypeSuffix(".type");
-static InspectorController::Setting variantToSetting(const QVariant& qvariant);
-static QVariant settingToVariant(const InspectorController::Setting& icSetting);
+static String variantToSetting(const QVariant& qvariant);
+static QVariant settingToVariant(const String& value);
class InspectorClientWebPage : public QWebPage {
Q_OBJECT
friend class InspectorClientQt;
public:
InspectorClientWebPage(QObject* parent = 0)
- : QWebPage(parent)
+ : QWebPage(parent)
{
- settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false);
}
QWebPage* createWindow(QWebPage::WebWindowType)
@@ -84,16 +83,19 @@ void InspectorClientQt::inspectorDestroyed()
Page* InspectorClientQt::createPage()
{
- QWebView* inspectorView = new QWebView;
- InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
- inspectorView->setPage(inspectorPage);
- m_inspectorView.set(inspectorView);
+ QWebView* inspectorView = m_inspectorView.get();
+ if (!inspectorView) {
+ inspectorView = new QWebView;
+ InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
+ inspectorView->setPage(inspectorPage);
+ m_inspectorView.set(inspectorView);
+ }
- inspectorPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
+ inspectorView->page()->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
m_inspectedWebPage->d->inspectorFrontend = inspectorView;
m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(inspectorView);
- return m_inspectorView->page()->d->page;
+ return inspectorView->page()->d->page;
}
String InspectorClientQt::localizedStringsURL()
@@ -112,17 +114,16 @@ void InspectorClientQt::showWindow()
{
updateWindowTitle();
+#if ENABLE(INSPECTOR)
m_inspectedWebPage->d->inspectorController()->setWindowVisible(true, true);
- // We don't allow the inspector to ask for widget visibility itself because showWindow is
- // not always called when we want.
- // Inspecting an element or calling QWebInspector::show() should already have made the
- // widget visible.
+#endif
}
void InspectorClientQt::closeWindow()
{
- if (m_inspectedWebPage->d->inspector)
- m_inspectedWebPage->d->inspector->close();
+#if ENABLE(INSPECTOR)
+ m_inspectedWebPage->d->inspectorController()->setWindowVisible(false);
+#endif
}
void InspectorClientQt::attachWindow()
@@ -169,7 +170,7 @@ void InspectorClientQt::updateWindowTitle()
}
}
-void InspectorClientQt::populateSetting(const String& key, InspectorController::Setting& setting)
+void InspectorClientQt::populateSetting(const String& key, String* setting)
{
QSettings qsettings;
if (qsettings.status() == QSettings::AccessError) {
@@ -183,10 +184,10 @@ void InspectorClientQt::populateSetting(const String& key, InspectorController::
QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString();
QVariant storedValue = qsettings.value(settingKey);
storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data()));
- setting = variantToSetting(storedValue);
+ *setting = variantToSetting(storedValue);
}
-void InspectorClientQt::storeSetting(const String& key, const InspectorController::Setting& setting)
+void InspectorClientQt::storeSetting(const String& key, const String& setting)
{
QSettings qsettings;
if (qsettings.status() == QSettings::AccessError) {
@@ -201,70 +202,24 @@ void InspectorClientQt::storeSetting(const String& key, const InspectorControlle
qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
}
-void InspectorClientQt::removeSetting(const String&)
-{
- notImplemented();
-}
-
-static InspectorController::Setting variantToSetting(const QVariant& qvariant)
+static String variantToSetting(const QVariant& qvariant)
{
- InspectorController::Setting retVal;
+ String retVal;
switch (qvariant.type()) {
case QVariant::Bool:
- retVal.set(qvariant.toBool());
- break;
- case QVariant::Double:
- retVal.set(qvariant.toDouble());
- break;
- case QVariant::Int:
- retVal.set((long)qvariant.toInt());
- break;
+ retVal = qvariant.toBool() ? "true" : "false";
case QVariant::String:
- retVal.set(qvariant.toString());
- break;
- case QVariant::StringList: {
- QStringList qsList = qvariant.toStringList();
- int listCount = qsList.count();
- Vector<String> vector(listCount);
- for (int i = 0; i < listCount; ++i)
- vector[i] = qsList[i];
- retVal.set(vector);
- break;
- }
+ retVal = qvariant.toString();
}
return retVal;
}
-static QVariant settingToVariant(const InspectorController::Setting& icSetting)
+static QVariant settingToVariant(const String& setting)
{
QVariant retVal;
-
- switch (icSetting.type()) {
- case InspectorController::Setting::StringType:
- retVal.setValue(static_cast<QString>(icSetting.string()));
- break;
- case InspectorController::Setting::StringVectorType: {
- const Vector<String>& vector = icSetting.stringVector();
- Vector<String>::const_iterator iter;
- QStringList qsList;
- for (iter = vector.begin(); iter != vector.end(); ++iter)
- qsList << *iter;
- retVal.setValue(qsList);
- break;
- }
- case InspectorController::Setting::DoubleType:
- retVal.setValue(icSetting.doubleValue());
- break;
- case InspectorController::Setting::IntegerType:
- retVal.setValue((int)icSetting.integerValue());
- break;
- case InspectorController::Setting::BooleanType:
- retVal.setValue(icSetting.booleanValue());
- break;
- }
-
+ retVal.setValue(static_cast<QString>(setting));
return retVal;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index ccf8b69..923bab4 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -66,9 +66,8 @@ namespace WebCore {
virtual void hideHighlight();
virtual void inspectedURLChanged(const String& newURL);
- virtual void populateSetting(const String& key, InspectorController::Setting&);
- virtual void storeSetting(const String& key, const InspectorController::Setting&);
- virtual void removeSetting(const String& key);
+ virtual void populateSetting(const String& key, String* value);
+ virtual void storeSetting(const String& key, const String& value);
virtual void inspectorWindowObjectCleared();
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
new file mode 100644
index 0000000..c553c45
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2010 Girish Ramakrishnan <girish@forwardbias.in>
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+#include "config.h"
+#include "QtFallbackWebPopup.h"
+
+#include "HostWindow.h"
+#include "PopupMenuClient.h"
+#include "qgraphicswebview.h"
+#include "QWebPageClient.h"
+#include <QAbstractItemView>
+#include <QApplication>
+#include <QGraphicsProxyWidget>
+#include <QGraphicsScene>
+#include <QGraphicsView>
+#include <QInputContext>
+#include <QMouseEvent>
+#include <QStandardItemModel>
+
+namespace WebCore {
+
+QtFallbackWebPopupCombo::QtFallbackWebPopupCombo(QtFallbackWebPopup& ownerPopup)
+ : m_ownerPopup(ownerPopup)
+{
+}
+
+void QtFallbackWebPopupCombo::showPopup()
+{
+ QComboBox::showPopup();
+ m_ownerPopup.m_popupVisible = true;
+}
+
+void QtFallbackWebPopupCombo::hidePopup()
+{
+ QWidget* activeFocus = QApplication::focusWidget();
+ if (activeFocus && activeFocus == QComboBox::view()
+ && activeFocus->testAttribute(Qt::WA_InputMethodEnabled)) {
+ QInputContext* qic = activeFocus->inputContext();
+ if (qic) {
+ qic->reset();
+ qic->setFocusWidget(0);
+ }
+ }
+
+ QComboBox::hidePopup();
+
+ if (QGraphicsProxyWidget* proxy = graphicsProxyWidget())
+ proxy->setVisible(false);
+
+ if (!m_ownerPopup.m_popupVisible)
+ return;
+
+ m_ownerPopup.m_popupVisible = false;
+ m_ownerPopup.popupDidHide();
+}
+
+// QtFallbackWebPopup
+
+QtFallbackWebPopup::QtFallbackWebPopup()
+ : QtAbstractWebPopup()
+ , m_popupVisible(false)
+ , m_combo(new QtFallbackWebPopupCombo(*this))
+ , m_proxy(0)
+{
+ connect(m_combo, SIGNAL(activated(int)),
+ SLOT(activeChanged(int)), Qt::QueuedConnection);
+}
+
+QtFallbackWebPopup::~QtFallbackWebPopup()
+{
+ // If we create a proxy, then the deletion of the proxy and the
+ // combo will be done by the proxy's parent (QGraphicsWebView)
+ if (!m_proxy)
+ delete m_combo;
+}
+
+void QtFallbackWebPopup::show()
+{
+ populate();
+ m_combo->setCurrentIndex(currentIndex());
+
+#if defined(Q_WS_MAEMO_5)
+ // Comboboxes with Qt on Maemo 5 come up in their full width on the screen, so neither
+ // the proxy widget, nor the coordinates are needed.
+ m_combo->setParent(pageClient()->ownerWidget());
+ m_combo->showPopup();
+ return;
+#endif
+
+ QRect rect = geometry();
+ if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) {
+ if (!m_proxy) {
+ m_proxy = new QGraphicsProxyWidget(webView);
+ m_proxy->setWidget(m_combo);
+ } else
+ m_proxy->setVisible(true);
+ m_proxy->setGeometry(rect);
+ } else {
+ m_combo->setParent(pageClient()->ownerWidget());
+ m_combo->setGeometry(QRect(rect.left(), rect.top(),
+ rect.width(), m_combo->sizeHint().height()));
+
+ }
+
+ // QCursor::pos() is not a great idea for a touch screen, but as Maemo 5 is handled
+ // separately above, this should be okay.
+ QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton,
+ Qt::LeftButton, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_combo, &event);
+}
+
+void QtFallbackWebPopup::hide()
+{
+ m_combo->hidePopup();
+}
+
+void QtFallbackWebPopup::populate()
+{
+ m_combo->clear();
+
+ QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_combo->model());
+ Q_ASSERT(model);
+
+#if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5)
+ m_combo->setFont(font());
+#endif
+ for (int i = 0; i < itemCount(); ++i) {
+ switch (itemType(i)) {
+ case Separator:
+ m_combo->insertSeparator(i);
+ break;
+ case Group:
+ m_combo->insertItem(i, itemText(i));
+ model->item(i)->setEnabled(false);
+ break;
+ case Option:
+ m_combo->insertItem(i, itemText(i));
+ model->item(i)->setEnabled(itemIsEnabled(i));
+ break;
+ }
+ }
+}
+
+void QtFallbackWebPopup::activeChanged(int index)
+{
+ if (index < 0)
+ return;
+
+ valueChanged(index);
+}
+
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
new file mode 100644
index 0000000..3924bf6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef QtFallbackWebPopup_h
+#define QtFallbackWebPopup_h
+
+#include "QtAbstractWebPopup.h"
+#include <QComboBox>
+
+class QGraphicsProxyWidget;
+
+namespace WebCore {
+
+class QtFallbackWebPopupCombo;
+
+class QtFallbackWebPopup : public QObject, public QtAbstractWebPopup {
+ Q_OBJECT
+public:
+ QtFallbackWebPopup();
+ ~QtFallbackWebPopup();
+
+ virtual void show();
+ virtual void hide();
+
+private slots:
+ void activeChanged(int);
+
+private:
+ friend class QtFallbackWebPopupCombo;
+ bool m_popupVisible;
+ QtFallbackWebPopupCombo* m_combo;
+ QGraphicsProxyWidget* m_proxy;
+
+ void populate();
+};
+
+class QtFallbackWebPopupCombo : public QComboBox {
+public:
+ QtFallbackWebPopupCombo(QtFallbackWebPopup& ownerPopup);
+ virtual void showPopup();
+ virtual void hidePopup();
+
+private:
+ QtFallbackWebPopup& m_ownerPopup;
+};
+
+}
+
+#endif // QtFallbackWebPopup_h
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf
index 8ee8f69..292c124 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf
@@ -4,7 +4,7 @@ project = qtwebkit
description = "Qt WebKit API Documentation"
headerdirs = $SRCDIR/WebKit/qt/Api
-sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs
+sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/JavaScriptCore/qt/api
outputdir = $OUTPUT_DIR/doc/html
outputformats = HTML
sources.fileextensions = "*.cpp *.doc *.qdoc *.h"
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
index 2707ffb..822b61c 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
@@ -53,8 +53,8 @@ static void findAll()
*/
//! [FindAll intro]
- QList<QWebElement> allSpans = document.findAll("span");
- QList<QWebElement> introSpans = document.findAll("p.intro span");
+ QWebElementCollection allSpans = document.findAll("span");
+ QWebElementCollection introSpans = document.findAll("p.intro span");
//! [FindAll intro] //! [FindAll]
}
diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
index 5dd2e20..f53bb0d 100644
--- a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -694,4 +694,8 @@ EXPORTS
_Z25qt_resumeActiveDOMObjectsP9QWebFrame @ 693 NONAME
_Z26qt_suspendActiveDOMObjectsP9QWebFrame @ 694 NONAME
_Z35qtwebkit_webframe_scrollRecursivelyP9QWebFrameii @ 695 NONAME
+ _ZN13QWebInspector10closeEventEP11QCloseEvent @ 696 NONAME
+ _ZN9QWebFrame17scrollRecursivelyEii @ 697 NONAME
+ _ZN16QGraphicsWebView20setResizesToContentsEb @ 698 NONAME
+ _ZNK16QGraphicsWebView17resizesToContentsEv @ 699 NONAME
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro
new file mode 100644
index 0000000..8b24274
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro
@@ -0,0 +1 @@
+include(../../tests.pri)
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
deleted file mode 100644
index bc5e75f..0000000
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = app
-TARGET = tst_loading
-include(../../../../../WebKit.pri)
-SOURCES += tst_loading.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.UID3 = 0xA000E541
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro
new file mode 100644
index 0000000..8acdd5c
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro
@@ -0,0 +1 @@
+include(../../tests.pri) \ No newline at end of file
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
deleted file mode 100644
index 48c7072..0000000
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = app
-TARGET = tst_painting
-include(../../../../../WebKit.pri)
-SOURCES += tst_painting.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.UID3 = 0xA000E542
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro
new file mode 100644
index 0000000..0e49a70
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro
@@ -0,0 +1,10 @@
+# -------------------------------------------------
+# Project created by QtCreator 2009-12-10T11:25:02
+# -------------------------------------------------
+include(../tests.pri)
+TARGET = hybridPixmap
+SOURCES += widget.cpp
+HEADERS += widget.h
+FORMS += widget.ui
+RESOURCES += resources.qrc
+CONFIG += console
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/resources.qrc b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/resources.qrc
new file mode 100644
index 0000000..5fd47e3
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/resources.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>test.html</file>
+ </qresource>
+</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/test.html b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/test.html
new file mode 100644
index 0000000..0f2c345
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/test.html
@@ -0,0 +1,65 @@
+<html>
+ <head>
+ <style>
+ img { display: block; border-style: groove}
+ </style>
+ <script>
+ function startTest()
+ {
+ var obj = myWidget.image;
+ var pxm = myWidget.pixmap;
+
+ var img = new Image;
+ obj.assignToHTMLImageElement(img);
+ var img1 = document.getElementById("img1");
+ var img2 = document.getElementById("img2");
+ var img3 = document.getElementById("img3");
+ var img4 = document.getElementById("img4");
+ document.body.appendChild(img);
+ obj.assignToHTMLImageElement(img3);
+ pxm.assignToHTMLImageElement(img4);
+ myWidget.compare(pxm.width, img4.width);
+ myWidget.compare(obj.width, img3.width);
+ var signalsFired = 0;
+ myWidget.compare(obj.toString(),"[Qt Native Pixmap "+obj.width+","+obj.height+"]");
+ myWidget.compare(String(pxm),"[Qt Native Pixmap "+pxm.width+","+pxm.height+"]");
+
+ // this shouldn't work but shouldn't crash
+ myWidget.randomSlot("foobar");
+
+ myWidget.pixmapSignal.connect(function(imgFromSignal) {
+ myWidget.compare(imgFromSignal.height, img2.height);
+ if (++signalsFired == 2)
+ myWidget.completeTest();
+ });
+
+ myWidget.imageSignal.connect(function(imgFromSignal) {
+ myWidget.compare(pxm.height, img2.height);
+ if (++signalsFired == 2)
+ myWidget.completeTest();
+ });
+
+ function continueTestAfterImagesAreLoaded()
+ {
+ if (img1.complete && img2.complete) {
+ myWidget.compare(pxm.height, img2.height);
+ myWidget.pixmapSlot(img);
+ myWidget.imageSlot(pxm);
+ }
+ }
+ img1.onload = continueTestAfterImagesAreLoaded;
+ img2.onload = continueTestAfterImagesAreLoaded;
+ img1.src = obj.toDataUrl();
+ img2.src = myWidget.pixmap.toDataUrl();
+ myWidget.image = pxm;
+ myWidget.pixmap = img;
+ }
+ </script>
+ </head>
+ <body onload="startTest()">
+ <img id="img1" />
+ <img id="img2" />
+ <img id="img3" />
+ <img id="img4" />
+ </body>
+</html>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp
new file mode 100644
index 0000000..72dbb3b
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "../util.h"
+
+#include "widget.h"
+#include <QtTest/QtTest>
+
+class tst_hybridPixmap : public QObject {
+ Q_OBJECT
+
+public:
+ tst_hybridPixmap(QObject* o = 0) : QObject(o) {}
+
+public slots:
+ void init()
+ {
+ }
+
+ void cleanup()
+ {
+ }
+
+private slots:
+ void hybridPixmap()
+ {
+ Widget widget;
+ widget.show();
+ widget.start();
+ waitForSignal(&widget, SIGNAL(testComplete()));
+ }
+};
+
+QTEST_MAIN(tst_hybridPixmap)
+
+#include <tst_hybridPixmap.moc>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.cpp b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.cpp
new file mode 100644
index 0000000..cfdb1d6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.cpp
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "widget.h"
+
+#include "qwebelement.h"
+#include "qwebframe.h"
+#include "ui_widget.h"
+#include <QPainter>
+#include <QtTest/QtTest>
+
+Widget::Widget(QWidget* parent) :
+ QWidget(parent),
+ ui(new Ui::Widget)
+{
+ ui->setupUi(this);
+}
+
+void Widget::refreshJS()
+{
+ ui->webView->page()->mainFrame()->addToJavaScriptWindowObject("myWidget", this);
+}
+void Widget::start()
+{
+ ui->webView->load(QUrl("qrc:///test.html"));
+ connect(ui->webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(refreshJS()));
+ ui->webView->page()->mainFrame()->addToJavaScriptWindowObject("myWidget", this);
+}
+
+void Widget::completeTest()
+{
+ QCOMPARE(ui->lbl1->pixmap()->size(), ui->lbl2->size());
+ QCOMPARE(ui->lbl3->size(), ui->lbl4->pixmap()->size());
+ QCOMPARE(ui->lbl2->size().width(), ui->webView->page()->mainFrame()->findFirstElement("#img1").evaluateJavaScript("this.width").toInt());
+ QCOMPARE(ui->lbl3->size().width(), ui->webView->page()->mainFrame()->findFirstElement("#img2").evaluateJavaScript("this.width").toInt());
+ emit testComplete();
+}
+
+void Widget::setPixmap(const QPixmap& p)
+{
+ ui->lbl1->setPixmap(p);
+}
+QPixmap Widget::pixmap() const
+{
+ QPixmap px(ui->lbl3->size());
+ {
+ QPainter p(&px);
+ ui->lbl3->render(&p);
+ }
+ return px;
+}
+void Widget::setImage(const QImage& img)
+{
+ ui->lbl4->setPixmap(QPixmap::fromImage(img));
+}
+
+QImage Widget::image() const
+{
+ QImage img(ui->lbl2->size(), QImage::Format_ARGB32);
+ {
+ QPainter p(&img);
+ ui->lbl2->render(&p);
+ }
+ return img;
+}
+
+Widget::~Widget()
+{
+ delete ui;
+}
+
+void Widget::changeEvent(QEvent* e)
+{
+ QWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+void Widget::compare(const QVariant& a, const QVariant& b)
+{
+ QCOMPARE(a, b);
+}
+
+void Widget::imageSlot(const QImage& img)
+{
+ QCOMPARE(img.size(), ui->lbl3->size());
+ emit pixmapSignal(QPixmap::fromImage(img));
+}
+
+void Widget::pixmapSlot(const QPixmap& pxm)
+{
+ QCOMPARE(pxm.size(), ui->lbl2->size());
+ emit imageSignal(ui->lbl4->pixmap()->toImage());
+}
+
+void Widget::randomSlot(const QPixmap& pxm)
+{
+ QVERIFY(pxm.isNull());
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.h b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.h
new file mode 100644
index 0000000..a49f8ba
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef widget_h
+#define widget_h
+
+#include <QImage>
+#include <QPixmap>
+#include <QWidget>
+#include "qwebview.h"
+
+typedef QWebView WebView;
+
+namespace Ui {
+class Widget;
+}
+
+class Widget : public QWidget {
+ Q_OBJECT
+ Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
+ Q_PROPERTY(QImage image READ image WRITE setImage)
+
+public:
+ Widget(QWidget* parent = 0);
+ ~Widget();
+ void setPixmap(const QPixmap&);
+ QPixmap pixmap() const;
+ void setImage(const QImage&);
+ QImage image() const;
+
+private slots:
+ void refreshJS();
+
+public slots:
+ void completeTest();
+ void start();
+ void compare(const QVariant& a, const QVariant& b);
+ void imageSlot(const QImage&);
+ void pixmapSlot(const QPixmap&);
+ void randomSlot(const QPixmap&);
+
+signals:
+ void testComplete();
+ void imageSignal(const QImage&);
+ void pixmapSignal(const QPixmap&);
+
+protected:
+ void changeEvent(QEvent* e);
+
+private:
+ Ui::Widget* ui;
+};
+
+#endif // widget_h
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui
new file mode 100644
index 0000000..4f2b3b8
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Widget</class>
+ <widget class="QWidget" name="Widget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>400</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Widget</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="WebView" name="webView" native="true">
+ <property name="url" stdset="0">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="lbl1">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lbl2">
+ <property name="minimumSize">
+ <size>
+ <width>120</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>120</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Image from Qt to HTML</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lbl3">
+ <property name="text">
+ <string>Pixmap from Qt to HTML</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lbl4">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+ <customwidget>
+ <class>WebView</class>
+ <extends>QWidget</extends>
+ <header>widget.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
index 57b4437..4ca2bf6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
@@ -1,10 +1 @@
-TEMPLATE = app
-TARGET = tst_qgraphicswebview
-include(../../../../WebKit.pri)
-SOURCES += tst_qgraphicswebview.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri) \ No newline at end of file
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 a52e167..657e09f 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -17,36 +17,13 @@
Boston, MA 02110-1301, USA.
*/
+#include "../util.h"
#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
{
Q_OBJECT
@@ -113,7 +90,7 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
view.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
view.resize(600, 480);
webView->resize(view.geometry().size());
- QTest::qWait(200);
+ QCoreApplication::processEvents();
view.show();
page->mainFrame()->setHtml(QString("data:text/html,"
@@ -122,7 +99,7 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
"<frame src=\"data:text/html,bar\">"
"</frameset>"));
- QVERIFY(::waitForSignal(page, SIGNAL(loadFinished(bool))));
+ QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool))));
}
QTEST_MAIN(tst_QGraphicsWebView)
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
index c45a9ac..4ca2bf6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -1,12 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebelement
-include(../../../../WebKit.pri)
-SOURCES += tst_qwebelement.cpp
-RESOURCES += qwebelement.qrc
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.UID3 = 0xA000E53A
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri) \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
deleted file mode 100644
index 28b9d7b..0000000
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<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/qwebframe/image.png b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/image.png
index 8d70364..8d70364 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/image.png
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/image.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/style.css b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/style.css
index 2713dfd..2713dfd 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/style.css
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/style.css
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/style2.css b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/style2.css
index 6575dcb..6575dcb 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/style2.css
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/resources/style2.css
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 e9dae18..8db0ec3 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
@@ -19,38 +19,15 @@
#include <QtTest/QtTest>
-
#include <qwebpage.h>
#include <qwidget.h>
#include <qwebview.h>
#include <qwebframe.h>
#include <qwebelement.h>
+#include <util.h>
//TESTED_CLASS=
//TESTED_FILES=
-/**
- * Starts an event loop that runs until the given signal is received.
- Optionally the event loop
- * can return earlier on a timeout.
- *
- * \return \p true if the requested signal was received
- * \p false on timeout
- */
-static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
-{
- QEventLoop loop;
- QObject::connect(obj, signal, &loop, SLOT(quit()));
- QTimer timer;
- QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
- if (timeout > 0) {
- QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
- timer.setSingleShot(true);
- timer.start(timeout);
- }
- loop.exec();
- return timeoutSpy.isEmpty();
-}
-
class tst_QWebElement : public QObject
{
Q_OBJECT
@@ -576,9 +553,8 @@ void tst_QWebElement::style()
"</body>";
// in few seconds, the CSS should be completey loaded
- QSignalSpy spy(m_page, SIGNAL(loadFinished(bool)));
m_mainFrame->setHtml(html6);
- QTest::qWait(200);
+ waitForSignal(m_page, SIGNAL(loadFinished(bool)), 200);
p = m_mainFrame->documentElement().findAll("p").at(0);
QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue"));
@@ -596,7 +572,7 @@ void tst_QWebElement::style()
// in few seconds, the style should be completey loaded
m_mainFrame->setHtml(html7);
- QTest::qWait(200);
+ waitForSignal(m_page, SIGNAL(loadFinished(bool)), 200);
p = m_mainFrame->documentElement().findAll("p").at(0);
QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black"));
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc
new file mode 100644
index 0000000..7384c76
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+<file alias="style.css">resources/style.css</file>
+<file alias="style2.css">resources/style2.css</file>
+<file alias="image.png">resources/image.png</file>
+</qresource>
+</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index b8734cd..4ca2bf6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -1,13 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebframe
-include(../../../../WebKit.pri)
-SOURCES += tst_qwebframe.cpp
-RESOURCES += qwebframe.qrc
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
-
-symbian {
- TARGET.UID3 = 0xA000E53D
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri) \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
deleted file mode 100644
index 8afa0c1..0000000
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/">
-<file>image.png</file>
-<file>style.css</file>
-<file>test1.html</file>
-<file>test2.html</file>
-<file>testiframe.html</file>
-<file>testiframe2.html</file>
-</qresource>
-</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image.png
index 8d70364..8d70364 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/style.css b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/style.css
index c05b747..c05b747 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/style.css
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/style.css
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test1.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/test1.html
index b323f96..b323f96 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test1.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/test1.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test2.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/test2.html
index 63ac1f6..63ac1f6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test2.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/test2.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/testiframe.html
index 9f3ae85..203d3d3 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/testiframe.html
@@ -1,54 +1,54 @@
-</html>
-<html>
-<head>
-<title></title>
-<style type="text/css">
-<!--
-#header {
- background: #0f0;
- position: absolute;
- top: 0px;
- left: 0px;
- width: 800px;
- height: 100px;
-}
-#content1 {
- background: #ff0;
- position: absolute;
- top: 101px;
- left: 0px;
- width: 400px;
- height: 400px;
- overflow: scroll;
-}
-#content2 {
- background: #ff7;
- position: absolute;
- top: 101px;
- left: 401px;
- width: 400px;
- height: 400px;
-}
-#footer {
- background: #0f0;
- position: absolute;
- top: 502px;
- left: 0px;
- width: 800px;
- height: 200px;
-}
--->
-</style>
-</head>
-<body>
-<div id="header"></div>
-<div id="content1">You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
-You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
-You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
-You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
-You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
-You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.</div>
-<iframe id="content2" name="control" src="testiframe2.html"> </iframe>
-<div id="footer"></div>
-</body>
+</html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+<!--
+#header {
+ background: #0f0;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 800px;
+ height: 100px;
+}
+#content1 {
+ background: #ff0;
+ position: absolute;
+ top: 101px;
+ left: 0px;
+ width: 400px;
+ height: 400px;
+ overflow: scroll;
+}
+#content2 {
+ background: #ff7;
+ position: absolute;
+ top: 101px;
+ left: 401px;
+ width: 400px;
+ height: 400px;
+}
+#footer {
+ background: #0f0;
+ position: absolute;
+ top: 502px;
+ left: 0px;
+ width: 800px;
+ height: 200px;
+}
+-->
+</style>
+</head>
+<body>
+<div id="header"></div>
+<div id="content1">You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.</div>
+<iframe id="content2" name="control" src="testiframe2.html"> </iframe>
+<div id="footer"></div>
+</body>
</html> \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe2.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/testiframe2.html
index 1913a89..0d3a22f 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe2.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/testiframe2.html
@@ -1,21 +1,21 @@
-</html>
-<html>
-<head>
-<title></title>
-<style type="text/css">
-<!--
-#content {
- background: #fff;
- position: absolute;
- top: 0px;
- left: 0px;
- width: 800px;
- height: 800px;
-}
--->
-</style>
-</head>
-<body>
-<div id="content"> </div>
-</body>
+</html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+<!--
+#content {
+ background: #fff;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 800px;
+ height: 800px;
+}
+-->
+</style>
+</head>
+<body>
+<div id="content"> </div>
+</body>
</html> \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 609f8b4..ba684fa 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -38,40 +38,6 @@
#endif
#include "../util.h"
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
-//TESTED_CLASS=
-//TESTED_FILES=
-
-// Task 160192
-/**
- * Starts an event loop that runs until the given signal is received.
- Optionally the event loop
- * can return earlier on a timeout.
- *
- * \return \p true if the requested signal was received
- * \p false on timeout
- */
-static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
-{
- QEventLoop loop;
- QObject::connect(obj, signal, &loop, SLOT(quit()));
- QTimer timer;
- QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
- if (timeout > 0) {
- QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
- timer.setSingleShot(true);
- timer.start(timeout);
- }
- loop.exec();
- return timeoutSpy.isEmpty();
-}
-
-/* Mostly a test for the JavaScript related parts of QWebFrame */
-
-
struct CustomType {
QString string;
};
@@ -100,6 +66,7 @@ class MyQObject : public QObject
Q_PROPERTY(int readOnlyProperty READ readOnlyProperty)
Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
Q_PROPERTY(CustomType propWithCustomType READ propWithCustomType WRITE setPropWithCustomType)
+ Q_PROPERTY(QWebElement webElementProperty READ webElementProperty WRITE setWebElementProperty)
Q_ENUMS(Policy Strategy)
Q_FLAGS(Ability)
@@ -215,6 +182,14 @@ public:
m_shortcut = seq;
}
+ QWebElement webElementProperty() const {
+ return m_webElement;
+ }
+
+ void setWebElementProperty(const QWebElement& element) {
+ m_webElement = element;
+ }
+
CustomType propWithCustomType() const {
return m_customType;
}
@@ -467,6 +442,10 @@ public Q_SLOTS:
m_qtFunctionInvoked = 35;
m_actuals << arg;
}
+ void myOverloadedSlot(const QWebElement &arg) {
+ m_qtFunctionInvoked = 36;
+ m_actuals << QVariant::fromValue<QWebElement>(arg);
+ }
void qscript_call(int arg) {
m_qtFunctionInvoked = 40;
@@ -501,6 +480,7 @@ private:
int m_writeOnlyValue;
int m_readOnlyValue;
QKeySequence m_shortcut;
+ QWebElement m_webElement;
CustomType m_customType;
int m_qtFunctionInvoked;
QVariantList m_actuals;
@@ -580,6 +560,7 @@ private slots:
void enumerate();
void objectDeleted();
void typeConversion();
+ void arrayObjectEnumerable();
void symmetricUrl();
void progressSignal();
void urlChange();
@@ -604,9 +585,12 @@ private slots:
void hasSetFocus();
void render();
void scrollPosition();
+ void scrollToAnchor();
void evaluateWillCauseRepaint();
void qObjectWrapperWithSameIdentity();
void scrollRecursively();
+ void introspectQtMethods_data();
+ void introspectQtMethods();
private:
QString evalJS(const QString&s) {
@@ -707,7 +691,6 @@ 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()
@@ -718,6 +701,7 @@ void tst_QWebFrame::cleanup()
void tst_QWebFrame::getSetStaticProperty()
{
+ m_page->mainFrame()->setHtml("<html><head><body></body></html>");
QCOMPARE(evalJS("typeof myObject.noSuchProperty"), sUndefined);
// initial value (set in MyQObject constructor)
@@ -857,6 +841,8 @@ void tst_QWebFrame::getSetStaticProperty()
QCOMPARE(evalJS("myObject.stringListProperty[1]"), QLatin1String("two"));
QCOMPARE(evalJS("typeof myObject.stringListProperty[2]"), sString);
QCOMPARE(evalJS("myObject.stringListProperty[2]"), QLatin1String("true"));
+ evalJS("myObject.webElementProperty=document.body;");
+ QCOMPARE(evalJS("myObject.webElementProperty.tagName"), QLatin1String("BODY"));
// try to delete
QCOMPARE(evalJS("delete myObject.intProperty"), sFalse);
@@ -1919,6 +1905,12 @@ void tst_QWebFrame::overloadedSlots()
f.call(QString(), QStringList() << m_engine->newVariant(QVariant("ciao")));
QCOMPARE(m_myObject->qtFunctionInvoked(), 35);
*/
+
+ // should pick myOverloadedSlot(QRegExp)
+ m_myObject->resetQtFunctionInvoked();
+ evalJS("myObject.myOverloadedSlot(document.body)");
+ QCOMPARE(m_myObject->qtFunctionInvoked(), 36);
+
// should pick myOverloadedSlot(QObject*)
m_myObject->resetQtFunctionInvoked();
evalJS("myObject.myOverloadedSlot(myObject)");
@@ -2102,6 +2094,31 @@ void tst_QWebFrame::typeConversion()
// ### RegExps
}
+class StringListTestObject : public QObject {
+ Q_OBJECT
+public Q_SLOTS:
+ QVariant stringList()
+ {
+ return QStringList() << "Q" << "t";
+ };
+};
+
+void tst_QWebFrame::arrayObjectEnumerable()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ QObject* qobject = new StringListTestObject();
+ frame->addToJavaScriptWindowObject("test", qobject, QScriptEngine::ScriptOwnership);
+
+ const QString script("var stringArray = test.stringList();"
+ "var result = '';"
+ "for (var i in stringArray) {"
+ " result += stringArray[i];"
+ "}"
+ "result;");
+ QCOMPARE(frame->evaluateJavaScript(script).toString(), QString::fromLatin1("Qt"));
+}
+
void tst_QWebFrame::symmetricUrl()
{
QVERIFY(m_view->url().isEmpty());
@@ -2245,7 +2262,7 @@ protected:
virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
{
QString url = request.url().toString();
- if (op == QNetworkAccessManager::GetOperation)
+ if (op == QNetworkAccessManager::GetOperation) {
if (url == "qrc:/test1.html" || url == "http://abcdef.abcdef/")
return new FakeReply(request, this);
#ifndef QT_NO_OPENSSL
@@ -2256,6 +2273,7 @@ protected:
return reply;
}
#endif
+ }
return QNetworkAccessManager::createRequest(op, request, outgoingData);
}
@@ -2272,19 +2290,19 @@ void tst_QWebFrame::requestedUrl()
page.setNetworkAccessManager(networkManager);
frame->setUrl(QUrl("qrc:/test1.html"));
- QTest::qWait(200);
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(spy.count(), 1);
QCOMPARE(frame->requestedUrl(), QUrl("qrc:/test1.html"));
QCOMPARE(frame->url(), QUrl("qrc:/test2.html"));
frame->setUrl(QUrl("qrc:/non-existent.html"));
- QTest::qWait(200);
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(spy.count(), 2);
QCOMPARE(frame->requestedUrl(), QUrl("qrc:/non-existent.html"));
QCOMPARE(frame->url(), QUrl("qrc:/non-existent.html"));
frame->setUrl(QUrl("http://abcdef.abcdef"));
- QTest::qWait(200);
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(spy.count(), 3);
QCOMPARE(frame->requestedUrl(), QUrl("http://abcdef.abcdef/"));
QCOMPARE(frame->url(), QUrl("http://abcdef.abcdef/"));
@@ -2295,7 +2313,7 @@ void tst_QWebFrame::requestedUrl()
QSignalSpy spy2(page.networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)));
frame->setUrl(QUrl("qrc:/fake-ssl-error.html"));
- QTest::qWait(200);
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(spy2.count(), 1);
QCOMPARE(frame->requestedUrl(), QUrl("qrc:/fake-ssl-error.html"));
QCOMPARE(frame->url(), QUrl("qrc:/fake-ssl-error.html"));
@@ -2353,7 +2371,7 @@ void tst_QWebFrame::setHtmlWithResource()
// in few seconds, the image should be completey loaded
QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
frame->setHtml(html);
- QTest::qWait(200);
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(spy.count(), 1);
QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1);
@@ -2372,7 +2390,7 @@ void tst_QWebFrame::setHtmlWithResource()
// in few seconds, the CSS should be completey loaded
frame->setHtml(html2);
- QTest::qWait(200);
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(spy.size(), 2);
QWebElement p = frame->documentElement().findAll("p").at(0);
@@ -2381,6 +2399,11 @@ void tst_QWebFrame::setHtmlWithResource()
void tst_QWebFrame::setHtmlWithBaseURL()
{
+ if (!QDir(TESTS_SOURCE_DIR).exists())
+ QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+
+ QDir::setCurrent(TESTS_SOURCE_DIR);
+
QString html("<html><body><p>hello world</p><img src='resources/image2.png'/></body></html>");
QWebPage page;
@@ -2389,8 +2412,8 @@ void tst_QWebFrame::setHtmlWithBaseURL()
// 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);
+ frame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(spy.count(), 1);
QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1);
@@ -2522,21 +2545,22 @@ void tst_QWebFrame::popupFocus()
QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(25, 25));
QObject* webpopup = firstChildByClassName(&view, "WebCore::QWebPopup");
QComboBox* combo = qobject_cast<QComboBox*>(webpopup);
+ QVERIFY(combo != 0);
QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup
// hide the popup and check if focus is on the page
combo->hidePopup();
QTRY_VERIFY(view.hasFocus() && !combo->view()->hasFocus()); // Focus should be back on the WebView
- // triple the flashing time, should at least blink twice already
- int delay = qApp->cursorFlashTime() * 3;
+ // double the flashing time, should at least blink once already
+ int delay = qApp->cursorFlashTime() * 2;
// focus the lineedit and check if it blinks
QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(200, 25));
m_popupTestView = &view;
view.installEventFilter( this );
QTest::qWait(delay);
- QVERIFY2(m_popupTestPaintCount >= 4,
+ QVERIFY2(m_popupTestPaintCount >= 3,
"The input field should have a blinking caret");
}
@@ -2680,7 +2704,7 @@ void tst_QWebFrame::hasSetFocus()
QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool)));
m_page->mainFrame()->setHtml(html);
- QTest::qWait(200);
+ waitForSignal(m_page->mainFrame(), SIGNAL(loadFinished(bool)), 200);
QCOMPARE(loadSpy.size(), 1);
QList<QWebFrame*> children = m_page->mainFrame()->childFrames();
@@ -2690,7 +2714,7 @@ void tst_QWebFrame::hasSetFocus()
"</body></html>");
frame->setHtml(innerHtml);
- QTest::qWait(200);
+ waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(loadSpy.size(), 2);
m_page->mainFrame()->setFocus();
@@ -2769,6 +2793,38 @@ void tst_QWebFrame::scrollPosition()
QCOMPARE(y, 29);
}
+void tst_QWebFrame::scrollToAnchor()
+{
+ QWebPage page;
+ page.setViewportSize(QSize(480, 800));
+ QWebFrame* frame = page.mainFrame();
+
+ QString html("<html><body><p style=\"margin-bottom: 1500px;\">Hello.</p>"
+ "<p><a id=\"foo\">This</a> is an anchor</p>"
+ "<p style=\"margin-bottom: 1500px;\"><a id=\"bar\">This</a> is another anchor</p>"
+ "</body></html>");
+ frame->setHtml(html);
+ frame->setScrollPosition(QPoint(0, 0));
+ QCOMPARE(frame->scrollPosition().x(), 0);
+ QCOMPARE(frame->scrollPosition().y(), 0);
+
+ QWebElement fooAnchor = frame->findFirstElement("a[id=foo]");
+
+ frame->scrollToAnchor("foo");
+ QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().top());
+
+ frame->scrollToAnchor("bar");
+ frame->scrollToAnchor("foo");
+ QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().top());
+
+ frame->scrollToAnchor("top");
+ QCOMPARE(frame->scrollPosition().y(), 0);
+
+ frame->scrollToAnchor("bar");
+ frame->scrollToAnchor("notexist");
+ QVERIFY(frame->scrollPosition().y() != 0);
+}
+
void tst_QWebFrame::evaluateWillCauseRepaint()
{
QWebView view;
@@ -2777,14 +2833,16 @@ void tst_QWebFrame::evaluateWillCauseRepaint()
view.setHtml(html);
view.show();
- QTest::qWait(200);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QTest::qWaitForWindowShown(&view);
+#else
+ QTest::qWait(2000);
+#endif
view.page()->mainFrame()->evaluateJavaScript(
"document.getElementById('junk').style.display = 'none';");
::waitForSignal(view.page(), SIGNAL(repaintRequested(QRect)));
-
- QTest::qWait(2000);
}
class TestFactory : public QObject
@@ -2825,8 +2883,6 @@ void tst_QWebFrame::qObjectWrapperWithSameIdentity()
QCOMPARE(mainFrame->toPlainText(), QString("test2"));
}
-bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy);
-
void tst_QWebFrame::scrollRecursively()
{
// The test content is
@@ -2850,7 +2906,7 @@ void tst_QWebFrame::scrollRecursively()
// verify scrolled
// verify scroll postion changed
QPoint scrollPosition(webPage->mainFrame()->scrollPosition());
- QVERIFY(qtwebkit_webframe_scrollRecursively(webPage->mainFrame(), 10, 10));
+ QVERIFY(webPage->mainFrame()->scrollRecursively(10, 10));
QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition());
// 2nd test
@@ -2860,7 +2916,7 @@ void tst_QWebFrame::scrollRecursively()
// verify parent's scroll position did not change
scrollPosition = webPage->mainFrame()->scrollPosition();
QPoint childScrollPosition = children.at(0)->scrollPosition();
- QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), 10, 10));
+ QVERIFY(children.at(0)->scrollRecursively(10, 10));
QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition());
QVERIFY(childScrollPosition != children.at(0)->scrollPosition());
@@ -2873,7 +2929,7 @@ void tst_QWebFrame::scrollRecursively()
webPage->event(&evpres);
scrollPosition = webPage->mainFrame()->scrollPosition();
childScrollPosition = children.at(0)->scrollPosition();
- QVERIFY(qtwebkit_webframe_scrollRecursively(webPage->mainFrame(), 5, 5));
+ QVERIFY(webPage->mainFrame()->scrollRecursively(5, 5));
QVERIFY(childScrollPosition == children.at(0)->scrollPosition());
QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition());
@@ -2883,13 +2939,55 @@ void tst_QWebFrame::scrollRecursively()
// verify parent's scroll == true second time
// verify parent and childs scroll position changed
childScrollPosition = children.at(0)->scrollPosition();
- QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), -10, -10));
+ QVERIFY(children.at(0)->scrollRecursively(-10, -10));
QVERIFY(childScrollPosition != children.at(0)->scrollPosition());
scrollPosition = webPage->mainFrame()->scrollPosition();
- QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), -10, -10));
+ QVERIFY(children.at(0)->scrollRecursively(-10, -10));
QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition());
}
+void tst_QWebFrame::introspectQtMethods_data()
+{
+ QTest::addColumn<QString>("objectExpression");
+ QTest::addColumn<QString>("methodName");
+ QTest::addColumn<QStringList>("expectedPropertyNames");
+
+ QTest::newRow("myObject.mySignal")
+ << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "length" << "name");
+ QTest::newRow("myObject.mySlot")
+ << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "length" << "name");
+ QTest::newRow("myObject.myInvokable")
+ << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "length" << "name");
+ QTest::newRow("myObject.mySignal.connect")
+ << "myObject.mySignal" << "connect" << (QStringList() << "length" << "name");
+ QTest::newRow("myObject.mySignal.disconnect")
+ << "myObject.mySignal" << "disconnect" << (QStringList() << "length" << "name");
+}
+
+void tst_QWebFrame::introspectQtMethods()
+{
+ QFETCH(QString, objectExpression);
+ QFETCH(QString, methodName);
+ QFETCH(QStringList, expectedPropertyNames);
+
+ QString methodLookup = QString::fromLatin1("%0['%1']").arg(objectExpression).arg(methodName);
+ QCOMPARE(evalJSV(QString::fromLatin1("Object.getOwnPropertyNames(%0).sort()").arg(methodLookup)).toStringList(), expectedPropertyNames);
+
+ for (int i = 0; i < expectedPropertyNames.size(); ++i) {
+ QString name = expectedPropertyNames.at(i);
+ QCOMPARE(evalJS(QString::fromLatin1("%0.hasOwnProperty('%1')").arg(methodLookup).arg(name)), sTrue);
+ evalJS(QString::fromLatin1("var descriptor = Object.getOwnPropertyDescriptor(%0, '%1')").arg(methodLookup).arg(name));
+ QCOMPARE(evalJS("typeof descriptor"), QString::fromLatin1("object"));
+ QCOMPARE(evalJS("descriptor.get"), sUndefined);
+ QCOMPARE(evalJS("descriptor.set"), sUndefined);
+ QCOMPARE(evalJS(QString::fromLatin1("descriptor.value === %0['%1']").arg(methodLookup).arg(name)), sTrue);
+ QCOMPARE(evalJS(QString::fromLatin1("descriptor.enumerable")), sFalse);
+ QCOMPARE(evalJS(QString::fromLatin1("descriptor.configurable")), sFalse);
+ }
+
+ QVERIFY(evalJSV("var props=[]; for (var p in myObject.deleteLater) {props.push(p);}; props.sort()").toStringList().isEmpty());
+}
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc
new file mode 100644
index 0000000..2a7d0b9
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+<file alias="image.png">resources/image.png</file>
+<file alias="style.css">resources/style.css</file>
+<file alias="test1.html">resources/test1.html</file>
+<file alias="test2.html">resources/test2.html</file>
+<file alias="testiframe.html">resources/testiframe.html</file>
+<file alias="testiframe2.html">resources/testiframe2.html</file>
+</qresource>
+</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index 7445e3b..4ca2bf6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -1,12 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebhistory
-include(../../../../WebKit.pri)
-SOURCES += tst_qwebhistory.cpp
-RESOURCES += tst_qwebhistory.qrc
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.UID3 = 0xA000E53B
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri) \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page1.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page1.html
index 82fa4af..82fa4af 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page1.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page1.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page2.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page2.html
index 5307bdc..5307bdc 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page2.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page2.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page3.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page3.html
index 4e5547c..4e5547c 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page3.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page3.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page4.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page4.html
index 3c57aed..3c57aed 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page4.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page4.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page5.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page5.html
index 8593552..8593552 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page5.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page5.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page6.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page6.html
index c5bbc6f..c5bbc6f 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page6.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/resources/page6.html
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 ec2d497..e967dcc 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -37,7 +37,7 @@ public:
protected :
void loadPage(int nr)
{
- frame->load(QUrl("qrc:/data/page" + QString::number(nr) + ".html"));
+ frame->load(QUrl("qrc:/resources/page" + QString::number(nr) + ".html"));
waitForLoadFinished.exec();
}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc
index 7c5ff0e..6e2f50a 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc
@@ -1,11 +1,11 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
- <file>data/page1.html</file>
- <file>data/page2.html</file>
- <file>data/page3.html</file>
- <file>data/page4.html</file>
- <file>data/page5.html</file>
- <file>data/page6.html</file>
+ <file>resources/page1.html</file>
+ <file>resources/page2.html</file>
+ <file>resources/page3.html</file>
+ <file>resources/page4.html</file>
+ <file>resources/page5.html</file>
+ <file>resources/page6.html</file>
</qresource>
</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index 764f806..4ca2bf6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -1,11 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebhistoryinterface
-include(../../../../WebKit.pri)
-SOURCES += tst_qwebhistoryinterface.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.UID3 = 0xA000E53C
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri) \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro
new file mode 100644
index 0000000..e99c7f4
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro
@@ -0,0 +1 @@
+include(../tests.pri)
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
new file mode 100644
index 0000000..12cd630
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
@@ -0,0 +1,68 @@
+/*
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <QtTest/QtTest>
+
+#include <qdir.h>
+#include <qwebinspector.h>
+#include <qwebpage.h>
+#include <qwebsettings.h>
+
+class tst_QWebInspector : public QObject {
+ Q_OBJECT
+
+private slots:
+ void attachAndDestroy();
+};
+
+void tst_QWebInspector::attachAndDestroy()
+{
+ { // External inspector + manual destruction of page first
+ QWebPage* page = new QWebPage();
+ page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ QWebInspector* inspector = new QWebInspector();
+ inspector->setPage(page);
+ page->updatePositionDependentActions(QPoint(0, 0));
+ page->triggerAction(QWebPage::InspectElement);
+
+ delete page;
+ delete inspector;
+ }
+ { // External inspector + manual destruction of inspector first
+ QWebPage* page = new QWebPage();
+ page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ QWebInspector* inspector = new QWebInspector();
+ inspector->setPage(page);
+ page->updatePositionDependentActions(QPoint(0, 0));
+ page->triggerAction(QWebPage::InspectElement);
+
+ delete inspector;
+ delete page;
+ }
+ { // Internal inspector
+ QWebPage page;
+ page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ page.updatePositionDependentActions(QPoint(0, 0));
+ page.triggerAction(QWebPage::InspectElement);
+ }
+}
+
+QTEST_MAIN(tst_QWebInspector)
+
+#include "tst_qwebinspector.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 7853b28..4ca2bf6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -1,13 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebpage
-include(../../../../WebKit.pri)
-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
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri) \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/frame_a.html
index 9ff68f1..9ff68f1 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/frame_a.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe.html
index f17027c..f17027c 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe2.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe2.html
index 5017435..5017435 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe2.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe2.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe3.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe3.html
index ed6ac5b..ed6ac5b 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/iframe3.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/iframe3.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/index.html
index c53ad09..c53ad09 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/resources/index.html
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 0e04acc..ba7a87e 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -19,72 +19,24 @@
Boston, MA 02110-1301, USA.
*/
-
+#include "../util.h"
+#include <QDir>
+#include <QGraphicsWidget>
+#include <QLineEdit>
+#include <QMenu>
+#include <QPushButton>
#include <QtTest/QtTest>
-
#include <qgraphicsscene.h>
#include <qgraphicsview.h>
#include <qgraphicswebview.h>
+#include <qnetworkrequest.h>
+#include <qwebdatabase.h>
#include <qwebelement.h>
-#include <qwebpage.h>
-#include <qwidget.h>
-#include <QGraphicsWidget>
-#include <qwebview.h>
#include <qwebframe.h>
#include <qwebhistory.h>
-#include <qnetworkrequest.h>
-#include <QDebug>
-#include <QLineEdit>
-#include <QMenu>
+#include <qwebpage.h>
#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) \
- do { \
- const int __step = 50; \
- const int __timeout = 5000; \
- if ((__expr) != (__expected)) { \
- QTest::qWait(0); \
- } \
- for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
- QTest::qWait(__step); \
- } \
- QCOMPARE(__expr, __expected); \
- } while(0)
-
-//TESTED_CLASS=
-//TESTED_FILES=
-
-// Task 160192
-/**
- * Starts an event loop that runs until the given signal is received.
- Optionally the event loop
- * can return earlier on a timeout.
- *
- * \return \p true if the requested signal was received
- * \p false on timeout
- */
-static bool waitForSignal(QObject* obj, const char* signal, int timeout = 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();
-}
+#include <qwebview.h>
class EventSpy : public QObject, public QList<QEvent::Type>
{
@@ -148,6 +100,8 @@ private slots:
void inputMethods();
void defaultTextEncoding();
void errorPageExtension();
+ void errorPageExtensionInIFrames();
+ void errorPageExtensionInFrameset();
void crashTests_LazyInitializationOfMainFrame();
@@ -156,6 +110,7 @@ private slots:
void originatingObjectInNetworkRequests();
void testJSPrompt();
+ void showModalDialog();
private:
QWebView* m_view;
@@ -270,10 +225,8 @@ void tst_QWebPage::loadFinished()
"<frame src=\"data:text/html,bar\"></frameset>"), QUrl());
QTRY_COMPARE(spyLoadFinished.count(), 1);
- QTest::qWait(3000);
-
- QVERIFY(spyLoadStarted.count() > 1);
- QVERIFY(spyLoadFinished.count() > 1);
+ QTRY_VERIFY(spyLoadStarted.count() > 1);
+ QTRY_VERIFY(spyLoadFinished.count() > 1);
spyLoadFinished.clear();
@@ -520,7 +473,6 @@ void tst_QWebPage::database()
// Remove removed test :-)
QWebDatabase::removeAllDatabases();
QVERIFY(!origin.databases().size());
- QTest::qWait(1000);
}
class PluginPage : public QWebPage
@@ -1275,7 +1227,7 @@ void tst_QWebPage::backActionUpdate()
QAction *action = page->action(QWebPage::Back);
QVERIFY(!action->isEnabled());
QSignalSpy loadSpy(page, SIGNAL(loadFinished(bool)));
- QUrl url = QUrl("qrc:///frametest/index.html");
+ QUrl url = QUrl("qrc:///resources/index.html");
page->mainFrame()->load(url);
QTRY_COMPARE(loadSpy.count(), 1);
QVERIFY(!action->isEnabled());
@@ -1306,7 +1258,7 @@ void tst_QWebPage::frameAt()
QWebView webView;
QWebPage* webPage = webView.page();
QSignalSpy loadSpy(webPage, SIGNAL(loadFinished(bool)));
- QUrl url = QUrl("qrc:///frametest/iframe.html");
+ QUrl url = QUrl("qrc:///resources/iframe.html");
webPage->mainFrame()->load(url);
QTRY_COMPARE(loadSpy.count(), 1);
frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos());
@@ -1535,10 +1487,17 @@ void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector()
void tst_QWebPage::localURLSchemes()
{
int i = QWebSecurityOrigin::localSchemes().size();
+
QWebSecurityOrigin::removeLocalScheme("file");
QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
QWebSecurityOrigin::addLocalScheme("file");
QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+
+ QWebSecurityOrigin::removeLocalScheme("qrc");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i - 1);
+ QWebSecurityOrigin::addLocalScheme("qrc");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+
QString myscheme = "myscheme";
QWebSecurityOrigin::addLocalScheme(myscheme);
QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i + 1);
@@ -1593,16 +1552,14 @@ void tst_QWebPage::testEnablePersistentStorage()
QWebSettings::enablePersistentStorage();
- // Give it some time to initialize - icon database needs it
- QTest::qWait(1000);
- QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true);
- QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true);
- QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true);
+ QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true);
+ QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true);
+ QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true);
- QVERIFY(!webPage.settings()->offlineStoragePath().isEmpty());
- QVERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty());
- QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
+ QTRY_VERIFY(!webPage.settings()->offlineStoragePath().isEmpty());
+ QTRY_VERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty());
+ QTRY_VERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
}
void tst_QWebPage::defaultTextEncoding()
@@ -1644,15 +1601,10 @@ public:
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;
+ errorPage->content = "data:text/html,error";
+ return true;
}
};
@@ -1663,11 +1615,10 @@ void tst_QWebPage::errorPageExtension()
QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
- page->mainFrame()->load(QUrl("qrc:///frametest/index.html"));
+ m_view->setUrl(QUrl("data:text/html,foo"));
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);
@@ -1676,20 +1627,48 @@ void tst_QWebPage::errorPageExtension()
QCOMPARE(page->history()->canGoForward(), false);
page->triggerAction(QWebPage::Back);
- QTest::qWait(2000);
- QCOMPARE(page->history()->canGoBack(), false);
- QCOMPARE(page->history()->canGoForward(), true);
+ QTRY_COMPARE(page->history()->canGoBack(), false);
+ QTRY_COMPARE(page->history()->canGoForward(), true);
page->triggerAction(QWebPage::Forward);
- QTest::qWait(2000);
- QCOMPARE(page->history()->canGoBack(), true);
- QCOMPARE(page->history()->canGoForward(), false);
+ QTRY_COMPARE(page->history()->canGoBack(), true);
+ QTRY_COMPARE(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"));
+ QTRY_COMPARE(page->history()->canGoBack(), false);
+ QTRY_COMPARE(page->history()->canGoForward(), true);
+ QTRY_COMPARE(page->history()->currentItem().url(), QUrl("data:text/html,foo"));
+
+ m_view->setPage(0);
+}
+
+void tst_QWebPage::errorPageExtensionInIFrames()
+{
+ ErrorPage* page = new ErrorPage;
+ m_view->setPage(page);
+
+ m_view->setHtml(QString("data:text/html,"
+ "<h1>h1</h1>"
+ "<iframe src='data:text/html,<p/>p'></iframe>"
+ "<iframe src='non-existent.html'></iframe>"));
+ QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
+ QTRY_COMPARE(spyLoadFinished.count(), 1);
+
+ QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("data:text/html,error"));
+
+ m_view->setPage(0);
+}
+
+void tst_QWebPage::errorPageExtensionInFrameset()
+{
+ ErrorPage* page = new ErrorPage;
+ m_view->setPage(page);
+
+ m_view->load(QUrl("qrc:///resources/index.html"));
+
+ QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
+ QTRY_COMPARE(spyLoadFinished.count(), 1);
+ QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("data:text/html,error"));
m_view->setPage(0);
}
@@ -1734,17 +1713,17 @@ void tst_QWebPage::screenshot_data()
void tst_QWebPage::screenshot()
{
- QDir::setCurrent(SRCDIR);
+ if (!QDir(TESTS_SOURCE_DIR).exists())
+ QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+
+ QDir::setCurrent(TESTS_SOURCE_DIR);
QFETCH(QString, html);
QWebPage* page = new QWebPage;
page->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
QWebFrame* mainFrame = page->mainFrame();
- mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
- if (html.contains("</embed>")) {
- // some reasonable time for the PluginStream to feed test.swf to flash and start painting
- QTest::qWait(2000);
- }
+ mainFrame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
+ ::waitForSignal(mainFrame, SIGNAL(loadFinished(bool)), 2000);
// take screenshot without a view
takeScreenshot(page);
@@ -1850,5 +1829,26 @@ void tst_QWebPage::testJSPrompt()
QVERIFY(res);
}
+class TestModalPage : public QWebPage
+{
+ Q_OBJECT
+public:
+ TestModalPage(QObject* parent = 0) : QWebPage(parent) {
+ }
+ virtual QWebPage* createWindow(WebWindowType) {
+ QWebPage* page = new TestModalPage();
+ connect(page, SIGNAL(windowCloseRequested()), page, SLOT(deleteLater()));
+ return page;
+ }
+};
+
+void tst_QWebPage::showModalDialog()
+{
+ TestModalPage page;
+ page.mainFrame()->setHtml(QString("<html></html>"));
+ QString res = page.mainFrame()->evaluateJavaScript("window.showModalDialog('javascript:window.returnValue=dialogArguments; window.close();', 'This is a test');").toString();
+ QCOMPARE(res, QString("This is a test"));
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc
index 3085ce2..0627cb4 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc
@@ -1,10 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
- <file>frametest/index.html</file>
- <file>frametest/frame_a.html</file>
- <file>frametest/iframe.html</file>
- <file>frametest/iframe2.html</file>
- <file>frametest/iframe3.html</file>
+ <file>resources/index.html</file>
+ <file>resources/frame_a.html</file>
+ <file>resources/iframe.html</file>
+ <file>resources/iframe2.html</file>
+ <file>resources/iframe3.html</file>
</qresource>
</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
index 569146a..e99c7f4 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -1,11 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebplugindatabase
-include(../../../../WebKit.pri)
-SOURCES += tst_qwebplugindatabase.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.UID3 = 0xA000E540
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
index 735537b..4ca2bf6 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
@@ -1,13 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebview
-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
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri) \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/frame_a.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/frame_a.html
index 9ff68f1..9ff68f1 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/frame_a.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/frame_a.html
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/index.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/index.html
index c53ad09..c53ad09 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/frametest/index.html
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/index.html
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 27daf38..ebcf4bb 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -30,6 +30,8 @@
#include <qwebkitversion.h>
#include <qwebframe.h>
+#include <QDebug>
+
class tst_QWebView : public QObject
{
Q_OBJECT
@@ -121,7 +123,10 @@ void tst_QWebView::reusePage_data()
void tst_QWebView::reusePage()
{
- QDir::setCurrent(SRCDIR);
+ if (!QDir(TESTS_SOURCE_DIR).exists())
+ QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+
+ QDir::setCurrent(TESTS_SOURCE_DIR);
QFETCH(QString, html);
QWebView* view1 = new QWebView;
@@ -129,21 +134,29 @@ void tst_QWebView::reusePage()
view1->setPage(page);
page->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
QWebFrame* mainFrame = page->mainFrame();
- mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+ mainFrame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
if (html.contains("</embed>")) {
// some reasonable time for the PluginStream to feed test.swf to flash and start painting
- QTest::qWait(2000);
+ waitForSignal(view1, SIGNAL(loadFinished(bool)), 2000);
}
view1->show();
- QTest::qWait(2000);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QTest::qWaitForWindowShown(view1);
+#else
+ QTest::qWait(2000);
+#endif
delete view1;
QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
QWebView *view2 = new QWebView;
view2->setPage(page);
view2->show(); // in Windowless mode, you should still be able to see the plugin here
- QTest::qWait(2000);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QTest::qWaitForWindowShown(view2);
+#else
+ QTest::qWait(2000);
+#endif
delete view2;
delete page; // must not crash
@@ -185,7 +198,7 @@ void tst_QWebView::crashTests()
// Test page should have frames.
QWebView view;
WebViewCrashTest tester(&view);
- QUrl url("qrc:///data/index.html");
+ QUrl url("qrc:///resources/index.html");
view.load(url);
QTRY_VERIFY(tester.m_executed); // If fail it means that the test wasn't executed.
}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc
index ede34a9..5abc64c 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc
@@ -1,7 +1,7 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
- <file>data/index.html</file>
- <file>data/frame_a.html</file>
+ <file>resources/index.html</file>
+ <file>resources/frame_a.html</file>
</qresource>
</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png b/src/3rdparty/webkit/WebKit/qt/tests/resources/image2.png
index 8d70364..8d70364 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png
+++ b/src/3rdparty/webkit/WebKit/qt/tests/resources/image2.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pri b/src/3rdparty/webkit/WebKit/qt/tests/tests.pri
new file mode 100644
index 0000000..187950a
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pri
@@ -0,0 +1,23 @@
+TEMPLATE = app
+CONFIG -= app_bundle
+
+TARGET = tst_$$TARGET
+SOURCES += $$_PRO_FILE_PWD_/$${TARGET}.cpp
+INCLUDEPATH += \
+ $$PWD \
+ $$PWD/../Api
+
+exists($$_PRO_FILE_PWD_/$${TARGET}.qrc):RESOURCES += $$_PRO_FILE_PWD_/$${TARGET}.qrc
+
+include(../../../WebKit.pri)
+QT += testlib network
+
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
+
+# This define is used by some tests to look up resources in the source tree
+!symbian: DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
+
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
index 939cd22..5e19202 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 qwebview qwebhistory
-greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro
+SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector hybridPixmap
+greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting benchmarks/loading
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/util.h b/src/3rdparty/webkit/WebKit/qt/tests/util.h
index 7f7e613..c61bc6b 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/util.h
+++ b/src/3rdparty/webkit/WebKit/qt/tests/util.h
@@ -18,6 +18,37 @@
*/
// Functions and macros that really need to be in QTestLib
+#include <QEventLoop>
+#include <QSignalSpy>
+#include <QTimer>
+
+#if !defined(TESTS_SOURCE_DIR)
+#define TESTS_SOURCE_DIR ""
+#endif
+
+/**
+ * Starts an event loop that runs until the given signal is received.
+ * Optionally the event loop
+ * can return earlier on a timeout.
+ *
+ * \return \p true if the requested signal was received
+ * \p false on timeout
+ */
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
+{
+ QEventLoop loop;
+ QObject::connect(obj, signal, &loop, SLOT(quit()));
+ QTimer timer;
+ QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
+ if (timeout > 0) {
+ QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.setSingleShot(true);
+ timer.start(timeout);
+ }
+ loop.exec();
+ return timeoutSpy.isEmpty();
+}
+
// Will try to wait for the condition while allowing event processing
#define QTRY_VERIFY(__expr) \
do { \
@@ -45,4 +76,3 @@
} \
QCOMPARE(__expr, __expected); \
} while(0)
-