+2005-07-19 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
+
+ * kjs/lookup.h: Changed tryCall in IMPLEMENT_PROTOFUNC here to call. It doesn't make
+ sense for this macro to use the name tryCall anyway, since that's specific to how
+ WebCore used this, so this is good anyway. On the other hand, it might be a problem
+ for KDOM or KSVG, in which case we'll need another macro for them, since JavaScriptCore
+ should presumably not have the C++ exception support.
+
2005-07-18 Geoffrey Garen <ggaren@apple.com>
-fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4008
#define IMPLEMENT_PROTOFUNC(ClassFunc) \
class ClassFunc : public DOMFunction { \
public: \
- ClassFunc(ExecState *exec, int i, int len) \
- : DOMFunction( /*proto? */ ), id(i) { \
- Value protect(this); \
- put(exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum); \
+ ClassFunc(ExecState *exec, int i, int len) : id(i) \
+ { \
+ put(exec, lengthPropertyName, Number(len), DontDelete|ReadOnly|DontEnum); \
} \
- /** You need to implement that one */ \
- virtual Value tryCall(ExecState *exec, Object &thisObj, const List &args); \
+ /* Macro user needs to implement the call function. */ \
+ virtual Value call(ExecState *exec, Object &thisObj, const List &args); \
private: \
int id; \
};
+2005-07-19 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Test cases added: None. Structural change only.
+
+ - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
+
+ * khtml/ecma/kjs_binding.cpp: Removed DOMObject::get, DOMObject::set, DOMFunction::get,
+ and DOMFunction::call.
+ * khtml/ecma/kjs_binding.h: Removed get, set, tryGet, trySet, call, tryCall from DOMObject
+ and DOMFunction. Removed DOMObjectLookupGet, DOMObjectLookupGetValue, and DOMObjectLookupPut.
+ We can just do things the normal way now.
+
+ The rest of the changes are just renames and removal of a couple stray tryCall wrappers.
+
+ tryGet -> get
+ tryPut -> put
+ tryCall -> call
+ putValue -> putValueProperty
+ DOMObjectLookupGet -> lookupGet
+ DOMObjectLookupGetValue -> lookupGetValue
+ DOMObjectLookupPut -> lookupPut
+
+ * khtml/ecma/domparser.cpp:
+ (KJS::DOMParserProtoFunc::call):
+ * khtml/ecma/kjs_css.cpp:
+ (KJS::DOMCSSStyleDeclaration::get):
+ (KJS::DOMCSSStyleDeclaration::put):
+ (KJS::DOMCSSStyleDeclarationProtoFunc::call):
+ (KJS::DOMStyleSheet::get):
+ (KJS::DOMStyleSheet::put):
+ (KJS::DOMStyleSheetList::get):
+ (KJS::DOMStyleSheetListFunc::call):
+ (KJS::DOMMediaList::get):
+ (KJS::DOMMediaList::put):
+ (KJS::KJS::DOMMediaListProtoFunc::call):
+ (KJS::DOMCSSStyleSheet::get):
+ (KJS::DOMCSSStyleSheetProtoFunc::call):
+ (KJS::DOMCSSRuleList::get):
+ (KJS::DOMCSSRuleListFunc::call):
+ (KJS::DOMCSSRule::get):
+ (KJS::DOMCSSRule::put):
+ (KJS::DOMCSSRule::putValueProperty):
+ (KJS::DOMCSSRuleFunc::call):
+ (KJS::CSSRuleConstructor::get):
+ (KJS::DOMCSSValue::get):
+ (KJS::DOMCSSValue::put):
+ (KJS::CSSValueConstructor::get):
+ (KJS::DOMCSSPrimitiveValue::get):
+ (KJS::DOMCSSPrimitiveValueProtoFunc::call):
+ (KJS::CSSPrimitiveValueConstructor::get):
+ (KJS::DOMCSSValueList::get):
+ (KJS::DOMCSSValueListFunc::call):
+ (KJS::DOMRGBColor::get):
+ (KJS::DOMRect::get):
+ (KJS::DOMCounter::get):
+ * khtml/ecma/kjs_css.h:
+ * khtml/ecma/kjs_dom.cpp:
+ (KJS::DOMNode::get):
+ (KJS::DOMNode::put):
+ (KJS::DOMNode::putValueProperty):
+ (KJS::DOMNodeProtoFunc::call):
+ (KJS::DOMNodeList::get):
+ (KJS::DOMNodeList::call):
+ (KJS::DOMNodeListFunc::call):
+ (KJS::DOMAttr::get):
+ (KJS::DOMAttr::put):
+ (KJS::DOMAttr::putValueProperty):
+ (KJS::DOMDocument::get):
+ (KJS::DOMDocument::put):
+ (KJS::DOMDocument::putValueProperty):
+ (KJS::DOMDocumentProtoFunc::call):
+ (KJS::DOMElement::get):
+ (KJS::DOMElementProtoFunc::call):
+ (KJS::DOMDOMImplementationProtoFunc::call):
+ (KJS::DOMDocumentType::get):
+ (KJS::DOMNamedNodeMap::get):
+ (KJS::DOMNamedNodeMapProtoFunc::call):
+ (KJS::DOMProcessingInstruction::get):
+ (KJS::DOMProcessingInstruction::put):
+ (KJS::DOMNotation::get):
+ (KJS::DOMEntity::get):
+ (KJS::NodeConstructor::get):
+ (KJS::DOMExceptionConstructor::get):
+ (KJS::DOMNamedNodesCollection::get):
+ (KJS::DOMCharacterData::get):
+ (KJS::DOMCharacterData::put):
+ (KJS::DOMCharacterDataProtoFunc::call):
+ (KJS::DOMText::get):
+ (KJS::DOMTextProtoFunc::call):
+ * khtml/ecma/kjs_dom.h:
+ * khtml/ecma/kjs_events.cpp:
+ (KJS::EventConstructor::get):
+ (KJS::DOMEvent::get):
+ (KJS::DOMEvent::put):
+ (KJS::DOMEvent::putValueProperty):
+ (KJS::DOMEventProtoFunc::call):
+ (KJS::EventExceptionConstructor::get):
+ (KJS::DOMUIEvent::get):
+ (KJS::DOMUIEventProtoFunc::call):
+ (KJS::DOMMouseEvent::get):
+ (KJS::DOMMouseEventProtoFunc::call):
+ (KJS::DOMKeyboardEvent::get):
+ (KJS::DOMKeyboardEventProtoFunc::call):
+ (KJS::MutationEventConstructor::get):
+ (KJS::DOMMutationEvent::get):
+ (KJS::DOMMutationEventProtoFunc::call):
+ (KJS::DOMWheelEvent::get):
+ (KJS::DOMWheelEventProtoFunc::call):
+ (KJS::Clipboard::get):
+ (KJS::Clipboard::put):
+ (KJS::Clipboard::putValueProperty):
+ (KJS::ClipboardProtoFunc::call):
+ * khtml/ecma/kjs_events.h:
+ * khtml/ecma/kjs_html.cpp:
+ (KJS::KJS::HTMLDocFunction::call):
+ (KJS::HTMLDocument::get):
+ (KJS::KJS::HTMLDocument::put):
+ (KJS::KJS::HTMLDocument::putValueProperty):
+ (KJS::KJS::HTMLElement::get):
+ (KJS::KJS::HTMLElementFunction::call):
+ (KJS::KJS::HTMLElement::put):
+ (KJS::HTMLElement::putValueProperty):
+ (KJS::KJS::HTMLCollection::get):
+ (KJS::KJS::HTMLCollection::call):
+ (KJS::KJS::HTMLCollectionProtoFunc::call):
+ (KJS::KJS::HTMLSelectCollection::get):
+ (KJS::KJS::HTMLSelectCollection::put):
+ (KJS::Image::get):
+ (KJS::Image::put):
+ (KJS::Image::putValueProperty):
+ (KJS::KJS::Context2DFunction::call):
+ (KJS::Context2D::get):
+ (KJS::Context2D::put):
+ (KJS::Context2D::putValueProperty):
+ (KJS::GradientFunction::call):
+ (KJS::Gradient::get):
+ (KJS::Gradient::put):
+ (KJS::Gradient::putValueProperty):
+ (KJS::ImagePattern::get):
+ (KJS::ImagePattern::put):
+ (KJS::ImagePattern::putValueProperty):
+ * khtml/ecma/kjs_html.h:
+ * khtml/ecma/kjs_navigator.cpp:
+ (KJS::PluginsFunc::call):
+ (KJS::NavigatorFunc::call):
+ * khtml/ecma/kjs_range.cpp:
+ (KJS::DOMRange::get):
+ (KJS::DOMRangeProtoFunc::call):
+ (KJS::RangeConstructor::get):
+ * khtml/ecma/kjs_range.h:
+ * khtml/ecma/kjs_traversal.cpp:
+ (KJS::DOMNodeIterator::get):
+ (KJS::DOMNodeIteratorProtoFunc::call):
+ (KJS::NodeFilterConstructor::get):
+ (KJS::DOMNodeFilterProtoFunc::call):
+ (KJS::DOMTreeWalker::get):
+ (KJS::DOMTreeWalker::put):
+ (KJS::DOMTreeWalkerProtoFunc::call):
+ * khtml/ecma/kjs_traversal.h:
+ * khtml/ecma/kjs_views.cpp:
+ (KJS::DOMAbstractView::get):
+ (KJS::DOMAbstractViewFunc::call):
+ * khtml/ecma/kjs_views.h:
+ * khtml/ecma/kjs_window.cpp:
+ (KJS::WindowFunc::call):
+ (KJS::LocationFunc::call):
+ (KJS::SelectionFunc::call):
+ (KJS::HistoryFunc::call):
+ (KJS::KonquerorFunc::call):
+ * khtml/ecma/xmlhttprequest.cpp:
+ (KJS::XMLHttpRequest::get):
+ (KJS::XMLHttpRequest::put):
+ (KJS::XMLHttpRequest::putValueProperty):
+ (KJS::XMLHttpRequestProtoFunc::call):
+ * khtml/ecma/xmlhttprequest.h:
+ * khtml/ecma/xmlserializer.cpp:
+ (KJS::XMLSerializerProtoFunc::call):
+
2005-07-19 Darin Adler <darin@apple.com>
Reviewed by Dave Hyatt.
}
-Value DOMParserProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMParserProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&DOMParser::info)) {
Object err = Error::create(exec,TypeError);
namespace KJS {
-/* TODO:
- * The catch all (...) clauses below shouldn't be necessary.
- * But they helped to view for example www.faz.net in an stable manner.
- * Those unknown exceptions should be treated as severe bugs and be fixed.
- *
- * these may be CSS exceptions - need to check - pmk
- */
-
-Value DOMObject::get(ExecState *exec, const Identifier &p) const
-{
- return tryGet(exec,p);
-}
-
-void DOMObject::put(ExecState *exec, const Identifier &propertyName,
- const Value &value, int attr)
-{
- tryPut(exec, propertyName, value, attr);
-}
-
UString DOMObject::toString(ExecState *) const
{
return "[object " + className() + "]";
}
-Value DOMFunction::get(ExecState *exec, const Identifier &propertyName) const
-{
- return tryGet(exec, propertyName);
-}
-
-Value DOMFunction::call(ExecState *exec, Object &thisObj, const List &args)
-{
- return tryCall(exec, thisObj, args);
-}
-
typedef HashMap<void *, DOMObject *> DOMObjectMap;
typedef HashMap<NodeImpl *, DOMNode *, PointerHash<NodeImpl *> > NodeMap;
typedef HashMap<DocumentImpl *, NodeMap *, PointerHash<DocumentImpl *> > NodePerDocMap;
namespace KJS {
/**
- * Base class for all objects in this binding - get() and put() run
- * tryGet() and tryPut() respectively, and catch exceptions if they
- * occur.
+ * Base class for all objects in this binding.
*/
class DOMObject : public ObjectImp {
- public:
+ protected:
DOMObject() : ObjectImp() {}
- virtual Value get(ExecState *exec, const Identifier &propertyName) const;
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const
- { return ObjectImp::get(exec, propertyName); }
-
- virtual void put(ExecState *exec, const Identifier &propertyName,
- const Value &value, int attr = None);
- virtual void tryPut(ExecState *exec, const Identifier &propertyName,
- const Value& value, int attr = None)
- { ObjectImp::put(exec,propertyName,value,attr); }
-
+ public:
virtual UString toString(ExecState *exec) const;
};
/**
- * Base class for all functions in this binding - get() and call() run
- * tryGet() and tryCall() respectively, and catch exceptions if they
- * occur.
+ * Base class for all functions in this binding.
*/
class DOMFunction : public ObjectImp {
+ protected:
+ DOMFunction() : ObjectImp() {}
public:
- DOMFunction() : ObjectImp( /* proto? */ ) {}
- virtual Value get(ExecState *exec, const Identifier &propertyName) const;
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const
- { return ObjectImp::get(exec, propertyName); }
-
virtual bool implementsCall() const { return true; }
- virtual Value call(ExecState *exec, Object &thisObj, const List &args);
-
- virtual Value tryCall(ExecState *exec, Object &thisObj, const List&args)
- { return ObjectImp::call(exec, thisObj, args); }
virtual bool toBoolean(ExecState *) const { return true; }
virtual Value toPrimitive(ExecState *exec, Type) const { return String(toString(exec)); }
virtual UString toString(ExecState *) const { return UString("[function]"); }
/**
* Convert a KJS value into a QVariant
- * Deprecated: Use variant instead.
*/
QVariant ValueToVariant(ExecState* exec, const Value& val);
- /**
- * We need a modified version of lookupGet because
- * we call tryGet instead of get, in DOMObjects.
- */
- template <class FuncImp, class ThisImp, class ParentImp>
- inline Value DOMObjectLookupGet(ExecState *exec, const Identifier &propertyName,
- const HashTable* table, const ThisImp* thisObj)
- {
- const HashEntry* entry = Lookup::findEntry(table, propertyName);
-
- if (!entry) // not found, forward to parent
- return thisObj->ParentImp::tryGet(exec, propertyName);
-
- if (entry->attr & Function)
- return lookupOrCreateFunction<FuncImp>(exec, propertyName, thisObj, entry->value, entry->params, entry->attr);
- return thisObj->getValueProperty(exec, entry->value);
- }
-
- /**
- * Simplified version of DOMObjectLookupGet in case there are no
- * functions, only "values".
- */
- template <class ThisImp, class ParentImp>
- inline Value DOMObjectLookupGetValue(ExecState *exec, const Identifier &propertyName,
- const HashTable* table, const ThisImp* thisObj)
- {
- const HashEntry* entry = Lookup::findEntry(table, propertyName);
-
- if (!entry) // not found, forward to parent
- return thisObj->ParentImp::tryGet(exec, propertyName);
-
- if (entry->attr & Function)
- fprintf(stderr, "Function bit set! Shouldn't happen in lookupValue!\n" );
- return thisObj->getValueProperty(exec, entry->value);
- }
-
- /**
- * We need a modified version of lookupPut because
- * we call tryPut instead of put, in DOMObjects.
- */
- template <class ThisImp, class ParentImp>
- inline void DOMObjectLookupPut(ExecState *exec, const Identifier &propertyName,
- const Value& value, int attr,
- const HashTable* table, ThisImp* thisObj)
- {
- const HashEntry* entry = Lookup::findEntry(table, propertyName);
-
- if (!entry) // not found: forward to parent
- thisObj->ParentImp::tryPut(exec, propertyName, value, attr);
- else if (entry->attr & Function) // function: put as override property
- thisObj->ObjectImp::put(exec, propertyName, value, attr);
- else if (entry->attr & ReadOnly) // readonly! Can't put!
-#ifdef KJS_VERBOSE
- fprintf(stderr,"Attempt to change value of readonly property '%s'\n",propertyName.ascii());
-#else
- ; // do nothing
-#endif
- else
- thisObj->putValue(exec, entry->value, value, attr);
- }
-
} // namespace
#endif
return ObjectImp::hasOwnProperty(exec, p);
}
-Value DOMCSSStyleDeclaration::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMCSSStyleDeclaration::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMCSSStyleDeclaration::tryGet " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMCSSStyleDeclaration::get " << propertyName.qstring() << endl;
#endif
const HashEntry* entry = Lookup::findEntry(&DOMCSSStyleDeclarationTable, propertyName);
CSSStyleDeclarationImpl &styleDecl = *m_impl;
return String("");
}
- return DOMObject::tryGet(exec, propertyName);
+ return DOMObject::get(exec, propertyName);
}
-void DOMCSSStyleDeclaration::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr )
+void DOMCSSStyleDeclaration::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr )
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMCSSStyleDeclaration::tryPut " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMCSSStyleDeclaration::put " << propertyName.qstring() << endl;
#endif
DOMExceptionTranslator exception(exec);
CSSStyleDeclarationImpl &styleDecl = *m_impl;
styleDecl.setProperty(prop, DOMString(propvalue), "", ignoreException);
}
} else {
- DOMObject::tryPut(exec, propertyName, value, attr);
+ DOMObject::put(exec, propertyName, value, attr);
}
}
}
-Value DOMCSSStyleDeclarationProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMCSSStyleDeclarationProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMCSSStyleDeclaration::info)) {
Object err = Error::create(exec,TypeError);
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMStyleSheet::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMStyleSheet::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<DOMStyleSheet,DOMObject>(exec,propertyName,&DOMStyleSheetTable,this);
+ return lookupGetValue<DOMStyleSheet,DOMObject>(exec,propertyName,&DOMStyleSheetTable,this);
}
Value DOMStyleSheet::getValueProperty(ExecState *exec, int token) const
return Value();
}
-void DOMStyleSheet::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void DOMStyleSheet::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
if (propertyName == "disabled") {
m_impl->setDisabled(value.toBoolean(exec));
}
else
- DOMObject::tryPut(exec, propertyName, value, attr);
+ DOMObject::put(exec, propertyName, value, attr);
}
ValueImp *getDOMStyleSheet(ExecState *exec, StyleSheetImpl *ss)
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMStyleSheetList::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMStyleSheetList::get(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMStyleSheetList::tryGet " << p.qstring() << endl;
+ kdDebug(6070) << "DOMStyleSheetList::get " << p.qstring() << endl;
#endif
StyleSheetListImpl &styleSheetList = *m_impl;
if (p == lengthPropertyName)
if (element && element->hasTagName(HTMLTags::style()))
return getDOMStyleSheet(exec, static_cast<HTMLStyleElementImpl *>(element)->sheet());
- return DOMObject::tryGet(exec, p);
+ return DOMObject::get(exec, p);
}
ValueImp *getDOMStyleSheetList(ExecState *exec, StyleSheetListImpl *ssl, DocumentImpl *doc)
}
}
-Value DOMStyleSheetListFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMStyleSheetListFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMStyleSheetList::info)) {
Object err = Error::create(exec,TypeError);
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMMediaList::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMMediaList::get(ExecState *exec, const Identifier &p) const
{
MediaListImpl &mediaList = *m_impl;
if (p == "mediaText")
if (ok)
return getStringOrNull(mediaList.item(u));
- return DOMObject::tryGet(exec, p);
+ return DOMObject::get(exec, p);
}
-void DOMMediaList::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void DOMMediaList::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
MediaListImpl &mediaList = *m_impl;
if (propertyName == "mediaText")
mediaList.setMediaText(value.toString(exec).string());
else
- DOMObject::tryPut(exec, propertyName, value, attr);
+ DOMObject::put(exec, propertyName, value, attr);
}
ValueImp *getDOMMediaList(ExecState *exec, MediaListImpl *ml)
return cacheDOMObject<MediaListImpl, DOMMediaList>(exec, ml);
}
-Value KJS::DOMMediaListProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value KJS::DOMMediaListProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMMediaList::info)) {
Object err = Error::create(exec,TypeError);
{
}
-Value DOMCSSStyleSheet::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMCSSStyleSheet::get(ExecState *exec, const Identifier &p) const
{
CSSStyleSheetImpl &cssStyleSheet = *static_cast<CSSStyleSheetImpl *>(impl());
if (p == "ownerRule")
return getDOMCSSRule(exec,cssStyleSheet.ownerRule());
else if (p == "cssRules" || p == "rules" /* MSIE extension */)
return getDOMCSSRuleList(exec,cssStyleSheet.cssRules());
- return DOMStyleSheet::tryGet(exec,p);
+ return DOMStyleSheet::get(exec,p);
}
-Value DOMCSSStyleSheetProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMCSSStyleSheetProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMCSSStyleSheet::info)) {
Object err = Error::create(exec,TypeError);
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMCSSRuleList::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMCSSRuleList::get(ExecState *exec, const Identifier &p) const
{
CSSRuleListImpl &cssRuleList = *m_impl;
if (p == lengthPropertyName)
if (ok)
return getDOMCSSRule(exec, cssRuleList.item(u));
- return DOMObject::tryGet(exec, p);
+ return DOMObject::get(exec, p);
}
-Value DOMCSSRuleListFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMCSSRuleListFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMCSSRuleList::info)) {
Object err = Error::create(exec,TypeError);
encoding DOMCSSRule::Charset_Encoding DontDelete
@end
*/
-Value DOMCSSRule::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMCSSRule::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMCSSRule::tryGet " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMCSSRule::get " << propertyName.qstring() << endl;
#endif
const HashEntry *entry = Lookup::findEntry(classInfo()->propHashTable, propertyName);
if (entry) {
}
// Base CSSRule stuff or parent class forward, as usual
- return DOMObjectLookupGet<DOMCSSRuleFunc, DOMCSSRule, DOMObject>(exec, propertyName, &DOMCSSRuleTable, this);
+ return lookupGet<DOMCSSRuleFunc, DOMCSSRule, DOMObject>(exec, propertyName, &DOMCSSRuleTable, this);
}
Value DOMCSSRule::getValueProperty(ExecState *exec, int token) const
return Undefined();
}
-void DOMCSSRule::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void DOMCSSRule::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
const HashTable* table = classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
ObjectImp::put(exec, propertyName, value, attr);
return;
}
- else if ((entry->attr & ReadOnly) == 0) // let DOMObjectLookupPut print the warning if not
+ else if ((entry->attr & ReadOnly) == 0) // let lookupPut print the warning if not
{
- putValue(exec, entry->value, value, attr);
+ putValueProperty(exec, entry->value, value, attr);
return;
}
}
- DOMObjectLookupPut<DOMCSSRule, DOMObject>(exec, propertyName, value, attr, &DOMCSSRuleTable, this);
+ lookupPut<DOMCSSRule, DOMObject>(exec, propertyName, value, attr, &DOMCSSRuleTable, this);
}
-void DOMCSSRule::putValue(ExecState *exec, int token, const Value& value, int)
+void DOMCSSRule::putValueProperty(ExecState *exec, int token, const Value& value, int)
{
switch (token) {
// for DOM::CSSRule::STYLE_RULE:
return;
default:
- kdWarning() << "DOMCSSRule::putValue unhandled token " << token << endl;
+ kdWarning() << "DOMCSSRule::putValueProperty unhandled token " << token << endl;
}
}
-Value DOMCSSRuleFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMCSSRuleFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMCSSRule::info)) {
Object err = Error::create(exec,TypeError);
@end
*/
-Value CSSRuleConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value CSSRuleConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<CSSRuleConstructor,DOMObject>(exec,p,&CSSRuleConstructorTable,this);
+ return lookupGetValue<CSSRuleConstructor,DOMObject>(exec,p,&CSSRuleConstructorTable,this);
}
Value CSSRuleConstructor::getValueProperty(ExecState *, int token) const
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMCSSValue::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMCSSValue::get(ExecState *exec, const Identifier &p) const
{
CSSValueImpl &cssValue = *m_impl;
if (p == "cssText")
return getStringOrNull(cssValue.cssText());
else if (p == "cssValueType");
return Number(cssValue.cssValueType());
- return DOMObject::tryGet(exec,p);
+ return DOMObject::get(exec,p);
}
-void DOMCSSValue::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void DOMCSSValue::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
CSSValueImpl &cssValue = *m_impl;
if (propertyName == "cssText")
cssValue.setCssText(value.toString(exec).string());
else
- DOMObject::tryPut(exec, propertyName, value, attr);
+ DOMObject::put(exec, propertyName, value, attr);
}
ValueImp *getDOMCSSValue(ExecState *exec, CSSValueImpl *v)
CSS_CUSTOM CSSValueConstructor::CSS_CUSTOM DontDelete|ReadOnly
@end
*/
-Value CSSValueConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value CSSValueConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<CSSValueConstructor,DOMObject>(exec,p,&CSSValueConstructorTable,this);
+ return lookupGetValue<CSSValueConstructor,DOMObject>(exec,p,&CSSValueConstructorTable,this);
}
Value CSSValueConstructor::getValueProperty(ExecState *, int token) const
setPrototype(DOMCSSPrimitiveValueProto::self(exec));
}
-Value DOMCSSPrimitiveValue::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMCSSPrimitiveValue::get(ExecState *exec, const Identifier &p) const
{
if (p == "primitiveType")
return Number(static_cast<CSSPrimitiveValueImpl *>(impl())->primitiveType());
- return DOMObject::tryGet(exec,p);
+ return DOMObject::get(exec,p);
}
-Value DOMCSSPrimitiveValueProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMCSSPrimitiveValueProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMCSSPrimitiveValue::info)) {
Object err = Error::create(exec,TypeError);
@end
*/
-Value CSSPrimitiveValueConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value CSSPrimitiveValueConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<CSSPrimitiveValueConstructor,CSSValueConstructor>(exec,p,&CSSPrimitiveValueConstructorTable,this);
+ return lookupGetValue<CSSPrimitiveValueConstructor,CSSValueConstructor>(exec,p,&CSSPrimitiveValueConstructorTable,this);
}
Value CSSPrimitiveValueConstructor::getValueProperty(ExecState *, int token) const
{
}
-Value DOMCSSValueList::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMCSSValueList::get(ExecState *exec, const Identifier &p) const
{
CSSValueListImpl &valueList = *static_cast<CSSValueListImpl *>(impl());
if (ok)
return getDOMCSSValue(exec,valueList.item(u));
- return DOMCSSValue::tryGet(exec,p);
+ return DOMCSSValue::get(exec,p);
}
-Value DOMCSSValueListFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMCSSValueListFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMCSSValue::info)) {
Object err = Error::create(exec,TypeError);
//rgbColors.remove(rgbColor.handle());
}
-Value DOMRGBColor::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMRGBColor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMRGBColor,DOMObject>(exec, p,
+ return lookupGetValue<DOMRGBColor,DOMObject>(exec, p,
&DOMRGBColorTable,
this);
}
ScriptInterpreter::forgetDOMObject(m_rect.get());
}
-Value DOMRect::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMRect::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMRect,DOMObject>(exec, p,
+ return lookupGetValue<DOMRect,DOMObject>(exec, p,
&DOMRectTable, this);
}
ScriptInterpreter::forgetDOMObject(m_counter.get());
}
-Value DOMCounter::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMCounter::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMCounter,DOMObject>(exec, p,
+ return lookupGetValue<DOMCounter,DOMObject>(exec, p,
&DOMCounterTable, this);
}
public:
DOMCSSStyleDeclaration(ExecState *exec, DOM::CSSStyleDeclarationImpl *s);
virtual ~DOMCSSStyleDeclaration();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
public:
DOMStyleSheet(ExecState *, DOM::StyleSheetImpl *ss) : m_impl(ss) { }
virtual ~DOMStyleSheet();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
DOMStyleSheetList(ExecState *, DOM::StyleSheetListImpl *ssl, DOM::DocumentImpl *doc)
: m_impl(ssl), m_doc(doc) { }
virtual ~DOMStyleSheetList();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
virtual bool toBoolean(ExecState* ) const { return true; }
public:
DOMMediaList(ExecState *, DOM::MediaListImpl *ml);
virtual ~DOMMediaList();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
virtual bool toBoolean(ExecState* ) const { return true; }
static const ClassInfo info;
public:
DOMCSSStyleSheet(ExecState *exec, DOM::CSSStyleSheetImpl *ss);
virtual ~DOMCSSStyleSheet();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
public:
DOMCSSRuleList(ExecState *, DOM::CSSRuleListImpl *rl) : m_impl(rl) { }
virtual ~DOMCSSRuleList();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
public:
DOMCSSRule(ExecState *, DOM::CSSRuleImpl *r) : m_impl(r) { }
virtual ~DOMCSSRule();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int attr);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int attr);
virtual const ClassInfo* classInfo() const;
static const ClassInfo info;
static const ClassInfo style_info, media_info, fontface_info, page_info, import_info, charset_info;
class CSSRuleConstructor : public DOMObject {
public:
CSSRuleConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMCSSValue(ExecState *, DOM::CSSValueImpl *v) : m_impl(v) { }
virtual ~DOMCSSValue();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { CssText, CssValueType };
class CSSValueConstructor : public DOMObject {
public:
CSSValueConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class DOMCSSPrimitiveValue : public DOMCSSValue {
public:
DOMCSSPrimitiveValue(ExecState *exec, DOM::CSSPrimitiveValueImpl *v);
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
class CSSPrimitiveValueConstructor : public CSSValueConstructor {
public:
CSSPrimitiveValueConstructor(ExecState *exec) : CSSValueConstructor(exec) { }
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class DOMCSSValueList : public DOMCSSValue {
public:
DOMCSSValueList(ExecState *exec, DOM::CSSValueListImpl *l);
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
public:
DOMRGBColor(unsigned color) : m_color(color) { }
~DOMRGBColor();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMRect(ExecState *, DOM::RectImpl *r) : m_rect(r) { }
~DOMRect();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMCounter(ExecState *, DOM::CounterImpl *c) : m_counter(c) { }
~DOMCounter();
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
friend class DOMNodeList;
public:
DOMNodeListFunc(ExecState *exec, int id, int len);
- virtual Value tryCall(ExecState *exec, Object &thisObj, const List &);
+ virtual Value call(ExecState *exec, Object &thisObj, const List &);
enum { Item };
private:
int id;
scrollHeight DOMNode::ScrollHeight DontDelete|ReadOnly
@end
*/
-Value DOMNode::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMNode::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMNode::tryGet " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMNode::get " << propertyName.qstring() << endl;
#endif
- return DOMObjectLookupGetValue<DOMNode, DOMObject>(exec, propertyName, &DOMNodeTable, this);
+ return lookupGetValue<DOMNode, DOMObject>(exec, propertyName, &DOMNodeTable, this);
}
Value DOMNode::getValueProperty(ExecState *exec, int token) const
return Value();
}
-void DOMNode::tryPut(ExecState *exec, const Identifier& propertyName, const Value& value, int attr)
+void DOMNode::put(ExecState *exec, const Identifier& propertyName, const Value& value, int attr)
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMNode::tryPut " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMNode::put " << propertyName.qstring() << endl;
#endif
- DOMObjectLookupPut<DOMNode,DOMObject>(exec, propertyName, value, attr,
+ lookupPut<DOMNode,DOMObject>(exec, propertyName, value, attr,
&DOMNodeTable, this );
}
-void DOMNode::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void DOMNode::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
DOMExceptionTranslator exception(exec);
NodeImpl &node = *m_impl;
break;
}
default:
- kdWarning() << "DOMNode::putValue unhandled token " << token << endl;
+ kdWarning() << "DOMNode::putValueProperty unhandled token " << token << endl;
}
}
{
}
-Value DOMNodeProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMNodeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&DOMNode::info)) {
Object err = Error::create(exec,TypeError);
return ObjectImp::hasOwnProperty(exec, p);
}
-Value DOMNodeList::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMNodeList::get(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMNodeList::tryGet " << p.ascii() << endl;
+ kdDebug(6070) << "DOMNodeList::get " << p.ascii() << endl;
#endif
Value result;
}
// Need to support both get and call, so that list[0] and list(0) work.
-Value DOMNodeList::call(ExecState *exec, Object &thisObj, const List &args)
-{
- // This code duplication is necessary, DOMNodeList isn't a DOMFunction
- Value val;
- try {
- val = tryCall(exec, thisObj, args);
- }
- // pity there's no way to distinguish between these in JS code
- catch (...) {
- Object err = Error::create(exec, GeneralError, "Exception from DOMNodeList");
- exec->setException(err);
- }
- return val;
-}
-
-Value DOMNodeList::tryCall(ExecState *exec, Object &, const List &args)
+Value DOMNodeList::call(ExecState *exec, Object &, const List &args)
{
// Do not use thisObj here. See HTMLCollection.
UString s = args[0].toString(exec);
if (ok)
return getDOMNode(exec, m_impl->item(u));
- kdWarning() << "KJS::DOMNodeList::tryCall " << s.qstring() << " not implemented" << endl;
+ kdWarning() << "KJS::DOMNodeList::call " << s.qstring() << " not implemented" << endl;
return Undefined();
}
}
// Not a prototype class currently, but should probably be converted to one
-Value DOMNodeListFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMNodeListFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMNodeList::info)) {
Object err = Error::create(exec,TypeError);
{
}
-Value DOMAttr::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMAttr::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMAttr::tryPut " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMAttr::put " << propertyName.qstring() << endl;
#endif
- return DOMObjectLookupGetValue<DOMAttr,DOMNode>(exec, propertyName,
+ return lookupGetValue<DOMAttr,DOMNode>(exec, propertyName,
&DOMAttrTable, this );
}
return Value(); // not reached
}
-void DOMAttr::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void DOMAttr::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMAttr::tryPut " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMAttr::put " << propertyName.qstring() << endl;
#endif
- DOMObjectLookupPut<DOMAttr,DOMNode>(exec, propertyName, value, attr,
+ lookupPut<DOMAttr,DOMNode>(exec, propertyName, value, attr,
&DOMAttrTable, this );
}
-void DOMAttr::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void DOMAttr::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
DOMExceptionTranslator exception(exec);
switch (token) {
static_cast<AttrImpl *>(impl())->setValue(value.toString(exec).string(), exception);
return;
default:
- kdWarning() << "DOMAttr::putValue unhandled token " << token << endl;
+ kdWarning() << "DOMAttr::putValueProperty unhandled token " << token << endl;
}
}
ScriptInterpreter::forgetDOMObject(static_cast<DocumentImpl *>(m_impl.get()));
}
-Value DOMDocument::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMDocument::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMDocument::tryGet " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMDocument::get " << propertyName.qstring() << endl;
#endif
- return DOMObjectLookupGetValue<DOMDocument, DOMNode>(
+ return lookupGetValue<DOMDocument, DOMNode>(
exec, propertyName, &DOMDocumentTable, this);
}
}
}
-void DOMDocument::tryPut(ExecState *exec, const Identifier& propertyName, const Value& value, int attr)
+void DOMDocument::put(ExecState *exec, const Identifier& propertyName, const Value& value, int attr)
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMDocument::tryPut " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMDocument::put " << propertyName.qstring() << endl;
#endif
- DOMObjectLookupPut<DOMDocument,DOMNode>(exec, propertyName, value, attr, &DOMDocumentTable, this );
+ lookupPut<DOMDocument,DOMNode>(exec, propertyName, value, attr, &DOMDocumentTable, this );
}
-void DOMDocument::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void DOMDocument::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
DocumentImpl &doc = *static_cast<DocumentImpl *>(impl());
switch (token) {
}
}
-Value DOMDocumentProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMDocumentProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMNode::info)) {
Object err = Error::create(exec,TypeError);
{
}
-Value DOMElement::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMElement::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMElement::tryGet " << propertyName.qstring() << endl;
+ kdDebug(6070) << "DOMElement::get " << propertyName.qstring() << endl;
#endif
ElementImpl &element = *static_cast<ElementImpl *>(impl());
case Style:
return getDOMCSSStyleDeclaration(exec,element.style());
default:
- kdWarning() << "Unhandled token in DOMElement::tryGet : " << entry->value << endl;
+ kdWarning() << "Unhandled token in DOMElement::get : " << entry->value << endl;
break;
}
}
// the listener object (function).
ValueImp *proto = prototype().imp();
if (DOMNode::hasOwnProperty(exec, propertyName) || (proto->dispatchType() == ObjectType && static_cast<ObjectImp *>(proto)->hasProperty(exec, propertyName)))
- return DOMNode::tryGet(exec, propertyName);
+ return DOMNode::get(exec, propertyName);
DOM::DOMString attr = element.getAttribute( propertyName.string() );
// Give access to attributes
return Undefined();
}
-Value DOMElementProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMElementProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMNode::info)) { // node should be enough here, given the cast
Object err = Error::create(exec,TypeError);
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMDOMImplementationProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMDOMImplementationProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMDOMImplementation::info)) {
Object err = Error::create(exec,TypeError);
DOMDocumentType::DOMDocumentType(ExecState *exec, DocumentTypeImpl *dt)
: DOMNode( /*### no proto yet*/exec, dt ) { }
-Value DOMDocumentType::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMDocumentType::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<DOMDocumentType, DOMNode>(exec, propertyName, &DOMDocumentTypeTable, this);
+ return lookupGetValue<DOMDocumentType, DOMNode>(exec, propertyName, &DOMDocumentTypeTable, this);
}
Value DOMDocumentType::getValueProperty(ExecState *exec, int token) const
return DOMObject::hasOwnProperty(exec, p);
}
-Value DOMNamedNodeMap::tryGet(ExecState* exec, const Identifier &p) const
+Value DOMNamedNodeMap::get(ExecState* exec, const Identifier &p) const
{
NamedNodeMapImpl &map = *m_impl;
if (p == lengthPropertyName)
return getDOMNode(exec,map.item(idx));
// Anything else (including functions, defined in the prototype)
- return DOMObject::tryGet(exec, p);
+ return DOMObject::get(exec, p);
}
-Value DOMNamedNodeMapProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMNamedNodeMapProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMNamedNodeMap::info)) {
Object err = Error::create(exec,TypeError);
{
}
-Value DOMProcessingInstruction::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMProcessingInstruction::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<DOMProcessingInstruction, DOMNode>(exec, propertyName, &DOMProcessingInstructionTable, this);
+ return lookupGetValue<DOMProcessingInstruction, DOMNode>(exec, propertyName, &DOMProcessingInstructionTable, this);
}
Value DOMProcessingInstruction::getValueProperty(ExecState *exec, int token) const
}
}
-void DOMProcessingInstruction::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void DOMProcessingInstruction::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
ProcessingInstructionImpl *pi = static_cast<ProcessingInstructionImpl *>(impl());
DOMExceptionTranslator exception(exec);
if (propertyName == "data")
pi->setData(value.toString(exec).string(), exception);
else
- DOMNode::tryPut(exec, propertyName, value, attr);
+ DOMNode::put(exec, propertyName, value, attr);
}
// -------------------------------------------------------------------------
{
}
-Value DOMNotation::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMNotation::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<DOMNotation, DOMNode>(exec, propertyName, &DOMNotationTable, this);
+ return lookupGetValue<DOMNotation, DOMNode>(exec, propertyName, &DOMNotationTable, this);
}
Value DOMNotation::getValueProperty(ExecState *, int token) const
{
}
-Value DOMEntity::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMEntity::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<DOMEntity, DOMNode>(exec, propertyName, &DOMEntityTable, this);
+ return lookupGetValue<DOMEntity, DOMNode>(exec, propertyName, &DOMEntityTable, this);
}
Value DOMEntity::getValueProperty(ExecState *, int token) const
NOTATION_NODE DOM::Node::NOTATION_NODE DontDelete|ReadOnly
@end
*/
-Value NodeConstructor::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value NodeConstructor::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<NodeConstructor, DOMObject>(exec, propertyName, &NodeConstructorTable, this);
+ return lookupGetValue<NodeConstructor, DOMObject>(exec, propertyName, &NodeConstructorTable, this);
}
Value NodeConstructor::getValueProperty(ExecState *, int token) const
@end
*/
-Value DOMExceptionConstructor::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMExceptionConstructor::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<DOMExceptionConstructor, DOMObject>(exec, propertyName, &DOMExceptionConstructorTable, this);
+ return lookupGetValue<DOMExceptionConstructor, DOMObject>(exec, propertyName, &DOMExceptionConstructorTable, this);
}
Value DOMExceptionConstructor::getValueProperty(ExecState *, int token) const
{
}
-Value DOMNamedNodesCollection::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value DOMNamedNodesCollection::get(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == lengthPropertyName)
return Number(m_nodes.count());
}
}
- return DOMObject::tryGet(exec,propertyName);
+ return DOMObject::get(exec,propertyName);
}
// -------------------------------------------------------------------------
{
}
-Value DOMCharacterData::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMCharacterData::get(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070)<<"DOMCharacterData::tryGet "<<p.string().string()<<endl;
+ kdDebug(6070)<<"DOMCharacterData::get "<<p.string().string()<<endl;
#endif
- return DOMObjectLookupGetValue<DOMCharacterData,DOMNode>(exec,p,&DOMCharacterDataTable,this);
+ return lookupGetValue<DOMCharacterData,DOMNode>(exec,p,&DOMCharacterDataTable,this);
}
Value DOMCharacterData::getValueProperty(ExecState *, int token) const
}
}
-void DOMCharacterData::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void DOMCharacterData::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
DOMExceptionTranslator exception(exec);
if (propertyName == "data")
static_cast<CharacterDataImpl *>(impl())->setData(value.toString(exec).string(), exception);
else
- DOMNode::tryPut(exec, propertyName,value,attr);
+ DOMNode::put(exec, propertyName,value,attr);
}
-Value DOMCharacterDataProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMCharacterDataProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMCharacterData::info)) {
Object err = Error::create(exec,TypeError);
setPrototype(DOMTextProto::self(exec));
}
-Value DOMText::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMText::get(ExecState *exec, const Identifier &p) const
{
if (p == "")
return Undefined(); // ### TODO
else
- return DOMCharacterData::tryGet(exec, p);
+ return DOMCharacterData::get(exec, p);
}
-Value DOMTextProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMTextProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMText::info)) {
Object err = Error::create(exec,TypeError);
DOMNode(ExecState *exec, DOM::NodeImpl *n);
virtual ~DOMNode();
virtual bool toBoolean(ExecState *) const;
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
virtual void mark();
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int attr);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int attr);
DOM::NodeImpl *impl() const { return m_impl.get(); }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
DOMNodeList(ExecState *, DOM::NodeListImpl *l) : m_impl(l) { }
~DOMNodeList();
virtual bool hasOwnProperty(ExecState *exec, const Identifier &p) const;
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
virtual Value call(ExecState *exec, Object &thisObj, const List&args);
- virtual Value tryCall(ExecState *exec, Object &thisObj, const List&args);
virtual bool implementsCall() const { return true; }
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMDocument(ExecState *exec, DOM::DocumentImpl *d);
~DOMDocument();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int attr);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int attr);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { DocType, Implementation, DocumentElement,
class DOMAttr : public DOMNode {
public:
DOMAttr(ExecState *exec, DOM::AttrImpl *a);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
Value getValueProperty(ExecState *exec, int token) const;
- void putValue(ExecState *exec, int token, const Value& value, int attr);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int attr);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Name, Specified, ValueProperty, OwnerElement };
class DOMElement : public DOMNode {
public:
DOMElement(ExecState *exec, DOM::ElementImpl *e);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
class DOMDocumentType : public DOMNode {
public:
DOMDocumentType(ExecState *exec, DOM::DocumentTypeImpl *dt);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
DOMNamedNodeMap(ExecState *, DOM::NamedNodeMapImpl *m);
~DOMNamedNodeMap();
virtual bool hasOwnProperty(ExecState *exec, const Identifier &p) const;
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
virtual bool toBoolean(ExecState *) const { return true; }
class DOMProcessingInstruction : public DOMNode {
public:
DOMProcessingInstruction(ExecState *exec, DOM::ProcessingInstructionImpl *pi);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Target, Data, Sheet };
class DOMNotation : public DOMNode {
public:
DOMNotation(ExecState *exec, DOM::NotationImpl *n);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class DOMEntity : public DOMNode {
public:
DOMEntity(ExecState *exec, DOM::EntityImpl *e);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class NodeConstructor : public DOMObject {
public:
NodeConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class DOMExceptionConstructor : public DOMObject {
public:
DOMExceptionConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class DOMNamedNodesCollection : public DOMObject {
public:
DOMNamedNodesCollection(ExecState *exec, const QValueList< khtml::SharedPtr<DOM::NodeImpl> >& nodes );
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
private:
QValueList< khtml::SharedPtr<DOM::NodeImpl> > m_nodes;
};
class DOMCharacterData : public DOMNode {
public:
DOMCharacterData(ExecState *exec, DOM::CharacterDataImpl *d);
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
DOM::CharacterDataImpl *toData() const;
class DOMText : public DOMCharacterData {
public:
DOMText(ExecState *exec, DOM::TextImpl *t);
- virtual Value tryGet(ExecState *exec,const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec,const Identifier &propertyName) const;
Value getValueProperty(ExecState *, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@end
*/
-Value EventConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value EventConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<EventConstructor, DOMObject>(exec,p,&EventConstructorTable,this);
+ return lookupGetValue<EventConstructor, DOMObject>(exec,p,&EventConstructorTable,this);
}
Value EventConstructor::getValueProperty(ExecState *, int token) const
clipboard->mark();
}
-Value DOMEvent::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMEvent::get(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
- kdDebug() << "KJS::DOMEvent::tryGet " << p.qstring() << endl;
+ kdDebug() << "KJS::DOMEvent::get " << p.qstring() << endl;
#endif
- return DOMObjectLookupGetValue<DOMEvent,DOMObject>(exec, p, &DOMEventTable, this );
+ return lookupGetValue<DOMEvent,DOMObject>(exec, p, &DOMEventTable, this );
}
Value DOMEvent::getValueProperty(ExecState *exec, int token) const
}
}
-void DOMEvent::tryPut(ExecState *exec, const Identifier &propertyName,
+void DOMEvent::put(ExecState *exec, const Identifier &propertyName,
const Value& value, int attr)
{
- DOMObjectLookupPut<DOMEvent, DOMObject>(exec, propertyName, value, attr,
+ lookupPut<DOMEvent, DOMObject>(exec, propertyName, value, attr,
&DOMEventTable, this);
}
-void DOMEvent::putValue(ExecState *exec, int token, const Value& value, int)
+void DOMEvent::putValueProperty(ExecState *exec, int token, const Value& value, int)
{
EventImpl &event = *m_impl;
switch (token) {
}
}
-Value DOMEventProtoFunc::tryCall(ExecState *exec, Object & thisObj, const List &args)
+Value DOMEventProtoFunc::call(ExecState *exec, Object & thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMEvent::info)) {
Object err = Error::create(exec,TypeError);
UNSPECIFIED_EVENT_TYPE_ERR DOM::EventException::UNSPECIFIED_EVENT_TYPE_ERR DontDelete|ReadOnly
@end
*/
-Value EventExceptionConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value EventExceptionConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<EventExceptionConstructor, DOMObject>(exec,p,&EventExceptionConstructorTable,this);
+ return lookupGetValue<EventExceptionConstructor, DOMObject>(exec,p,&EventExceptionConstructorTable,this);
}
Value EventExceptionConstructor::getValueProperty(ExecState *, int token) const
{
}
-Value DOMUIEvent::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMUIEvent::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMUIEvent,DOMEvent>(exec,p,&DOMUIEventTable,this);
+ return lookupGetValue<DOMUIEvent,DOMEvent>(exec,p,&DOMUIEventTable,this);
}
Value DOMUIEvent::getValueProperty(ExecState *exec, int token) const
}
}
-Value DOMUIEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMUIEventProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMUIEvent::info)) {
Object err = Error::create(exec,TypeError);
{
}
-Value DOMMouseEvent::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMMouseEvent::get(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMMouseEvent::tryGet " << p.qstring() << endl;
+ kdDebug(6070) << "DOMMouseEvent::get " << p.qstring() << endl;
#endif
- return DOMObjectLookupGetValue<DOMMouseEvent,DOMUIEvent>(exec,p,&DOMMouseEventTable,this);
+ return lookupGetValue<DOMMouseEvent,DOMUIEvent>(exec,p,&DOMMouseEventTable,this);
}
static QPoint offsetFromTarget(const MouseRelatedEventImpl *e)
}
}
-Value DOMMouseEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMMouseEventProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMMouseEvent::info)) {
Object err = Error::create(exec,TypeError);
return &info;
}
-Value DOMKeyboardEvent::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMKeyboardEvent::get(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMKeyboardEvent::tryGet " << p.qstring() << endl;
+ kdDebug(6070) << "DOMKeyboardEvent::get " << p.qstring() << endl;
#endif
- return DOMObjectLookupGetValue<DOMKeyboardEvent, DOMUIEvent>(exec, p, &DOMKeyboardEventTable, this);
+ return lookupGetValue<DOMKeyboardEvent, DOMUIEvent>(exec, p, &DOMKeyboardEventTable, this);
}
Value DOMKeyboardEvent::getValueProperty(ExecState *exec, int token) const
}
}
-Value DOMKeyboardEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMKeyboardEventProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&DOMKeyboardEvent::info)) {
Object err = Error::create(exec,TypeError);
REMOVAL DOM::MutationEvent::REMOVAL DontDelete|ReadOnly
@end
*/
-Value MutationEventConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value MutationEventConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<MutationEventConstructor,DOMObject>(exec,p,&MutationEventConstructorTable,this);
+ return lookupGetValue<MutationEventConstructor,DOMObject>(exec,p,&MutationEventConstructorTable,this);
}
Value MutationEventConstructor::getValueProperty(ExecState *, int token) const
{
}
-Value DOMMutationEvent::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMMutationEvent::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMMutationEvent,DOMEvent>(exec,p,&DOMMutationEventTable,this);
+ return lookupGetValue<DOMMutationEvent,DOMEvent>(exec,p,&DOMMutationEventTable,this);
}
Value DOMMutationEvent::getValueProperty(ExecState *exec, int token) const
}
}
-Value DOMMutationEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMMutationEventProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMMutationEvent::info)) {
Object err = Error::create(exec,TypeError);
{
}
-Value DOMWheelEvent::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMWheelEvent::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMWheelEvent,DOMEvent>(exec, p, &DOMWheelEventTable, this);
+ return lookupGetValue<DOMWheelEvent,DOMEvent>(exec, p, &DOMWheelEventTable, this);
}
Value DOMWheelEvent::getValueProperty(ExecState *exec, int token) const
return Undefined();
}
-Value DOMWheelEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMWheelEventProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&DOMWheelEvent::info)) {
Object error = Error::create(exec,TypeError);
}
}
-Value Clipboard::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value Clipboard::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<Clipboard,DOMObject>(exec, propertyName, &ClipboardTable, this);
+ return lookupGetValue<Clipboard,DOMObject>(exec, propertyName, &ClipboardTable, this);
}
Value Clipboard::getValueProperty(ExecState *exec, int token) const
}
}
-void Clipboard::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void Clipboard::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
- DOMObjectLookupPut<Clipboard,DOMObject>(exec, propertyName, value, attr, &ClipboardTable, this );
+ lookupPut<Clipboard,DOMObject>(exec, propertyName, value, attr, &ClipboardTable, this );
}
-void Clipboard::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void Clipboard::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
switch (token) {
case DropEffect:
clipboard->setEffectAllowed(value.toString(exec).string());
break;
default:
- kdWarning() << "Clipboard::putValue unhandled token " << token << endl;
+ kdWarning() << "Clipboard::putValueProperty unhandled token " << token << endl;
}
}
-Value ClipboardProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value ClipboardProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::Clipboard::info)) {
Object err = Error::create(exec,TypeError);
class EventConstructor : public DOMObject {
public:
EventConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMEvent(ExecState *exec, DOM::EventImpl *e);
~DOMEvent();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName,
+ virtual void put(ExecState *exec, const Identifier &propertyName,
const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Type, Target, CurrentTarget, EventPhase, Bubbles,
class EventExceptionConstructor : public DOMObject {
public:
EventExceptionConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMUIEvent(ExecState *exec, DOM::UIEventImpl *ue);
~DOMUIEvent();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMMouseEvent(ExecState *exec, DOM::MouseEventImpl *me);
~DOMMouseEvent();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
virtual void mark();
// no put - all read-only
public:
DOMKeyboardEvent(ExecState *exec, DOM::KeyboardEventImpl *ke);
~DOMKeyboardEvent();
- virtual Value tryGet(ExecState *exec, const Identifier &p) const;
+ virtual Value get(ExecState *exec, const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const;
class MutationEventConstructor : public DOMObject {
public:
MutationEventConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMMutationEvent(ExecState *exec, DOM::MutationEventImpl *me);
~DOMMutationEvent();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class DOMWheelEvent : public DOMUIEvent {
public:
DOMWheelEvent(ExecState *, DOM::WheelEventImpl *);
- virtual Value tryGet(ExecState *, const Identifier &p) const;
+ virtual Value get(ExecState *, const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
Clipboard(ExecState *exec, DOM::ClipboardImpl *ds);
~Clipboard();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
class HTMLElementFunction : public DOMFunction {
public:
HTMLElementFunction(ExecState *exec, int i, int len);
- virtual Value tryCall(ExecState *exec, Object &thisObj, const List&args);
+ virtual Value call(ExecState *exec, Object &thisObj, const List&args);
private:
int id;
};
IMPLEMENT_PROTOFUNC(HTMLDocFunction)
-Value KJS::HTMLDocFunction::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value KJS::HTMLDocFunction::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&HTMLDocument::info)) {
Object err = Error::create(exec,TypeError);
return DOMDocument::hasOwnProperty(exec, p) || doc->haveNamedImageOrForm(p.qstring());
}
-Value HTMLDocument::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value HTMLDocument::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "KJS::HTMLDocument::tryGet " << propertyName.qstring() << endl;
+ kdDebug(6070) << "KJS::HTMLDocument::get " << propertyName.qstring() << endl;
#endif
HTMLDocumentImpl &doc = *static_cast<HTMLDocumentImpl *>(impl());
HTMLElementImpl *body = doc.body();
ValueImp *proto = prototype().imp();
if (DOMDocument::hasOwnProperty(exec, propertyName) || (proto->dispatchType() == ObjectType && static_cast<ObjectImp *>(proto)->hasProperty(exec, propertyName)))
- return DOMDocument::tryGet(exec, propertyName);
+ return DOMDocument::get(exec, propertyName);
- //kdDebug(6070) << "KJS::HTMLDocument::tryGet " << propertyName.qstring() << " not found, returning element" << endl;
+ //kdDebug(6070) << "KJS::HTMLDocument::get " << propertyName.qstring() << " not found, returning element" << endl;
// image and form elements with the name p will be looked up last
// Look for named applets.
return HTMLCollection(exec, doc.nameableItems().get()).getNamedItems(exec, propertyName); // Get all the items with the same name
}
-void KJS::HTMLDocument::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void KJS::HTMLDocument::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "KJS::HTMLDocument::tryPut " << propertyName.qstring() << endl;
+ kdDebug(6070) << "KJS::HTMLDocument::put " << propertyName.qstring() << endl;
#endif
- DOMObjectLookupPut<HTMLDocument, DOMDocument>( exec, propertyName, value, attr, &HTMLDocumentTable, this );
+ lookupPut<HTMLDocument, DOMDocument>( exec, propertyName, value, attr, &HTMLDocumentTable, this );
}
-void KJS::HTMLDocument::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void KJS::HTMLDocument::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
DOMExceptionTranslator exception(exec);
HTMLDocumentImpl &doc = *static_cast<HTMLDocumentImpl *>(impl());
break;
}
default:
- kdWarning() << "HTMLDocument::putValue unhandled token " << token << endl;
+ kdWarning() << "HTMLDocument::putValueProperty unhandled token " << token << endl;
}
}
{
}
-Value KJS::HTMLElement::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value KJS::HTMLElement::get(ExecState *exec, const Identifier &propertyName) const
{
HTMLElementImpl &element = *static_cast<HTMLElementImpl *>(impl());
#ifdef KJS_VERBOSE
}
// Base HTMLElement stuff or parent class forward, as usual
- return DOMObjectLookupGet<KJS::HTMLElementFunction, KJS::HTMLElement, DOMElement>(exec, propertyName, &HTMLElementTable, this);
+ return lookupGet<KJS::HTMLElementFunction, KJS::HTMLElement, DOMElement>(exec, propertyName, &HTMLElementTable, this);
}
bool KJS::HTMLElement::implementsCall() const
put(exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum);
}
-Value KJS::HTMLElementFunction::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value KJS::HTMLElementFunction::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::HTMLElement::info)) {
Object err = Error::create(exec,TypeError);
return Undefined();
}
-void KJS::HTMLElement::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void KJS::HTMLElement::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
#ifdef KJS_VERBOSE
DOM::DOMString str = value.isA(NullType) ? DOM::DOMString() : value.toString(exec).string();
ObjectImp::put(exec, propertyName, value, attr);
return;
}
- else if ((entry->attr & ReadOnly) == 0) { // let DOMObjectLookupPut print the warning if not
- putValue(exec, entry->value, value, attr);
+ else if (!(entry->attr & ReadOnly)) { // let lookupPut print the warning if read-only
+ putValueProperty(exec, entry->value, value, attr);
return;
}
}
- DOMObjectLookupPut<KJS::HTMLElement, DOMElement>(exec, propertyName, value, attr, &HTMLElementTable, this);
+ lookupPut<KJS::HTMLElement, DOMElement>(exec, propertyName, value, attr, &HTMLElementTable, this);
}
void HTMLElement::htmlSetter(ExecState *exec, int token, const Value& value, const DOM::DOMString& str)
// FIXME: Find out what WinIE supports and implement it.
}
-void HTMLElement::putValue(ExecState *exec, int token, const Value& value, int)
+void HTMLElement::putValueProperty(ExecState *exec, int token, const Value& value, int)
{
DOMExceptionTranslator exception(exec);
DOM::DOMString str = value.isA(NullType) ? DOM::DOMString() : value.toString(exec).string();
return DOMObject::hasOwnProperty(exec, p);
}
-Value KJS::HTMLCollection::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value KJS::HTMLCollection::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
- kdDebug() << "KJS::HTMLCollection::tryGet " << propertyName.ascii() << endl;
+ kdDebug() << "KJS::HTMLCollection::get " << propertyName.ascii() << endl;
#endif
HTMLCollectionImpl &collection = *m_impl;
if (propertyName == lengthPropertyName)
// HTMLCollections are strange objects, they support both get and call,
// so that document.forms.item(0) and document.forms(0) both work.
-Value KJS::HTMLCollection::call(ExecState *exec, Object &thisObj, const List &args)
-{
- // This code duplication is necessary, HTMLCollection isn't a DOMFunction
- Value val;
- try {
- val = tryCall(exec, thisObj, args);
- }
- // pity there's no way to distinguish between these in JS code
- catch (...) {
- Object err = Error::create(exec, GeneralError, "Exception from HTMLCollection");
- exec->setException(err);
- }
- return val;
-}
-
-Value KJS::HTMLCollection::tryCall(ExecState *exec, Object &, const List &args)
+Value KJS::HTMLCollection::call(ExecState *exec, Object &, const List &args)
{
// Do not use thisObj here. It can be the HTMLDocument, in the document.forms(i) case.
/*if( thisObj.imp() != this )
{
- kdWarning() << "thisObj.imp() != this in HTMLCollection::tryCall" << endl;
- KJS::printInfo(exec,"KJS::HTMLCollection::tryCall thisObj",thisObj,-1);
- KJS::printInfo(exec,"KJS::HTMLCollection::tryCall this",Value(this),-1);
+ kdWarning() << "thisObj.imp() != this in HTMLCollection::call" << endl;
+ KJS::printInfo(exec,"KJS::HTMLCollection::call thisObj",thisObj,-1);
+ KJS::printInfo(exec,"KJS::HTMLCollection::call this",Value(this),-1);
}*/
HTMLCollectionImpl &collection = *m_impl;
return Value(new DOMNamedNodesCollection(exec,namedItems));
}
-Value KJS::HTMLCollectionProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value KJS::HTMLCollectionProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::HTMLCollection::info)) {
Object err = Error::create(exec,TypeError);
{
}
-Value KJS::HTMLSelectCollection::tryGet(ExecState *exec, const Identifier &p) const
+Value KJS::HTMLSelectCollection::get(ExecState *exec, const Identifier &p) const
{
if (p == "selectedIndex")
return Number(m_element->selectedIndex());
- return HTMLCollection::tryGet(exec, p);
+ return HTMLCollection::get(exec, p);
}
-void KJS::HTMLSelectCollection::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int)
+void KJS::HTMLSelectCollection::put(ExecState *exec, const Identifier &propertyName, const Value& value, int)
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "KJS::HTMLSelectCollection::tryPut " << propertyName.qstring() << endl;
+ kdDebug(6070) << "KJS::HTMLSelectCollection::put " << propertyName.qstring() << endl;
#endif
if ( propertyName == "selectedIndex" ) {
m_element->setSelectedIndex( value.toInt32( exec ) );
@end
*/
-Value Image::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value Image::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<Image,DOMObject>(exec, propertyName, &ImageTable, this);
+ return lookupGetValue<Image,DOMObject>(exec, propertyName, &ImageTable, this);
}
Value Image::getValueProperty(ExecState *, int token) const
}
}
-void Image::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void Image::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
- DOMObjectLookupPut<Image,DOMObject>(exec, propertyName, value, attr, &ImageTable, this );
+ lookupPut<Image,DOMObject>(exec, propertyName, value, attr, &ImageTable, this );
}
-void Image::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void Image::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
switch(token) {
case Src:
height = value.toInt32(exec);
break;
default:
- kdWarning() << "HTMLDocument::putValue unhandled token " << token << endl;
+ kdWarning() << "HTMLDocument::putValueProperty unhandled token " << token << endl;
}
}
#define BITS_PER_COMPONENT 8
#define BYTES_PER_ROW(width,bitsPerComponent,numComponents) ((width * bitsPerComponent * numComponents + 7)/8)
-Value KJS::Context2DFunction::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value KJS::Context2DFunction::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&Context2D::info)) {
Object err = Error::create(exec,TypeError);
@end
*/
-Value Context2D::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value Context2D::get(ExecState *exec, const Identifier &propertyName) const
{
const HashTable* table = classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
return getValueProperty(exec, entry->value);
}
- return DOMObjectLookupGetValue<Context2D,DOMObject>(exec, propertyName, &Context2DTable, this);
+ return lookupGetValue<Context2D,DOMObject>(exec, propertyName, &Context2DTable, this);
}
Value Context2D::getValueProperty(ExecState *, int token) const
return Undefined();
}
-void Context2D::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void Context2D::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
- DOMObjectLookupPut<Context2D,DOMObject>(exec, propertyName, value, attr, &Context2DTable, this );
+ lookupPut<Context2D,DOMObject>(exec, propertyName, value, attr, &Context2DTable, this );
}
CGContextRef Context2D::drawingContext()
CFRelease (colorRef);
}
-void Context2D::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void Context2D::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
CGContextRef context = drawingContext();
if (!context)
IMPLEMENT_PROTOFUNC(GradientFunction)
-Value GradientFunction::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value GradientFunction::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&Gradient::info)) {
Object err = Error::create(exec,TypeError);
commonInit();
}
-Value Gradient::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value Gradient::get(ExecState *exec, const Identifier &propertyName) const
{
const HashTable* table = classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
return getValueProperty(exec, entry->value);
}
- return DOMObjectLookupGetValue<Gradient,DOMObject>(exec, propertyName, &GradientTable, this);
+ return lookupGetValue<Gradient,DOMObject>(exec, propertyName, &GradientTable, this);
}
Value Gradient::getValueProperty(ExecState *, int token) const
return Undefined();
}
-void Gradient::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void Gradient::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
- DOMObjectLookupPut<Gradient,DOMObject>(exec, propertyName, value, attr, &GradientTable, this );
+ lookupPut<Gradient,DOMObject>(exec, propertyName, value, attr, &GradientTable, this );
}
-void Gradient::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void Gradient::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
}
}
}
-Value ImagePattern::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value ImagePattern::get(ExecState *exec, const Identifier &propertyName) const
{
const HashTable* table = classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
return getValueProperty(exec, entry->value);
}
- return DOMObjectLookupGetValue<ImagePattern,DOMObject>(exec, propertyName, &ImagePatternTable, this);
+ return lookupGetValue<ImagePattern,DOMObject>(exec, propertyName, &ImagePatternTable, this);
}
Value ImagePattern::getValueProperty(ExecState *, int token) const
return Undefined();
}
-void ImagePattern::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void ImagePattern::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
- DOMObjectLookupPut<ImagePattern,DOMObject>(exec, propertyName, value, attr, &ImagePatternTable, this );
+ lookupPut<ImagePattern,DOMObject>(exec, propertyName, value, attr, &ImagePatternTable, this );
}
-void ImagePattern::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void ImagePattern::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
}
class HTMLDocument : public DOMDocument {
public:
HTMLDocument(ExecState *exec, DOM::HTMLDocumentImpl *d);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/);
virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
class HTMLElement : public DOMElement {
public:
HTMLElement(ExecState *exec, DOM::HTMLElementImpl *e);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int);
virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual UString toString(ExecState *exec) const;
virtual void pushEventHandlerScope(ExecState *exec, ScopeChain &scope) const;
public:
HTMLCollection(ExecState *exec, DOM::HTMLCollectionImpl *c);
~HTMLCollection();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
virtual Value call(ExecState *exec, Object &thisObj, const List&args);
- virtual Value tryCall(ExecState *exec, Object &thisObj, const List&args);
virtual bool implementsCall() const { return true; }
virtual bool toBoolean(ExecState *) const { return true; }
virtual bool hasOwnProperty(ExecState *exec, const Identifier &p) const;
class HTMLSelectCollection : public HTMLCollection {
public:
HTMLSelectCollection(ExecState *exec, DOM::HTMLCollectionImpl *c, DOM::HTMLSelectElementImpl *e);
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
private:
khtml::SharedPtr<DOM::HTMLSelectElementImpl> m_element;
};
public:
Image(DOM::DocumentImpl *d, bool ws, int w, bool hs, int h);
~Image();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/);
void notifyFinished(khtml::CachedObject *);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
public:
Context2D(DOM::HTMLElementImpl *e);
~Context2D();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual void mark();
virtual const ClassInfo* classInfo() const { return &info; }
Gradient(float x0, float y0, float x1, float y1);
Gradient(float x0, float y0, float r0, float x1, float y1, float r1);
~Gradient();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
public:
ImagePattern(Image *i, int type);
~ImagePattern();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
}
-Value PluginsFunc::tryCall(ExecState *exec, Object &, const List &args)
+Value PluginsFunc::call(ExecState *exec, Object &, const List &args)
{
PluginBase(exec).refresh(args[0].toBoolean(exec));
return Undefined();
}
-Value NavigatorFunc::tryCall(ExecState *exec, Object &thisObj, const List &)
+Value NavigatorFunc::call(ExecState *exec, Object &thisObj, const List &)
{
if (!thisObj.inherits(&KJS::Navigator::info)) {
Object err = Error::create(exec,TypeError);
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMRange::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMRange::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMRange, DOMObject>(exec, p, &DOMRangeTable, this);
+ return lookupGetValue<DOMRange, DOMObject>(exec, p, &DOMRangeTable, this);
}
Value DOMRange::getValueProperty(ExecState *exec, int token) const
}
}
-Value DOMRangeProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMRangeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMRange::info)) {
Object err = Error::create(exec,TypeError);
END_TO_START DOM::Range::END_TO_START DontDelete|ReadOnly
@end
*/
-Value RangeConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value RangeConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<RangeConstructor,DOMObject>(exec, p, &RangeConstructorTable, this);
+ return lookupGetValue<RangeConstructor,DOMObject>(exec, p, &RangeConstructorTable, this);
}
Value RangeConstructor::getValueProperty(ExecState *, int token) const
public:
DOMRange(ExecState *exec, DOM::RangeImpl *r);
~DOMRange();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class RangeConstructor : public DOMObject {
public:
RangeConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMNodeIterator::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMNodeIterator::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMNodeIterator,DOMObject>(exec,p,&DOMNodeIteratorTable,this);
+ return lookupGetValue<DOMNodeIterator,DOMObject>(exec,p,&DOMNodeIteratorTable,this);
}
Value DOMNodeIterator::getValueProperty(ExecState *exec, int token) const
}
}
-Value DOMNodeIteratorProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &)
+Value DOMNodeIteratorProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
{
if (!thisObj.inherits(&KJS::DOMNodeIterator::info)) {
Object err = Error::create(exec,TypeError);
SHOW_NOTATION DOM::NodeFilter::SHOW_NOTATION DontDelete|ReadOnly
@end
*/
-Value NodeFilterConstructor::tryGet(ExecState *exec, const Identifier &p) const
+Value NodeFilterConstructor::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<NodeFilterConstructor,DOMObject>(exec,p,&NodeFilterConstructorTable,this);
+ return lookupGetValue<NodeFilterConstructor,DOMObject>(exec,p,&NodeFilterConstructorTable,this);
}
Value NodeFilterConstructor::getValueProperty(ExecState *, int token) const
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMNodeFilterProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMNodeFilterProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&KJS::DOMNodeFilter::info)) {
Object err = Error::create(exec,TypeError);
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMTreeWalker::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMTreeWalker::get(ExecState *exec, const Identifier &p) const
{
- return DOMObjectLookupGetValue<DOMTreeWalker,DOMObject>(exec,p,&DOMTreeWalkerTable,this);
+ return lookupGetValue<DOMTreeWalker,DOMObject>(exec,p,&DOMTreeWalkerTable,this);
}
Value DOMTreeWalker::getValueProperty(ExecState *exec, int token) const
}
}
-void DOMTreeWalker::tryPut(ExecState *exec, const Identifier &propertyName,
+void DOMTreeWalker::put(ExecState *exec, const Identifier &propertyName,
const Value& value, int attr)
{
if (propertyName == "currentNode") {
ObjectImp::put(exec, propertyName, value, attr);
}
-Value DOMTreeWalkerProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &)
+Value DOMTreeWalkerProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
{
if (!thisObj.inherits(&KJS::DOMTreeWalker::info)) {
Object err = Error::create(exec,TypeError);
public:
DOMNodeIterator(ExecState *exec, DOM::NodeIteratorImpl *ni);
~DOMNodeIterator();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
class NodeFilterConstructor : public DOMObject {
public:
NodeFilterConstructor(ExecState *) { }
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
public:
DOMTreeWalker(ExecState *exec, DOM::TreeWalkerImpl *tw);
~DOMTreeWalker();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName,
+ virtual void put(ExecState *exec, const Identifier &propertyName,
const Value& value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-Value DOMAbstractView::tryGet(ExecState *exec, const Identifier &p) const
+Value DOMAbstractView::get(ExecState *exec, const Identifier &p) const
{
if (p == "document")
return getDOMNode(exec, m_impl->document());
else if (p == "getComputedStyle")
return lookupOrCreateFunction<DOMAbstractViewFunc>(exec,p,this,DOMAbstractView::GetComputedStyle,2,DontDelete|Function);
- return DOMObject::tryGet(exec, p);
+ return DOMObject::get(exec, p);
}
-Value DOMAbstractViewFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value DOMAbstractViewFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&DOMAbstractView::info)) {
Object err = Error::create(exec,TypeError);
public:
DOMAbstractView(ExecState *, DOM::AbstractViewImpl *av) : m_impl(av) { }
~DOMAbstractView();
- virtual Value tryGet(ExecState *exec,const Identifier &p) const;
+ virtual Value get(ExecState *exec,const Identifier &p) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
public:
KonquerorFunc(const Konqueror* k, const char* name)
: DOMFunction(), konqueror(k), m_name(name) { }
- virtual Value tryCall(ExecState *exec, Object &thisObj, const List &args);
+ virtual Value call(ExecState *exec, Object &thisObj, const List &args);
private:
const Konqueror* konqueror;
//kdDebug(6070) << "Window " << this << " (part=" << m_part << ")::setCurrentEvent m_evt=" << evt << endl;
}
-Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value WindowFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&Window::info)) {
Object err = Error::create(exec,TypeError);
return m_part->url().prettyURL();
}
-Value LocationFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value LocationFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&Location::info)) {
Object err = Error::create(exec,TypeError);
return UString(m_part->selection().toRange()->toString(exception));
}
-Value SelectionFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value SelectionFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&Selection::info)) {
Object err = Error::create(exec,TypeError);
return "[object History]";
}
-Value HistoryFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value HistoryFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&History::info)) {
Object err = Error::create(exec,TypeError);
return /*Function*/( new KonquerorFunc(this, p.qstring().latin1() ) );
}
-Value KonquerorFunc::tryCall(ExecState *exec, Object &, const List &args)
+Value KonquerorFunc::call(ExecState *exec, Object &, const List &args)
{
KParts::BrowserExtension *ext = konqueror->part->browserExtension();
@end
*/
-Value XMLHttpRequest::tryGet(ExecState *exec, const Identifier &propertyName) const
+Value XMLHttpRequest::get(ExecState *exec, const Identifier &propertyName) const
{
- return DOMObjectLookupGetValue<XMLHttpRequest,DOMObject>(exec, propertyName, &XMLHttpRequestTable, this);
+ return lookupGetValue<XMLHttpRequest,DOMObject>(exec, propertyName, &XMLHttpRequestTable, this);
}
Value XMLHttpRequest::getValueProperty(ExecState *exec, int token) const
}
}
-void XMLHttpRequest::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+void XMLHttpRequest::put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
{
- DOMObjectLookupPut<XMLHttpRequest,DOMObject>(exec, propertyName, value, attr, &XMLHttpRequestTable, this );
+ lookupPut<XMLHttpRequest,DOMObject>(exec, propertyName, value, attr, &XMLHttpRequestTable, this );
}
-void XMLHttpRequest::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+void XMLHttpRequest::putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/)
{
switch(token) {
case Onreadystatechange:
if (onLoadListener) onLoadListener->ref();
break;
default:
- kdWarning() << "HTMLDocument::putValue unhandled token " << token << endl;
+ kdWarning() << "HTMLDocument::putValueProperty unhandled token " << token << endl;
}
}
QPtrDictIterator<XMLHttpRequest>(*requests).current()->abort();
}
-Value XMLHttpRequestProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value XMLHttpRequestProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&XMLHttpRequest::info)) {
Object err = Error::create(exec,TypeError);
public:
XMLHttpRequest(ExecState *, DOM::DocumentImpl *d);
~XMLHttpRequest();
- virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
- virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, const Value& value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual void mark();
setPrototype(XMLSerializerProto::self(exec));
}
-Value XMLSerializerProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+Value XMLSerializerProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&XMLSerializer::info)) {
Object err = Error::create(exec,TypeError);