summaryrefslogtreecommitdiffstats
path: root/WebKit/qt
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/qt')
-rw-r--r--WebKit/qt/Api/headers.pri1
-rw-r--r--WebKit/qt/Api/qgraphicswebview.cpp352
-rw-r--r--WebKit/qt/Api/qwebdatabase.cpp10
-rw-r--r--WebKit/qt/Api/qwebelement.cpp20
-rw-r--r--WebKit/qt/Api/qwebframe.cpp42
-rw-r--r--WebKit/qt/Api/qwebhistoryinterface.cpp23
-rw-r--r--WebKit/qt/Api/qwebinspector.cpp45
-rw-r--r--WebKit/qt/Api/qwebkitglobal.h4
-rw-r--r--WebKit/qt/Api/qwebkitplatformplugin.h77
-rw-r--r--WebKit/qt/Api/qwebkitversion.cpp66
-rw-r--r--WebKit/qt/Api/qwebpage.cpp187
-rw-r--r--WebKit/qt/Api/qwebpluginfactory.cpp36
-rw-r--r--WebKit/qt/Api/qwebsecurityorigin.cpp24
-rw-r--r--WebKit/qt/Api/qwebsettings.cpp129
-rw-r--r--WebKit/qt/Api/qwebsettings.h2
-rw-r--r--WebKit/qt/Api/qwebview.cpp35
-rw-r--r--WebKit/qt/ChangeLog455
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp17
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.h7
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp137
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h20
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.cpp16
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.h3
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp63
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h7
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorClientQt.cpp4
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp8
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h2
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.cpp197
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.h135
-rw-r--r--WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp4
-rw-r--r--WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h4
-rw-r--r--WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp143
-rw-r--r--WebKit/qt/WebCoreSupport/QtPlatformPlugin.h64
-rw-r--r--WebKit/qt/docs/qtwebkit.qdoc109
-rw-r--r--WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp2
-rw-r--r--WebKit/qt/docs/webkitsnippets/webelement/main.cpp56
-rw-r--r--WebKit/qt/symbian/eabi/QtWebKitu.def3
-rw-r--r--WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp8
-rw-r--r--WebKit/qt/tests/qwebpage/tst_qwebpage.cpp23
40 files changed, 1918 insertions, 622 deletions
diff --git a/WebKit/qt/Api/headers.pri b/WebKit/qt/Api/headers.pri
index 1a42597..29bb125 100644
--- a/WebKit/qt/Api/headers.pri
+++ b/WebKit/qt/Api/headers.pri
@@ -1,6 +1,7 @@
WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
$$PWD/qgraphicswebview.h \
$$PWD/qwebkitglobal.h \
+ $$PWD/qwebkitplatformplugin.h \
$$PWD/qwebpage.h \
$$PWD/qwebview.h \
$$PWD/qwebsettings.h \
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 821e699..904201e 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -25,7 +25,7 @@
#include "qwebframe_p.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
-#include "QWebPageClient.h"
+#include "PageClientQt.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "IntRect.h"
@@ -46,98 +46,24 @@
#endif
#include <Settings.h>
-// 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);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
-#endif
- 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;
-};
+using namespace WebCore;
-class QGraphicsWebViewPrivate : public QWebPageClient {
+class QGraphicsWebViewPrivate {
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
- }
+ , resizesToContents(false) {}
virtual ~QGraphicsWebViewPrivate();
- virtual void scroll(int dx, int dy, const QRect&);
- virtual void update(const QRect& dirtyRect);
- virtual void setInputMethodEnabled(bool enable);
- virtual bool inputMethodEnabled() const;
-#if QT_VERSION >= 0x040600
- virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
-#endif
-
-#ifndef QT_NO_CURSOR
- virtual QCursor cursor() const;
- virtual void updateCursor(const QCursor& cursor);
-#endif
-
- virtual QPalette palette() const;
- virtual int screenNumber() const;
- virtual QWidget* ownerWidget() const;
- virtual QRect geometryRelativeToOwnerWidget() const;
-
- virtual QObject* pluginParent() const;
-
- virtual QStyle* style() const;
-
-#if USE(ACCELERATED_COMPOSITING)
- virtual void setRootGraphicsLayer(QGraphicsItem* layer);
- virtual void markForSync(bool scheduleSync);
- void updateCompositingScrollPosition();
-
- // QGraphicsWebView can render composited layers
- virtual bool allowsAcceleratedCompositing() const { return true; }
-#endif
+ void syncLayers();
void updateResizesToContentsForPage();
- QRectF graphicsItemVisibleRect() const;
-#if ENABLE(TILED_BACKING_STORE)
- void updateTiledBackingStoreScale();
-#endif
+ virtual QRectF graphicsItemVisibleRect() const;
- void createOrDeleteOverlay();
- void syncLayers();
-
- void unsetPageIfExists();
+ void detachCurrentPage();
void _q_doLoadFinished(bool success);
void _q_contentsSizeChanged(const QSize&);
@@ -148,101 +74,21 @@ public:
QGraphicsWebView* q;
QWebPage* page;
-
bool resizesToContents;
- // the overlay gets instantiated when the root layer is attached, and get deleted when it's detached
- QSharedPointer<QGraphicsWebViewOverlay> overlay;
-
- // we need to put the root graphics layer behind the overlay (which contains the scrollbar)
- enum { RootGraphicsLayerZValue, OverlayZValue };
-
-#if USE(ACCELERATED_COMPOSITING)
- QGraphicsItem* rootGraphicsLayer;
- // 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;
-#endif
+ // Just a convenience to avoid using page->client->overlay always
+ QSharedPointer<QGraphicsItemOverlay> overlay;
};
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
-}
-
-void QGraphicsWebViewPrivate::createOrDeleteOverlay()
-{
- bool useOverlay = false;
- if (!resizesToContents) {
-#if USE(ACCELERATED_COMPOSITING)
- useOverlay = useOverlay || rootGraphicsLayer;
-#endif
-#if ENABLE(TILED_BACKING_STORE)
- useOverlay = useOverlay || QWebFramePrivate::core(q->page()->mainFrame())->tiledBackingStore();
-#endif
- }
- if (useOverlay == !!overlay)
- return;
- if (useOverlay) {
- overlay = QSharedPointer<QGraphicsWebViewOverlay>(new QGraphicsWebViewOverlay(q));
- overlay->setZValue(OverlayZValue);
- } else
- overlay.clear();
-}
-
-#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);
- updateCompositingScrollPosition();
- }
- createOrDeleteOverlay();
-}
-
-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);
- }
+ detachCurrentPage();
}
-#endif
void QGraphicsWebViewPrivate::syncLayers()
{
#if USE(ACCELERATED_COMPOSITING)
- if (shouldSync) {
- QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive();
- shouldSync = false;
- }
+ static_cast<PageClientQGraphicsWidget*>(page->d->client)->syncLayers();
#endif
}
@@ -275,117 +121,6 @@ void QGraphicsWebViewPrivate::_q_pageDestroyed()
q->setPage(0);
}
-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));
-
- createOrDeleteOverlay();
- if (overlay)
- overlay->update(QRectF(dirtyRect));
-#if USE(ACCELERATED_COMPOSITING)
- updateCompositingScrollPosition();
- syncLayers();
-#endif
-}
-
-
-void QGraphicsWebViewPrivate::setInputMethodEnabled(bool enable)
-{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- q->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
-#endif
-}
-
-bool QGraphicsWebViewPrivate::inputMethodEnabled() const
-{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- return q->flags() & QGraphicsItem::ItemAcceptsInputMethod;
-#else
- return false;
-#endif
-}
-
-#if QT_VERSION >= 0x040600
-void QGraphicsWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
-{
- if (enable)
- q->setInputMethodHints(q->inputMethodHints() | hint);
- else
- q->setInputMethodHints(q->inputMethodHints() & ~hint);
-}
-#endif
-#ifndef QT_NO_CURSOR
-QCursor QGraphicsWebViewPrivate::cursor() const
-{
- return q->cursor();
-}
-
-void QGraphicsWebViewPrivate::updateCursor(const QCursor& cursor)
-{
- q->setCursor(cursor);
-}
-#endif
-
-QPalette QGraphicsWebViewPrivate::palette() const
-{
- return q->palette();
-}
-
-int QGraphicsWebViewPrivate::screenNumber() const
-{
-#if defined(Q_WS_X11)
- if (QGraphicsScene* scene = q->scene()) {
- const QList<QGraphicsView*> views = scene->views();
-
- if (!views.isEmpty())
- return views.at(0)->x11Info().screen();
- }
-#endif
-
- return 0;
-}
-
-QWidget* QGraphicsWebViewPrivate::ownerWidget() const
-{
- if (QGraphicsScene* scene = q->scene()) {
- const QList<QGraphicsView*> views = scene->views();
- return views.value(0);
- }
- return 0;
-}
-
-QRect QGraphicsWebViewPrivate::geometryRelativeToOwnerWidget() const
-{
- if (!q->scene())
- return QRect();
-
- QList<QGraphicsView*> views = q->scene()->views();
- if (views.isEmpty())
- return QRect();
-
- QGraphicsView* view = views.at(0);
- return view->mapFromScene(q->boundingRect()).boundingRect();
-}
-
-QObject* QGraphicsWebViewPrivate::pluginParent() const
-{
- return q;
-}
-
-QStyle* QGraphicsWebViewPrivate::style() const
-{
- return q->style();
-}
-
void QGraphicsWebViewPrivate::updateResizesToContentsForPage()
{
ASSERT(page);
@@ -418,7 +153,7 @@ void QGraphicsWebViewPrivate::_q_contentsSizeChanged(const QSize& size)
void QGraphicsWebViewPrivate::_q_scaleChanged()
{
#if ENABLE(TILED_BACKING_STORE)
- updateTiledBackingStoreScale();
+ static_cast<PageClientQGraphicsWidget*>(page->d->client)->updateTiledBackingStoreScale();
#endif
}
@@ -441,16 +176,6 @@ QRectF QGraphicsWebViewPrivate::graphicsItemVisibleRect() const
return q->mapRectFromScene(QRectF(QPoint(xPosition, yPosition), views[0]->viewport()->size()));
}
-#if ENABLE(TILED_BACKING_STORE)
-void QGraphicsWebViewPrivate::updateTiledBackingStoreScale()
-{
- WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore();
- if (!backingStore)
- return;
- backingStore->setContentsScale(q->scale());
-}
-#endif
-
/*!
\class QGraphicsWebView
\brief The QGraphicsWebView class allows Web content to be added to a GraphicsView.
@@ -554,18 +279,6 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
*/
QGraphicsWebView::~QGraphicsWebView()
{
- if (d->page) {
-#if QT_VERSION >= 0x040600
- d->page->d->view.clear();
-#else
- d->page->d->view = 0;
-#endif
- d->page->d->client = 0; // unset the page client
- }
-
- if (d->page && d->page->parent() == this)
- delete d->page;
-
delete d;
}
@@ -599,12 +312,7 @@ void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem*
#if ENABLE(TILED_BACKING_STORE)
if (WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore()) {
// FIXME: We should set the backing store viewport earlier than in paint
- if (d->resizesToContents)
- backingStore->viewportChanged(WebCore::IntRect(d->graphicsItemVisibleRect()));
- else {
- QRectF visibleRect(d->page->mainFrame()->scrollPosition(), d->page->mainFrame()->geometry().size());
- backingStore->viewportChanged(WebCore::IntRect(visibleRect));
- }
+ backingStore->adjustVisibleRect();
// QWebFrame::render is a public API, bypass it for tiled rendering so behavior does not need to change.
WebCore::GraphicsContext context(painter);
page()->mainFrame()->d->renderFromTiledBackingStore(&context, option->exposedRect.toAlignedRect());
@@ -713,7 +421,7 @@ bool QGraphicsWebView::event(QEvent* event)
// WebCore.
// FIXME: Add a QEvent::CursorUnset or similar to Qt.
if (cursor().shape() == Qt::ArrowCursor)
- d->resetCursor();
+ d->page->d->client->resetCursor();
}
#endif
}
@@ -721,18 +429,19 @@ bool QGraphicsWebView::event(QEvent* event)
return QGraphicsWidget::event(event);
}
-void QGraphicsWebViewPrivate::unsetPageIfExists()
+void QGraphicsWebViewPrivate::detachCurrentPage()
{
if (!page)
return;
- // if the page client is the special client constructed for
- // delegating the responsibilities to a QWidget, we need
- // to destroy it.
-
- if (page->d->client && page->d->client->isQWidgetClient())
- delete page->d->client;
+#if QT_VERSION >= 0x040600
+ page->d->view.clear();
+#else
+ page->d->view = 0;
+#endif
+ // The client has always to be deleted.
+ delete page->d->client;
page->d->client = 0;
// if the page was created by us, we own it and need to
@@ -742,6 +451,8 @@ void QGraphicsWebViewPrivate::unsetPageIfExists()
delete page;
else
page->disconnect(q);
+
+ page = 0;
}
/*!
@@ -758,16 +469,17 @@ void QGraphicsWebView::setPage(QWebPage* page)
if (d->page == page)
return;
- d->unsetPageIfExists();
+ d->detachCurrentPage();
d->page = page;
if (!d->page)
return;
- d->page->d->client = d; // set the page client
+ d->page->d->client = new PageClientQGraphicsWidget(this, page); // set the page client
+ d->overlay = static_cast<PageClientQGraphicsWidget*>(d->page->d->client)->overlay;
if (d->overlay)
- d->overlay->prepareGeometryChange();
+ d->overlay->prepareGraphicsItemGeometryChange();
QSize size = geometry().size().toSize();
page->setViewportSize(size);
@@ -878,7 +590,7 @@ qreal QGraphicsWebView::zoomFactor() const
void QGraphicsWebView::updateGeometry()
{
if (d->overlay)
- d->overlay->prepareGeometryChange();
+ d->overlay->prepareGraphicsItemGeometryChange();
QGraphicsWidget::updateGeometry();
@@ -896,7 +608,7 @@ void QGraphicsWebView::setGeometry(const QRectF& rect)
QGraphicsWidget::setGeometry(rect);
if (d->overlay)
- d->overlay->prepareGeometryChange();
+ d->overlay->prepareGraphicsItemGeometryChange();
if (!d->page)
return;
@@ -1130,8 +842,10 @@ void QGraphicsWebView::setResizesToContents(bool enabled)
if (d->resizesToContents == enabled)
return;
d->resizesToContents = enabled;
- if (d->page)
+ if (d->page) {
+ static_cast<PageClientQGraphicsWidget*>(d->page->d->client)->viewResizesToContents = enabled;
d->updateResizesToContentsForPage();
+ }
}
bool QGraphicsWebView::resizesToContents() const
diff --git a/WebKit/qt/Api/qwebdatabase.cpp b/WebKit/qt/Api/qwebdatabase.cpp
index 4e8fd30..ba039c7 100644
--- a/WebKit/qt/Api/qwebdatabase.cpp
+++ b/WebKit/qt/Api/qwebdatabase.cpp
@@ -39,8 +39,10 @@ using namespace WebCore;
access on a local computer through JavaScript. QWebDatabase is the C++ interface to these
databases.
- To get access to all databases defined by a security origin, use QWebSecurityOrigin::databases().
- Each database has an internal name(), as well as a user-friendly name, provided by displayName().
+ Databases are grouped together in security origins. To get access to all databases defined by
+ a security origin, use QWebSecurityOrigin::databases(). Each database has an internal name(),
+ as well as a user-friendly name, provided by displayName(). These names are specified when
+ creating the database in the JavaScript code.
WebKit uses SQLite to create and access the local SQL databases. The location of the database
file in the local file system is returned by fileName(). You can access the database directly
@@ -49,7 +51,7 @@ using namespace WebCore;
For each database the web site can define an expectedSize(). The current size of the database
in bytes is returned by size().
- For more information refer to the \l{http://dev.w3.org/html5/webdatabase/}{HTML 5 Draft Standard}.
+ For more information refer to the \l{http://dev.w3.org/html5/webdatabase/}{HTML5 Web SQL Database Draft Standard}.
\sa QWebSecurityOrigin
*/
@@ -80,7 +82,7 @@ QString QWebDatabase::name() const
}
/*!
- Returns the name of the database as seen by the user.
+ Returns the name of the database in a format that is suitable for display to the user.
*/
QString QWebDatabase::displayName() const
{
diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp
index 551346b..d2cdf79 100644
--- a/WebKit/qt/Api/qwebelement.cpp
+++ b/WebKit/qt/Api/qwebelement.cpp
@@ -84,13 +84,27 @@ public:
\snippet webkitsnippets/webelement/main.cpp Traversing with QWebElement
+ Individual elements can be inspected or changed using methods such as attribute()
+ or setAttribute(). For examle, to capture the user's input in a text field for later
+ use (auto-completion), a browser could do something like this:
+
+ \snippet webkitsnippets/webelement/main.cpp autocomplete1
+
+ When the same page is later revisited, the browser can fill in the text field automatically
+ by modifying the value attribute of the input element:
+
+ \snippet webkitsnippets/webelement/main.cpp autocomplete2
+
+ Another use case is to emulate a click event on an element. The following
+ code snippet demonstrates how to call the JavaScript DOM method click() of
+ a submit button:
+
+ \snippet webkitsnippets/webelement/main.cpp Calling a DOM element method
+
The underlying content of QWebElement is explicitly shared. Creating a copy
of a QWebElement does not create a copy of the content. Instead, both
instances point to the same element.
- The element's attributes can be read using attribute() and modified with
- setAttribute().
-
The contents of child elements can be converted to plain text with
toPlainText(); to XHTML using toInnerXml(). To include the element's tag in
the output, use toOuterXml().
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index e6ee00f..4b12545 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -88,8 +88,9 @@ QT_BEGIN_NAMESPACE
extern Q_GUI_EXPORT int qt_defaultDpi();
QT_END_NAMESPACE
-static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const QPoint& pos)
+bool QWEBKIT_EXPORT qtwebkit_webframe_scrollOverflow(QWebFrame* qFrame, int dx, int dy, const QPoint& pos)
{
+ WebCore::Frame* frame = QWebFramePrivate::core(qFrame);
if (!frame || !frame->document() || !frame->view() || !frame->eventHandler())
return false;
@@ -112,17 +113,24 @@ static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const
bool scrolledHorizontal = false;
bool scrolledVertical = false;
- if (dx > 0)
- scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx);
- else if (dx < 0)
- scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx));
+ do {
+ if (dx > 0)
+ scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx);
+ else if (dx < 0)
+ scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx));
+
+ if (dy > 0)
+ scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy);
+ else if (dy < 0)
+ scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy));
+
+ if (scrolledHorizontal || scrolledVertical)
+ return true;
- if (dy > 0)
- scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy);
- else if (dy < 0)
- scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy));
+ renderLayer = renderLayer->parent();
+ } while (renderLayer);
- return (scrolledHorizontal || scrolledVertical);
+ return false;
}
@@ -138,7 +146,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d
if (!qFrame)
return;
- if (webframe_scrollOverflow(QWebFramePrivate::core(qFrame), dx, dy, pos))
+ if (qtwebkit_webframe_scrollOverflow(qFrame, dx, dy, pos))
return;
bool scrollHorizontal = false;
@@ -152,7 +160,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d
if (dy > 0) // scroll down
scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical);
- else if (dy < 0) //scroll up
+ else if (dy < 0) //scroll up
scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical);
if (scrollHorizontal || scrollVertical) {
@@ -364,8 +372,10 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame:
can connect to the web page's \l{QWebPage::}{frameCreated()} signal
to be notified when a new frame is created.
- The hitTestContent() function can be used to programmatically examine the
- contents of a frame.
+ There are multiple ways to programmatically examine the contents of a frame.
+ The hitTestContent() function can be used to find elements by coordinate.
+ For access to the underlying DOM tree, there is documentElement(),
+ findAllElements() and findFirstElement().
A QWebFrame can be printed onto a QPrinter using the print() function.
This function is marked as a slot and can be conveniently connected to
@@ -593,6 +603,10 @@ static inline QUrl ensureAbsoluteUrl(const QUrl &url)
\property QWebFrame::url
\brief the url of the frame currently viewed
+ Setting this property clears the view and loads the URL.
+
+ By default, this property contains an empty, invalid URL.
+
\sa urlChanged()
*/
diff --git a/WebKit/qt/Api/qwebhistoryinterface.cpp b/WebKit/qt/Api/qwebhistoryinterface.cpp
index 80567d1..61cf5af 100644
--- a/WebKit/qt/Api/qwebhistoryinterface.cpp
+++ b/WebKit/qt/Api/qwebhistoryinterface.cpp
@@ -41,7 +41,7 @@ static void gCleanupInterface()
/*!
Sets a new default interface, \a defaultInterface, that will be used by all of WebKit
- for managing history.
+ to keep track of visited links.
If an interface without a parent has already been set, the old interface will be deleted.
When the application exists QWebHistoryInterface will automatically delete the
@@ -68,8 +68,9 @@ void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface* defaultInte
}
/*!
- Returns the default interface that will be used by WebKit. If no
- default interface has been set, QtWebkit will not track history.
+ Returns the default interface that will be used by WebKit. If no default interface has been set,
+ Webkit will not keep track of visited links and a null pointer will be returned.
+ \sa setDefaultInterface
*/
QWebHistoryInterface* QWebHistoryInterface::defaultInterface()
{
@@ -84,11 +85,15 @@ QWebHistoryInterface* QWebHistoryInterface::defaultInterface()
\inmodule QtWebKit
The QWebHistoryInterface is an interface that can be used to
- implement link history. It contains two pure virtual methods that
- are called by the WebKit engine. addHistoryEntry() is used to add
- pages that have been visited to the interface, while
- historyContains() is used to query whether this page has been
- visited by the user.
+ keep track of visited links. It contains two pure virtual methods that
+ are called by the WebKit engine: addHistoryEntry() is used to add
+ urls that have been visited to the interface, while
+ historyContains() is used to query whether the given url has been
+ visited by the user. By default the QWebHistoryInterface is not set, so WebKit does not keep
+ track of visited links.
+
+ \note The history tracked by QWebHistoryInterface is not specific to an instance of QWebPage
+ but applies to all pages.
*/
/*!
@@ -100,7 +105,7 @@ QWebHistoryInterface::QWebHistoryInterface(QObject* parent)
}
/*!
- Destructor. If this is currently the default interface it will be unset.
+ Destroys the interface. If this is currently the default interface it will be unset.
*/
QWebHistoryInterface::~QWebHistoryInterface()
{
diff --git a/WebKit/qt/Api/qwebinspector.cpp b/WebKit/qt/Api/qwebinspector.cpp
index c0e5277..802ea98 100644
--- a/WebKit/qt/Api/qwebinspector.cpp
+++ b/WebKit/qt/Api/qwebinspector.cpp
@@ -31,17 +31,23 @@
/*!
\class QWebInspector
\since 4.6
+ \inmodule QtWebKit
\brief The QWebInspector class allows the placement and control of a
QWebPage's inspector.
- The inspector allows you to see a page current hierarchy and loading
- statistics.
+ The inspector can display a page's hierarchy, its loading statistics and
+ the current state of its individual elements. It is mostly used by web
+ developers.
- The QWebPage to be inspected is determined with the setPage() method.
+ The QWebPage to be inspected must be specified using the setPage() method.
A typical use of QWebInspector follows:
\snippet webkitsnippets/qtwebkit_qwebinspector_snippet.cpp 0
+ A QWebInspector can be made visible either programmatically using
+ setVisible(), or by the user through the attached QWebPage's context
+ menu.
+
\note A QWebInspector will display a blank widget if either:
\list
\o page() is null
@@ -61,17 +67,16 @@
\section1 Inspector configuration persistence
The inspector allows the user to configure some options through its
- interface (e.g. the resource tracking "Always enable" option).
- These settings are persisted automatically by QtWebKit using QSettings.
-
- However since the QSettings object is instantiated using the empty
- constructor, QCoreApplication::setOrganizationName() and
- QCoreApplication::setApplicationName() must be called within your
- application to enable the persistence of these options.
+ user interface (e.g. the resource tracking "Always enable" option).
+ These settings will be persisted automatically by QtWebKit only if
+ your application previously called QCoreApplication::setOrganizationName()
+ and QCoreApplication::setApplicationName().
+ See QSettings's default constructor documentation for an explanation
+ of why this is necessary.
*/
/*!
- Constructs an empty QWebInspector with parent \a parent.
+ Constructs an unbound QWebInspector with \a parent as its parent.
*/
QWebInspector::QWebInspector(QWidget* parent)
: QWidget(parent)
@@ -89,16 +94,16 @@ QWebInspector::~QWebInspector()
}
/*!
- Sets the QWebPage to be inspected.
-
- There can only be one QWebInspector associated with a QWebPage
- and vices versa.
+ Bind this inspector to the QWebPage to be inspected.
- Calling with \a page as null will break the current association, if any.
-
- If \a page is already associated to another QWebInspector, the association
- will be replaced and the previous QWebInspector will have no page
- associated.
+ \bold {Notes:}
+ \list
+ \o There can only be one QWebInspector associated with a QWebPage
+ and vice versa.
+ \o Calling this method with a null \a page will break the current association, if any.
+ \o If \a page is already associated to another QWebInspector, the association
+ will be replaced and the previous QWebInspector will become unbound
+ \endlist
\sa page()
*/
diff --git a/WebKit/qt/Api/qwebkitglobal.h b/WebKit/qt/Api/qwebkitglobal.h
index 665bf1b..d83d569 100644
--- a/WebKit/qt/Api/qwebkitglobal.h
+++ b/WebKit/qt/Api/qwebkitglobal.h
@@ -22,9 +22,9 @@
#include <QtCore/qglobal.h>
-#define QTWEBKIT_VERSION_STR "2.0.0"
+#define QTWEBKIT_VERSION_STR "2.1.0"
// QTWEBKIT_VERSION is (major << 16) + (minor << 8) + patch. Similar to Qt.
-#define QTWEBKIT_VERSION 0x020000
+#define QTWEBKIT_VERSION 0x020100
// Use: #if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 0, 0)). Similar to Qt.
#define QTWEBKIT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h
new file mode 100644
index 0000000..7d024ae
--- /dev/null
+++ b/WebKit/qt/Api/qwebkitplatformplugin.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef QWEBKITPLATFORMPLUGIN_H
+#define QWEBKITPLATFORMPLUGIN_H
+
+/*
+ * Warning: The contents of this file is not part of the public QtWebKit API
+ * and may be changed from version to version or even be completely removed.
+*/
+
+#include <QObject>
+
+class QWebSelectData
+{
+public:
+ inline ~QWebSelectData() {}
+
+ enum ItemType { Option, Group, Separator };
+
+ virtual ItemType itemType(int) const = 0;
+ virtual QString itemText(int index) const = 0;
+ virtual QString itemToolTip(int index) const = 0;
+ virtual bool itemIsEnabled(int index) const = 0;
+ virtual bool itemIsSelected(int index) const = 0;
+ virtual int itemCount() const = 0;
+ virtual bool multiple() const = 0;
+};
+
+class QWebSelectMethod : public QObject
+{
+ Q_OBJECT
+public:
+ inline ~QWebSelectMethod() {}
+
+ virtual void show(const QWebSelectData&) = 0;
+ virtual void hide() = 0;
+
+Q_SIGNALS:
+ void selectItem(int index, bool allowMultiplySelections, bool shift);
+ void didHide();
+};
+
+class QWebKitPlatformPlugin
+{
+public:
+ inline ~QWebKitPlatformPlugin() {}
+
+ enum Extension {
+ MultipleSelections
+ };
+
+ virtual QWebSelectMethod* createSelectInputMethod() const = 0;
+ virtual bool supportsExtension(Extension extension) const = 0;
+
+};
+
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.0");
+
+#endif // QWEBKITPLATFORMPLUGIN_H
diff --git a/WebKit/qt/Api/qwebkitversion.cpp b/WebKit/qt/Api/qwebkitversion.cpp
index 062839f..181913b 100644
--- a/WebKit/qt/Api/qwebkitversion.cpp
+++ b/WebKit/qt/Api/qwebkitversion.cpp
@@ -22,11 +22,21 @@
#include <WebKitVersion.h>
/*!
-
+ \relates QWebPage
+ \since 4.6
Returns the version number of WebKit at run-time as a string (for
- example, "531.3"). This is the version of WebKit the application
- was compiled against.
+ example, "531.3").
+
+ This version is commonly used in WebKit based browsers as part
+ of the user agent string. Web servers and JavaScript might use
+ it to identify the presence of certain WebKit engine features
+ and behaviour.
+ The evolution of this version is bound to the releases of Apple's
+ Safari browser. For a version specific to the QtWebKit library,
+ see QTWEBKIT_VERSION
+
+ \sa QWebPage::userAgentForUrl()
*/
QString qWebKitVersion()
{
@@ -34,11 +44,13 @@ QString qWebKitVersion()
}
/*!
-
+ \relates QWebPage
+ \since 4.6
Returns the 'major' version number of WebKit at run-time as an integer
(for example, 531). This is the version of WebKit the application
was compiled against.
+ \sa qWebKitVersion()
*/
int qWebKitMajorVersion()
{
@@ -46,13 +58,57 @@ int qWebKitMajorVersion()
}
/*!
-
+ \relates QWebPage
+ \since 4.6
Returns the 'minor' version number of WebKit at run-time as an integer
(for example, 3). This is the version of WebKit the application
was compiled against.
+ \sa qWebKitVersion()
*/
int qWebKitMinorVersion()
{
return WEBKIT_MINOR_VERSION;
}
+
+/*!
+ \macro QTWEBKIT_VERSION
+ \relates QWebPage
+
+ This macro expands a numeric value of the form 0xMMNNPP (MM =
+ major, NN = minor, PP = patch) that specifies QtWebKit's version
+ number. For example, if you compile your application against QtWebKit
+ 2.1.2, the QTWEBKIT_VERSION macro will expand to 0x020102.
+
+ You can use QTWEBKIT_VERSION to use the latest QtWebKit API where
+ available.
+
+ \sa QT_VERSION
+*/
+
+/*!
+ \macro QTWEBKIT_VERSION_STR
+ \relates QWebPage
+
+ This macro expands to a string that specifies QtWebKit's version number
+ (for example, "2.1.2"). This is the version against which the
+ application is compiled.
+
+ \sa QTWEBKIT_VERSION
+*/
+
+/*!
+ \macro QTWEBKIT_VERSION_CHECK
+ \relates QWebPage
+
+ Turns the major, minor and patch numbers of a version into an
+ integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can
+ be compared with another similarly processed version id, for example
+ in a preprocessor statement:
+
+ \code
+ #if QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 1, 0)
+ // code to use API new in QtWebKit 2.1.0
+ #endif
+ \endcode
+*/
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index c9fc210..3810155 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -1478,7 +1478,7 @@ InspectorController* QWebPagePrivate::inspectorController()
/*!
\enum QWebPage::FindFlag
- This enum describes the options available to QWebPage's findText() function. The options
+ This enum describes the options available to the findText() function. The options
can be OR-ed together from the following list:
\value FindBackward Searches backwards instead of forwards.
@@ -1499,6 +1499,8 @@ InspectorController* QWebPagePrivate::inspectorController()
\value DelegateExternalLinks When activating links that point to documents not stored on the
local filesystem or an equivalent - such as the Qt resource system - then linkClicked() is emitted.
\value DelegateAllLinks Whenever a link is activated the linkClicked() signal is emitted.
+
+ \sa QWebPage::linkDelegationPolicy
*/
/*!
@@ -1513,6 +1515,8 @@ InspectorController* QWebPagePrivate::inspectorController()
\value NavigationTypeReload The user activated the reload action.
\value NavigationTypeFormResubmitted An HTML form was submitted a second time.
\value NavigationTypeOther A navigation to another document using a method not listed above.
+
+ \sa acceptNavigationRequest()
*/
/*!
@@ -1522,7 +1526,7 @@ InspectorController* QWebPagePrivate::inspectorController()
Actions only have an effect when they are applicable. The availability of
actions can be be determined by checking \l{QAction::}{isEnabled()} on the
- action returned by \l{QWebPage::}{action()}.
+ action returned by action().
One method of enabling the text editing, cursor movement, and text selection actions
is by setting \l contentEditable to true.
@@ -1604,6 +1608,8 @@ InspectorController* QWebPagePrivate::inspectorController()
/*!
\enum QWebPage::WebWindowType
+ This enum describes the types of window that can be created by the createWindow() function.
+
\value WebBrowserWindow The window is a regular web browser window.
\value WebModalDialog The window acts as modal dialog.
*/
@@ -1620,11 +1626,13 @@ InspectorController* QWebPagePrivate::inspectorController()
to provide functionality like QWebView in a widget-less environment.
QWebPage's API is very similar to QWebView, as you are still provided with
- common functions like action() (known as \l{QWebView::}{pageAction()} in
- QWebView), triggerAction(), findText() and settings(). More QWebView-like
- functions can be found in the main frame of QWebPage, obtained via
- QWebPage::mainFrame(). For example, the load(), setUrl() and setHtml()
- unctions for QWebPage can be accessed using QWebFrame.
+ common functions like action() (known as
+ \l{QWebView::pageAction()}{pageAction}() in QWebView), triggerAction(),
+ findText() and settings(). More QWebView-like functions can be found in the
+ main frame of QWebPage, obtained via the mainFrame() function. For example,
+ the \l{QWebFrame::load()}{load}(), \l{QWebFrame::setUrl()}{setUrl}() and
+ \l{QWebFrame::setHtml()}{setHtml}() functions for QWebPage can be accessed
+ using QWebFrame.
The loadStarted() signal is emitted when the page begins to load.The
loadProgress() signal, on the other hand, is emitted whenever an element
@@ -1728,7 +1736,8 @@ QWebFrame *QWebPage::currentFrame() const
/*!
\since 4.6
- Returns the frame at the given point \a pos.
+ Returns the frame at the given point \a pos, or 0 if there is no frame at
+ that position.
\sa mainFrame(), currentFrame()
*/
@@ -1847,7 +1856,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
result should be written to \a result and true should be returned. If the prompt was not cancelled by the
user, the implementation should return true and the result string must not be null.
- The default implementation uses QInputDialog::getText.
+ The default implementation uses QInputDialog::getText().
*/
bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result)
{
@@ -2061,6 +2070,8 @@ QSize QWebPage::viewportSize() const
By default, for a newly-created Web page, this property contains a size with
zero width and height.
+
+ \sa QWebFrame::render(), preferredContentsSize
*/
void QWebPage::setViewportSize(const QSize &size) const
{
@@ -2089,11 +2100,12 @@ QSize QWebPage::preferredContentsSize() const
/*!
\property QWebPage::preferredContentsSize
\since 4.6
- \brief the size of the fixed layout
+ \brief the preferred size of the contents
- The size affects the layout of the page in the viewport. If set to a fixed size of
- 1024x768 for example then webkit will layout the page as if the viewport were that size
- rather than something different.
+ If this property is set to a valid size, it is used to lay out the page.
+ If it is not set (the default), the viewport size is used instead.
+
+ \sa viewportSize
*/
void QWebPage::setPreferredContentsSize(const QSize &size) const
{
@@ -2441,9 +2453,11 @@ QAction *QWebPage::action(WebAction action) const
/*!
\property QWebPage::modified
- \brief whether the page contains unsubmitted form data
+ \brief whether the page contains unsubmitted form data, or the contents have been changed.
By default, this property is false.
+
+ \sa contentsChanged(), contentEditable, undoStack()
*/
bool QWebPage::isModified() const
{
@@ -2459,6 +2473,8 @@ bool QWebPage::isModified() const
#ifndef QT_NO_UNDOSTACK
/*!
Returns a pointer to the undo stack used for editable content.
+
+ \sa modified
*/
QUndoStack *QWebPage::undoStack() const
{
@@ -2581,7 +2597,7 @@ bool QWebPage::event(QEvent *ev)
}
/*!
- Similar to QWidget::focusNextPrevChild it focuses the next focusable web element
+ Similar to QWidget::focusNextPrevChild() it focuses the next focusable web element
if \a next is true; otherwise the previous element is focused.
Returns true if it can find a new focusable element, or false if it can't.
@@ -2608,6 +2624,8 @@ bool QWebPage::focusNextPrevChild(bool next)
If this property is enabled the contents of the page can be edited by the user through a visible
cursor. If disabled (the default) only HTML elements in the web page with their
\c{contenteditable} attribute set are editable.
+
+ \sa modified, contentsChanged(), WebAction
*/
void QWebPage::setContentEditable(bool editable)
{
@@ -2777,17 +2795,21 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
as a result of the user clicking on a "file upload" button in a HTML form where multiple
file selection is allowed.
- \omitvalue ErrorPageExtension (introduced in Qt 4.6)
+ \value ErrorPageExtension Whether the web page can provide an error page when loading fails.
+ (introduced in Qt 4.6)
+
+ \sa ChooseMultipleFilesExtensionOption, ChooseMultipleFilesExtensionReturn, ErrorPageExtensionOption, ErrorPageExtensionReturn
*/
/*!
\enum QWebPage::ErrorDomain
\since 4.6
- \internal
- \value QtNetwork
- \value Http
- \value WebKit
+ This enum describes the domain of an ErrorPageExtensionOption object (i.e. the layer in which the error occurred).
+
+ \value QtNetwork The error occurred in the QtNetwork layer; the error code is of type QNetworkReply::NetworkError.
+ \value Http The error occurred in the HTTP layer; the error code is a HTTP status code (see QNetworkRequest::HttpStatusCodeAttribute).
+ \value WebKit The error is an internal WebKit error.
*/
/*!
@@ -2797,7 +2819,18 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\inmodule QtWebKit
- \sa QWebPage::extension()
+ \sa QWebPage::extension() QWebPage::ExtensionReturn
+*/
+
+
+/*!
+ \class QWebPage::ExtensionReturn
+ \since 4.4
+ \brief The ExtensionReturn class provides an output result from a QWebPage's extension.
+
+ \inmodule QtWebKit
+
+ \sa QWebPage::extension() QWebPage::ExtensionOption
*/
/*!
@@ -2808,12 +2841,38 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\inmodule QtWebKit
- The ErrorPageExtensionOption class holds the \a url for which an error occoured as well as
+ The ErrorPageExtensionOption class holds the \a url for which an error occurred as well as
the associated \a frame.
The error itself is reported by an error \a domain, the \a error code as well as \a errorString.
- \sa QWebPage::ErrorPageExtensionReturn
+ \sa QWebPage::extension() QWebPage::ErrorPageExtensionReturn
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::url
+ \brief the url for which an error occurred
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::frame
+ \brief the frame associated with the error
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::domain
+ \brief the domain that reported the error
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::error
+ \brief the error code. Interpretation of the value depends on the \a domain
+ \sa QWebPage::ErrorDomain
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::errorString
+ \brief a string that describes the error
*/
/*!
@@ -2834,7 +2893,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
External objects such as stylesheets or images referenced in the HTML are located relative to
\a baseUrl.
- \sa QWebPage::ErrorPageExtensionOption, QString::toUtf8()
+ \sa QWebPage::extension() QWebPage::ErrorPageExtensionOption, QString::toUtf8()
*/
/*!
@@ -2843,6 +2902,29 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
Constructs a new error page object.
*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::contentType
+ \brief the error page's content type
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::encoding
+ \brief the error page encoding
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::baseUrl
+ \brief the base url
+
+ External objects such as stylesheets or images referenced in the HTML are located relative to this url.
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::content
+ \brief the HTML content of the error page
+*/
+
/*!
\class QWebPage::ChooseMultipleFilesExtensionOption
\since 4.5
@@ -2854,7 +2936,22 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
The ChooseMultipleFilesExtensionOption class holds the frame originating the request
and the suggested filenames which might be provided.
- \sa QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
+ \sa QWebPage::extension() QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
+*/
+
+/*!
+ \variable QWebPage::ChooseMultipleFilesExtensionOption::parentFrame
+ \brief The frame in which the request originated
+*/
+
+/*!
+ \variable QWebPage::ChooseMultipleFilesExtensionOption::suggestedFileNames
+ \brief The suggested filenames
+*/
+
+/*!
+ \variable QWebPage::ChooseMultipleFilesExtensionReturn::fileNames
+ \brief The selected filenames
*/
/*!
@@ -2868,14 +2965,17 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user
when the extension is invoked.
- \sa QWebPage::ChooseMultipleFilesExtensionOption
+ \sa QWebPage::extension() QWebPage::ChooseMultipleFilesExtensionOption
*/
/*!
This virtual function can be reimplemented in a QWebPage subclass to provide support for extensions. The \a option
argument is provided as input to the extension; the output results can be stored in \a output.
- The behavior of this function is determined by \a extension.
+ The behavior of this function is determined by \a extension. The \a option
+ and \a output values are typically casted to the corresponding types (for
+ example, ChooseMultipleFilesExtensionOption and
+ ChooseMultipleFilesExtensionReturn for ChooseMultipleFilesExtension).
You can call supportsExtension() to check if an extension is supported by the page.
@@ -2967,6 +3067,8 @@ QWebSettings *QWebPage::settings() const
A suggested filename may be provided in \a suggestedFile. The frame originating the
request is provided as \a parentFrame.
+
+ \sa ChooseMultipleFilesExtension
*/
QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile)
{
@@ -3220,6 +3322,15 @@ QString QWebPage::userAgentForUrl(const QUrl&) const
case QSysInfo::SV_9_4:
firstPartTemp += QString::fromLatin1("/9.4");
break;
+ case QSysInfo::SV_SF_2:
+ firstPartTemp += QString::fromLatin1("^2");
+ break;
+ case QSysInfo::SV_SF_3:
+ firstPartTemp += QString::fromLatin1("^3");
+ break;
+ case QSysInfo::SV_SF_4:
+ firstPartTemp += QString::fromLatin1("^4");
+ break;
default:
firstPartTemp += QString::fromLatin1("/Unknown");
}
@@ -3330,7 +3441,7 @@ quint64 QWebPage::totalBytes() const
/*!
Returns the number of bytes that were received from the network to render the current page.
- \sa totalBytes()
+ \sa totalBytes(), loadProgress()
*/
quint64 QWebPage::bytesReceived() const
{
@@ -3362,7 +3473,7 @@ quint64 QWebPage::bytesReceived() const
This signal is emitted when a load of the page is finished.
\a ok will indicate whether the load was successful or any error occurred.
- \sa loadStarted()
+ \sa loadStarted(), ErrorPageExtension
*/
/*!
@@ -3389,12 +3500,15 @@ quint64 QWebPage::bytesReceived() const
\fn void QWebPage::frameCreated(QWebFrame *frame)
This signal is emitted whenever the page creates a new \a frame.
+
+ \sa currentFrame()
*/
/*!
\fn void QWebPage::selectionChanged()
- This signal is emitted whenever the selection changes.
+ This signal is emitted whenever the selection changes, either interactively
+ or programmatically (e.g. by calling triggerAction() with a selection action).
\sa selectedText()
*/
@@ -3406,7 +3520,7 @@ quint64 QWebPage::bytesReceived() const
This signal is emitted whenever the text in form elements changes
as well as other editable content.
- \sa contentEditable, QWebFrame::toHtml(), QWebFrame::toPlainText()
+ \sa contentEditable, modified, QWebFrame::toHtml(), QWebFrame::toPlainText()
*/
/*!
@@ -3482,9 +3596,9 @@ quint64 QWebPage::bytesReceived() const
\fn void QWebPage::microFocusChanged()
This signal is emitted when for example the position of the cursor in an editable form
- element changes. It is used inform input methods about the new on-screen position where
- the user is able to enter text. This signal is usually connected to QWidget's updateMicroFocus()
- slot.
+ element changes. It is used to inform input methods about the new on-screen position where
+ the user is able to enter text. This signal is usually connected to the
+ QWidget::updateMicroFocus() slot.
*/
/*!
@@ -3495,6 +3609,9 @@ quint64 QWebPage::bytesReceived() const
By default no links are delegated and are handled by QWebPage instead.
+ \note This signal possibly won't be emitted for clicked links which use
+ JavaScript to trigger navigation.
+
\sa linkHovered()
*/
@@ -3525,6 +3642,8 @@ quint64 QWebPage::bytesReceived() const
This signal is emitted whenever the web site shown in \a frame is asking to store data
to the database \a databaseName and the quota allocated to that web site is exceeded.
+
+ \sa QWebDatabase
*/
/*!
diff --git a/WebKit/qt/Api/qwebpluginfactory.cpp b/WebKit/qt/Api/qwebpluginfactory.cpp
index 8ff13b1..f715430 100644
--- a/WebKit/qt/Api/qwebpluginfactory.cpp
+++ b/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -23,25 +23,40 @@
/*!
\class QWebPluginFactory
\since 4.4
- \brief The QWebPluginFactory class creates plugins to be embedded into web
- pages.
+ \brief The QWebPluginFactory class is used to embed custom data types in web pages.
\inmodule QtWebKit
- QWebPluginFactory is a factory for creating plugins for QWebPage. A plugin
- factory can be installed on a QWebPage using QWebPage::setPluginFactory().
+ The HTML \c{<object>} tag is used to embed arbitrary content into a web page,
+ for example:
+
+ \code
+ <object type="application/x-pdf" data="http://qt.nokia.com/document.pdf" width="500" height="400"></object>
+ \endcode
+
+ QtWebkit will natively handle the most basic data types like \c{text/html} and
+ \c{image/jpeg}, but for any advanced or custom data types you will need to
+ provide a handler yourself.
+
+ QWebPluginFactory is a factory for creating plugins for QWebPage, where each
+ plugin provides support for one or more data types. A plugin factory can be
+ installed on a QWebPage using QWebPage::setPluginFactory().
\note The plugin factory is only used if plugins are enabled through QWebSettings.
- You can provide a QWebPluginFactory by implementing the plugins() and the
- create() method. For plugins() it is necessary to describe the plugins the
+ You provide a QWebPluginFactory by implementing the plugins() and the
+ create() methods. For plugins() it is necessary to describe the plugins the
factory can create, including a description and the supported MIME types.
The MIME types each plugin can handle should match the ones specified in
- in the HTML \c{<object>} tag.
+ in the HTML \c{<object>} tag of your content.
The create() method is called if the requested MIME type is supported. The
implementation has to return a new instance of the plugin requested for the
given MIME type and the specified URL.
+
+ The plugins themselves are subclasses of QObject, but currently only plugins
+ based on either QWidget or QGraphicsWidget are supported.
+
*/
@@ -183,6 +198,7 @@ void QWebPluginFactory::refreshPlugins()
/*!
\enum QWebPluginFactory::Extension
+ \internal
This enum describes the types of extensions that the plugin factory can support. Before using these extensions, you
should verify that the extension is supported by calling supportsExtension().
@@ -192,6 +208,7 @@ void QWebPluginFactory::refreshPlugins()
/*!
\class QWebPluginFactory::ExtensionOption
+ \internal
\since 4.4
\brief The ExtensionOption class provides an extended input argument to QWebPluginFactory's extension support.
@@ -202,6 +219,7 @@ void QWebPluginFactory::refreshPlugins()
/*!
\class QWebPluginFactory::ExtensionReturn
+ \internal
\since 4.4
\brief The ExtensionOption class provides an extended output argument to QWebPluginFactory's extension support.
@@ -214,6 +232,8 @@ void QWebPluginFactory::refreshPlugins()
This virtual function can be reimplemented in a QWebPluginFactory subclass to provide support for extensions. The \a option
argument is provided as input to the extension; the output results can be stored in \a output.
+ \internal
+
The behaviour of this function is determined by \a extension.
You can call supportsExtension() to check if an extension is supported by the factory.
@@ -233,6 +253,8 @@ bool QWebPluginFactory::extension(Extension extension, const ExtensionOption *op
/*!
This virtual function returns true if the plugin factory supports \a extension; otherwise false is returned.
+ \internal
+
\sa extension()
*/
bool QWebPluginFactory::supportsExtension(Extension extension) const
diff --git a/WebKit/qt/Api/qwebsecurityorigin.cpp b/WebKit/qt/Api/qwebsecurityorigin.cpp
index b69f24d..fe25d2d 100644
--- a/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -48,6 +48,16 @@ using namespace WebCore;
\c{http://www.malicious.com/evil.html} from accessing \c{http://www.example.com/}'s resources,
because they are of a different security origin.
+ By default local schemes like \c{file://} and \c{qrc://} are concidered to be in the same
+ security origin, and can access each other's resources. You can add additional local schemes
+ by using QWebSecurityOrigin::addLocalScheme(), or override the default same-origin behavior
+ by setting QWebSettings::LocalContentCanAccessFileUrls to \c{false}.
+
+ \note Local resources are by default restricted from accessing remote content, which
+ means your \c{file://} will not be able to access \c{http://domain.com/foo.html}. You
+ can relax this restriction by setting QWebSettings::LocalContentCanAccessRemoteUrls to
+ \c{true}.
+
Call QWebFrame::securityOrigin() to get the QWebSecurityOrigin for a frame in a
web page, and use host(), scheme() and port() to identify the security origin.
@@ -204,7 +214,11 @@ QList<QWebDatabase> QWebSecurityOrigin::databases() const
\since 4.6
Adds the given \a scheme to the list of schemes that are considered equivalent
- to the \c file: scheme. They are not subject to cross domain restrictions.
+ to the \c file: scheme.
+
+ Cross domain restrictions depend on the two web settings QWebSettings::LocalContentCanAccessFileUrls
+ and QWebSettings::LocalContentCanAccessFileUrls. By default all local schemes are concidered to be
+ in the same security origin, and local schemes can not access remote content.
*/
void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
{
@@ -216,6 +230,9 @@ void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
Removes the given \a scheme from the list of local schemes.
+ \note You can not remove the \c{file://} scheme from the list
+ of local schemes.
+
\sa addLocalScheme()
*/
void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
@@ -225,7 +242,10 @@ void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
/*!
\since 4.6
- Returns a list of all the schemes that were set by the application as local schemes,
+ Returns a list of all the schemes concidered to be local.
+
+ By default this is \c{file://} and \c{qrc://}.
+
\sa addLocalScheme(), removeLocalScheme()
*/
QStringList QWebSecurityOrigin::localSchemes()
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index 99fd812..a649658 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -290,8 +290,8 @@ QWebSettings* QWebSettings::globalSettings()
function. The \l{QWebSettings::WebAttribute}{WebAttribute} enum further describes
each attribute.
- QWebSettings also configures global properties such as the Web page memory
- cache and the Web page icon database, local database storage and offline
+ QWebSettings also configures global properties such as the web page memory
+ cache, icon database, local database storage and offline
applications storage.
\section1 Enabling Plugins
@@ -300,8 +300,8 @@ QWebSettings* QWebSettings::globalSettings()
\l{QWebSettings::PluginsEnabled}{PluginsEnabled} attribute. For many applications,
this attribute is enabled for all pages by setting it on the
\l{globalSettings()}{global settings object}. QtWebKit will always ignore this setting
- \when processing Qt plugins. The decision to allow a Qt plugin is made by the client
- \in its reimplementation of QWebPage::createPlugin.
+ when processing Qt plugins. The decision to allow a Qt plugin is made by the client
+ in its reimplementation of QWebPage::createPlugin().
\section1 Web Application Support
@@ -340,7 +340,7 @@ QWebSettings* QWebSettings::globalSettings()
\value MinimumFontSize The hard minimum font size.
\value MinimumLogicalFontSize The minimum logical font size that is applied
- after zooming with QWebFrame's textSizeMultiplier().
+ when zooming out with QWebFrame::setTextSizeMultiplier().
\value DefaultFontSize The default font size for regular text.
\value DefaultFixedFontSize The default font size for fixed-pitch text.
*/
@@ -363,67 +363,76 @@ QWebSettings* QWebSettings::globalSettings()
This enum describes various attributes that are configurable through QWebSettings.
\value AutoLoadImages Specifies whether images are automatically loaded in
- web pages.
+ web pages. This is enabled by default.
\value DnsPrefetchEnabled Specifies whether QtWebkit will try to pre-fetch DNS entries to
- speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later.
+ speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later. This is disabled by default.
\value JavascriptEnabled Enables or disables the running of JavaScript
- programs.
+ programs. This is enabled by default
\value JavaEnabled Enables or disables Java applets.
Currently Java applets are not supported.
- \value PluginsEnabled Enables or disables plugins in Web pages. Qt plugins
- with a mimetype such as "application/x-qt-plugin" are not affected by this setting.
+ \value PluginsEnabled Enables or disables plugins in Web pages (e.g. using NPAPI). Qt plugins
+ with a mimetype such as "application/x-qt-plugin" are not affected by this setting. This is disabled by default.
\value PrivateBrowsingEnabled Private browsing prevents WebKit from
- recording visited pages in the history and storing web page icons.
+ recording visited pages in the history and storing web page icons. This is disabled by default.
\value JavascriptCanOpenWindows Specifies whether JavaScript programs
- can open new windows.
+ can open new windows. This is disabled by default.
\value DOMPasteAllowed Specifies whether JavaScript programs can
read clipboard contents.
+ \value JavascriptCanAccessClipboard Specifies whether JavaScript programs
+ can read or write to the clipboard. This is disabled by default.
\value DeveloperExtrasEnabled Enables extra tools for Web developers.
Currently this enables the "Inspect" element in the context menu as
- well as the use of QWebInspector which controls the WebKit WebInspector
- for web site debugging.
+ well as the use of QWebInspector which controls the web inspector
+ for web site debugging. This is disabled by default.
\value SpatialNavigationEnabled Enables or disables the Spatial Navigation
feature, which consists in the ability to navigate between focusable
elements in a Web page, such as hyperlinks and form controls, by using
- Left, Right, Up and Down arrow keys. For example, if an user presses the
+ Left, Right, Up and Down arrow keys. For example, if a user presses the
Right key, heuristics determine whether there is an element he might be
- trying to reach towards the right, and if there are multiple elements,
- which element he probably wants.
+ trying to reach towards the right and which element he probably wants.
+ This is disabled by default.
\value LinksIncludedInFocusChain Specifies whether hyperlinks should be
- included in the keyboard focus chain.
- \value ZoomTextOnly Specifies whether the zoom factor on a frame applies to
- only the text or all content.
+ included in the keyboard focus chain. This is enabled by default.
+ \value ZoomTextOnly Specifies whether the zoom factor on a frame applies
+ only to the text or to all content. This is disabled by default.
\value PrintElementBackgrounds Specifies whether the background color and images
- are also drawn when the page is printed.
+ are also drawn when the page is printed. This is enabled by default.
\value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5
- offline storage feature is enabled or not. Disabled by default.
+ offline storage feature is enabled or not. This is disabled by default.
\value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5
- web application cache feature is enabled or not. Disabled by default.
+ web application cache feature is enabled or not. This is disabled by default.
\value LocalStorageEnabled Specifies whether support for the HTML 5
- local storage feature is enabled or not. Disabled by default.
+ local storage feature is enabled or not. This is disabled by default.
\value LocalStorageDatabaseEnabled \e{This enum value is deprecated.} Use
QWebSettings::LocalStorageEnabled instead.
- \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls.
- \value LocalContentCanAccessFileUrls Specifies whether locally loaded documents are allowed to access other local urls.
- \value JavaScriptCanAccessClipboard Specifies whether JavaScript can access the clipboard.
- \value XSSAuditingEnabled Specifies whether load requests should be monitored for cross-site scripting attempts.
+ \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are
+ allowed to access remote urls. This is disabled by default. For more information
+ about security origins and local vs. remote content see QWebSecurityOrigin.
+ \value LocalContentCanAccessFileUrls Specifies whether locally loaded documents are
+ allowed to access other local urls. This is enabled by default. For more information
+ about security origins and local vs. remote content see QWebSecurityOrigin.
+ \value XSSAuditingEnabled Specifies whether load requests should be monitored for cross-site
+ scripting attempts. Suspicious scripts will be blocked and reported in the inspector's
+ JavaScript console. Enabling this feature might have an impact on performance
+ and it is disabled by default.
\value AcceleratedCompositingEnabled This feature, when used in conjunction with
QGraphicsWebView, accelerates animations of web content. CSS animations of the transform and
opacity properties will be rendered by composing the cached content of the animated elements.
- This feature is enabled by default
+ This is enabled by default.
\value TiledBackingStoreEnabled This setting enables the tiled backing store feature
for a QGraphicsWebView. With the tiled backing store enabled, the web page contents in and around
the current visible area is speculatively cached to bitmap tiles. The tiles are automatically kept
in sync with the web page as it changes. Enabling tiling can significantly speed up painting heavy
operations like scrolling. Enabling the feature increases memory consumption. It does not work well
with contents using CSS fixed positioning (see also \l{QGraphicsWebView::}{resizesToContents} property).
- \l{QGraphicsWebView::}{tiledBackingStoreFrozen} property allows application to temporarily freeze the contents of the backing store.
+ \l{QGraphicsWebView::}{tiledBackingStoreFrozen} property allows application to temporarily
+ freeze the contents of the backing store. This is disabled by default.
\value FrameFlatteningEnabled With this setting each subframe is expanded to its contents.
On touch devices, it is desired to not have any scrollable sub parts of the page
as it results in a confusing user experience, with scrolling sometimes scrolling sub parts
and at other times scrolling the page itself. For this reason iframes and framesets are
barely usable on touch devices. This will flatten all the frames to become one scrollable page.
- Disabled by default.
+ This is disabled by default.
*/
/*!
@@ -529,7 +538,8 @@ void QWebSettings::resetFontSize(FontSize type)
with UTF-8 and Base64 encoded data, such as:
"data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow=="
- NOTE: In case the base 64 data is not valid the style will not be applied.
+
+ \note If the base64 data is not valid, the style will not be applied.
\sa userStyleSheetUrl()
*/
@@ -580,9 +590,11 @@ QString QWebSettings::defaultTextEncoding() const
Sets the path of the icon database to \a path. The icon database is used
to store "favicons" associated with web sites.
- \a path must point to an existing directory where the icons are stored.
+ \a path must point to an existing directory.
Setting an empty path disables the icon database.
+
+ \sa iconDatabasePath(), clearIconDatabase()
*/
void QWebSettings::setIconDatabasePath(const QString& path)
{
@@ -625,7 +637,7 @@ void QWebSettings::clearIconDatabase()
/*!
Returns the web site's icon for \a url.
- If the web site does not specify an icon, or the icon is not in the
+ If the web site does not specify an icon \bold OR if the icon is not in the
database, a null QIcon is returned.
\note The returned icon's size is arbitrary.
@@ -662,7 +674,7 @@ QWebPluginDatabase *QWebSettings::pluginDatabase()
Sets \a graphic to be drawn when QtWebKit needs to draw an image of the
given \a type.
- For example, when an image cannot be loaded the pixmap specified by
+ For example, when an image cannot be loaded, the pixmap specified by
\l{QWebSettings::WebGraphic}{MissingImageGraphic} is drawn instead.
\sa webGraphic()
@@ -680,9 +692,6 @@ void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap& graphic)
Returns a previously set pixmap used to draw replacement graphics of the
specified \a type.
- For example, when an image cannot be loaded the pixmap specified by
- \l{QWebSettings::WebGraphic}{MissingImageGraphic} is drawn instead.
-
\sa setWebGraphic()
*/
QPixmap QWebSettings::webGraphic(WebGraphic type)
@@ -723,8 +732,7 @@ void QWebSettings::clearMemoryCaches()
Sets the maximum number of pages to hold in the memory page cache to \a pages.
The Page Cache allows for a nicer user experience when navigating forth or back
- to pages in the forward/back history, by pausing and resuming up to \a pages
- per page group.
+ to pages in the forward/back history, by pausing and resuming up to \a pages.
For more information about the feature, please refer to:
@@ -796,8 +804,8 @@ QString QWebSettings::fontFamily(FontFamily which) const
}
/*!
- Resets the actual font family to the default font family, specified by
- \a which.
+ Resets the actual font family specified by \a which to the one set
+ in the global QWebSettings instance.
This function has no effect on the global QWebSettings instance.
*/
@@ -839,7 +847,9 @@ bool QWebSettings::testAttribute(WebAttribute attr) const
/*!
\fn void QWebSettings::resetAttribute(WebAttribute attribute)
- Resets the setting of \a attribute.
+ Resets the setting of \a attribute to the value specified in the
+ global QWebSettings instance.
+
This function has no effect on the global QWebSettings instance.
\sa globalSettings()
@@ -855,12 +865,15 @@ void QWebSettings::resetAttribute(WebAttribute attr)
/*!
\since 4.5
- Sets the path for HTML5 offline storage to \a path.
+ Sets \a path as the save location for HTML5 client-side database storage data.
- \a path must point to an existing directory where the databases are stored.
+ \a path must point to an existing directory.
Setting an empty path disables the feature.
+ Support for client-side databases can enabled by setting the
+ \l{QWebSettings::OfflineStorageDatabaseEnabled}{OfflineStorageDatabaseEnabled} attribute.
+
\sa offlineStoragePath()
*/
void QWebSettings::setOfflineStoragePath(const QString& path)
@@ -873,7 +886,7 @@ void QWebSettings::setOfflineStoragePath(const QString& path)
/*!
\since 4.5
- Returns the path of the HTML5 offline storage or an empty string if the
+ Returns the path of the HTML5 client-side database storage or an empty string if the
feature is disabled.
\sa setOfflineStoragePath()
@@ -910,22 +923,24 @@ qint64 QWebSettings::offlineStorageDefaultQuota()
/*!
\since 4.6
- \relates QWebSettings
Sets the path for HTML5 offline web application cache storage to \a path.
An application cache acts like an HTTP cache in some sense. For documents
- that use the application cache via JavaScript, the loader mechinery will
+ that use the application cache via JavaScript, the loader engine will
first ask the application cache for the contents, before hitting the
network.
The feature is described in details at:
http://dev.w3.org/html5/spec/Overview.html#appcache
- \a path must point to an existing directory where the cache is stored.
+ \a path must point to an existing directory.
Setting an empty path disables the feature.
+ Support for offline web application cache storage can enabled by setting the
+ \l{QWebSettings::OfflineWebApplicationCacheEnabled}{OfflineWebApplicationCacheEnabled} attribute.
+
\sa offlineWebApplicationCachePath()
*/
void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
@@ -937,7 +952,6 @@ void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
/*!
\since 4.6
- \relates QWebSettings
Returns the path of the HTML5 offline web application cache storage
or an empty string if the feature is disabled.
@@ -984,7 +998,6 @@ qint64 QWebSettings::offlineWebApplicationCacheQuota()
/*!
\since 4.6
- \relates QWebSettings
Sets the path for HTML5 local storage to \a path.
@@ -1004,7 +1017,6 @@ void QWebSettings::setLocalStoragePath(const QString& path)
/*!
\since 4.6
- \relates QWebSettings
Returns the path for HTML5 local storage.
@@ -1017,13 +1029,14 @@ QString QWebSettings::localStoragePath() const
/*!
\since 4.6
- \relates QWebSettings
- Enables WebKit persistent data and sets the path to \a path.
- If the \a path is empty the path for persistent data is set to the
- user-specific data location specified by
- \l{QDesktopServices::DataLocation}{DataLocation}.
-
+ Enables WebKit data persistence and sets the path to \a path.
+ If \a path is empty, the user-specific data location specified by
+ \l{QDesktopServices::DataLocation}{DataLocation} will be used instead.
+
+ This method will simultaneously set and enable the iconDatabasePath(),
+ localStoragePath(), offlineStoragePath() and offlineWebApplicationCachePath().
+
\sa localStoragePath()
*/
void QWebSettings::enablePersistentStorage(const QString& path)
diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h
index 7355e33..040f9b4 100644
--- a/WebKit/qt/Api/qwebsettings.h
+++ b/WebKit/qt/Api/qwebsettings.h
@@ -63,7 +63,7 @@ public:
OfflineStorageDatabaseEnabled,
OfflineWebApplicationCacheEnabled,
LocalStorageEnabled,
-#ifdef QT_DEPRECATED
+#if defined(QT_DEPRECATED) || defined(qdoc)
LocalStorageDatabaseEnabled = LocalStorageEnabled,
#endif
LocalContentCanAccessRemoteUrls,
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index 3ba1678..2defdbb 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -44,8 +44,10 @@ public:
Q_ASSERT(view);
}
+ virtual ~QWebViewPrivate();
+
void _q_pageDestroyed();
- void unsetPageIfExists();
+ void detachCurrentPage();
QWebView *view;
QWebPage *page;
@@ -53,6 +55,11 @@ public:
QPainter::RenderHints renderHints;
};
+QWebViewPrivate::~QWebViewPrivate()
+{
+ detachCurrentPage();
+}
+
void QWebViewPrivate::_q_pageDestroyed()
{
page = 0;
@@ -319,18 +326,6 @@ QWebView::QWebView(QWidget *parent)
*/
QWebView::~QWebView()
{
- if (d->page) {
-#if QT_VERSION >= 0x040600
- d->page->d->view.clear();
-#else
- d->page->d->view = 0;
-#endif
- delete d->page->d->client;
- d->page->d->client = 0;
- }
-
- if (d->page && d->page->parent() == this)
- delete d->page;
delete d;
}
@@ -348,11 +343,19 @@ QWebPage *QWebView::page() const
return d->page;
}
-void QWebViewPrivate::unsetPageIfExists()
+void QWebViewPrivate::detachCurrentPage()
{
if (!page)
return;
+ if (page) {
+#if QT_VERSION >= 0x040600
+ page->d->view.clear();
+#else
+ page->d->view = 0;
+#endif
+ }
+
// if the page client is the special client constructed for
// delegating the responsibilities to a QWidget, we need
// to destroy it.
@@ -369,6 +372,8 @@ void QWebViewPrivate::unsetPageIfExists()
delete page;
else
page->disconnect(view);
+
+ page = 0;
}
/*!
@@ -385,7 +390,7 @@ void QWebView::setPage(QWebPage* page)
if (d->page == page)
return;
- d->unsetPageIfExists();
+ d->detachCurrentPage();
d->page = page;
if (d->page) {
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 0ed6300..e5fabd8 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,458 @@
+2010-05-17 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix compilation with QT_NO_COMBOBOX
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createSelectPopup):
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ * WebCoreSupport/QtFallbackWebPopup.h:
+
+2010-05-17 Antti Koivisto <koivisto@iki.fi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39218
+ [Qt] Tiled backing store tiles sometimes flicker when exiting a zoom animation
+
+ Tiles sometimes flicker when exiting a zoom animation. This happens as a result
+ of the visible rectangle being momentarily out of sync.
+
+ Instead of updating the visible rect by explicitly setting it, pull it through
+ the client and recompute in WebKit the level.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::paint):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::visibleRectForTiledBackingStore):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2010-05-16 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Unskip fast/loader/main-document-url-for-non-http-loads.html
+
+ Fix FrameLoaderClientQt.cpp to print relative filename paths correctly.
+
+ Move qt_* functions in FrameLoaderClientQt, EditorClientQt, and NotificationPresenterClientQt
+ to DumpRenderTreeSupportQt. Create new functions to replace them in DumpRenderTreeSupportQt.
+ Support for the old function names is retained until confirmed that no one uses them outside
+ QtWebKit.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38867
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::dumpFrameLoader):
+ (DumpRenderTreeSupportQt::dumpResourceLoadCallbacks):
+ (DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath):
+ (DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect):
+ (DumpRenderTreeSupportQt::setWillSendRequestReturnsNull):
+ (DumpRenderTreeSupportQt::setWillSendRequestClearHeaders):
+ (DumpRenderTreeSupportQt::dumpEditingCallbacks):
+ (DumpRenderTreeSupportQt::dumpSetAcceptsEditing):
+ (DumpRenderTreeSupportQt::dumpNotification):
+ (qt_dump_frame_loader):
+ (qt_dump_resource_load_callbacks):
+ (qt_dump_resource_load_callbacks_path):
+ (qt_set_will_send_request_returns_null_on_redirect):
+ (qt_set_will_send_request_returns_null):
+ (qt_set_will_send_request_clear_headers):
+ (qt_dump_editing_callbacks):
+ (qt_dump_set_accepts_editing):
+ (qt_dump_notification):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/EditorClientQt.cpp:
+ * WebCoreSupport/EditorClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (drtDescriptionSuitableForTestResult):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+ * WebCoreSupport/NotificationPresenterClientQt.h:
+
+2010-05-16 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt]Unskip security/set-form-autocomplete-attribute.html
+
+ Add support for layoutTestController.elementDoesAutoCompleteForElementWithId().
+
+ https://bugs.webkit.org/show_bug.cgi?id=38859
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2010-05-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Prospective Qt/Mac build fix.
+
+ The friend declaration of QGraphicsWidget confuses gcc and thinks that it's an implicit
+ forward declaration, moving the class into the WebCore namespace (WebCore::QGraphicsWidget).
+
+ The declaration seems useless as no method of QGraphicsWidget is going to call anything
+ in this class.
+
+ * WebCoreSupport/PageClientQt.h:
+
+2010-05-15 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ Reviewed by Simon Hausmann.
+
+ This patch fixes the build failure of WebKit on Linux for Qt4.5
+ https://bugs.webkig.org/show_bug.cgi?id=39108
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::syncLayers):
+ * WebCoreSupport/QtPlatformPlugin.cpp:
+
+2010-05-14 Kent Hansen <kent.hansen@nokia.com>, Jocelyn Turcotte <jocelyn.turcotte@nokia.com>, Tor Arne Vestbø <tor.arne.vestbo@nokia.com>, Henry Haverinen <henry.haverinen@nokia.com>, Jedrzej Nowacki <jedrzej.nowacki@nokia.com>, Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Merge overhaul of the QtWebKit API documentation
+
+ Numerous improvements in wording, qdoc warning fixes and
+ clarifications, done in a team work effort.
+
+ No functional changes.
+
+ * Api/qwebdatabase.cpp:
+ * Api/qwebelement.cpp:
+ * Api/qwebframe.cpp:
+ * Api/qwebhistoryinterface.cpp:
+ * Api/qwebinspector.cpp:
+ * Api/qwebkitversion.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebsecurityorigin.cpp:
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+ * docs/qtwebkit.qdoc:
+ * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp:
+ (wrapInFunction):
+ * docs/webkitsnippets/webelement/main.cpp:
+ (findButtonAndClick):
+ (autocomplete1):
+ (autocomplete2):
+ (main):
+
+2010-05-14 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Documentation: Fix overview grouping.
+
+ * docs/qtwebkit.qdoc:
+
+2010-05-14 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [QT] Update the Symbian version for the user agent
+ https://bugs.webkit.org/show_bug.cgi?id=38389
+
+ Update the user agent for Symbian^2 to Symbian^4
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+
+2010-05-14 Dawit Alemayehu <adawit@kde.org>
+
+ Reviewed by Simon Hausmann.
+
+ Implemented createJavaAppletWidget to activate Java applet support.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33044
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createJavaAppletWidget):
+
+2010-05-13 Simon Hausmann <hausmann@webkit.org>
+
+ Symbian build fix.
+
+ [Qt] Updated the def file with new exports.
+
+ * symbian/eabi/QtWebKitu.def: Add missing gc symbol for QtLauncher
+
+2010-05-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Symbian build fix.
+
+ [Qt] Updated the def file with new exports.
+
+ * symbian/eabi/QtWebKitu.def:
+
+2010-05-11 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] tst_QWebPage::inputMethods failing on Maemo5
+ https://bugs.webkit.org/show_bug.cgi?id=38685
+
+ Check if the SIP (Software Input Panel) is triggered, which normally
+ happens on mobile platforms, when a user input form receives a mouse click.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2010-05-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] REGRESSION(r58497) tst_QGraphicsWebView::crashOnViewlessWebPages() is failing
+ https://bugs.webkit.org/show_bug.cgi?id=38655
+
+ Fix double free by moving the connect till after the resize.
+
+ The bug is causes by the fact that a resize of an empty page causes a
+ layout, thus deleting the qgraphicswebview before setHtml is called,
+ which then deletes it again, causing a double free.
+
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::crashOnViewlessWebPages):
+
+2010-05-12 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Regression(r59152): QGraphicsPageClient is not forwarding scroll and update events to view
+ https://bugs.webkit.org/show_bug.cgi?id=39016
+
+ Some forward calls got lost during the refatory.
+
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PageClientQGraphicsWidget::scroll):
+ (WebCore::PageClientQGraphicsWidget::update):
+
+2010-05-13 Antonio Gomes <tonikitoo@webkit.org>, Yi Shen <yi.4.shen@nokia.com>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
+ https://bugs.webkit.org/show_bug.cgi?id=37759
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::markerTextForListItem):
+ (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2010-05-12 Joe Ligman <joseph.ligman@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Nested overflow div does not scroll
+ https://bugs.webkit.org/show_bug.cgi?id=38641
+
+ Modify qtwebkit_webframe_scrollOverflow, if the current node's render layer
+ does not scroll it will try and scroll the parent's render layer. Also export
+ qtwebkit_webframe_scrollOverflow so we can use it independently of
+ qtwebkit_webframe_scrollRecursively
+
+ * Api/qwebframe.cpp:
+ (qtwebkit_webframe_scrollOverflow):
+ (qtwebkit_webframe_scrollRecursively):
+
+2010-05-12 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Remove the unneeded check for QWidgetPageClient @QGraphicsWebView::detachCurrentPage
+ https://bugs.webkit.org/show_bug.cgi?id=38989
+
+ Reasons:
+ - There is no need to check for a QWidgetPageClient-based in QGraphicsWebView.
+ - The client has always to be deleted anyways.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::detachPage):
+
+2010-05-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ Add a comment to explain the web inspector dynamic property url hook
+ and that it's there on purpose :)
+
+ https://bugs.webkit.org/show_bug.cgi?id=35340
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::openInspectorFrontend):
+
+2010-05-11 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Implement a detachCurrentPage method for QGraphicsWebView and QWebView
+ https://bugs.webkit.org/show_bug.cgi?id=38939
+
+ unsetPageIfExists method was renamed to detachCurrentPage method and is now responsible
+ for doing all the unset logic of page and pageClient references previously done by
+ the Q{Graphics}WebView destructor(s).
+
+ It is a code clean up, no behaviour change.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate):
+ (QGraphicsWebView::~QGraphicsWebView):
+ (QGraphicsWebViewPrivate::detachCurrentPage):
+ (QGraphicsWebView::setPage):
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::~QWebViewPrivate):
+ (QWebView::~QWebView):
+ (QWebViewPrivate::detachCurrentPage):
+ (QWebView::setPage):
+
+2010-05-11 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] emit initialLayoutCompleted signal from FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout
+ https://bugs.webkit.org/show_bug.cgi?id=38921
+
+ Emit initialLayoutCompleted signal from FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout
+ instead of FrameLoaderClientQt::dispatchDidFirstLayout , because the former ensures that a
+ visual content layed out on the frame.
+
+ It matches to QWebFrame::initialLayoutCompleted signal documentation at:
+
+ "... This is the first time you will see contents displayed on the frame ..."
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout):
+
+2010-05-11 Jesus Sanchez-Palencia <jesus@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add PageClientQGraphicsWidget specific implementation.
+ QGraphicsWebViewPrivate doesn't inherit QWebPageClient anymore
+ and the needed functions were moved to this new PageClient class,
+ including Tiling and Accelerated Composite specific ones.
+
+ [Qt] PageClientQt specific implementation for QGraphicsWidget
+ https://bugs.webkit.org/show_bug.cgi?id=37866
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::syncLayers):
+ (QGraphicsWebViewPrivate::_q_scaleChanged):
+ (QGraphicsWebView::event):
+ (QGraphicsWebView::setPage):
+ (QGraphicsWebView::updateGeometry):
+ (QGraphicsWebView::setGeometry):
+ (QGraphicsWebView::setResizesToContents):
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PageClientQGraphicsWidget::~PageClientQGraphicsWidget):
+ (WebCore::PageClientQGraphicsWidget::scroll):
+ (WebCore::PageClientQGraphicsWidget::update):
+ (WebCore::PageClientQGraphicsWidget::createOrDeleteOverlay):
+ (WebCore::PageClientQGraphicsWidget::syncLayers):
+ (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer):
+ (WebCore::PageClientQGraphicsWidget::markForSync):
+ (WebCore::PageClientQGraphicsWidget::updateCompositingScrollPosition):
+ (WebCore::PageClientQGraphicsWidget::updateTiledBackingStoreScale):
+ (WebCore::PageClientQGraphicsWidget::setInputMethodEnabled):
+ (WebCore::PageClientQGraphicsWidget::inputMethodEnabled):
+ (WebCore::PageClientQGraphicsWidget::setInputMethodHint):
+ (WebCore::PageClientQGraphicsWidget::cursor):
+ (WebCore::PageClientQGraphicsWidget::updateCursor):
+ (WebCore::PageClientQGraphicsWidget::palette):
+ (WebCore::PageClientQGraphicsWidget::screenNumber):
+ (WebCore::PageClientQGraphicsWidget::ownerWidget):
+ (WebCore::PageClientQGraphicsWidget::geometryRelativeToOwnerWidget):
+ (WebCore::PageClientQGraphicsWidget::pluginParent):
+ (WebCore::PageClientQGraphicsWidget::style):
+ * WebCoreSupport/PageClientQt.h:
+ (WebCore::QGraphicsItemOverlay::page):
+ (WebCore::QGraphicsItemOverlay::boundingRect):
+ (WebCore::QGraphicsItemOverlay::paint):
+ (WebCore::QGraphicsItemOverlay::prepareGraphicsItemGeometryChange):
+ (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):
+ (WebCore::PageClientQGraphicsWidget::isQWidgetClient):
+ (WebCore::PageClientQGraphicsWidget::allowsAcceleratedCompositing):
+ (WebCore::PageClientQGraphicsWidget::):
+
+2010-05-09 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used
+ https://bugs.webkit.org/show_bug.cgi?id=38574
+
+ The fix uses a QWeakPointer for rootGraphicsLayer, protecting from a crash in case the layer is deleted before the QGraphicsWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::setRootGraphicsLayer):
+ (QGraphicsWebViewPrivate::updateCompositingScrollPosition):
+
+2010-05-08 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Platform plugin
+ https://bugs.webkit.org/show_bug.cgi?id=38438
+
+ Select popups delegate private API. To provide select popup delegates
+ a plugin that implements QWebKitPlatformPlugin must be found
+ in QCoreApplication::libraryPaths.
+
+ * Api/headers.pri:
+ * Api/qwebkitplatformplugin.h: Added.
+ (QWebSelectData::~QWebSelectData):
+ (QWebSelectData::):
+ (QWebSelectMethod::~QWebSelectMethod):
+ (QWebKitPlatformPlugin::~QWebKitPlatformPlugin):
+ (QWebKitPlatformPlugin::):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createSelectPopup):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/QtPlatformPlugin.cpp: Added.
+ (WebCore::SelectData::SelectData):
+ (WebCore::SelectData::itemText):
+ (WebCore::SelectData::itemToolTip):
+ (WebCore::SelectData::itemIsEnabled):
+ (WebCore::SelectData::itemCount):
+ (WebCore::SelectData::itemIsSelected):
+ (WebCore::SelectData::multiple):
+ (WebCore::SelectData::itemType):
+ (WebCore::SelectInputMethodWrapper::SelectInputMethodWrapper):
+ (WebCore::SelectInputMethodWrapper::show):
+ (WebCore::SelectInputMethodWrapper::hide):
+ (WebCore::SelectInputMethodWrapper::selectItem):
+ (WebCore::SelectInputMethodWrapper::didHide):
+ (WebCore::getPluginObject):
+ (WebCore::QtPlatformPlugin::~QtPlatformPlugin):
+ (WebCore::QtPlatformPlugin::plugin):
+ (WebCore::QtPlatformPlugin::createSelectInputMethod):
+ * WebCoreSupport/QtPlatformPlugin.h: Added.
+ (WebCore::QtPlatformPlugin::QtPlatformPlugin):
+
+2010-05-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Document a limitation of QWebPage::linkClicked
+ https://bugs.webkit.org/show_bug.cgi?id=37694
+
+ * Api/qwebpage.cpp:
+
+2010-05-02 Simon Hausmann <hausmann@webkit.org>
+
+ [Qt] Unreviewed, QtWebKit versioning for the trunk.
+
+ The next version is going to be 2.1, based off the trunk.
+
+ * Api/qwebkitglobal.h:
+
2010-05-07 Simon Hausmann <simon.hausmann@nokia.com>
Symbian build fix.
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index cf100f7..1c475b3 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -567,13 +567,28 @@ bool ChromeClientQt::allowsAcceleratedCompositing() const
}
#endif
+
+#if ENABLE(TILED_BACKING_STORE)
+IntRect ChromeClientQt::visibleRectForTiledBackingStore() const
+{
+ if (!platformPageClient())
+ return IntRect();
+ return enclosingIntRect(FloatRect(platformPageClient()->graphicsItemVisibleRect()));
+}
+#endif
QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
{
+ QtAbstractWebPopup* result = m_platformPlugin.createSelectInputMethod();
+ if (result)
+ return result;
+
#if defined(Q_WS_MAEMO_5)
return new QtMaemoWebPopup;
-#else
+#elif !defined(QT_NO_COMBOBOX)
return new QtFallbackWebPopup;
+#else
+ return result;
#endif
}
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index a4575e2..0396aef 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -33,6 +33,7 @@
#include "RefCounted.h"
#include "KURL.h"
#include "PlatformString.h"
+#include "QtPlatformPlugin.h"
QT_BEGIN_NAMESPACE
class QEventLoop;
@@ -144,6 +145,10 @@ namespace WebCore {
virtual bool allowsAcceleratedCompositing() const;
#endif
+#if ENABLE(TILED_BACKING_STORE)
+ virtual IntRect visibleRectForTiledBackingStore() const;
+#endif
+
#if ENABLE(TOUCH_EVENTS)
virtual void needTouchEvents(bool) { }
#endif
@@ -181,6 +186,8 @@ namespace WebCore {
bool statusBarVisible;
bool menuBarVisible;
QEventLoop* m_eventLoop;
+
+ QtPlatformPlugin m_platformPlugin;
};
}
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index 935be85..6e59a20 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -23,16 +23,21 @@
#include "config.h"
#include "DumpRenderTreeSupportQt.h"
+#include "CSSComputedStyleDeclaration.h"
#include "ContextMenu.h"
#include "ContextMenuClientQt.h"
#include "ContextMenuController.h"
#include "Editor.h"
+#include "EditorClientQt.h"
#include "Element.h"
#include "FocusController.h"
#include "Frame.h"
+#include "FrameLoaderClientQt.h"
#include "FrameView.h"
#include "GCController.h"
+#include "HTMLInputElement.h"
#include "InspectorController.h"
+#include "NotificationPresenterClientQt.h"
#include "Page.h"
#include "PageGroup.h"
#include "PluginDatabase.h"
@@ -47,6 +52,7 @@
#include "TextIterator.h"
#include "WorkerThread.h"
+#include "qwebelement.h"
#include "qwebframe.h"
#include "qwebframe_p.h"
#include "qwebpage.h"
@@ -377,6 +383,23 @@ QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listIt
return WebCore::markerTextForListItem(listItem.m_element);
}
+QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(const QWebElement& element)
+{
+ QVariantMap res;
+
+ WebCore::Element* webElement = element.m_element;
+ if (!webElement)
+ return res;
+
+ RefPtr<WebCore::CSSComputedStyleDeclaration> style = computedStyle(webElement, true);
+ for (int i = 0; i < style->length(); i++) {
+ QString name = style->item(i);
+ QString value = (static_cast<WebCore::CSSStyleDeclaration*>(style.get()))->getPropertyValue(name);
+ res[name] = QVariant(value);
+ }
+ return res;
+}
+
QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPage* page)
{
WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
@@ -421,6 +444,74 @@ QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPage* page,
return rect;
}
+bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId)
+{
+ Frame* coreFrame = QWebFramePrivate::core(frame);
+ if (!coreFrame)
+ return false;
+
+ Document* doc = coreFrame->document();
+ Q_ASSERT(doc);
+
+ Node* coreNode = doc->getElementById(elementId);
+ if (!coreNode || !coreNode->renderer())
+ return false;
+
+ HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);
+ if (!inputElement)
+ return false;
+
+ return (inputElement->isTextField()
+ && inputElement->inputType() != HTMLInputElement::PASSWORD
+ && inputElement->autoComplete());
+}
+
+void DumpRenderTreeSupportQt::dumpFrameLoader(bool b)
+{
+ FrameLoaderClientQt::dumpFrameLoaderCallbacks = b;
+}
+
+void DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(bool b)
+{
+ FrameLoaderClientQt::dumpResourceLoadCallbacks = b;
+}
+
+void DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(const QString& path)
+{
+ FrameLoaderClientQt::dumpResourceLoadCallbacksPath = path;
+}
+
+void DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(bool b)
+{
+ FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = b;
+}
+
+void DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(bool b)
+{
+ FrameLoaderClientQt::sendRequestReturnsNull = b;
+}
+
+void DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(const QStringList& headers)
+{
+ FrameLoaderClientQt::sendRequestClearHeaders = headers;
+}
+
+void DumpRenderTreeSupportQt::dumpEditingCallbacks(bool b)
+{
+ EditorClientQt::dumpEditingCallbacks = b;
+}
+
+void DumpRenderTreeSupportQt::dumpSetAcceptsEditing(bool b)
+{
+ EditorClientQt::acceptsEditing = b;
+}
+
+void DumpRenderTreeSupportQt::dumpNotification(bool b)
+{
+#if ENABLE(NOTIFICATIONS)
+ NotificationPresenterClientQt::dumpNotification = b;
+#endif
+}
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)
@@ -502,3 +593,49 @@ void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& group
{
DumpRenderTreeSupportQt::webPageSetGroupName(page, groupName);
}
+
+void QWEBKIT_EXPORT qt_dump_frame_loader(bool b)
+{
+ DumpRenderTreeSupportQt::dumpFrameLoader(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_resource_load_callbacks(bool b)
+{
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_resource_load_callbacks_path(const QString& path)
+{
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(path);
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_returns_null_on_redirect(bool b)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(b);
+
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_returns_null(bool b)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(b);
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_clear_headers(const QStringList& headers)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(headers);
+}
+
+void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b)
+{
+ DumpRenderTreeSupportQt::dumpEditingCallbacks(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b)
+{
+ DumpRenderTreeSupportQt::dumpSetAcceptsEditing(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_notification(bool b)
+{
+ DumpRenderTreeSupportQt::dumpNotification(b);
+}
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index c0187df..6045463 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -26,10 +26,9 @@
#include "qwebkitglobal.h"
#include <QVariant>
-#include "qwebelement.h"
-
-class QWebPage;
+class QWebElement;
class QWebFrame;
+class QWebPage;
class QWEBKIT_EXPORT DumpRenderTreeSupportQt {
@@ -78,6 +77,7 @@ public:
static int numberOfPages(QWebFrame* frame, float width, float height);
static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height);
static bool hasDocumentElement(QWebFrame* frame);
+ static bool elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId);
static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
static void resetOriginAccessWhiteLists();
@@ -85,6 +85,20 @@ public:
static int workerThreadCount();
static QString markerTextForListItem(const QWebElement& listItem);
+ static QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element);
+
+ static void dumpFrameLoader(bool b);
+ static void dumpResourceLoadCallbacks(bool b);
+ static void dumpResourceLoadCallbacksPath(const QString& path);
+ static void setWillSendRequestReturnsNullOnRedirect(bool b);
+ static void setWillSendRequestReturnsNull(bool b);
+ static void setWillSendRequestClearHeaders(const QStringList& headers);
+
+ static void dumpEditingCallbacks(bool b);
+ static void dumpSetAcceptsEditing(bool b);
+
+ static void dumpNotification(bool b);
+
};
#endif
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 8a0aa08..83aa2a9 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -57,19 +57,6 @@
#include <QUndoStack>
#define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__);
-static bool dumpEditingCallbacks = false;
-static bool acceptsEditing = true;
-void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b)
-{
- dumpEditingCallbacks = b;
-}
-
-void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b)
-{
- acceptsEditing = b;
-}
-
-
static QString dumpPath(WebCore::Node *node)
{
QString str = node->nodeName();
@@ -99,6 +86,9 @@ static QString dumpRange(WebCore::Range *range)
namespace WebCore {
+bool EditorClientQt::dumpEditingCallbacks = false;
+bool EditorClientQt::acceptsEditing = true;
+
using namespace HTMLNames;
bool EditorClientQt::shouldDeleteRange(Range* range)
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.h b/WebKit/qt/WebCoreSupport/EditorClientQt.h
index 6c20898..811298b 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.h
@@ -109,6 +109,9 @@ public:
bool isEditing() const;
+ static bool dumpEditingCallbacks;
+ static bool acceptsEditing;
+
private:
QWebPage* m_page;
bool m_editing;
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index a0b06fb..00359c0 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -78,39 +78,8 @@
#include <QStringList>
#include "qwebhistory_p.h"
-static bool dumpFrameLoaderCallbacks = false;
-static bool dumpResourceLoadCallbacks = false;
-static bool sendRequestReturnsNullOnRedirect = false;
-static bool sendRequestReturnsNull = false;
-static QStringList sendRequestClearHeaders;
-
static QMap<unsigned long, QString> dumpAssignedUrls;
-void QWEBKIT_EXPORT qt_dump_frame_loader(bool b)
-{
- dumpFrameLoaderCallbacks = b;
-}
-
-void QWEBKIT_EXPORT qt_dump_resource_load_callbacks(bool b)
-{
- dumpResourceLoadCallbacks = b;
-}
-
-void QWEBKIT_EXPORT qt_set_will_send_request_returns_null_on_redirect(bool b)
-{
- sendRequestReturnsNullOnRedirect = b;
-}
-
-void QWEBKIT_EXPORT qt_set_will_send_request_returns_null(bool b)
-{
- sendRequestReturnsNull = b;
-}
-
-void QWEBKIT_EXPORT qt_set_will_send_request_clear_headers(const QStringList& headers)
-{
- sendRequestClearHeaders = headers;
-}
-
// Compare with WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame)
{
@@ -131,8 +100,10 @@ static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame)
static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url)
{
- QUrl url = _url;
- return url.toString();
+ if (_url.isEmpty() || !_url.isLocalFile())
+ return _url.string();
+ // Remove the leading path from file urls
+ return QString(_url.string()).replace(WebCore::FrameLoaderClientQt::dumpResourceLoadCallbacksPath, "").mid(1);
}
static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceError& error)
@@ -143,15 +114,15 @@ static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceError&
static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceRequest& request)
{
- QString url = request.url().string();
+ QString url = drtDescriptionSuitableForTestResult(request.url());
QString httpMethod = request.httpMethod();
- QString mainDocumentUrl = request.firstPartyForCookies().string();
+ QString mainDocumentUrl = drtDescriptionSuitableForTestResult(request.firstPartyForCookies());
return QString::fromLatin1("<NSURLRequest URL %1, main document URL %2, http method %3>").arg(url).arg(mainDocumentUrl).arg(httpMethod);
}
static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceResponse& response)
{
- QString url = response.url().string();
+ QString url = drtDescriptionSuitableForTestResult(response.url());
int httpStatusCode = response.httpStatusCode();
return QString::fromLatin1("<NSURLResponse %1, http status code %2>").arg(url).arg(httpStatusCode);
}
@@ -160,6 +131,13 @@ static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceRespon
namespace WebCore
{
+bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false;
+bool FrameLoaderClientQt::dumpResourceLoadCallbacks = false;
+bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false;
+bool FrameLoaderClientQt::sendRequestReturnsNull = false;
+QStringList FrameLoaderClientQt::sendRequestClearHeaders;
+QString FrameLoaderClientQt::dumpResourceLoadCallbacksPath;
+
FrameLoaderClientQt::FrameLoaderClientQt()
: m_frame(0)
, m_webFrame(0)
@@ -446,13 +424,13 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
void FrameLoaderClientQt::dispatchDidFirstLayout()
{
- if (m_webFrame)
- emit m_webFrame->initialLayoutCompleted();
+ notImplemented();
}
void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout()
{
- notImplemented();
+ if (m_webFrame)
+ emit m_webFrame->initialLayoutCompleted();
}
void FrameLoaderClientQt::dispatchShow()
@@ -1413,11 +1391,10 @@ void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget)
m_hasSentResponseToPlugin = false;
}
-PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&,
- const Vector<String>&, const Vector<String>&)
+PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* element, const KURL& url,
+ const Vector<String>& paramNames, const Vector<String>& paramValues)
{
- notImplemented();
- return 0;
+ return createPlugin(pluginSize, element, url, paramNames, paramValues, "application/x-java-applet", true);
}
String FrameLoaderClientQt::overrideMediaType() const
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 9c968a0..9aa9344 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -212,6 +212,13 @@ namespace WebCore {
QString chooseFile(const QString& oldFile);
+ static bool dumpFrameLoaderCallbacks;
+ static bool dumpResourceLoadCallbacks;
+ static QString dumpResourceLoadCallbacksPath;
+ static bool sendRequestReturnsNullOnRedirect;
+ static bool sendRequestReturnsNull;
+ static QStringList sendRequestClearHeaders;
+
private:
Frame *m_frame;
QWebFrame *m_webFrame;
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index a3dd9dd..725c5fb 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -89,6 +89,10 @@ void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
inspectorView->setPage(inspectorPage);
QWebInspector* inspector = m_inspectedWebPage->d->getOrCreateInspector();
+ // This is a known hook that allows changing the default URL for the
+ // Web inspector. This is used for SDK purposes. Please keep this hook
+ // around and don't remove it.
+ // https://bugs.webkit.org/show_bug.cgi?id=35340
QUrl inspectorUrl = inspector->property("_q_inspectorUrl").toUrl();
if (!inspectorUrl.isValid())
inspectorUrl = QUrl("qrc:/webkit/inspector/inspector.html");
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
index e440837..d6546ae 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -41,17 +41,13 @@
#include <QtGui>
-static bool dumpNotification = false;
-
-void QWEBKIT_EXPORT qt_dump_notification(bool b)
-{
- dumpNotification = b;
-}
#if ENABLE(NOTIFICATIONS)
using namespace WebCore;
+bool NotificationPresenterClientQt::dumpNotification = false;
+
NotificationPresenterClientQt::NotificationPresenterClientQt()
{
}
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
index 272c661..5967867 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
@@ -51,6 +51,8 @@ public:
virtual void requestPermission(SecurityOrigin*, PassRefPtr<VoidCallback>);
virtual NotificationPresenter::Permission checkPermission(const KURL&);
+ static bool dumpNotification;
+
private:
#ifndef QT_NO_SYSTEMTRAYICON
QSystemTrayIcon m_tray;
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 611bab7..e19f44f 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -103,4 +103,201 @@ QStyle* PageClientQWidget::style() const
return view->style();
}
+PageClientQGraphicsWidget::~PageClientQGraphicsWidget()
+{
+#if USE(ACCELERATED_COMPOSITING)
+ if (!rootGraphicsLayer)
+ return;
+ // we don't need to delete the root graphics layer. The lifecycle is managed in GraphicsLayerQt.cpp.
+ rootGraphicsLayer.data()->setParentItem(0);
+ view->scene()->removeItem(rootGraphicsLayer.data());
+#endif
+}
+
+void PageClientQGraphicsWidget::scroll(int dx, int dy, const QRect& rectToScroll)
+{
+ view->scroll(qreal(dx), qreal(dy), rectToScroll);
+
+#if USE(ACCELERATED_COMPOSITING)
+ updateCompositingScrollPosition();
+#endif
+}
+
+void PageClientQGraphicsWidget::update(const QRect& dirtyRect)
+{
+ view->update(dirtyRect);
+
+ createOrDeleteOverlay();
+ if (overlay)
+ overlay->update(QRectF(dirtyRect));
+#if USE(ACCELERATED_COMPOSITING)
+ syncLayers();
+#endif
+}
+
+void PageClientQGraphicsWidget::createOrDeleteOverlay()
+{
+ bool useOverlay = false;
+ if (!viewResizesToContents) {
+#if USE(ACCELERATED_COMPOSITING)
+ useOverlay = useOverlay || rootGraphicsLayer;
+#endif
+#if ENABLE(TILED_BACKING_STORE)
+ useOverlay = useOverlay || QWebFramePrivate::core(page->mainFrame())->tiledBackingStore();
+#endif
+ }
+ if (useOverlay == !!overlay)
+ return;
+ if (useOverlay) {
+ overlay = QSharedPointer<QGraphicsItemOverlay>(new QGraphicsItemOverlay(view, page));
+ overlay->setZValue(OverlayZValue);
+ } else
+ overlay.clear();
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+void PageClientQGraphicsWidget::syncLayers()
+{
+ if (shouldSync) {
+ QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
+ shouldSync = false;
+ }
+}
+
+void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsItem* layer)
+{
+ if (rootGraphicsLayer) {
+ rootGraphicsLayer.data()->setParentItem(0);
+ view->scene()->removeItem(rootGraphicsLayer.data());
+ QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
+ }
+
+ rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0;
+
+ if (layer) {
+ layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
+ layer->setParentItem(view);
+ layer->setZValue(RootGraphicsLayerZValue);
+ updateCompositingScrollPosition();
+ }
+ createOrDeleteOverlay();
+}
+
+void PageClientQGraphicsWidget::markForSync(bool scheduleSync)
+{
+ shouldSync = true;
+ if (scheduleSync)
+ syncMetaMethod.invoke(view, Qt::QueuedConnection);
+}
+
+void PageClientQGraphicsWidget::updateCompositingScrollPosition()
+{
+ if (rootGraphicsLayer && page && page->mainFrame()) {
+ const QPoint scrollPosition = page->mainFrame()->scrollPosition();
+ rootGraphicsLayer.data()->setPos(-scrollPosition);
+ }
+}
+#endif
+
+#if ENABLE(TILED_BACKING_STORE)
+void PageClientQGraphicsWidget::updateTiledBackingStoreScale()
+{
+ WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore();
+ if (!backingStore)
+ return;
+ backingStore->setContentsScale(view->scale());
+}
+#endif
+
+void PageClientQGraphicsWidget::setInputMethodEnabled(bool enable)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ view->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
+#endif
+}
+
+bool PageClientQGraphicsWidget::inputMethodEnabled() const
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ return view->flags() & QGraphicsItem::ItemAcceptsInputMethod;
+#else
+ return false;
+#endif
+}
+
+#if QT_VERSION >= 0x040600
+void PageClientQGraphicsWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+{
+ if (enable)
+ view->setInputMethodHints(view->inputMethodHints() | hint);
+ else
+ view->setInputMethodHints(view->inputMethodHints() & ~hint);
+}
+#endif
+
+#ifndef QT_NO_CURSOR
+QCursor PageClientQGraphicsWidget::cursor() const
+{
+ return view->cursor();
+}
+
+void PageClientQGraphicsWidget::updateCursor(const QCursor& cursor)
+{
+ view->setCursor(cursor);
+}
+#endif
+
+QPalette PageClientQGraphicsWidget::palette() const
+{
+ return view->palette();
+}
+
+int PageClientQGraphicsWidget::screenNumber() const
+{
+#if defined(Q_WS_X11)
+ if (QGraphicsScene* scene = view->scene()) {
+ const QList<QGraphicsView*> views = scene->views();
+
+ if (!views.isEmpty())
+ return views.at(0)->x11Info().screen();
+ }
+#endif
+
+ return 0;
+}
+
+QWidget* PageClientQGraphicsWidget::ownerWidget() const
+{
+ if (QGraphicsScene* scene = view->scene()) {
+ const QList<QGraphicsView*> views = scene->views();
+ return views.value(0);
+ }
+ return 0;
+}
+
+QRect PageClientQGraphicsWidget::geometryRelativeToOwnerWidget() const
+{
+ if (!view->scene())
+ return QRect();
+
+ QList<QGraphicsView*> views = view->scene()->views();
+ if (views.isEmpty())
+ return QRect();
+
+ QGraphicsView* graphicsView = views.at(0);
+ return graphicsView->mapFromScene(view->boundingRect()).boundingRect();
+}
+
+QObject* PageClientQGraphicsWidget::pluginParent() const
+{
+ return view;
+}
+
+QStyle* PageClientQGraphicsWidget::style() const
+{
+ return view->style();
+}
+
+
+
}
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h
index 3f09564..9341b19 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.h
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.h
@@ -21,10 +21,27 @@
#ifndef PageClientQt_h
#define PageClientQt_h
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "IntRect.h"
+#include "qwebframe.h"
+#include "qwebframe_p.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
#include "QWebPageClient.h"
+#include "TiledBackingStore.h"
+#include <QtCore/qmetaobject.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtGui/qgraphicsscene.h>
+#include <QtGui/qgraphicsview.h>
+#include <QtGui/qgraphicswidget.h>
+#include <QtGui/qscrollbar.h>
+#include <QtGui/qstyleoption.h>
#include <QtGui/qwidget.h>
+#include <Settings.h>
+
namespace WebCore {
@@ -63,5 +80,123 @@ public:
QWidget* view;
};
+// the overlay is here for one reason only: to have the scroll-bars and other
+// extra UI elements appear on top of any QGraphicsItems created by CSS compositing layers
+class QGraphicsItemOverlay : public QGraphicsItem {
+ public:
+ QGraphicsItemOverlay(QGraphicsWidget* view, QWebPage* p)
+ :QGraphicsItem(view)
+ , q(view)
+ , page(p)
+ {
+ setPos(0, 0);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
+#endif
+ setCacheMode(QGraphicsItem::DeviceCoordinateCache);
+ }
+
+ QRectF boundingRect() const
+ {
+ return q->boundingRect();
+ }
+
+ void paint(QPainter* painter, const QStyleOptionGraphicsItem* options, QWidget*)
+ {
+ page->mainFrame()->render(painter, static_cast<QWebFrame::RenderLayer>(QWebFrame::AllLayers&(~QWebFrame::ContentsLayer)), options->exposedRect.toRect());
+ }
+
+ void prepareGraphicsItemGeometryChange()
+ {
+ prepareGeometryChange();
+ }
+
+ QGraphicsWidget* q;
+ QWebPage* page;
+};
+
+
+class PageClientQGraphicsWidget : public QWebPageClient {
+public:
+ PageClientQGraphicsWidget(QGraphicsWidget* v, QWebPage* p)
+ : view(v)
+ , page(p)
+ , viewResizesToContents(false)
+#if USE(ACCELERATED_COMPOSITING)
+ , shouldSync(false)
+#endif
+ {
+ Q_ASSERT(view);
+#if USE(ACCELERATED_COMPOSITING)
+ // the overlay and stays alive for the lifetime of
+ // this QGraphicsWebView as the scrollbars are needed when there's no compositing
+ view->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption);
+ syncMetaMethod = view->metaObject()->method(view->metaObject()->indexOfMethod("syncLayers()"));
+#endif
+ }
+
+ virtual ~PageClientQGraphicsWidget();
+
+ virtual bool isQWidgetClient() const { return false; }
+
+ virtual void scroll(int dx, int dy, const QRect&);
+ virtual void update(const QRect& dirtyRect);
+ virtual void setInputMethodEnabled(bool enable);
+ virtual bool inputMethodEnabled() const;
+#if QT_VERSION >= 0x040600
+ virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+#endif
+
+#ifndef QT_NO_CURSOR
+ virtual QCursor cursor() const;
+ virtual void updateCursor(const QCursor& cursor);
+#endif
+
+ virtual QPalette palette() const;
+ virtual int screenNumber() const;
+ virtual QWidget* ownerWidget() const;
+ virtual QRect geometryRelativeToOwnerWidget() const;
+
+ virtual QObject* pluginParent() const;
+
+ virtual QStyle* style() const;
+
+ void createOrDeleteOverlay();
+
+#if ENABLE(TILED_BACKING_STORE)
+ void updateTiledBackingStoreScale();
+#endif
+
+#if USE(ACCELERATED_COMPOSITING)
+ virtual void setRootGraphicsLayer(QGraphicsItem* layer);
+ virtual void markForSync(bool scheduleSync);
+ void updateCompositingScrollPosition();
+ void syncLayers();
+
+ // QGraphicsWebView can render composited layers
+ virtual bool allowsAcceleratedCompositing() const { return true; }
+#endif
+
+ QGraphicsWidget* view;
+ QWebPage* page;
+ bool viewResizesToContents;
+
+#if USE(ACCELERATED_COMPOSITING)
+ QWeakPointer<QGraphicsObject> rootGraphicsLayer;
+
+ // we have to flush quite often, so we use a meta-method instead of QTimer::singleShot for putting the event in the queue
+ QMetaMethod syncMetaMethod;
+
+ // we need to sync the layers if we get a special call from the WebCore
+ // compositor telling us to do so. We'll get that call from ChromeClientQt
+ bool shouldSync;
+#endif
+ // the overlay gets instantiated when the root layer is attached, and get deleted when it's detached
+ QSharedPointer<QGraphicsItemOverlay> overlay;
+
+ // we need to put the root graphics layer behind the overlay (which contains the scrollbar)
+ enum { RootGraphicsLayerZValue, OverlayZValue };
+};
+
}
#endif // PageClientQt
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
index 7514077..26420e5 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -21,6 +21,8 @@
#include "config.h"
#include "QtFallbackWebPopup.h"
+#ifndef QT_NO_COMBOBOX
+
#include "HostWindow.h"
#include "PopupMenuClient.h"
#include "QWebPageClient.h"
@@ -225,3 +227,5 @@ void QtFallbackWebPopup::activeChanged(int index)
}
}
+
+#endif // QT_NO_COMBOBOX
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
index 62b8aea..6d2e1ff 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
@@ -23,6 +23,8 @@
#include "QtAbstractWebPopup.h"
#include <QComboBox>
+#ifndef QT_NO_COMBOBOX
+
QT_BEGIN_NAMESPACE
class QGraphicsProxyWidget;
QT_END_NAMESPACE
@@ -67,4 +69,6 @@ private:
}
+#endif // QT_NO_COMBOBOX
+
#endif // QtFallbackWebPopup_h
diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
new file mode 100644
index 0000000..a097bf7
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "QtPlatformPlugin.h"
+
+#include "qwebkitplatformplugin.h"
+
+#include <QCoreApplication>
+#include <QDir>
+#include <QPluginLoader>
+
+namespace WebCore {
+
+class SelectData : public QWebSelectData {
+public:
+ SelectData(QtAbstractWebPopup* data) : d(data) {}
+
+ virtual ItemType itemType(int) const;
+ virtual QString itemText(int index) const { return d->itemText(index); }
+ virtual QString itemToolTip(int index) const { return d->itemToolTip(index); }
+ virtual bool itemIsEnabled(int index) const { return d->itemIsEnabled(index); }
+ virtual int itemCount() const { return d->itemCount(); }
+ virtual bool itemIsSelected(int index) const { return d->itemIsSelected(index); }
+ virtual bool multiple() const { return d->multiple(); }
+
+private:
+ QtAbstractWebPopup* d;
+};
+
+QWebSelectData::ItemType SelectData::itemType(int index) const
+{
+ switch (d->itemType(index)) {
+ case QtAbstractWebPopup::Separator: return Separator;
+ case QtAbstractWebPopup::Group: return Group;
+ default: return Option;
+ }
+}
+
+SelectInputMethodWrapper::SelectInputMethodWrapper(QWebSelectMethod* plugin)
+ : m_plugin(plugin)
+{
+ m_plugin->setParent(this);
+ connect(m_plugin, SIGNAL(didHide()), this, SLOT(didHide()));
+ connect(m_plugin, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool)));
+}
+
+void SelectInputMethodWrapper::show()
+{
+ SelectData data(this);
+ m_plugin->show(data);
+}
+
+void SelectInputMethodWrapper::hide()
+{
+ m_plugin->hide();
+}
+
+void SelectInputMethodWrapper::selectItem(int index, bool allowMultiplySelections, bool shift)
+{
+ QtAbstractWebPopup::selectItem(index, allowMultiplySelections, shift);
+}
+
+void SelectInputMethodWrapper::didHide()
+{
+ QtAbstractWebPopup::popupDidHide();
+}
+
+// QtPlatformPlugin
+
+static QWebKitPlatformPlugin* getPluginObject()
+{
+ const QLatin1String suffix("/webkit/");
+ const QStringList paths = QCoreApplication::libraryPaths();
+ QObject* obj = 0;
+ for (int i = 0; !obj && i < paths.count(); ++i) {
+ const QDir dir(paths[i] + suffix);
+ if (!dir.exists())
+ continue;
+ const QStringList files = dir.entryList(QDir::Files);
+ for (int i = 0; i < files.count(); ++i) {
+ QPluginLoader pluginLoader(dir.absoluteFilePath(files.at(i)));
+ if (!pluginLoader.load())
+ continue;
+ obj = pluginLoader.instance();
+ if (obj) {
+ QWebKitPlatformPlugin* result = qobject_cast<QWebKitPlatformPlugin*>(obj);
+ if (result)
+ return result;
+ delete obj;
+ }
+ pluginLoader.unload();
+ }
+ }
+ return 0;
+}
+
+QtPlatformPlugin::~QtPlatformPlugin()
+{
+ delete m_plugin;
+}
+
+QWebKitPlatformPlugin* QtPlatformPlugin::plugin()
+{
+ if (m_loaded)
+ return m_plugin;
+
+ m_loaded = true;
+ m_plugin = getPluginObject();
+ return m_plugin;
+}
+
+QtAbstractWebPopup* QtPlatformPlugin::createSelectInputMethod()
+{
+ QWebKitPlatformPlugin* p = plugin();
+ if (!p)
+ return 0;
+
+ QWebSelectMethod* selector = p->createSelectInputMethod();
+ if (!selector)
+ return 0;
+
+ return new SelectInputMethodWrapper(selector);
+}
+
+}
diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
new file mode 100644
index 0000000..9b73079
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef QtPlatformPlugin_h
+#define QtPlatformPlugin_h
+
+#include "QtAbstractWebPopup.h"
+#include <QObject>
+
+class QWebSelectMethod;
+class QWebKitPlatformPlugin;
+
+namespace WebCore {
+
+class SelectInputMethodWrapper : public QObject, public QtAbstractWebPopup {
+ Q_OBJECT
+public:
+ SelectInputMethodWrapper(QWebSelectMethod* plugin);
+
+ virtual void show();
+ virtual void hide();
+
+private Q_SLOTS:
+ void selectItem(int index, bool allowMultiplySelections, bool shift);
+ void didHide();
+
+private:
+ QWebSelectMethod* m_plugin;
+};
+
+class QtPlatformPlugin {
+public:
+ QtPlatformPlugin() : m_loaded(false), m_plugin(0) {}
+ ~QtPlatformPlugin();
+
+ QtAbstractWebPopup* createSelectInputMethod();
+
+private:
+ bool m_loaded;
+ QWebKitPlatformPlugin* m_plugin;
+
+ QWebKitPlatformPlugin* plugin();
+};
+
+}
+
+#endif // QtPlatformPlugin_h
diff --git a/WebKit/qt/docs/qtwebkit.qdoc b/WebKit/qt/docs/qtwebkit.qdoc
index 9e653e4..c6dd550 100644
--- a/WebKit/qt/docs/qtwebkit.qdoc
+++ b/WebKit/qt/docs/qtwebkit.qdoc
@@ -5,63 +5,11 @@
\previouspage QtSvg
\nextpage QtXml
\ingroup modules
+ \ingroup technology-apis
+
\brief The QtWebKit module provides a web browser engine as well as
classes to render and interact with web content.
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
-
- To link against the module, add this line to your \l qmake \c
- .pro file:
-
- \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
-
- \section1 License Information
-
- This is a snapshot of the Qt port of WebKit. The exact version information
- can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
-
- Qt Commercial Edition licensees that wish to distribute applications that
- use the QtWebKit module need to be aware of their obligations under the
- GNU Library General Public License (LGPL).
-
- Developers using the Open Source Edition can choose to redistribute
- the module under the appropriate version of the GNU LGPL.
-
- \legalese
- WebKit is licensed under the GNU Library General Public License.
- Individual contributor names and copyright dates can be found
- inline in the code.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- \endlegalese
-*/
-
-/*!
- \page webintegration.html
- \title Integrating Web Content with QtWebKit
- \since 4.4
-
- \ingroup frameworks-technologies
-
- \keyword Browser
- \keyword Web Browser
-
QtWebKit provides a Web browser engine that makes it easy to embed content
from the World Wide Web into your Qt application. At the same time Web
content can be enhanced with native controls.
@@ -83,6 +31,20 @@
QtWebKit is based on the Open Source WebKit engine. More information about
WebKit itself can be found on the \l{WebKit Open Source Project} Web site.
+ \section1 Including In Your Project
+
+ To include the definitions of the module's classes, use the
+ following directive:
+
+ \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
+
+ To link against the module, add this line to your \l qmake \c
+ .pro file:
+
+ \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
+
+ \section1 Notes
+
\note Building the QtWebKit module with debugging symbols is problematic
on many platforms due to the size of the WebKit engine. We recommend
building the module only in release mode for embedded platforms.
@@ -97,10 +59,6 @@
Embedded Linux systems. See the \l{Qt for Embedded Linux Requirements}
document for more information.
- Topics:
-
- \tableofcontents
-
\section1 Architecture
The easiest way to render content is through the QWebView class. As a
@@ -193,4 +151,39 @@
\o The system \c{/Library/Internet Plug-Ins} directory
\endlist
\endtable
+
+
+ \section1 License Information
+
+ This is a snapshot of the Qt port of WebKit. The exact version information
+ can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
+
+ Qt Commercial Edition licensees that wish to distribute applications that
+ use the QtWebKit module need to be aware of their obligations under the
+ GNU Library General Public License (LGPL).
+
+ Developers using the Open Source Edition can choose to redistribute
+ the module under the appropriate version of the GNU LGPL.
+
+ \legalese
+ WebKit is licensed under the GNU Library General Public License.
+ Individual contributor names and copyright dates can be found
+ inline in the code.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ \endlegalese
*/
+
diff --git a/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp b/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
index a6b6620..07f1d45 100644
--- a/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
+++ b/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
@@ -9,8 +9,6 @@ void wrapInFunction()
QWebInspector *inspector = new QWebInspector;
inspector->setPage(page);
-
- connect(page, SIGNAL(webInspectorTriggered(QWebElement)), inspector, SLOT(show()));
//! [0]
}
diff --git a/WebKit/qt/docs/webkitsnippets/webelement/main.cpp b/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
index 822b61c..b1781a6 100644
--- a/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
+++ b/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
@@ -36,6 +36,59 @@ static void traverse()
//! [Traversing with QWebElement]
}
+static void findButtonAndClick()
+{
+
+ frame->setHtml("<form name=\"myform\" action=\"submit_form.asp\" method=\"get\">"
+ "<input type=\"text\" name=\"myfield\">"
+ "<input type=\"submit\" value=\"Submit\">"
+ "</form>");
+
+//! [Calling a DOM element method]
+
+ QWebElement document = frame->documentElement();
+ /* Assume that the document has the following structure:
+
+ <form name="myform" action="submit_form.asp" method="get">
+ <input type="text" name="myfield">
+ <input type="submit" value="Submit">
+ </form>
+
+ */
+
+ QWebElement button = document.findFirst("input[type=submit]");
+ button.evaluateJavaScript("click()");
+
+//! [Calling a DOM element method]
+
+ }
+
+static void autocomplete1()
+{
+ QWebElement document = frame->documentElement();
+
+//! [autocomplete1]
+ QWebElement firstTextInput = document.findFirst("input[type=text]");
+ QString storedText = firstTextInput.attribute("value");
+//! [autocomplete1]
+
+}
+
+
+static void autocomplete2()
+{
+
+ QWebElement document = frame->documentElement();
+ QString storedText = "text";
+
+//! [autocomplete2]
+ QWebElement firstTextInput = document.findFirst("input[type=text]");
+ textInput.setAttribute("value", storedText);
+//! [autocomplete2]
+
+}
+
+
static void findAll()
{
//! [FindAll]
@@ -65,5 +118,8 @@ int main(int argc, char *argv[])
frame = view->page()->mainFrame();
traverse();
findAll();
+ findButtonAndClick();
+ autocomplete1();
+ autocomplete2();
return 0;
}
diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def
index 6ccaaa7..a9c2825 100644
--- a/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -720,3 +720,6 @@ EXPORTS
_Z19qt_drt_setMediaTypeP9QWebFrameRK7QString @ 719 NONAME ABSENT
_Z26qt_drt_enableCaretBrowsingP8QWebPageb @ 720 NONAME ABSENT
_ZNK12QWebSettings12inspectorUrlEv @ 721 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt19webPageSetGroupNameEP8QWebPageRK7QString @ 722 NONAME
+ _ZN23DumpRenderTreeSupportQt16webPageGroupNameEP8QWebPage @ 723 NONAME
+ _ZN23DumpRenderTreeSupportQt23garbageCollectorCollectEv @ 724 NONAME
diff --git a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index 14f5820..ebe847d 100644
--- a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -84,16 +84,19 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
WebPage* page = new WebPage;
webView->setPage(page);
page->webView = webView;
- connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
-
scene.addItem(webView);
view.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
view.resize(600, 480);
webView->resize(view.geometry().size());
+
QCoreApplication::processEvents();
view.show();
+ // Resizing the page will resize and layout the empty "about:blank"
+ // page, so we first connect the signal afterward.
+ connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
+
page->mainFrame()->setHtml(QString("data:text/html,"
"<frameset cols=\"25%,75%\">"
"<frame src=\"data:text/html,foo \">"
@@ -101,6 +104,7 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
"</frameset>"));
QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool))));
+ delete page;
}
void tst_QGraphicsWebView::microFocusCoordinates()
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 795216d..bbbfe09 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -27,6 +27,7 @@
#include <QLocale>
#include <QMenu>
#include <QPushButton>
+#include <QStyle>
#include <QtTest/QtTest>
#include <QTextCharFormat>
#include <qgraphicsscene.h>
@@ -1364,7 +1365,27 @@ void tst_QWebPage::inputMethods()
page->event(&evrel);
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+ // This part of the test checks if the SIP (Software Input Panel) is triggered,
+ // which normally happens on mobile platforms, when a user input form receives
+ // a mouse click.
+ int inputPanel = 0;
+ if (viewType == "QWebView") {
+ if (QWebView* wv = qobject_cast<QWebView*>(view))
+ inputPanel = wv->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel);
+ } else if (viewType == "QGraphicsWebView") {
+ if (QGraphicsWebView* wv = qobject_cast<QGraphicsWebView*>(view))
+ inputPanel = wv->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel);
+ }
+
+ // For non-mobile platforms RequestSoftwareInputPanel event is not called
+ // because there is no SIP (Software Input Panel) triggered. In the case of a
+ // mobile platform, an input panel, e.g. virtual keyboard, is usually invoked
+ // and the RequestSoftwareInputPanel event is called. For these two situations
+ // this part of the test can verified as the checks below.
+ if (inputPanel)
+ QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+ else
+ QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
#endif
viewEventSpy.clear();