src/aria/templates/CSSMgr.js
function (tplClasspath, cssClasspath, contextArgs) {
            this.$assert(195, tplClasspath && cssClasspath);

            // Do something only if this CSS class is not yet loaded
            var usage = this.__cssUsage[cssClasspath];
            if (usage && usage.length) {
                usage.push(tplClasspath);
                this.__pathsLoaded.push(cssClasspath);
                if (!this.__invalidClasspaths[cssClasspath]) {
                    return [];
                }
            } else {
                this.__cssUsage[cssClasspath] = [tplClasspath];
            }

            // Starting from here, nobody is using this css, it should also be added to the DOM

            // classpath may be invalid but not currently used
            delete this.__invalidClasspaths[cssClasspath];

            var cssCtxt = ariaTemplatesCSSCtxtManager.getContext(cssClasspath, contextArgs);
            // Give a prefix to the Global file in order to have higher priority
            if (cssClasspath == "aria.templates.GlobalStyle" || cssClasspath == "aria.templates.LegacyGeneralStyle"
                    || cssClasspath == "aria.widgets.GlobalStyle") {
                this.__getPrefix(cssClasspath);
            }
            if (cssCtxt.doPrefixing()) {
                var prefixClass = this.__getPrefix(cssClasspath);
                cssCtxt.prefixText(prefixClass);
            }

            // Remember the text to be loaded
            this.__textLoaded[cssClasspath] = {
                text : cssCtxt.getText(),
                lines : cssCtxt.getNumLines()
            };

            // Build the association between this classpath and a style tag
            var styleTag = this.__getStyleTag(cssCtxt);
            this.__styleTagAssociation[cssClasspath] = styleTag;

            this.__pathsLoaded.push(cssClasspath);
            return [styleTag];
        }
function (tplClasspath, cssClasspath, contextArgs) {
            this.$assert(195, tplClasspath && cssClasspath);

            // Do something only if this CSS class is not yet loaded
            var usage = this.__cssUsage[cssClasspath];
            if (usage && usage.length) {
                usage.push(tplClasspath);
                this.__pathsLoaded.push(cssClasspath);
                if (!this.__invalidClasspaths[cssClasspath]) {
                    return [];
                }
            } else {
                this.__cssUsage[cssClasspath] = [tplClasspath];
            }

            // Starting from here, nobody is using this css, it should also be added to the DOM

            // classpath may be invalid but not currently used
            delete this.__invalidClasspaths[cssClasspath];

            var cssCtxt = ariaTemplatesCSSCtxtManager.getContext(cssClasspath, contextArgs);
            // Give a prefix to the Global file in order to have higher priority
            if (cssClasspath == "aria.templates.GlobalStyle" || cssClasspath == "aria.templates.LegacyGeneralStyle"
                    || cssClasspath == "aria.widgets.GlobalStyle") {
                this.__getPrefix(cssClasspath);
            }
            if (cssCtxt.doPrefixing()) {
                var prefixClass = this.__getPrefix(cssClasspath);
                cssCtxt.prefixText(prefixClass);
            }

            // Remember the text to be loaded
            this.__textLoaded[cssClasspath] = {
                text : cssCtxt.getText(),
                lines : cssCtxt.getNumLines()
            };

            // Build the association between this classpath and a style tag
            var styleTag = this.__getStyleTag(cssCtxt);
            this.__styleTagAssociation[cssClasspath] = styleTag;

            this.__pathsLoaded.push(cssClasspath);
            return [styleTag];
        }
function ( tplClasspath , cssClasspath , contextArgs ) { this . $assert ( 195 , tplClasspath && cssClasspath ) ; // Do something only if this CSS class is not yet loaded var usage = this . __cssUsage [ cssClasspath ] ; if ( usage && usage . length ) { usage . push ( tplClasspath ) ; this . __pathsLoaded . push ( cssClasspath ) ; if ( ! this . __invalidClasspaths [ cssClasspath ] ) { return [ ] ; } } else { this . __cssUsage [ cssClasspath ] = [ tplClasspath ] ; } // Starting from here, nobody is using this css, it should also be added to the DOM // classpath may be invalid but not currently used delete this . __invalidClasspaths [ cssClasspath ] ; var cssCtxt = ariaTemplatesCSSCtxtManager . getContext ( cssClasspath , contextArgs ) ; // Give a prefix to the Global file in order to have higher priority if ( cssClasspath == "aria.templates.GlobalStyle" || cssClasspath == "aria.templates.LegacyGeneralStyle" || cssClasspath == "aria.widgets.GlobalStyle" ) { this . __getPrefix ( cssClasspath ) ; } if ( cssCtxt . doPrefixing ( ) ) { var prefixClass = this . __getPrefix ( cssClasspath ) ; cssCtxt . prefixText ( prefixClass ) ; } // Remember the text to be loaded this . __textLoaded [ cssClasspath ] = { text : cssCtxt . getText ( ) , lines : cssCtxt . getNumLines ( ) } ; // Build the association between this classpath and a style tag var styleTag = this . __getStyleTag ( cssCtxt ) ; this . __styleTagAssociation [ cssClasspath ] = styleTag ; this . __pathsLoaded . push ( cssClasspath ) ; return [ styleTag ] ; }
Mark a CSS template dependency as "to be loaded". If it's already loaded this will simply register a new
dependency, otherwise it will buffer the changes that should be applied to the style tag or the pool of
styles
@param {String} tplClasspath Template classpath
@param {String} cssClasspath CSS template classpath
@return {Array} An array of tag pool's id that require a refresh
@private
Mark a CSS template dependency as to be loaded . If it s already loaded this will simply register a new dependency otherwise it will buffer the changes that should be applied to the style tag or the pool of styles