I'm not sure if this is what you want, it works closest to your first pseudo-code where you have an instance of the element, anyway hope this helps:
var proto = Element.prototype;
var slice = Function.call.bind(Array.prototype.slice);
var matches = Function.call.bind(proto.matchesSelector ||
proto.mozMatchesSelector || proto.webkitMatchesSelector ||
proto.msMatchesSelector || proto.oMatchesSelector);
var elementMatchCSSRule = function(element, cssRule) {
return matches(element, cssRule.selectorText);
};
var propertyInCSSRule = function(prop, cssRule) {
return prop in cssRule.style && cssRule.style[prop] !== "";
};
var cssRules = slice(document.styleSheets).reduce(function(rules, styleSheet) {
return rules.concat(slice(styleSheet.cssRules));
}, []);
var bar = document.getElementById("bar");
var elementRules = cssRules.filter(elementMatchCSSRule.bind(null, bar));
hasWidth = elementRules.some(propertyInCSSRule.bind(null, "width"));
, , - , - , cssRules , elementRules, - for , .
ES5 matchesSelector, . , .. - , , , , ..