Closed Bug 62607 Opened 24 years ago Closed 24 years ago

cssText field of CSSRule is incomplete

Categories

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

defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: david, Assigned: glazou)

References

Details

Attachments

(3 files)

If you look at the cssText field of a CSSRule object, you get a string like
"font-family: sanserif;"--a string that only contains the style description,
but not the selectors.  I'm pretty sure that the DOM standard intends for
this property to return the entire contents of the rule, something like "P {
font-family: sanserif;}"

It looks to me like CSSRule.cssText is returning what
CSSStyleDeclaration.cssText ought to return.
Keywords: correctness
Attached file testcase
See also bug #62611, bug #62612, bug#62613
This bug has been marked "future" because the original netscape engineer
workingon this is over-burdened. If you feel this is an error, that you or
another known resource will be working on this bug,or if it blocks your work in
some way -- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Future
Adding dependency to 52381
Depends on: 52381
Proposing trivial patch for missing curly braces around the declaration.

According to DOM2, CSSDeclaration.cssText is "the parsable representation of the
declaration block (excluding the surrounding curly braces)." and
CSSStyleRule.cssText is "the parsable representation of the rule".
Then David's interpretation is correct, all the rule should be replied,
including selectors and the rest.
Accepting bug. Proposing new patch because the output of curly braces must be
done even if there is no declaration. r= needed.

BTW, it seems that the parser does not store a rule with no declarations like "P
{ }"... I guess it is for performance reasons but should such a rule be
accessible by DOM 2 CSS ?
Assignee: jst → glazman
Status: ASSIGNED → NEW
r=brade
sr=attinasi
checked in
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Component: DOM Level 2 → DOM Style
Taking QA Contact on all open or unverified DOM Style bugs...
QA Contact: vidur → ian
v based on test case
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: