Re: [css4-ui] ::tooltip

tooltips are actually only a small part of popup elements "iceberg" in HTML/CSS.

Here are some details of popup functionality that I have in my
HTMLayout and Sciter engines,
probably could be useful if will decide to go further with this.

As of pure tooltips:

Additionally to standard 'title' I also have 'title-id' DOM attribute
that defines ID of
element used as a tooltip. So we are able to show tooltips like this:
http://www.terrainformatica.com/htmlayout/images/tooltip-balloon.jpg
The tooltip here is a normal DOM element that is styled by CSS
(background-image, etc.)

I also have tooltips that are automatically generated for
text-overflow:ellipsis elements to reveal
full content of the element when it overflows.

Tooltips implementation in my case is a part of "popup module" -
functionality of other popup windows
used by HTML/CSS. For example popup portion of the <select> and
input[type=date] (calendar)
are popup windows as tooltips. Context menus are also there (both
engines allow to define custom
context menus using <menu class=context> elements)

For popups I've added two pseudo-classes that are used for all types of popups:
  :popup - is 'on' when the element is shown as a popup, out-of-flow element.
  :owns-popup - is 'on' for the element that owns active (visible)
popup (tooltip included).
      In some cases owner of the popup needs to be rendered
differently, e.g. to match
      style of the popup when it is seen.

Popup elements are using special positioning schema. In most cases popup
position cannot be defined by current CSS means. And popup visibility too.
Popups use non-standard cascading rules - some attributes are inherited from
element that :owns-popup rather than DOM parent. Directionality as an example.

Event propagation is also quite different - for many good reasons
event bubbling
shall occur from popup to its owner rather than to its DOM parent.

That are just few details. In any case :tooltip or :popup should be
pseudo-classes that define runtime state of the element rather than
pseudo-elements as someone proposed in this discussion.

-- 
Andrew Fedoniouk.

http://terrainformatica.com


On Tue, Apr 10, 2012 at 5:04 PM, Lea Verou <leaverou@gmail.com> wrote:
> A way to style tooltips was discussed in the mailing list 3 years ago [1],
> but no resolution was reached and WG participation was very low. I consider
> this a very useful feature, so I thought I'd bring up the issue again. The
> short 2009 discussion follows (older to newer):
>

Received on Wednesday, 11 April 2012 20:31:00 UTC