Re: Text selector [was Re: breaking overflow]

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
use.

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.

Rob
-- 
"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
53:5-6]

Received on Tuesday, 5 January 2010 00:04:46 UTC