Closed Bug 1226887 Opened 9 years ago Closed 8 years ago

No tooltips for allocation sites

Categories

(DevTools :: Memory, defect, P3)

defect

Tracking

(firefox47 fixed)

RESOLVED FIXED
Firefox 47
Tracking Status
firefox47 --- fixed

People

(Reporter: jsantell, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

(Whiteboard: [polish-backlog][difficulty=easy])

Attachments

(2 files)

In the profiler, when mousing over a location, the tooltip contains the function name as well as the full path to the source, as we only display the function name, filename and host. Right now, the `frame` component sets a `title` attr on the debugger link, but this isn't working.

STR:
* Turn on allocations and take a snapshot
* view by allocation site breakdown
* hover over one of the links to the debugger

ER: Should display a tooltip with full filename
AR: No tooltip.
Has STR: --- → yes
Whiteboard: [polish-backlog][difficulty=easy]
memory.xhtml is the only xhtml file used in definitions.js. Other tooltips from .xhtml files work because the embedding iframe has |tooltip="aHTMLTooltip"|, e.g. bug 1237556.
The iframes the tools live in also have the tooltip=aHTMLTooltip attribute, but the elements with a `title` attribute still don't display, hmm
Priority: -- → P3
Neil, :ntim tells me you may understand why `title="foo bar baz"` tooltips may or may not be showing up in different windows/iframes. Any idea what might be going on here, or why the `tooltip="aHTMLTooltip"` thing did not work for us in this case?

Thanks!
Flags: needinfo?(enndeakin)
(In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #3)
> Neil, :ntim tells me you may understand why `title="foo bar baz"` tooltips
> may or may not be showing up in different windows/iframes. Any idea what
> might be going on here, or why the `tooltip="aHTMLTooltip"` thing did not
> work for us in this case?

Could this be bug 248862?
Using tooltip=aHTMLTooltip simply means we should rely on the XUL tooltip with id "aHTMLTooltip".

This XUL tooltip is either declared in a XUL file, or created dynamically (see https://dxr.mozilla.org/mozilla-central/source/devtools/client/framework/sidebar.js#256 for instance).

When loading the memory profiler, no <tooltip id="aHTMLTooltip"> is created/available, therefore no tooltip is displayed. For the sake of testing, adding a hardcoded <tooltip id="aHTMLTooltip"> to toolbox.xul will enable tooltips in the memory profiler.
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
@bgrins : flagged you for review as you have the highest "score" on toolbox.xul edits.

Bug 1226887 - add aHTMLTooltip in toolbox.xul;r=bgrins

In order for tooltips to work in XHTML documents embedded in XUL documents,
the parent XUL document needs to have a <tooltip> element which can be
used to display the title.

In the devtools, a tooltip element with id "aHTMLTooltip" is usually created
for this. For the memory profiler, the embedding XUL document is toolbox.xul.
This commit adds a tooltip element with id aHTMLTooltip.

try : https://treeherder.mozilla.org/#/jobs?repo=try&revision=c775de590373
Attachment #8711472 - Flags: review?(bgrinstead)
Comment on attachment 8711472 [details] [diff] [review]
bug1226887.v1.patch

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

OK, this fixes the problem for me.  Good find!  I notice we also have a <tooltip id="aHTMLTooltip" page="true"/> in webconsole.xul.  I couldn't figure out why at first but it looks like that's needed to get the title attribute to work on XHTML elements inside of the xul doc
Attachment #8711472 - Flags: review?(bgrinstead) → review+
Thanks for the review !

> I couldn't figure out why at first but it looks like that's needed to get the title attribute 
> to work on XHTML elements inside of the xul doc

From what I tested, you need to have the XUL tooltip element in the parent of the XHTML document. That's why having a <tooltip> in toolbox.xul is not enough to ensure we will always have tooltips everywhere : it only works for XHTML documents that are directly embedded in toolbox.xul.

FWIW, we also create <tooltip> elements dynamically in sidebar.js, for similar reasons.
Generally, for displaying tooltips in web pages, you need:

<browser src="..." tooltip="someTooltip"/>

<tooltip id="someTooltip" page="true"/>

The tooltip attribute on the browser indicates that this element wants the mouseover/mousemove event handling that causes the tooltip with that id to appear. It doesn't have to be browser; any element with a tooltip attribute will work, but it naturally will only handle tooltips on children of that element.

The page attribute on the tooltip indicates that you want the analysis done to find and fill in the text of the tooltip from the node the mouse is over. This will handle titles from html/xhtml/svg. Without the page attribute, the tooltip displays whatever you put as children of the tooltip node instead.
Flags: needinfo?(enndeakin)
https://hg.mozilla.org/mozilla-central/rev/f7479f781e02
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: