W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Re: [css4-ui] ::tooltip

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Thu, 12 Apr 2012 19:34:47 -0700
Message-ID: <CALRQH78QoqjCkk7XKwHqmxNiUy8kLCkDS1u-RQ9HyxcEddQNAg@mail.gmail.com>
To: Divya Manian <manian@adobe.com>
Cc: Lea Verou <leaverou@gmail.com>, "www-style@w3.org" <www-style@w3.org>
On Thu, Apr 12, 2012 at 2:18 PM, Divya Manian <manian@adobe.com> wrote:
> On 4/11/12 9:21 PM, "Andrew Fedoniouk" <news@terrainformatica.com> wrote:
>
>>Ideally we should have one mechanism that covers all use cases, not two
>>of them.
>>
>>This for example:
>>
>>    div[title] -> :tooltip { background:gold; font-size: x-large;  }
>>
>>does exactly as yours:
>>
>>   div[title]::tooltip { background:gold; font-size: x-large;  }
>
> No it does not. You are asking for completely different set of features
> from what Lea did. All Lea suggests we have is a way to style the tooltips
> that browsers show on <abbr> or image elements. You are suggesting we add
> a state to an existing element that somehow becomes a tooltip by some
> magic (how?)

I am speaking precisely about tooltips that appear for elements with
declared @title.

When UA detects that it needs to show tooltip it creates DOM element
(or something like this) in "shadow" DOM.

If it is an element in shadow DOM then it can be selected by CSS as any other
such element using shadow tree access combinators (discussed couple of times
here).

As of pseudo-elements...

Pseudo elements like ::after or ::before are a) pseudo-element declarations
and at the same time are b) *instructions* for the UA to create after/before
sub-elements for the element in shadow tree. And so these elements are
getting into
rendering tree as soon as there is matching rule with ::after declaration.

So if to follow current CSS practice this declaration:

   div[title]::tooltip { background:gold; }

can be read as:
  "UA, as soon as you see <div> with attribute 'title' create tooltip
  element for it and show the tooltip while this selector is in effect."
  So the tooltip will be shown always no matter what.

Which is a bit far from what we actually want here:
   "UA, when you need to show "title" element for the <div>
    in :tooltip state style it this way".

Let me know if all this above is not clear.

>
> These are not use cases for the same "feature" and need to be talked about
> separately.
>

I do not understand what you've tried to say here, sorry.

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Friday, 13 April 2012 02:35:16 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:52 GMT