cssRules.selectorText @ media

RESOLVED INVALID

Status

()

Core
DOM: CSS Object Model
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: John A. Bilicki III, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
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
Last Resolved: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.