Revision: 201037 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 17 Sep 2010 09:07:27 +0300
branchRCL_3
changeset 1 9d347b658349
parent 0 4f2f89ce4247
Revision: 201037
VERSION.SHA1
WebCore/ChangeLog
WebCore/bridge/qt/qt_instance.cpp
WebCore/manual-tests/inspector/errors-with-space in-url.html
WebKit/qt/ChangeLog
WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
WebKitTools/DumpRenderTree/fonts/WebKit Layout Tests 2.ttf
WebKitTools/DumpRenderTree/fonts/WebKit Layout Tests.ttf
WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests 2.ttf
WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests.ttf
confml/qtwebkit.confml
content/apps/qtwebkit.sisx
content/group/bld.inf
implml/qtwebkit_copy.implml
layers.sysdef.xml
package_definition.xml
package_map.xml
qtwebkit_stub.pkg
--- a/VERSION.SHA1	Fri Sep 17 09:02:29 2010 +0300
+++ b/VERSION.SHA1	Fri Sep 17 09:07:27 2010 +0300
@@ -1,1 +1,1 @@
-ba092bbb0d60ec19fa5368e19bae9823c14de6e7
+ddefd46cd15fc0cbe286b8a4b843a459d0bf3a19
--- a/WebCore/ChangeLog	Fri Sep 17 09:02:29 2010 +0300
+++ b/WebCore/ChangeLog	Fri Sep 17 09:07:27 2010 +0300
@@ -8435,6 +8435,24 @@
         (WebCore::TransformAnimationQt::updateState):
         (WebCore::OpacityAnimationQt::updateState):
 
+2010-07-08  Sam Magnuson  <smagnuson@netflix.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] instance objects created for QObjects are somtimes GC'd
+        https://bugs.webkit.org/show_bug.cgi?id=40352
+
+        In markAggregate loop over all the current fields and for any that
+        still have a dynamic property or a child, mark them as
+        well. Otherwise the proxy instance will go away and the JS that
+        was bound to it will be lost.
+
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtInstance::getQtInstance):
+        (JSC::Bindings::QtInstance::removeCachedMethod):
+        (JSC::Bindings::QtInstance::markAggregate):
+        (JSC::Bindings::QtInstance::getPropertyNames):
+
 2010-07-08  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Pavel Feldman.
--- a/WebCore/bridge/qt/qt_instance.cpp	Fri Sep 17 09:02:29 2010 +0300
+++ b/WebCore/bridge/qt/qt_instance.cpp	Fri Sep 17 09:07:27 2010 +0300
@@ -192,6 +192,34 @@
         if (val)
             markStack.append(val);
     }
+    foreach (QtField* field, m_fields.values()) {
+        bool mark = false;
+        if (field->fieldType() == QtField::MetaProperty)
+            mark = true;
+        else if (field->fieldType() == QtField::DynamicProperty) {
+            if (m_object && m_object->dynamicPropertyNames().indexOf(field->name()) >= 0)
+                mark = true;
+        } else if (m_object) {
+            QList<QObject*> children = m_object->children();
+            for (int index = 0; index < children.count(); ++index) {
+                QObject* child = children.at(index);
+                if (child->objectName().toLatin1() == field->name()) {
+                    mark = true;
+                    break;
+                }
+            }
+        }
+        if (mark) {
+            if (RefPtr<RootObject> ro = rootObject()) {
+                JSGlobalObject* globalobj = ro->globalObject();
+                if (globalobj) {
+                    ExecState* exec = globalobj->globalExec();
+                    JSValue val = field->valueFromInstance(exec, this);
+                    markStack.append(val);
+                }
+            }
+        }
+    }
 }
 
 void QtInstance::begin()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WebCore/manual-tests/inspector/errors-with-space in-url.html	Fri Sep 17 09:07:27 2010 +0300
