Closed Bug 970485 Opened 10 years ago Closed 10 years ago

`CustomizableUI.getWidget(id).forWindow(window).anchor` sometimes raise an exception.

Categories

(Firefox :: Toolbars and Customization, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 30
Tracking Status
firefox29 --- fixed
firefox30 --- fixed

People

(Reporter: zer0, Assigned: Gijs)

References

(Blocks 1 open bug)

Details

(Whiteboard: [Australis:P3][qa-])

Attachments

(1 file)

In some cases, `CustomizableUI.getWidget(domNode.id).forWindow(window).anchor` raises a "`aWidget` is not defined" exception.

To be more precise, asking for the anchor in this code is always working:

https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/widget.js#L456

Where if I try to move that part of code here:

https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/panel/utils.js#L136

is failing all the time. The problem seems the getter of `anchor` property.
Is CUI.getWidget(id).forWindow(window).node null, by any chance?
Flags: needinfo?(zer0)
No, the `node` returns the same `domNode` where we get the id:

    console.log(CUI.getWidget(domNode.id).forWindow(window).node === domNode) // true
    console.log(CUI.getWidget(domNode.id).forWindow(window).anchor) // ReferenceError: aWidgetId is not defined
Flags: needinfo?(zer0)
Well, that is embarrassing...
Attachment #8374184 - Flags: review?(mdeboer)
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Whiteboard: [Australis:P3]
Attachment #8374184 - Flags: review?(mdeboer) → review+
remote:   https://hg.mozilla.org/integration/fx-team/rev/4eb2df686edc
Whiteboard: [Australis:P3] → [Australis:P3][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/4eb2df686edc
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [Australis:P3][fixed-in-fx-team] → [Australis:P3]
Target Milestone: --- → Firefox 30
Comment on attachment 8374184 [details] [diff] [review]
Australis widget wrapper's anchor property for API-provided widgets causes exceptions,

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Australis
User impact if declined: add-on APIs don't work correctly
Testing completed (on m-c, etc.): local, on m-c
Risk to taking this patch (and alternatives if risky): none
String or IDL/UUID changes made by this patch: none
Attachment #8374184 - Flags: approval-mozilla-aurora?
Attachment #8374184 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [Australis:P3] → [Australis:P3][qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: