summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/qt/Api
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/Api
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/Api')
-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
4 files changed, 26 insertions, 19 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));