function findMatchingRules(selector, htmlDocument) {
        var result          = new $.Deferred(),
            resultSelectors = [];
        
        // Synchronously search for matches in <style> blocks
        if (htmlDocument) {
            _findMatchingRulesInStyleBlocks(htmlDocument, selector, resultSelectors);
        }
        
        // Asynchronously search for matches in all the project's CSS files
        // (results are appended together in same 'resultSelectors' array)
        _findMatchingRulesInCSSFiles(selector, resultSelectors)
            .done(function () {
                result.resolve(resultSelectors);
            })
            .fail(function (error) {
                result.reject(error);
            });
        
        return result.promise();
    }
Return all rules matching the specified selector.
For Sprint 4, we only look at the rightmost simple selector. For example, searching for ".foo" will 
match these rules:
 .foo {}
 div .foo {}
 div.foo {}
 div .foo[bar="42"] {}
 div .foo:hovered {}
 div .foo::first-child
but will *not* match these rules:
 .foobar {}
 .foo .bar {}
 div .foo .bar {}
 .foo.bar {}

@param {!String} selector The selector to match. This can be a tag selector, class selector or id selector
@param {?Document} htmlDocument An HTML file for context (so we can search <style> blocks)
@return {$.Promise} that will be resolved with an Array of objects containing the
     source document, start line, and end line (0-based, inclusive range) for each matching declaration list.
     Does not addRef() the documents returned in the array.