[Webkit-unassigned] [Bug 50125] New: can't define value getter on input element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Nov 27 09:37:41 PST 2010


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

           Summary: can't define value getter on input element
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.6
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: amwebdk at gmail.com


Created an attachment (id=74962)
 --> (https://bugs.webkit.org/attachment.cgi?id=74962&action=review)
testcase

I all browser, except Safari Webkit, i am able to manipulate the input.value with __defineGetter__.

There is no error, the function there is set in defineGetter will just never run.

Test case:
_______________________________________
<input type="text" value="2" id="input">

<script type="text/javascript">

    var input = document.getElementById('input');

        input.__defineGetter__('value', function () {
            return parseInt(this.getAttribute('value')) * 2;
        });

        console.log(input.value);

        if (input.value == 4) {
            input.style.background = "#0F0";
        } else {
            input.style.background = "#F00";
        }
</script>
_______________________________________

In this testcase safari webkit return 2, in all other browsers it return 4.

-- 
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