W3C home > Mailing lists > Public > www-style@w3.org > August 2004

Re: per-site user stylesheet rules

From: Robin Berjon <robin.berjon@expway.fr>
Date: Fri, 20 Aug 2004 10:40:03 +0200
Message-ID: <4125B8E3.6050300@expway.fr>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style@w3.org


L. David Baron wrote:
> I've implemented an at-rule allowing per-site user stylesheet rules in
> Mozilla.  It's available in Mozilla 1.8 alpha 3.  This is based on the
> idea proposed in [1], although with different syntax.
> @-moz-document url(http://www.w3.org/),
>                url-prefix(http://www.w3.org/Style/),
>                domain(mozilla.org)
> {
>   /* CSS rules here apply to:
>      + The page "http://www.w3.org/".
>      + Any page whose URL begins with "http://www.w3.org/Style/"
>      + Any page whose URL's host is "mozilla.org" or ends with
>        ".mozilla.org"
>    */
> }

I like the idea -- it certainly is a valuable feature to have -- and in 
fact it could be augmented with something along the lines of:

   @document url-list "title";

That would select the alternate with the given title, for that 
url-matching specification.

That being said, do these things need to be specified in CSS? Or, to put 
it another way, is it likely that you will ever send such stylesheets 
over the wire? To be honest, I strongly doubt it. The security issues 
are too important: if you go to http://dahut.org/ and I send a 
stylesheet that has:

@document domain(mozilla.org) {
   :root {
     display: none;

I assume you wouldn't want that to apply, especially as I could do 
things nastier than that such as attach an XBL keyboard logger to your 
bank's site.

So it's limited to local files that will never be interchanged. Does it 
need to become a standard?
Robin Berjon
Received on Friday, 20 August 2004 08:40:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:15 UTC