Closed Bug 996095 Opened 11 years ago Closed 11 years ago

Tabindex ignored when it's not in the int16_t range

Categories

(Core :: DOM: Core & HTML, defect)

28 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla32
Tracking Status
firefox31 --- affected
firefox32 --- verified
firefox33 --- verified
firefox34 --- verified

People

(Reporter: nicktates, Assigned: bzbarsky)

Details

(Whiteboard: [bugday-20140820])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 (Beta/Release) Build ID: 20140314220517 Steps to reproduce: Create elements (input or anchor) with a tabindex greater than 40000 and when tabbing through fields starting from the first, these elements are ignored and focus is never brought to them. See fiddle below: http://jsfiddle.net/tatesn/hVv72/ Actual results: Focus eventually ended up on the tab in the window, then moved around all elements outside the webpage, and never landed on the inputs with the large tabindex value. Expected results: As in other browsers, when tabbing from one field to the next, even if the tabindex is reasonably large, the element should receive focus when tabbed from the next lowest tabindex.
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
One issue here is in nsGenericHTMLElement::ParseAttribute: 992 if (aAttribute == nsGkAtoms::tabindex) { 993 return aResult.ParseIntWithBounds(aValue, -32768, 32767); 994 } That code has been in place since the original fix for bug 171366. But then nsFocusManager::GetNextTabIndex gets the string value of the attribute and re-parses as an integer, so the node has 32767 stored, but we're looking for a node with 40000, and we find no match.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Tabindex Ignored → Tabindex ignored when it's not in the int16_t range
Whiteboard: [need review]
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8424916 [details] [diff] [review] All 32-bit integers are valid values for tabindex; don't restrict it to the int16_t range during parsing Huh, the old limitation is odd.
Attachment #8424916 - Flags: review?(bugs) → review+
Flags: in-testsuite?
Whiteboard: [need review]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
QA Whiteboard: [good first verify]
[bugday-20140820] Reproduced on: Firefox 31.0 Verified on: Firefox 32.0 Beta 8 (20140818191513) Nightly 34.0a1 (20140820030202)
Verifying per comment 6.
Status: RESOLVED → VERIFIED
Whiteboard: [bugday-20140820]
[testday-20140912] Just for completeness, verified also on Firefox 33.0 beta 3.
Marking verified on Firefox 33 based on comment #8.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: