Closed Bug 952294 Opened 11 years ago Closed 10 years ago

Image preview tooltips are not shown

Categories

(DevTools :: General, defect)

29 Branch
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 29

People

(Reporter: merihakar, Assigned: pbro)

References

()

Details

Attachments

(5 files, 2 obsolete files)

When hovered over, image preview tooltips are not being shown in inspector and style rule view in Firefox 29 Nightly. Hovewer they are shown in Firefox 28 Aurora.
Please provide a test URL and a screenshot showing the problem.
Flags: needinfo?(merihakar)
The mouse cursor is on the src attribute of the img element and the image tooltip is not shown.
Flags: needinfo?(merihakar)
The mouse pointer is on the url part of the background property in style view. No tooltips shown there either.
I confirm that this happens on linux and windows

Related bug #945068 ?
Status: UNCONFIRMED → NEW
Ever confirmed: true
I have realized that image preview tooltips are shown as a thin line in Linux.
Attachment #8350828 - Attachment description: No tooltips for img element → No tooltips for img element (windows)
Attachment #8350830 - Attachment description: No tooltips for css background property → No tooltips for css background property (windows)
* Tested on Win7 virtual machine: indeed, image preview tooltip is not shown at all in markup-view and rule-view/computed-view
* On Linux (Ubuntu virtual machine): same, except that a thin 1px wide line is visible
* On Mac: everthing works fine

Tested on a few different sites, so this is global.
Other types of tooltips (e.g. the color picker) seem to work fine though.

My first guess is that the tooltip is here, but has a 0px width.
Assignee: nobody → pbrosset
The tooltip widget tries to assign width/height dimensions to the XUL panels in the various setContent function, but it appears to be working a lot better (on linux at least) without these dimensions.
It works too on Mac without them.
So I think the fix for this bug is to remove any call to setSize and add a new test that ensure various tooltips have adequate dimensions when shown.
This patch simply gets rid of the unnecessary setSize(W,H) function calls to let the tooltip panels be sized by their content elements.

It also adds a test case that ensures tooltips are at least as big as their content.

Ongoing try build: https://tbpl.mozilla.org/?tree=Try&rev=9cfa5a1328fb
Attachment #8356302 - Flags: review?(mratcliffe)
Comment on attachment 8356302 [details] [diff] [review]
bug952294-image-tooltip-hidden-win-linux v1.patch

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

Looks great, just a couple of tiny nits.

r+

::: browser/devtools/inspector/test/browser_inspector_bug_952294_tooltips_dimensions.js
@@ +83,5 @@
> +    let panel = ruleView.previewTooltip.panel;
> +
> +    // Let's not test for a specific size, but instead let's make sure it's at
> +    // least as big as the preview canvas
> +    let w = panel.querySelector("canvas").width;

let canvas = panel.querySelector("canvas");
let w = canvas.width;
let h = canvas.height;

@@ +109,5 @@
> +    let panel = ruleView.previewTooltip.panel;
> +
> +    // Let's not test for a specific size, but instead let's make sure it's at
> +    // least as big as the image
> +    let imageRect = panel.getElementsByTagName("image")[0].getBoundingClientRect();

let imageRect = panel.querySelector("image").getBoundingClientRect();
Attachment #8356302 - Flags: review?(mratcliffe) → review+
Corrected the couple of problems raised by Mike.
Applied R+ since these are just Nits.
Launched a new try build: https://tbpl.mozilla.org/?tree=Try&rev=26dfd52f61c9
Attachment #8356302 - Attachment is obsolete: true
Attachment #8356534 - Flags: review+
Sorry, I just attached the wrong patch... I don't know how to HG...
So, here's the new try build: https://tbpl.mozilla.org/?tree=Try&rev=00b814ab8494
Attachment #8356534 - Attachment is obsolete: true
Attachment #8356536 - Flags: review+
Try build is green.
R+ by Mike.
Ready to check-in.
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/3639d34ce298
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/3639d34ce298
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
Tooltips looks fine in Firefox 29.0a1 (2014-01-09) on Windows 7.
Status: RESOLVED → VERIFIED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: