Closed Bug 377038 Opened 17 years ago Closed 17 years ago

XUL tabIndex property should return 0 when tabindex attribute isn't specified

Categories

(Toolkit :: UI Widgets, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: enndeakin, Assigned: enndeakin)

Details

Attachments

(2 files)

Currently NaN is returned when the tabindex attribute isn't specified
Attachment #261143 - Flags: first-review?(neil)
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Comment on attachment 261143 [details] [diff] [review]
return 0 instead of NaN

I'm not convinced. In XUL, a tabIndex, even 0 or -1, overrides -moz-user-focus.

Nit: use parseInt(foo) || 0
Attachment #261143 - Flags: first-review?(neil)
Well, NaN isn't a valid return value for a method that returns an integer, so it needs to be changed to return something.

The tabIndex property only overrides if the tabindex attribute on an element is specified. If the attribute is unspecified, the tabIndex property is never checked, so it can just return 0.

Comment on attachment 261143 [details] [diff] [review]
return 0 instead of NaN

OK, r=me if you use || 0 instead.
Attachment #261143 - Flags: first-review+
Bug 377253 contains an automated testcase for this.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: