Closed Bug 324822 Opened 19 years ago Closed 19 years ago

fails to exit due to updateCurrentBrowser assuming that any focusable element has a blur() method, which is not the case for arbitrary XML with xlink:href set

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 323805

People

(Reporter: mozbugs, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1

 

Reproducible: Always

Steps to Reproduce:
1.Open the browser with a web page (not about:blank)
2.Load http://www.aadmm.de/en/dtdform.xml
3.Open a link from this page in a new tab & select tab
  Note - the back/forward arrows affect the first (apparently unfocussed) tab
4.Close the new tab using the close button or File -> Close Tab
5.Try to close the browser using File -> Quit
Actual Results:  
The browser will not close
The Javascript console shows - 

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMXULElement.boxObject]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://global/content/bindings/browser.xml :: get_docShell :: line 0"  data: no]


Right clicking on the tab and selecting Close Tab will not show the exception or the Quit problem.
The Browser can be closed using the close button.
Maybe related to bug 289035 or Suite bug 317820 (same error message/Close Tab)?
Attached file Testcase
1.Open testcase.
2.Click link then click back.
  (or right-click link & then close menu - this does not show the focus problem).
3.Open new tab & close (do not right-click -> Close tab).
4.Try to close browser.
(In reply to comment #2)
> Created an attachment (id=209960) [edit]
> Testcase
> 
> 1.Open testcase.
> 2.Click link then click back.
>   (or right-click link & then close menu - this does not show the focus
> problem).
> 3.Open new tab & close (do not right-click -> Close tab).
> 4.Try to close browser.
> 

Version: unspecified → 1.5 Branch
Reproducible with the attached testcase and Firefox 1.5.0.1 RC1/20060111, File > Close and Alt+F4 close Firefox as expected.
I can also reproduce on trunk after applying a fix to bug 324946.

The browser doesn't quit because (only (1) is relevant to the bug, the rest is for the curious):
1) this call fails when creating a new tab, because the focused element doesn't have a blur() method.
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/content/widgets/tabbrowser.xml&rev=1.129#656
(note that there's also a focus() call later there)
2) exception is thrown, so updateCurrentBrowser doesn't finish executing; mCurrentTab doesn't get updated
3) when you close the tab, a wrong tab (#1) is passed to removeTab(). However due to this code:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/content/widgets/tabbrowser.xml&rev=1.129#1299
the correct (#2) <browser/> is removed from the tree. So after removeTab() tab #1 and browser #2 are removed from tree
4) when you try to quit, |WindowIsClosing| in browser.js causes an exception at this line:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/base/content/browser.js&rev=1.555#5648
Because the only tab in the tab strip is the former tab #2, and the browser for that tab is no longer in the tree.

As goQuitApplication doesn't handle this exception, quit doesn't happen.
Component: General → Tabbed Browser
OS: Linux → All
QA Contact: general → tabbed.browser
Hardware: PC → All
Version: 1.5 Branch → Trunk
No duplicates found, confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Summary: Browser Fails to Quit & Focus is Confused - uncaught exception NS_ERROR_FAILURE → fails to exit due to updateCurrentBrowser assuming that any focusable element has a blur() method, which is not the case for arbitrary XML with xlink:href set

*** This bug has been marked as a duplicate of 323805 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: