Closed Bug 716226 Opened 13 years ago Closed 12 years ago

CSSKeyframeRule created by CSSKeyframesRule.insertRule has invalid value for parentRule/parentStyleSheet and doesn't allow changes to its CSSStyleDeclaration attrib

Categories

(Core :: DOM: CSS Object Model, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: 256petabyte, Assigned: bzbarsky)

Details

Attachments

(2 files)

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.
Summary: CSSKeyframeRule created by CSSKeyframesRule.insertRule has invalid value for parentRule/parentStyleSheet → CSSKeyframeRule created by CSSKeyframesRule.insertRule has invalid value for parentRule/parentStyleSheet and doesn't allow changes to its CSSStyleDeclaration attrib
Attachment #586664 - Attachment mime type: application/octet-stream → text/plain
nsCSSKeyframesRule::InsertRule just appends the new rule to mRules for some reason.  That's broken.  It should call AppendStyleRule instead.
petabyte, thanks for the bug report and the testcase!
Assignee: nobody → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
Version: 9 Branch → Trunk
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
Attachment #587716 - Flags: review?(dbaron) → review+
Well, that answers that question.  ;)  This should be in tomorrow's (Jan 12, PST) nightlies.

https://hg.mozilla.org/integration/mozilla-inbound/rev/d28ab93ab623
Flags: in-testsuite+
Target Milestone: --- → mozilla12
Yay! :-)
https://hg.mozilla.org/mozilla-central/rev/d28ab93ab623
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
... which means actually the Jan 13 nightlies.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: