Last Comment Bug 301471 - XUL error pages should have 'Try Again' button focused, eliminating the need of additional Tab pressing
: XUL error pages should have 'Try Again' button focused, eliminating the need ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Document Navigation (show other bugs)
: Trunk
: All All
: -- enhancement with 1 vote (vote)
: mozilla12
Assigned To: Wesley Johnston (:wesj)
:
Mentors:
http://any-domain-that-does-not-exist...
: 333151 358485 402870 (view as bug list)
Depends on: 749218 175279 310774 311053 748787 748803
Blocks: 451250
  Show dependency treegraph
 
Reported: 2005-07-20 10:44 PDT by Sergey «Mithgol the Webmaster» Sokoloff
Modified: 2012-05-21 02:52 PDT (History)
14 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.03 KB, patch)
2005-08-17 16:16 PDT, Jesse Ruderman
no flags Details | Diff | Splinter Review
patch 2 (1.03 KB, patch)
2005-08-19 16:00 PDT, Jesse Ruderman
cbiesinger: review+
bzbarsky: superreview+
cbeard: approval1.8b4+
Details | Diff | Splinter Review
patch 3 (1.30 KB, patch)
2005-08-20 22:12 PDT, Jesse Ruderman
no flags Details | Diff | Splinter Review
Patch (1.30 KB, patch)
2012-01-17 20:48 PST, Wesley Johnston (:wesj)
bzbarsky: review+
Details | Diff | Splinter Review

Description Sergey «Mithgol the Webmaster» Sokoloff 2005-07-20 10:44:07 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+

When a XUL error page appears in Deer Park Alpha 2 (for example, Address Not
Found Error for most of domain typos), its only useful element -- the 'Try
again' button -- should be instantly focused, so that it would be possible to
reload the page with single Enter or Space key hit. It may seem useless when
dealing with Address Not Found Error, but it's a real time-saver when Net
Timeout or Document Empty (not sure about this last name) happens.

Reproducible: Always

Steps to Reproduce:
1. Follow the above given URL.
Actual Results:  
the 'Try again' button is not focused.

Expected Results:  
the 'Try again' button should have focus
Comment 1 zug_treno 2005-07-21 09:19:56 PDT
Reproducible with SeaMonkey/20050721, related to Core bug 280190?
Comment 2 Jesse Ruderman 2005-08-17 16:16:46 PDT
Created attachment 192999 [details] [diff] [review]
patch

* Works on Mac (1.8 branch).  Not tested on Windows or Linux.
* Focusing inline didn't work (too early), and onload doesn't work according to
the comment, so I used a setTimeout.
* Doesn't steal focus from other tabs.
* Doesn't steal focus from other windows, even with dom.disable_window_flip set
to false.
Comment 3 Jesse Ruderman 2005-08-18 19:44:27 PDT
* Works on Windows (trunk).  Still not tested on Linux.
* Sometimes you can see that the button isn't focused right away, at least in a
debug build.
* On Windows, you can activate the focused button with Enter or Space.  On Mac,
only Space works.
Comment 4 Christian :Biesinger (don't email me, ping me on IRC) 2005-08-19 08:21:57 PDT
> * Focusing inline didn't work (too early)

what do you mean with "too early"? Can you file a bug on that?
Comment 5 Jesse Ruderman 2005-08-19 15:55:31 PDT
Bug 232004 - Inline scripts in XHTML can't set focus (workaround: setTimeout).
Comment 6 Jesse Ruderman 2005-08-19 16:00:46 PDT
Created attachment 193222 [details] [diff] [review]
patch 2

Same patch, with a comment added.
Comment 7 Christian :Biesinger (don't email me, ping me on IRC) 2005-08-19 16:35:22 PDT
Comment on attachment 193222 [details] [diff] [review]
patch 2

oh, urg... right. ok then, r=biesi. but please remove the trailing whitespace
on the empty line you're adding.
Comment 8 Jesse Ruderman 2005-08-20 22:12:51 PDT
Created attachment 193323 [details] [diff] [review]
patch 3

More detailed comment as suggested by bz.
Comment 9 Jesse Ruderman 2005-08-20 22:19:00 PDT
Checked in, trunk and Gecko 1.8 branch.
Comment 10 Boris Zbarsky [:bz] (TPAC) 2005-10-02 09:46:57 PDT
This caused regression bug 310774
Comment 11 Jesse Ruderman 2005-10-03 12:38:02 PDT
Backed out, trunk and Gecko 1.8 branch, due to a regression (bug 310774). Reopening.
Comment 12 Jesse Ruderman 2005-10-05 11:57:20 PDT
The regression was due to bug 311053.  One possible workaround is to turn the
<xul:button> in netError.xhtml into an <html:button>, but that would change its
appearance, especially on Mac OS X.

The right way to fix this is to fix bug 311053 and then re-apply the patch in
this bug.
Comment 13 :Gavin Sharp [email: gavin@gavinsharp.com] 2006-04-07 11:28:22 PDT
*** Bug 333151 has been marked as a duplicate of this bug. ***
Comment 14 Ria Klaassen (not reading all bugmail) 2006-10-28 04:10:48 PDT
*** Bug 358485 has been marked as a duplicate of this bug. ***
Comment 15 Jesse Ruderman 2007-11-07 10:03:32 PST
*** Bug 402870 has been marked as a duplicate of this bug. ***
Comment 16 Jesse Ruderman 2009-08-29 23:53:37 PDT
Bug 311053 has been fixed.  Time to try again?
Comment 17 Wesley Johnston (:wesj) 2012-01-17 20:48:35 PST
Created attachment 589399 [details] [diff] [review]
Patch
Comment 18 Boris Zbarsky [:bz] (TPAC) 2012-01-17 21:06:12 PST
Comment on attachment 589399 [details] [diff] [review]
Patch

r=me.  Please test well!
Comment 20 :Ms2ger (⌚ UTC+1/+2) 2012-01-25 07:15:55 PST
https://hg.mozilla.org/mozilla-central/rev/b9fe3e1419c6
Comment 21 neil@parkwaycc.co.uk 2012-01-25 07:19:09 PST
(In reply to Jesse Ruderman from comment #16)
> Bug 311053 has been fixed.  Time to try again?
So after all that, the button got turned into an HTML button anyway ;-)
Comment 22 Jefferson 2012-05-20 21:10:16 PDT
There appears to be an unfortunate interaction between this change and iframes.

Many users apparently redirect tracking hosts to 127.0.0.1 using the Windows hosts file. Pages often make calls to these hosts using a zero width, zero height iframe. When the page loads, Firefox now scrolls the page to the location of the iframe which is both annoying and, when the iframe is not visible, incomprehensible.

Related new bug: https://bugzilla.mozilla.org/show_bug.cgi?id=751297

Focusing the Try Again button in an iframe is not especially useful because if the user cannot already see the button, it probably is not an important source of content on the page.

SuMo thread: https://support.mozilla.org/en-US/questions/892998 - many example URLs on page 2 for user who installed MVPS HOSTS file from http://winhelp2002.mvps.org/hosts.txt - my comments on this analysis: https://support.mozilla.org/en-US/questions/892998?page=3#answer-335119

It would be nice to disable autofocus="true" on the Try Again button in iframes, at least on iframes that are too small for the button to be displayed.

(Apologies for commenting on a closed bug, but I didn't see a better place to raise this.)
Comment 23 Jesse Ruderman 2012-05-21 02:52:59 PDT
Jefferson, the patch in bug 748803 should take care of that.

Note You need to log in before you can comment on or make changes to this bug.