NEW 106522
[JSC] Author script cannot override HTMLCollection’s methods
https://bugs.webkit.org/show_bug.cgi?id=106522
Summary [JSC] Author script cannot override HTMLCollection’s methods
Ryosuke Niwa
Reported 2013-01-09 20:03:55 PST
Say collection is a HTMLCollection, then: collection.namedItem = 10; alert(collection.namedItem === 10); alerts false because collection.namedItem is still the builtin method.
Attachments
Radar WebKit Bug Importer
Comment 1 2013-01-09 20:04:44 PST
Ryosuke Niwa
Comment 2 2013-01-11 20:49:19 PST
Turned out this isn't as trivial as I had hoped it to be. The trickiness comes from the fact JSHTMLCollection's subclasses have their own name getter implementations. Because of this, we can't call Base::getOwnPropertySlot in JSHTMLCollection's subclasses because that'll end up invoking JSHTMLCollection's name getter implementation. Discussing the issue with Gavin and Filip, we came up a solution like this: 1. Add a virtual method like postGetOwnPropertySlot, which deals with name getters and remove the name getter code from getOwnPropertySlot. 2. get() will, in addition to going through getOwnPropertySlot, will call postGetOwnPropertySlot at the very end if earlier calls to getOwnPropertySlot had not returned a value.
Note You need to log in before you can comment on or make changes to this bug.