Closed Bug 403162 Opened 18 years ago Closed 18 years ago

[FIX]"Error: this._handleClick is not a function" closing Firefox tabs by clicking close button

Categories

(Core :: XBL, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9beta2

People

(Reporter: philor, Assigned: bzbarsky)

References

Details

(Keywords: regression)

Attachments

(3 files)

Error: this._handleClick is not a function Source File: chrome://global/content/bindings/button.xml Line: 140 STR: 1. In a new profile (which should mean you have two tabs open, firstrun and default home page), go to about:config in one tab, and toggle javascript.options.showInConsole to true 2. Open the error console 3. Close the other tab by clicking the close button on the tab Regression from bug 282180, which may have baked in SeaMonkey for 3 years, but apparently didn't consider things like http://mxr.mozilla.org/mozilla/source/browser/base/content/tabbrowser.xml#3010 (which I'm just guessing is the difference, and thus the source of the problem). So far, I haven't spotted any overt problems from the error, but then I never was very good at reproducing the "double-click closes and opens" bug that the close-button handler hacks around.
Flags: blocking1.9?
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9b2pre) Gecko/2007110905 Minefield/3.0b2pre] (nightly) (W2Ksp4) Bug confirmed, per steps. Oddly, if I use '-jsconsole' instead of step 2, I need to restart FireFox to get the error :-/
Flags: blocking1.9? → blocking1.9+
Priority: -- → P3
I'm not sure whether this is a core bug, but I've written a workaround. Basically tabbrowser-close-tab-button removes its binding parent from the DOM when it's clicked. This then tears down all its XBL methods. However its base binding's click handler still fires, and gets upset for obvious reasons.
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #288144 - Flags: review?(mano)
Comment on attachment 288144 [details] [diff] [review] Don't bother inheriting the binding r=mano.
Attachment #288144 - Flags: review?(mano) → review+
So really, we shouldn't be firing the event handler here, right? That would make the most sense to me.
So just undo what InstallEventHandlers does, I would think.
We have nsXBLBinding::UnhookEventHandlers, but it doesn't seem to be call everywhere where needed.
Does this fix it too? The steps to reproduce don't reproduce for me, even without this patch....
Attached patch Same as diff -wSplinter Review
Comment on attachment 288249 [details] [diff] [review] Possible core patch Yep, that fixes it for me.
Neil, you ok if I move this to Core and take it, or should I file a separate bug on the core change?
(In reply to comment #11) >Neil, you ok if I move this to Core and take it, or should I file a separate >bug on the core change? If I'm not going to need my patch then feel free to move this to Core.
Assignee: neil → nobody
Status: ASSIGNED → NEW
Component: XUL Widgets → XBL
Product: Toolkit → Core
QA Contact: xul.widgets → xbl
Summary: "Error: this._handleClick is not a function" closing Firefox tabs by clicking close button → [FIX]"Error: this._handleClick is not a function" closing Firefox tabs by clicking close button
Target Milestone: --- → mozilla1.9 M10
Assignee: nobody → bzbarsky
Comment on attachment 288250 [details] [diff] [review] Same as diff -w This makes unhooking mirror hookup more closely, and calls it when we tear down style bindings.
Attachment #288250 - Flags: superreview?(jonas)
Attachment #288250 - Flags: review?(jonas)
Comment on attachment 288250 [details] [diff] [review] Same as diff -w Does it really matter if we use target->RemoveGroupedEventListener or manager->RemoveEventListenerByType? I agree it's good to make install and unhook be similar so the change seems good. I'm mostly curious.
Attachment #288250 - Flags: superreview?(jonas)
Attachment #288250 - Flags: superreview+
Attachment #288250 - Flags: review?(jonas)
Attachment #288250 - Flags: review+
> Does it really matter if we use target->RemoveGroupedEventListener or > manager->RemoveEventListenerByType? I have no idea! So I figured I'd play it safe. Maybe we should remove some of these APIs.... ;) Checked the patch in. Working on tests.
Status: NEW → RESOLVED
Closed: 18 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Checked in a test for this.
Flags: in-testsuite? → in-testsuite+
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9b2pre) Gecko/2007111605 Minefield/3.0b2pre] (nightly) (W2Ksp4) V.Fixed.
Status: RESOLVED → VERIFIED
Blocks: 304933
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: