Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Explicitly read/write ShadowDOMPolyfill on window
Browse files Browse the repository at this point in the history
Breaks when executed inside non-top level window
context.
  • Loading branch information
timoxley committed Oct 28, 2013
1 parent 3888683 commit 8624ed2
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/ShadowRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,4 +659,4 @@
remove: remove,
};

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/querySelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
scope.GetElementsByInterface = GetElementsByInterface;
scope.SelectorsInterface = SelectorsInterface;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
4 changes: 2 additions & 2 deletions src/wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is goverened by a BSD-style
// license that can be found in the LICENSE file.

var ShadowDOMPolyfill = {};
window.ShadowDOMPolyfill = {};

(function(scope) {
'use strict';
Expand Down Expand Up @@ -370,4 +370,4 @@ var ShadowDOMPolyfill = {};
scope.wrapIfNeeded = wrapIfNeeded;
scope.wrappers = wrappers;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/CanvasRenderingContext2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingContext2D);

scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/CharacterData.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
document.createTextNode(''));

scope.wrappers.CharacterData = CharacterData;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,4 @@
scope.wrappers.DOMImplementation = DOMImplementation;
scope.wrappers.Document = Document;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@
// that reflect attributes.
scope.matchesName = matchesName;
scope.wrappers.Element = Element;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/HTMLCanvasElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
document.createElement('canvas'));

scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/HTMLContentElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
registerWrapper(OriginalHTMLContentElement, HTMLContentElement);

scope.wrappers.HTMLContentElement = HTMLContentElement;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/HTMLElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,4 @@
// TODO: Find a better way to share these two with WrapperShadowRoot.
scope.getInnerHTML = getInnerHTML;
scope.setInnerHTML = setInnerHTML
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/HTMLImageElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@

scope.wrappers.HTMLImageElement = HTMLImageElement;
scope.wrappers.Image = Image;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/HTMLShadowElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
registerWrapper(OriginalHTMLShadowElement, HTMLShadowElement);

scope.wrappers.HTMLShadowElement = HTMLShadowElement;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/HTMLTemplateElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@
registerWrapper(OriginalHTMLTemplateElement, HTMLTemplateElement);

scope.wrappers.HTMLTemplateElement = HTMLTemplateElement;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/HTMLUnknownElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
HTMLUnknownElement.prototype = Object.create(HTMLElement.prototype);
registerWrapper(OriginalHTMLUnknownElement, HTMLUnknownElement);
scope.wrappers.HTMLUnknownElement = HTMLUnknownElement;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/MutationObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
scope.wrappers.MutationObserver = MutationObserver;
scope.wrappers.MutationRecord = MutationRecord;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,4 +494,4 @@

scope.wrappers.Node = Node;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/NodeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
scope.addWrapNodeListMethod = addWrapNodeListMethod;
scope.wrapNodeList = wrapNodeList;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/Range.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@

scope.wrappers.Range = Range;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/ShadowRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
scope.getHostForShadowRoot = function(node) {
return shadowHostTable.get(node);
};
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/WebGLRenderingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
registerWrapper(OriginalWebGLRenderingContext, WebGLRenderingContext);

scope.wrappers.WebGLRenderingContext = WebGLRenderingContext;
})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@

scope.wrappers.Window = Window;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/elements-with-form-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@

elementsWithFormProperty.forEach(createWrapperConstructor);

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,4 +746,4 @@
scope.wrappers.MutationEvent = MutationEvent;
scope.wrappers.UIEvent = UIEvent;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
scope.wrappers.DocumentFragment = DocumentFragment;
scope.wrappers.Text = Text;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/node-interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
scope.ChildNodeInterface = ChildNodeInterface;
scope.ParentNodeInterface = ParentNodeInterface;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);
2 changes: 1 addition & 1 deletion src/wrappers/override-constructors.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@
// Export for testing.
scope.knownElements = elements;

})(this.ShadowDOMPolyfill);
})(window.ShadowDOMPolyfill);

0 comments on commit 8624ed2

Please sign in to comment.