summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/qt
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebKit/qt
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebKit/qt')
-rw-r--r--Source/WebKit/qt/Api/qwebframe.cpp19
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp23
-rw-r--r--Source/WebKit/qt/Api/qwebpage.h1
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.cpp2
-rw-r--r--Source/WebKit/qt/ChangeLog474
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp6
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h3
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp5
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DragClientQt.h1
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp57
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h4
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp82
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h3
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp46
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h23
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp122
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h66
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp152
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h3
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp4
-rw-r--r--Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp5
-rw-r--r--Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h1
-rw-r--r--Source/WebKit/qt/declarative/declarative.pro2
-rw-r--r--Source/WebKit/qt/declarative/qdeclarativewebview.cpp26
-rw-r--r--Source/WebKit/qt/declarative/qdeclarativewebview_p.h2
-rw-r--r--Source/WebKit/qt/docs/docs.pri2
-rw-r--r--Source/WebKit/qt/docs/qtwebkit.qdoc19
-rw-r--r--Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp58
-rw-r--r--Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp62
-rw-r--r--Source/WebKit/qt/tests/tests.pri2
32 files changed, 1093 insertions, 186 deletions
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp
index 391ff26..dce0137 100644
--- a/Source/WebKit/qt/Api/qwebframe.cpp
+++ b/Source/WebKit/qt/Api/qwebframe.cpp
@@ -357,11 +357,10 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame:
view->updateLayoutAndStyleIfNeededRecursive();
if (layer & QWebFrame::ContentsLayer) {
- painter->save();
for (int i = 0; i < vector.size(); ++i) {
const QRect& clipRect = vector.at(i);
- QRect intersectedRect = clipRect.intersected(view->frameRect());
+ QRect rect = clipRect.intersected(view->frameRect());
context->save();
painter->setClipRect(clipRect, Qt::IntersectClip);
@@ -372,7 +371,6 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame:
int scrollX = view->scrollX();
int scrollY = view->scrollY();
- QRect rect = intersectedRect;
context->translate(x, y);
rect.translate(-x, -y);
context->translate(-scrollX, -scrollY);
@@ -383,7 +381,6 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame:
context->restore();
}
- painter->restore();
#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
renderCompositedLayers(context, IntRect(clip.boundingRect()));
#endif
@@ -403,15 +400,13 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame:
if (layer & QWebFrame::ScrollBarLayer
&& !view->scrollbarsSuppressed()
&& (view->horizontalScrollbar() || view->verticalScrollbar())) {
- context->save();
-
QRect rect = intersectedRect;
context->translate(x, y);
rect.translate(-x, -y);
view->paintScrollbars(context, rect);
- context->restore();
+ context->translate(-x, -y);
}
#if ENABLE(PAN_SCROLLING)
@@ -754,14 +749,14 @@ static inline QUrl ensureAbsoluteUrl(const QUrl &url)
void QWebFrame::setUrl(const QUrl &url)
{
const QUrl absolute = ensureAbsoluteUrl(url);
- d->frame->loader()->writer()->begin(absolute);
- d->frame->loader()->writer()->end();
+ d->frame->loader()->activeDocumentLoader()->writer()->begin(absolute);
+ d->frame->loader()->activeDocumentLoader()->writer()->end();
load(absolute);
}
QUrl QWebFrame::url() const
{
- return d->frame->loader()->url();
+ return d->frame->document()->url();
}
/*!
@@ -817,7 +812,7 @@ QUrl QWebFrame::baseUrl() const
QIcon QWebFrame::icon() const
{
- return QWebSettings::iconForUrl(d->frame->loader()->url());
+ return QWebSettings::iconForUrl(d->frame->document()->url());
}
/*!
@@ -1309,7 +1304,7 @@ QPoint QWebFrame::pos() const
if (!d->frame->view())
return QPoint();
- return d->frame->view()->frameRect().topLeft();
+ return d->frame->view()->frameRect().location();
}
/*!
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index e80aac5..075756d 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -162,6 +162,7 @@ static const char* editorCommandWebActions[] =
0, // OpenImageInNewWindow,
0, // DownloadImageToDisk,
0, // CopyImageToClipboard,
+ 0, // CopyImageUrlToClipboard,
0, // Back,
0, // Forward,
@@ -404,6 +405,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow;
case WebCore::ContextMenuItemTagDownloadImageToDisk: return QWebPage::DownloadImageToDisk;
case WebCore::ContextMenuItemTagCopyImageToClipboard: return QWebPage::CopyImageToClipboard;
+ case WebCore::ContextMenuItemTagCopyImageUrlToClipboard: return QWebPage::CopyImageUrlToClipboard;
case WebCore::ContextMenuItemTagOpenFrameInNewWindow: return QWebPage::OpenFrameInNewWindow;
case WebCore::ContextMenuItemTagCopy: return QWebPage::Copy;
case WebCore::ContextMenuItemTagGoBack: return QWebPage::Back;
@@ -431,7 +433,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMenu,
const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions)
{
- if (!client)
+ if (!client || !webcoreMenu)
return 0;
QMenu* menu = new QMenu(client->ownerWidget());
@@ -1680,6 +1682,7 @@ IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoi
\value OpenImageInNewWindow Open the highlighted image in a new window.
\value DownloadImageToDisk Download the highlighted image to the disk.
\value CopyImageToClipboard Copy the highlighted image to the clipboard.
+ \value CopyImageUrlToClipboard Copy the highlighted image's URL to the clipboard.
\value Back Navigate back in the history of navigated links.
\value Forward Navigate forward in the history of navigated links.
\value Stop Stop loading the current page.
@@ -1883,9 +1886,10 @@ QWebPage::ViewportAttributes& QWebPage::ViewportAttributes::operator=(const QWeb
The loadStarted() signal is emitted when the page begins to load.The
loadProgress() signal, on the other hand, is emitted whenever an element
of the web page completes loading, such as an embedded image, a script,
- etc. Finally, the loadFinished() signal is emitted when the page has
- loaded completely. Its argument, either true or false, indicates whether
- or not the load operation succeeded.
+ etc. Finally, the loadFinished() signal is emitted when the page contents
+ are loaded completely, independent of script execution or page rendering.
+ Its argument, either true or false, indicates whether or not the load
+ operation succeeded.
\section1 Using QWebPage in a Widget-less Environment
@@ -2342,6 +2346,9 @@ void QWebPage::triggerAction(WebAction action, bool)
case CopyImageToClipboard:
QApplication::clipboard()->setPixmap(d->hitTestResult.pixmap());
break;
+ case CopyImageUrlToClipboard:
+ QApplication::clipboard()->setText(d->hitTestResult.imageUrl().toString());
+ break;
#endif
case Back:
d->page->goBack();
@@ -2730,6 +2737,9 @@ QAction *QWebPage::action(WebAction action) const
case CopyImageToClipboard:
text = contextMenuItemTagCopyImageToClipboard();
break;
+ case CopyImageUrlToClipboard:
+ text = contextMenuItemTagCopyImageUrlToClipboard();
+ break;
case Back:
text = contextMenuItemTagGoBack();
@@ -3979,7 +3989,7 @@ quint64 QWebPage::bytesReceived() const
/*!
\fn void QWebPage::loadStarted()
- This signal is emitted when a new load of the page is started.
+ This signal is emitted when a page starts loading content.
\sa loadFinished()
*/
@@ -3998,7 +4008,8 @@ quint64 QWebPage::bytesReceived() const
/*!
\fn void QWebPage::loadFinished(bool ok)
- This signal is emitted when a load of the page is finished.
+ This signal is emitted when the page finishes loading content. This signal
+ is independant of script execution or page rendering.
\a ok will indicate whether the load was successful or any error occurred.
\sa loadStarted(), ErrorPageExtension
diff --git a/Source/WebKit/qt/Api/qwebpage.h b/Source/WebKit/qt/Api/qwebpage.h
index b66adb2..e12b460 100644
--- a/Source/WebKit/qt/Api/qwebpage.h
+++ b/Source/WebKit/qt/Api/qwebpage.h
@@ -105,6 +105,7 @@ public:
OpenImageInNewWindow,
DownloadImageToDisk,
CopyImageToClipboard,
+ CopyImageUrlToClipboard,
Back,
Forward,
diff --git a/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp
index 9bb187e..e2d6061 100644
--- a/Source/WebKit/qt/Api/qwebsettings.cpp
+++ b/Source/WebKit/qt/Api/qwebsettings.cpp
@@ -171,7 +171,7 @@ void QWebSettingsPrivate::apply()
settings->setAcceleratedCompositingEnabled(value);
#endif
-#if ENABLE(3D_CANVAS)
+#if ENABLE(WEBGL)
value = attributes.value(QWebSettings::WebGLEnabled,
global->attributes.value(QWebSettings::WebGLEnabled));
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index aec5b45..e4c8cef 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,477 @@
+2011-02-11 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] wmode gets overridden even if already windowless in QGraphicsWebView
+ Do not override wmode if it is not set to "window".
+ https://bugs.webkit.org/show_bug.cgi?id=50495
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2011-02-10 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Update calls to DocumentWriter.
+ https://bugs.webkit.org/show_bug.cgi?id=50489
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setUrl):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::finishedLoading):
+
+2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Ensure WebView press delay timer is cancelled when grab is taken
+ https://bugs.webkit.org/show_bug.cgi?id=54242
+
+ As reported in:
+ http://bugreports.qt.nokia.com/browse/QTBUG-15529
+
+ Flickable steals the grab, but the timer was not stopped and the
+ keepGrab flag is set and the mouse grabbed. This means that the WebView
+ now has the grab and subsequent clicks on another element are ignored.
+
+ Original patch from Martin Jones <martin.jones@nokia.com>
+ reviewed (there) by Joona Petrell
+ 52068f57f9c32098a90cc217730a530f85590f65
+
+ * declarative/qdeclarativewebview.cpp:
+ (GraphicsWebView::sceneEvent):
+ * declarative/qdeclarativewebview_p.h:
+
+2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fix assert in QDeclarativeWebView
+ https://bugs.webkit.org/show_bug.cgi?id=54240
+
+ As reported in:
+ http://bugreports.qt.nokia.com/browse/QTBUG-14278
+
+ Instantiating a QDeclarativeWebView twice will trigger an assertion
+ when in debug mode.
+
+ Original patch from Thomas Hartmann <Thomas.Hartmann@nokia.com>,
+ reviewed (there) by Aaron Kennedy
+ f532679ca11914b453e22342f2ae5e9f790ce47a
+
+ * declarative/qdeclarativewebview.cpp:
+ (QDeclarativeWebView::init):
+
+2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Misc documentation fixes/updates
+ https://bugs.webkit.org/show_bug.cgi?id=54236
+
+ There are a few commits in the Qt repository (master and 4.7 branches)
+ with QtWebKit documentation fixes:
+
+ 84d278501a19eaccf9a77cccd95ca5d17a2dcd2b
+ Clarified documentation of loadFinished() signal
+
+ eebe205b306daaa3674d9746de11a73bef4bd0de
+ Doc: Fixed QML, unindented snippet
+
+ b0d64717d2c541976dc5524e4100c62f060e206f
+ doc: Changed a table into 3 tables to eliminate a \raw.
+
+ As these are all minor doc changes, I decided to group them
+ into one single patch.
+
+ * Api/qwebpage.cpp:
+ * declarative/qdeclarativewebview.cpp:
+ * docs/qtwebkit.qdoc:
+
+2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Remove the use of deprecated qVariant*
+ https://bugs.webkit.org/show_bug.cgi?id=54229
+
+ This was applied on the Qt repository and affects QtWebKit there.
+ (633f3f45e5420663cf4ceadea79e62fea44cd2eb)
+
+ The side effect of this change is that we won't be able to build
+ QtWebKit with MSVC 6, as it doesn't support member template functions
+ (not sure if it's possible today anyway).
+
+ Original patch from Olivier Goffart <olivier.goffart@nokia.com>, with
+ review reported as being from the mailing list.
+
+ The changes are result of the following commands:
+
+ git grep -O"sed -i 's/qVariantValue</qvariant_cast</'" qVariantValue
+ git grep -O"sed -i 's/qVariantSetValue(\([^&*\(),]*\), */\\1.setValue(/'" qVariantSetValue
+ git grep -O"sed -i 's/qVariantSetValue *<\([^>]*\)> *(\([^&*\(),]*\), */\\2.setValue<\\1>(/'" qVariantSetValue
+ git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert
+ git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*([^&*\(),]*)\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert
+ git grep -O"sed -i 's/qVariantFromValue\( *[(<]\)/QVariant::fromValue\\1/'" qVariantFromValue
+
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::nodesFromRect):
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (MyQObject::myInvokableWithQObjectListArg):
+ (MyQObject::myInvokableWithListOfIntArg):
+ (MyQObject::myInvokableWithQObjectStarArg):
+ (MyQObject::myInvokableWithQBrushArg):
+ (MyQObject::myInvokableWithBrushStyleArg):
+ (MyQObject::myInvokableWithVoidStarArg):
+ (MyQObject::myInvokableWithAmbiguousArg):
+ (MyQObject::myInvokableWithDefaultArgs):
+ (MyQObject::myInvokableWithPointArg):
+ (MyQObject::myOverloadedSlot):
+
+2011-02-10 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Return menu items from eventSender.contextMenu()
+ https://bugs.webkit.org/show_bug.cgi?id=53039
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (iterateContextMenu):
+ (DumpRenderTreeSupportQt::contextMenu):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2011-02-10 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] In trunk with Qt Multimedia the full screen mode doesn't work.
+ https://bugs.webkit.org/show_bug.cgi?id=54201
+
+ Add a default fullscreen handler when there is no plaftform plugin
+ installed. This handler creates a fullscreen QVideoWidget and plays
+ the video. Space pause/resume the video playback and esc quit the
+ fullscreen mode.
+
+ * WebCoreSupport/FullScreenVideoQt.cpp:
+ (WebCore::DefaultFullScreenVideoHandler::DefaultFullScreenVideoHandler):
+ (WebCore::DefaultFullScreenVideoHandler::~DefaultFullScreenVideoHandler):
+ (WebCore::DefaultFullScreenVideoHandler::requiresFullScreenForVideoPlayback):
+ (WebCore::DefaultFullScreenVideoHandler::enterFullScreen):
+ (WebCore::DefaultFullScreenVideoHandler::exitFullScreen):
+ (WebCore::FullScreenVideoQt::FullScreenVideoQt):
+ * WebCoreSupport/FullScreenVideoQt.h:
+ * WebCoreSupport/FullScreenVideoWidget.cpp: Added.
+ (WebCore::FullScreenVideoWidget::FullScreenVideoWidget):
+ (WebCore::FullScreenVideoWidget::~FullScreenVideoWidget):
+ (WebCore::FullScreenVideoWidget::show):
+ (WebCore::FullScreenVideoWidget::closeEvent):
+ (WebCore::FullScreenVideoWidget::event):
+ (WebCore::FullScreenVideoWidget::keyPressEvent):
+ (WebCore::FullScreenVideoWidget::hideCursor):
+ (WebCore::FullScreenVideoWidget::showCursor):
+ * WebCoreSupport/FullScreenVideoWidget.h: Added.
+
+2011-02-10 kasthuri <kasthuri.n-s@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] QWebFrame::setHtml doesn't emit loadFinished signal
+ https://bugs.webkit.org/show_bug.cgi?id=38634
+
+ QWebView->page()->mainFrame()->setHtml(html) is always emitting
+ the loadFinished() signal for all types of html files.
+ But the proposed test content was trying to catch the signal after
+ calling setHtml() api and becuase of this the emitted signal for a
+ simple html page is never caught as its emitted before even the connect
+ call was successful.
+
+ updated the tst_QWebFrame::setHtml() in tst_qwebframe.cpp to check for
+ signal using the QSignalSpy.
+
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2011-02-09 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [Qt] REGRESSION (r73535): tst_QWebPage fails
+ https://bugs.webkit.org/show_bug.cgi?id=51331
+
+ Since r73535 a ContextMenu is only created when a context menu
+ event is received, so QWebPage::updatePositionDependentActions()
+ can't depend on one being there if it is called directly by
+ the client. QtWebKit itself only ever calls updatePositionDependentActions()
+ when a context menu event has been received.
+
+ Update tst_QWebPage:contextMenuCrash to create a context menu.
+ Add tst_QWebPage:updatePositionDependentActionsCrash to test for this crash.
+
+ There doesn't seem to be a good reason for creating a context menu if
+ clients call QWebPage::updatePositionDependentActions() when no
+ context menu event has ever been received.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::createContextMenu):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::contextMenuCrash):
+
+2011-02-09 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] fast/dom/nodesFromRect-links-and-text.html crashes in debug mode
+ https://bugs.webkit.org/show_bug.cgi?id=53921
+
+ QDRTNode needs a copy constructor and an operator= in order to keep
+ proper refcounts.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (:m_node):
+ (QDRTNode::operator=):
+ (DumpRenderTreeSupportQt::nodesFromRect):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2011-02-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove orphan code from old parser
+ https://bugs.webkit.org/show_bug.cgi?id=53984
+
+ * WebCoreSupport/ChromeClientQt.h:
+
+2011-02-07 Aparna Nandyal <aparna.nand@wipro.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] - Context menu needs "Copy" as well when the selected text is a link.
+ https://bugs.webkit.org/show_bug.cgi?id=40983
+
+ Added a test case to create a context sensitive menu.
+ A check is made if it has Copy menu item when user
+ selects a link and opens context menu.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::contextMenuCopy):
+
+2011-02-07 Benjamin Poulain <ikipou@gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] cookiesEnabled could create the cookieJar on the wrong thread.
+ https://bugs.webkit.org/show_bug.cgi?id=52289
+
+ Test if the cookie jar is created in the right thread when accessed from
+ the navigator object.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::navigatorCookieEnabledForNetworkAccessManagerOnDifferentThread):
+
+2011-02-07 Qi Zhang <qi.2.zhang@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
+ https://bugs.webkit.org/show_bug.cgi?id=52974
+
+ Add QWebPage::CopyImageUrlToClipboard into QWebPage::WebAction.
+
+ * Api/qwebpage.cpp:
+ (webActionForContextMenuAction):
+ (QWebPage::triggerAction):
+ (QWebPage::action):
+ * Api/qwebpage.h:
+ * WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard):
+ * WebCoreSupport/WebPlatformStrategies.h:
+
+2011-02-07 Enrica Casucci <enrica@apple.com>
+
+ Reviewed Adam Roben and Darin Adler.
+
+ WebKit2: drag and drop support on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=52775
+
+ Removed createDragImageForLink from DragClient.
+
+ * WebCoreSupport/DragClientQt.cpp:
+ * WebCoreSupport/DragClientQt.h:
+
+2011-02-06 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Remove unnecessary QRect assignment
+ https://bugs.webkit.org/show_bug.cgi?id=53873
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::renderRelativeCoords):
+
+2011-02-06 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Clear page's groupName even when not in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=53874
+
+ Matches behaviour of other ports.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::closeWindowSoon):
+
+2011-02-03 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: remove settings related methods from InspectorClient
+ https://bugs.webkit.org/show_bug.cgi?id=53686
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorFrontendClientQt::InspectorFrontendClientQt):
+ * WebCoreSupport/InspectorClientQt.h:
+
+2011-02-03 Adam Langley <agl@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Plumb mixed script URL to FrameLoaderClient
+ https://bugs.webkit.org/show_bug.cgi?id=52384
+
+ Regressions covered by http/tests/security/mixedContent/*
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didRunInsecureContent):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2011-02-01 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed Qt buildfix after r77286.
+
+ https://bugs.webkit.org/show_bug.cgi?id=53520
+ Remove the physical terminology from IntRect and FloatRect.
+
+ * WebCoreSupport/PopupMenuQt.cpp:
+ (WebCore::PopupMenuQt::show):
+
+2011-01-31 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QWebElements example from QtWebKit Bridge documentation does not work at all
+ https://bugs.webkit.org/show_bug.cgi?id=46748
+
+ Problem was that we need to register QWebElement's variant-type to Qt's meta type system at some point.
+ This wasn't caught by previous tests inside tst_QWebFrame because it only appears when there's also a QWebElement property.
+ Added a regression test to tst_QWebFrame.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (MyWebElementSlotOnlyObject::doSomethingWithWebElement):
+ (MyWebElementSlotOnlyObject::tagName):
+
+2011-01-31 Srikumar Bonda <srikumar.b@gmail.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] ContextMenuClientQt.cpp has coding-style errors
+ "RefCounted.h" header inclusion style changed to <wtf/RefCounted.h>
+ https://bugs.webkit.org/show_bug.cgi?id=40243
+
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+
+2011-01-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <select> can't display right-to-left (rtl) languages
+ https://bugs.webkit.org/show_bug.cgi?id=19785
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::selectItemAlignmentFollowsMenuWritingDirection): Added.
+ * WebCoreSupport/ChromeClientQt.h:
+
+2011-01-27 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Use Document::url() instead of FrameLoader::url().
+ https://bugs.webkit.org/show_bug.cgi?id=41165
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::url):
+
+2011-01-27 Robert Hogan <robert@webkit.org>
+
+ Rubber-stamped by Andreas Kling.
+
+ [Qt] Style Fix: correct indentation in FrameLoadeClientQt:createPlugin
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2011-01-24 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ Change ENABLE_3D_CANVAS to ENABLE_WEBGL
+ https://bugs.webkit.org/show_bug.cgi?id=53041
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+
+2011-01-24 Renata Hodovan <reni@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] QWebFramePrivate::renderRelativeCoords() calls QPainter::save/restore more than necessary
+ https://bugs.webkit.org/show_bug.cgi?id=49915
+
+ In the first loop of renderRelativeCoords() the call of QPainter::save/restore is useless, because
+ the context is saved/stored within the loop.
+ In the second loop the calls are also avoidable by using inverse translation on context.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::renderRelativeCoords):
+
+2011-01-24 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [Qt] Move project files into Source
+ https://bugs.webkit.org/show_bug.cgi?id=52891
+
+ * declarative/declarative.pro:
+ * docs/docs.pri:
+ * tests/tests.pri:
+
+2011-01-22 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: next step in splitting InspectorController.
+
+ #include "InspectorController.h" was added.
+
+ https://bugs.webkit.org/show_bug.cgi?id=52955
+
+ * WebCoreSupport/InspectorServerQt.cpp:
+
+2011-01-22 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Support layoutTestController.addURLToRedirect()
+ https://bugs.webkit.org/show_bug.cgi?id=52956
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::addURLToRedirect):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
2011-01-21 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index acb136a..b7a0350 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -307,6 +307,7 @@ bool ChromeClientQt::runBeforeUnloadConfirmPanel(const String& message, Frame* f
void ChromeClientQt::closeWindowSoon()
{
+ m_webPage->d->page->setGroupName(String());
m_webPage->mainFrame()->d->frame->loader()->stopAllLoaders();
emit m_webPage->windowCloseRequested();
}
@@ -736,6 +737,11 @@ bool ChromeClientQt::selectItemWritingDirectionIsNatural()
return false;
}
+bool ChromeClientQt::selectItemAlignmentFollowsMenuWritingDirection()
+{
+ return false;
+}
+
PassRefPtr<PopupMenu> ChromeClientQt::createPopupMenu(PopupMenuClient* client) const
{
return adoptRef(new PopupMenuQt(client, this));
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index d8c2f57..684ece8 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -179,8 +179,6 @@ namespace WebCore {
virtual void formStateDidChange(const Node*) { }
- virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
-
virtual void setCursor(const Cursor&);
virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
@@ -189,6 +187,7 @@ namespace WebCore {
virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*);
virtual bool selectItemWritingDirectionIsNatural();
+ virtual bool selectItemAlignmentFollowsMenuWritingDirection();
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
virtual void populateVisitedLinks();
diff --git a/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
index b4400ff..29180e0 100644
--- a/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
@@ -29,8 +29,8 @@
#include "ContextMenu.h"
#include "HitTestResult.h"
#include "KURL.h"
-#include "RefCounted.h"
#include "NotImplemented.h"
+#include <wtf/RefCounted.h>
#include <stdio.h>
diff --git a/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp
index f136328..8996b52 100644
--- a/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp
@@ -110,9 +110,4 @@ void DragClientQt::startDrag(DragImageRef dragImage, const IntPoint&, const IntP
}
-DragImageRef DragClientQt::createDragImageForLink(KURL&, const String&, Frame*)
-{
- return 0;
-}
-
} // namespace WebCore
diff --git a/Source/WebKit/qt/WebCoreSupport/DragClientQt.h b/Source/WebKit/qt/WebCoreSupport/DragClientQt.h
index 4c83191..38b463b 100644
--- a/Source/WebKit/qt/WebCoreSupport/DragClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/DragClientQt.h
@@ -37,7 +37,6 @@ public:
virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&);
virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*);
virtual void startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false);
- virtual DragImageRef createDragImageForLink(KURL&, const String& label, Frame*);
private:
QWebPage* m_webPage;
};
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index a7a495a..1b6a4d4 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -104,6 +104,26 @@ QDRTNode::~QDRTNode()
m_node->deref();
}
+QDRTNode::QDRTNode(const QDRTNode& other)
+ :m_node(other.m_node)
+{
+ if (m_node)
+ m_node->ref();
+}
+
+QDRTNode& QDRTNode::operator=(const QDRTNode& other)
+{
+ if (this != &other) {
+ Node* otherNode = other.m_node;
+ if (otherNode)
+ otherNode->ref();
+ if (m_node)
+ m_node->deref();
+ m_node = otherNode;
+ }
+ return *this;
+}
+
DumpRenderTreeSupportQt::DumpRenderTreeSupportQt()
{
@@ -875,13 +895,11 @@ QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document,
return res;
RefPtr<NodeList> nodes = doc->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
for (int i = 0; i < nodes->length(); i++) {
- QVariant v;
// QWebElement will be null if the Node is not an HTML Element
if (nodes->item(i)->isHTMLElement())
- v.setValue(QWebElement(nodes->item(i)));
+ res << QVariant::fromValue(QWebElement(nodes->item(i)));
else
- v.setValue(QDRTNode(nodes->item(i)));
- res << v;
+ res << QVariant::fromValue(QDRTNode(nodes->item(i)));
}
return res;
}
@@ -893,6 +911,37 @@ QString DumpRenderTreeSupportQt::responseMimeType(QWebFrame* frame)
return docLoader->responseMIMEType();
}
+void DumpRenderTreeSupportQt::addURLToRedirect(const QString& origin, const QString& destination)
+{
+ FrameLoaderClientQt::URLsToRedirect[origin] = destination;
+}
+
+static QStringList iterateContextMenu(QMenu* menu)
+{
+ if (!menu)
+ return QStringList();
+
+ QStringList items;
+ QList<QAction *> actions = menu->actions();
+ for (int i = 0; i < actions.count(); ++i) {
+ if (actions.at(i)->isSeparator())
+ items << QLatin1String("<separator>");
+ else
+ items << actions.at(i)->text();
+ if (actions.at(i)->menu())
+ items << iterateContextMenu(actions.at(i)->menu());
+ }
+ return items;
+}
+
+QStringList DumpRenderTreeSupportQt::contextMenu(QWebPage* page)
+{
+#ifndef QT_NO_CONTEXTMENU
+ return iterateContextMenu(page->d->currentContextMenu);
+#else
+ return QStringList();
+#endif
+}
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index dd84e76..685d724 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -58,6 +58,8 @@ extern QMap<int, QWebScriptWorld*> m_worldMap;
class QWEBKIT_EXPORT QDRTNode {
public:
QDRTNode();
+ QDRTNode(const QDRTNode&);
+ QDRTNode &operator=(const QDRTNode&);
~QDRTNode();
private:
@@ -185,6 +187,8 @@ public:
static QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
static QString responseMimeType(QWebFrame*);
+ static void addURLToRedirect(const QString& origin, const QString& destination);
+ static QStringList contextMenu(QWebPage*);
};
#endif
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 474b768..22e2ac9 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -180,6 +180,7 @@ QStringList FrameLoaderClientQt::sendRequestClearHeaders;
QString FrameLoaderClientQt::dumpResourceLoadCallbacksPath;
bool FrameLoaderClientQt::policyDelegateEnabled = false;
bool FrameLoaderClientQt::policyDelegatePermissive = false;
+QMap<QString, QString> FrameLoaderClientQt::URLsToRedirect = QMap<QString, QString>();
// Taken from DumpRenderTree/chromium/WebViewHost.cpp
static const char* navigationTypeToString(NavigationType type)
@@ -629,7 +630,7 @@ void FrameLoaderClientQt::finishedLoading(DocumentLoader* loader)
// However, we only want to do this if makeRepresentation has been called, to
// match the behavior on the Mac.
if (m_hasRepresentation)
- loader->frameLoader()->writer()->setEncoding("", false);
+ loader->writer()->setEncoding("", false);
return;
}
if (m_pluginView->isPluginView())
@@ -846,7 +847,7 @@ void FrameLoaderClientQt::didDisplayInsecureContent()
notImplemented();
}
-void FrameLoaderClientQt::didRunInsecureContent(WebCore::SecurityOrigin*)
+void FrameLoaderClientQt::didRunInsecureContent(WebCore::SecurityOrigin*, const KURL&)
{
if (dumpFrameLoaderCallbacks)
printf("didRunInsecureContent\n");
@@ -1021,6 +1022,11 @@ void FrameLoaderClientQt::dispatchWillSendRequest(WebCore::DocumentLoader*, unsi
for (int i = 0; i < sendRequestClearHeaders.size(); ++i)
newRequest.setHTTPHeaderField(sendRequestClearHeaders.at(i).toLocal8Bit().constData(), QString());
+ if (QWebPagePrivate::drtRun) {
+ QString url = newRequest.url().string();
+ if (URLsToRedirect.contains(url))
+ newRequest.setURL(QUrl(URLsToRedirect[url]));
+ }
// seems like the Mac code doesn't do anything here by default neither
//qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << request.url().string`();
}
@@ -1510,46 +1516,46 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
#endif // QT_NO_STYLE_STYLESHEET
}
- if (!object) {
- QWebPluginFactory* factory = m_webFrame->page()->pluginFactory();
- if (factory)
- object = factory->create(mimeType, qurl, params, values);
- }
+ if (!object) {
+ QWebPluginFactory* factory = m_webFrame->page()->pluginFactory();
+ if (factory)
+ object = factory->create(mimeType, qurl, params, values);
+ }
- if (object) {
- QWidget* widget = qobject_cast<QWidget*>(object);
- if (widget) {
- QWidget* parentWidget = 0;
- if (m_webFrame->page()->d->client)
- parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent());
- if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose.
- widget->setParent(parentWidget);
- widget->hide();
- RefPtr<QtPluginWidget> w = adoptRef(new QtPluginWidget());
- w->setPlatformWidget(widget);
- // Make sure it's invisible until properly placed into the layout
- w->setFrameRect(IntRect(0, 0, 0, 0));
- return w;
- }
+ if (object) {
+ QWidget* widget = qobject_cast<QWidget*>(object);
+ if (widget) {
+ QWidget* parentWidget = 0;
+ if (m_webFrame->page()->d->client)
+ parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent());
+ if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose.
+ widget->setParent(parentWidget);
+ widget->hide();
+ RefPtr<QtPluginWidget> w = adoptRef(new QtPluginWidget());
+ w->setPlatformWidget(widget);
+ // Make sure it's invisible until properly placed into the layout
+ w->setFrameRect(IntRect(0, 0, 0, 0));
+ return w;
+ }
#if !defined(QT_NO_GRAPHICSVIEW)
- QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object);
- if (graphicsWidget) {
- QGraphicsObject* parentWidget = 0;
- if (m_webFrame->page()->d->client)
- parentWidget = qobject_cast<QGraphicsObject*>(m_webFrame->page()->d->client->pluginParent());
- graphicsWidget->hide();
- if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose.
- graphicsWidget->setParentItem(parentWidget);
- RefPtr<QtPluginGraphicsWidget> w = QtPluginGraphicsWidget::create(graphicsWidget);
- // Make sure it's invisible until properly placed into the layout
- w->setFrameRect(IntRect(0, 0, 0, 0));
- return w;
- }
+ QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object);
+ if (graphicsWidget) {
+ QGraphicsObject* parentWidget = 0;
+ if (m_webFrame->page()->d->client)
+ parentWidget = qobject_cast<QGraphicsObject*>(m_webFrame->page()->d->client->pluginParent());
+ graphicsWidget->hide();
+ if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose.
+ graphicsWidget->setParentItem(parentWidget);
+ RefPtr<QtPluginGraphicsWidget> w = QtPluginGraphicsWidget::create(graphicsWidget);
+ // Make sure it's invisible until properly placed into the layout
+ w->setFrameRect(IntRect(0, 0, 0, 0));
+ return w;
+ }
#endif // QT_NO_GRAPHICSVIEW
- // FIXME: make things work for widgetless plugins as well
- delete object;
+ // FIXME: make things work for widgetless plugins as well
+ delete object;
}
#if ENABLE(NETSCAPE_PLUGIN_API)
else { // NPAPI Plugins
@@ -1575,7 +1581,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
if (wmodeIndex == -1) {
params.append("wmode");
values.append("opaque");
- } else
+ } else if (equalIgnoringCase(values[wmodeIndex], "window"))
values[wmodeIndex] = "opaque";
}
#endif
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 3d93eaf..09a26ea 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -158,7 +158,7 @@ public:
virtual void dispatchDidRemoveBackForwardItem(HistoryItem*) const;
virtual void dispatchDidChangeBackForwardIndex() const;
virtual void didDisplayInsecureContent();
- virtual void didRunInsecureContent(SecurityOrigin*);
+ virtual void didRunInsecureContent(SecurityOrigin*, const KURL&);
virtual ResourceError cancelledError(const ResourceRequest&);
virtual ResourceError blockedError(const ResourceRequest&);
@@ -250,6 +250,7 @@ public:
static bool policyDelegatePermissive;
static bool deferMainResourceDataLoad;
static bool dumpHistoryCallbacks;
+ static QMap<QString, QString> URLsToRedirect;
private:
Frame *m_frame;
diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
index bdc22e5..ccca43c 100644
--- a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
@@ -22,16 +22,57 @@
#include "FullScreenVideoQt.h"
#include "ChromeClientQt.h"
+#include "FullScreenVideoWidget.h"
#include "HTMLNames.h"
#include "HTMLVideoElement.h"
#include "MediaPlayerPrivateQt.h"
#include "Node.h"
-#include "qwebkitplatformplugin.h"
+
#include <QGraphicsVideoItem>
+#include <QMediaPlayer>
namespace WebCore {
+bool DefaultFullScreenVideoHandler::s_shouldForceFullScreenVideoPlayback = false;
+
+DefaultFullScreenVideoHandler::DefaultFullScreenVideoHandler()
+ : QWebFullScreenVideoHandler()
+ , m_fullScreenWidget(new FullScreenVideoWidget)
+{
+ connect(m_fullScreenWidget, SIGNAL(didExitFullScreen()), this, SIGNAL(fullScreenClosed()));
+ m_fullScreenWidget->hide();
+}
+
+DefaultFullScreenVideoHandler::~DefaultFullScreenVideoHandler()
+{
+ delete m_fullScreenWidget;
+}
+
+bool DefaultFullScreenVideoHandler::requiresFullScreenForVideoPlayback() const
+{
+ static bool initialized = false;
+ if (!initialized) {
+ QByteArray forceFullScreen = qgetenv("QT_WEBKIT_FORCE_FULLSCREEN_VIDEO");
+ if (!forceFullScreen.isEmpty())
+ s_shouldForceFullScreenVideoPlayback = true;
+
+ initialized = true;
+ }
+
+ return s_shouldForceFullScreenVideoPlayback;
+}
+
+void DefaultFullScreenVideoHandler::enterFullScreen(QMediaPlayer* player)
+{
+ m_fullScreenWidget->show(player);
+}
+
+void DefaultFullScreenVideoHandler::exitFullScreen()
+{
+ m_fullScreenWidget->close();
+}
+
FullScreenVideoQt::FullScreenVideoQt(ChromeClientQt* chromeClient)
: m_chromeClient(chromeClient)
, m_videoElement(0)
@@ -39,6 +80,9 @@ FullScreenVideoQt::FullScreenVideoQt(ChromeClientQt* chromeClient)
Q_ASSERT(m_chromeClient);
m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler();
+ if (!m_FullScreenVideoHandler)
+ m_FullScreenVideoHandler = new DefaultFullScreenVideoHandler;
+
if (m_FullScreenVideoHandler)
connect(m_FullScreenVideoHandler, SIGNAL(fullScreenClosed()), this, SLOT(aboutToClose()));
}
diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
index 637da70..a48a882 100644
--- a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
@@ -20,21 +20,38 @@
#ifndef FullScreenVideoQt_h
#define FullScreenVideoQt_h
+#include "qwebkitplatformplugin.h"
#include <QObject>
QT_BEGIN_NAMESPACE
class QGraphicsVideoItem;
+class QMediaPlayer;
QT_END_NAMESPACE
-class QWebFullScreenVideoHandler;
-
namespace WebCore {
class ChromeClientQt;
+class FullScreenVideoWidget;
class HTMLVideoElement;
class Node;
class MediaPlayerPrivateQt;
+class DefaultFullScreenVideoHandler : public QWebFullScreenVideoHandler {
+ Q_OBJECT
+public:
+ DefaultFullScreenVideoHandler();
+ virtual ~DefaultFullScreenVideoHandler();
+ bool requiresFullScreenForVideoPlayback() const;
+
+public Q_SLOTS:
+ void enterFullScreen(QMediaPlayer*);
+ void exitFullScreen();
+
+private:
+ static bool s_shouldForceFullScreenVideoPlayback;
+ FullScreenVideoWidget *m_fullScreenWidget;
+};
+
class FullScreenVideoQt : public QObject {
Q_OBJECT
public:
@@ -61,4 +78,4 @@ private:
}
-#endif // PopupMenuQt_h
+#endif // FullScreenVideoQt_h
diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
new file mode 100644
index 0000000..4922cd7
--- /dev/null
+++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "FullScreenVideoWidget.h"
+
+#include <QApplication>
+#include <QCloseEvent>
+#include <QDesktopWidget>
+#include <QKeyEvent>
+#include <QMediaPlayer>
+
+static const int gHideMouseCursorDelay = 3000;
+
+namespace WebCore {
+
+FullScreenVideoWidget::FullScreenVideoWidget()
+ : QVideoWidget()
+ , m_mediaPlayer(0)
+{
+ QPalette palette(this->palette());
+ palette.setColor(QPalette::Base, Qt::black);
+ palette.setColor(QPalette::Background, Qt::black);
+ setPalette(palette);
+
+ setWindowModality(Qt::ApplicationModal);
+ setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
+
+ setGeometry(QApplication::desktop()->screenGeometry());
+
+ m_cursorTimer.setSingleShot(true);
+ connect(&m_cursorTimer, SIGNAL(timeout()), this, SLOT(hideCursor()));
+}
+
+FullScreenVideoWidget::~FullScreenVideoWidget()
+{
+}
+
+void FullScreenVideoWidget::show(QMediaPlayer* player)
+{
+ m_mediaPlayer = player;
+ showFullScreen();
+ setMouseTracking(true);
+ raise();
+ m_mediaPlayer->setVideoOutput(this);
+ grabMouse();
+ hideCursor();
+}
+
+void FullScreenVideoWidget::closeEvent(QCloseEvent* event)
+{
+ m_mediaPlayer = 0;
+ setMouseTracking(false);
+ releaseMouse();
+ QApplication::restoreOverrideCursor();
+ event->ignore();
+ hide();
+ emit didExitFullScreen();
+}
+
+bool FullScreenVideoWidget::event(QEvent* ev)
+{
+ switch (ev->type()) {
+ case QEvent::MouseMove:
+ showCursor();
+ ev->accept();
+ return true;
+ case QEvent::MouseButtonDblClick:
+ close();
+ ev->accept();
+ return true;
+ default:
+ return QVideoWidget::event(ev);
+ }
+}
+
+void FullScreenVideoWidget::keyPressEvent(QKeyEvent* ev)
+{
+ if (m_mediaPlayer && ev->key() == Qt::Key_Space) {
+ if (m_mediaPlayer->state() == QMediaPlayer::PlayingState)
+ m_mediaPlayer->pause();
+ else
+ m_mediaPlayer->play();
+ } else if (ev->key() == Qt::Key_Escape)
+ close();
+}
+
+void FullScreenVideoWidget::hideCursor()
+{
+ QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
+}
+
+void FullScreenVideoWidget::showCursor()
+{
+ QApplication::restoreOverrideCursor();
+ m_cursorTimer.start(gHideMouseCursorDelay);
+}
+
+}
diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
new file mode 100644
index 0000000..466042c
--- /dev/null
+++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FullScreenVideoWidget_h
+#define FullScreenVideoWidget_h
+
+#include <QTimer>
+#include <QVideoWidget>
+
+QT_BEGIN_NAMESPACE
+class QMediaPlayer;
+QT_END_NAMESPACE
+
+namespace WebCore {
+
+class FullScreenVideoWidget : public QVideoWidget {
+ Q_OBJECT
+public:
+ FullScreenVideoWidget();
+ virtual ~FullScreenVideoWidget();
+ void show(QMediaPlayer*);
+
+Q_SIGNALS:
+ void didExitFullScreen();
+
+protected:
+ virtual void closeEvent(QCloseEvent*);
+ virtual bool event(QEvent*);
+ virtual void keyPressEvent(QKeyEvent*);
+
+private slots:
+ void hideCursor();
+
+private:
+ void showCursor();
+ QMediaPlayer* m_mediaPlayer;
+ QTimer m_cursorTimer;
+};
+
+}
+
+#endif // FullScreenVideoWidget_h
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 1b06e2e..f364b28 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -32,7 +32,6 @@
#include "InspectorClientQt.h"
#include "Frame.h"
-#include "InspectorBackendDispatcher.h"
#include "InspectorController.h"
#include "InspectorFrontend.h"
#include "InspectorServerQt.h"
@@ -55,9 +54,6 @@ namespace WebCore {
static const QLatin1String settingStoragePrefix("Qt/QtWebKit/QWebInspector/");
static const QLatin1String settingStorageTypeSuffix(".type");
-static String variantToSetting(const QVariant& qvariant);
-static QVariant settingToVariant(const String& value);
-
class InspectorClientWebPage : public QWebPage {
Q_OBJECT
friend class InspectorClientQt;
@@ -97,6 +93,85 @@ public slots:
}
};
+namespace {
+
+#if ENABLE(INSPECTOR)
+class InspectorFrontendSettingsQt : public InspectorFrontendClientLocal::Settings {
+public:
+ virtual ~InspectorFrontendSettingsQt() { }
+ virtual String getProperty(const String& name)
+ {
+#ifdef QT_NO_SETTINGS
+ Q_UNUSED(name)
+ Q_UNUSED(value)
+ qWarning("QWebInspector: QSettings is not supported by Qt.");
+ return String();
+#else
+ QSettings qsettings;
+ if (qsettings.status() == QSettings::AccessError) {
+ // QCoreApplication::setOrganizationName and QCoreApplication::setApplicationName haven't been called
+ qWarning("QWebInspector: QSettings couldn't read configuration setting [%s].",
+ qPrintable(static_cast<QString>(name)));
+ return String();
+ }
+
+ QString settingKey(settingStoragePrefix + QString(name));
+ QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString();
+ QVariant storedValue = qsettings.value(settingKey);
+ storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data()));
+ return variantToSetting(storedValue);
+#endif // QT_NO_SETTINGS
+ }
+
+ virtual void setProperty(const String& name, const String& value)
+ {
+#ifdef QT_NO_SETTINGS
+ Q_UNUSED(name)
+ Q_UNUSED(value)
+ qWarning("QWebInspector: QSettings is not supported by Qt.");
+#else
+ QSettings qsettings;
+ if (qsettings.status() == QSettings::AccessError) {
+ qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].",
+ qPrintable(static_cast<QString>(name)));
+ return;
+ }
+
+ QVariant valueToStore = settingToVariant(value);
+ QString settingKey(settingStoragePrefix + QString(name));
+ qsettings.setValue(settingKey, valueToStore);
+ qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
+#endif // QT_NO_SETTINGS
+ }
+
+private:
+ static String variantToSetting(const QVariant& qvariant)
+ {
+ String retVal;
+
+ switch (qvariant.type()) {
+ case QVariant::Bool:
+ retVal = qvariant.toBool() ? "true" : "false";
+ case QVariant::String:
+ retVal = qvariant.toString();
+ default:
+ break;
+ }
+
+ return retVal;
+ }
+
+ static QVariant settingToVariant(const String& setting)
+ {
+ QVariant retVal;
+ retVal.setValue(static_cast<QString>(setting));
+ return retVal;
+ }
+};
+#endif // ENABLE(INSPECTOR)
+
+}
+
#if USE(V8)
static void ensureDebuggerScriptLoaded()
{
@@ -213,50 +288,6 @@ void InspectorClientQt::hideHighlight()
notImplemented();
}
-void InspectorClientQt::populateSetting(const String& key, String* setting)
-{
-#ifdef QT_NO_SETTINGS
- Q_UNUSED(key)
- Q_UNUSED(setting)
- qWarning("QWebInspector: QSettings is not supported by Qt.");
-#else
- QSettings qsettings;
- if (qsettings.status() == QSettings::AccessError) {
- // QCoreApplication::setOrganizationName and QCoreApplication::setApplicationName haven't been called
- qWarning("QWebInspector: QSettings couldn't read configuration setting [%s].",
- qPrintable(static_cast<QString>(key)));
- return;
- }
-
- QString settingKey(settingStoragePrefix + QString(key));
- QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString();
- QVariant storedValue = qsettings.value(settingKey);
- storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data()));
- *setting = variantToSetting(storedValue);
-#endif // QT_NO_SETTINGS
-}
-
-void InspectorClientQt::storeSetting(const String& key, const String& setting)
-{
-#ifdef QT_NO_SETTINGS
- Q_UNUSED(key)
- Q_UNUSED(setting)
- qWarning("QWebInspector: QSettings is not supported by Qt.");
-#else
- QSettings qsettings;
- if (qsettings.status() == QSettings::AccessError) {
- qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].",
- qPrintable(static_cast<QString>(key)));
- return;
- }
-
- QVariant valueToStore = settingToVariant(setting);
- QString settingKey(settingStoragePrefix + QString(key));
- qsettings.setValue(settingKey, valueToStore);
- qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
-#endif // QT_NO_SETTINGS
-}
-
bool InspectorClientQt::sendMessageToFrontend(const String& message)
{
#if ENABLE(INSPECTOR)
@@ -276,32 +307,9 @@ bool InspectorClientQt::sendMessageToFrontend(const String& message)
#endif
}
-static String variantToSetting(const QVariant& qvariant)
-{
- String retVal;
-
- switch (qvariant.type()) {
- case QVariant::Bool:
- retVal = qvariant.toBool() ? "true" : "false";
- case QVariant::String:
- retVal = qvariant.toString();
- default:
- break;
- }
-
- return retVal;
-}
-
-static QVariant settingToVariant(const String& setting)
-{
- QVariant retVal;
- retVal.setValue(static_cast<QString>(setting));
- return retVal;
-}
-
#if ENABLE(INSPECTOR)
InspectorFrontendClientQt::InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView, InspectorClientQt* inspectorClient)
- : InspectorFrontendClientLocal(inspectedWebPage->d->page->inspectorController(), inspectorView->page()->d->page)
+ : InspectorFrontendClientLocal(inspectedWebPage->d->page->inspectorController(), inspectorView->page()->d->page, new InspectorFrontendSettingsQt())
, m_inspectedWebPage(inspectedWebPage)
, m_inspectorView(inspectorView)
, m_destroyingInspectorView(false)
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index 64a2d0c..c16fabe 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -58,9 +58,6 @@ public:
virtual void highlight(Node*);
virtual void hideHighlight();
- virtual void populateSetting(const String& key, String* value);
- virtual void storeSetting(const String& key, const String& value);
-
virtual bool sendMessageToFrontend(const String&);
void releaseFrontendPage();
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
index 7002dce..f83deb2 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
@@ -20,8 +20,8 @@
#include "config.h"
#include "InspectorServerQt.h"
-#include "InspectorBackendDispatcher.h"
#include "InspectorClientQt.h"
+#include "InspectorController.h"
#include "MD5.h"
#include "Page.h"
#include "qwebpage.h"
@@ -363,7 +363,7 @@ void InspectorServerRequestHandlerQt::webSocketReadyRead()
#if ENABLE(INSPECTOR)
if (m_inspectorClient) {
InspectorController* inspectorController = m_inspectorClient->m_inspectedWebPage->d->page->inspectorController();
- inspectorController->inspectorBackendDispatcher()->dispatch(QString::fromUtf8(payload));
+ inspectorController->dispatchMessageFromFrontend(QString::fromUtf8(payload));
}
#endif
diff --git a/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp
index 0c0f2d7..f7c4edc 100644
--- a/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp
@@ -109,7 +109,7 @@ void PopupMenuQt::show(const IntRect& rect, FrameView* view, int index)
if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup)) {
QRect geometry(rect);
- geometry.moveTopLeft(view->contentsToWindow(rect.topLeft()));
+ geometry.moveTopLeft(view->contentsToWindow(rect.location()));
fallback->setGeometry(geometry);
fallback->setFont(m_popupClient->menuStyle().font().font());
}
diff --git a/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
index c67ec2f..de4de3e 100644
--- a/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
@@ -200,6 +200,11 @@ String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
return QCoreApplication::translate("QWebPage", "Copy Image", "Copy Link context menu item");
}
+String WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard()
+{
+ return QCoreApplication::translate("QWebPage", "Copy Image Address", "Copy Image Address menu item");
+}
+
String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
{
return QCoreApplication::translate("QWebPage", "Open Video", "Open Video in New Window");
diff --git a/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
index 5f72f46..b760045 100644
--- a/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
+++ b/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
@@ -66,6 +66,7 @@ private:
virtual WTF::String contextMenuItemTagOpenImageInNewWindow();
virtual WTF::String contextMenuItemTagDownloadImageToDisk();
virtual WTF::String contextMenuItemTagCopyImageToClipboard();
+ virtual WTF::String contextMenuItemTagCopyImageUrlToClipboard();
virtual WTF::String contextMenuItemTagOpenFrameInNewWindow();
virtual WTF::String contextMenuItemTagCopy();
virtual WTF::String contextMenuItemTagGoBack();
diff --git a/Source/WebKit/qt/declarative/declarative.pro b/Source/WebKit/qt/declarative/declarative.pro
index bc94eed..526cf06 100644
--- a/Source/WebKit/qt/declarative/declarative.pro
+++ b/Source/WebKit/qt/declarative/declarative.pro
@@ -33,7 +33,7 @@ symbian: {
TARGET = $$TARGET$${QT_LIBINFIX}
}
-include(../../../../WebKit.pri)
+include(../../../WebKit.pri)
QT += declarative
diff --git a/Source/WebKit/qt/declarative/qdeclarativewebview.cpp b/Source/WebKit/qt/declarative/qdeclarativewebview.cpp
index e26889e..bcc1f1c 100644
--- a/Source/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/Source/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -141,6 +141,16 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
QGraphicsWebView::mouseMoveEvent(event);
}
+bool GraphicsWebView::sceneEvent(QEvent *event)
+{
+ bool rv = QGraphicsWebView::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ pressTimer.stop();
+ parent->setKeepMouseGrab(false);
+ }
+ return rv;
+}
+
/*!
\qmlclass WebView QDeclarativeWebView
\ingroup qml-view-elements
@@ -249,7 +259,11 @@ void QDeclarativeWebView::init()
{
d = new QDeclarativeWebViewPrivate(this);
- QWebSettings::enablePersistentStorage();
+ if (QWebSettings::iconDatabasePath().isNull() &&
+ QWebSettings::globalSettings()->localStoragePath().isNull() &&
+ QWebSettings::offlineStoragePath().isNull() &&
+ QWebSettings::offlineWebApplicationCachePath().isNull())
+ QWebSettings::enablePersistentStorage();
setAcceptedMouseButtons(Qt::LeftButton);
setFlag(QGraphicsItem::ItemHasNoContents, true);
@@ -730,11 +744,11 @@ QWebPage* QDeclarativeWebView::page() const
See QWebSettings for details of these properties.
\qml
- WebView {
- settings.pluginsEnabled: true
- settings.standardFontFamily: "Arial"
- ...
- }
+ WebView {
+ settings.pluginsEnabled: true
+ settings.standardFontFamily: "Arial"
+ // ...
+ }
\endqml
*/
QDeclarativeWebSettings* QDeclarativeWebView::settingsObject() const
diff --git a/Source/WebKit/qt/declarative/qdeclarativewebview_p.h b/Source/WebKit/qt/declarative/qdeclarativewebview_p.h
index b2055bf..ca15a1e 100644
--- a/Source/WebKit/qt/declarative/qdeclarativewebview_p.h
+++ b/Source/WebKit/qt/declarative/qdeclarativewebview_p.h
@@ -70,6 +70,8 @@ protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void timerEvent(QTimerEvent* event);
+ bool sceneEvent(QEvent *event);
+
Q_SIGNALS:
void doubleClick(int clickX, int clickY);
private:
diff --git a/Source/WebKit/qt/docs/docs.pri b/Source/WebKit/qt/docs/docs.pri
index d87dcd6..a56ddb4 100644
--- a/Source/WebKit/qt/docs/docs.pri
+++ b/Source/WebKit/qt/docs/docs.pri
@@ -1,4 +1,4 @@
-include(../../../../WebKit.pri)
+include(../../../WebKit.pri)
unix {
QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/bin/qdoc3
diff --git a/Source/WebKit/qt/docs/qtwebkit.qdoc b/Source/WebKit/qt/docs/qtwebkit.qdoc
index df22e65..1e76901 100644
--- a/Source/WebKit/qt/docs/qtwebkit.qdoc
+++ b/Source/WebKit/qt/docs/qtwebkit.qdoc
@@ -103,8 +103,8 @@
The following locations are searched for plugins:
\table
- \header \o Linux/Unix (X11) \o Windows
- \row \o{1,3}
+ \header \o Linux/Unix (X11)
+ \row \o
\list
\o \c{.mozilla/plugins} in the user's home directory
\o \c{.netscape/plugins} in the user's home directory
@@ -134,19 +134,20 @@
\o \c{$QTWEBKIT_PLUGIN_PATH}
\endlist
\endlist
+ \endtable
- \o
+ \table
+ \header \o Windows
+ \row \o
\list
\o The user's \c{Application Data\Mozilla\plugins} directory
\o Standard system locations of plugins for Quicktime, Flash, etc.
\endlist
+ \endtable
- \row
- \raw HTML
- <th class="qt-style">Mac OS X</th>
- \endraw
- \row
- \o
+ \table
+ \header \o Mac OS X
+ \row \o
\list
\o \c{Library/Internet Plug-Ins} in the user's home directory
\o The system \c{/Library/Internet Plug-Ins} directory
diff --git a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 6b0b58d..3c47d1c 100644
--- a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -308,7 +308,7 @@ public:
}
Q_INVOKABLE QObjectList myInvokableWithQObjectListArg(const QObjectList &lst) {
m_qtFunctionInvoked = 14;
- m_actuals << qVariantFromValue(lst);
+ m_actuals << QVariant::fromValue(lst);
return lst;
}
Q_INVOKABLE QVariant myInvokableWithVariantArg(const QVariant &v) {
@@ -323,38 +323,38 @@ public:
}
Q_INVOKABLE QList<int> myInvokableWithListOfIntArg(const QList<int> &lst) {
m_qtFunctionInvoked = 17;
- m_actuals << qVariantFromValue(lst);
+ m_actuals << QVariant::fromValue(lst);
return lst;
}
Q_INVOKABLE QObject* myInvokableWithQObjectStarArg(QObject* obj) {
m_qtFunctionInvoked = 18;
- m_actuals << qVariantFromValue(obj);
+ m_actuals << QVariant::fromValue(obj);
return obj;
}
Q_INVOKABLE QBrush myInvokableWithQBrushArg(const QBrush &brush) {
m_qtFunctionInvoked = 19;
- m_actuals << qVariantFromValue(brush);
+ m_actuals << QVariant::fromValue(brush);
return brush;
}
Q_INVOKABLE void myInvokableWithBrushStyleArg(Qt::BrushStyle style) {
m_qtFunctionInvoked = 43;
- m_actuals << qVariantFromValue(style);
+ m_actuals << QVariant::fromValue(style);
}
Q_INVOKABLE void myInvokableWithVoidStarArg(void* arg) {
m_qtFunctionInvoked = 44;
- m_actuals << qVariantFromValue(arg);
+ m_actuals << QVariant::fromValue(arg);
}
Q_INVOKABLE void myInvokableWithAmbiguousArg(int arg) {
m_qtFunctionInvoked = 45;
- m_actuals << qVariantFromValue(arg);
+ m_actuals << QVariant::fromValue(arg);
}
Q_INVOKABLE void myInvokableWithAmbiguousArg(uint arg) {
m_qtFunctionInvoked = 46;
- m_actuals << qVariantFromValue(arg);
+ m_actuals << QVariant::fromValue(arg);
}
Q_INVOKABLE void myInvokableWithDefaultArgs(int arg1, const QString &arg2 = "") {
m_qtFunctionInvoked = 47;
- m_actuals << qVariantFromValue(arg1) << qVariantFromValue(arg2);
+ m_actuals << QVariant::fromValue(arg1) << qVariantFromValue(arg2);
}
Q_INVOKABLE QObject& myInvokableReturningRef() {
m_qtFunctionInvoked = 48;
@@ -366,11 +366,11 @@ public:
}
Q_INVOKABLE void myInvokableWithPointArg(const QPoint &arg) {
const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 50;
- m_actuals << qVariantFromValue(arg);
+ m_actuals << QVariant::fromValue(arg);
}
Q_INVOKABLE void myInvokableWithPointArg(const QPointF &arg) {
const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 51;
- m_actuals << qVariantFromValue(arg);
+ m_actuals << QVariant::fromValue(arg);
}
Q_INVOKABLE void myInvokableWithBoolArg(bool arg) {
m_qtFunctionInvoked = 52;
@@ -418,7 +418,7 @@ public Q_SLOTS:
}
void myOverloadedSlot(QObject* arg) {
m_qtFunctionInvoked = 41;
- m_actuals << qVariantFromValue(arg);
+ m_actuals << QVariant::fromValue(arg);
}
void myOverloadedSlot(bool arg) {
m_qtFunctionInvoked = 25;
@@ -514,6 +514,24 @@ private:
QVariantList m_actuals;
};
+class MyWebElementSlotOnlyObject : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString tagName READ tagName)
+public slots:
+ void doSomethingWithWebElement(const QWebElement& element)
+ {
+ m_tagName = element.tagName();
+ }
+
+public:
+ QString tagName() const
+ {
+ return m_tagName;
+ }
+private:
+ QString m_tagName;
+};
+
class MyOtherQObject : public MyQObject
{
public:
@@ -584,6 +602,7 @@ private slots:
void findChild();
void findChildren();
void overloadedSlots();
+ void webElementSlotOnly();
void enumerate_data();
void enumerate();
void objectDeleted();
@@ -824,7 +843,7 @@ void tst_QWebFrame::getSetStaticProperty()
QCOMPARE(evalJS("myObject.variantProperty === 'bar'"), sTrue);
m_myObject->setVariantProperty(42);
QCOMPARE(evalJS("myObject.variantProperty === 42"), sTrue);
- m_myObject->setVariantProperty(qVariantFromValue(QBrush()));
+ m_myObject->setVariantProperty(QVariant::fromValue(QBrush()));
//XFAIL
// QCOMPARE(evalJS("typeof myObject.variantProperty"), sVariant);
@@ -1246,7 +1265,7 @@ void tst_QWebFrame::callQtInvokable()
/* XFAIL - variant support
m_myObject->resetQtFunctionInvoked();
{
- m_myObject->setVariantProperty(qVariantFromValue(QBrush()));
+ m_myObject->setVariantProperty(QVariant::fromValue(QBrush()));
QVariant ret = evalJS("myObject.myInvokableWithVariantArg(myObject.variantProperty)");
QVERIFY(ret.isVariant());
QCOMPARE(m_myObject->qtFunctionInvoked(), 15);
@@ -2427,8 +2446,10 @@ void tst_QWebFrame::javaScriptWindowObjectClearedOnEvaluate()
void tst_QWebFrame::setHtml()
{
QString html("<html><head></head><body><p>hello world</p></body></html>");
+ QSignalSpy spy(m_view->page(), SIGNAL(loadFinished(bool)));
m_view->page()->mainFrame()->setHtml(html);
QCOMPARE(m_view->page()->mainFrame()->toHtml(), html);
+ QCOMPARE(spy.count(), 1);
}
void tst_QWebFrame::setHtmlWithResource()
@@ -3257,5 +3278,14 @@ void tst_QWebFrame::setCacheLoadControlAttribute()
QCOMPARE(manager->lastCacheLoad(), QNetworkRequest::PreferNetwork);
}
+void tst_QWebFrame::webElementSlotOnly()
+{
+ MyWebElementSlotOnlyObject object;
+ m_page->mainFrame()->setHtml("<html><head><body></body></html>");
+ m_page->mainFrame()->addToJavaScriptWindowObject("myWebElementSlotObject", &object);
+ evalJS("myWebElementSlotObject.doSomethingWithWebElement(document.body)");
+ QCOMPARE(evalJS("myWebElementSlotObject.tagName"), QString("BODY"));
+}
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index ec1f336..c9c409d 100644
--- a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -78,6 +78,7 @@ private slots:
void initTestCase();
void cleanupTestCase();
+ void contextMenuCopy();
void acceptNavigationRequest();
void geolocationRequestJS();
void loadFinished();
@@ -85,6 +86,7 @@ private slots:
void userStyleSheet();
void modified();
void contextMenuCrash();
+ void updatePositionDependentActionsCrash();
void database();
void createPluginWithPluginsEnabled();
void createPluginWithPluginsDisabled();
@@ -133,6 +135,7 @@ private slots:
void infiniteLoopJS();
void networkAccessManagerOnDifferentThread();
void navigatorCookieEnabled();
+ void navigatorCookieEnabledForNetworkAccessManagerOnDifferentThread();
#ifdef Q_OS_MAC
void macCopyUnicodeToClipboard();
@@ -495,11 +498,31 @@ void tst_QWebPage::modified()
QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*,QWebHistoryItem*))));
}
+// https://bugs.webkit.org/show_bug.cgi?id=51331
+void tst_QWebPage::updatePositionDependentActionsCrash()
+{
+ QWebView view;
+ view.setHtml("<p>test");
+ QPoint pos(0, 0);
+ view.page()->updatePositionDependentActions(pos);
+ QMenu* contextMenu = 0;
+ foreach (QObject* child, view.children()) {
+ contextMenu = qobject_cast<QMenu*>(child);
+ if (contextMenu)
+ break;
+ }
+ QVERIFY(!contextMenu);
+}
+
+// https://bugs.webkit.org/show_bug.cgi?id=20357
void tst_QWebPage::contextMenuCrash()
{
QWebView view;
view.setHtml("<p>test");
- view.page()->updatePositionDependentActions(QPoint(0, 0));
+ QPoint pos(0, 0);
+ QContextMenuEvent event(QContextMenuEvent::Mouse, pos);
+ view.page()->swallowContextMenuEvent(&event);
+ view.page()->updatePositionDependentActions(pos);
QMenu* contextMenu = 0;
foreach (QObject* child, view.children()) {
contextMenu = qobject_cast<QMenu*>(child);
@@ -2740,6 +2763,19 @@ void tst_QWebPage::navigatorCookieEnabled()
QVERIFY(m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool());
}
+void tst_QWebPage::navigatorCookieEnabledForNetworkAccessManagerOnDifferentThread()
+{
+ QtNAMThread qnamThread;
+ qnamThread.start();
+ m_page->setNetworkAccessManager(qnamThread.networkAccessManager());
+
+ // This call access the cookie jar, the cookie jar must be in the same thread as
+ // the network access manager.
+ QVERIFY(m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool());
+
+ QCOMPARE(qnamThread.networkAccessManager()->cookieJar()->thread(), &qnamThread);
+}
+
#ifdef Q_OS_MAC
void tst_QWebPage::macCopyUnicodeToClipboard()
{
@@ -2755,5 +2791,29 @@ void tst_QWebPage::macCopyUnicodeToClipboard()
}
#endif
+void tst_QWebPage::contextMenuCopy()
+{
+ QWebView view;
+
+ view.setHtml("<a href=\"http://www.google.com\">You cant miss this</a>");
+
+ view.page()->triggerAction(QWebPage::SelectAll);
+ QVERIFY(!view.page()->selectedText().isEmpty());
+
+ QWebElement link = view.page()->mainFrame()->findFirstElement("a");
+ QPoint pos(link.geometry().center());
+ QContextMenuEvent event(QContextMenuEvent::Mouse, pos);
+ view.page()->swallowContextMenuEvent(&event);
+ view.page()->updatePositionDependentActions(pos);
+
+ QList<QMenu*> contextMenus = view.findChildren<QMenu*>();
+ QVERIFY(!contextMenus.isEmpty());
+ QMenu* contextMenu = contextMenus.first();
+ QVERIFY(contextMenu);
+
+ QList<QAction *> list = contextMenu->actions();
+ int index = list.indexOf(view.page()->action(QWebPage::Copy));
+ QVERIFY(index != -1);
+}
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/Source/WebKit/qt/tests/tests.pri b/Source/WebKit/qt/tests/tests.pri
index 2e30dd0..a795ff8 100644
--- a/Source/WebKit/qt/tests/tests.pri
+++ b/Source/WebKit/qt/tests/tests.pri
@@ -10,7 +10,7 @@ INCLUDEPATH += \
$$PWD \
$$PWD/../Api
-include(../../../../WebKit.pri)
+include(../../../WebKit.pri)
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR