Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
fixed Android 2 and 4 and IE9 Mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Aug 18, 2016
1 parent b69c87b commit 74f93fd
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 33 deletions.
2 changes: 1 addition & 1 deletion build/document-register-element.amd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/document-register-element.js

Large diffs are not rendered by default.

35 changes: 26 additions & 9 deletions build/document-register-element.max.amd.js
Expand Up @@ -512,16 +512,32 @@ var
}
};
},
Promise = window.Promise || function (fn) {
var
notify = [],
done = false,
p = {
'catch': function () {
return p;
},
'then': function (cb) {
notify.push(cb);
if (done) setTimeout(resolve, 1);
return p;
}
}
;
function resolve(value) {
done = true;
while (notify.length) notify.shift()(value);
}
fn(resolve);
return p;
},
justCreated = false,
constructors = Dict(null),
waitingList = Dict(null),
nodeNames = new Map(),
/*
bind = Object.bind || function () {
var fn = this;
return function () { return fn.call(this); };
},
*/

// used to create unique instances
create = Object.create || function Bridge(proto) {
Expand Down Expand Up @@ -1233,12 +1249,13 @@ function whenDefined(name) {
}

try {
(function (DRE) {
(function (DRE, options) {
options[EXTENDS] = 'a';
setPrototype(DRE.prototype, HTMLAnchorElement.prototype);
customElements.define('document-register-element-a', DRE, {extends: 'a'});
customElements.define('document-register-element-a', DRE, options);
documentElement.insertBefore((DRE = new DRE()), documentElement.firstChild);
documentElement.removeChild(DRE);
}(function () {}));
}(function () {}, {}));
} catch(o_O) {
delete window.customElements;
defineProperty(window, 'customElements', {
Expand Down
35 changes: 26 additions & 9 deletions build/document-register-element.max.js
Expand Up @@ -510,16 +510,32 @@ var
}
};
},
Promise = window.Promise || function (fn) {
var
notify = [],
done = false,
p = {
'catch': function () {
return p;
},
'then': function (cb) {
notify.push(cb);
if (done) setTimeout(resolve, 1);
return p;
}
}
;
function resolve(value) {
done = true;
while (notify.length) notify.shift()(value);
}
fn(resolve);
return p;
},
justCreated = false,
constructors = Dict(null),
waitingList = Dict(null),
nodeNames = new Map(),
/*
bind = Object.bind || function () {
var fn = this;
return function () { return fn.call(this); };
},
*/

// used to create unique instances
create = Object.create || function Bridge(proto) {
Expand Down Expand Up @@ -1231,12 +1247,13 @@ function whenDefined(name) {
}

try {
(function (DRE) {
(function (DRE, options) {
options[EXTENDS] = 'a';
setPrototype(DRE.prototype, HTMLAnchorElement.prototype);
customElements.define('document-register-element-a', DRE, {extends: 'a'});
customElements.define('document-register-element-a', DRE, options);
documentElement.insertBefore((DRE = new DRE()), documentElement.firstChild);
documentElement.removeChild(DRE);
}(function () {}));
}(function () {}, {}));
} catch(o_O) {
delete window.customElements;
defineProperty(window, 'customElements', {
Expand Down
5 changes: 1 addition & 4 deletions index.html
Expand Up @@ -8,11 +8,8 @@
<meta names="apple-mobile-web-app-status-bar-style" content="black"/>
<!--[if lte IE 9]><script>(function(f){window.setTimeout=f(window.setTimeout);window.setInterval=f(window.setInterval)})(function(f){return function(c,t){var a=[].slice.call(arguments,2);return f(function(){c.apply(this,a)},t)}});</script><![endif]-->
<!--[if IE 8]><script src="//cdnjs.cloudflare.com/ajax/libs/ie8/0.2.3/ie8.js"></script><![endif]-->
<script src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.4.5/dom4.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.8.3/dom4.js"></script>
<!--[if IE 8]><script src="build/dre-ie8-upfront-fix.js"></script><![endif]-->
<script>window.module = {};</script>
<script src="http://npmcdn.com/promise-pjs@1.1.2/promise.js"></script>
<script>if (!window.Promise) window.Promise = module.exports; delete window.module;</script>
<script src="build/document-register-element.max.js"></script>
<script src="build/innerHTML.max.js"></script>
<script>
Expand Down
35 changes: 26 additions & 9 deletions src/document-register-element.js
Expand Up @@ -88,16 +88,32 @@ var
}
};
},
Promise = window.Promise || function (fn) {
var
notify = [],
done = false,
p = {
'catch': function () {
return p;
},
'then': function (cb) {
notify.push(cb);
if (done) setTimeout(resolve, 1);
return p;
}
}
;
function resolve(value) {
done = true;
while (notify.length) notify.shift()(value);
}
fn(resolve);
return p;
},
justCreated = false,
constructors = Dict(null),
waitingList = Dict(null),
nodeNames = new Map(),
/*
bind = Object.bind || function () {
var fn = this;
return function () { return fn.call(this); };
},
*/

// used to create unique instances
create = Object.create || function Bridge(proto) {
Expand Down Expand Up @@ -809,12 +825,13 @@ function whenDefined(name) {
}

try {
(function (DRE) {
(function (DRE, options) {
options[EXTENDS] = 'a';
setPrototype(DRE.prototype, HTMLAnchorElement.prototype);
customElements.define('document-register-element-a', DRE, {extends: 'a'});
customElements.define('document-register-element-a', DRE, options);
documentElement.insertBefore((DRE = new DRE()), documentElement.firstChild);
documentElement.removeChild(DRE);
}(function () {}));
}(function () {}, {}));
} catch(o_O) {
delete window.customElements;
defineProperty(window, 'customElements', {
Expand Down

0 comments on commit 74f93fd

Please sign in to comment.