Bug Tracker

Modify

Ticket #10809 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

incorrect test using ".activeElement" in the :focus pseudo-class resolver

Reported by: diego.perini@… Owned by: timmywil
Priority: low Milestone: 1.8
Component: selector Version: 1.6.4
Keywords: Cc:
Blocking: Blocked by:

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

Change History

comment:1 Changed 2 years ago by timmywil

  • Owner set to timmywil
  • Priority changed from undecided to low
  • Status changed from new to assigned
  • Component changed from unfiled to selector
  • Milestone changed from None to 1.8

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.

comment:3 Changed 2 years ago by timmywil

  • Status changed from assigned to closed
  • Resolution set to fixed

comment:4 Changed 2 years ago by timmywil

#10569 is a duplicate of this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.