@@ -0,0 +1,7 @@
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=19065">Bug 19065:
+Resources with a space in their URL don't get error/warning bubbles</a>.</p>
+<p>To test, open the Inspector and refresh this page. There should be a red
+bubble with the number "1" in it next to the main resource in the Resources
+panel. Clicking the button below should change the "1" to a "2".</p>
+<p></p></p>
+<button onclick="console.error('hi')">click me</button>
--- a/WebKit/qt/ChangeLog	Fri Sep 17 09:02:29 2010 +0300
+++ b/WebKit/qt/ChangeLog	Fri Sep 17 09:07:27 2010 +0300
@@ -408,6 +408,18 @@
         (QWebFrame::setUrl):
         (QWebFrame::load):
 
+2010-07-08  Sam Magnuson  <smagnuson@netflix.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] instance objects created for QObjects are somtimes GC'd
+        https://bugs.webkit.org/show_bug.cgi?id=40352
+
+        Improved the test to check for jsObjects that that are garbage collected.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (tst_QWebFrame::):
+
 2010-07-08  Aaron Boodman  <aa@chromium.org>
 
         Unreviewed change to fix qt build after c62876.
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	Fri Sep 17 09:02:29 2010 +0300
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	Fri Sep 17 09:07:27 2010 +0300
@@ -37,6 +37,7 @@
 #include <qsslerror.h>
 #endif
 #include "../util.h"
+#include "../WebCoreSupport/DumpRenderTreeSupportQt.h"
 
 struct CustomType {
     QString string;
@@ -570,9 +571,11 @@
     void cleanup();
 
 private slots:
+    void getSetDynamicProperty();
+    void getSetDynamicProperty_data();
+    void getSetChildren();
+    void getSetChildren_data();
     void getSetStaticProperty();
-    void getSetDynamicProperty();
-    void getSetChildren();
     void callQtInvokable();
     void connectAndDisconnect();
     void classEnums();
@@ -668,6 +671,10 @@
         evalJS("delete retvalue; delete typevalue");
         return ret;
     }
