[Webkit-unassigned] [Bug 44886] New: Reflected attribute input.size wraps on negative values (Chrome), or returns them (Safari)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Aug 30 12:24:43 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=44886
Summary: Reflected attribute input.size wraps on negative
values (Chrome), or returns them (Safari)
Product: WebKit
Version: 528+ (Nightly build)
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: Minor
Priority: P2
Component: HTML DOM
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: Simetrical+webkit at gmail.com
Test case:
<!doctype html>
<script>
var el = document.createElement("input");
el.setAttribute("size", "-1");
alert(el.size);
</script>
Chrome dev on Ubuntu alerts 4294967295, Safari 5 on XP alerts -1, IE8 alerts 20, Opera 10.60 alerts -1, recent Firefox nightly alerts 0. The winner per the spec is Firefox:
"""
If a reflecting IDL attribute is an unsigned integer type (unsigned long) then, on getting, the content attribute must be parsed according to the rules for parsing non-negative integers, and if that is successful, and the value is in the range of the IDL attribute's type, the resulting value must be returned. If, on the other hand, it fails or returns an out of range value, or if the attribute is absent, the default value must be returned instead, or 0 if there is no default value.
"""
http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflecting-content-attributes-in-idl-attributes
There is no default value specified, so since parsing as a non-negative integer fails, it should return 0. Both Chrome and Safari need to change here -- should I file separate bugs for both of them, or is this one fine by itself?
--
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