Heydon / REVENGE.CSS

A CSS bookmarklet that puts pink error boxes (with messages in comic sans) everywhere you write bad HTML.
834 stars 57 forks source link

Revert "Clarify the keyboard focus warning" #9

Open Heydon opened 10 years ago

Heydon commented 10 years ago

Reverts Heydon/REVENGE.CSS#7

Heydon commented 10 years ago

I think you're onto something here. However, ([tabindex]) should probably be concatenated with :not([tabindex="-1"]) ?

denis-sokolov commented 10 years ago

Well, that would be a further improvement to my change. I wouldn't go as far as to revert it. Perhaps even have a separate rule:

button[tabindex="-1"], a[tabindex="-1"], .btn[tabindex="-1"], .button[tabindex="-1"], input[tabindex="-1"] {
}

P.S. Mention a developer to invite him to join a discussion. I got to know about this pull request by accident.

Heydon commented 10 years ago

@denis-sokolov like this? Yeah, sorry :-)

The trouble is tabindex="-1" is focusable programmatically. In some ARIA widgets, -1 on links or buttons is necessary for turning tabbing off before adding custom key controls like arrow keys (?)

denis-sokolov commented 10 years ago

Well, then just leave it as it is. If somebody has explicitly chosen to add tabindex="-1", I don't think they need a warning about the element being unfocusable.