Closed Bug 995161 Opened 10 years ago Closed 10 years ago

Customize mode can still break after bootstrapped add-on with custom legacy:true toolbar restarts

Categories

(Firefox :: Toolbars and Customization, defect)

29 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 31
Tracking Status
firefox29 --- fixed
firefox30 --- fixed
firefox31 --- fixed

People

(Reporter: quicksaver, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [Australis:P3])

Attachments

(1 file)

Can still reproduce bug 989609 if registering the testBar as legacy:true, as in step 2:
> CustomizableUI.registerArea('testBar', 
>   { type: CustomizableUI.TYPE_TOOLBAR, legacy: true }
> );
Blocks: australis-addonfixes
No longer blocks: australis-addons
Whiteboard: [Australis:P3]
STR cripped from bug 989609, and tweaked to use legacy: true.

1. Open clean firefox profile

2. Enter this bit in the browser console to create a normal customizable toolbar under the nav-bar:
> var testBar = document.createElement('toolbar');
> testBar.id = 'testBar';
> testBar.setAttribute('toolbarname', 'Test Bar');
> testBar.hidden = false;
> testBar.collapsed = false;
> testBar.setAttribute('class', 'toolbar-primary chromeclass-toolbar');
> testBar.setAttribute('context', 'toolbar-context-menu');
> testBar.setAttribute('customizable', 'true');
> CustomizableUI.registerArea('testBar', 
>   { type: CustomizableUI.TYPE_TOOLBAR, legacy: true }
> );
> gNavToolbox.appendChild(testBar);

3. Enter customize mode. Our testBar works perfectly fine, add a couple of widgets to it to compare afterwards.
3.1 Close customize mode.

4. Enter this bit in the browser console to clean and remove our testBar:
> CustomizableUI.unregisterArea('testBar');
> testBar.remove();
> testBar = null;

5. Enter customize mode. Everything seems fine, the widgets that were added to the testBar in step 3 went back to the palette as expected.
5.1 Close customize mode.

6. Re-do step 2 to re-add the testBar. Everything seems fine, the widgets moved in step 3 were automatically re-added to the testBar.

7. Enter customize mode. The testBar and the palette are now empty! This appears in the console:

> "[CustomizeMode]" TypeError: realNode is null
> Stack trace:
> get_currentSet@chrome://browser/content/customizableui/toolbar.xml:165:1
> CustomizableUIInternal.inDefaultState@resource://app/modules/CustomizableUI.jsm:2368:1
> this.CustomizableUI.inDefaultState@resource://app/modules/CustomizableUI.jsm:3146:5
> CustomizeMode.prototype._updateResetButton@resource://app/modules/CustomizeMode.jsm:1163:5
> CustomizeMode.prototype.enter/<@resource://app/modules/CustomizeMode.jsm:277:7
> [...]
I'll see what I can do about this.
Assignee: nobody → mconley
Status: NEW → ASSIGNED
Attached patch Patch v1Splinter Review
Seems to do the job, but I have no idea if this is the right choice. CustomizableUI is an extraordinary machine.

Blair / Gijs, I'll let you two race to tell me whether or not this is advisable, or hair-brained. :)
Attachment #8405556 - Flags: review?(gijskruitbosch+bugs)
Attachment #8405556 - Flags: review?(bmcbride)
Comment on attachment 8405556 [details] [diff] [review]
Patch v1

Review of attachment 8405556 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Attachment #8405556 - Flags: review?(gijskruitbosch+bugs)
Attachment #8405556 - Flags: review?(bmcbride)
Attachment #8405556 - Flags: review+
Thanks!

remote:   https://hg.mozilla.org/integration/fx-team/rev/93dceafcb1e6
Whiteboard: [Australis:P3] → [Australis:P3][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/93dceafcb1e6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [Australis:P3][fixed-in-fx-team] → [Australis:P3]
Target Milestone: --- → Firefox 31
Comment on attachment 8405556 [details] [diff] [review]
Patch v1

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Australis
User impact if declined: legacy toolbars and bootstrapped add-ons can cause customize mode to break
Testing completed (on m-c, etc.): on m-c
Risk to taking this patch (and alternatives if risky): very low - small update from the other patch (for non-legacy toolbars) and has an automated test (which was updated for this change)
String or IDL/UUID changes made by this patch: none
Attachment #8405556 - Flags: approval-mozilla-beta?
Attachment #8405556 - Flags: approval-mozilla-aurora?
Attachment #8405556 - Flags: approval-mozilla-beta?
Attachment #8405556 - Flags: approval-mozilla-beta+
Attachment #8405556 - Flags: approval-mozilla-aurora?
Attachment #8405556 - Flags: approval-mozilla-aurora+
Is testing for this fully covered automatically? Is there any need for manually testing this?
Flags: needinfo?(mconley)
Flags: in-testsuite?
(In reply to Florin Mezei, QA [:FlorinMezei] from comment #9)
> Is testing for this fully covered automatically? Is there any need for
> manually testing this?

The automated test handles this, so I think we're all good. Thanks. :)
Flags: needinfo?(mconley)
Flags: in-testsuite?
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: