Closed Bug 947144 Opened 11 years ago Closed 5 years ago

Inspection bubble panel is sometimes misplaced

Categories

(DevTools :: Debugger, defect, P3)

x86_64
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: past, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Attached image bubble-gone-awry.png
The inspection bubble can sometimes appear very far from the identifier. It probably happens when showing the panel above the identifier can't fit on the screen. See the attached screenshot. Maybe we should switch the panel attachment if the identifier is on the top half part of the editor.
(In reply to Panos Astithas [:past] from comment #0)
> the screen. See the attached screenshot. Maybe we should switch the panel
> attachment if the identifier is on the top half part of the editor.

...in the detached toolbox (or sidebar) case. The toolbox-on-the-bottom case should probably never face this issue.
(In reply to Panos Astithas [:past] from comment #0)
> Created attachment 8343676 [details]
> bubble-gone-awry.png
> 

> Maybe we should switch the panel attachment if the identifier is on the top half part of the editor.

What if the toolbox window is at the bottom of the screen, and the popup height is larger than the window? :)

Granted, maybe this isn't going to be too common, but the <xul:panel> should be smart enough to handle such scenarios by itself, so this is a XUL bug. Nobody looks at panel bugs though, so I'm ok with hacky solutions like you suggested.
Agreed that this should be the automatic behavior of the panel, but perhaps we are obstructing it by specifying before_start position? Maybe using flip="both" can do what we want?

https://developer.mozilla.org/en-US/docs/XUL/panel#Attributes
If this popup has a proper and valid anchor node, you can simply do .moveTo(-1, -1) to realign it to its anchor. If the popup is opened via openPopupAt, then if the size changes, then sometimes you are out of luck to put it at proper places :)
(Trust me, I have played with this issue for the css autocomplete feature in style editor)

Also, the current popup does not play well when the zoom level is not default.
OK, so flip="both" doesn't seem to work, but I'm attaching the change anyway.
Assignee: nobody → past
Status: NEW → ASSIGNED
No time to look at this right now.
Assignee: past → nobody
Status: ASSIGNED → NEW
Priority: -- → P3
Was this fixed by bug 957187?
(In reply to Victor Porof [:vporof][:vp] from comment #7)
> Was this fixed by bug 957187?

Not entirely, but it got better. The bubble is now close to the identifier, but the arrow always points downwards.
(If flip="both" was to work, then the arrow will point upwards)

So ideally, the issue is fixed.
(In reply to Panos Astithas [:past] from comment #8)
> 
> Not entirely, but it got better. The bubble is now close to the identifier,
> but the arrow always points downwards.

Patrick, does the custom styling of the panel support such cases? AFAIK we have some smarts for different arrows in CSS.
Flags: needinfo?(pbrosset)
The custom XUL arrow panel styling we have should support these cases. There are custom arrow images for all top, left, bottom, right sides: http://mxr.mozilla.org/mozilla-central/source/browser/themes/shared/devtools/dark-theme.css#275
And the code in Tooltip.js doesn't make any assumption concerning the position of the panel.

Interestingly, the firefox bookmark toolbar button behaves exactly as we want, but I haven't been able to find what's different in that panel.

I've tried playing with the flip and side attributes, that didn't make any difference.
The thing is, when the tooltip does open to the bottom, its side attribute gets the correct value "bottom", but the CSS doesn't seem to apply in that case.
Flags: needinfo?(pbrosset)
@Panos: Do you think bug 967096 is a dupe of this? (In which case it's worse on a multi-monitor setup)
Product: Firefox → DevTools

We don't use XUL in the new debugger and I'm confident our preview bubbles are displaying in the proper place.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: