Closed Bug 327139 Opened 18 years ago Closed 17 years ago

uncaught exception: Unexpected error ... tabbrowser.xml :: setFocus :: line 749

Categories

(Firefox :: Tabbed Browser, defect, P4)

defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: ronny.perinke, Assigned: Gavin)

References

()

Details

(Keywords: fixed1.8.1, verified1.8.0.2)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060214 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060214 Firefox/1.5

When opening a new tab, switching to another tab or closing a tab this error occurs:

Error: uncaught exception: [Exception... "Unexpected error"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://global/content/bindings/tabbrowser.xml :: setFocus :: line 749"  data: no]

This also causes to not set the focus to a possibly give anchor in the address like http://lxr.mozilla.org/mozilla1.8/source/xpfe/global/resources/content/bindings/tabbrowser.xml#749

Reproducible: Always

Steps to Reproduce:
1. open a new tab or close another one or stich to another tab
2. click on a link with an anchor which opens in a new tab/windows


Actual Results:  
anchor not focused + above mentioned error

Expected Results:  
no error and give the anchor the focus
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → 1.5 Branch
*** Bug 326890 has been marked as a duplicate of this bug. ***
From dupe: the behaviour change is that after switching tabs, new "foreground" content doesn't have focus and you can't scroll it with keyboard. Old background tab is scrolled instead.

In fact it's almost impossible to focus current content with keyboard now, things like F6 will keep switching between background content and urlbar.
Need to either fix this on branch or back out bug 323805.  The root cause is that |window instanceof HTMLElement| throws and the "element" can actually be a window.  Should add a |element instanceof Window| check too or something.
Flags: blocking1.8.0.2?
Flags: blocking-firefox2?
Attached patch workaround (obsolete) — Splinter Review
This "fixes" the bug: (window instanceof foo) is throwing for some reason.
Comment on attachment 211869 [details] [diff] [review]
workaround (don't bail if it's a window)

Indeed.  We should get this on the branches...
Attachment #211869 - Flags: superreview+
Attachment #211869 - Flags: review?(mconnor)
Attachment #211869 - Flags: approval1.8.0.2?
Attachment #211869 - Flags: approval-branch-1.8.1?(mconnor)
Attachment #211869 - Flags: review?(mconnor)
Attachment #211869 - Flags: review+
Attachment #211869 - Flags: approval-branch-1.8.1?(mconnor)
Attachment #211869 - Flags: approval-branch-1.8.1+
Landed that patch on the 1.8 branch.
mozilla/toolkit/content/widgets/tabbrowser.xml; new revision: 1.103.2.19;
Assignee: nobody → gavin.sharp
Flags: blocking-firefox2?
Keywords: fixed1.8.1
Target Milestone: --- → Firefox1.5
*** Bug 327211 has been marked as a duplicate of this bug. ***
A variant of this issue seems to be occurring now.  I'm occasionally seeing the following upon launch of FF (I have three homepage tabs configured to open):

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.focus]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/tabbrowser.xml :: setFocus :: line 753" data: no]

NEW Profile; NO Extensions; BUILD: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060214 Firefox/1.5 ID:2006021500

Bryan
(In reply to comment #8)
> Landed that patch on the 1.8 branch.
> mozilla/toolkit/content/widgets/tabbrowser.xml; new revision: 1.103.2.19;
> 

The patch seems to work fine. :)

(In reply to comment #10)
> A variant of this issue seems to be occurring now.  I'm occasionally seeing the
> following upon launch of FF (I have three homepage tabs configured to open):
> 
> Error: uncaught exception: [Exception... "Component returned failure code:
> 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.focus]" nsresult:
> "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
> chrome://global/content/bindings/tabbrowser.xml :: setFocus :: line 753" data:
> no]
> 
> NEW Profile; NO Extensions; BUILD: Mozilla/5.0 (Windows; U; Windows NT 5.1;
> en-US; rv:1.8) Gecko/20060214 Firefox/1.5 ID:2006021500
> 
> Bryan
> 
works fine with the applied patch
(In reply to comment #11)
> works fine with the applied patch

As I stated, I'm seeing this "occasionally" with the build I listed (BUILD: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060214 Firefox/1.5 ID:2006021500).  I just downloaded Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060215 Firefox/1.5 ID:2006021514 (.zip build) and will test that.  I see the error when I first open FF if I remember correctly.

~B

Saw a variant of this bug in today's build.  This occurs when I upon launch of FF for the first time but doesn't always happen.  I have three "homepages" configured to launch in FF (three tabs load).

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.focus]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://global/content/bindings/tabbrowser.xml :: setFocus :: line 753"  data: no]

NEW Profile; NO Extensions: BUILD: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060216 Firefox/1.5 ID:2006021607

~B
Flags: blocking1.8.0.2? → blocking1.8.0.2+
Comment on attachment 211869 [details] [diff] [review]
workaround (don't bail if it's a window)

approved for 1.8.0 branch, a=dveditz for drivers
Attachment #211869 - Flags: approval1.8.0.2? → approval1.8.0.2+
Checked in on the 1.8.0 branch.
mozilla/toolkit/content/widgets/tabbrowser.xml; new revision: 1.103.2.13.2.2;
Keywords: fixed1.8.0.2
v.fixed on 1.8.0 branch with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060224 Firefox/1.5.0.1, no errors in JS console after testing various tab browsing behaviors based on comment #0.
I agree that it's fixed on the branch.  Does somebody have the authority to change the status on this bug?  Since this was never an issue in any released version, we surely don't need to wait until 1.5.0.2 is out to mark this item resolved.
Priority: -- → P4
Target Milestone: Firefox1.5 → Future
Version: 1.5.0.x Branch → Trunk
(In reply to comment #17)
> I agree that it's fixed on the branch.  Does somebody have the authority to
> change the status on this bug?  Since this was never an issue in any released
> version, we surely don't need to wait until 1.5.0.2 is out to mark this item
> resolved.

Is this not the same type of error?

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.focus]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://global/content/bindings/tabbrowser.xml :: setFocus :: line 780"  data: no]

BUILD: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060411 Firefox/2.0a1 ID:2006041202

I see this multiple times using FF and have for months!!!  I have three tabs configured to open and I get this error when the second or third tab steals focus from the first when I first launch FF.

Bryan
Blocks: 331457
QA Contact: general → tabbed.browser
gavin, see bug #348183, especially comment #9 from bryner

for the trunk and the 1.8.1 branch, the call to element.focus() is now wrapped with a try catch:

-                element.focus();
+                try {
+                  element.focus();
+                }
+                catch(ex) {
+                  dump("focus() failed, see bug #348183: ex = " + ex + "\n");
+                }
I would say this bug is fixed, not?
Gavin, can this bug be marked fixed?
Sure, fixed by bug 348183 I guess. (Sorry I missed your comment earlier)
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
(In reply to comment #19)
>for the trunk and the 1.8.1 branch, the call to element.focus() is now wrapped
>with a try catch:
>-                element.focus();
>+                try {
>+                  element.focus();
>+                }
>+                catch(ex) {
>+                  dump("focus() failed, see bug #348183: ex = " + ex + "\n");
>+                }
You should be using nsIDOMWindowUtils::focus on the trunk.
(In reply to comment #23)
> You should be using nsIDOMWindowUtils::focus on the trunk.

That was fixed in the patch for bug 323805 that you reviewed (also the patch that added nsIDOMWindowUtils.focus) :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: