Created attachment 586664 [details] js_snippet_bugreport.js User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0 Build ID: 20111216140209 Steps to reproduce: I did the following steps with JS in a regular html document (no FF extension): === I programmatically created a StyleSheet node, inserted a new CSSKeyframesRule (with an initial rule) into which I also inserted a new CSSKeyframeRule. Then I accessed the CSSStyleDeclaration attributes of both CSSKeyframeRules and tried to change its `cssText` and/or one of its style properties. === The JS code I used to accomplish the outlined steps are available in the attached file and on Mozilla's pastebin: http://pastebin.mozilla.org/1438111 Actual results: Changing `cssText`/style props of the 'initial' CSSKeyframeRule worked as expected. But the newly created CSSKeyframeRule neither has a valid value for `parentRule` nor one for `parentStyleSheet` -- both are null. When I try to change its `cssText` attribute or one of its style properties, exceptions are thrown. (Error: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCSSStyleDeclaration.cssText]) Expected results: `parentRule` and `parentStyleSheet` of the newly created CSSKeyframeRule should point to the according instances and changing `cssText` or a style property should be possible without throwing an exception.
5 years ago
nsCSSKeyframesRule::InsertRule just appends the new rule to mRules for some reason. That's broken. It should call AppendStyleRule instead.
Created attachment 587716 [details] [diff] [review] When using insertRule on a keyframes rule, set up the child keyframe rule correctly.
petabyte, thanks for the bug report and the testcase!
I thank *you* for providing a fix so quickly. :) It's the first time I filed a bug in here, so I have no experience about how long it takes until a fix usually lands ... can you estimate how long it will take until your fix will be part of a nightly/beta build? (just roughly)
That basically depends on how long it takes for David Baron to look over the patch and review it. Could be anywhere from a few hours to a few months, depending on what else is on his plate. If this is causing serious problems, I can ask him to see what he can do to expedite the review; the actual time needed to review this shouldn't be that high. Once he reviews the patch, it'll probably take me less than a day to land it; it'll show up in a nightly at that point.
Comment on attachment 587716 [details] [diff] [review] When using insertRule on a keyframes rule, set up the child keyframe rule correctly. r=dbaron
Well, that answers that question. ;) This should be in tomorrow's (Jan 12, PST) nightlies. https://hg.mozilla.org/integration/mozilla-inbound/rev/d28ab93ab623
... which means actually the Jan 13 nightlies.