Re: [css3] URI selectors

I think this would be a really valuable feature but it must be easy to 
use, which is primarily the UA's job. However, as Chris Moschini said 
to me in an off-list mail, this is primarily a question of 
accessibility. In order for it to help the people that need it most, it 
needs to be available in the big UAs. The W3C can help make that 
happen.

As an aside on the syntax, the match should be starts with. So

	@scope url("http://www.yahoo.com/") {
		body {
			background-color:red;
		}
	}

	@scope url("http://www.yahoo.com/business/") {
		body {
			background-color:green;
		}
	}

would render http://www.yahoo.com/business/ with a green background, 
but all other Yahoo pages with a red BG. What about subdomains? Would 
the user have to exclusively list them:

	@scope url("http://www.yahoo.com/"), url("http://dir.yahoo.com/"), 
url("http://uk.yahoo.com/"), url("http://finance.yahoo.com/"), 
url("http://groups.yahoo.com/"), url("http://login.yahoo.com/"), 
url("http://shopping.yahoo.com/"), url("http://privacy.yahoo.com/")  {
		body {
			background-color:blue;
		}
	}

But all this is moot if people who have a hard time reading my peach 
text on a purple background or who can't find your text-decoration:none 
links can't actually override our settings specifically with their UA.



On 9 Dec 2003, at 2:39, Tantek Çelik wrote:

>
> On 12/8/03 12:50 PM, "Boris Zbarsky" <bzbarsky@MIT.EDU> wrote:
>
>>
>> Chris Moschini wrote:
>>> For this reason, why not offer as part of the CSS3 spec a selector 
>>> that can
>>> differentiate
>>> between URIs? Something like:
>>>
>>> uri( "www.w3c.org" ), url( "www.w3.org" ) { font-size: 150%; }
>>>
>>> It could be a huge boon to accessibility.
>>
>> It would be much easier for the UA to implement per-site user
>> stylesheets...  The UA can then even use a definition of "site" that's
>> somewhat better than a direct URI match (eg based on document.domain
>> amongst other things).
>
> It is doubtful that the UA will understand what defines the "site" 
> better
> than the author of the site.
>
> Thus an author technology is preferable to a UA-only technology.
>
> In addition, any such author technology can be overridden by the user 
> in
> their user style sheet, or by UA settings which result in synthesized 
> user
> style sheet rules.
>
> This kind of functionality was previously proposed, albeit using an 
> at-rule
> (which I think is preferable to a selector -- as selectors *should* be
> limited to aspects of elements rather than aspects of the document 
> (like its
> URL), viewport, media etc.)
>
> Todd Fahrner proposed @scope in 1999.  It works like @media except 
> based on
> the URL rather than the media type.
>
> [CSS WG only link]
>  http://lists.w3.org/Archives/Member/w3c-css-wg/1999JanMar/0274.html
>
> Here are the essential bits (I don't think Todd won't mind that I 
> reposted
> this).  I still think this is a good proposal, and think it may find 
> its way
> to either the CSS3 Cascading or CSS3 Syntax modules (more likely 
> Cascading).
>
> Tantek
>
>
>
> ==================
> From: Todd Fahrner
> Date: Wed, 10 Mar 1999 09:11:00 -0800
>
>
> How about an "@scope" feature to limit application of the enclosed 
> rules to
> the specified scope? e.g.:
>
> @scope url("http://www.apple.com/")
>     {
>     background: red;
>     }
>
> @scope url("http://www.ibm.com/")
>     {
>     background: blue;
>     }
>
> Now these rules would apply to all subdirectories inside those urls as 
> well.
>
> You should also be able to do stuff like this:
>
> @scope url("/ads/"), url("http://www.yahoo.com/ad1.jpg")
>     {
>     display: none;
>     }
>
> or this:
>
> @scope url("http://intranet.mycompany.com/")
>     {
>     background: no-repeat fixed url("confidential.png");
>     }
>
> or this:
>
> @scope url("https:")
>     {
>     background: no-repeat fixed url("securehttp.png");
>     }
>
> or this:
>
> @scope url("file:")
>     {
>     background: no-repeat fixed url("local.png");
>     }
>
> Obviously useful for user style sheets, as it suggests a CSS framework 
> for
> UAs to apply certain rules only to certain domains, whose authors may 
> have
> some disagreeable notions of taste or usability. With some sort of
> expression for "the current domain", would enable transient 
> application of
> bits of corrective or "utility" CSS.
>
> ...
>
> ===============
>
>
>

(q)	Ben Godfrey?
(a)	Web Developer and Designer
	See http://aftnn.org/ for details

Received on Monday, 8 December 2003 21:59:33 UTC