summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/internationalization/linguist-manual.qdoc2
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog13
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp2
-rw-r--r--src/script/api/qscriptengine.cpp8
-rw-r--r--src/script/api/qscriptvalue.cpp13
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp2
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp12
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp127
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp1
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp12
11 files changed, 174 insertions, 20 deletions
diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc
index 678eb09..424dec2 100644
--- a/doc/src/internationalization/linguist-manual.qdoc
+++ b/doc/src/internationalization/linguist-manual.qdoc
@@ -724,7 +724,7 @@
causes an application to perform an action. There are two kinds of
keyboard accelerators: Alt key and Ctrl key accelerators.
- \section3 Alt Key Accellerators
+ \section3 Alt Key Accelerators
Alt key accelerators are used in menu selection and on buttons.
The underlined character in a menu item or button label signifies
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 45608c5..7c9ea04 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- e3dc4ef2b801d91e115c54f833fa7766d392ceda
+ 14feb62c96ffe2c37e3e2fdac4e370fdbc76ef62
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index a2bd5c3..b7e46c7 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-04-09 David Leong <david.leong@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Symbian apps crash on exit due to a bad qObject_cast.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37303
+
+ Added check for NULL to avoid the crash.
+
+ * plugins/symbian/PluginViewSymbian.cpp:
+ (WebCore::PluginView::platformDestroy):
+
2009-11-15 Dave Tapuska <dtapuska@rim.com>
Reviewed by George Staikos.
diff --git a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
index 86f5f6c..0cce1fd 100644
--- a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
@@ -453,7 +453,7 @@ bool PluginView::platformStart()
void PluginView::platformDestroy()
{
QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
- if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(client->pluginParent()))
+ if (client && qobject_cast<QGraphicsWebView*>(client->pluginParent()))
delete static_cast<PluginContainerSymbian*>(platformPluginWidget())->proxy();
else
delete platformPluginWidget();
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index d6d1367..2422108 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1007,11 +1007,15 @@ void QScriptEnginePrivate::setGlobalObject(JSC::JSObject *object)
if (object == globalObject())
return;
QScript::GlobalObject *glob = static_cast<QScript::GlobalObject*>(originalGlobalObject());
- if (object == originalGlobalObjectProxy)
+ if (object == originalGlobalObjectProxy) {
glob->customGlobalObject = 0;
- else {
+ // Sync the internal prototype, since JSObject::prototype() is not virtual.
+ glob->setPrototype(originalGlobalObjectProxy->prototype());
+ } else {
Q_ASSERT(object != originalGlobalObject());
glob->customGlobalObject = object;
+ // Sync the internal prototype, since JSObject::prototype() is not virtual.
+ glob->setPrototype(object->prototype());
}
}
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 8cf01e7..79d5dcb 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -792,19 +792,28 @@ void QScriptValue::setPrototype(const QScriptValue &prototype)
"a different engine");
return;
}
+ JSC::JSObject *thisObject = JSC::asObject(d->jscValue);
JSC::JSValue other = d->engine->scriptValueToJSCValue(prototype);
// check for cycle
JSC::JSValue nextPrototypeValue = other;
while (nextPrototypeValue && nextPrototypeValue.isObject()) {
JSC::JSObject *nextPrototype = JSC::asObject(nextPrototypeValue);
- if (nextPrototype == JSC::asObject(d->jscValue)) {
+ if (nextPrototype == thisObject) {
qWarning("QScriptValue::setPrototype() failed: cyclic prototype value");
return;
}
nextPrototypeValue = nextPrototype->prototype();
}
- JSC::asObject(d->jscValue)->setPrototype(other);
+
+ thisObject->setPrototype(other);
+
+ // Sync the internal Global Object prototype if appropriate.
+ if (((thisObject == d->engine->originalGlobalObjectProxy)
+ && !d->engine->customGlobalObject())
+ || (thisObject == d->engine->customGlobalObject())) {
+ d->engine->originalGlobalObject()->setPrototype(other);
+ }
}
/*!
diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index f27f469..35ebbd9 100644
--- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -385,7 +385,7 @@ void tst_QHttpNetworkConnection::post_data()
QTest::addColumn<int>("contentLength");
QTest::addColumn<int>("downloadSize");
- QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/cgi-bin/echo.cgi" << ushort(80) << false << "7 bytes" << 200 << "OK" << 7 << 7;
+ QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/qtest/cgi-bin/echo.cgi" << ushort(80) << false << "7 bytes" << 200 << "OK" << 7 << 7;
QTest::newRow("failure-internal") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << "Hello World" << 404 << "Not Found" << -1 << 997 + QtNetworkSettings::serverName().size();
}
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 71ee2d0..8813a80 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -1376,10 +1376,10 @@ void tst_QNetworkReply::deleteFromHttp_data()
// for status codes to expect, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
QTest::newRow("405-method-not-allowed") << QUrl("http://" + QtNetworkSettings::serverName() + "/index.html") << 405 << QNetworkReply::ContentOperationNotPermittedError;
- QTest::newRow("200-ok") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?200-ok") << 200 << QNetworkReply::NoError;
- QTest::newRow("202-accepted") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?202-accepted") << 202 << QNetworkReply::NoError;
- QTest::newRow("204-no-content") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?204-no-content") << 204 << QNetworkReply::NoError;
- QTest::newRow("404-not-found") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?404-not-found") << 404 << QNetworkReply::ContentNotFoundError;
+ QTest::newRow("200-ok") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?200-ok") << 200 << QNetworkReply::NoError;
+ QTest::newRow("202-accepted") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?202-accepted") << 202 << QNetworkReply::NoError;
+ QTest::newRow("204-no-content") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?204-no-content") << 204 << QNetworkReply::NoError;
+ QTest::newRow("404-not-found") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?404-not-found") << 404 << QNetworkReply::ContentNotFoundError;
}
void tst_QNetworkReply::deleteFromHttp()
@@ -3786,10 +3786,10 @@ void tst_QNetworkReply::authorizationError_data()
QTest::addColumn<QString>("httpBody");
QTest::newRow("unknown-authorization-method") << "http://" + QtNetworkSettings::serverName() +
- "/cgi-bin/http-unknown-authentication-method.cgi?401-authorization-required" << 1 << 1
+ "/qtest/cgi-bin/http-unknown-authentication-method.cgi?401-authorization-required" << 1 << 1
<< int(QNetworkReply::AuthenticationRequiredError) << 401 << "authorization required";
QTest::newRow("unknown-proxy-authorization-method") << "http://" + QtNetworkSettings::serverName() +
- "/cgi-bin/http-unknown-authentication-method.cgi?407-proxy-authorization-required" << 1 << 1
+ "/qtest/cgi-bin/http-unknown-authentication-method.cgi?407-proxy-authorization-required" << 1 << 1
<< int(QNetworkReply::ProxyAuthenticationRequiredError) << 407
<< "authorization required";
}
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index cbc36a7..f556fa1 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -104,6 +104,8 @@ private slots:
void getSetGlobalObject();
void globalObjectProperties();
void globalObjectGetterSetterProperty();
+ void customGlobalObjectWithPrototype();
+ void globalObjectWithCustomPrototype();
void builtinFunctionNames_data();
void builtinFunctionNames();
void checkSyntax_data();
@@ -1174,6 +1176,131 @@ void tst_QScriptEngine::globalObjectGetterSetterProperty()
QVERIFY(global.property("baz").equals(789));
}
+void tst_QScriptEngine::customGlobalObjectWithPrototype()
+{
+ for (int x = 0; x < 2; ++x) {
+ QScriptEngine engine;
+ QScriptValue wrap = engine.newObject();
+ QScriptValue global = engine.globalObject();
+ QScriptValue originalGlobalProto = global.prototype();
+ if (!x) {
+ // Set prototype before setting global object
+ wrap.setPrototype(global);
+ QVERIFY(wrap.prototype().strictlyEquals(global));
+ engine.setGlobalObject(wrap);
+ } else {
+ // Set prototype after setting global object
+ engine.setGlobalObject(wrap);
+ wrap.setPrototype(global);
+ QVERIFY(wrap.prototype().strictlyEquals(global));
+ }
+ {
+ QScriptValue ret = engine.evaluate("print");
+ QVERIFY(ret.isFunction());
+ QVERIFY(ret.strictlyEquals(wrap.property("print")));
+ }
+ {
+ QScriptValue ret = engine.evaluate("this.print");
+ QVERIFY(ret.isFunction());
+ QVERIFY(ret.strictlyEquals(wrap.property("print")));
+ }
+ {
+ QScriptValue ret = engine.evaluate("hasOwnProperty('print')");
+ QVERIFY(ret.isBool());
+ QVERIFY(!ret.toBool());
+ }
+ {
+ QScriptValue ret = engine.evaluate("this.hasOwnProperty('print')");
+ QVERIFY(ret.isBool());
+ QVERIFY(!ret.toBool());
+ }
+
+ QScriptValue anotherProto = engine.newObject();
+ anotherProto.setProperty("anotherProtoProperty", 123);
+ global.setPrototype(anotherProto);
+ {
+ QScriptValue ret = engine.evaluate("print");
+ QVERIFY(ret.isFunction());
+ QVERIFY(ret.strictlyEquals(wrap.property("print")));
+ }
+ {
+ QScriptValue ret = engine.evaluate("anotherProtoProperty");
+ QVERIFY(ret.isNumber());
+ QVERIFY(ret.strictlyEquals(wrap.property("anotherProtoProperty")));
+ }
+ {
+ QScriptValue ret = engine.evaluate("this.anotherProtoProperty");
+ QVERIFY(ret.isNumber());
+ QVERIFY(ret.strictlyEquals(wrap.property("anotherProtoProperty")));
+ }
+
+ wrap.setPrototype(anotherProto);
+ {
+ QScriptValue ret = engine.evaluate("print");
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("ReferenceError: Can't find variable: print"));
+ }
+ {
+ QScriptValue ret = engine.evaluate("anotherProtoProperty");
+ QVERIFY(ret.isNumber());
+ QVERIFY(ret.strictlyEquals(wrap.property("anotherProtoProperty")));
+ }
+ QVERIFY(global.prototype().strictlyEquals(anotherProto));
+
+ global.setPrototype(originalGlobalProto);
+ engine.setGlobalObject(global);
+ {
+ QScriptValue ret = engine.evaluate("anotherProtoProperty");
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("ReferenceError: Can't find variable: anotherProtoProperty"));
+ }
+ {
+ QScriptValue ret = engine.evaluate("print");
+ QVERIFY(ret.isFunction());
+ QVERIFY(ret.strictlyEquals(global.property("print")));
+ }
+ QVERIFY(!anotherProto.property("print").isValid());
+ }
+}
+
+void tst_QScriptEngine::globalObjectWithCustomPrototype()
+{
+ QScriptEngine engine;
+ QScriptValue proto = engine.newObject();
+ proto.setProperty("protoProperty", 123);
+ QScriptValue global = engine.globalObject();
+ QScriptValue originalProto = global.prototype();
+ global.setPrototype(proto);
+ {
+ QScriptValue ret = engine.evaluate("protoProperty");
+ QVERIFY(ret.isNumber());
+ QVERIFY(ret.strictlyEquals(global.property("protoProperty")));
+ }
+ {
+ QScriptValue ret = engine.evaluate("this.protoProperty");
+ QVERIFY(ret.isNumber());
+ QVERIFY(ret.strictlyEquals(global.property("protoProperty")));
+ }
+ {
+ QScriptValue ret = engine.evaluate("hasOwnProperty('protoProperty')");
+ QVERIFY(ret.isBool());
+ QVERIFY(!ret.toBool());
+ }
+ {
+ QScriptValue ret = engine.evaluate("this.hasOwnProperty('protoProperty')");
+ QVERIFY(ret.isBool());
+ QVERIFY(!ret.toBool());
+ }
+
+ // Custom prototype set from JS
+ {
+ QScriptValue ret = engine.evaluate("this.__proto__ = { 'a': 123 }; a");
+ QVERIFY(ret.isNumber());
+ QEXPECT_FAIL("", "QTBUG-9737", Continue);
+ QVERIFY(ret.strictlyEquals(global.property("a")));
+ }
+}
+
void tst_QScriptEngine::builtinFunctionNames_data()
{
QTest::addColumn<QString>("expression");
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index ad2b50d..c141caf 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -1520,6 +1520,7 @@ void tst_QSslSocket::verifyMode()
loop.exec();
QVERIFY(clientSocket.isEncrypted());
+ qDebug() << server.socket->sslErrors();
QVERIFY(server.socket->sslErrors().isEmpty());
}
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index a6c0d35..be0d708 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -2040,7 +2040,7 @@ void tst_QXmlQuery::fnDocNetworkAccessSuccess_data() const
return;
QTest::newRow("http scheme")
- << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qxmlquery/wellFormed.xml"))
+ << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/wellFormed.xml"))
<< QByteArray("<!-- a comment --><e from=\"http\">Some Text</e>");
QTest::newRow("ftp scheme")
@@ -2103,10 +2103,10 @@ void tst_QXmlQuery::fnDocNetworkAccessFailure_data() const
return;
QTest::newRow("http scheme, not well-formed")
- << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qxmlquery/notWellformed.xml"));
+ << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/notWellformed.xml"));
QTest::newRow("https scheme, not well-formed")
- << QUrl(QString("https://" + QtNetworkSettings::serverName() + "/qxmlquery/notWellformedViaHttps.xml"));
+ << QUrl(QString("https://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/notWellformedViaHttps.xml"));
QTest::newRow("https scheme, nonexistent host")
<< QUrl(QLatin1String("https://this.host.does.not.exist.I.SWear"));
@@ -2564,7 +2564,7 @@ void tst_QXmlQuery::setQueryQUrlSuccess_data() const
<< QByteArray("This was received via FTP");
QTest::newRow("A valid query via the http scheme")
- << QUrl::fromEncoded(QString("http://" + QtNetworkSettings::serverName() + "/qxmlquery/viaHttp.xq").toLatin1())
+ << QUrl::fromEncoded(QString("http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/viaHttp.xq").toLatin1())
<< QByteArray("This was received via HTTP.");
}
@@ -2630,11 +2630,11 @@ void tst_QXmlQuery::setQueryQUrlFailure_data() const
QTest::newRow("A query via http:// that is completely empty, but readable.")
<< QUrl::fromEncoded(QString(
- "http://" + QtNetworkSettings::serverName() + "/qxmlquery/completelyEmptyQuery.xq").toLatin1());
+ "http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/completelyEmptyQuery.xq").toLatin1());
QTest::newRow("A query via ftp:// that is completely empty, but readable.")
<< QUrl::fromEncoded(QString(
- "ftp://" + QtNetworkSettings::serverName() + "qxmlquery/completelyEmptyQuery.xq").toLatin1());
+ "ftp://" + QtNetworkSettings::serverName() + "/pub/qxmlquery/completelyEmptyQuery.xq").toLatin1());
}