+    void garbageCollectJS()
+    {
+        DumpRenderTreeSupportQt::garbageCollectorCollect();
+    }
     QObject* firstChildByClassName(QObject* parent, const char* className) {
         const QObjectList & children = parent->children();
         foreach (QObject* child, children) {
@@ -944,6 +951,8 @@
 
 void tst_QWebFrame::getSetDynamicProperty()
 {
+    QFETCH(bool, garbageCollect);
+
     // initially the object does not have the property
     // In WebKit, RuntimeObjects do not inherit Object, so don't have hasOwnProperty
 
@@ -955,11 +964,34 @@
     //QCOMPARE(evalJS("myObject.hasOwnProperty('dynamicProperty')"), sTrue);
     QCOMPARE(evalJS("typeof myObject.dynamicProperty != 'undefined'"), sTrue);
     QCOMPARE(evalJS("myObject.dynamicProperty == 123"), sTrue);
+    if( garbageCollect ) {
+        garbageCollectJS();
+        QCOMPARE(evalJS("typeof myObject.dynamicProperty != 'undefined'"), sTrue);
+    }
 
     // property change in script should be reflected in C++
     QCOMPARE(evalJS("myObject.dynamicProperty = 'foo';"
                     "myObject.dynamicProperty"), QLatin1String("foo"));
     QCOMPARE(m_myObject->property("dynamicProperty").toString(), QLatin1String("foo"));
+    if( garbageCollect ) {
+        garbageCollectJS();
+        QCOMPARE(m_myObject->property("dynamicProperty").toString(), QLatin1String("foo"));
+    }
+
+    // add a dynamic property in C++ to another QObject
+    QObject* propertyObject = new QObject(m_myObject);
+    QCOMPARE(m_myObject->setProperty("dynamicObjectProperty", qVariantFromValue(propertyObject)), false);
+    QCOMPARE(evalJS("typeof myObject.dynamicObjectProperty != 'undefined'"), sTrue);
+    evalJS("myObject.dynamicObjectProperty.jsProperty = 123");
+    QCOMPARE(evalJS("myObject.dynamicObjectProperty.jsProperty == 123"), sTrue);
+    if( garbageCollect ) {
+        garbageCollectJS();
+        QCOMPARE(evalJS("typeof myObject.dynamicObjectProperty != 'undefined'"), sTrue);
+        QCOMPARE(evalJS("myObject.dynamicObjectProperty.jsProperty == 123"), sTrue);
+    }
+    QCOMPARE(m_myObject->setProperty("dynamicObjectProperty", QVariant()), false);
+    delete propertyObject;
+    QCOMPARE(evalJS("typeof myObject.dynamicObjectProperty == 'undefined'"), sTrue);
 
     // delete the property (XFAIL - can't delete properties)
     QEXPECT_FAIL("", "can't delete properties", Continue);
@@ -970,10 +1002,21 @@
     //    QCOMPARE(evalJS("myObject.hasOwnProperty('dynamicProperty')"), sFalse);
     QCOMPARE(evalJS("typeof myObject.dynamicProperty"), sUndefined);
     */
+
+    evalJS("myObject.dynamicProperty = undefined");
+}
+
+void tst_QWebFrame::getSetDynamicProperty_data()
+{
+    QTest::addColumn<bool>("garbageCollect");
+    QTest::newRow("with garbageCollect") << true;
+    QTest::newRow("without garbageCollect") << false;
 }
 
 void tst_QWebFrame::getSetChildren()
 {
+    QFETCH(bool, garbageCollect);
+
     // initially the object does not have the child
     // (again, no hasOwnProperty)
 
@@ -985,12 +1028,27 @@
     child->setObjectName("child");
 //  QCOMPARE(evalJS("myObject.hasOwnProperty('child')"), sTrue);
     QCOMPARE(evalJS("typeof myObject.child != 'undefined'"), sTrue);
+    evalJS("myObject.child.jsProperty = 123");
+    QCOMPARE(evalJS("myObject.child.jsProperty == 123"), sTrue);
+
+    if( garbageCollect ) {
+        garbageCollectJS();
+        QCOMPARE(evalJS("typeof myObject.child != 'undefined'"), sTrue);
+        QCOMPARE(evalJS("myObject.child.jsProperty == 123"), sTrue);
+    }
 
     // add a grandchild
     MyQObject* grandChild = new MyQObject(child);
     grandChild->setObjectName("grandChild");
 //  QCOMPARE(evalJS("myObject.child.hasOwnProperty('grandChild')"), sTrue);
     QCOMPARE(evalJS("typeof myObject.child.grandChild != 'undefined'"), sTrue);
+    evalJS("myObject.child.grandChild.jsProperty = 123");
+    evalJS("myObject.child.grandChild.jsProperty = 123");
+    if( garbageCollect ) {
+        garbageCollectJS();
+        QCOMPARE(evalJS("typeof myObject.child.grandChild != 'undefined'"), sTrue);
+        QCOMPARE(evalJS("myObject.child.grandChild.jsProperty == 123"), sTrue);
+    }
 
     // delete grandchild
     delete grandChild;
@@ -1001,6 +1059,18 @@
     delete child;
 //  QCOMPARE(evalJS("myObject.hasOwnProperty('child')"), sFalse);
     QCOMPARE(evalJS("typeof myObject.child == 'undefined'"), sTrue);
+    if( garbageCollect ) {
+        garbageCollectJS();
+        QCOMPARE(evalJS("typeof myObject.child == 'undefined'"), sTrue);
+    }
+}
+
+
+void tst_QWebFrame::getSetChildren_data()
+{
+    QTest::addColumn<bool>("garbageCollect");
+    QTest::newRow("with garbageCollect") << true;
+    QTest::newRow("without garbageCollect") << false;
 }
 
 Q_DECLARE_METATYPE(QVector<int>)
@@ -1667,7 +1737,7 @@
     m_myObject->emitMySignal();
     QCOMPARE(m_myObject->qtFunctionInvoked(), 20);
     evalJS("myObject = null");
-    evalJS("gc()");
+    garbageCollectJS();
     m_myObject->resetQtFunctionInvoked();
     m_myObject->emitMySignal();
     QCOMPARE(m_myObject->qtFunctionInvoked(), 20);
Binary file WebKitTools/DumpRenderTree/fonts/WebKit Layout Tests 2.ttf has changed
Binary file WebKitTools/DumpRenderTree/fonts/WebKit Layout Tests.ttf has changed
Binary file WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests 2.ttf has changed
Binary file WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests.ttf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/confml/qtwebkit.confml	Fri Sep 17 09:07:27 2010 +0300
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2">
+	<confml:feature name="QTWebkit" ref="qtwebkit">
+		<confml:desc>QT Webkit settings</confml:desc>
+		<confml:setting name="QT Webkit enabled" 
+						ref="Enabled"
+						type="boolean">
+			<confml:desc>To enable QT Webkit usage</confml:desc>
+		</confml:setting>
+	</confml:feature>
+	<confml:data>
+		<confml:qtwebkit>
+			<confml:Enabled>true</confml:Enabled>
+		</confml:qtwebkit>
+	</confml:data>
+</confml:configuration>
\ No newline at end of file
Binary file content/apps/qtwebkit.sisx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/content/group/bld.inf	Fri Sep 17 09:07:27 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* ============================================================================
+*  Name        : bld.inf
+*  Part of     : webruntime
+*  Description :
+*  Version     : %version: 2 %
+*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This file is part of Qt Web Runtime.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../../confml/qtwebkit.confml                  CONFML_EXPORT_PATH(qtwebkit.confml,uda_content)
+../../implml/qtwebkit_copy.implml             CRML_EXPORT_PATH(qtwebkit_copy.implml,uda_content)
+../../content/apps/qtwebkit.sisx							CRML_EXPORT_PATH(../content/sis/,uda_content)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/implml/qtwebkit_copy.implml	Fri Sep 17 09:07:27 2010 +0300
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container  xmlns="http://www.symbianfoundation.org/xml/implml/1"
+			condition="${qtwebkit.Enabled}">
+	<tag name="target" value="uda" />
+	<content xmlns="http://www.s60.com/xml/content/2">	  
+	  <output dir="sis" flatten="true">
+	    <input file="sis/qtwebkit.sisx" />
+	  </output>
+	</content>
+</container>
--- a/layers.sysdef.xml	Fri Sep 17 09:02:29 2010 +0300
+++ b/layers.sysdef.xml	Fri Sep 17 09:07:27 2010 +0300
@@ -10,5 +10,10 @@
 			<unit name="qtwebkit" unitID="qtwebkit" bldFile="&layer_real_source_path;" mrp="" proFile="WebKit.pro" />
 		</module>
     </layer>
+    <layer name="mw_layer">
+			<module name="qtwebkit_uda">
+				<unit name="qtwebkit_uda" unitID="qtwebkit_uda" bldFile="&layer_real_source_path;/content/group" mrp="" />
+			</module>
+        </layer>
   </systemModel>
 </SystemDefinition>
--- a/package_definition.xml	Fri Sep 17 09:02:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0" xmlns:qt="http://www.nokia.com/qt">
- <package id="qtwebkit" name="QtWebKit">
-	<!-- need to break up this package into collections and components -->
-    <collection id="qtwebkit_info" name="QtWebKit Info">
-     <component id="qtwebkit_build" name="QtWebKit Build" introduced="^3" filter="s60">
-      <unit bldFile="." qt:proFile="WebKit.pro"/>
-     </component>
-    </collection>
-   </package>
-</SystemDefinition>
-
--- a/package_map.xml	Fri Sep 17 09:02:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-<PackageMap root="sf" layer="mw"/>
--- a/qtwebkit_stub.pkg	Fri Sep 17 09:02:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-; Language
-&EN
-
-
-; SIS header: name, uid, version
-#{"QtWebKit"},(0x200267C2),4,7,0
-
-
-; Manual PKG pre-rules from PRO files
-; Default HW/platform dependencies
- 
-; Localised Vendor name
-%{"Nokia"}
- 
-; Unique Vendor name
-:"Nokia"
- 
-; Dependencies of Qt libraries
-
-"" - "z:\sys\bin\qmlwebkitplugin.dll"
-;"" - "z:\resource\qt\imports\QtWebKit\qmlwebkitplugin.qtplugin"
-;"" - "z:\resource\qt\imports\QtWebKit\qmldir"
-"" - "z:\sys\bin\QtWebKit.dll"
-"" - "z:\private\10202D56\import\packages\200267C2\backup_registration.xml"