Commit Graph
30 Commits
Author SHA1 Message Date
Julian Descottes 2966642428 Bug 1293211 - part1: wait for xul wrapper popupshown event in HTMLTooltip;r=bgrins
MozReview-Commit-ID: Gv04Fc1cfgI
2016-08-08 11:29:31 +02:00
Julian Descottes 9e9494904c Bug 1287090 - HTMLTooltip: support host changes by retrieving top window dynamically;r=bgrins
MozReview-Commit-ID: 9RcM2h41DdV
2016-07-15 16:30:54 +02:00
Julian Descottes f5586f9990 Bug 1287438 - html-tooltip: use level=top for xul panel wrapper;r=bgrins
Using level=float seems buggy when the window to which the XUL panel is attached
changes.

MozReview-Commit-ID: HuOnMDGo38l
2016-07-18 17:19:24 +02:00
Julian Descottes 902c53d236 Bug 1286523 - fix autocomplete popup position in RTL locales;r=bgrins
MozReview-Commit-ID: HRC1ialFBVj
2016-07-13 18:52:37 +02:00
Julian Descottes 7b0f804f9d Bug 1286553 - HTMLTooltip: consume only left click events;r=bgrins
MozReview-Commit-ID: Hr0Lwv8Zx5C
2016-07-14 16:13:11 +02:00
Julian Descottes 9c689d6870 Bug 1285206 - Enable xul panel for some devtools tooltips;r=bgrins
Set useXulWrapper to true for markup view image previews and rule view
tooltips.

Also slightly changed the logic in HTMLTooltip.js so that useXulWrapper is only
true when we are in a XUL context.

MozReview-Commit-ID: 9EkQYLLAn7C
2016-07-08 15:46:42 +02:00
Julian Descottes b6be03d894 Bug 1285206 - Use type=arrow for xul panel wrapper in HTMLTooltip;r=bgrins
MozReview-Commit-ID: I1DCXbl05b6
2016-07-12 17:24:53 +02:00
Julian Descottes b8d27afa33 Bug 1284461 - HTMLTooltip: use variable height only if height==Infinity;r=bgrins
MozReview-Commit-ID: LTraHLeEEp4
2016-07-05 14:35:15 +02:00
Alexandre Poirot 76ccbff09c Bug 1267414 - Apply scoped stylesheet to HTMLTooltip container. r=jdescottes 2016-07-11 01:26:02 -07:00
Julian Descottes 5bc2788731 Bug 1266456 - part9: use HTMLTooltip for autocomplete-popup;r=bgrins
Modify the devtools autocomplete-popup to rely on a HTMLTooltip instance
instead of a XUL panel.

Other than the straightforward migration to HTML, the main difference with
the new implementation is that the richlistbox has now been replace with a
simple HTML list element. The former XUL widget used to be able to take the
focus from the input it was linked to.

This is no longer the case. Most autocomplete users were always keeping the
focus in the input, except for the inspector-search, which was moving the
focus back and forth between the input and the autocomplete's richlistbox.
Now the focus is always in the input. A practical example to illustrate how
this changes the UX: before when the user had the focus on the first element
of the list, pressing "DOWN" would keep the element selected but visually move
the focus in the input. Now the selection simply cycles to the next item.

Even though this introduces a difference in behaviour compared to the previous
implementation, it makes the inspector search UX consistent with the other
autocomplete widgets used in devtools.

Another difference is about the display for the inspector-search. The position
of the autocomplete popup used to be above the input. This is now impossible to
achieve because the search input is at the top of the toolbox and the HTML tooltip
can not exceed the limits of the toolbox.

For this #2 issue, either we manage to use XUL panel wrappers, in which case, the
autocomplete will be displayed as it used to. Or we can invert the order in which
items are inserted and explicitly ask for the autocomplete to be displayed below the
input. I prefered not to change this here in order to make the code change easier to
understand, but it should be addressed in a follow-up.

MozReview-Commit-ID: jH9aXm9Jvz
2016-07-07 16:32:42 +02:00
Julian Descottes 68f0b1004c Bug 1285189 - change default value of HTMLTooltip:useXulWrapper to false;r=ochameau
MozReview-Commit-ID: 4uEqkVbqcsC
2016-07-07 11:57:29 +02:00
Julian Descottes 34cb206f63 Bug 1267403 - HTMLTooltip: add useXulWrapper option when displayed in a XUL document;r=ochameau
The HTMLTooltip supports an additional configuration parameter "useXulWrapper".
When set to true, if the tooltip is displayed in a XUL document, a XUL panel
will be used as an additional container for the tooltip.

This allows the tooltip to be displayed anywhere on the screen and can be
useful when displayed in small toolboxes.

MozReview-Commit-ID: 63kv4vAeW5R
2016-07-06 14:50:44 +02:00
Julian Descottes 9d649d3159 Bug 1266456 - part6: HTMLTooltip show() now accepts x,y offsets;r=bgrins
The autocomplete popup is displayed relatively to an anchor, but will be
shifted on the x-axis in order to be aligned with the word being completed.

To support this, the HTMLTooltip show() method now accepts x and y offsets.

MozReview-Commit-ID: 1cR3XFPdcVy
2016-06-20 21:07:08 +02:00
Julian Descottes a7428b281b Bug 1266456 - part5: HTMLTooltip setContent() support "auto" width parameter;r=bgrins
The autocomplete popup defines its width by finding the longest label
to display and then applying a "width:Xch" to its content, where X is
the length of the longest label + 3.

In order to support this, the HTMLTooltip setContent() methods allows to
use width: "auto" (which also becomes the default value). In this case,
the HTMLTooltip show() method will automatically compute the preferred
width for the tooltip. It will first calculate the tooltip height, then
measure the width of the tooltip for this computed height and use it as
the preferred width.

