Closed Bug 1029078 Opened 10 years ago Closed 10 years ago

cssRules.selectorText @ media

Categories

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

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jab_creations, Unassigned)

Details

Gecko's cssRules.selectorText can't handle @media. The following messes up cssRules.selectorText...

 - - -

@keyframes emergency {0% {color: #f00;} 50% {color: #600;} 100% {color: #f00;}}

 - - -

I'm not entirely certain that it technically counts as a selector (it at least appears to be so).

Tested in Firefox 32 nightly (that build about two weeks old at the time of this post).

 - - -

Using the following is a temporary work-around for this bug...

     var r = document.styleSheets[0].cssRules;
     for (var j = 0; j <= r.length - 1; j++)
     {
      if (r[j].selectorText!=undefined) {alert(j+' = '+r[j].selectorText.toLowerCase());}
     }
selectorText is a property on CSSStyleRule.

Neither @media nor @keyframes rules (which one _did_ you mean) are StyleRule instances.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.