[Webkit-unassigned] [Bug 36423] Object.defineProperty cannot be used to set id of Div element, Element/HTMLDivElement prototype

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 29 16:53:01 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=36423


Ken Jackson <wkenjackson at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wkenjackson at gmail.com




--- Comment #7 from Ken Jackson <wkenjackson at gmail.com>  2012-05-29 16:53:00 PST ---
I've had similar problems in trying to define a getter for the 'src' attribute of DOM img elements without using prototypes.  Many DOM elements have property descriptors where configurable is set to false in webkit/JSC.

Note that in Safari 5.1.6, the 3rd test from comment #1:

> // Override the property on a DIV element
> // PASS: IE8, IE9, FF3.7
> // FAIL: WebKit
> try {
>    Object.defineProperty(el,"id",{ get:function () { return "c"; } });
>    alert(el.id==="c" ? "PASS" : "FAIL");
> } catch (e) {
>    alert("ERROR: "+e.message);
> }

fails and displays an alert "ERROR: Attempting to change access mechanism for an unconfigurable property" and this test does not use the prototype chain.

This test passes in IE8, IE9, FF3.7 and Chrome 19.0.1084.52.

Object.getOwnPropertyDescriptor(el, 'id').configurable returns false in Safari 5.1.6 for this test but returns true in other browsers.   It would be nice if webkit/JSC behaved in a manner that was consistent with other browsers.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list