Closed
Bug 564277
Opened 16 years ago
Closed 15 years ago
Fix up focusrings in html documents
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
People
(Reporter: enndeakin, Assigned: enndeakin)
References
Details
Attachments
(1 file, 1 obsolete file)
|
38.86 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
This patch makes focusrings work the same in html elements as xul elements. Specifically:
- bug 561518, on Mac for all elements (including XUL), focus rings should actually appear on all elements when focused. This is a bug in the recent focus rings changes.
- another problem with that patch is that the -moz-focusring wasn't correct for textboxes and lists on Mac. This patch corrects that (as now all focused elements have rings)
- on Mac, buttons and other focusable elements don't focus on click, but do clear the current focus (as Safari does) <input type="text"/type="password">, <textarea> and <select> do however focus on click. Are there others that should? - on Windows, focus rings only appear once a key is used or the system setting is enabled
- focus rings always render on Linux when an element is focused.
- the special link handling of focusing but showing no focus ring still applies. It renders when the tab is switched or when navigating back.
Comment 1•16 years ago
|
||
(In reply to comment #0)
> - on Mac, buttons and other focusable elements don't focus on click, but do
> clear the current focus (as Safari does)
Do you know why Safari does that clearing thing? I don't really see the point.
| Assignee | ||
Comment 2•16 years ago
|
||
> > - on Mac, buttons and other focusable elements don't focus on click, but do
> > clear the current focus (as Safari does)
> Do you know why Safari does that clearing thing? I don't really see the point.
Nope. I didn't intentionally implement it that way though.
| Assignee | ||
Comment 3•16 years ago
|
||
(In reply to comment #1)
> (In reply to comment #0)
> > - on Mac, buttons and other focusable elements don't focus on click, but do
> > clear the current focus (as Safari does)
>
> Do you know why Safari does that clearing thing? I don't really see the point.
Ok, I see why this is used. Clicking in the content moves the caret to that spot and could start a selection if the mouse is dragged.
We could prevent this for specific elements but I'm not sure the extra complexity is worth it.
Comment 4•16 years ago
|
||
(In reply to comment #3)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > - on Mac, buttons and other focusable elements don't focus on click, but do
> > > clear the current focus (as Safari does)
> >
> > Do you know why Safari does that clearing thing? I don't really see the point.
>
> Ok, I see why this is used. Clicking in the content moves the caret to that
> spot and could start a selection if the mouse is dragged.
Ah, makes sense. Probably not worth worrying more about.
| Assignee | ||
Comment 5•16 years ago
|
||
Comment on attachment 443939 [details] [diff] [review]
patch
Builds are at https://build.mozilla.org/tryserver-builds/neil@mozilla.com-focusringshtml/
Attachment #443939 -
Flags: ui-review?(faaborg)
Comment 6•16 years ago
|
||
>- bug 561518, on Mac for all elements (including XUL), focus rings should
>actually appear on all elements when focused. This is a bug in the recent focus
>rings changes.
can you cc me on that bug
>- on Mac, buttons and other focusable elements don't focus on click, but do
>clear the current focus (as Safari does) <input type="text"/type="password">,
><textarea> and <select> do however focus on click. Are there others that
>should? - on Windows, focus rings only appear once a key is used or the system
>setting is enabled
Those are the only two that come to mind, just the different types of text areas
>(as now all focused elements have rings)
Do you mean all keyboard focused elements? If an element is focused with the mouse (aside from the text field exceptions on OS X) it shouldn't draw a ring (unless I'm missing something from 561518).
| Assignee | ||
Comment 7•16 years ago
|
||
(In reply to comment #6)
> Do you mean all keyboard focused elements? If an element is focused with the
> mouse (aside from the text field exceptions on OS X) it shouldn't draw a ring
> (unless I'm missing something from 561518).
Clicking the mouse on element doesn't change the focus on Mac (except for textboxes and lists), so naturally no ring will appear. The focus and ring will remain on the currently focused element.
Comment 8•16 years ago
|
||
(sorry about all the confusion, could find an OS X tryserver build) If I'm on maps.google.com, and I focus the text field with the mouse [ring draws around it], and then I focus the "search maps" button with the mouse [no ring draws since it is a button] does the textfield still have the ring drawn at that point? The correct behavior OS X seems to be:
-only draw the rings on items on the following items that also currently hold the focus:
-text field
-password field
-list area
| Assignee | ||
Comment 9•16 years ago
|
||
That is the issue that Markus brought up above. The patch here follows what Safari does: clicking 'Search Maps' clears the focus, but does not focus the button. Similar to what happens when clicking some other part of the page. This is so that the caret can be updated and the selection started if needed.
We could add exceptions when clicking specific elements though.
Comment 10•16 years ago
|
||
>The patch here follows what
>Safari does: clicking 'Search Maps' clears the focus, but does not focus the
>button.
Ok, that sounds ok although I guess the only issue might be if the user believes the button now has the focus (since it was last interacted with), and is surprised when they start to hit the tab key and the focus isn't where they think it is.
| Assignee | ||
Comment 11•16 years ago
|
||
Attachment #443939 -
Attachment is obsolete: true
Attachment #444421 -
Flags: review?(Olli.Pettay)
Attachment #443939 -
Flags: ui-review?(faaborg)
Comment 12•16 years ago
|
||
Comment on attachment 444421 [details] [diff] [review]
fix issue with some tests
IsLink could be in nsContentUtils.
And if we have similar code elsewhere, that could use the nsContentUtils method.
In general I don't like OSX focus behavior, but that is OS level problem I guess.
(Someone should provide reasonable working window manager for OSX)
Attachment #444421 -
Flags: review?(Olli.Pettay) → review+
Updated•16 years ago
|
blocking2.0: ? → beta1+
Comment 13•15 years ago
|
||
What's left here, kinda looks like this is ready to land?
blocking2.0: beta1+ → beta2+
| Assignee | ||
Comment 14•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Updated•7 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•