Closed
Bug 1270499
Opened 10 years ago
Closed 10 years ago
Setting reflected unsigned long to out-of-range value should set to default
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla49
| Tracking | Status | |
|---|---|---|
| firefox49 | --- | fixed |
People
(Reporter: ayg, Assigned: ayg)
Details
(Whiteboard: btpp-active)
Attachments
(1 file)
|
19.17 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
data:text/html,<!DOCTYPE html>
<script>
var img = document.createElement("img");
img.width = 2147483649;
document.documentElement.textContent = img.getAttribute("width");
</script>
We output 2147483649. Chrome outputs -2147483647. IE 11 outputs 0. The spec matches IE 11:
"""
On setting, first, if the new value is in the range 0 to 2147483647, then let n be the new value, otherwise let n be the default value, or 0 if there is no default value; then, n must be converted to the shortest possible string representing the number as a valid non-negative integer and that string must be used as the new content attribute value.
"""
https://html.spec.whatwg.org/multipage/infrastructure.html#reflect
This aligns nicely with getting, where out-of-range values also map to the default value, so given that there's no interop anyway, it seems sensible to converge on this.
| Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8749179 -
Flags: review?(bzbarsky)
Comment 2•10 years ago
|
||
Comment on attachment 8749179 [details] [diff] [review]
0001-Bug-1270499-Setting-reflected-unsigned-long-to-out-o.patch
>+ if (aValue > 2147483647) {
INT32_MAX, please.
r=me with that.
Attachment #8749179 -
Flags: review?(bzbarsky) → review+
Updated•10 years ago
|
Whiteboard: btpp-active
Comment 4•10 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•