summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/kjs_html.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/kjs_html.cpp')
-rw-r--r--WebCore/bindings/js/kjs_html.cpp61
1 files changed, 33 insertions, 28 deletions
diff --git a/WebCore/bindings/js/kjs_html.cpp b/WebCore/bindings/js/kjs_html.cpp
index 8f2c7c4..c143c1e 100644
--- a/WebCore/bindings/js/kjs_html.cpp
+++ b/WebCore/bindings/js/kjs_html.cpp
@@ -84,6 +84,7 @@ JSValue* runtimeObjectGetter(ExecState* exec, JSObject* originalObject, const Id
{
JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
+
return getRuntimeObject(exec, element);
}
@@ -91,32 +92,37 @@ JSValue* runtimeObjectPropertyGetter(ExecState* exec, JSObject* originalObject,
{
JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
- JSObject* runtimeObject = getRuntimeObject(exec, element);
- if (!runtimeObject)
- return jsUndefined();
- return runtimeObject->get(exec, propertyName);
+
+ if (JSValue* runtimeObject = getRuntimeObject(exec, element))
+ return static_cast<JSObject*>(runtimeObject)->get(exec, propertyName);
+ return jsUndefined();
}
-bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, JSHTMLElement* originalObj, HTMLElement* thisImp)
+bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, WebCore::JSHTMLElement* originalObj, HTMLElement* thisImp)
{
- JSObject* runtimeObject = getRuntimeObject(exec, thisImp);
- if (!runtimeObject)
- return false;
- if (!runtimeObject->hasProperty(exec, propertyName))
- return false;
- slot.setCustom(originalObj, runtimeObjectPropertyGetter);
- return true;
+ JSValue* runtimeObject = getRuntimeObject(exec, thisImp);
+ if (runtimeObject) {
+ JSObject* imp = static_cast<JSObject*>(runtimeObject);
+ if (imp->hasProperty(exec, propertyName)) {
+ slot.setCustom(originalObj, runtimeObjectPropertyGetter);
+ return true;
+ }
+ }
+
+ return false;
}
-bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue* value, HTMLElement* thisImp)
+bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue* value, int /*attr*/, HTMLElement* thisImp)
{
- JSObject* runtimeObject = getRuntimeObject(exec, thisImp);
- if (!runtimeObject)
- return 0;
- if (!runtimeObject->hasProperty(exec, propertyName))
- return false;
- runtimeObject->put(exec, propertyName, value);
- return true;
+ if (JSValue* runtimeObject = getRuntimeObject(exec, thisImp)) {
+ JSObject* imp = static_cast<JSObject*>(runtimeObject);
+ if (imp->canPut(exec, propertyName)) {
+ imp->put(exec, propertyName, value);
+ return true;
+ }
+ }
+
+ return false;
}
bool runtimeObjectImplementsCall(HTMLElement* thisImp)
@@ -125,18 +131,17 @@ bool runtimeObjectImplementsCall(HTMLElement* thisImp)
if (!frame)
return false;
ExecState* exec = frame->scriptProxy()->globalObject()->globalExec();
- JSObject* runtimeObject = getRuntimeObject(exec, thisImp);
- if (!runtimeObject)
- return false;
- return runtimeObject->implementsCall();
+ if (JSValue* runtimeObject = getRuntimeObject(exec, thisImp))
+ return static_cast<JSObject*>(runtimeObject)->implementsCall();
+
+ return false;
}
JSValue* runtimeObjectCallAsFunction(ExecState* exec, JSObject* thisObj, const List& args, HTMLElement* thisImp)
{
- JSObject* runtimeObject = getRuntimeObject(exec, thisImp);
- if (!runtimeObject)
- return jsUndefined();
- return runtimeObject->call(exec, thisObj, args);
+ if (JSValue* runtimeObject = getRuntimeObject(exec, thisImp))
+ return static_cast<JSObject*>(runtimeObject)->call(exec, thisObj, args);
+ return jsUndefined();
}
} // namespace WebCore