Side navigation
#10809 closed bug (fixed)
Opened November 17, 2011 12:30AM UTC
Closed May 28, 2012 04:58PM UTC
Last modified May 29, 2012 12:07AM UTC
incorrect test using ".activeElement" in the :focus pseudo-class resolver
Reported by: | diego.perini@gmail.com | Owned by: | timmywil |
---|---|---|---|
Priority: | low | Milestone: | 1.8 |
Component: | selector | Version: | 1.6.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The "document.activeElement" does not completely reflect a "focussed" element in every situation/environment.
Newer browser have a "document.hasFocus()" method to make sure a given document contains the currently "focussed" element.
There can only be one focussed element in the browser. So the "focus" is bound to the current editing view.
So if you are typing in a text box in one window, that element is both "active" and "focussed". As soon as you switch window and you type in a different text box the previous element is still "active" but not "focussed".
Use the ".activeElement" property to provide support for the CSS2 ":active" pseudo-class which is currently missing. Just rename current "focus" method to "active" and add a new "focus" method that considers newer browsers implementing the ".hasFocus()" method.
Diego
Attachments (0)
Change History (4)
Changed November 17, 2011 01:02AM UTC by comment:1
component: | unfiled → selector |
---|---|
milestone: | None → 1.8 |
owner: | → timmywil |
priority: | undecided → low |
status: | new → assigned |
Changed May 28, 2012 04:57PM UTC by comment:2
Changed May 28, 2012 04:58PM UTC by comment:3
resolution: | → fixed |
---|---|
status: | assigned → closed |
I probably should have filed a ticket for this myself. I have this change on my list for the Sizzle revamp in 1.8. Thanks for filing Diego.
If it's a major concern, we can push this ahead to 1.7.x, but imo, I don't think that's necessary.