summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp62
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h91
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp90
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h12
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h18
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp17
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp100
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h17
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp64
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp23
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.h51
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog519
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp15
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebKit_pch.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc28
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qwebview-diagram.pngbin0 -> 9036 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp105
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp109
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test1.html1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test2.html1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp178
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp26
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pro1
41 files changed, 1319 insertions, 307 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
index 0d11381..d51e4e6 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
@@ -55,7 +55,8 @@ using namespace WebCore;
/*!
Constructs a web database from \a other.
*/
-QWebDatabase::QWebDatabase(const QWebDatabase& other) : d(other.d)
+QWebDatabase::QWebDatabase(const QWebDatabase& other)
+ : d(other.d)
{
}
@@ -163,7 +164,7 @@ QWebSecurityOrigin QWebDatabase::origin() const
Removes the database \a db from its security origin. All data stored in the
database \a db will be destroyed.
*/
-void QWebDatabase::removeDatabase(const QWebDatabase &db)
+void QWebDatabase::removeDatabase(const QWebDatabase& db)
{
#if ENABLE(DATABASE)
DatabaseTracker::tracker().deleteDatabase(db.d->origin.get(), db.d->name);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
index 5b4f704..875b2eb 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
@@ -31,8 +31,7 @@ namespace WebCore {
class QWebDatabasePrivate;
class QWebSecurityOrigin;
-class QWEBKIT_EXPORT QWebDatabase
-{
+class QWEBKIT_EXPORT QWebDatabase {
public:
QWebDatabase(const QWebDatabase& other);
QWebDatabase &operator=(const QWebDatabase& other);
@@ -45,7 +44,7 @@ public:
QString fileName() const;
QWebSecurityOrigin origin() const;
- static void removeDatabase(const QWebDatabase &db);
+ static void removeDatabase(const QWebDatabase&);
static void removeAllDatabases();
private:
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h
index 988fb16..9ae8fc8 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h
@@ -27,8 +27,7 @@
#include "RefPtr.h"
-class QWebDatabasePrivate : public QSharedData
-{
+class QWebDatabasePrivate : public QSharedData {
public:
WebCore::String name;
WTF::RefPtr<WebCore::SecurityOrigin> origin;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
index 413a662..1dfb409 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
@@ -46,46 +46,52 @@
using namespace WebCore;
-class QWebElementPrivate
-{
+class QWebElementPrivate {
public:
};
/*!
\class QWebElement
\since 4.6
- \brief The QWebElement class provides convenience access to DOM elements in a QWebFrame.
- \preliminary
+ \brief The QWebElement class provides convenient access to DOM elements in a QWebFrame.
- QWebElement is the main class to provide easy access to the document model.
+ QWebElement is the main class to easily access to the document model.
The document model is represented by a tree-like structure of DOM elements.
The root of the tree is called the document element and can be accessed using QWebFrame::documentElement().
- You can reach specific elements by using the findAll() and findFirst() functions, which
- allow the use of CSS selectors to identify elements.
+ You can reach specific elements using findAll() and findFirst(); the elements
+ are identified through CSS selectors.
\snippet webkitsnippets/webelement/main.cpp FindAll
- The first list contains all span elements in the document. The second list contains
- only the span elements that are children of the paragraph that is classified
- as "intro" paragraph.
+ The first list contains all \c span elements in the document. The second list contains
+ \c span elements that are children of \c p, classified with \c intro.
+
+ Using findFirst() is more efficient than calling findAll() and extracting the first element
+ only in the returned list.
Alternatively you can manually traverse the document using firstChild() and nextSibling():
\snippet webkitsnippets/webelement/main.cpp Traversing with QWebElement
The underlying content of QWebElement is explicitly shared. Creating a copy of a QWebElement
- does not create a copy of the content, both instances point to the same underlying element.
+ 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 element's attributes can be read using attribute() and changed using setAttribute().
+ The contents of child elements can be converted to plain text with toPlainText() and to
+ XHTML using toInnerXml(). To also include the element's tag in the output, use toOuterXml().
- The content of the child elements can be converted to plain text using toPlainText() and to
- x(html) using toXml(), and it is possible to replace the content using setPlainText() and setXml().
+ It is possible to replace the contents using setPlainText() and setInnerXml(). To replace
+ the element itself and its contents, use setOuterXml().
- Depending on the type of the underlying element there may be extra functionality available, not
- covered through QWebElement's API. For example a HTML form element can be triggered to submit the
- entire form. These list of these functions is available through functions() and they can be called
- directly using callFunction().
+ In the JavaScript DOM interfaces, elements can have additional functions depending on their
+ type. For example an HTML form element can be triggered to submit the entire form to the
+ web server using the submit() function. A list of these special functions can be obtained
+ in QWebElement using functions(); they can be invoked using callFunction().
+
+ Similarly element specific properties can be obtained using scriptableProperties() and
+ read/written using scriptableProperty()/setScriptableProperty().
*/
/*!
@@ -178,10 +184,13 @@ bool QWebElement::isNull() const
}
/*!
- Returns a new collection of elements that are children of this element
- and that match the given CSS selector \a selectorQuery.
+ Returns a new list of child elements matching the given CSS selector \a selectorQuery.
+ If there are no matching elements, an empty list is returned.
+
+ \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
+ used for the query.
- The query is specified using \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{standard CSS2 selectors}.
+ \note This search is performed recursively.
*/
QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const
{
@@ -205,9 +214,10 @@ QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const
/*!
Returns the first child element that matches the given CSS selector \a selectorQuery.
- This function is equivalent to calling findAll() and taking only the
- first element in the returned collection of elements. However calling
- this function is more efficient.
+ \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
+ used for the query.
+
+ \note This search is performed recursively.
*/
QWebElement QWebElement::findFirst(const QString &selectorQuery) const
{
@@ -743,7 +753,7 @@ QStringList QWebElement::functions() const
continue;
JSC::UString ustring = (*it).ustring();
- names << QString::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());
+ names << QString::fromUtf16((const ushort*)ustring.rep()->data(), ustring.size());
}
if (state->hadException())
@@ -868,7 +878,7 @@ QStringList QWebElement::scriptableProperties() const
continue;
JSC::UString ustring = (*it).ustring();
- names << QString::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());
+ names << QString::fromUtf16((const ushort*)ustring.rep()->data(), ustring.size());
}
if (exec->hadException())
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
index 7e56d0f..bc6f8a9 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
@@ -34,12 +34,11 @@ namespace WebCore {
class QWebFrame;
class QWebElementPrivate;
-class QWEBKIT_EXPORT QWebElement
-{
+class QWEBKIT_EXPORT QWebElement {
public:
QWebElement();
- QWebElement(const QWebElement &);
- QWebElement &operator=(const QWebElement &);
+ QWebElement(const QWebElement&);
+ QWebElement &operator=(const QWebElement&);
~QWebElement();
bool operator==(const QWebElement& o) const;
@@ -47,33 +46,33 @@ public:
bool isNull() const;
- QList<QWebElement> findAll(const QString &selectorQuery) const;
- QWebElement findFirst(const QString &selectorQuery) const;
+ QList<QWebElement> findAll(const QString& selectorQuery) const;
+ QWebElement findFirst(const QString& selectorQuery) const;
- void setPlainText(const QString &text);
+ void setPlainText(const QString& text);
QString toPlainText() const;
- void setOuterXml(const QString &markup);
+ void setOuterXml(const QString& markup);
QString toOuterXml() const;
- void setInnerXml(const QString &markup);
+ void setInnerXml(const QString& markup);
QString toInnerXml() const;
- void setAttribute(const QString &name, const QString &value);
- void setAttributeNS(const QString &namespaceUri, const QString &name, const QString &value);
- QString attribute(const QString &name, const QString &defaultValue = QString()) const;
- QString attributeNS(const QString &namespaceUri, const QString &name, const QString &defaultValue = QString()) const;
- bool hasAttribute(const QString &name) const;
- bool hasAttributeNS(const QString &namespaceUri, const QString &name) const;
- void removeAttribute(const QString &name);
- void removeAttributeNS(const QString &namespaceUri, const QString &name);
+ void setAttribute(const QString& name, const QString& value);
+ void setAttributeNS(const QString& namespaceUri, const QString& name, const QString& value);
+ QString attribute(const QString& name, const QString& defaultValue = QString()) const;
+ QString attributeNS(const QString& namespaceUri, const QString& name, const QString& defaultValue = QString()) const;
+ bool hasAttribute(const QString& name) const;
+ bool hasAttributeNS(const QString& namespaceUri, const QString& name) const;
+ void removeAttribute(const QString& name);
+ void removeAttributeNS(const QString& namespaceUri, const QString& name);
bool hasAttributes() const;
QStringList classes() const;
- bool hasClass(const QString &name) const;
- void addClass(const QString &name);
- void removeClass(const QString &name);
- void toggleClass(const QString &name);
+ bool hasClass(const QString& name) const;
+ void addClass(const QString& name);
+ void removeClass(const QString& name);
+ void toggleClass(const QString& name);
QRect geometry() const;
@@ -92,62 +91,62 @@ public:
// TODO: Add QList<QWebElement> overloads
// docs need example snippet
- void appendInside(const QString &markup);
- void appendInside(const QWebElement &element);
+ void appendInside(const QString& markup);
+ void appendInside(const QWebElement& element);
// docs need example snippet
- void prependInside(const QString &markup);
- void prependInside(const QWebElement &element);
+ void prependInside(const QString& markup);
+ void prependInside(const QWebElement& element);
// docs need example snippet
- void appendOutside(const QString &markup);
- void appendOutside(const QWebElement &element);
+ void appendOutside(const QString& markup);
+ void appendOutside(const QWebElement& element);
// docs need example snippet
- void prependOutside(const QString &markup);
- void prependOutside(const QWebElement &element);
+ void prependOutside(const QString& markup);
+ void prependOutside(const QWebElement& element);
// docs need example snippet
- void encloseContentsWith(const QWebElement &element);
- void encloseContentsWith(const QString &markup);
- void encloseWith(const QString &markup);
- void encloseWith(const QWebElement &element);
+ void encloseContentsWith(const QWebElement& element);
+ void encloseContentsWith(const QString& markup);
+ void encloseWith(const QString& markup);
+ void encloseWith(const QWebElement& element);
- void replace(const QString &markup);
- void replace(const QWebElement &element);
+ void replace(const QString& markup);
+ void replace(const QWebElement& element);
QWebElement clone() const;
- QWebElement &takeFromDocument();
+ QWebElement& takeFromDocument();
void removeFromDocument();
void removeChildren();
QVariant evaluateScript(const QString& scriptSource);
- QVariant callFunction(const QString &functionName, const QVariantList &arguments = QVariantList());
+ QVariant callFunction(const QString& functionName, const QVariantList& arguments = QVariantList());
QStringList functions() const;
- QVariant scriptableProperty(const QString &name) const;
- void setScriptableProperty(const QString &name, const QVariant &value);
+ QVariant scriptableProperty(const QString& name) const;
+ void setScriptableProperty(const QString& name, const QVariant& value);
QStringList scriptableProperties() const;
enum ResolveRule { IgnoreCascadingStyles, RespectCascadingStyles };
- QString styleProperty(const QString &name, ResolveRule = IgnoreCascadingStyles) const;
+ QString styleProperty(const QString& name, ResolveRule = IgnoreCascadingStyles) const;
enum StylePriority { NormalStylePriority, DeclaredStylePriority, ImportantStylePriority };
- void setStyleProperty(const QString &name, const QString &value, StylePriority = DeclaredStylePriority);
+ void setStyleProperty(const QString& name, const QString& value, StylePriority = DeclaredStylePriority);
- QString computedStyleProperty(const QString &name) const;
+ QString computedStyleProperty(const QString& name) const;
private:
- explicit QWebElement(WebCore::Element *domElement);
- explicit QWebElement(WebCore::Node *node);
+ explicit QWebElement(WebCore::Element*);
+ explicit QWebElement(WebCore::Node*);
friend class QWebFrame;
friend class QWebHitTestResult;
friend class QWebHitTestResultPrivate;
- QWebElementPrivate *d;
- WebCore::Element *m_element;
+ QWebElementPrivate* d;
+ WebCore::Element* m_element;
};
#endif // QWEBELEMENT_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 29d380d..23cb473 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -232,7 +232,7 @@ WebCore::Scrollbar* QWebFramePrivate::verticalScrollBar() const
return frame->view()->verticalScrollbar();
}
-void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip, bool contents)
+void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
{
if (!frame->view() || !frame->contentRenderer())
return;
@@ -246,7 +246,7 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip, boo
GraphicsContext context(painter);
- if (!contents)
+ if (clipRenderToViewport)
view->paint(&context, vector.first());
else
view->paintContents(&context, vector.first());
@@ -255,7 +255,7 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip, boo
const QRect& clipRect = vector.at(i);
painter->save();
painter->setClipRect(clipRect, Qt::IntersectClip);
- if (!contents)
+ if (clipRenderToViewport)
view->paint(&context, clipRect);
else
view->paintContents(&context, clipRect);
@@ -280,6 +280,13 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip, boo
\l{Elements of QWebView} for an explanation of how web
frames are related to a web page and web view.
+ The QWebFrame class also offers methods to retrieve both the URL currently
+ loaded by the frame (see url()) as well as the URL originally requested
+ to be loaded (see requestedUrl()). These methods make possible the retrieval
+ of the URL before and after a DNS resolution or a redirection occurs during
+ the load process. The requestedUrl() also matches to the URL added to the
+ frame history (\l{QWebHistory}) if load is successful.
+
The title of an HTML frame can be accessed with the title() property.
Additionally, a frame may also specify an icon, which can be accessed
using the icon() property. If the title or the icon changes, the
@@ -376,7 +383,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled))
return;
- JSC::JSLock lock(false);
+ JSC::JSLock lock(JSC::SilenceAssertionsOnly);
JSDOMWindow* window = toJSDOMWindow(d->frame);
JSC::Bindings::RootObject* root = d->frame->script()->bindingRootObject();
if (!window) {
@@ -443,7 +450,7 @@ QString QWebFrame::title() const
{
if (d->frame->document())
return d->frame->loader()->documentLoader()->title();
- else return QString();
+ return QString();
}
/*!
@@ -479,10 +486,10 @@ QString QWebFrame::title() const
*/
QMultiMap<QString, QString> QWebFrame::metaData() const
{
- if(!d->frame->document())
- return QMap<QString,QString>();
+ if (!d->frame->document())
+ return QMap<QString, QString>();
- QMultiMap<QString,QString> map;
+ QMultiMap<QString, QString> map;
Document* doc = d->frame->document();
RefPtr<NodeList> list = doc->getElementsByTagName("meta");
unsigned len = list->length();
@@ -521,6 +528,24 @@ QUrl QWebFrame::url() const
}
/*!
+ \since 4.6
+ \property QWebFrame::requestedUrl
+
+ The URL requested to loaded by the frame currently viewed. The URL may differ from
+ the one returned by url() if a DNS resolution or a redirection occurs.
+
+ \sa url(), setUrl()
+*/
+QUrl QWebFrame::requestedUrl() const
+{
+ if (!d->frame->loader()->activeDocumentLoader()
+ || !d->frameLoaderClient->m_loadSucceeded)
+ return QUrl(d->frame->loader()->outgoingReferrer());
+
+ return d->frame->loader()->originalRequest().url();
+}
+/*!
+ \since 4.6
\property QWebFrame::baseUrl
\brief the base URL of the frame, can be used to resolve relative URLs
\since 4.6
@@ -815,9 +840,8 @@ int QWebFrame::scrollBarValue(Qt::Orientation orientation) const
{
Scrollbar *sb;
sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar();
- if (sb) {
+ if (sb)
return sb->value();
- }
return 0;
}
@@ -867,7 +891,7 @@ QRect QWebFrame::scrollBarGeometry(Qt::Orientation orientation) const
\since 4.5
Scrolls the frame \a dx pixels to the right and \a dy pixels downward. Both
\a dx and \a dy may be negative.
-
+
\sa QWebFrame::scrollPosition
*/
@@ -875,7 +899,7 @@ void QWebFrame::scroll(int dx, int dy)
{
if (!d->frame->view())
return;
-
+
d->frame->view()->scrollBy(IntSize(dx, dy));
}
@@ -888,7 +912,7 @@ void QWebFrame::scroll(int dx, int dy)
QPoint QWebFrame::scrollPosition() const
{
if (!d->frame->view())
- return QPoint(0,0);
+ return QPoint(0, 0);
IntSize ofs = d->frame->view()->scrollOffset();
return QPoint(ofs.width(), ofs.height());
@@ -924,12 +948,23 @@ void QWebFrame::render(QPainter *painter)
}
/*!
- \since 4.6
- Render the frame's \a contents into \a painter while clipping to \a contents.
+ \since 4.6
+ \property QWebFrame::clipRenderToViewport
+
+ Returns true if render will clip content to viewport; otherwise returns false.
*/
-void QWebFrame::renderContents(QPainter *painter, const QRegion &contents)
+bool QWebFrame::clipRenderToViewport() const
{
- d->renderPrivate(painter, contents, true);
+ return d->clipRenderToViewport;
+}
+
+/*!
+ \since 4.6
+ Sets whether the content of a frame will be clipped to viewport when rendered.
+*/
+void QWebFrame::setClipRenderToViewport(bool clipRenderToViewport)
+{
+ d->clipRenderToViewport = clipRenderToViewport;
}
/*!
@@ -1051,8 +1086,11 @@ QWebElement QWebFrame::documentElement() const
/*!
\since 4.6
- Returns a new collection of elements that are children of the frame's
- document element and that match the given CSS selector \a selectorQuery.
+ Returns a new list of elements matching the given CSS selector \a selectorQuery.
+ If there are no matching elements, an empty list is returned.
+
+ \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
+ used for the query.
\sa QWebElement::findAll()
*/
@@ -1064,8 +1102,11 @@ QList<QWebElement> QWebFrame::findAllElements(const QString &selectorQuery) cons
/*!
\since 4.6
Returns the first element in the frame's document that matches the
- given CSS selector \a selectorQuery. Returns a null element if there is no
- match.
+ given CSS selector \a selectorQuery. If there is no matching element, a
+ null element is returned.
+
+ \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
+ used for the query.
\sa QWebElement::findFirst()
*/
@@ -1123,11 +1164,11 @@ void QWebFrame::print(QPrinter *printer) const
printContext.begin(pageRect.width());
- printContext.computePageRects(pageRect, /*headerHeight*/0, /*footerHeight*/0, /*userScaleFactor*/1.0, pageHeight);
+ printContext.computePageRects(pageRect, /* headerHeight */ 0, /* footerHeight */ 0, /* userScaleFactor */ 1.0, pageHeight);
int docCopies;
int pageCopies;
- if (printer->collateCopies() == true){
+ if (printer->collateCopies()) {
docCopies = 1;
pageCopies = printer->numCopies();
} else {
@@ -1340,7 +1381,8 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult
return;
pos = hitTest.point();
boundingRect = hitTest.boundingBox();
- title = hitTest.title();
+ WebCore::TextDirection dir;
+ title = hitTest.title(dir);
linkText = hitTest.textContent();
linkUrl = hitTest.absoluteLinkURL();
linkTitle = hitTest.titleDisplayString();
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
index 2c5309a..55c73b4 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -60,8 +60,7 @@ class QWebFrameData;
class QWebHitTestResultPrivate;
class QWebFrame;
-class QWEBKIT_EXPORT QWebHitTestResult
-{
+class QWEBKIT_EXPORT QWebHitTestResult {
public:
QWebHitTestResult();
QWebHitTestResult(const QWebHitTestResult &other);
@@ -102,17 +101,18 @@ private:
friend class QWebPage;
};
-class QWEBKIT_EXPORT QWebFrame : public QObject
-{
+class QWEBKIT_EXPORT QWebFrame : public QObject {
Q_OBJECT
Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false)
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
+ Q_PROPERTY(QUrl requestedUrl READ requestedUrl)
Q_PROPERTY(QUrl baseUrl READ baseUrl)
Q_PROPERTY(QIcon icon READ icon)
Q_PROPERTY(QSize contentsSize READ contentsSize)
Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition)
+ Q_PROPERTY(bool clipRenderToViewport READ clipRenderToViewport WRITE setClipRenderToViewport)
Q_PROPERTY(bool focus READ hasFocus)
private:
QWebFrame(QWebPage *parent, QWebFrameData *frameData);
@@ -142,6 +142,7 @@ public:
QString title() const;
void setUrl(const QUrl &url);
QUrl url() const;
+ QUrl requestedUrl() const;
QUrl baseUrl() const;
QIcon icon() const;
QMultiMap<QString, QString> metaData() const;
@@ -166,7 +167,8 @@ public:
void render(QPainter *painter, const QRegion &clip);
void render(QPainter *painter);
- void renderContents(QPainter *painter, const QRegion &contents);
+ bool clipRenderToViewport() const;
+ void setClipRenderToViewport(bool clipRenderToViewport);
void setTextSizeMultiplier(qreal factor);
qreal textSizeMultiplier() const;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
index 2b5c187..d6afc01 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -31,8 +31,7 @@
#include "wtf/RefPtr.h"
#include "Frame.h"
-namespace WebCore
-{
+namespace WebCore {
class FrameLoaderClientQt;
class FrameView;
class HTMLFrameOwnerElement;
@@ -40,8 +39,7 @@ namespace WebCore
}
class QWebPage;
-class QWebFrameData
-{
+class QWebFrameData {
public:
QWebFrameData(WebCore::Page*, WebCore::Frame* parentFrame = 0,
WebCore::HTMLFrameOwnerElement* = 0,
@@ -60,8 +58,7 @@ public:
int marginHeight;
};
-class QWebFramePrivate
-{
+class QWebFramePrivate {
public:
QWebFramePrivate()
: q(0)
@@ -73,6 +70,7 @@ public:
, allowsScrolling(true)
, marginWidth(-1)
, marginHeight(-1)
+ , clipRenderToViewport(true)
{}
void init(QWebFrame* qframe, QWebFrameData* frameData);
@@ -82,12 +80,12 @@ public:
WebCore::Scrollbar* verticalScrollBar() const;
Qt::ScrollBarPolicy horizontalScrollBarPolicy;
- Qt::ScrollBarPolicy verticalScrollBarPolicy;
+ Qt::ScrollBarPolicy verticalScrollBarPolicy;
static WebCore::Frame* core(QWebFrame*);
static QWebFrame* kit(WebCore::Frame*);
- void renderPrivate(QPainter *painter, const QRegion &clip, bool contents = false);
+ void renderPrivate(QPainter *painter, const QRegion &clip);
QWebFrame *q;
WebCore::FrameLoaderClientQt *frameLoaderClient;
@@ -97,10 +95,10 @@ public:
bool allowsScrolling;
int marginWidth;
int marginHeight;
+ bool clipRenderToViewport;
};
-class QWebHitTestResultPrivate
-{
+class QWebHitTestResultPrivate {
public:
QWebHitTestResultPrivate() : isContentEditable(false), isContentSelected(false), isScrollBar(false) {}
QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
index 7cdc00e..1c1c72a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
@@ -32,7 +32,6 @@
/*!
\class QWebHistoryItem
- \ingroup explicitly-shared
\since 4.4
\brief The QWebHistoryItem class represents one item in the history of a QWebPage
@@ -52,13 +51,17 @@
\row \o userData() \o The user specific data that was stored with the history item.
\endtable
- \note QWebHistoryItem objects are value based and \l{explicitly shared}.
+ \note QWebHistoryItem objects are value based, but \e{explicitly shared}. Changing
+ a QWebHistoryItem instance by calling setUserData() will change all copies of that
+ instance.
\sa QWebHistory, QWebPage::history(), QWebHistoryInterface
*/
/*!
- Constructs a history item from \a other.
+ Constructs a history item from \a other. The new item and \a other
+ will share their data, and modifying either this item or \a other will
+ modify both instances.
*/
QWebHistoryItem::QWebHistoryItem(const QWebHistoryItem &other)
: d(other.d)
@@ -66,7 +69,9 @@ QWebHistoryItem::QWebHistoryItem(const QWebHistoryItem &other)
}
/*!
- Assigns the \a other history item to this.
+ Assigns the \a other history item to this. This item and \a other
+ will share their data, and modifying either this item or \a other will
+ modify both instances.
*/
QWebHistoryItem &QWebHistoryItem::operator=(const QWebHistoryItem &other)
{
@@ -163,6 +168,8 @@ QVariant QWebHistoryItem::userData() const
\since 4.5
Stores user specific data \a userData with the history item.
+
+ \note All copies of this item will be modified.
\sa userData()
*/
@@ -239,7 +246,7 @@ void QWebHistory::clear()
{
RefPtr<WebCore::HistoryItem> current = d->lst->currentItem();
int capacity = d->lst->capacity();
- d->lst->setCapacity(0);
+ d->lst->setCapacity(0);
WebCore::Page* page = d->lst->page();
if (page && page->groupPtr())
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
index 1a048f4..e46f124 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
@@ -35,8 +35,8 @@ namespace WebCore {
}
class QWebHistoryItemPrivate;
-class QWEBKIT_EXPORT QWebHistoryItem
-{
+
+class QWEBKIT_EXPORT QWebHistoryItem {
public:
QWebHistoryItem(const QWebHistoryItem &other);
QWebHistoryItem &operator=(const QWebHistoryItem &other);
@@ -74,18 +74,17 @@ private:
class QWebHistoryPrivate;
-class QWEBKIT_EXPORT QWebHistory
-{
+class QWEBKIT_EXPORT QWebHistory {
public:
enum HistoryStateVersion {
HistoryVersion_1,
/*, HistoryVersion_2, */
DefaultHistoryVersion = HistoryVersion_1
};
-
+
bool restoreState(const QByteArray& buffer);
QByteArray saveState(HistoryStateVersion version = DefaultHistoryVersion) const;
-
+
void clear();
QList<QWebHistoryItem> items() const;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
index 4bee62b..e77adef 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
@@ -25,8 +25,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qshareddata.h>
-class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData
-{
+class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData {
public:
static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem *q)
{
@@ -65,8 +64,7 @@ public:
WebCore::HistoryItem *item;
};
-class QWebHistoryPrivate : public QSharedData
-{
+class QWebHistoryPrivate : public QSharedData {
public:
QWebHistoryPrivate(WebCore::BackForwardList *l)
{
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
index 88a1aa3..87d52ce 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
@@ -28,13 +28,13 @@
#include "PlatformString.h"
-static QWebHistoryInterface *default_interface;
+static QWebHistoryInterface* default_interface;
static bool gRoutineAdded;
static void gCleanupInterface()
{
- if (default_interface && default_interface->parent() == 0)
+ if (default_interface && !default_interface->parent())
delete default_interface;
default_interface = 0;
}
@@ -47,11 +47,12 @@ static void gCleanupInterface()
When the application exists QWebHistoryInterface will automatically delete the
\a defaultInterface if it does not have a parent.
*/
-void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface *defaultInterface)
+void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface* defaultInterface)
{
if (default_interface == defaultInterface)
return;
- if (default_interface && default_interface->parent() == 0)
+
+ if (default_interface && !default_interface->parent())
delete default_interface;
default_interface = defaultInterface;
@@ -70,7 +71,7 @@ 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.
*/
-QWebHistoryInterface *QWebHistoryInterface::defaultInterface()
+QWebHistoryInterface* QWebHistoryInterface::defaultInterface()
{
return default_interface;
}
@@ -91,7 +92,8 @@ QWebHistoryInterface *QWebHistoryInterface::defaultInterface()
/*!
Constructs a new QWebHistoryInterface with parent \a parent.
*/
-QWebHistoryInterface::QWebHistoryInterface(QObject *parent) : QObject(parent)
+QWebHistoryInterface::QWebHistoryInterface(QObject* parent)
+ : QObject(parent)
{
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h
index 670fca0..a49c586 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h
@@ -26,8 +26,7 @@
#include "qwebkitglobal.h"
-class QWEBKIT_EXPORT QWebHistoryInterface : public QObject
-{
+class QWEBKIT_EXPORT QWebHistoryInterface : public QObject {
Q_OBJECT
public:
QWebHistoryInterface(QObject *parent = 0);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 3c2151b..1a45fe6 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -59,6 +59,7 @@
#include "Scrollbar.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformWheelEvent.h"
+#include "PluginDatabase.h"
#include "ProgressTracker.h"
#include "RefPtr.h"
#include "HashMap.h"
@@ -99,6 +100,18 @@
using namespace WebCore;
+void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
+{
+ PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false);
+
+ Vector<String> paths;
+ String qtPath(getenv("QTWEBKIT_PLUGIN_PATH"));
+ qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths);
+
+ db->setPluginDirectories(paths);
+ db->refresh();
+}
+
bool QWebPagePrivate::drtRun = false;
void QWEBKIT_EXPORT qt_drt_run(bool b)
{
@@ -116,29 +129,29 @@ QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
}
// Lookup table mapping QWebPage::WebActions to the associated Editor commands
-static const char* editorCommandWebActions[] =
+static const char* editorCommandWebActions[] =
{
0, // OpenLink,
0, // OpenLinkInNewWindow,
0, // OpenFrameInNewWindow,
-
+
0, // DownloadLinkToDisk,
0, // CopyLinkToClipboard,
-
+
0, // OpenImageInNewWindow,
0, // DownloadImageToDisk,
0, // CopyImageToClipboard,
-
+
0, // Back,
0, // Forward,
0, // Stop,
0, // Reload,
-
+
"Cut", // Cut,
"Copy", // Copy,
"Paste", // Paste,
-
+
"Undo", // Undo,
"Redo", // Redo,
"MoveForward", // MoveToNextChar,
@@ -167,21 +180,22 @@ static const char* editorCommandWebActions[] =
"MoveToEndOfDocumentAndModifySelection", // SelectEndOfDocument,
"DeleteWordBackward", // DeleteStartOfWord,
"DeleteWordForward", // DeleteEndOfWord,
-
+
0, // SetTextDirectionDefault,
0, // SetTextDirectionLeftToRight,
0, // SetTextDirectionRightToLeft,
-
+
"ToggleBold", // ToggleBold,
"ToggleItalic", // ToggleItalic,
"ToggleUnderline", // ToggleUnderline,
-
+
0, // InspectElement,
"InsertNewline", // InsertParagraphSeparator
"InsertLineBreak", // InsertLineSeparator
"SelectAll", // SelectAll
+ 0, // ReloadAndBypassCache,
"PasteAndMatchStyle", // PasteAndMatchStyle
"RemoveFormat", // RemoveFormat
@@ -206,7 +220,6 @@ const char* QWebPagePrivate::editorCommandForWebActions(QWebPage::WebAction acti
{
if ((action > QWebPage::NoWebAction) && (action < int(sizeof(editorCommandWebActions) / sizeof(const char*))))
return editorCommandWebActions[action];
-
return 0;
}
@@ -252,7 +265,7 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions)
QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
: q(qq)
, view(0)
- , viewportSize(QSize(0,0))
+ , viewportSize(QSize(0, 0))
{
WebCore::InitializeLoggingChannelsIfNecessary();
JSC::initializeThreading();
@@ -405,9 +418,8 @@ QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMen
if (anyEnabledAction) {
subMenu->setTitle(item.title());
menu->addAction(subMenu->menuAction());
- } else {
+ } else
delete subMenu;
- }
break;
}
}
@@ -456,6 +468,7 @@ void QWebPagePrivate::updateAction(QWebPage::WebAction action)
enabled = loader->isLoading();
break;
case QWebPage::Reload:
+ case QWebPage::ReloadAndBypassCache:
enabled = !loader->isLoading();
break;
#ifndef QT_NO_UNDOSTACK
@@ -501,6 +514,7 @@ void QWebPagePrivate::updateNavigationActions()
updateAction(QWebPage::Forward);
updateAction(QWebPage::Stop);
updateAction(QWebPage::Reload);
+ updateAction(QWebPage::ReloadAndBypassCache);
}
void QWebPagePrivate::updateEditorActions()
@@ -647,12 +661,12 @@ void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
Pasteboard::generalPasteboard()->setSelectionMode(true);
WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame();
if (ev->button() == Qt::LeftButton) {
- if(focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) {
+ if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) {
focusFrame->editor()->copy();
ev->setAccepted(true);
}
} else if (ev->button() == Qt::MidButton) {
- if(focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) {
+ if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) {
focusFrame->editor()->paste();
ev->setAccepted(true);
}
@@ -822,11 +836,10 @@ void QWebPagePrivate::focusInEvent(QFocusEvent *ev)
FocusController *focusController = page->focusController();
Frame *frame = focusController->focusedFrame();
focusController->setActive(true);
- if (frame) {
+ if (frame)
focusController->setFocused(true);
- } else {
+ else
focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame));
- }
}
void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
@@ -932,7 +945,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
QString preedit = ev->preeditString();
// ### FIXME: use the provided QTextCharFormat (use color at least)
Vector<CompositionUnderline> underlines;
- underlines.append(CompositionUnderline(0, preedit.length(), Color(0,0,0), false));
+ underlines.append(CompositionUnderline(0, preedit.length(), Color(0, 0, 0), false));
editor->setComposition(preedit, underlines, preedit.length(), 0);
}
ev->accept();
@@ -968,9 +981,8 @@ void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event)
}
}
#ifndef QT_NO_SHORTCUT
- else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) {
+ else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction)
event->accept();
- }
#endif
}
}
@@ -1036,12 +1048,11 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
*/
QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
{
- switch(property) {
+ switch (property) {
case Qt::ImMicroFocus: {
Frame *frame = d->page->focusController()->focusedFrame();
- if (frame) {
+ if (frame)
return QVariant(frame->selection()->absoluteCaretBounds());
- }
return QVariant();
}
case Qt::ImFont: {
@@ -1054,9 +1065,8 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
Frame *frame = d->page->focusController()->focusedFrame();
if (frame) {
VisibleSelection selection = frame->selection()->selection();
- if (selection.isCaret()) {
+ if (selection.isCaret())
return QVariant(selection.start().deprecatedEditingOffset());
- }
}
return QVariant();
}
@@ -1064,9 +1074,8 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
Frame *frame = d->page->focusController()->focusedFrame();
if (frame) {
Document *document = frame->document();
- if (document->focusedNode()) {
+ if (document->focusedNode())
return QVariant(document->focusedNode()->nodeValue());
- }
}
return QVariant();
}
@@ -1142,6 +1151,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
\value Forward Navigate forward in the history of navigated links.
\value Stop Stop loading the current page.
\value Reload Reload the current page.
+ \value ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6)
\value Cut Cut the content currently selected into the clipboard.
\value Copy Copy the content currently selected into the clipboard.
\value Paste Paste content from the clipboard.
@@ -1415,9 +1425,8 @@ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QStr
bool ok = false;
#ifndef QT_NO_INPUTDIALOG
QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);
- if (ok && result) {
+ if (ok && result)
*result = x;
- }
#endif
return ok;
}
@@ -1568,7 +1577,10 @@ void QWebPage::triggerAction(WebAction action, bool checked)
mainFrame()->d->frame->loader()->stopForUserCancel();
break;
case Reload:
- mainFrame()->d->frame->loader()->reload();
+ mainFrame()->d->frame->loader()->reload(/*endtoendreload*/false);
+ break;
+ case ReloadAndBypassCache:
+ mainFrame()->d->frame->loader()->reload(/*endtoendreload*/true);
break;
case SetTextDirectionDefault:
editor->setBaseWritingDirection(NaturalWritingDirection);
@@ -1630,9 +1642,8 @@ QSize QWebPage::fixedContentsSize() const
QWebFrame* frame = d->mainFrame;
if (frame) {
WebCore::FrameView* view = frame->d->frame->view();
- if (view && view->useFixedLayout()) {
+ if (view && view->useFixedLayout())
return d->mainFrame->d->frame->view()->fixedLayoutSize();
- }
}
return d->fixedLayoutSize;
@@ -2140,9 +2151,8 @@ void QWebPage::setContentEditable(bool editable)
frame->applyEditingStyleToBodyElement();
// FIXME: mac port calls this if there is no selectedDOMRange
//frame->setSelectionFromNone();
- } else {
+ } else
frame->removeEditingStyleFromBodyElement();
- }
}
d->updateEditorActions();
@@ -2210,9 +2220,8 @@ bool QWebPage::swallowContextMenuEvent(QContextMenuEvent *event)
if (QWebFrame* webFrame = frameAt(event->pos())) {
Frame* frame = QWebFramePrivate::core(webFrame);
- if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos())) {
+ if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos()))
return scrollbar->contextMenu(PlatformMouseEvent(event, 1));
- }
}
WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
@@ -2267,9 +2276,8 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
originallyEnabledWebActions &= ~visitedWebActions; // Mask out visited actions (they're part of the menu)
for (int i = 0; i < QWebPage::WebActionCount; ++i) {
if (originallyEnabledWebActions.at(i)) {
- if (QAction *a = this->action(QWebPage::WebAction(i))) {
+ if (QAction *a = this->action(QWebPage::WebAction(i)))
a->setEnabled(true);
- }
}
}
@@ -2392,9 +2400,8 @@ bool QWebPage::findText(const QString &subString, FindFlags options)
if (subString.isEmpty()) {
d->page->unmarkAllTextMatches();
return true;
- } else {
+ } else
return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0);
- }
} else {
::FindDirection direction = ::FindDirectionForward;
if (options & FindBackward)
@@ -2635,7 +2642,7 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
#if defined Q_OS_WIN32
QString ver;
- switch(QSysInfo::WindowsVersion) {
+ switch (QSysInfo::WindowsVersion) {
case QSysInfo::WV_32s:
ver = "Windows 3.1";
break;
@@ -2709,7 +2716,8 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
}
-void QWebPagePrivate::_q_onLoadProgressChanged(int) {
+void QWebPagePrivate::_q_onLoadProgressChanged(int)
+{
m_totalBytes = page->progress()->totalPageAndResourceBytesToLoad();
m_bytesReceived = page->progress()->totalBytesReceived();
}
@@ -2721,7 +2729,8 @@ void QWebPagePrivate::_q_onLoadProgressChanged(int) {
\sa bytesReceived()
*/
-quint64 QWebPage::totalBytes() const {
+quint64 QWebPage::totalBytes() const
+{
return d->m_totalBytes;
}
@@ -2731,7 +2740,8 @@ quint64 QWebPage::totalBytes() const {
\sa totalBytes()
*/
-quint64 QWebPage::bytesReceived() const {
+quint64 QWebPage::bytesReceived() const
+{
return d->m_bytesReceived;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index 517a77c..24741a1 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -59,8 +59,7 @@ namespace WebCore {
struct FrameLoadRequest;
}
-class QWEBKIT_EXPORT QWebPage : public QObject
-{
+class QWEBKIT_EXPORT QWebPage : public QObject {
Q_OBJECT
Q_PROPERTY(bool modified READ isModified)
@@ -149,6 +148,7 @@ public:
InsertLineSeparator,
SelectAll,
+ ReloadAndBypassCache,
PasteAndMatchStyle,
RemoveFormat,
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index 3a3a674..87c624d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -35,8 +35,7 @@
#include <wtf/RefPtr.h>
-namespace WebCore
-{
+namespace WebCore {
class ChromeClientQt;
class ContextMenuClientQt;
class ContextMenuItem;
@@ -66,14 +65,13 @@ class QMenu;
class QBitArray;
QT_END_NAMESPACE
-class QWebPagePrivate
-{
+class QWebPagePrivate {
public:
- QWebPagePrivate(QWebPage *);
+ QWebPagePrivate(QWebPage*);
~QWebPagePrivate();
void createMainFrame();
#ifndef QT_NO_CONTEXTMENU
- QMenu *createContextMenu(const WebCore::ContextMenu *webcoreMenu, const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions);
+ QMenu* createContextMenu(const WebCore::ContextMenu* webcoreMenu, const QList<WebCore::ContextMenuItem>* items, QBitArray* visitedWebActions);
#endif
void _q_onLoadProgressChanged(int);
void _q_webActionTriggered(bool checked);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
index 3531b06..cff774d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
@@ -31,8 +31,7 @@ class QString;
QT_END_NAMESPACE
class QWebPluginFactoryPrivate;
-class QWEBKIT_EXPORT QWebPluginFactory : public QObject
-{
+class QWEBKIT_EXPORT QWebPluginFactory : public QObject {
Q_OBJECT
public:
struct MimeType {
@@ -47,16 +46,16 @@ public:
QList<MimeType> mimeTypes;
};
- explicit QWebPluginFactory(QObject *parent = 0);
+ explicit QWebPluginFactory(QObject* parent = 0);
virtual ~QWebPluginFactory();
virtual QList<Plugin> plugins() const = 0;
virtual void refreshPlugins();
- virtual QObject *create(const QString &mimeType,
- const QUrl &url,
- const QStringList &argumentNames,
- const QStringList &argumentValues) const = 0;
+ virtual QObject *create(const QString& mimeType,
+ const QUrl&,
+ const QStringList& argumentNames,
+ const QStringList& argumentValues) const = 0;
enum Extension {
};
@@ -64,11 +63,11 @@ public:
{};
class ExtensionReturn
{};
- virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
+ virtual bool extension(Extension extension, const ExtensionOption* option = 0, ExtensionReturn* output = 0);
virtual bool supportsExtension(Extension extension) const;
private:
- QWebPluginFactoryPrivate *d;
+ QWebPluginFactoryPrivate* d;
};
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
index b52194d..3cfb0f4 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
@@ -34,8 +34,7 @@ class QWebSecurityOriginPrivate;
class QWebDatabase;
class QWebFrame;
-class QWEBKIT_EXPORT QWebSecurityOrigin
-{
+class QWEBKIT_EXPORT QWebSecurityOrigin {
public:
static QList<QWebSecurityOrigin> allOrigins();
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h
index 73fe8ed..cdc93bd 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h
@@ -23,8 +23,7 @@
#include "SecurityOrigin.h"
#include "RefPtr.h"
-class QWebSecurityOriginPrivate : public QSharedData
-{
+class QWebSecurityOriginPrivate : public QSharedData {
public:
QWebSecurityOriginPrivate(WebCore::SecurityOrigin* o)
{
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index 02ef4a0..fb94d55 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -42,10 +42,9 @@
#include <QUrl>
#include <QFileInfo>
-class QWebSettingsPrivate
-{
+class QWebSettingsPrivate {
public:
- QWebSettingsPrivate(WebCore::Settings *wcSettings = 0)
+ QWebSettingsPrivate(WebCore::Settings* wcSettings = 0)
: settings(wcSettings)
{
}
@@ -60,7 +59,7 @@ public:
qint64 offlineStorageDefaultQuota;
void apply();
- WebCore::Settings *settings;
+ WebCore::Settings* settings;
};
typedef QHash<int, QPixmap> WebGraphicHash;
@@ -80,14 +79,14 @@ static WebGraphicHash* graphics()
return hash;
}
-Q_GLOBAL_STATIC(QList<QWebSettingsPrivate *>, allSettings);
+Q_GLOBAL_STATIC(QList<QWebSettingsPrivate*>, allSettings);
void QWebSettingsPrivate::apply()
{
if (settings) {
settings->setTextAreasAreResizable(true);
- QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+ QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;
QString family = fontFamilies.value(QWebSettings::StandardFont,
global->fontFamilies.value(QWebSettings::StandardFont));
@@ -194,7 +193,7 @@ void QWebSettingsPrivate::apply()
global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls));
settings->setAllowUniversalAccessFromFileURLs(value);
} else {
- QList<QWebSettingsPrivate *> settings = *::allSettings();
+ QList<QWebSettingsPrivate*> settings = *::allSettings();
for (int i = 0; i < settings.count(); ++i)
settings[i]->apply();
}
@@ -206,9 +205,9 @@ void QWebSettingsPrivate::apply()
Any setting changed on the default object is automatically applied to all
QWebPage instances where the particular setting is not overriden already.
*/
-QWebSettings *QWebSettings::globalSettings()
+QWebSettings* QWebSettings::globalSettings()
{
- static QWebSettings *global = 0;
+ static QWebSettings* global = 0;
if (!global)
global = new QWebSettings;
return global;
@@ -365,7 +364,7 @@ QWebSettings::QWebSettings()
/*!
\internal
*/
-QWebSettings::QWebSettings(WebCore::Settings *settings)
+QWebSettings::QWebSettings(WebCore::Settings* settings)
: d(new QWebSettingsPrivate(settings))
{
d->settings = settings;
@@ -400,7 +399,7 @@ int QWebSettings::fontSize(FontSize type) const
{
int defaultValue = 0;
if (d->settings) {
- QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+ QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;
defaultValue = global->fontSizes.value(type);
}
return d->fontSizes.value(type, defaultValue);
@@ -427,7 +426,7 @@ void QWebSettings::resetFontSize(FontSize type)
\sa userStyleSheetUrl()
*/
-void QWebSettings::setUserStyleSheetUrl(const QUrl &location)
+void QWebSettings::setUserStyleSheetUrl(const QUrl& location)
{
d->userStyleSheetLocation = location;
d->apply();
@@ -453,7 +452,7 @@ QUrl QWebSettings::userStyleSheetUrl() const
\sa defaultTextEncoding()
*/
-void QWebSettings::setDefaultTextEncoding(const QString &encoding)
+void QWebSettings::setDefaultTextEncoding(const QString& encoding)
{
d->defaultTextEncoding = encoding;
d->apply();
@@ -478,7 +477,7 @@ QString QWebSettings::defaultTextEncoding() const
Setting an empty path disables the icon database.
*/
-void QWebSettings::setIconDatabasePath(const QString &path)
+void QWebSettings::setIconDatabasePath(const QString& path)
{
WebCore::iconDatabase()->delayDatabaseCleanup();
@@ -501,11 +500,10 @@ void QWebSettings::setIconDatabasePath(const QString &path)
*/
QString QWebSettings::iconDatabasePath()
{
- if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen()) {
+ if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen())
return WebCore::iconDatabase()->databasePath();
- } else {
+ else
return QString();
- }
}
/*!
@@ -527,18 +525,18 @@ void QWebSettings::clearIconDatabase()
\sa setIconDatabasePath()
*/
-QIcon QWebSettings::iconForUrl(const QUrl &url)
+QIcon QWebSettings::iconForUrl(const QUrl& url)
{
WebCore::Image* image = WebCore::iconDatabase()->iconForPageURL(WebCore::KURL(url).string(),
WebCore::IntSize(16, 16));
- if (!image) {
+ if (!image)
return QPixmap();
- }
- QPixmap *icon = image->nativeImageForCurrentFrame();
- if (!icon) {
+
+ QPixmap* icon = image->nativeImageForCurrentFrame();
+ if (!icon)
return QPixmap();
- }
- return *icon;
+
+ return* icon;
}
/*!
@@ -550,9 +548,9 @@ QIcon QWebSettings::iconForUrl(const QUrl &url)
\sa webGraphic()
*/
-void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap &graphic)
+void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap& graphic)
{
- WebGraphicHash *h = graphics();
+ WebGraphicHash* h = graphics();
if (graphic.isNull())
h->remove(type);
else
@@ -641,7 +639,7 @@ int QWebSettings::maximumPagesInCache()
*/
void QWebSettings::setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity)
{
- bool disableCache = cacheMinDeadCapacity == 0 && cacheMaxDead == 0 && totalCapacity == 0;
+ bool disableCache = !cacheMinDeadCapacity && !cacheMaxDead && !totalCapacity;
WebCore::cache()->setDisabled(disableCache);
WebCore::cache()->setCapacities(qMax(0, cacheMinDeadCapacity),
@@ -653,7 +651,7 @@ void QWebSettings::setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheM
Sets the actual font family to \a family for the specified generic family,
\a which.
*/
-void QWebSettings::setFontFamily(FontFamily which, const QString &family)
+void QWebSettings::setFontFamily(FontFamily which, const QString& family)
{
d->fontFamilies.insert(which, family);
d->apply();
@@ -667,7 +665,7 @@ QString QWebSettings::fontFamily(FontFamily which) const
{
QString defaultValue;
if (d->settings) {
- QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+ QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;
defaultValue = global->fontFamilies.value(which);
}
return d->fontFamilies.value(which, defaultValue);
@@ -708,7 +706,7 @@ bool QWebSettings::testAttribute(WebAttribute attr) const
{
bool defaultValue = false;
if (d->settings) {
- QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;
+ QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;
defaultValue = global->attributes.value(attr);
}
return d->attributes.value(attr, defaultValue);
@@ -789,7 +787,7 @@ qint64 QWebSettings::offlineStorageDefaultQuota()
/*
\internal
\relates QWebSettings
-
+
Sets the path for HTML5 offline web application cache storage to \a path.
\a path must point to an existing directory where the cache is stored.
@@ -808,7 +806,7 @@ void QWEBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QStri
/*
\internal
\relates QWebSettings
-
+
Returns the path of the HTML5 offline web application cache storage
or an empty string if the feature is disabled.
@@ -837,7 +835,7 @@ QString QWEBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()
*/
void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path)
{
- QWebSettingsPrivate *d = settings->handle();
+ QWebSettingsPrivate* d = settings->handle();
d->localStorageDatabasePath = path;
d->apply();
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
index 7cbca25..63144cb 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
@@ -27,8 +27,7 @@
#include <QtGui/qicon.h>
#include <QtCore/qshareddata.h>
-namespace WebCore
-{
+namespace WebCore {
class Settings;
}
@@ -38,8 +37,7 @@ QT_BEGIN_NAMESPACE
class QUrl;
QT_END_NAMESPACE
-class QWEBKIT_EXPORT QWebSettings
-{
+class QWEBKIT_EXPORT QWebSettings {
public:
enum FontFamily {
StandardFont,
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index 6c5860c..e1a0c98 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -30,8 +30,7 @@
#include "qdir.h"
#include "qfile.h"
-class QWebViewPrivate
-{
+class QWebViewPrivate {
public:
QWebViewPrivate(QWebView *view)
: view(view)
@@ -87,7 +86,7 @@ public:
\image qwebview-url.png
A web site can be loaded onto QWebView with the load() function. Like all
- Qt Widgets, the show() function must be invoked in order to display
+ Qt widgets, the show() function must be invoked in order to display
QWebView. The snippet below illustrates this:
\snippet webkitsnippets/simple/main.cpp Using QWebView
@@ -147,7 +146,8 @@ public:
if you do not require QWidget attributes. Nevertheless, QtWebKit depends
on QtGui, so you should use a QApplication instead of QCoreApplication.
- \sa {Previewer Example}, {Browser}
+ \sa {Previewer Example}, {Web Browser}, {Form Extractor Example},
+ {Google Chat Example}, {Fancy Browser Example}
*/
/*!
@@ -206,16 +206,15 @@ QWebPage *QWebView::page() const
\sa page()
*/
-void QWebView::setPage(QWebPage *page)
+void QWebView::setPage(QWebPage* page)
{
if (d->page == page)
return;
if (d->page) {
- if (d->page->parent() == this) {
+ if (d->page->parent() == this)
delete d->page;
- } else {
+ else
d->page->disconnect(this);
- }
}
d->page = page;
if (d->page) {
@@ -710,9 +709,8 @@ bool QWebView::event(QEvent *e)
}
#endif
#endif
- } else if (e->type() == QEvent::Leave) {
+ } else if (e->type() == QEvent::Leave)
d->page->event(e);
- }
}
return QWidget::event(e);
@@ -815,7 +813,7 @@ void QWebView::paintEvent(QPaintEvent *ev)
#ifdef QWEBKIT_TIME_RENDERING
int elapsed = time.elapsed();
- qDebug()<<"paint event on "<<ev->region()<<", took to render = "<<elapsed;
+ qDebug() << "paint event on " << ev->region() << ", took to render = " << elapsed;
#endif
}
@@ -1011,9 +1009,8 @@ void QWebView::inputMethodEvent(QInputMethodEvent *e)
*/
void QWebView::changeEvent(QEvent *e)
{
- if (d->page && e->type() == QEvent::PaletteChange) {
+ if (d->page && e->type() == QEvent::PaletteChange)
d->page->setPalette(palette());
- }
QWidget::changeEvent(e);
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
index 0dab925..e886144 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
@@ -40,8 +40,7 @@ class QWebPage;
class QWebViewPrivate;
class QWebNetworkRequest;
-class QWEBKIT_EXPORT QWebView : public QWidget
-{
+class QWEBKIT_EXPORT QWebView : public QWidget {
Q_OBJECT
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
@@ -54,27 +53,27 @@ class QWEBKIT_EXPORT QWebView : public QWidget
Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints)
Q_FLAGS(QPainter::RenderHints)
public:
- explicit QWebView(QWidget *parent = 0);
+ explicit QWebView(QWidget* parent = 0);
virtual ~QWebView();
- QWebPage *page() const;
- void setPage(QWebPage *page);
+ QWebPage* page() const;
+ void setPage(QWebPage* page);
- static QUrl guessUrlFromString(const QString &string);
+ static QUrl guessUrlFromString(const QString& string);
- void load(const QUrl &url);
+ void load(const QUrl& url);
#if QT_VERSION < 0x040400 && !defined(qdoc)
- void load(const QWebNetworkRequest &request);
+ void load(const QWebNetworkRequest& request);
#else
- void load(const QNetworkRequest &request,
+ void load(const QNetworkRequest& request,
QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
const QByteArray &body = QByteArray());
#endif
- void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
- void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
+ void setHtml(const QString& html, const QUrl& baseUrl = QUrl());
+ void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl());
- QWebHistory *history() const;
- QWebSettings *settings() const;
+ QWebHistory* history() const;
+ QWebSettings* settings() const;
QString title() const;
void setUrl(const QUrl &url);
@@ -83,7 +82,7 @@ public:
QString selectedText() const;
- QAction *pageAction(QWebPage::WebAction action) const;
+ QAction* pageAction(QWebPage::WebAction action) const;
void triggerPageAction(QWebPage::WebAction action, bool checked = false);
bool isModified() const;
@@ -108,9 +107,9 @@ public:
void setRenderHints(QPainter::RenderHints hints);
void setRenderHint(QPainter::RenderHint hint, bool enabled = true);
- bool findText(const QString &subString, QWebPage::FindFlags options = 0);
+ bool findText(const QString& subString, QWebPage::FindFlags options = 0);
- virtual bool event(QEvent *);
+ virtual bool event(QEvent*);
public Q_SLOTS:
void stop();
@@ -118,7 +117,7 @@ public Q_SLOTS:
void forward();
void reload();
- void print(QPrinter *printer) const;
+ void print(QPrinter*) const;
Q_SIGNALS:
void loadStarted();
@@ -126,14 +125,14 @@ Q_SIGNALS:
void loadFinished(bool);
void titleChanged(const QString& title);
void statusBarMessage(const QString& text);
- void linkClicked(const QUrl &url);
+ void linkClicked(const QUrl&);
void selectionChanged();
void iconChanged();
- void urlChanged(const QUrl &url);
+ void urlChanged(const QUrl&);
protected:
- void resizeEvent(QResizeEvent *e);
- void paintEvent(QPaintEvent *ev);
+ void resizeEvent(QResizeEvent*);
+ void paintEvent(QPaintEvent*);
virtual QWebView *createWindow(QWebPage::WebWindowType type);
@@ -150,10 +149,10 @@ protected:
#endif
virtual void keyPressEvent(QKeyEvent*);
virtual void keyReleaseEvent(QKeyEvent*);
- virtual void dragEnterEvent(QDragEnterEvent *);
- virtual void dragLeaveEvent(QDragLeaveEvent *);
- virtual void dragMoveEvent(QDragMoveEvent *);
- virtual void dropEvent(QDropEvent *);
+ virtual void dragEnterEvent(QDragEnterEvent*);
+ virtual void dragLeaveEvent(QDragLeaveEvent*);
+ virtual void dragMoveEvent(QDragMoveEvent*);
+ virtual void dropEvent(QDropEvent*);
virtual void focusInEvent(QFocusEvent*);
virtual void focusOutEvent(QFocusEvent*);
virtual void inputMethodEvent(QInputMethodEvent*);
@@ -162,7 +161,7 @@ protected:
private:
friend class QWebPage;
- QWebViewPrivate *d;
+ QWebViewPrivate* d;
};
#endif // QWEBVIEW_H
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 02aab77..83808d2 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,522 @@
+2009-07-28 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Ariya Hidayat.
+
+ Fix compilation with the precompiled header.
+
+ * WebKit_pch.h: Don't include JSDOMBinding.h and MathObject.h,
+ as they include AtomicString.h. AtomicString.cpp needs to enable
+ a #define before including AtomicString.h, which breaks if the PCH
+ forces the inclusion beforehand.
+
+2009-07-28 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Added tests to ensure that scroll position can be changed
+ programmatically, even when the scroll bar policy is set to off.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix a few compilation warnings in the QWebFrame tests.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-28 Andre Pedralho <andre.pedralho@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Fixed tst_QWebFrame::hasSetFocus test which was using
+ an undefined resource.
+ https://bugs.webkit.org/show_bug.cgi?id=27512
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-28 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ Make it possible to pass relative file names to QtLauncher.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2009-07-27 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27735
+ Give a helpful name to JSLock constructor argument
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject):
+
+2009-07-27 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ QWebView's "enabled" parameter should default to true, as with QGraphicsView and
+ QPainter.
+
+ * Api/qwebview.cpp: Add reference to QPainter::renderHints().
+ * Api/qwebview.h: Add default for enabled argument.
+
+2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ More documentation cleanups in the QWebElement class overview.
+
+ * Api/qwebelement.cpp:
+
+2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Clean up documentation of QWebElement's findFirst and findAll functions,
+ as well as their QWebFrame counterparts.
+
+ * Api/qwebelement.cpp:
+ * Api/qwebframe.cpp:
+
+2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Various documentation cleanups
+
+ * Fixed qdoc warnings
+ * Hide QWebNetworkInterface from the class overview
+ * Mention QWebElement in the module overview
+ * More cleanups
+
+ * Api/qwebframe.cpp:
+ * Api/qwebnetworkinterface.cpp:
+ * Api/qwebview.cpp:
+ * docs/qtwebkit.qdoc:
+
+2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Added missing class diagram referenced from the docs, taken from the Qt
+ documentation.
+
+ * docs/qtwebkit.qdocconf: Register the image directory with
+ qdoc.
+ * docs/qwebview-diagram.png: Added.
+
+2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Adam Treat.
+
+ As per discussion on IRC, changed originalUrl by requestedUrl.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::requestedUrl):
+ * Api/qwebframe.h:
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-24 Andre Pedralho <andre.pedralho@openbossa.org>
+
+ Reviewed by Adam Treat.
+
+ Removed void QWebFrame::renderContents(...) and added the Q_PROPERTY
+ clipRenderToViewport to control whether QWebFrame::render would call
+ FrameView::paintContents rather than FrameView::paint and do not clip
+ the frame content to viewport.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::renderPrivate):
+ (QWebFrame::clipRenderToViewport):
+ (QWebFrame::setClipRenderToViewport):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ [QT] Implement originalUrl getter method to the API
+ https://bugs.webkit.org/show_bug.cgi?id=25867
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::originalUrl):
+ * Api/qwebframe.h:
+ * tests/qwebframe/qwebframe.qrc:
+ * tests/qwebframe/test1.html: Added.
+ * tests/qwebframe/test2.html: Added.
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-24 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Build fix for Qt.
+
+ Fix build issue introduced in 46344
+ ([Bug 22700] ApplicationCache should have size limit)
+
+ Remove method only added to the Qt ChromeClient.
+
+ * WebCoreSupport/ChromeClientQt.h:
+
+2009-07-24 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Anders Carlsson.
+
+ ApplicationCache should have size limit
+ https://bugs.webkit.org/show_bug.cgi?id=22700
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::reachedMaxAppCacheSize):
+ Adds empty implementation of the reachedMaxAppCacheSize callback.
+ * WebCoreSupport/ChromeClientQt.h:
+
+2009-07-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add simple proxy support for QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=27495
+
+ Picks up proxy settings from the http_proxy environment
+ variable.
+
+ * QtLauncher/QtLauncher.pro: Add QtNetwork dependency for all
+ platforms.
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2009-07-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ Added a testcase to verify that cached methods in the QOBject bindings
+ remain alife even after garbage collection.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::protectBindingsRuntimeObjectsFromCollector):
+
+2009-07-23 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Fixing two issues related to QtLauncher
+ - MainWindow objects are not always freed after close
+ - JavaScript window.close() sometimes crashes
+ https://bugs.webkit.org/show_bug.cgi?id=27601
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (main):
+
+2009-07-21 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Various improvements to the API documentation.
+
+ * Updated link to W3c Database spec
+ * Formatting fixes, cleanups
+ * Add missing \since 4.6 tags to QWebPage::frameAt
+ * Extend QWebDatabase and QWebSecurityOrigin docs.
+
+ * Api/qwebdatabase.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebsecurityorigin.cpp:
+ * Api/qwebview.cpp:
+
+2009-07-21 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ Remove preliminary-tag from QWebElement
+
+ * Api/qwebelement.cpp:
+
+2009-07-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix Qt code to follow the WebKit Coding Style.
+
+ * Api/qcookiejar.cpp:
+ (QCookieJar::setCookieJar):
+ (QCookieJar::cookieJar):
+ * Api/qcookiejar.h:
+ * Api/qwebdatabase.cpp:
+ (QWebDatabase::QWebDatabase):
+ (QWebDatabase::removeDatabase):
+ * Api/qwebdatabase.h:
+ * Api/qwebdatabase_p.h:
+ * Api/qwebelement.h:
+ * Api/qwebframe.cpp:
+ (QWebFrame::title):
+ (QWebFrame::print):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebhistory.cpp:
+ (QWebHistory::clear):
+ * Api/qwebhistory.h:
+ * Api/qwebhistory_p.h:
+ * Api/qwebhistoryinterface.cpp:
+ (gCleanupInterface):
+ (QWebHistoryInterface::setDefaultInterface):
+ (QWebHistoryInterface::defaultInterface):
+ (QWebHistoryInterface::QWebHistoryInterface):
+ * Api/qwebhistoryinterface.h:
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::finished):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+ (QWebNetworkInterface::addJob):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::editorCommandForWebActions):
+ (QWebPagePrivate::createContextMenu):
+ (QWebPagePrivate::focusInEvent):
+ (QWebPage::fixedContentsSize):
+ (QWebPage::setContentEditable):
+ (QWebPage::swallowContextMenuEvent):
+ (QWebPage::findText):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebpluginfactory.h:
+ * Api/qwebsecurityorigin.h:
+ * Api/qwebsecurityorigin_p.h:
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::QWebSettingsPrivate):
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::globalSettings):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::fontSize):
+ (QWebSettings::setUserStyleSheetUrl):
+ (QWebSettings::setDefaultTextEncoding):
+ (QWebSettings::setIconDatabasePath):
+ (QWebSettings::iconDatabasePath):
+ (QWebSettings::iconForUrl):
+ (QWebSettings::setWebGraphic):
+ (QWebSettings::setFontFamily):
+ (QWebSettings::fontFamily):
+ (QWebSettings::testAttribute):
+ (qt_websettings_setLocalStorageDatabasePath):
+ * Api/qwebsettings.h:
+ * Api/qwebview.cpp:
+ (QWebView::setPage):
+ (QWebView::event):
+ * Api/qwebview.h:
+
+2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add test for loading webpages...
+
+ Performance test for loading webpages. Wait for the loadFinished
+ signal to be fired. This should include a non empty layout.
+
+ * tests/benchmarks/loading/tst_loading.cpp: Added.
+ (waitForSignal):
+ (tst_Loading::init):
+ (tst_Loading::cleanup):
+ (tst_Loading::load_data):
+ (tst_Loading::load):
+ * tests/benchmarks/loading/tst_loading.pro: Added.
+ * tests/tests.pro:
+
+2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add a test case for drawing a simple viewrect to a QPixmap
+
+ * tests/benchmarks/painting/tst_painting.cpp: Added.
+ (waitForSignal):
+ (tst_Painting::init):
+ (tst_Painting::cleanup):
+ (tst_Painting::paint_data):
+ (tst_Painting::paint):
+ * tests/benchmarks/painting/tst_painting.pro: Added.
+ * tests/tests.pro:
+
+2009-07-20 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Add an option for QtLauncher to build without QtUiTools dependency
+ https://bugs.webkit.org/show_bug.cgi?id=27438
+
+ Based on Norbert Leser's work.
+
+ * QtLauncher/main.cpp:
+ (WebPage::createPlugin):
+
+2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Adam Treat.
+
+ Coding style fixes.
+
+ * Api/qcookiejar.cpp:
+ (QCookieJarPrivate::QCookieJarPrivate):
+ (qHash):
+ (QCookieJar::cookieJar):
+ * Api/qwebelement.cpp:
+ (QWebElement::functions):
+ (QWebElement::scriptableProperties):
+ * Api/qwebframe.cpp:
+ (QWebFrame::metaData):
+ (QWebFrame::scrollBarValue):
+ (QWebFrame::scroll):
+ (QWebFrame::scrollPosition):
+ (QWebFrame::print):
+ * Api/qwebnetworkinterface.cpp:
+ (decodePercentEncoding):
+ (QWebNetworkRequestPrivate::init):
+ (QWebNetworkRequestPrivate::setURL):
+ (QWebNetworkRequest::QWebNetworkRequest):
+ (QWebNetworkRequest::operator=):
+ (QWebNetworkRequest::setUrl):
+ (QWebNetworkRequest::setHttpHeader):
+ (QWebNetworkRequest::httpHeaderField):
+ (QWebNetworkRequest::setHttpHeaderField):
+ (QWebNetworkRequest::setPostData):
+ (QWebNetworkJob::setResponse):
+ (QWebNetworkJob::frame):
+ (QWebNetworkManager::add):
+ (QWebNetworkManager::cancel):
+ (QWebNetworkManager::started):
+ (QWebNetworkManager::data):
+ (QWebNetworkManager::finished):
+ (QWebNetworkManager::addHttpJob):
+ (QWebNetworkManager::cancelHttpJob):
+ (QWebNetworkManager::httpConnectionClosed):
+ (QWebNetworkInterfacePrivate::sendFileData):
+ (QWebNetworkInterfacePrivate::parseDataUrl):
+ (QWebNetworkManager::doWork):
+ (QWebNetworkInterface::setDefaultInterface):
+ (QWebNetworkInterface::defaultInterface):
+ (QWebNetworkInterface::QWebNetworkInterface):
+ (QWebNetworkInterface::addJob):
+ (QWebNetworkInterface::cancelJob):
+ (WebCoreHttp::WebCoreHttp):
+ (WebCoreHttp::request):
+ (WebCoreHttp::scheduleNextRequest):
+ (WebCoreHttp::getConnection):
+ (WebCoreHttp::onResponseHeaderReceived):
+ (WebCoreHttp::onReadyRead):
+ (WebCoreHttp::onRequestFinished):
+ (WebCoreHttp::onAuthenticationRequired):
+ (WebCoreHttp::onProxyAuthenticationRequired):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::inputMethodEvent):
+ (QWebPagePrivate::shortcutOverrideEvent):
+ (QWebPage::inputMethodQuery):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::updatePositionDependentActions):
+ (QWebPage::userAgentForUrl):
+ (QWebPagePrivate::_q_onLoadProgressChanged):
+ (QWebPage::totalBytes):
+ (QWebPage::bytesReceived):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::iconForUrl):
+ (QWebSettings::setObjectCacheCapacities):
+ * Api/qwebview.cpp:
+ (QWebView::paintEvent):
+ (QWebView::changeEvent):
+
+2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Overwrite the plugin directories for the DRT.
+ Part of https://bugs.webkit.org/show_bug.cgi?id=27215
+
+ * Api/qwebpage.cpp:
+ (qt_drt_overwritePluginDirectories): Only set the plugin directories
+ to the ones in the QTWEBKIT_PLUGIN_PATH environment variable.
+
+2009-07-16 Xiaomei Ji <xji@chromium.org>
+
+ Reviewed by Dan Bernstein.
+
+ This is the 2nd part of fixing "RTL: tooltip does not get its directionlity from its element's."
+ https://bugs.webkit.org/show_bug.cgi?id=24187
+
+ Add one extra parameter to the callee of HitTestResult::title() due to the signature change.
+
+ * Api/qwebframe.cpp:
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate): Add direction as a parameter to the callee of HitTestResult::title().
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement): Add direction as a parameter to the callee of HitTestResult::title().
+
+2009-07-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Add new action to qwebpage to reload without cache.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+ (QWebPagePrivate::updateNavigationActions):
+ (QWebPage::triggerAction):
+ * Api/qwebpage.h:
+
+2009-07-16 Xiaomei Ji <xji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Fix tooltip does not get its directionality from its element's directionality.
+ https://bugs.webkit.org/show_bug.cgi?id=24187
+
+ Per mitz's suggestion in comment #6, while getting the plain-text
+ title, we also get the directionality of the title. How to handle
+ the directionality is up to clients. Clients could ignore it,
+ or use attribute or unicode control characters to display the title
+ as what they want.
+
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::setToolTip): Add directionality as 2nd parameter to setToopTip() (without handling it yet).
+ * WebCoreSupport/ChromeClientQt.h: Add directionality as 2nd parameter to setToolTip().
+
+2009-07-15 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27285
+
+ When the user clicks a link with a target attribute, the newly created window should be visible.
+ Make new windows created in Qtlauncher visible.
+
+ * QtLauncher/main.cpp:
+ (WebPage::createWindow):
+
+2009-07-14 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Zack Rusin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26983
+
+ The default constructed values for QSize and WebCore::IntSize are different. The former
+ produces an invalid size whereas the latter produces a size of zero. This was causing
+ a layout to be triggered when constructing a view and an assert to be hit. This patch fixes
+ the crash by taking care not to cause an unnecessary layout triggered by ScrollView::setFixedLayoutSize.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
2009-07-13 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Ariya Hidayat.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index c169a9f..d659833 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -353,18 +353,19 @@ void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) cons
void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
{
+ TextDirection dir;
if (result.absoluteLinkURL() != lastHoverURL
- || result.title() != lastHoverTitle
+ || result.title(dir) != lastHoverTitle
|| result.textContent() != lastHoverContent) {
lastHoverURL = result.absoluteLinkURL();
- lastHoverTitle = result.title();
+ lastHoverTitle = result.title(dir);
lastHoverContent = result.textContent();
emit m_webPage->linkHovered(lastHoverURL.prettyURL(),
lastHoverTitle, lastHoverContent);
}
}
-void ChromeClientQt::setToolTip(const String &tip)
+void ChromeClientQt::setToolTip(const String &tip, TextDirection)
{
#ifndef QT_NO_TOOLTIP
QWidget* view = m_webPage->view();
@@ -400,6 +401,14 @@ void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseN
}
#endif
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+void ChromeClientQt::reachedMaxAppCacheSize(int64_t spaceNeeded)
+{
+ // FIXME: Free some space.
+ notImplemented();
+}
+#endif
+
void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
{
RefPtr<FileChooser> fileChooser = prpFileChooser;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 67663fb..96c7fab 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -110,12 +110,15 @@ namespace WebCore {
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
- virtual void setToolTip(const String&);
+ virtual void setToolTip(const String&, TextDirection);
virtual void print(Frame*);
#if ENABLE(DATABASE)
virtual void exceededDatabaseQuota(Frame*, const String&);
#endif
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
+#endif
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
virtual void formStateDidChange(const Node*) { }
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 8e6ffed..5cf86b1 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -214,7 +214,7 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
m_frame->createView(m_webFrame->page()->viewportSize(),
backgroundColor, !backgroundColor.alpha(),
- fixedLayoutSize,
+ fixedLayoutSize.isValid() ? IntSize(fixedLayoutSize) : IntSize(),
fixedLayoutSize.isValid(),
(ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
(ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
diff --git a/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h b/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h
index ae8ec88..1dd4d52 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h
@@ -77,7 +77,4 @@
#include <wtf/UnusedParam.h>
#include <wtf/AlwaysInline.h>
#include <wtf/GetPtr.h>
-
-#include "../../WebCore/bindings/js/JSDOMBinding.h"
-#include "../../JavaScriptCore/runtime/MathObject.h"
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
index 3def65c..f3681ee 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
@@ -57,16 +57,13 @@
\section1 Configuring the Build Process
- Applications that use QtWebKit's classes need to be configured to be built
+ Applications using QtWebKit's classes need to be configured to be built
against the QtWebKit module. The following declaration in a \c qmake
project file ensures that an application is compiled and linked
appropriately:
\snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
- This line is necessary because only the QtCore and QtGui modules are used
- in the default build process.
-
To include the definitions of the module's classes, use the following
directive:
@@ -80,17 +77,24 @@
\snippet webkitsnippets/simple/main.cpp Using QWebView
- QWebView acts as a view onto Web pages, each of which is represented by an
- instance of the QWebPage class. QWebPage provides access to the document
- structure in a page, describing features such as frames, the navigation
- history, and the undo/redo stack for editable content.
+ QWebView is used to view Web pages. An instance of QWebView has one
+ QWebPage. QWebPage provides access to the document structure in a page,
+ describing features such as frames, the navigation history, and the
+ undo/redo stack for editable content.
HTML documents can be nested using frames in a frameset. An individual
- frame in HTML is represented using the QWebFrame class. It includes the
+ frame in HTML is represented using the QWebFrame class. This class includes the
bridge to the JavaScript window object and can be painted using QPainter.
- Each QWebPage has one QWebFrame object as its main frame.
+ Each QWebPage has one QWebFrame object as its main frame, and the main frame
+ may contain many child frames.
+
+ Individual elements of an HTML document can be accessed via DOM JavaScript
+ interfaces from within a web page. The equivalent of this API in QtWebKit
+ is represented by QWebElement. QWebElement objects are obtained using QWebFrame's
+ \l{QWebFrame::}{findAllElements()} and \l{QWebFrame::}{findFirstElement()}
+ functions with CSS selector queries.
- Individual browser features, defaults and other settings can be configured
+ Common web browser features, defaults and other settings can be configured
through the QWebSettings class. It is possible to provide defaults for all
QWebPage instances through the default settings. Individual attributes
can be overidden by the page specific settings object.
@@ -100,7 +104,7 @@
Since WebKit supports the Netscape Plugin API, Qt applications can display
Web pages that embed common plugins, as long as the user has the appropriate
binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled}
- attribute is set for the application.
+ attribute is enabled for the application.
The following locations are searched for plugins:
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf
index 6343b17..8ee8f69 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdocconf
@@ -9,6 +9,7 @@ outputdir = $OUTPUT_DIR/doc/html
outputformats = HTML
sources.fileextensions = "*.cpp *.doc *.qdoc *.h"
exampledirs = $SRCDIR/WebKit/qt/docs
+imagedirs = $SRCDIR/WebKit/qt/docs
indexes = $QTDIR/doc/html/qt.index
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qwebview-diagram.png b/src/3rdparty/webkit/WebKit/qt/docs/qwebview-diagram.png
new file mode 100644
index 0000000..ada865e
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qwebview-diagram.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp
new file mode 100644
index 0000000..0bc87f7
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2009 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <QtTest/QtTest>
+
+#include <qwebframe.h>
+#include <qwebview.h>
+#include <qpainter.h>
+
+/**
+ * Starts an event loop that runs until the given signal is received.
+ Optionally the event loop
+ * can return earlier on a timeout.
+ *
+ * \return \p true if the requested signal was received
+ * \p false on timeout
+ */
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
+{
+ QEventLoop loop;
+ QObject::connect(obj, signal, &loop, SLOT(quit()));
+ QTimer timer;
+ QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
+ if (timeout > 0) {
+ QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.setSingleShot(true);
+ timer.start(timeout);
+ }
+ loop.exec();
+ return timeoutSpy.isEmpty();
+}
+
+class tst_Loading : public QObject
+{
+ Q_OBJECT
+
+public:
+
+public Q_SLOTS:
+ void init();
+ void cleanup();
+
+private Q_SLOTS:
+ void load_data();
+ void load();
+
+private:
+ QWebView* m_view;
+ QWebPage* m_page;
+};
+
+void tst_Loading::init()
+{
+ m_view = new QWebView;
+ m_page = m_view->page();
+
+ QSize viewportSize(1024, 768);
+ m_view->setFixedSize(viewportSize);
+ m_page->setViewportSize(viewportSize);
+}
+
+void tst_Loading::cleanup()
+{
+ delete m_view;
+}
+
+void tst_Loading::load_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::newRow("amazon") << QUrl("http://www.amazon.com");
+ QTest::newRow("kde") << QUrl("http://www.kde.org");
+ QTest::newRow("apple") << QUrl("http://www.apple.com");
+}
+
+void tst_Loading::load()
+{
+ QFETCH(QUrl, url);
+
+
+ QBENCHMARK {
+ m_view->load(url);
+
+ // really wait for loading, painting is in another test
+ ::waitForSignal(m_view, SIGNAL(loadFinished(bool)));
+ }
+}
+
+QTEST_MAIN(tst_Loading)
+#include "tst_loading.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
new file mode 100644
index 0000000..af0387e
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_loading
+include(../../../../../WebKit.pri)
+SOURCES += tst_loading.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp
new file mode 100644
index 0000000..f4531fd
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2009 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <QtTest/QtTest>
+
+#include <qwebframe.h>
+#include <qwebview.h>
+#include <qpainter.h>
+
+/**
+ * Starts an event loop that runs until the given signal is received.
+ Optionally the event loop
+ * can return earlier on a timeout.
+ *
+ * \return \p true if the requested signal was received
+ * \p false on timeout
+ */
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
+{
+ QEventLoop loop;
+ QObject::connect(obj, signal, &loop, SLOT(quit()));
+ QTimer timer;
+ QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
+ if (timeout > 0) {
+ QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.setSingleShot(true);
+ timer.start(timeout);
+ }
+ loop.exec();
+ return timeoutSpy.isEmpty();
+}
+
+class tst_Painting : public QObject
+{
+ Q_OBJECT
+
+public:
+
+public Q_SLOTS:
+ void init();
+ void cleanup();
+
+private Q_SLOTS:
+ void paint_data();
+ void paint();
+
+private:
+ QWebView* m_view;
+ QWebPage* m_page;
+};
+
+void tst_Painting::init()
+{
+ m_view = new QWebView;
+ m_page = m_view->page();
+
+ QSize viewportSize(1024, 768);
+ m_view->setFixedSize(viewportSize);
+ m_page->setViewportSize(viewportSize);
+}
+
+void tst_Painting::cleanup()
+{
+ delete m_view;
+}
+
+void tst_Painting::paint_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::newRow("amazon") << QUrl("http://www.amazon.com");
+}
+
+void tst_Painting::paint()
+{
+ QFETCH(QUrl, url);
+
+ m_view->load(url);
+ ::waitForSignal(m_view, SIGNAL(loadFinished(bool)));
+
+ /* force a layout */
+ QWebFrame* mainFrame = m_page->mainFrame();
+ mainFrame->toPlainText();
+
+ QPixmap pixmap(m_page->viewportSize());
+ QBENCHMARK {
+ QPainter painter(&pixmap);
+ mainFrame->render(&painter, QRect(QPoint(0, 0), m_page->viewportSize()));
+ painter.end();
+ }
+}
+
+QTEST_MAIN(tst_Painting)
+#include "tst_painting.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
new file mode 100644
index 0000000..496210e
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_painting
+include(../../../../../WebKit.pri)
+SOURCES += tst_painting.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
index 266cdce..9615e27 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
@@ -2,5 +2,7 @@
<qresource prefix="/">
<file>image.png</file>
<file>style.css</file>
+<file>test1.html</file>
+<file>test2.html</file>
</qresource>
</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test1.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test1.html
new file mode 100644
index 0000000..b323f96
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test1.html
@@ -0,0 +1 @@
+<html><body><p>Some text 1</p></body></html>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test2.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test2.html
new file mode 100644
index 0000000..63ac1f6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/test2.html
@@ -0,0 +1 @@
+<html><body> <p>Some text 2</p></body></html>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index c0e72be..a3bcd20 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -29,8 +29,10 @@
#include <QAbstractItemView>
#include <QApplication>
#include <QComboBox>
+#include <QPicture>
#include <QRegExp>
#include <QNetworkRequest>
+#include <QNetworkReply>
//TESTED_CLASS=
//TESTED_FILES=
@@ -573,6 +575,7 @@ private slots:
void progressSignal();
void urlChange();
void domCycles();
+ void requestedUrl();
void setHtml();
void setHtmlWithResource();
void ipv6HostEncoding();
@@ -585,6 +588,8 @@ private slots:
void baseUrl_data();
void baseUrl();
void hasSetFocus();
+ void render();
+ void scrollPosition();
private:
QString evalJS(const QString&s) {
@@ -2159,6 +2164,93 @@ void tst_QWebFrame::domCycles()
QVERIFY(v.type() == QVariant::Map);
}
+class FakeReply : public QNetworkReply {
+ Q_OBJECT
+
+ public:
+ FakeReply(const QNetworkRequest& request, QObject* parent = 0)
+ : QNetworkReply(parent)
+ {
+ setOperation(QNetworkAccessManager::GetOperation);
+ setRequest(request);
+ if (request.url() == QUrl("qrc:/test1.html")) {
+ setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
+ setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
+ } else
+ setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
+
+ open(QIODevice::ReadOnly);
+ QTimer::singleShot(0, this, SLOT(timeout()));
+ }
+ ~FakeReply()
+ {
+ close();
+ }
+ virtual void abort() {}
+ virtual void close() {}
+ protected:
+ qint64 readData(char*, qint64)
+ {
+ return 0;
+ }
+ private slots:
+ void timeout()
+ {
+ if (request().url() == QUrl("qrc://test1.html"))
+ emit error(this->error());
+ else if (request().url() == QUrl("http://abcdef.abcdef/"))
+ emit metaDataChanged();
+
+ emit readyRead();
+ emit finished();
+ }
+};
+
+class FakeNetworkManager : public QNetworkAccessManager {
+public:
+ FakeNetworkManager(QObject* parent) : QNetworkAccessManager(parent) { }
+
+protected:
+ virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
+ {
+ if (op == QNetworkAccessManager::GetOperation
+ && (request.url().toString() == "qrc:/test1.html"
+ || request.url().toString() == "http://abcdef.abcdef/"))
+ return new FakeReply(request, this);
+
+ return QNetworkAccessManager::createRequest(op, request, outgoingData);
+ }
+};
+
+void tst_QWebFrame::requestedUrl()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+
+ // in few seconds, the image should be completely loaded
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+ FakeNetworkManager* networkManager = new FakeNetworkManager(&page);
+ page.setNetworkAccessManager(networkManager);
+
+ frame->setUrl(QUrl("qrc:/test1.html"));
+ QTest::qWait(200);
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(frame->requestedUrl(), QUrl("qrc:/test1.html"));
+ QCOMPARE(frame->url(), QUrl("qrc:/test2.html"));
+
+ frame->setUrl(QUrl("qrc:/non-existent.html"));
+ QTest::qWait(200);
+ QCOMPARE(spy.count(), 2);
+ QCOMPARE(frame->requestedUrl(), QUrl("qrc:/non-existent.html"));
+ QCOMPARE(frame->url(), QUrl("qrc:/non-existent.html"));
+
+ frame->setUrl(QUrl("http://abcdef.abcdef"));
+ QTest::qWait(200);
+ QCOMPARE(spy.count(), 3);
+ QCOMPARE(frame->requestedUrl(), QUrl("http://abcdef.abcdef/"));
+ QCOMPARE(frame->url(), QUrl("http://abcdef.abcdef/"));
+}
+
void tst_QWebFrame::setHtml()
{
QString html("<html><head></head><body><p>hello world</p></body></html>");
@@ -2453,16 +2545,29 @@ void tst_QWebFrame::baseUrl()
void tst_QWebFrame::hasSetFocus()
{
+ QString html("<html><body><p>top</p>" \
+ "<iframe width='80%' height='30%'/>" \
+ "</body></html>");
+
QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool)));
- QUrl url = QUrl("qrc:///frametest/iframe.html");
- m_page->mainFrame()->load(url);
+ m_page->mainFrame()->setHtml(html);
+
+ QTest::qWait(200);
+ QCOMPARE(loadSpy.size(), 1);
- ::waitForSignal(m_page, SIGNAL(loadFinished(bool)));
+ QList<QWebFrame*> children = m_page->mainFrame()->childFrames();
+ QWebFrame* frame = children.at(0);
+ QString innerHtml("<html><body><p>another iframe</p>" \
+ "<iframe width='80%' height='30%'/>" \
+ "</body></html>");
+ frame->setHtml(innerHtml);
+
+ QTest::qWait(200);
+ QCOMPARE(loadSpy.size(), 2);
m_page->mainFrame()->setFocus();
QVERIFY(m_page->mainFrame()->hasFocus());
- QList<QWebFrame*> children = m_page->mainFrame()->childFrames();
for (int i = 0; i < children.size(); ++i) {
children.at(i)->setFocus();
QVERIFY(children.at(i)->hasFocus());
@@ -2473,5 +2578,70 @@ void tst_QWebFrame::hasSetFocus()
QVERIFY(m_page->mainFrame()->hasFocus());
}
+void tst_QWebFrame::render()
+{
+ QString html("<html>" \
+ "<head><style>" \
+ "body, iframe { margin: 0px; border: none; }" \
+ "</style></head>" \
+ "<body><iframe width='100px' height='100px'/></body>" \
+ "</html>");
+
+ QWebPage page;
+ page.mainFrame()->setHtml(html);
+
+ QList<QWebFrame*> frames = page.mainFrame()->childFrames();
+ QWebFrame *frame = frames.at(0);
+ QString innerHtml("<body style='margin: 0px;'><img src='qrc:/image.png'/></body>");
+ frame->setHtml(innerHtml);
+
+ QPicture picture;
+
+ // render clipping to Viewport
+ frame->setClipRenderToViewport(true);
+ QPainter painter1(&picture);
+ frame->render(&painter1);
+ painter1.end();
+
+ QSize size = page.mainFrame()->contentsSize();
+ page.setViewportSize(size);
+ QCOMPARE(size.width(), picture.boundingRect().width()); // 100px
+ QCOMPARE(size.height(), picture.boundingRect().height()); // 100px
+
+ // render without clipping to Viewport
+ frame->setClipRenderToViewport(false);
+ QPainter painter2(&picture);
+ frame->render(&painter2);
+ painter2.end();
+
+ QImage resource(":/image.png");
+ QCOMPARE(resource.width(), picture.boundingRect().width()); // resource width: 128px
+ QCOMPARE(resource.height(), picture.boundingRect().height()); // resource height: 128px
+}
+
+void tst_QWebFrame::scrollPosition()
+{
+ // enlarged image in a small viewport, to provoke the scrollbars to appear
+ QString html("<html><body><img src='qrc:/image.png' height=500 width=500/></body></html>");
+
+ QWebPage page;
+ page.setViewportSize(QSize(200, 200));
+
+ QWebFrame* frame = page.mainFrame();
+ frame->setHtml(html);
+ frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
+ frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+
+ // try to set the scroll offset programmatically
+ frame->setScrollPosition(QPoint(23, 29));
+ QCOMPARE(frame->scrollPosition().x(), 23);
+ QCOMPARE(frame->scrollPosition().y(), 29);
+
+ int x = frame->evaluateJavaScript("window.scrollX").toInt();
+ int y = frame->evaluateJavaScript("window.scrollY").toInt();
+ QCOMPARE(x, 23);
+ QCOMPARE(y, 29);
+}
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 6c3b296..966f049 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -109,6 +109,7 @@ private slots:
void backActionUpdate();
void frameAt();
void requestCache();
+ void protectBindingsRuntimeObjectsFromCollector();
private:
@@ -1164,5 +1165,30 @@ void tst_QWebPage::frameAt()
frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos());
}
+// import a little DRT helper function to trigger the garbage collector
+void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
+
+void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector()
+{
+ QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool)));
+
+ PluginPage* newPage = new PluginPage(m_view);
+ m_view->setPage(newPage);
+
+ m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+
+ m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='lineedit' id='mylineedit'/></body></html>"));
+ QTRY_COMPARE(loadSpy.count(), 1);
+
+ newPage->mainFrame()->evaluateJavaScript("function testme(text) { var lineedit = document.getElementById('mylineedit'); lineedit.setText(text); lineedit.selectAll(); }");
+
+ newPage->mainFrame()->evaluateJavaScript("testme('foo')");
+
+ qt_drt_garbageCollector_collect();
+
+ // don't crash!
+ newPage->mainFrame()->evaluateJavaScript("testme('bar')");
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
index 076046f..7000d32 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
@@ -1,3 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = qwebframe qwebpage qwebelement qwebhistoryinterface qwebview qwebhistory
+SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro