src/LiveDevelopment/Agents/CSSAgent.js
function reloadCSSForDocument(doc, newContent) {
        var styles = styleForURL(doc.url),
            styleSheetId,
            deferreds = [];

        if (newContent === undefined) {
            newContent = doc.getText();
        }
        for (styleSheetId in styles) {
            deferreds.push(Inspector.CSS.setStyleSheetText(styles[styleSheetId].styleSheetId, newContent));
        }
        if (!deferreds.length) {
            console.error("Style Sheet for document not loaded: " + doc.url);
            return new $.Deferred().reject().promise();
        }
        // return master deferred
        return $.when.apply($, deferreds);
    }
function reloadCSSForDocument(doc, newContent) {
        var styles = styleForURL(doc.url),
            styleSheetId,
            deferreds = [];

        if (newContent === undefined) {
            newContent = doc.getText();
        }
        for (styleSheetId in styles) {
            deferreds.push(Inspector.CSS.setStyleSheetText(styles[styleSheetId].styleSheetId, newContent));
        }
        if (!deferreds.length) {
            console.error("Style Sheet for document not loaded: " + doc.url);
            return new $.Deferred().reject().promise();
        }
        // return master deferred
        return $.when.apply($, deferreds);
    }
function reloadCSSForDocument ( doc , newContent ) { var styles = styleForURL ( doc . url ) , styleSheetId , deferreds = [ ] ; if ( newContent === undefined ) { newContent = doc . getText ( ) ; } for ( styleSheetId in styles ) { deferreds . push ( Inspector . CSS . setStyleSheetText ( styles [ styleSheetId ] . styleSheetId , newContent ) ) ; } if ( ! deferreds . length ) { console . error ( "Style Sheet for document not loaded: " + doc . url ) ; return new $ . Deferred ( ) . reject ( ) . promise ( ) ; } // return master deferred return $ . when . apply ( $ , deferreds ) ; }
Reload a CSS style sheet from a document
@param {Document} document
@param {string=} newContent new content of every stylesheet. Defaults to doc.getText() if omitted
@return {jQuery.Promise}
Reload a CSS style sheet from a document