MozReview-Commit-ID: KDxZNB3KDdR
2016-06-23 17:30:50 +02:00
Julian Descottes f6f57e0f12 Bug 1266456 - part4: HTMLTooltip support XUL docs using page instead of window;r=ochameau
Some test documents are using a <page> object instead of a <window> object.
When inserting the tooltip container  inside of the document, the HTMLTooltip
will now insert the container in the documentElement

MozReview-Commit-ID: F57vP2lfvrg
2016-06-22 19:44:59 +02:00
Julian Descottes d83fbffb78 Bug 1266456 - part3: HTMLTooltip show() clear timeout to avoid window leaks;r=jsnajdr
When calling HTMLTooltip::show() consecutively, we were leaking a window object.
The timeout responsible for attaching the click event on window is now cleared
before attaching a new one.

MozReview-Commit-ID: 3ccIHM2QNlp
2016-06-24 16:47:01 +02:00
Julian Descottes df9144d00a Bug 1266456 - part2: HTMLTooltip setContent() use object as 2nd arg;r=jsnajdr
setContent expects 3 arguments: content, width, height. Height is already optional
but for the autocomplete migration, the width will also become optional.

Using an object argument for width and height makes this easier.

MozReview-Commit-ID: 9CiMG0BdLOR
2016-06-23 17:27:32 +02:00
Julian Descottes 92e734731d Bug 1266456 - part1: HTMLTooltip cleanup test & jsdoc for synchronous setContent;r=jsnajdr
MozReview-Commit-ID: Ia3aRmwFawP
2016-06-22 15:18:21 +02:00
Julian Descottes 6b4ec8f341 Bug 1279441 - fix HTMLTooltip closing after click on inner iframe;r=bgrins
MozReview-Commit-ID: EggheTpU2y3
2016-06-10 11:24:04 +02:00
Julian Descottes f5dc74d78e Bug 1266450 - part7: fix html tooltip autofocus behavior;r=bgrins
For autofocus tooltips, we need to find a focusable item in order
to call focus() now that the tooltip content lives in the same
document as the toolbox. Updated the corresponding test and made
some superficial changes to HTMLTooltip.js.

MozReview-Commit-ID: L61eIxgFm3d
2016-06-08 13:32:15 +02:00
Julian Descottes 2e11b982f8 Bug 1266450 - part6: migrate EventDetails tooltip;r=bgrins
For now this is a 1 to 1 migration of the existing Tooltip
helper method from XUL to HTML.

MozReview-Commit-ID: 9YiJLgibV9h
2016-05-31 11:25:43 +02:00
Julian Descottes c94e194787 Bug 1266450 - part4: allow tooltips to have a variable height;r=bgrins
With this changeset the tooltip's effective height can be smaller than
the height specified when calling setContent. If the tooltip content is
dynamic, this allows to display a small tooltip frame if the content is
collapsed, and a bigger tooltip frame when it is expanded.

MozReview-Commit-ID: 44vA0Rdz62m
2016-06-03 12:52:59 +02:00
Julian Descottes 6605337e81 Bug 1266450 - part3: fix helper to check if click occurred in tooltip;r=bgrins
The existing helper checking if a click occurred inside or outside a
HTMLTooltip container was failing if the click occurred in an iframe.

MozReview-Commit-ID: 9AIACOukYUF
2016-06-03 12:50:39 +02:00
Julian Descottes ce41dce5f4 Bug 1266450 - part2: remove iframe container for HTML tooltip;r=bgrins
In order to have tooltips with a variable height, the tooltip container
should be allowed to resize itself on the fly, which cannot be achieved
with an iframe.

This changeset makes the HTMLTooltip rely on a HTML container inserted
in the XUL document directly. This allows to go back to a synchronous
API which also simplifies the implementation.

MozReview-Commit-ID: EDcsnVSKmeU
2016-05-30 23:02:58 +02:00
Julian Descottes 7046ee2670 Bug 1277906 - part2: focus previous active element when hiding HTML Tooltip;r=bgrins
MozReview-Commit-ID: GuiwOlZyyik
2016-06-04 00:40:37 +02:00
Julian Descottes 74a70da867 Bug 1277906 - part1: change HTMLTooltip default autofocus value to false;r=bgrins
Given the current usage of the HTMLTooltip, I think having the autofocus as
an opt-in behavior makes more sense.

MozReview-Commit-ID: CS98szSKQdF
2016-06-03 21:15:54 +02:00
Julian Descottes 9b74db5fce Bug 1266448 - part3: use HTML tooltip for markupview image previews;r=ochameau
MozReview-Commit-ID: E45sJPVAsxj
2016-05-15 14:45:51 +02:00
Julian Descottes 258d2da4bb Bug 1267401 - part3: Create arrow style for HTML tooltips;r=bgrins
MozReview-Commit-ID: Bp2RylafolP
2016-05-16 17:53:19 +02:00
Julian Descottes acf216e545 Bug 1267401 - part1: Rename HTMLTooltip properties for backward comp with Tooltip;r=bgrins
Rename document -> doc for consistency and parent to panel
for test compatibility.

MozReview-Commit-ID: KHT7plLtNQc
2016-05-23 22:49:21 +02:00
Julian Descottes d162f12420 Bug 1259834 - Create basic HTML tooltip API;r=bgrins
First implementation of HTML based tooltip to be used in devtools
instead of XUL panels. API is similar to the current API of
Tooltip.js

MozReview-Commit-ID: 8njiKBubLSj
2016-05-04 14:44:57 +02:00