Log Message
Unreviewed, rolling out r126146. http://trac.webkit.org/changeset/126146 https://bugs.webkit.org/show_bug.cgi?id=94606
It made all tests assert (Requested by Ossy on #webkit). Patch by Sheriff Bot <[email protected]> on 2012-08-21 Source/WebCore: * bridge/qt/qt_runtime.cpp: (JSC::Bindings::prototypeForSignalsAndSlots): (JSC::Bindings::QtRuntimeMethod::call): (JSC::Bindings::QtRuntimeMethod::jsObjectRef): (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect): * bridge/qt/qt_runtime.h: (QtRuntimeMethod): Source/WebKit/qt: * tests/qobjectbridge/tst_qobjectbridge.cpp: (tst_QObjectBridge::objectDeleted): (tst_QObjectBridge::introspectQtMethods_data): (tst_QObjectBridge::introspectQtMethods): LayoutTests: * platform/qt/Skipped:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (126160 => 126161)
--- trunk/LayoutTests/ChangeLog 2012-08-21 16:17:01 UTC (rev 126160)
+++ trunk/LayoutTests/ChangeLog 2012-08-21 16:21:26 UTC (rev 126161)
@@ -1,3 +1,13 @@
+2012-08-21 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r126146.
+ http://trac.webkit.org/changeset/126146
+ https://bugs.webkit.org/show_bug.cgi?id=94606
+
+ It made all tests assert (Requested by Ossy on #webkit).
+
+ * platform/qt/Skipped:
+
2012-08-21 Brady Eidson <[email protected]>
MathML tests need rebaselining on Mac.
Modified: trunk/LayoutTests/platform/qt/Skipped (126160 => 126161)
--- trunk/LayoutTests/platform/qt/Skipped 2012-08-21 16:17:01 UTC (rev 126160)
+++ trunk/LayoutTests/platform/qt/Skipped 2012-08-21 16:21:26 UTC (rev 126161)
@@ -2725,6 +2725,9 @@
# https://bugs.webkit.org/show_bug.cgi?id=93812
svg/custom/use-instanceRoot-as-event-target.xhtml
+# https://bugs.webkit.org/show_bug.cgi?id=93897
+fast/profiler/nested-start-and-stop-profiler.html
+
# New test introduced in r125648 fast/events/autoscroll-in-textarea.html fails
# https://bugs.webkit.org/show_bug.cgi?id=94076
fast/events/autoscroll-in-textarea.html
Modified: trunk/Source/WebCore/ChangeLog (126160 => 126161)
--- trunk/Source/WebCore/ChangeLog 2012-08-21 16:17:01 UTC (rev 126160)
+++ trunk/Source/WebCore/ChangeLog 2012-08-21 16:21:26 UTC (rev 126161)
@@ -1,5 +1,21 @@
2012-08-21 Sheriff Bot <[email protected]>
+ Unreviewed, rolling out r126146.
+ http://trac.webkit.org/changeset/126146
+ https://bugs.webkit.org/show_bug.cgi?id=94606
+
+ It made all tests assert (Requested by Ossy on #webkit).
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::prototypeForSignalsAndSlots):
+ (JSC::Bindings::QtRuntimeMethod::call):
+ (JSC::Bindings::QtRuntimeMethod::jsObjectRef):
+ (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect):
+ * bridge/qt/qt_runtime.h:
+ (QtRuntimeMethod):
+
+2012-08-21 Sheriff Bot <[email protected]>
+
Unreviewed, rolling out r126150.
http://trac.webkit.org/changeset/126150
https://bugs.webkit.org/show_bug.cgi?id=94605
Modified: trunk/Source/WebCore/bridge/qt/qt_runtime.cpp (126160 => 126161)
--- trunk/Source/WebCore/bridge/qt/qt_runtime.cpp 2012-08-21 16:17:01 UTC (rev 126160)
+++ trunk/Source/WebCore/bridge/qt/qt_runtime.cpp 2012-08-21 16:21:26 UTC (rev 126161)
@@ -1282,8 +1282,8 @@
static JSClassRef prototypeForSignalsAndSlots()
{
static JSClassDefinition classDef = {
- 0, kJSClassAttributeNoAutomaticPrototype, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, QtRuntimeMethod::call, 0, 0, 0
};
static JSClassRef cls = JSClassCreate(&classDef);
return cls;
@@ -1307,7 +1307,7 @@
JSValueRef QtRuntimeMethod::call(JSContextRef context, JSObjectRef function, JSObjectRef /*thisObject*/, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- QtRuntimeMethod* d = toRuntimeMethod(context, function);
+ QtRuntimeMethod* d = reinterpret_cast<QtRuntimeMethod*>(JSObjectGetPrivate(function));
if (!d) {
setException(context, exception, QStringLiteral("cannot call function of deleted runtime method"));
return JSValueMakeUndefined(context);
@@ -1353,53 +1353,50 @@
if (JSObjectRef cachedWrapper = m_instance->m_cachedMethods.get(this))
return cachedWrapper;
+ static const JSClassDefinition classDefForConnect = {
+ 0, 0, "connect", 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, connect, 0, 0, 0
+ };
+
+ static const JSClassDefinition classDefForDisconnect = {
+ 0, 0, "disconnect", 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, disconnect, 0, 0, 0
+ };
+
+ static JSClassRef classRefConnect = JSClassCreate(&classDefForConnect);
+ static JSClassRef classRefDisconnect = JSClassCreate(&classDefForDisconnect);
+ bool isSignal = m_flags & MethodIsSignal;
+ JSObjectRef object = JSObjectMake(context, prototypeForSignalsAndSlots(), this);
+ JSObjectRef connectFunction = JSObjectMake(context, classRefConnect, this);
+ JSObjectRef disconnectFunction = JSObjectMake(context, classRefDisconnect, this);
+ JSPropertyAttributes attributes = kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete;
+
static JSStringRef connectStr = JSStringCreateWithUTF8CString("connect");
static JSStringRef disconnectStr = JSStringCreateWithUTF8CString("disconnect");
+ static JSStringRef lengthStr = JSStringCreateWithUTF8CString("length");
+ static JSStringRef nameStr = JSStringCreateWithUTF8CString("name");
JSRetainPtr<JSStringRef> actualNameStr(Adopt, JSStringCreateWithUTF8CString(m_identifier.constData()));
- JSObjectRef object = JSObjectMakeFunctionWithCallback(context, actualNameStr.get(), call);
+ JSObjectSetProperty(context, connectFunction, lengthStr, JSValueMakeNumber(context, isSignal ? 1 : 0), attributes, exception);
+ JSObjectSetProperty(context, connectFunction, nameStr, JSValueMakeString(context, connectStr), attributes, exception);
+ JSObjectSetProperty(context, disconnectFunction, lengthStr, JSValueMakeNumber(context, isSignal ? 1 : 0), attributes, exception);
+ JSObjectSetProperty(context, disconnectFunction, nameStr, JSValueMakeString(context, disconnectStr), attributes, exception);
- JSObjectRef generalFunctionProto = JSValueToObject(context, JSObjectGetPrototype(context, object), 0);
- JSObjectRef runtimeMethodProto = JSObjectMake(context, prototypeForSignalsAndSlots(), this);
- JSObjectSetPrototype(context, runtimeMethodProto, generalFunctionProto);
-
- JSObjectSetPrototype(context, object, runtimeMethodProto);
-
- JSObjectRef connectFunction = JSObjectMakeFunctionWithCallback(context, connectStr, connect);
- JSObjectSetPrototype(context, connectFunction, runtimeMethodProto);
-
- JSObjectRef disconnectFunction = JSObjectMakeFunctionWithCallback(context, disconnectStr, disconnect);
- JSObjectSetPrototype(context, disconnectFunction, runtimeMethodProto);
-
- const JSPropertyAttributes attributes = kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete;
JSObjectSetProperty(context, object, connectStr, connectFunction, attributes, exception);
JSObjectSetProperty(context, object, disconnectStr, disconnectFunction, attributes, exception);
+ JSObjectSetProperty(context, object, lengthStr, JSValueMakeNumber(context, 0), attributes, exception);
+ JSObjectSetProperty(context, object, nameStr, JSValueMakeString(context, actualNameStr.get()), attributes, exception);
m_instance->m_cachedMethods.set(context, this, object);
return object;
}
-QtRuntimeMethod* QtRuntimeMethod::toRuntimeMethod(JSContextRef context, JSObjectRef object)
-{
- JSObjectRef proto = JSValueToObject(context, JSObjectGetPrototype(context, object), 0);
- if (!proto)
- return 0;
- if (!JSValueIsObjectOfClass(context, proto, prototypeForSignalsAndSlots()))
- return 0;
- return static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(proto));
-}
-
JSValueRef QtRuntimeMethod::connectOrDisconnect(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception, bool connect)
{
- QtRuntimeMethod* d = toRuntimeMethod(context, thisObject);
+ QtRuntimeMethod* d = static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(thisObject));
if (!d)
- d = toRuntimeMethod(context, function);
- if (!d) {
- QString errorStr = QStringLiteral("QtMetaMethod.%1: Cannot connect to/from deleted QObject").arg(connect ? QStringLiteral("connect") : QStringLiteral("disconnect"));
- setException(context, exception, errorStr);
- return JSValueMakeUndefined(context);
- }
+ d = static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(function));
QString functionName = connect ? QStringLiteral("connect") : QStringLiteral("disconnect");
@@ -1435,9 +1432,11 @@
// object.signal.connect(someFunction);
if (JSObjectIsFunction(context, targetFunction)) {
- // object.signal.connect(otherObject.slot);
- if (QtRuntimeMethod* targetMethod = toRuntimeMethod(context, targetFunction))
- targetObject = toRef(QtInstance::getQtInstance(targetMethod->m_object.data(), d->m_instance->rootObject(), QtInstance::QtOwnership)->createRuntimeObject(toJS(context)));
+ if (JSValueIsObjectOfClass(context, targetFunction, prototypeForSignalsAndSlots())) {
+ // object.signal.connect(otherObject.slot);
+ if (QtRuntimeMethod* targetMethod = static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(targetFunction)))
+ targetObject = toRef(QtInstance::getQtInstance(targetMethod->m_object.data(), d->m_instance->rootObject(), QtInstance::QtOwnership)->createRuntimeObject(toJS(context)));
+ }
} else
targetFunction = 0;
} else {
Modified: trunk/Source/WebCore/bridge/qt/qt_runtime.h (126160 => 126161)
--- trunk/Source/WebCore/bridge/qt/qt_runtime.h 2012-08-21 16:17:01 UTC (rev 126160)
+++ trunk/Source/WebCore/bridge/qt/qt_runtime.h 2012-08-21 16:21:26 UTC (rev 126161)
@@ -114,7 +114,8 @@
const QByteArray& name() { return m_identifier; }
private:
- static QtRuntimeMethod* toRuntimeMethod(JSContextRef, JSObjectRef);
+ static const JSStaticFunction connectFunction;
+ static const JSStaticFunction disconnectFunction;
static JSValueRef connectOrDisconnect(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception, bool connect);
QPointer<QObject> m_object;
Modified: trunk/Source/WebKit/qt/ChangeLog (126160 => 126161)
--- trunk/Source/WebKit/qt/ChangeLog 2012-08-21 16:17:01 UTC (rev 126160)
+++ trunk/Source/WebKit/qt/ChangeLog 2012-08-21 16:21:26 UTC (rev 126161)
@@ -1,3 +1,16 @@
+2012-08-21 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r126146.
+ http://trac.webkit.org/changeset/126146
+ https://bugs.webkit.org/show_bug.cgi?id=94606
+
+ It made all tests assert (Requested by Ossy on #webkit).
+
+ * tests/qobjectbridge/tst_qobjectbridge.cpp:
+ (tst_QObjectBridge::objectDeleted):
+ (tst_QObjectBridge::introspectQtMethods_data):
+ (tst_QObjectBridge::introspectQtMethods):
+
2012-08-17 Simon Hausmann <[email protected]>
[Qt] REGRESSION(r125428): fast/profiler/nested-start-and-stop-profiler.html fails
Modified: trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp (126160 => 126161)
--- trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp 2012-08-21 16:17:01 UTC (rev 126160)
+++ trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp 2012-08-21 16:21:26 UTC (rev 126161)
@@ -1879,7 +1879,7 @@
evalJS("bar.intProperty = 123;");
QCOMPARE(qobj->intProperty(), 123);
qobj->resetQtFunctionInvoked();
- evalJS("bar.myInvokable.call(bar);");
+ evalJS("bar.myInvokable(bar);");
QCOMPARE(qobj->qtFunctionInvoked(), 0);
// do this, to ensure that we cache that it implements call
@@ -2148,15 +2148,15 @@
QTest::addColumn<QStringList>("expectedPropertyNames");
QTest::newRow("myObject.mySignal")
- << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "name");
+ << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "length" << "name");
QTest::newRow("myObject.mySlot")
- << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "name");
+ << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "length" << "name");
QTest::newRow("myObject.myInvokable")
- << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "name");
+ << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "length" << "name");
QTest::newRow("myObject.mySignal.connect")
- << "myObject.mySignal" << "connect" << (QStringList() << "name");
+ << "myObject.mySignal" << "connect" << (QStringList() << "length" << "name");
QTest::newRow("myObject.mySignal.disconnect")
- << "myObject.mySignal" << "disconnect" << (QStringList() << "name");
+ << "myObject.mySignal" << "disconnect" << (QStringList() << "length" << "name");
}
void tst_QObjectBridge::introspectQtMethods()
@@ -2177,7 +2177,7 @@
QCOMPARE(evalJS("descriptor.set"), sUndefined);
QCOMPARE(evalJS(QString::fromLatin1("descriptor.value === %0['%1']").arg(methodLookup).arg(name)), sTrue);
QCOMPARE(evalJS(QString::fromLatin1("descriptor.enumerable")), sFalse);
- QCOMPARE(evalJS(QString::fromLatin1("descriptor.configurable")), sFalse);
+ QCOMPARE(evalJS(QString::fromLatin1("descriptor.configurable")), sTrue);
}
QVERIFY(evalJSV("var props=[]; for (var p in myObject.deleteLater) {props.push(p);}; props.sort()").toStringList().isEmpty());
_______________________________________________ webkit-changes mailing list [email protected] http://lists.webkit.org/mailman/listinfo/webkit-changes
