Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-8042 in a recent build.
  1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    80
    Vote Rating
    27
    klodoma1 has a spectacular aura about klodoma1 has a spectacular aura about

      0  

    Default Ext.utils.CSS.getRule - always throws error

    Code:
            getRule: function(selector, refreshCache, rawCache) {            var i;
    
                if (refreshCache) {
                    CSS.refreshCache();
                }
                if (!Ext.isArray(selector)) {
                    return rawCache ? rules[selector.toLowerCase()] : rules[selector.toLowerCase()].cssRule;
                }
                for (i = 0; i < selector.length; i++) {
                    if (rules[selector[i]]) {
                        return rawCache ? rules[selector[i].toLowerCase()] : rules[selector[i].toLowerCase()].cssRule;
                    }
                }
                return null;
    },
    nice refactoring it ALWAYS throws an error.

    rules variable comes from!?

    I think the developer forgot a line like:
    var rules = this.getRules(refreshCache);
    Management means doing the things right,
    Leadership means doing the right things.

    www.interpid.eu, www.webdbadmin.com

  2. #2
    Sencha User
    Join Date
    Sep 2008
    Posts
    80
    Vote Rating
    27
    klodoma1 has a spectacular aura about klodoma1 has a spectacular aura about

      0  

    Default

    This solution works(at least for my cases)


    Code:
            getRule: function(selector, refreshCache, rawCache) {
                var rules = this.getRules(refreshCache),
                i;
    
    
                if (refreshCache) {
                    CSS.refreshCache();
                }
                if (!Ext.isArray(selector)) {
                    return rawCache ? rules[selector.toLowerCase()] : rules[selector.toLowerCase()].cssRule;
                }
                for (i = 0; i < selector.length; i++) {
                    if (rules[selector[i]]) {
                        return rawCache ? rules[selector[i].toLowerCase()] : rules[selector[i].toLowerCase()].cssRule;
                    }
                }
                return null;
            },
    Management means doing the things right,
    Leadership means doing the right things.

    www.interpid.eu, www.webdbadmin.com

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,616
    Vote Rating
    212
    dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of

      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,568
    Vote Rating
    55
    Animal will become famous soon enough Animal will become famous soon enough

      0  

    Default

    Fixed method:

    Code:
    getRule: function(selector, refreshCache, rawCache) {
                var i;
    
                if (!rules || refreshCache) {
                    CSS.refreshCache();
                }
                if (!Ext.isArray(selector)) {
                    return rawCache ? rules[selector.toLowerCase()] : rules[selector.toLowerCase()].cssRule;
                }
                for (i = 0; i < selector.length; i++) {
                    if (rules[selector[i]]) {
                        return rawCache ? rules[selector[i].toLowerCase()] : rules[selector[i].toLowerCase()].cssRule;
                    }
                }
                return null;
            },

Thread Participants: 2