Re: [cssom] Make CSSStyleSheet constructable

On 10/19/12 11:16 PM, Dimitri Glazkov wrote:
>> OK, I'm with you so far.  So we want to have a way to link to stylesheets
>> from this declaration file and say "this stylesheet applies to all
>> components defined in this file".  Which could be as simple as "this <link>
>> is in <head>" or whatnot, right?
>
> Yup.

OK, good.  So we have a declarative solution here, excellent.

>> Ah, so in this case there is no declaration file at all?
>
> Right.

OK, I agree that's a use case we want to address.  I assume there is no 
convenient object that represents a set of component definitions that 
are all related that the sheet load could hang off of?

My main concern with making CSSStyleSheet objects directly constructable 
is that it seems like it creates various footguns, in terms of 
specification, implementation, and use.  Most importantly, it lets you 
share a single CSSStyleSheet across multiple pages, including pages that 
are not same-origin due to document.domain changes....  So if there is a 
way to address the use case without creating all the same complexity, I 
would be in favor of it.

-Boris

Received on Monday, 22 October 2012 20:33:05 UTC