Re: [cssom] Make CSSStyleSheet constructable

On Fri, Oct 19, 2012 at 3:21 PM, François REMY
<fremycompany_pub@yahoo.fr> wrote:
> |  For example, in frameworks where components are dynamically loaded (or
> |  generated), their developers will use document.register
> |
> (http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-document-register)
> |  to register them with the document. As such, they would have no way to
> |  specify a shared stylesheet. And that seems bad.
>
> I don't see why. The shared stylesheets will be automatically guessed from
> their template. I mean, by default, when the template will be copied, the
> same stylesheet will be reused for its copies (unless they modify it, but I
> guess they should not do that).

I think you missed the distinction I made between the two types of
stylesheets :)

>
>
> |  I chose to use rule-twiddling because of encapsulation: the state of
> |  the tab manager is stored completely inside of the component. Had I
> |  put a class on the tab, I would've leaked that state onto the children
> |  of the tab manager.
>
> Again, you can change the class of an element located in your template.

I don't see how? The tabs are not in the template.

> Since you can select elements directly from the shadow tree using @host {}
> you can easily solve this in an elegant way. Modifying the rules of a CSS
> file destroys a lot of browser optimizations. Modifying a CSS stylesheet
> should be a "I-have-no-other-solution" fix because it comes at very high
> costs.

I am not arguing that point :)

:DG<

Received on Friday, 19 October 2012 22:24:23 UTC