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

Re: [css4-ui] ::tooltip

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 13 Apr 2012 08:28:22 -0700
Message-Id: <8CABB201-04BD-47C5-90C6-3EB36BE6EF6A@gmail.com>
Cc: Divya Manian <manian@adobe.com>, Andrew Fedoniouk <news@terrainformatica.com>, Lea Verou <leaverou@gmail.com>, "www-style@w3.org" <www-style@w3.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Apr 13, 2012, at 8:14 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Fri, Apr 13, 2012 at 6:32 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
>> For some pseudo-elements, you can grab content from elsewhere. We have 'content' and 'flow-from' (regions) that could provide that content for '::tooltip'. 'Content' could grab it from the 'title' attribute, like this:
>> 
>> div::tooltip { content: attr(title); background: gold; font-size: x-large;  }
>> 
>> In this case, if no title attribute exists, then there is no content. If there is no content, then the pseudo-element does not appear (just as with '::before' and '::after'). So we don't actually need '[title]' in the selector.
> 
> Actually, you do, as attr() will return the empty string in that case,
> and the empty string is a valid value for 'content' that should cause
> it to be generated.  

Is that considered useful? Why not null if the attribute doesn't exist, and empty string it exists with no value or empty value?

> Not all browsers agree on this, though - Chrome
> won't generate a pseudo-element in that case, but Firefox will.
Received on Friday, 13 April 2012 15:28:52 GMT

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