Note: There are a few cases of duplicates in user autocompletion which are being worked on.

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

RESOLVED FIXED in mozilla12

Status

()

Core
DOM: CSS Object Model
P3
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: petabyte, Assigned: bz)

Tracking

Trunk
mozilla12
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
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.
(Reporter)

Updated

6 years ago
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
(Assignee)

Updated

6 years ago
Attachment #586664 - Attachment mime type: application/octet-stream → text/plain
(Assignee)

Comment 1

6 years ago
nsCSSKeyframesRule::InsertRule just appends the new rule to mRules for some reason.  That's broken.  It should call AppendStyleRule instead.
(Assignee)

Comment 2

6 years ago
Created attachment 587716 [details] [diff] [review]
When using insertRule on a keyframes rule, set up the child keyframe rule correctly.
Attachment #587716 - Flags: review?(dbaron)
(Assignee)

Comment 3

6 years ago
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
(Reporter)

Comment 4

6 years ago
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)
(Assignee)

Comment 5

6 years ago
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+
(Assignee)

Comment 7

6 years ago
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
(Reporter)

Comment 8

6 years ago
Yay! :-)
https://hg.mozilla.org/mozilla-central/rev/d28ab93ab623
Status: NEW → RESOLVED
Last Resolved: 6 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.