[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/khtml/ecma
From: Harri Porten <porten () kde ! org>
Date: 2004-10-17 16:31:58
Message-ID: 20041017163158.9E08B16C91 () office ! kde ! org
[Download RAW message or body]
CVS commit by porten:
support non-standard NodeList lookups by name
BUG: 90269
M +10 -1 kjs_dom.cpp 1.182
--- kdelibs/khtml/ecma/kjs_dom.cpp #1.181:1.182
@@ -624,4 +624,6 @@ Value DOMNodeList::tryCall(ExecState *ex
// Do not use thisObj here. See HTMLCollection.
UString s = args[0].toString(exec);
+
+ // index-based lookup?
bool ok;
unsigned int u = s.toULong(&ok);
@@ -629,5 +631,12 @@ Value DOMNodeList::tryCall(ExecState *ex
return getDOMNode(exec,list.item(u));
- kdDebug(6070) << "WARNING: KJS::DOMNodeList::tryCall " << s.qstring() << " not implemented" << endl;
+ // try lookup by name
+ // ### NodeList::namedItem() would be cool to have
+ // ### do we need to support the same two arg overload as in HTMLCollection?
+ Value result = tryGet(exec, Identifier(s));
+
+ if (result.isValid())
+ return result;
+
return Undefined();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic