W3C home > Mailing lists > Public > www-style@w3.org > October 2012

Re: [cssom] Make CSSStyleSheet constructable

From: Dimitri Glazkov <dglazkov@google.com>
Date: Fri, 19 Oct 2012 15:23:55 -0700
Message-ID: <CADh5Ky223h7JkL4p-Wk-dcCp0oMdtRUQrX9=T5ukujprCGgfUA@mail.gmail.com>
To: François REMY <fremycompany_pub@yahoo.fr>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org" <www-style@w3.org>, Tony Ross <tross@microsoft.com>
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 :)

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:22 UTC