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

Re: Text selector [was Re: breaking overflow]

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 5 Jan 2010 13:04:13 +1300
Message-ID: <11e306601001041604o5a12ae63y8c1c587a4fa9d15b@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
On Tue, Jan 5, 2010 at 5:24 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> Note that I'm OK with ::text not matching across element boundaries, at
> first glance, and not entirely convinced we want a ::text at all, but if we
> _do_ have it, I think it should have restrictions similar to first-line at
> least.

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. 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?"). Also, there is a risk of the rule unexpectedly matching
content (e.g., dynamically generated text or text typed by the user). There
is the problem of multiple ::text rules matching overlapping strings. It's
going to be hard to spec, hard to implement, and potentially confusing to

IMHO if you want to call out a chunk of text for styling, DOM manipulation,
or other processing, you should put it in a <span> or similar element.
That's what elements are for.

"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
Received on Tuesday, 5 January 2010 00:04:46 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:42 UTC