[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

ap at apple.com ap at apple.com
Thu Apr 8 01:55:44 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 4daadcc6b79cfdc909c58853e444589ea7f6c9e5
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 22 22:21:33 2010 +0000

            Reviewed by Darin Adler.
    
            https://bugs.webkit.org/show_bug.cgi?id=35260
            Eliminate __apple_runtime_object
    
            No change in functionality, so no tests.
    
            * WebCore.base.exp: Don't export Instance::newRuntimeObject, WebKit doesn't need it.
    
            * bindings/js/JSHTMLAppletElementCustom.cpp:
            * bindings/js/JSHTMLEmbedElementCustom.cpp:
            * bindings/js/JSHTMLObjectElementCustom.cpp:
            * html/HTMLAppletElement.idl:
            * html/HTMLEmbedElement.idl:
            * html/HTMLObjectElement.idl:
            These objects no longer need overriding name getters, as they no longer intercept the
            __apple_runtime_object property.
    
            * bindings/js/JSPluginElementFunctions.cpp:
            (WebCore::pluginInstance): This is no longer static. It was used for callPlugin() in
            this file, and now it's also used elsewhere when calling plug-in methods.
            (WebCore::runtimeObjectGetter): Removed. This function was only used by the intercepting
            name getters.
    
            * bindings/js/JSPluginElementFunctions.h: Export pluginInstance().
    
            * bindings/objc/WebScriptObject.mm:
            (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
            * bridge/runtime_method.cpp:
            (JSC::callRuntimeMethod):
            Take plug-in element's instance directly, without relying on fake attribute lookup.
            One change resulting from this is that RuntimeObjectImp may not be created in some cases -
            this code only needs an instance, but the old code had to pass the instance wrapped into
            RuntimeObjectImp.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55104 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 443df4f..f3e7e0c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,40 @@
+2010-02-22  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35260
+        Eliminate __apple_runtime_object
+
+        No change in functionality, so no tests.
+
+        * WebCore.base.exp: Don't export Instance::newRuntimeObject, WebKit doesn't need it.
+
+        * bindings/js/JSHTMLAppletElementCustom.cpp:
+        * bindings/js/JSHTMLEmbedElementCustom.cpp:
+        * bindings/js/JSHTMLObjectElementCustom.cpp:
+        * html/HTMLAppletElement.idl:
+        * html/HTMLEmbedElement.idl:
+        * html/HTMLObjectElement.idl:
+        These objects no longer need overriding name getters, as they no longer intercept the
+        __apple_runtime_object property.
+
+        * bindings/js/JSPluginElementFunctions.cpp:
+        (WebCore::pluginInstance): This is no longer static. It was used for callPlugin() in
+        this file, and now it's also used elsewhere when calling plug-in methods.
+        (WebCore::runtimeObjectGetter): Removed. This function was only used by the intercepting
+        name getters.
+
+        * bindings/js/JSPluginElementFunctions.h: Export pluginInstance().
+
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
+        * bridge/runtime_method.cpp:
+        (JSC::callRuntimeMethod):
+        Take plug-in element's instance directly, without relying on fake attribute lookup.
+        One change resulting from this is that RuntimeObjectImp may not be created in some cases -
+        this code only needs an instance, but the old code had to pass the instance wrapped into
+        RuntimeObjectImp.
+
 2010-02-22  John Sullivan  <sullivan at apple.com>
         
         Reviewed by Tim Hatcher.
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index a07aee4..77ddf8c 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -134,7 +134,6 @@ __Z4coreP19DOMDocumentFragment
 __Z4coreP22DOMCSSStyleDeclaration
 __Z4coreP7DOMNode
 __Z4coreP8DOMRange
-__ZN3JSC8Bindings8Instance16newRuntimeObjectEPNS_9ExecStateE
 __ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbN3WTF10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
 __ZN7WebCore10ScrollView17setScrollbarModesENS_13ScrollbarModeES1_
 __ZN7WebCore10ScrollView20setCanHaveScrollbarsEb
diff --git a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
index 30892e0..40d20cf 100644
--- a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
@@ -53,14 +53,4 @@ CallType JSHTMLAppletElement::getCallData(CallData& callData)
     return runtimeObjectGetCallData(impl(), callData);
 }
 
-bool JSHTMLAppletElement::canGetItemsForName(ExecState*, HTMLAppletElement*, const Identifier& propertyName)
-{
-    return propertyName == "__apple_runtime_object";
-}
-
-JSValue JSHTMLAppletElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return runtimeObjectGetter(exec, propertyName, slot);
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
index bce3ffb..b9f8c12 100644
--- a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
@@ -53,14 +53,4 @@ CallType JSHTMLEmbedElement::getCallData(CallData& callData)
     return runtimeObjectGetCallData(impl(), callData);
 }
 
