W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: Text selector [was Re: breaking overflow]

From: Bobby Jack <bobbykjack@yahoo.co.uk>
Date: Tue, 5 Jan 2010 02:09:47 -0800 (PST)
Message-ID: <59550.6448.qm@web24103.mail.ird.yahoo.com>
To: Boris Zbarsky <bzbarsky@mit.edu>, robert@ocallahan.org
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
--- On Tue, 1/5/10, Robert O'Callahan <robert@ocallahan.org> wrote:

> Personally I don't think we should have ::text at all.
> I think there are all kinds of pitfalls associated with
> trying to apply style to a particular text string.

I've been waiting for someone to say that! :)

> For one thing, it makes style dependent on details of the content in
> a way that seems rather fragile (e.g., "I just fixed a
> typo, why did my styles go away?").

Agree. It also makes translation a pain (i.e. stylesheets need to be translated in addition to content) and, I fear, could lead to situations in which it's very difficult to determine which styles are applied. 

> It's going to be hard to spec, hard to
> implement, and potentially confusing to use.

And, given that, I think we need to ensure there are some strong use cases before considering this any further. The common use case seems to be, for example, a heading consisting of several words, each of which needs to be styled independently. As suggested, this can currently be achieved using additional span elements, although this is certainly not ideal - how would one plan for this at the structural level?
Having said that, I think this particular use case can be handled with a more structural, less content-dependent selector such as ::word(n) (which I don't think exists anywhere).

Are there any other use cases?

- Bobby
Received on Tuesday, 5 January 2010 10:10:20 GMT

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