Re: Proposal for "Cascading Attribute Sheets" - like CSS, but for attributes!

On Tue, Aug 21, 2012 at 11:27 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 8/21/12 2:17 PM, Tab Atkins Jr. wrote:
>> My thought right now is that your CAS is only
>> applied to elements when they are inserted into the DOM
>
> If an element is removed, is the CAS "unapplied"?
>
> If not, what happens if the element is removed and then reinserted?

I'm thinking not.  Unapplying it requires you to track which changes
were made by CAS, and what the value was beforehand, and also deal
with after-the-fact setAttribute() and such.

Removing and reinserting would trigger the observer, and rerun all the
CAS applications.

>> (Slight weirdness here - a CAS file can reset its own @src attribute
>> to load *another* CAS file.  A <script> can do the same, though.
>> Acceptable or not?)
>
> A <script> is evaluated once, period.  Changing its @src after it has run
> does not start a new load.

Ah, I didn't realize that.  Sounds good, then.

~TJ

Received on Tuesday, 21 August 2012 18:33:46 UTC