-bool JSHTMLEmbedElement::canGetItemsForName(ExecState*, HTMLEmbedElement*, const Identifier& propertyName)
-{
-    return propertyName == "__apple_runtime_object";
-}
-
-JSValue JSHTMLEmbedElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return runtimeObjectGetter(exec, propertyName, slot);
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
index 1bfb51f..68c9e59 100644
--- a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
@@ -53,14 +53,4 @@ CallType JSHTMLObjectElement::getCallData(CallData& callData)
     return runtimeObjectGetCallData(impl(), callData);
 }
 
-bool JSHTMLObjectElement::canGetItemsForName(ExecState*, HTMLObjectElement*, const Identifier& propertyName)
-{
-    return propertyName == "__apple_runtime_object";
-}
-
-JSValue JSHTMLObjectElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return runtimeObjectGetter(exec, propertyName, slot);
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSPluginElementFunctions.cpp b/WebCore/bindings/js/JSPluginElementFunctions.cpp
index e927ef1..4f5f1af 100644
--- a/WebCore/bindings/js/JSPluginElementFunctions.cpp
+++ b/WebCore/bindings/js/JSPluginElementFunctions.cpp
@@ -35,7 +35,7 @@ using namespace HTMLNames;
 
 // Runtime object support code for JSHTMLAppletElement, JSHTMLEmbedElement and JSHTMLObjectElement.
 
-static Instance* pluginInstance(Node* node)
+Instance* pluginInstance(Node* node)
 {
     if (!node)
         return 0;
@@ -57,14 +57,6 @@ static RuntimeObjectImp* getRuntimeObject(ExecState* exec, Node* node)
     return instance->createRuntimeObject(exec);
 }
 
-JSValue runtimeObjectGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
-{
-    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slot.slotBase()));
-    HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
-    RuntimeObjectImp* runtimeObject = getRuntimeObject(exec, element);
-    return runtimeObject ? runtimeObject : jsUndefined();
-}
-
 JSValue runtimeObjectPropertyGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slot.slotBase()));
diff --git a/WebCore/bindings/js/JSPluginElementFunctions.h b/WebCore/bindings/js/JSPluginElementFunctions.h
index a5a323a..d2fcaa3 100644
--- a/WebCore/bindings/js/JSPluginElementFunctions.h
+++ b/WebCore/bindings/js/JSPluginElementFunctions.h
@@ -22,6 +22,12 @@
 
 #include "JSDOMBinding.h"
 
+namespace JSC {
+namespace Bindings {
+class Instance;
+}
+}
+
 namespace WebCore {
 
     class HTMLElement;
@@ -29,8 +35,8 @@ namespace WebCore {
     class Node;
 
     // Runtime object support code for JSHTMLAppletElement, JSHTMLEmbedElement and JSHTMLObjectElement.
+    JSC::Bindings::Instance* pluginInstance(Node*);
 
-    JSC::JSValue runtimeObjectGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
     JSC::JSValue runtimeObjectPropertyGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
     bool runtimeObjectCustomGetOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&, JSHTMLElement*);
     bool runtimeObjectCustomGetOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&, JSHTMLElement*);
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm
index d7bc90c..d4c78d2 100644
--- a/WebCore/bindings/objc/WebScriptObject.mm
+++ b/WebCore/bindings/objc/WebScriptObject.mm
@@ -33,6 +33,8 @@
 #import "Frame.h"
 #import "JSDOMWindow.h"
 #import "JSDOMWindowCustom.h"
+#import "JSHTMLElement.h"
+#import "JSPluginElementFunctions.h"
 #import "PlatformString.h"
 #import "StringSourceProvider.h"
 #import "WebCoreObjCExtras.h"
