Closed Bug 996364 Opened 10 years ago Closed 10 years ago

Calling CustomizableUI.registerArea a second time for the same area will throw an exception

Categories

(Firefox :: Toolbars and Customization, defect)

defect
Not set
normal

Tracking

()

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

People

(Reporter: mossop, Assigned: jaws)

References

Details

(Whiteboard: [Australis:P3-])

Attachments

(1 file)

http://hg.mozilla.org/mozilla-central/annotate/265d82091bce/browser/components/customizableui/src/CustomizableUI.jsm#l314

The first time through defaultCollapsed is set to true then stored in gAreas. The second time that setting is retrieved from gAreas then we hit this if statement which makes us throw if aInternalCaller is false. You probably want to only throw if defaultCollapsed was passed in aProperties here.
Flags: needinfo?(gijskruitbosch+bugs)
Yes.
Blocks: 966599
Flags: needinfo?(gijskruitbosch+bugs)
Whiteboard: [Australis:P3-]
(I'm a little surprised this didn't get caught by automated testing... we should make sure we do write such a test now; it'll be pretty trivial)
Jared, feel free to steal, but otherwise I will probably pick this up my morning.
Assignee: nobody → gijskruitbosch+bugs
Assignee: gijskruitbosch+bugs → jaws
Status: NEW → ASSIGNED
Summary: Calling CustomiableUI.registerArea a second time for the same area with throw an exception → Calling CustomizableUI.registerArea a second time for the same area with throw an exception
Summary: Calling CustomizableUI.registerArea a second time for the same area with throw an exception → Calling CustomizableUI.registerArea a second time for the same area will throw an exception
Attached patch PatchSplinter Review
Attachment #8407050 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 8407050 [details] [diff] [review]
Patch

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

Drive by - this looks pretty good to me. Nice tests.

I'm curious to know - what happens if "overflowable" or "legacy", or any of the other registerArea object properties change from one registration to the other?
Comment on attachment 8407050 [details] [diff] [review]
Patch

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

r=me, although mconley makes a good point. Up to you whether you want to take care of this here or in a followup.
Attachment #8407050 - Flags: review?(gijskruitbosch+bugs) → review+
https://hg.mozilla.org/integration/fx-team/rev/b1470828166b

I'll file a separate bug for the things that mconley mentioned.
Flags: in-testsuite+
Whiteboard: [Australis:P3-] → [Australis:P3-][fixed-in-fx-team]
(In reply to :Gijs Kruitbosch from comment #6)
> Comment on attachment 8407050 [details] [diff] [review]
> Patch
> 
> Review of attachment 8407050 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> r=me, although mconley makes a good point. Up to you whether you want to
> take care of this here or in a followup.

Filed bug 996899 for this.
https://hg.mozilla.org/mozilla-central/rev/b1470828166b
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 8407050 [details] [diff] [review]
Patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 966599
User impact if declined: add-ons that call CustomizableUI.registerArea twice may behave unexpectedly
Testing completed (on m-c, etc.): locally, on m-c, and in automated tests
Risk to taking this patch (and alternatives if risky): none expected, may potentially fix addons that behave unexpectedly upon upgrade
String or IDL/UUID changes made by this patch: none
Attachment #8407050 - Flags: approval-mozilla-aurora?
Attachment #8407050 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: