Closed Bug 301471 Opened 16 years ago Closed 10 years ago

XUL error pages should have 'Try Again' button focused, eliminating the need of additional Tab pressing

Categories

(Core :: DOM: Navigation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: mithgol, Assigned: wesj)

References

(Depends on 1 open bug, )

Details

Attachments

(1 file, 3 obsolete files)

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
Version: unspecified → Trunk
Reproducible with SeaMonkey/20050721, related to Core bug 280190?
Assignee: nobody → jruderman
Attached patch patch (obsolete) — Splinter Review
* 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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: General → Embedding: Docshell
Product: Firefox → Core
* 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.
Attachment #192999 - Flags: review?(cbiesinger)
> * Focusing inline didn't work (too early)

what do you mean with "too early"? Can you file a bug on that?
OS: Windows XP → All
Hardware: PC → All
Bug 232004 - Inline scripts in XHTML can't set focus (workaround: setTimeout).
Attached patch patch 2 (obsolete) — Splinter Review
Same patch, with a comment added.
Attachment #192999 - Attachment is obsolete: true
Attachment #193222 - Flags: review?(cbiesinger)
Attachment #192999 - Flags: review?(cbiesinger)
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.
Attachment #193222 - Flags: review?(cbiesinger) → review+
Attachment #193222 - Flags: superreview?(bzbarsky)
Attachment #193222 - Flags: superreview?(bzbarsky) → superreview+
Attachment #193222 - Flags: approval1.8b4?
Attachment #193222 - Flags: approval1.8b4? → approval1.8b4+
Attached patch patch 3 (obsolete) — Splinter Review
More detailed comment as suggested by bz.
Attachment #193222 - Attachment is obsolete: true
Checked in, trunk and Gecko 1.8 branch.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Keywords: fixed1.8
Depends on: 310774
This caused regression bug 310774
Backed out, trunk and Gecko 1.8 branch, due to a regression (bug 310774). Reopening.
Status: RESOLVED → REOPENED
Keywords: fixed1.8
Resolution: FIXED → ---
Depends on: 311053
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.
*** Bug 333151 has been marked as a duplicate of this bug. ***
QA Contact: general → docshell
*** Bug 358485 has been marked as a duplicate of this bug. ***
Depends on: 175279
Assignee: jruderman → nobody
Status: REOPENED → NEW
Duplicate of this bug: 402870
Blocks: 451250
Bug 311053 has been fixed.  Time to try again?
Attached patch PatchSplinter Review
Assignee: nobody → wjohnston
Attachment #193323 - Attachment is obsolete: true
Attachment #589399 - Flags: review?(bzbarsky)
Comment on attachment 589399 [details] [diff] [review]
Patch

r=me.  Please test well!
Attachment #589399 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/b9fe3e1419c6
Status: NEW → RESOLVED
Closed: 16 years ago10 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla12
(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 ;-)
Depends on: 748803
Depends on: 749218
Depends on: 748787
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.)
Jefferson, the patch in bug 748803 should take care of that.
You need to log in before you can comment on or make changes to this bug.