<link rel="import" href="../lib/x-style.html">
<script>
(function() {

  var transformer = document.createElement('style', 'x-style');

  var styleProtector = {

    scopeDocumentSheets: function() {
      this.scopeSheets(this.getSheetsToScope());
    },
    
    getSheetsToScope: function() {
      var s$ = document.styleSheets;
      return Array.prototype.filter.call(s$, function(s) {
        return s.ownerNode.hasAttribute(this.SCOPE_ATTR);
      }, this);
    },

    scopeSheets: function(sheets) {
  