Re: Text selector [was Re: breaking overflow]

On Jan 5, 2010, at 3:59 PM, "Robert O'Callahan" <robert@ocallahan.org>  
wrote:

> On Wed, Jan 6, 2010 at 12:40 PM, Brad Kemper <brad.kemper@gmail.com>  
> wrote:
> I could live with that, if it's as fast as JavaScript regexp  
> processing. Simple regexp and literals run pretty fast, don't they?  
> And dynamic element changes also require rematching. I don't think  
> I'd want it to run the matching every second as I typed into  
> editable HTML.
>
> That's exactly what a browser has to do.

I meant to say "every microsecond" or "every CPU cycle". If it waited  
for a one second pause in editing before refreshing styles, I think it  
would enhance performance significantly, even when using today's CSS.  
That shouldbe plenty, epecially if you are only looking at the text  
nodes of the currently changing innermost element for rule matches.

> No way. Talk about idealistic goals that cant be reached! I should  
> have the content/markup author tell the UA where all the numbers  
> are, just because I want to style them differently? I should insist  
> on a separate class for every phone number that matches a particular  
> one that I might be interested in styling? What HTML tag do I use  
> for a ">" that represents another level of breadcrumbs? These are  
> all things that I cannot reasonably expect to be in the markup, but  
> that I may want to style. There are already many places where  
> authors are adding extra spans in the HTML just to get a  
> presentational effect, and I think we should provide ways to  
> alleviate that where we can.
>
> Sure, but that set of examples aren't just presentational effects,  
> they have semantic meaning. Maybe not expressible in HTML directly,  
> but there's nothing "wrong" with adding classes for them.
>
> CSS needs some cooperation from the document author.

It helps. But the CSS author can very often expect NO cooperation from  
the HTML author beyond what they have already created. And it is  
usually unreasonable to expect a whole site to be re-coded in order to  
acheive non-essential (but desirable) presentational effects.

> Even using ::text("Example \d: *\n"), the author has to make sure to  
> put the right number of spaces in, which is arguably harder to get  
> right than wrapping the text in a span with a class.

I disagree. In that example, I already have 0-many spaces that can  
come before line break. If I was really worried about unexpected white  
space, I could rewrite that single pattern string as "Example\s+\d:\s* 
\n". But that is kind of ugly. I would much rather have the pattern  
matched against a copy of the element's text that had already had the  
white space collapsed (so if the element had 'white-space: normal',  
all source code white space would be collapsed to single spaces, and  
<br> elements would be read as "\n").





>
> 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 Wednesday, 6 January 2010 00:38:33 UTC