+2005-02-03 Richard Williamson <rjw@apple.com>
+
+ Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
+
+ Revert to old (and correct) behavior of returning runtime object
+ when passed as a parameter, rather than it's corresponding DOM
+ object.
+
+ Reviewed by Chris.
+
+ * bindings/objc/WebScriptObject.mm:
+ (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
+
=== Safari-183 ===
=== Safari-182 ===
// First see if we have a ObjC instance.
if (value.type() == KJS::ObjectType){
ObjectImp *objectImp = static_cast<ObjectImp*>(value.imp());
+
+ if (objectImp->classInfo() != &KJS::RuntimeObjectImp::info) {
+ Value runtimeObject = objectImp->get(root->interpreter()->globalExec(), "__apple_runtime_object");
+ if (!runtimeObject.isNull() && runtimeObject.type() == KJS::ObjectType)
+ objectImp = static_cast<RuntimeObjectImp*>(runtimeObject.imp());
+ }
+
if (objectImp->classInfo() == &KJS::RuntimeObjectImp::info) {
- RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(value.imp());
+ RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(objectImp);
ObjcInstance *instance = static_cast<ObjcInstance*>(imp->getInternalInstance());
if (instance)
result = instance->getObject();