@@ -508,18 +510,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) {
+        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(&RuntimeObjectImp::s_info)) {
             RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(object);
-            ObjcInstance *instance = static_cast<ObjcInstance*>(imp->getInternalInstance());
+            ObjcInstance* instance = static_cast<ObjcInstance*>(imp->getInternalInstance());
             if (instance)
                 return instance->getObject();
             return nil;
diff --git a/WebCore/bridge/runtime_method.cpp b/WebCore/bridge/runtime_method.cpp
index ffe4c0a..f10a64f 100644
--- a/WebCore/bridge/runtime_method.cpp
+++ b/WebCore/bridge/runtime_method.cpp
@@ -27,6 +27,8 @@
 #include "runtime_method.h"
 
 #include "JSDOMBinding.h"
+#include "JSHTMLElement.h"
+#include "JSPluginElementFunctions.h"
 #include "runtime_object.h"
 #include <runtime/Error.h>
 #include <runtime/FunctionPrototype.h>
@@ -91,25 +93,25 @@ static JSValue JSC_HOST_CALL callRuntimeMethod(ExecState* exec, JSObject* functi
 
     if (method->methods()->isEmpty())
         return jsUndefined();
-    
-    RuntimeObjectImp* imp;
+
+    Instance* instance = 0;
 
     if (thisValue.inherits(&RuntimeObjectImp::s_info)) {
-        imp = static_cast<RuntimeObjectImp*>(asObject(thisValue));
+        RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(asObject(thisValue));
+        instance = imp->getInternalInstance();
+        if (!instance) 
+            return RuntimeObjectImp::throwInvalidAccessError(exec);
     } else {
-        // If thisObj is the DOM object for a plugin, get the corresponding
-        // runtime object from the DOM object.
-        JSValue value = thisValue.get(exec, Identifier(exec, "__apple_runtime_object"));
-        if (value.inherits(&RuntimeObjectImp::s_info))    
-            imp = static_cast<RuntimeObjectImp*>(asObject(value));
-        else
+        // Calling a runtime object of a plugin element?
+        if (thisValue.inherits(&JSHTMLElement::s_info)) {
+            HTMLElement* element = static_cast<JSHTMLElement*>(asObject(thisValue))->impl();
+            instance = pluginInstance(element);
+        }
+        if (!instance)
             return throwError(exec, TypeError);
     }
+    ASSERT(instance);
 
-    RefPtr<Instance> instance = imp->getInternalInstance();
-    if (!instance) 
-        return RuntimeObjectImp::throwInvalidAccessError(exec);
-        
     instance->begin();
     JSValue result = instance->invokeMethod(exec, *method->methods(), args);
     instance->end();
diff --git a/WebCore/html/HTMLAppletElement.idl b/WebCore/html/HTMLAppletElement.idl
index 8d6803e..f5984f0 100644
--- a/WebCore/html/HTMLAppletElement.idl
+++ b/WebCore/html/HTMLAppletElement.idl
@@ -23,8 +23,7 @@ module html {
     interface [
         DelegatingPutFunction,
         DelegatingGetOwnPropertySlot,
-        CustomCall,
-        HasOverridingNameGetter
+        CustomCall
     ] HTMLAppletElement : HTMLElement {
                  attribute [ConvertNullToNullString, Reflect] DOMString align;
                  attribute [ConvertNullToNullString, Reflect] DOMString alt;
diff --git a/WebCore/html/HTMLEmbedElement.idl b/WebCore/html/HTMLEmbedElement.idl
index d491a0d..576bca9 100644
--- a/WebCore/html/HTMLEmbedElement.idl
+++ b/WebCore/html/HTMLEmbedElement.idl
@@ -23,8 +23,7 @@ module html {
     interface [
         DelegatingPutFunction,
         DelegatingGetOwnPropertySlot,
-        CustomCall,
-        HasOverridingNameGetter
+        CustomCall
     ] HTMLEmbedElement : HTMLElement {
                  attribute [ConvertNullToNullString, Reflect] DOMString align;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
diff --git a/WebCore/html/HTMLObjectElement.idl b/WebCore/html/HTMLObjectElement.idl
index 8d975ba..be91dc4 100644
--- a/WebCore/html/HTMLObjectElement.idl
+++ b/WebCore/html/HTMLObjectElement.idl
@@ -23,8 +23,7 @@ module html {
     interface [
         DelegatingPutFunction,
         DelegatingGetOwnPropertySlot,
-        CustomCall,
-        HasOverridingNameGetter
+        CustomCall
     ] HTMLObjectElement : HTMLElement {
         readonly attribute HTMLFormElement form;
                  attribute [ConvertNullToNullString, Reflect] DOMString       code;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list