W3C home > Mailing lists > Public > www-style@w3.org > November 2011

Re: [css3-animations] scope of keyframes and OM issues

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 24 Nov 2011 19:32:05 -0800
Message-ID: <CAAWBYDDd4fJef=MwBWmd=-bYtzEPJH09H4qR2sR1co1ZgzTHZA@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style <www-style@w3.org>, Anne van Kesteren <annevk@opera.com>
On Thu, Nov 24, 2011 at 12:29 AM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> (cc:ing AVK for the OM part)
>
> It seems that nothing is told in CSS 3 Animations about the scope
> of a @keyframes rule. Limited to a stylesheet or to the whole
> document?

Consistency with both other specifications (like @font-face) and all
existing implementations says whole-document.

[snip 2 examples]

Given my above paragraph, yes, both of those are animated.


> 3. can @keyframes be contained inside another at-rule, for instance
>   @media? WebKit accepts it, Gecko does not.

They should be able to be nested.  Off the top of my head, I think
that Gecko is actually following the current grammar specs, though,
which disallow it.  Conditionals is changing this to allow it.


> AFAICT, both WebKit and Gecko animate the paragraphs, making animations
> document-wide. I'm fine with that BUT
>
> a. there should be some prose about it in the spec and unless I missed
>   it, there isn't.
>
> b. the nested @-rule case has to be discussed and resolved.

Agreed on both.

> c. I would like to have a new API *for instance* on the document
>   giving access to the applicable @keyframes (if two keyframes have
>   same name, only last one applies, right?).
>
>   Something like
>
>     partial interface Document {
>       readonly attribute CSSRuleList keyframesRuleList;
>     }
>
>   Without that, discovering all animations in a document is tricky
>   and expensive.

Yes, this sort of thing would be useful.  I had something similar
proposed for the old @var form of rules, for the same reason.  I think
we should see about minting a "namespace" object for CSS functions
like this, so we can use nice short names like
"document.CSS.keyframes".  (This would also help with things like the
Values OM, so we can have nice short constructors instead of the
horrible long names currently in the draft. ^_^)

~TJ
Received on Friday, 25 November 2011 03:33:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT