W3C home > Mailing lists > Public > www-style@w3.org > September 2008

Re: [CSSWG] Minutes F2F 2008-08-21

From: Brad Kemper <brkemper.comcast@gmail.com>
Date: Mon, 8 Sep 2008 20:52:31 -0700
Cc: www-style@w3.org
Message-Id: <A4ECACBF-25FF-43C6-8F71-014B67878E44@gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>


On Sep 8, 2008, at 6:55 PM, fantasai wrote:

>  Peter: I think the thing you match against the original text.

Me too.

> David: Then you have to merge the replacements.
>  David: What happens if your replacements overlap? E.g. you replace
>         "Soviet Union" and you replace "Union".
>  Howcome: You define a sequence. There's no infinite loop here.

Yes, like this:

<p>Soviet Union</p>

p::text("Soviet Union") { content:  "Russia"; }  /* result:  Russia  */
html > body p::text("Union") { content:  "Confederacy"; }   /* end  
result still:  Russia  */
/* longest match wins, even with stronger selector weight  */
p::text("Soviet Union") { content:  "SSR"; }  /* result:  SSR  */
/* this rule overrides the first one */

A different case for same HTML part:

p::text("Union") { content:  "Confederacy"; }  /* result:  Soviet  
Confederacy  */
p::text("Soviet Confederacy") { content:  "Russia"; }  /* result  
still:  Soviet Confederacy  */
/* no matching against replacement content  */
p::text("Soviet Union") { content:  "Russia"; }  /* end result still:   
Soviet Confederacy  */
/* rule is too late. "Soviet Union" has already been replaced  */

And with this HTML part:
<p>Soviet <b>Union</b></p>

then p::text("Soviet Union") would NOT match, because it crosses a tag  
boundary.


>  Ishida: What is your use case here?
> [ ...clipped... ]

> Peter: I can see you using it in a collaborative process when  
> someone scans
>         text and posts it, someone else writes a style sheet for it.

Or you are using licensed content where you don't get to change the  
HTML, but you do get to provide a style sheet, and you want to change  
some things to match your house style guide ("style guide" refers to  
language standardization in this case, not CSS per se). This kind of  
thing comes up for me all the time. Replacing a CSS file is  
instantaneous almost, but getting text changes is like pulling teeth,  
and takes forever. Even when legal responsibility of what the text  
says is not an issue.

*::text("Log On") { content:  "Sign On"; }
*::text("User Name") { content:  "User ID"; }
*::text("colour") { content:  "color"; }
*::text("biscuit") { content:  "cookie"; }
*::text("home banking") { content:  "online banking"; }
*::text("Calif.") { content:  "CA"; }

>  Håkon: The replacements on ancestors would happen before  
> replacements on
>         descendants.
>  Elika: This shouldn't be in CSS, so you can have all the declarations
>         apply rather than having them override each other by  
> cascading and
>         inheritance.

I think it could still work well with cascading and inheritance.

>  Steve: Should record: with the selector approach, you have the  
> overlap
>         problem.
>  <dbaron> *:text("Soviet") { content: "CEI"; }
>  David: If you make this an inherited property, then you have more  
> overriding
>         happening and you don't have these problems.
>  David: Only one text-replace value ever applies to a given run of  
> text.

Another benefit of the selector approach is that it is more useful  
than to just use it for content replacement. For instance, if I wanted  
my company name to always be bold and red:

*::text("MyCompany") { font-weight: bold; color: red; }

The use cases for that sort of thing are even greater than for all-out  
replacement, IMO.
Received on Tuesday, 9 September 2008 03:53:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:12 GMT