JSPluginElementFunctions.h [plain text]
#ifndef JSPluginElementFunctions_h
#define JSPluginElementFunctions_h
#include "JSDOMBinding.h"
namespace JSC {
namespace Bindings {
class Instance;
}
}
namespace WebCore {
class HTMLElement;
class JSHTMLElement;
class Node;
JSC::Bindings::Instance* pluginInstance(Node*);
JSC::JSObject* pluginScriptObject(JSC::ExecState* exec, JSHTMLElement* jsHTMLElement);
JSC::JSValue runtimeObjectPropertyGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
bool runtimeObjectCustomGetOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&, JSHTMLElement*);
bool runtimeObjectCustomGetOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&, JSHTMLElement*);
bool runtimeObjectCustomPut(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSHTMLElement*, JSC::PutPropertySlot&);
JSC::CallType runtimeObjectGetCallData(JSHTMLElement*, JSC::CallData&);
template <class Type, class Base> bool pluginElementCustomGetOwnPropertySlot(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertySlot& slot, Type* element)
{
if (!element->globalObject()->world()->isNormal()) {
if (JSC::getStaticValueSlot<Type, Base>(exec, element->s_info.staticPropHashTable, element, propertyName, slot))
return true;
JSC::JSValue proto = element->prototype();
if (proto.isObject() && JSC::jsCast<JSC::JSObject*>(asObject(proto))->hasProperty(exec, propertyName))
return false;
}
return runtimeObjectCustomGetOwnPropertySlot(exec, propertyName, slot, element);
}
template <class Type, class Base> bool pluginElementCustomGetOwnPropertyDescriptor(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor, Type* element)
{
if (!element->globalObject()->world()->isNormal()) {
if (JSC::getStaticValueDescriptor<Type, Base>(exec, element->s_info.staticPropHashTable, element, propertyName, descriptor))
return true;
JSC::JSValue proto = element->prototype();
if (proto.isObject() && JSC::jsCast<JSC::JSObject*>(asObject(proto))->hasProperty(exec, propertyName))
return false;
}
return runtimeObjectCustomGetOwnPropertyDescriptor(exec, propertyName, descriptor, element);
}
}
#endif // JSPluginElementFunctions_h