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

Re: [cssom] Make CSSStyleSheet constructable

From: Dimitri Glazkov <dglazkov@google.com>
Date: Sat, 20 Oct 2012 08:26:29 -0700
Message-ID: <CADh5Ky3boVMbsY89Z0N1U3qDX+-WjaMY7heFo=fKGBxWo4AKDg@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 Sat, Oct 20, 2012 at 1:27 AM, François REMY
<fremycompany_pub@yahoo.fr> wrote:
> |  I don't see how? The tabs are not in the template.
> Then you need a way add "invisible" classes from the component. An idea:
>    @virtual-namespace tab-data "http://jquery.com/namespaces/tab-data";
>    h2[tab-data|selected] {
>        ...
>    }
>    var tabData = getVirtualNamespace("tab-data");
>    // add the virtual attribute to the element
>    tabData.set(element, "selected", "true");
>    // remove the virtual attribute
>    tabData.set(element, "selected", null);
> Virtual namespaces would be recognized by URL and would be shared accross
> css documents using the same "virtual-namespace" declaration. However, each
> document need to have an @virtual-namespace declaration to map a CSS name to
> a virtual namespace.
> To the contrary of real namespaces, virtual namespaces would not rely on
> attributes but on weakmaps (at least, this is what the API would induce, the
> internal implementation could be different).
> Doesn't that solve your initial problem more elegantly than just rewriting a
> stylesheet evertime you need to change something on an element outside the
> template you don't want to touch?

Yes! This is bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=15954
and Tab had sketched out a solution there that is similar to yours.
Please feel encouraged to respond/improve! :)

Received on Saturday, 20 October 2012 15:26:57 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:21 UTC