summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-13 23:31:47 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-13 23:31:47 (GMT)
commitee60791655c3303e50cef4fc0ebd1ad644467fc8 (patch)
tree77a0354415deba1acb450e54b240860ed9660326 /src/3rdparty/webkit
parent1c20abaaeef1ab448526e5821db06350537c1333 (diff)
parent5a90ecfd34f8959e73cc711337529ce8bada7aa2 (diff)
downloadQt-ee60791655c3303e50cef4fc0ebd1ad644467fc8.zip
Qt-ee60791655c3303e50cef4fc0ebd1ad644467fc8.tar.gz
Qt-ee60791655c3303e50cef4fc0ebd1ad644467fc8.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-webkit into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-webkit: Updated WebKit to f943ead2759537527faa7f3cb057d995291663b9
Diffstat (limited to 'src/3rdparty/webkit')
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog106
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pri16
-rw-r--r--src/3rdparty/webkit/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.cpp11
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.h3
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/platform/text/qt/TextBreakIteratorQt.cpp64
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp20
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog50
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc100
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp204
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp17
16 files changed, 450 insertions, 154 deletions
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 09a4fe2..125e175 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-f943ead2759537527faa7f3cb057d995291663b9
+0f8941d0dd5f947530e1dc55b859d810bba14764
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index a19b85a..6aaae4f 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- 6db5de6d18c3ab8b74809303e4d79abacfc570a8
+ f943ead2759537527faa7f3cb057d995291663b9
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 1d9d739..e04729d 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,109 @@
+2010-06-13 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] GraphicsLayer: recaching images creates an unnecessary deep copy
+ https://bugs.webkit.org/show_bug.cgi?id=40535
+
+ Made sure the painter ends its operation before copying the pixmap.
+
+ No new tests: this is an optimization.
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::recache):
+
+2010-03-24 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Changing the V8 and JSC implementations of
+ SQLStatementErrorCallback to interpret as false all results that
+ could be converted to a false boolean. Pretty much a revert of
+ r54981.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36569
+
+ * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
+ (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
+ * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
+ (WebCore::V8CustomSQLStatementErrorCallback::handleEvent):
+ * bindings/v8/custom/V8CustomVoidCallback.cpp:
+ (WebCore::invokeCallback):
+ * bindings/v8/custom/V8CustomVoidCallback.h:
+
+2010-06-13 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] tests/hybridPixmap fails
+ https://bugs.webkit.org/show_bug.cgi?id=37316
+
+ The problem was that JSC::Instance::createRuntimeObject was never called.
+ This is fixed by overloading newRuntimeObject and calling Instance::createRuntimeObject
+ in between, instead of creating the runtime object directly inside the static function
+ QtPixmapInstance::createRuntimeObject, which had to be renamed as to not overshadow the virtual function.
+
+ This fixes an existing test, tests/hybridPixmap
+
+ * bridge/qt/qt_pixmapruntime.cpp:
+ (JSC::Bindings::QtPixmapInstance::newRuntimeObject):
+ (JSC::Bindings::QtPixmapInstance::createPixmapRuntimeObject):
+ * bridge/qt/qt_pixmapruntime.h:
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertQVariantToValue):
+
+2010-06-07 Mahesh Kulakrni <mahesh.kulkarni@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [QT] QT_BEARER flag is not enabled on S60 properly
+ https://bugs.webkit.org/show_bug.cgi?id=39357
+
+ enable QT_BEARER for all platform based on qtmobility +
+ bearer module availability or for qt 4.7+
+
+ * WebCore.pri:
+
+2010-06-09 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Dirk Schulze.
+
+ [Qt] Imperfect dependency for generated SVGNames.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=40359
+
+ * WebCore.pri: Missing dependency added.
+
+2010-06-08 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Unreviewed Buildbot fix.
+
+ Reset the Qt TextBreakIterator when reusing it.
+
+ * platform/text/qt/TextBreakIteratorQt.cpp:
+ (WebCore::setUpIterator):
+
+2010-06-08 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Antti Koivisto.
+
+ [Qt] TextBreakIterator Qt performance
+ https://bugs.webkit.org/show_bug.cgi?id=39958
+
+ Rework TextBreakIteratorQt to be more in line with the ICU version.
+
+ We now reuse iterators where ever possible. The string data is compared
+ with memcmp, which should be faster than using a hash, as you need
+ to traverse the full buffer in the case the strings don't match,
+ where as the compare would fail quickly.
+
+ * platform/text/qt/TextBreakIteratorQt.cpp:
+ (WebCore::TextBreakIterator::TextBreakIterator):
+ (WebCore::setUpIterator):
+ (WebCore::wordBreakIterator):
+ (WebCore::characterBreakIterator):
+ (WebCore::lineBreakIterator):
+ (WebCore::sentenceBreakIterator):
+
2010-06-07 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pri b/src/3rdparty/webkit/WebCore/WebCore.pri
index 5f5987f..9debd6a 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pri
+++ b/src/3rdparty/webkit/WebCore/WebCore.pri
@@ -101,18 +101,19 @@ greaterThan(QT_MINOR_VERSION, 5) {
DEFINES += ENABLE_XSLT=0
}
-!CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_QT_BEARER=.) {
- symbian: {
- exists($${EPOCROOT}epoc32/release/winscw/udeb/QtBearer.lib)| \
- exists($${EPOCROOT}epoc32/release/armv5/lib/QtBearer.lib) {
+# Bearer management is part of Qt 4.7
+# for older version, check for mobility with bearer
+!contains(DEFINES, ENABLE_QT_BEARER=.) {
+ !lessThan(QT_MINOR_VERSION, 7) {
+ DEFINES += ENABLE_QT_BEARER=1
+ } else {
+ load(mobilityconfig)
+ contains(MOBILITY_CONFIG, bearer) {
DEFINES += ENABLE_QT_BEARER=1
}
}
}
-# Bearer management is part of Qt 4.7
-!lessThan(QT_MINOR_VERSION, 7):!contains(DEFINES, ENABLE_QT_BEARER=.):DEFINES += ENABLE_QT_BEARER=1
-
# Enable touch event support with Qt 4.6
!lessThan(QT_MINOR_VERSION, 6): DEFINES += ENABLE_TOUCH_EVENTS=1
@@ -593,6 +594,7 @@ contains(DEFINES, ENABLE_SVG=1) {
# GENERATOR 5-C:
svgnames.output = $${WC_GENERATED_SOURCES_DIR}/SVGNames.cpp
svgnames.input = SVG_NAMES
+ svgnames.depends = $$PWD/svg/svgattrs.in
svgnames.wkScript = $$PWD/dom/make_names.pl
svgnames.commands = perl -I$$PWD/bindings/scripts $$svgnames.wkScript --tags $$PWD/svg/svgtags.in --attrs $$PWD/svg/svgattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
svgnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/SVGElementFactory.cpp $${WC_GENERATED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp b/src/3rdparty/webkit/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
index 4d5de79..6178509 100644
--- a/src/3rdparty/webkit/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
+++ b/src/3rdparty/webkit/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
@@ -77,7 +77,7 @@ bool JSCustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction,
// Therefore an exception and returning true are the same thing - so, return true on an exception
return true;
}
- return !result.isFalse();
+ return result.toBoolean(exec);
}
}
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.cpp
index 803316d..3e6197f 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.cpp
@@ -346,10 +346,17 @@ returnEmptyVariant:
return QVariant::fromValue<QImage>(QImage());
return QVariant();
}
-JSObject* QtPixmapInstance::createRuntimeObject(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& data)
+
+RuntimeObject* QtPixmapInstance::newRuntimeObject(ExecState* exec)
+{
+ return new(exec) QtPixmapRuntimeObject(exec, this);
+}
+
+JSObject* QtPixmapInstance::createPixmapRuntimeObject(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& data)
{
JSLock lock(SilenceAssertionsOnly);
- return new(exec) QtPixmapRuntimeObject(exec, new QtPixmapInstance(root, data));
+ QtPixmapInstance* instance = new QtPixmapInstance(root, data);
+ return instance->createRuntimeObject(exec);
}
bool QtPixmapInstance::canHandle(QMetaType::Type hint)
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.h b/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.h
index a0e0e26..de1bcee 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.h
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_pixmapruntime.h
@@ -42,7 +42,8 @@ public:
int height() const;
QPixmap toPixmap();
QImage toImage();
- static JSObject* createRuntimeObject(ExecState*, PassRefPtr<RootObject>, const QVariant&);
+ RuntimeObject* newRuntimeObject(ExecState* exec);
+ static JSObject* createPixmapRuntimeObject(ExecState*, PassRefPtr<RootObject>, const QVariant&);
static QVariant variantFromObject(JSObject*, QMetaType::Type hint);
static bool canHandle(QMetaType::Type hint);
};
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
index 4524d97..a39dc7a 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
@@ -877,7 +877,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
}
if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(variant.type())))
- return QtPixmapInstance::createRuntimeObject(exec, root, variant);
+ return QtPixmapInstance::createPixmapRuntimeObject(exec, root, variant);
if (type == qMetaTypeId<QWebElement>()) {
if (!root->globalObject()->inherits(&JSDOMWindow::s_info))
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index be44fca..ad2ec9c 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -330,6 +330,7 @@ QPixmap GraphicsLayerQtImpl::recache(const QRegion& regionToUpdate)
// Render the actual contents into the cache
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
m_layer->paintGraphicsLayerContents(gc, region.boundingRect());
+ painter.end();
m_backingStoreKey = QPixmapCache::insert(pixmap);
return pixmap;
diff --git a/src/3rdparty/webkit/WebCore/platform/text/qt/TextBreakIteratorQt.cpp b/src/3rdparty/webkit/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
index 5a8a812..dda443f 100644
--- a/src/3rdparty/webkit/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
@@ -33,31 +33,49 @@
namespace WebCore {
+ static unsigned char buffer[1024];
+
class TextBreakIterator : public QTextBoundaryFinder {
+ public:
+ TextBreakIterator(QTextBoundaryFinder::BoundaryType type, const UChar* string, int length)
+ : QTextBoundaryFinder(type, (const QChar*)string, length, buffer, sizeof(buffer))
+ , length(length)
+ , string(string) {}
+ TextBreakIterator()
+ : QTextBoundaryFinder()
+ , length(0)
+ , string(0) {}
+
+ int length;
+ const UChar* string;
};
- static QTextBoundaryFinder* iterator = 0;
- static unsigned char buffer[1024];
- TextBreakIterator* wordBreakIterator(const UChar* string, int length)
+ TextBreakIterator* setUpIterator(TextBreakIterator& iterator, QTextBoundaryFinder::BoundaryType type, const UChar* string, int length)
{
if (!string || !length)
return 0;
- if (!iterator)
- iterator = new QTextBoundaryFinder;
- *iterator = QTextBoundaryFinder(QTextBoundaryFinder::Word, (const QChar *)string, length, buffer, sizeof(buffer));
- return static_cast<TextBreakIterator*>(iterator);
+ if (iterator.isValid() && type == iterator.type() && length == iterator.length
+ && memcmp(string, iterator.string, length) == 0) {
+ iterator.toStart();
+ return &iterator;
+ }
+
+ iterator = TextBreakIterator(type, string, length);
+
+ return &iterator;
}
- TextBreakIterator* characterBreakIterator(const UChar* string, int length)
+ TextBreakIterator* wordBreakIterator(const UChar* string, int length)
{
- if (!string || !length)
- return 0;
- if (!iterator)
- iterator = new QTextBoundaryFinder;
+ static TextBreakIterator staticWordBreakIterator;
+ return setUpIterator(staticWordBreakIterator, QTextBoundaryFinder::Word, string, length);
+ }
- *iterator = QTextBoundaryFinder(QTextBoundaryFinder::Grapheme, (const QChar *)string, length, buffer, sizeof(buffer));
- return static_cast<TextBreakIterator*>(iterator);
+ TextBreakIterator* characterBreakIterator(const UChar* string, int length)
+ {
+ static TextBreakIterator staticCharacterBreakIterator;
+ return setUpIterator(staticCharacterBreakIterator, QTextBoundaryFinder::Grapheme, string, length);
}
TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
@@ -67,25 +85,15 @@ namespace WebCore {
TextBreakIterator* lineBreakIterator(const UChar* string, int length)
{
- static QTextBoundaryFinder *iterator = 0;
- if (!string || !length)
- return 0;
- if (!iterator)
- iterator = new QTextBoundaryFinder;
-
- *iterator = QTextBoundaryFinder(QTextBoundaryFinder::Line, (const QChar *)string, length, buffer, sizeof(buffer));
- return static_cast<TextBreakIterator*>(iterator);
+ static TextBreakIterator staticLineBreakIterator;
+ return setUpIterator(staticLineBreakIterator, QTextBoundaryFinder::Line, string, length);
}
TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
{
- if (!string || !length)
- return 0;
- if (!iterator)
- iterator = new QTextBoundaryFinder;
+ static TextBreakIterator staticSentenceBreakIterator;
+ return setUpIterator(staticSentenceBreakIterator, QTextBoundaryFinder::Sentence, string, length);
- *iterator = QTextBoundaryFinder(QTextBoundaryFinder::Sentence, (const QChar *)string, length, buffer, sizeof(buffer));
- return static_cast<TextBreakIterator*>(iterator);
}
int textBreakFirst(TextBreakIterator* bi)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 2788085..8c7b93d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1175,7 +1175,7 @@ void QWebPagePrivate::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData));
ev->setDropAction(action);
if (action != Qt::IgnoreAction)
- ev->accept();
+ ev->acceptProposedAction();
#endif
}
@@ -1188,7 +1188,7 @@ void QWebPagePrivate::dragEnterEvent(QDragEnterEvent* ev)
ev->setDropAction(action);
// We must accept this event in order to receive the drag move events that are sent
// while the drag and drop action is in progress.
- ev->accept();
+ ev->acceptProposedAction();
#endif
}
@@ -1218,7 +1218,7 @@ void QWebPagePrivate::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData));
ev->setDropAction(action);
if (action != Qt::IgnoreAction)
- ev->accept();
+ ev->acceptProposedAction();
#endif
}
@@ -1232,7 +1232,7 @@ void QWebPagePrivate::dragMoveEvent(QDragMoveEvent* ev)
ev->setDropAction(action);
// We must accept this event in order to receive the drag move events that are sent
// while the drag and drop action is in progress.
- ev->accept();
+ ev->acceptProposedAction();
#endif
}
@@ -1242,7 +1242,7 @@ void QWebPagePrivate::dropEvent(QGraphicsSceneDragDropEvent* ev)
DragData dragData(ev->mimeData(), ev->pos().toPoint(),
QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
if (page->dragController()->performDrag(&dragData))
- ev->accept();
+ ev->acceptProposedAction();
#endif
}
@@ -1254,7 +1254,7 @@ void QWebPagePrivate::dropEvent(QDropEvent* ev)
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
dropActionToDragOp(Qt::DropAction(ev->dropAction())));
if (page->dragController()->performDrag(&dragData))
- ev->accept();
+ ev->acceptProposedAction();
#endif
}
@@ -3267,6 +3267,14 @@ bool QWebPage::findText(const QString &subString, FindFlags options)
} else
return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0);
} else {
+ if (subString.isEmpty()) {
+ d->page->mainFrame()->selection()->clear();
+ Frame* frame = d->page->mainFrame()->tree()->firstChild();
+ while (frame) {
+ frame->selection()->clear();
+ frame = frame->tree()->traverseNextWithWrap(false);
+ }
+ }
::FindDirection direction = ::FindDirectionForward;
if (options & FindBackward)
direction = ::FindDirectionBackward;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
index f715430..b9180be 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -63,7 +63,7 @@
/*!
\class QWebPluginFactory::Plugin
\since 4.4
- \brief the QWebPluginFactory::Plugin structure describes the properties of a plugin a QWebPluginFactory can create.
+ \brief The QWebPluginFactory::Plugin structure describes the properties of a plugin a QWebPluginFactory can create.
\inmodule QtWebKit
*/
@@ -147,7 +147,7 @@ QWebPluginFactory::~QWebPluginFactory()
supported plugins the factory can create.
\note Currently, this function is only called when JavaScript programs
- access the global \c plugins or \c mimetypes objects.
+ access the global \c plugins or \c mimetypes objects.
*/
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 3deb9ac..671acec 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,53 @@
+2010-06-09 Pierre Rossi <pierre.rossi@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ QWebPage::findText() does not clear selection when passed empty string
+ https://bugs.webkit.org/show_bug.cgi?id=31779
+
+ * Api/qwebpage.cpp:
+ (QWebPage::findText):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::findText):
+
+2010-06-12 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add documentation to the QtWebkit bridge
+ https://bugs.webkit.org/show_bug.cgi?id=35861
+
+ The previous accepted patch was actually a faulty one; It was hard to trace since it's just a documentation
+ change. The new patch amends that, with the correct snippets and grammar fixes.
+
+ * docs/qtwebkit-bridge.qdoc:
+ * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp:
+ (wrapInFunction):
+
+2010-06-11 Jesus Sanchez-Palencia <jesus@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Typo error in QWebPluginFactory Documentation
+ https://bugs.webkit.org/show_bug.cgi?id=40490
+
+ * Api/qwebpluginfactory.cpp:
+
+2010-06-10 Andy Shaw <andy.shaw@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ REGRESSION: [Qt] When dragging onto a page that handles the drag in Javascript it will be a move and not a copy by default
+ https://bugs.webkit.org/show_bug.cgi?id=40401
+
+ The correct pattern in Qt for Dnd events is to use acceptProposedAction() instead
+ of accept().
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragMoveEvent):
+ (QWebPagePrivate::dropEvent):
+
2010-06-02 Tasuku Suzuki <tasuku.suzuki@nokia.com>
Reviewed by Shinichiro Hamaji.
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
index 4f41d29..fa93293 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
@@ -7,25 +7,26 @@
\section2 The technology
The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native
- objects that are represented as QObjects. It takes advantage of the inherent introspection of the
- \l{Qt Object Model}, which has a natural alignment to the way JavaScript worked.
+ objects that are represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection,
+ a part of the \l{Qt Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
+ for example \l{QObject} properties map directly to JavaScript properties.
For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter
pair under one name.
\section2 Use Cases
- There are two main use cases for the QtWebKit bridge. Web content in a native application, and Thin Client.
+ There are two main use cases for the QtWebKit bridge. Web content in a native application, and Thin Clients.
\section3 Web Content in a Native Application
This is a common use case in classic Qt application, and a design pattern used by several modern
- applications. For example, an application that contains both a media-player, playlist manager, and
- a music store. The playlist manager is usually best authored as a classic desktop application,
+ applications. For example, an application that contains a media-player, playlist manager, and music store.
+ The playlist manager is usually best authored as a classic desktop application,
with the native-looking robust \l{QWidget}s helping with producing that application.
The media-player control, which usually looks custom, can be written using \l{The Graphics View framework}
or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content
- from the internet, and gets modified rapidly, is best authored in HTML and maintained on the server.
+ from the internet and gets modified rapidly, is best authored in HTML and maintained on the server.
With the QtWebKit bridge, that music store component can interact with native parts of the application,
for example, if a file needs to be saved to a specific location.
@@ -38,7 +39,7 @@
access to native features not usually exposed to the web, or to enable helper components that
are best written with C++.
- An example for such client is a UI for a video-on-demand service on a TV. The entire content and
+ An example for such a client is a UI for a video-on-demand service on a TV. The entire content and
UI can be kept on the server, served dynamically through HTTP and rendered with WebKit, with additional
native components for accessing hardware-specific features like extracting the list of images
out of the video.
@@ -67,7 +68,7 @@
\section2 Creating the link via QWebFrame
By default, no QObjects are accessible through the web environment, for security reasons.
- To enable web content access to a native QObject, the application has to explicitly grant it access,
+ To enable web content access for a native QObject, the application must explicitly grant it access,
using the following call:
\snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 0
@@ -76,13 +77,13 @@
\section2 Using Signals and Slots
- Qt Script adapts Qt's central \l{Signals and Slots} feature for
+ The QtWebKit bridge adapts Qt's central \l{Signals and Slots} feature for
scripting. There are three principal ways to use signals and slots
- with Qt Script:
+ with the QtWebKit bridge:
\list
\i \bold{Hybrid C++/script}: C++ application code connects a
- signal to a script function. The script function can, for example, be
+ signal to a script function. For example, the script function can be
a function that the user has typed in, or one that you have read from a
file. This approach is useful if you have a QObject but don't want
to expose the object itself to the scripting environment; you just
@@ -97,7 +98,7 @@
the connections is fully dynamic (script-defined).
\i \bold{Purely script-defined}: A script can both define signal
- handler functions (effectively "slots written in Qt Script"),
+ handler functions (effectively "slots written in JavaScript"),
\e{and} set up the connections that utilize those handlers. For
example, a script can define a function that will handle the
QLineEdit::returnPressed() signal, and then connect that signal to the
@@ -108,36 +109,36 @@
\section3 Signal to Function Connections
- \c{connect(function)}
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 6
In this form of connection, the argument to \c{connect()} is the
function to connect to the signal.
- \snippet webkitsnippets/doc_src_qtscript.qdoc 2
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 7
- The argument can be a Qt Script function, as in the above
+ The argument can be a JavaScript function, as in the above
example, or it can be a QObject slot, as in
the following example:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 3
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 8
When the argument is a QObject slot, the argument types of the
signal and slot do not necessarily have to be compatible;
- the QtWebKit bridge will, if necessary, perform conversion of the signal
+ If necessary, the QtWebKit bridge will, perform conversion of the signal
arguments to match the argument types of the slot.
To disconnect from a signal, you invoke the signal's
\c{disconnect()} function, passing the function to disconnect
as argument:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 4
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 9
When a script function is invoked in response to a signal, the
\c this object will be the Global Object.
\section3 Signal to Member Function Connections
- \c{connect(thisObject, function)}
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 10
In this form of the \c{connect()} function, the first argument
is the object that will be bound to the variable, \c this, when
@@ -148,31 +149,31 @@
\c{clicked} signal; passing the form as the \c this object
makes sense in such a case.
- \snippet webkitsnippets/doc_src_qtscript.qdoc 5
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 11
To disconnect from the signal, pass the same arguments to \c{disconnect()}:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 6
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 12
\section3 Signal to Named Member Function Connections
- \c{connect(thisObject, functionName)}
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 14
- In this form of the \c{connect()} function, the first argument is
- the object that will be bound to the variable, \c this, when
- a function is invoked in response to the signal. The second argument
- specifies the name of a function that is connected to the signal,
- and this refers to a member function of the object passed as the
- first argument (\c thisObject in the above scheme).
+ This form of the \c{connect()} function requires that the first argument is
+ the object that will be bound to the variable \c{this} when a function is
+ invoked in response to the signal. The second argument specifies the
+ name of a function that is connected to the signal, and this refers to a
+ member function of the object passed as the first argument (thisObject
+ in the above scheme).
Note that the function is resolved when the connection is made, not
when the signal is emitted.
- \snippet webkitsnippets/doc_src_qtscript.qdoc 7
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 15
To disconnect from the signal, pass the same arguments to \c{disconnect()}:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 8
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 17
\section3 Error Handling
@@ -181,14 +182,14 @@
You can obtain an error message from the resulting \c{Error} object.
Example:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 9
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 18
\section3 Emitting Signals from Scripts
To emit a signal from script code, you simply invoke the signal
function, passing the relevant arguments:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 10
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 19
It is currently not possible to define a new signal in a script;
i.e., all signals must be defined by C++ classes.
@@ -201,13 +202,13 @@
\c{myOverloadedSlot(int)} and \c{myOverloadedSlot(QString)}, the following
script code will behave reasonably:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 11
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 20
You can specify a particular overload by using array-style property access
with the \l{QMetaObject::normalizedSignature()}{normalized signature} of
the C++ function as the property name:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 12
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 21
If the overloads have different number of arguments, the QtWebKit bridge will
pick the overload with the argument count that best matches the
@@ -225,7 +226,7 @@
(it would be meaningless to return values from a slot, as the connected signals don't handle the returned data).
To make a non-slot method invokable, simply add the Q_INVOKABLE macro before its definition:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 20
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 22
\section2 Accessing Properties
@@ -235,11 +236,11 @@
property will automatically be invoked. For example, if your
C++ class has a property declared as follows:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 13
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 23
then script code can do things like the following:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 14
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 24
\section2 Accessing Child QObjects
@@ -250,12 +251,12 @@
\c{"okButton"}, you can access this object in script code through
the expression
- \snippet webkitsnippets/doc_src_qtscript.qdoc 15
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 25
Since \c{objectName} is itself a Q_PROPERTY, you can manipulate
the name in script code to, for example, rename an object:
- \snippet webkitsnippets/doc_src_qtscript.qdoc 16
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 26
\section2 Data types
@@ -283,7 +284,7 @@
\section3 Strings
When JavaScript accesses methods or properties that expect a \l{QString}, the QtWebKit bridge
- will automatically convert the value to a string (if it's not already a string), using the
+ will automatically convert the value to a string (if it is not already a string), using the
built-in JavaScript toString method.
When a QString is passed to JavaScript from a signal or a property, The QtWebKit bridge will
@@ -292,7 +293,7 @@
\section3 Date & Time
Both \l{QDate}, \l{QTime} and \l{QDateTime} are automatically translated to or from the JavaScript
- Date object. If a number is passed as an argument to a method that expects one of the date/time
+ Date object. If a number were passed as an argument to a method that expects one of the date/time
types, the QtWebKit bridge would treat it as a timestamp. If a sting is passed, QtWebKit would
try different Qt date parsing functions to find the right one.
@@ -314,7 +315,7 @@
\section3 Compound (JSON) objects
- JavaScript compound objects, also known as JSON objects, are variables which hold a list
+ JavaScript compound objects, also known as JSON objects, are variables that hold a list
of key-value pairs, where all the keys are strings and the values can have any type.
This translates very well to \l{QVariantMap}, which is nothing more than a \l{QMap} of \l{QString}
to \l{QVariant}.
@@ -334,7 +335,7 @@
a normal JSON object would become a \l{QVariantMap}, and a JavaScript array would become a \l{QVariantList}.
Using \l{QVariant}s generously in C++ in that way makes C++ programming feel a bit more like JavaScript programming,
- as it adds another level of indirection - passing \l{QVariant}s around is very flexible, as the program can figure out
+ as it adds another level of indirection. Passing \l{QVariant}s around like this q is very flexible, as the program can figure out
the type of argument in runtime just like JavaScript would do, but it also takes away from the type-safety and robust
nature of C++. It's recommended to use \l{QVariant}s only for convenience high-level functions, and to keep most of your
\l{QObject}s somewhat type-safe.
@@ -348,7 +349,7 @@
a \l{QObject}.
In general its advised to use care when passing \l{QObject}s as arguments, as those objects don't become owned by
- the Javascipt engine; That means that the application developer has to be extra careful not to try to access
+ the JavaScript engine; That means that the application developer has to be extra careful not to try to access
\l{QObject}s that have already been deleted by the native environment.
\section3 Pixmaps and Images
@@ -401,25 +402,26 @@
\section2 Limiting the Scope of the Hybrid Layer
- When using QtWebKit's hybrid features, it's a common pitfall to make the API exposed to JavaScript very rich and
+ When using QtWebKit's hybrid features, it is a common pitfall to make the API exposed to JavaScript very rich and
use all its features. This, however, leads to complexity and can create bugs that are hard to trace.
- Instead, it's advisable to keep the hybrid layer small and manageable: create a gate only when
+ Instead, it is advisable to keep the hybrid layer small and manageable: create a gate only when
there's an actual need for it, i.e. there's a new native enabler that requires a direct interface
to the application layer. Sometimes new functionality is better handled internally in the native layer
or in the web layer; simplicity is your friend.
This usually becomes more apparent when the hybrid layer can create or destroy objects, or uses
- signals slots or properties with a \l{QObject}* argument. It's advised to be very careful and to treat
+ signals slots or properties with a \l{QObject}* argument. It is advised to be very careful and to treat
an exposed \l{QObject} as a system - with careful attention to memory management and object ownership.
\section2 Internet Security
- When exposing native object to an open web environment, it's important to understand the security
+ When exposing native object to an open web environment, it is importwhichant to understand the security
implications. Think whether the exposed object enables the web environment access to things that
shouldn't be open, and whether the web content loaded by that web page comes from a trusted. In general, when
exposing native QObjects that give the web environment access to private information or to functionality
that's potentially harmful to the client, such exposure should be balanced by limiting the web page's
- access to trusted URLs only with HTTPS and other security measures.
+ access to trusted URLs only with HTTPS, and by utilizing other measures as part of a security strategy.
+
*/
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
index d83ab3f..62eeeca 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
@@ -2,82 +2,176 @@
void wrapInFunction()
{
-//! [0]
+ //! [0]
// ...
QWebFrame *frame = myWebPage->mainFrame();
frame->addToJavaScriptWindowObject("someNameForMyObject", myObject);
// ...
-//! [0]
+ //! [0]
#if 0
//! [1]
- {
- width: ...,
- height: ...,
- toDataURL: function() { ... },
- assignToHTMLImageElement: function(element) { ... }
- }
- //! [1]
+ {
+ width: ...,
+ height: ...,
+ toDataURL: function() { ... },
+ assignToHTMLImageElement: function(element) { ... }
+ }
+ //! [1]
#endif
//! [2]
- class MyObject : QObject {
- Q_OBJECT
- Q_PROPERTY(QPixmap myPixmap READ getPixmap)
+ class MyObject : QObject {
+ Q_OBJECT
+ Q_PROPERTY(QPixmap myPixmap READ getPixmap)
- public:
- QPixmap getPixmap() const;
- };
+ public:
+ QPixmap getPixmap() const;
+ };
- /* ... */
+ /* ... */
- MyObject myObject;
- myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject);
+ MyObject myObject;
+ myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject);
//! [2]
- #if 0
- //! [3]
- <html>
- <head>
- <script>
- function loadImage() {
- myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement"));
- }
- </script>
- </head>
- <body onload="loadImage()">
- <img id="imageElement" width="300" height="200" />
- </body>
- </html>
+#if 0
//! [3]
- #endif
- //! [4]
- class MyObject : QObject {
- Q_OBJECT
+ <html>
+ <head>
+ <script>
+ function loadImage() {
+ myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement"));
+ }
+ </script>
+ </head>
+ <body onload="loadImage()">
+ <img id="imageElement" width="300" height="200" />
+ </body>
+ </html>
+ //! [3]
+#endif
+ //! [4]
+ class MyObject : QObject {
+ Q_OBJECT
- public slots:
- void doSomethingWithWebElement(const QWebElement&);
- };
+ public slots:
+ void doSomethingWithWebElement(const QWebElement&);
+ };
- /* ... */
+ /* ... */
- MyObject myObject;
- myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject);
+ MyObject myObject;
+ myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject);
- //! [4]
- #if 0
- //! [5]
- <html>
+ //! [4]
+#if 0
+ //! [5]
+ <html>
<head>
- <script>
- function runExample() {
- myObject.doSomethingWithWebElement(document.getElementById("someElement"));
- }
- </script>
+ <script>
+ function runExample() {
+ myObject.doSomethingWithWebElement(document.getElementById("someElement"));
+ }
+ </script>
</head>
<body onload="runExample()">
- <span id="someElement">Text</span>
+ <span id="someElement">Text</span>
</body>
- </html>
- //! [5]
- #endif
+ </html>
+ //! [5]
+ //! [6]
+ connect(function);
+ //! [6]
+ //! [7]
+ function myInterestingScriptFunction() { ... }
+ ...
+ myQObject.somethingChanged.connect(myInterestingScriptFunction);
+ //! [7]
+ //! [8]
+ myQObject.somethingChanged.connect(myOtherQObject.doSomething);
+ //! [8]
+ //! [9]
+ myQObject.somethingChanged.disconnect(myInterestingFunction);
+ myQObject.somethingChanged.disconnect(myOtherQObject.doSomething);
+ //! [9]
+ //! [10]
+ connect(thisObject, function)
+ //! [10]
+ //! [11]
+ var obj = { x: 123 };
+ var fun = function() { print(this.x); };
+ myQObject.somethingChanged.connect(obj, fun);
+ //! [11]
+ //! [12]
+ myQObject.somethingChanged.disconnect(obj, fun);
+ //! [12]
+ //! [13]
+ connect(function);
+ //! [13]
+ //! [14]
+ connect(thisObject, functionName)
+ //! [14]
+ //! [15]
+ var obj = { x: 123, fun: function() { print(this.x); } };
+ myQObject.somethingChanged.connect(obj, "fun");
+ //! [15]
+ //! [16]
+ connect(function);
+ //! [16]
+ //! [17]
+ myQObject.somethingChanged.disconnect(obj, "fun");
+ //! [17]
+ //! [18]
+ try {
+ myQObject.somethingChanged.connect(myQObject, "slotThatDoesntExist");
+ } catch (e) {
+ print(e);
+ }
+ //! [18]
+ //! [19]
+ myQObject.somethingChanged("hello");
+ //! [19]
+ //! [20]
+ myQObject.myOverloadedSlot(10); // will call the int overload
+ myQObject.myOverloadedSlot("10"); // will call the QString overload
+ //! [20]
+ //! [21]
+ myQObject['myOverloadedSlot(int)']("10"); // call int overload; the argument is converted to an int
+ myQObject['myOverloadedSlot(QString)'](10); // call QString overload; the argument is converted to a string
+ //! [21]
+ //! [22]
+ class MyObject : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ Q_INVOKABLE void thisMethodIsInvokableInQtScript();
+ void thisMethodIsNotInvokableInQtScript();
+
+ ...
+ };
+ //! [22]
+ //! [23]
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
+ //! [23]
+ //! [24]
+ myQObject.enabled = true;
+
+ ...
+
+ myQObject.enabled = !myQObject.enabled;
+ //! [24]
+ //! [25]
+ myQObject.enabled = true;
+
+ ...
+
+ myQObject.enabled = !myQObject.enabled;
+ //! [25]
+ //! [26]
+ myDialog.okButton
+ myDialog.okButton.objectName = "cancelButton";
+ // from now on, myDialog.cancelButton references the button
+ //! [26]
+#endif
}
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 27f4b27..0f2ca22 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -122,6 +122,7 @@ private slots:
void testJSPrompt();
void showModalDialog();
void testStopScheduledPageRefresh();
+ void findText();
private:
QWebView* m_view;
@@ -2121,5 +2122,21 @@ void tst_QWebPage::testStopScheduledPageRefresh()
QCOMPARE(page2.mainFrame()->url().toString(), QString("about:blank"));
}
+void tst_QWebPage::findText()
+{
+ m_view->setHtml(QString("<html><head></head><body><div>foo bar</div></body></html>"));
+ m_page->triggerAction(QWebPage::SelectAll);
+ QVERIFY(!m_page->selectedText().isEmpty());
+ m_page->findText("");
+ QVERIFY(m_page->selectedText().isEmpty());
+ QStringList words = (QStringList() << "foo" << "bar");
+ foreach (QString subString, words) {
+ m_page->findText(subString, QWebPage::FindWrapsAroundDocument);
+ QCOMPARE(m_page->selectedText(), subString);
+ m_page->findText("");
+ QVERIFY(m_page->selectedText().isEmpty());
+ }
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"