Summary: | __lookupSetter__ and __lookupGetter__ don't work for getting native setters and getters | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Michael A. Puls II <shadow2531> | ||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED DUPLICATE | ||||||
Severity: | Normal | CC: | barraclough, joker806, webmaster | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
URL: | javascript:alert(Attr.prototype.__lookupSetter__("value")); | ||||||
Attachments: |
|
Description
Michael A. Puls II
2008-04-25 01:12:46 PDT
It doesn't work on instances either. javascript:alert(document.createAttribute("instance").__lookupGetter__("value")) That works in FF and Opera 9.5. The reason this does not work is that value is a not a getter/setter, but rather an attribute. It is an implementation detail that Firefox implements native attributes as getter/setter functions. Changing our implementation to do this would be a probable performance hit, so I can only really see doing this if there is a real world need. (In reply to comment #2) > The reason this does not work is that value is a not a getter/setter, but > rather an attribute. It is an implementation detail that Firefox implements > native attributes as getter/setter functions. Changing our implementation to > do this would be a probable performance hit, so I can only really see doing > this if there is a real world need. > Would making it work for instances be acceptable, or would that be just as much as a performance concern? Created attachment 22467 [details] Example that works in Opera 9.5 and Firefox 3, but not in Safari with latest webkit (In reply to comment #2) > so I can only really see doing > this if there is a real world need. See the source of the attachment for an example. If not, how bout just for compatibility with Firefox and Opera? Or, maybe try out the change and see how much performance is affected? (Maybe it'd be acceptable?) (In reply to comment #1) > It doesn't work on instances either. > > javascript:alert(document.createAttribute("instance").__lookupGetter__("value")) > > That works in FF and Opera 9.5. > This works in Opera 9.5+, Firefox and IE8 beta 2. javascript:alert(document.createTextNode("instance").__lookupGetter__("nodeValue")) |