Re: Domain selectors

@document is better than a simple selector.
The problem with @document are the security aspects and the limited use 
cases.

Selectors are best suited for DOM properties and tree structure. Your 
syntax also conflicts with existing selectors.

On 3/7/15 12:10 PM, L. David Baron wrote:
> On Saturday 2015-03-07 20:46 +0100, Jens Oliver Meiert wrote:
>> Quick and dirty.
>>
>> I grow fond of the utility of something like a domain (more precisely:
>> hostname) selector:
>>
>>    [host='example.com'] html { color: red }
>>
>> The syntax would follow that of attribute selectors (as well as RFC 3986).
>>
>> The only constraint would be that the domain selector would need to be
>> followed by another selector (as with “html” in example).
>>
>> The use cases:
>>
>> 1) More effective—or rather finally manageable—handling of
>> multi-domain/subdomain sites (as with easier “skinning”).
>>
>> 2) More robust user style sheets (as in reasonably limiting the scope
>> of possibly overly aggressive selectors).
>>
>> I’m not aware of any existing work here and, glossing over the idea,
>> it seems to be of value.
> There was a draft in earlier versions of CSS Conditional Rules:
> http://www.w3.org/TR/2012/WD-css3-conditional-20120911/#at-document
> and it's been implemented in Gecko as @-moz-document for a long
> time.
>
> The main reasons for dropping it were that (1) it wasn't clear what
> definition of URL equality to specify and (2) there wasn't much
> interest from other browsers in implementing it.
>
> There were also some security concerns related to sites that allowed
> others to provide CSS to be included on their site without doing
> proper sanitization; see
> https://bugzilla.mozilla.org/show_bug.cgi?id=1035091
>
> -David
>

Received on Sunday, 8 March 2015 22:20:49 UTC