Closed
Bug 615728
Opened 14 years ago
Closed 12 years ago
When selecting an empty tab, autofocus on the location bar
Categories
(Firefox :: Tabbed Browser, defect)
Firefox
Tabbed Browser
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: limi, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
1.66 KB,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
2.20 KB,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
This is a follow-up bug from bug 565575, since the problem described there wasn't actually fixed. :)
To reproduce:
1. open a new tab
2. cause it to loose focus by clicking in the content area
3. start typing, or switch to a different tab and switch back
4. keyboard input is ignored
Recommendations:
* if you start typing on a blank tab when it isn't focused, focus the URL field
* if the search field or URL field is focused, retain this focus when switching back from a different tab (also related: bug 536576, a subset of this problem)
* if you switch back to a blank, unfocused tab from another tab, make sure the URL field is focused
It should never be possible to get a blank tab without focus — the easy way might be to just accept keyboard input and focus when it happens, or build logic to make sure it doesn't happen — I'll leave that decision up to you guys, they are equivalent as far as the UX goes.
Comment 1•14 years ago
|
||
(In reply to comment #0)
> It should never be possible to get a blank tab without focus — the easy way
> might be to just accept keyboard input and focus when it happens, or build
> logic to make sure it doesn't happen — I'll leave that decision up to you guys,
> they are equivalent as far as the UX goes.
You mean it should never be possible for a blank tab's Awesome Bar to loose focus, right? In the way you phrased it looks like not letting the entire tab loose focus, which is not nice.
Comment 2•14 years ago
|
||
(In reply to comment #1)
s/loose/lose/ >_>
Reporter | ||
Comment 3•14 years ago
|
||
(In reply to comment #1)
> You mean it should never be possible for a blank tab's Awesome Bar to loose
> focus, right? In the way you phrased it looks like not letting the entire tab
> loose focus, which is not nice.
No, it should respect whatever focus was there if any (ie. if you were in the search field), but if there is no focus, either accept keyboard input and autofocus the URL field when you start typing — or activate the URL field when you switch to the tab.
Will this be fixed for 3.6 ? or only for 4.0 ? :-( Sorry for posting the question here i hope there is no trouble.
Reporter | ||
Comment 5•14 years ago
|
||
(In reply to comment #4)
> Will this be fixed for 3.6 ? or only for 4.0 ? :-( Sorry for posting the
> question here i hope there is no trouble.
4.0 or later only.
Comment 6•14 years ago
|
||
The change is done in a do{...} while(false), don't know why so I didn't remove it.
Attachment #527969 -
Flags: review?(dao)
Comment 7•14 years ago
|
||
Buu-Minh made his first patch at the Stanford Open Source Bootcamp! :)
Assignee: nobody → buu-minh.ta
Status: NEW → ASSIGNED
Comment 8•14 years ago
|
||
Comment on attachment 527969 [details] [diff] [review]
Patch
This seems to lack significant parts of what this bug is asking for, e.g. "2. cause it to loose focus by clicking in the content area; 3. start typing [...]" or "if the search field [...] is focused, retain this focus when switching
back from a different tab".
Attachment #527969 -
Flags: review?(dao) → review-
Reporter | ||
Comment 9•14 years ago
|
||
(In reply to comment #8)
> Comment on attachment 527969 [details] [diff] [review]
> Patch
>
> This seems to lack significant parts of what this bug is asking for, e.g. "2.
> cause it to loose focus by clicking in the content area; 3. start typing [...]"
> or "if the search field [...] is focused, retain this focus when switching
> back from a different tab".
This does get us improved behavior, though — although there are more cases we need to solve, we don't have to solve them all at once.
Reporter | ||
Comment 10•14 years ago
|
||
Filed a follow-up to handle the remaining issues, bug 652600.
No longer blocks: 652600
Comment 11•14 years ago
|
||
Attachment #527969 -
Flags: review- → review?(dao)
Updated•14 years ago
|
Attachment #527969 -
Flags: review?(dao) → review+
Comment 12•14 years ago
|
||
Landed: http://tbpl.mozilla.org/?rev=e0110ab48587
... and backed out again because of test failures (test_bug493251.html, browser_addon_bar_shortcut.js, browser_bug427559.js, browser_bug462289.js, browser_bug565575.js).
Comment 13•13 years ago
|
||
gURLBar.focus() will also select the contents if the textbox had not been previously focused, so focusAndSelectURLBar() isn't needed for blank tabs.
Test fixes coming next.
Comment 14•13 years ago
|
||
Comment on attachment 549310 [details] [diff] [review]
updated to tip
focusAndSelectURLBar was correct... The gURLBar.focus() behavior you're seeing depends on browser.urlbar.clickSelectsAll.
Attachment #549310 -
Flags: review-
Comment 15•13 years ago
|
||
Attachment #527969 -
Attachment is obsolete: true
Attachment #549310 -
Attachment is obsolete: true
Attachment #549321 -
Flags: review?(dao)
Comment 16•13 years ago
|
||
Oops, inserted a trailing space. I removed that on my local copy of the patch.
Comment 17•13 years ago
|
||
Comment on attachment 549321 [details] [diff] [review]
patch v3
>+ // Focus the location bar if the tab is blank or, in non-fullscreen mode,
>+ // if it was previously focused for that tab.
>+ if (gURLBar && (newBrowser._urlbarFocused && !window.fullScreen ||
>+ isTabEmpty(this.mCurrentTab))) {
Can you either reword that comment or make the code match the sequence currently described? E.g.:
if (gURLBar && (isTabEmpty(this.mCurrentTab) ||
!window.fullScreen && newBrowser._urlbarFocused)) {
>- if (!window.fullScreen) {
>+ if (!window.fullScreen)
> gURLBar.focus();
>- break;
>- } else if (isTabEmpty(this.mCurrentTab)) {
>+ else
------------------------^
trailing space
Attachment #549321 -
Flags: review?(dao) → review+
Comment 18•13 years ago
|
||
Does that patch actually provide some value over the first patch? The first patch seems to result in more readable code.
Updated•13 years ago
|
Attachment #527969 -
Attachment is obsolete: false
Comment 19•12 years ago
|
||
(In reply to Dão Gottwald [:dao] from comment #18)
> Does that patch actually provide some value over the first patch? The first
> patch seems to result in more readable code.
I've become indifferent about this bug. If you have a patch in mind, feel free to write one, and I can review it.
Assignee: buu-minh.ta → nobody
Status: ASSIGNED → NEW
Comment 20•12 years ago
|
||
The new tab page now contains focusable elements for accessibility.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•