lib/kissy/5.0.0-alpha.3/build/stylesheet-debug.js
function StyleSheet(el) {
        /**
     * style/link element or selector
     * @cfg {HTMLElement|String} el
     */
        /**
     * style/link element
     * @type {HTMLElement}
     * @property el
     */
        if (el.el) {
            el = el.el;
        }
        el = this.el = Dom.get(el);    // http://msdn.microsoft.com/en-us/library/ie/ms535871(v=vs.85).aspx
                                       // firefox 跨域时抛出异常
        // http://msdn.microsoft.com/en-us/library/ie/ms535871(v=vs.85).aspx
        // firefox 跨域时抛出异常
        var sheet = el.sheet || el.styleSheet;
        this.sheet = sheet;
        var cssRules = {};
        this.cssRules = cssRules;
        var rulesName = sheet && 'cssRules' in sheet ? 'cssRules' : 'rules';
        this.rulesName = rulesName;
        var domCssRules = sheet[rulesName];
        var i, rule, selectorText, styleDeclaration;
        for (i = domCssRules.length - 1; i >= 0; i--) {
            rule = domCssRules[i];
            selectorText = rule.selectorText;    // 去重
            // 去重
            if (styleDeclaration = cssRules[selectorText]) {
                styleDeclaration.style.cssText += ';' + styleDeclaration.style.cssText;
                deleteRule(sheet, i);
            } else {
                cssRules[selectorText] = rule;
            }
        }
    }
function StyleSheet(el) {
        /**
     * style/link element or selector
     * @cfg {HTMLElement|String} el
     */
        /**
     * style/link element
     * @type {HTMLElement}
     * @property el
     */
        if (el.el) {
            el = el.el;
        }
        el = this.el = Dom.get(el);    // http://msdn.microsoft.com/en-us/library/ie/ms535871(v=vs.85).aspx
                                       // firefox 跨域时抛出异常
        // http://msdn.microsoft.com/en-us/library/ie/ms535871(v=vs.85).aspx
        // firefox 跨域时抛出异常
        var sheet = el.sheet || el.styleSheet;
        this.sheet = sheet;
        var cssRules = {};
        this.cssRules = cssRules;
        var rulesName = sheet && 'cssRules' in sheet ? 'cssRules' : 'rules';
        this.rulesName = rulesName;
        var domCssRules = sheet[rulesName];
        var i, rule, selectorText, styleDeclaration;
        for (i = domCssRules.length - 1; i >= 0; i--) {
            rule = domCssRules[i];
            selectorText = rule.selectorText;    // 去重
            // 去重
            if (styleDeclaration = cssRules[selectorText]) {
                styleDeclaration.style.cssText += ';' + styleDeclaration.style.cssText;
                deleteRule(sheet, i);
            } else {
                cssRules[selectorText] = rule;
            }
        }
    }
function StyleSheet ( el ) { /**
     * style/link element or selector
     * @cfg {HTMLElement|String} el
     */ /**
     * style/link element
     * @type {HTMLElement}
     * @property el
     */ if ( el . el ) { el = el . el ; } el = this . el = Dom . get ( el ) ; // http://msdn.microsoft.com/en-us/library/ie/ms535871(v=vs.85).aspx // firefox 跨域时抛出异常 // http://msdn.microsoft.com/en-us/library/ie/ms535871(v=vs.85).aspx // firefox 跨域时抛出异常 var sheet = el . sheet || el . styleSheet ; this . sheet = sheet ; var cssRules = { } ; this . cssRules = cssRules ; var rulesName = sheet && 'cssRules' in sheet ? 'cssRules' : 'rules' ; this . rulesName = rulesName ; var domCssRules = sheet [ rulesName ] ; var i , rule , selectorText , styleDeclaration ; for ( i = domCssRules . length - 1 ; i >= 0 ; i -- ) { rule = domCssRules [ i ] ; selectorText = rule . selectorText ; // 去重 // 去重 if ( styleDeclaration = cssRules [ selectorText ] ) { styleDeclaration . style . cssText += ';' + styleDeclaration . style . cssText ; deleteRule ( sheet , i ) ; } else { cssRules [ selectorText ] = rule ; } } }
Normalize operation about stylesheet
@class KISSY.StyleSheet
@param el {HTMLElement} style/link element
 
Normalize operation about stylesheet
@class KISSY.StyleSheet
@param el {HTMLElement} style/link element
Normalize operation about stylesheet