Closed Bug 315653 Opened 19 years ago Closed 19 years ago

[JavaScript Console error]Components.classes['@mozilla.org/typeaheadfind;1'] has no properties

Categories

(Thunderbird :: Mail Window Front End, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sugar.waffle, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

In trunk nightly build, when the Mail account is made, and the message is done in Preview, the following messages are displayed in JavaScript Console. JavaScript Console message: Error: Components.classes['@mozilla.org/typeaheadfind;1'] has no properties Source File: chrome://global/content/bindings/browser.xml Line: 267 Bug314288 might relate. http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/toolkit/content/widgets&command=DIFF_FRAMESET&file=browser.xml&rev2=1.81&rev1=1.80 Reproducible: Always Windows XP SP1 version 1.6a1 (20051108)
When patch of Bug314288 is back out, this error is not displayed.
Assignee: mscott → masayuki
OS: Windows XP → All
Hardware: PC → All
Keywords: regression
Priority: -- → P5
Status: NEW → ASSIGNED
Component: General → Mail Window Front End
Attached patch Patch rv1.0 (obsolete) — Splinter Review
Attachment #202377 - Flags: review?(mconnor)
Comment on attachment 202377 [details] [diff] [review] Patch rv1.0 >Index: toolkit/content/widgets/browser.xml >+ var findClass = >+ Components.classes["@mozilla.org/typeaheadfind;1"]; >+ if (!findClass) >+ return null; Wouldn't the following be clearer? if (!("@mozilla.org/typeaheadfind;1" in Components.classes)) return null;
gavin: Isn't the performance worse? We use |findClass| after the code.
If you're that worried about performance, you should do that check before the call to getTabBrowser ;). Either way, I'd guess the performance difference is negligible. Also, shouldn't tabbrowser's "fastFind" getter have this check too? I guess TB doesn't use tabbrowser, but if it's worth adding for browser, it's probably worth adding for tabbrowser too. It kinda sucks to have to accomodate TB specifically not building this.
(Hmm, shouldn't TB not building satchel break attachFormFill called from onPageShow? Another bug, I guess.)
Attached patch Patch rv1.1 (obsolete) — Splinter Review
This fixes bug 314819 too.
Attachment #202377 - Attachment is obsolete: true
Attachment #202836 - Flags: review?(mconnor)
Attachment #202377 - Flags: review?(mconnor)
Comment on attachment 202836 [details] [diff] [review] Patch rv1.1 Oops. Sorry. This has a bug.
Attachment #202836 - Flags: review?(mconnor) → review-
Attached patch Patch rv1.2Splinter Review
Attachment #202836 - Attachment is obsolete: true
Attachment #202846 - Flags: review?(mconnor)
Whiteboard: [needs review mconnor]
(In reply to comment #3) >(From update of attachment 202377 [details] [diff] [review] [edit]) >>Index: toolkit/content/widgets/browser.xml > >>+ var findClass = >>+ Components.classes["@mozilla.org/typeaheadfind;1"]; >>+ if (!findClass) >>+ return null; > >Wouldn't the following be clearer? > >if (!("@mozilla.org/typeaheadfind;1" in Components.classes)) > return null; > It would also avoid a JS strict warning too, I think.
Attachment #202846 - Flags: review?(mconnor) → review+
checked-in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [needs review mconnor]
Comment on attachment 202846 [details] [diff] [review] Patch rv1.2 >Index: toolkit/content/widgets/browser.xml > <method name="updatePageReport"> > <body> > <![CDATA[ >- var n = this.parentNode; >- while (n && n.localName != "tabbrowser") >- n = n.parentNode; >+ var tabBrowser = this.getTabBrowser(); >+ if (!tabBrowser || tabBrowser.mCurrentBrowser != this) >+ return; > >- if (!n || n.mCurrentBrowser != this) return; >- > var event = document.createEvent("Events"); > event.initEvent("DOMUpdatePageReport", true, true); > n.dispatchEvent(event); s/n/tabBrowser/ (bug 330464)
Oops, sorry and thanks.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: