window.getCSSInterface = function()

in 2020/functional/domCssTest.js [43:62]


window.getCSSInterface = function(type) {
  for (var i = 0; i < document.styleSheets.length; i++) {
    for (var j = 0; j < document.styleSheets[i].cssRules.length; j++) {
      if (document.styleSheets[i].cssRules[j] instanceof type) {
        return document.styleSheets[i].cssRules[j];
      } else if (document.styleSheets[i].cssRules instanceof type) {
        // Some tests may only need a CSSRuleList
        return document.styleSheets[i].cssRules;
      } else if (document.styleSheets[i] instanceof type) {
        // Some tests may only need a CSSStyleSheet
        return document.styleSheets[i];
      } else if (document.styleSheets[i].cssRules[j] instanceof CSSStyleRule &&
          document.styleSheets[i].cssRules[j].style instanceof type) {
        // Some tests may only need a CSSStyleDeclaration
        return document.styleSheets[i].cssRules[j].style;
      }
    }
  }
  return null;
};