diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:31:00 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:12 +0100 |
commit | dcc8cf2e65d1aa555cce12431a16547e66b469ee (patch) | |
tree | 92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/bindings/objc | |
parent | ccac38a6b48843126402088a309597e682f40fe6 (diff) | |
download | external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2 |
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/bindings/objc')
-rw-r--r-- | WebCore/bindings/objc/DOM.mm | 1 | ||||
-rw-r--r-- | WebCore/bindings/objc/WebScriptObject.mm | 30 |
2 files changed, 17 insertions, 14 deletions
diff --git a/WebCore/bindings/objc/DOM.mm b/WebCore/bindings/objc/DOM.mm index 907961f..378efe2 100644 --- a/WebCore/bindings/objc/DOM.mm +++ b/WebCore/bindings/objc/DOM.mm @@ -37,6 +37,7 @@ #import "Frame.h" #import "HTMLElement.h" #import "HTMLNames.h" +#import "Image.h" #import "NodeFilter.h" #import "RenderImage.h" #import "WebScriptObjectPrivate.h" diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm index d7bc90c..618459a 100644 --- a/WebCore/bindings/objc/WebScriptObject.mm +++ b/WebCore/bindings/objc/WebScriptObject.mm @@ -33,6 +33,9 @@ #import "Frame.h" #import "JSDOMWindow.h" #import "JSDOMWindowCustom.h" +#import "JSHTMLElement.h" +#import "JSPluginElementFunctions.h" +#import "ObjCRuntimeObject.h" #import "PlatformString.h" #import "StringSourceProvider.h" #import "WebCoreObjCExtras.h" @@ -286,7 +289,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root ExecState* exec = [self _rootObject]->globalObject()->globalExec(); ASSERT(!exec->hadException()); - JSValue function = [self _imp]->get(exec, Identifier(exec, String(name))); + JSValue function = [self _imp]->get(exec, Identifier(exec, stringToUString(String(name)))); CallData callData; CallType callType = function.getCallData(callData); if (callType == CallTypeNone) @@ -363,7 +366,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root JSLock lock(SilenceAssertionsOnly); PutPropertySlot slot; - [self _imp]->put(exec, Identifier(exec, String(key)), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]), slot); + [self _imp]->put(exec, Identifier(exec, stringToUString(String(key))), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]), slot); if (exec->hadException()) { addExceptionToConsole(exec); @@ -388,7 +391,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root // leaving the lock permanently held JSLock lock(SilenceAssertionsOnly); - JSValue result = [self _imp]->get(exec, Identifier(exec, String(key))); + JSValue result = [self _imp]->get(exec, Identifier(exec, stringToUString(String(key)))); if (exec->hadException()) { addExceptionToConsole(exec); @@ -417,7 +420,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root ASSERT(!exec->hadException()); JSLock lock(SilenceAssertionsOnly); - [self _imp]->deleteProperty(exec, Identifier(exec, String(key))); + [self _imp]->deleteProperty(exec, Identifier(exec, stringToUString(String(key)))); if (exec->hadException()) { addExceptionToConsole(exec); @@ -508,18 +511,17 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root { if (value.isObject()) { JSObject* object = asObject(value); - ExecState* exec = rootObject->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); - - if (object->classInfo() != &RuntimeObjectImp::s_info) { - JSValue runtimeObject = object->get(exec, Identifier(exec, "__apple_runtime_object")); - if (runtimeObject && runtimeObject.isObject()) - object = asObject(runtimeObject); - } - if (object->classInfo() == &RuntimeObjectImp::s_info) { - RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(object); - ObjcInstance *instance = static_cast<ObjcInstance*>(imp->getInternalInstance()); + if (object->inherits(&JSHTMLElement::s_info)) { + // Plugin elements cache the instance internally. + HTMLElement* el = static_cast<JSHTMLElement*>(object)->impl(); + ObjcInstance* instance = static_cast<ObjcInstance*>(pluginInstance(el)); + if (instance) + return instance->getObject(); + } else if (object->inherits(&ObjCRuntimeObject::s_info)) { + ObjCRuntimeObject* runtimeObject = static_cast<ObjCRuntimeObject*>(object); + ObjcInstance* instance = runtimeObject->getInternalObjCInstance(); if (instance) return instance->getObject(); return nil; |