Bug 12721

Summary: getter/setter does not follow the behavior of Firefox
Product: WebKit Reporter: Feng Qian <ian.eng.webkit>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, barraclough, bedney, feng, joker806, t.brain
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
test case none

Feng Qian
Reported 2007-02-09 15:53:21 PST
Case: window.screen.__defineGetter__("width", function(){return "foo";}); Firefox allows defining a getter on a readonly property, WebKit ignores it.
Attachments
test case (521 bytes, text/html)
2007-02-10 10:29 PST, Alexey Proskuryakov
no flags
Alexey Proskuryakov
Comment 1 2007-02-10 10:29:12 PST
Created attachment 13106 [details] test case
Alexey Proskuryakov
Comment 2 2009-06-04 04:10:27 PDT
See also: bug 18737.
Alexey Proskuryakov
Comment 3 2009-06-04 04:10:37 PDT
*** Bug 26127 has been marked as a duplicate of this bug. ***
T. Brains
Comment 4 2009-06-04 06:52:35 PDT
(In reply to comment #3) > *** Bug 26127 has been marked as a duplicate of this bug. *** As I described under bug 26127, this isn't limited to "read-only" properties as described here, but rather getters and setters on any native DOM property. And this contradicts the behavior of Firefox, IE8 and even Chrome.
William J. Edney
Comment 5 2010-02-03 17:26:08 PST
I've confirmed this behavior as well. Any fix to this would be most welcome! :-) Cheers, - Bill
Gavin Barraclough
Comment 6 2012-03-07 18:21:24 PST
The behaviour of __defineGetter__ is correct here, we should not be able to redefine non-configurable properties. The problem is likely that these properties are directly on the instance of the object, rather than accessors on the prototype. Per WebIDL, this is a bug in our implementation. *** This bug has been marked as a duplicate of bug 49739 ***
Note You need to log in before you can comment on or make changes to this bug.