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

Commit 8624ed2

Browse files
committed
Explicitly read/write ShadowDOMPolyfill on window
Breaks when executed inside non-top level window context.
1 parent 3888683 commit 8624ed2

26 files changed

+27
-27
lines changed

src/ShadowRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,4 +659,4 @@
659659
remove: remove,
660660
};
661661

662-
})(this.ShadowDOMPolyfill);
662+
})(window.ShadowDOMPolyfill);

src/querySelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@
7070
scope.GetElementsByInterface = GetElementsByInterface;
7171
scope.SelectorsInterface = SelectorsInterface;
7272

73-
})(this.ShadowDOMPolyfill);
73+
})(window.ShadowDOMPolyfill);

src/wrappers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is goverened by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
var ShadowDOMPolyfill = {};
5+
window.ShadowDOMPolyfill = {};
66

77
(function(scope) {
88
'use strict';
@@ -370,4 +370,4 @@ var ShadowDOMPolyfill = {};
370370
scope.wrapIfNeeded = wrapIfNeeded;
371371
scope.wrappers = wrappers;
372372

373-
})(this.ShadowDOMPolyfill);
373+
})(window.ShadowDOMPolyfill);

src/wrappers/CanvasRenderingContext2D.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingContext2D);
3636

3737
scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;
38-
})(this.ShadowDOMPolyfill);
38+
})(window.ShadowDOMPolyfill);

src/wrappers/CharacterData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
document.createTextNode(''));
3232

3333
scope.wrappers.CharacterData = CharacterData;
34-
})(this.ShadowDOMPolyfill);
34+
})(window.ShadowDOMPolyfill);

src/wrappers/Document.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,4 @@
281281
scope.wrappers.DOMImplementation = DOMImplementation;
282282
scope.wrappers.Document = Document;
283283

284-
})(this.ShadowDOMPolyfill);
284+
})(window.ShadowDOMPolyfill);

src/wrappers/Element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@
114114
// that reflect attributes.
115115
scope.matchesName = matchesName;
116116
scope.wrappers.Element = Element;
117-
})(this.ShadowDOMPolyfill);
117+
})(window.ShadowDOMPolyfill);

src/wrappers/HTMLCanvasElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
document.createElement('canvas'));
2929

3030
scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;
31-
})(this.ShadowDOMPolyfill);
31+
})(window.ShadowDOMPolyfill);

src/wrappers/HTMLContentElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
registerWrapper(OriginalHTMLContentElement, HTMLContentElement);
3939

4040
scope.wrappers.HTMLContentElement = HTMLContentElement;
41-
})(this.ShadowDOMPolyfill);
41+
})(window.ShadowDOMPolyfill);

src/wrappers/HTMLElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,4 @@
197197
// TODO: Find a better way to share these two with WrapperShadowRoot.
198198
scope.getInnerHTML = getInnerHTML;
199199
scope.setInnerHTML = setInnerHTML
200-
})(this.ShadowDOMPolyfill);
200+
})(window.ShadowDOMPolyfill);

0 commit comments

Comments
 (0)