Last Comment Bug 653645 - css3-animations should not override user or UA !important declarations
: css3-animations should not override user or UA !important declarations
: dev-doc-complete
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
P2 normal (vote)
: mozilla6
Assigned To: David Baron :dbaron: ⌚️UTC-8
: Jet Villegas (:jet)
Depends on: 822766
  Show dependency treegraph
Reported: 2011-04-28 20:20 PDT by David Baron :dbaron: ⌚️UTC-8
Modified: 2015-07-07 05:40 PDT (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (12.00 KB, patch)
2011-04-28 20:20 PDT, David Baron :dbaron: ⌚️UTC-8
bzbarsky: review+
bugzilla: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description User image David Baron :dbaron: ⌚️UTC-8 2011-04-28 20:20:47 PDT
Created attachment 529028 [details] [diff] [review]

One issue that came up in today's security review of css3-animations (and I think the only one that should definitely block release of css3-animations) is that animations should not override user or particularly UA !important declarations.

This patch instead makes them appear as the most important thing in the author level, i.e., between override stylesheet !important rules and user !important rules.  That doesn't necessarily make a huge amount of sense for animations used in a user style sheet, but I think use of animations in a user style sheet will be quite rare... and it's not *horrible*, just a little odd for that case.
Comment 1 User image Boris Zbarsky [:bz] (still a bit busy) 2011-04-29 21:58:02 PDT
Comment on attachment 529028 [details] [diff] [review]

>+// If that rule changes, we should rewrite it to depend on a different rule.

Please add a corresponding comment in forms.css? 

We should probably add an assert somewhere that there's only one animation rule for any given ruletree leaf..  We sort of assert that in ReplaceAnimationRule but maybe we could assert it in rulenode code directly to catch it earliet (e.g. we should never be hitting Transition when both |this| and the new rulenode are animation rules)?

r=me with those changes.
Comment 2 User image David Baron :dbaron: ⌚️UTC-8 2011-04-30 15:34:01 PDT
Comment 3 User image David Baron :dbaron: ⌚️UTC-8 2011-04-30 15:43:39 PDT
Comment on attachment 529028 [details] [diff] [review]

This changes how CSS animations interact with user and UA style sheet rules with !important -- it shouldn't be noticeable except in edge cases, but it's the most important item that came out of the security review for animations, and I'd be uncomfortable shipping animations without this change.
Comment 4 User image Johnathan Nightingale [:johnath] 2011-05-03 14:46:45 PDT
Comment on attachment 529028 [details] [diff] [review]

dbaron asserts this is safe, and an important part of shipping animations with confidence.
Comment 5 User image David Baron :dbaron: ⌚️UTC-8 2011-05-03 15:08:17 PDT
Comment 6 User image Sebastian Zartner [:sebo] 2015-07-07 05:40:36 PDT
A description for this behavior can be found at and is explicitly noted again in the next section.


Note You need to log in before you can comment on or make changes to this bug.