Bug 85225
| Summary: | getSelection().getRangeAt(9223372036854775811) returns getRangeAt(0) | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | arv, ayg, ojan |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ryosuke Niwa
It appears that we treat really large number index as 0 :(
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Erik Arvidsson
This is the correct behavior.
Range getRangeAt(in long index)
According to the spec, http://www.w3.org/TR/WebIDL/#es-long, we should do a ToInt32 and since ToInt32(9223372036854775811) is 0 we are doing the right thing.
PS.
ToInt32 can be written as
function toInt32(x) {
return x | 0;
}
Ryosuke Niwa
Okay. Good to know.