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

fix(web components): Fix tests in IE10 #1372

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions test/core_dom/web_components_support.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
/**
* Used to create Javascript Web Components from Dart tests
* Registers Javascript Web Components from Dart tests.
*
* Per HTML5 spec, the prototype object should inherit from `HTMLELement`.
* see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register
*
* Note: __proto__ can not be used as it is not supported in IE10.
*/
function angularTestsRegisterElement(name, prototype) {
// Polymer requires that all prototypes are chained to HTMLElement
// https://github.com/Polymer/CustomElements/issues/121
prototype.__proto__ = HTMLElement.prototype;
prototype.createdCallback = function() {};
document.registerElement(name, {prototype: prototype});
var proto = Object.create(HTMLElement.prototype);
for (var p in prototype) {
if (prototype.hasOwnProperty(p)) {
proto[p] = prototype[p];
}
}
proto.createdCallback = function() {};
document.registerElement(name, {prototype: proto});
}