Closed Bug 678263 Opened 13 years ago Closed 13 years ago

panel.show(anchor) doesn't work, we should yank it from the docs

Categories

(Add-on SDK Graveyard :: Documentation, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: canuckistani, Assigned: wbamberg)

Details

Attachments

(1 file, 1 obsolete file)

Currently the docs for panel.show() state: 

"show(anchor)

Displays the panel.
[ anchor : handle ]

A handle to a DOM node in a page to which the panel should appear to be anchored. If not given, the panel is centered inside the most recent browser window. Note that it is not currently possible to anchor panels in this way using only the high level APIs."

The ability to anchor panels to content nodes is either unimplemented or broken ( see bug #677785 ) - if add ing / fixing the functionality isn't going to happen soon we should consider amending the docs to be something like this:

"show()

Displays the panel centered inside the most recent browser window."
I'm not sure I agree with this. panel.show is not broken, exactly, it works fine. The problem is that, by design, it's not possible to get at DOM nodes using the APIs in addon-kit. So the anchor argument is not useful to people who are using the high-level APIs (which the docs already say) - but that doesn't mean it's not useful, full stop.

Would it be helpful to be more explicit?

"show(anchor)

Displays the panel.
[ anchor : handle ]

A handle to a DOM node in a page to which the panel should appear to be anchored. If not given, the panel is centered inside the most recent browser window.

Add-ons which restrict themselves to the APIs in the [addon-kit package] can't make use of this argument, and so are not able to anchor panels to DOM nodes."
I hadn't bothered to hack out something like this and really understand what was going on:

https://builder.addons.mozilla.org/addon/1013359/revision/22/

I like the new wording better, maybe with a little more sugar:

Add-ons which restrict themselves to the APIs in the [addon-kit package] can't make use of this argument, and so are not able to anchor panels to DOM nodes without using lower-level apis."
OS: Mac OS X → All
Priority: -- → P1
Hardware: x86 → All
Target Milestone: --- → 1.1
Target Milestone: 1.1 → 1.2
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: 1.2 → ---
Assignee: nobody → wbamberg
Attachment #567213 - Flags: review?(dietrich)
Since this is a high-level API, we should not document this functionality, and should instead remove it altogether.

If we need this functionality, we should split it into an api-utils version that exposes the feature in a way that makes sense at the low-level, and a high-level version that will not break in the future.

That's the way we've done every other API, and is in line with the requirements for high-level APIs.
Attachment #567213 - Flags: review?(dietrich)
(In reply to Dietrich Ayala (:dietrich) from comment #5)
> Since this is a high-level API, we should not document this functionality,
> and should instead remove it altogether.
> 
> If we need this functionality, we should split it into an api-utils version
> that exposes the feature in a way that makes sense at the low-level, and a
> high-level version that will not break in the future.
> 
> That's the way we've done every other API, and is in line with the
> requirements for high-level APIs.

So shall I update this patch to remove any mention of the 'anchor' argument, and raise a separate bug to make the code changes you've proposed?
Attachment #567213 - Attachment is obsolete: true
Attachment #569722 - Flags: review?(dietrich)
Attachment #569722 - Flags: review?(dietrich) → review+
Thanks Dietrich!

-> https://github.com/mozilla/addon-sdk/commit/25c52e72032eebc39169dba284966551c87e6d39
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: