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

Commit 5e4cd63

Browse files
author
Andrea Giammarchi
committed
fixed #110 - Chrome 67 will not be patched at all
1 parent 33fd301 commit 5e4cd63

16 files changed

+169
-142
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
2-
node_modules/
2+
node_modules/
3+
package-lock.json

.npmignore

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
Makefile
1+
build/*.amd.js
2+
examples/
3+
node_modules/
4+
src/
5+
template/
6+
test/
7+
.gitignore
8+
.npmignore
9+
.travis.yml
10+
bower.json
211
index.html
12+
Makefile
13+
package-lock.json
314
testrunner.js
4-
bower.json
5-
src
6-
test
7-
template
8-
node_modules
9-
examples
10-
build/*.amd.js
15+
yarn.lock

build/document-register-element.amd.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/document-register-element.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/document-register-element.max.amd.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
/*!
2+
ISC License
23
3-
Copyright (C) 2014-2016 by Andrea Giammarchi - @WebReflection
4+
Copyright (c) 2014-2018, Andrea Giammarchi, @WebReflection
45
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Permission to use, copy, modify, and/or distribute this software for any
7+
purpose with or without fee is hereby granted, provided that the above
8+
copyright notice and this permission notice appear in all copies.
119
12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
2217
2318
*/
2419
define(function(polyfill){'use strict';
@@ -702,6 +697,8 @@ define(function(polyfill){'use strict';
702697
// IE11 disconnectedCallback issue #
703698
// to be tested before any createElement patch
704699
if (MutationObserver) {
700+
// original fix:
701+
// https://github.com/javan/mutation-observer-inner-html-shim
705702
tmp = document.createElement('div');
706703
tmp.innerHTML = '<div><div></div></div>';
707704
new MutationObserver(function (mutations, observer) {
@@ -1439,13 +1436,14 @@ define(function(polyfill){'use strict';
14391436
// if available test extends work as expected
14401437
try {
14411438
(function (DRE, options, name) {
1439+
var re = new RegExp('^<a\\s+is=(\'|")' + name + '\\1></a>$');
14421440
options[EXTENDS] = 'a';
14431441
DRE.prototype = create(HTMLAnchorElement.prototype);
14441442
DRE.prototype.constructor = DRE;
14451443
window.customElements.define(name, DRE, options);
14461444
if (
1447-
getAttribute.call(document.createElement('a', {is: name}), 'is') !== name ||
1448-
(usableCustomElements && getAttribute.call(new DRE(), 'is') !== name)
1445+
!re.test(document.createElement('a', {is: name}).outerHTML) ||
1446+
!re.test((new DRE()).outerHTML)
14491447
) {
14501448
throw options;
14511449
}

build/document-register-element.max.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
/*!
2+
ISC License
23
3-
Copyright (C) 2014-2016 by Andrea Giammarchi - @WebReflection
4+
Copyright (c) 2014-2018, Andrea Giammarchi, @WebReflection
45
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Permission to use, copy, modify, and/or distribute this software for any
7+
purpose with or without fee is hereby granted, provided that the above
8+
copyright notice and this permission notice appear in all copies.
119
12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
2217
2318
*/
2419
(function(window, polyfill){'use strict';
@@ -702,6 +697,8 @@ THE SOFTWARE.
702697
// IE11 disconnectedCallback issue #
703698
// to be tested before any createElement patch
704699
if (MutationObserver) {
700+
// original fix:
701+
// https://github.com/javan/mutation-observer-inner-html-shim
705702
tmp = document.createElement('div');
706703
tmp.innerHTML = '<div><div></div></div>';
707704
new MutationObserver(function (mutations, observer) {
@@ -1439,13 +1436,14 @@ THE SOFTWARE.
14391436
// if available test extends work as expected
14401437
try {
14411438
(function (DRE, options, name) {
1439+
var re = new RegExp('^<a\\s+is=(\'|")' + name + '\\1></a>$');
14421440
options[EXTENDS] = 'a';
14431441
DRE.prototype = create(HTMLAnchorElement.prototype);
14441442
DRE.prototype.constructor = DRE;
14451443
window.customElements.define(name, DRE, options);
14461444
if (
1447-
getAttribute.call(document.createElement('a', {is: name}), 'is') !== name ||
1448-
(usableCustomElements && getAttribute.call(new DRE(), 'is') !== name)
1445+
!re.test(document.createElement('a', {is: name}).outerHTML) ||
1446+
!re.test((new DRE()).outerHTML)
14491447
) {
14501448
throw options;
14511449
}

build/document-register-element.node.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
/*!
2+
ISC License
23
3-
Copyright (C) 2014-2016 by Andrea Giammarchi - @WebReflection
4+
Copyright (c) 2014-2018, Andrea Giammarchi, @WebReflection
45
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Permission to use, copy, modify, and/or distribute this software for any
7+
purpose with or without fee is hereby granted, provided that the above
8+
copyright notice and this permission notice appear in all copies.
119
12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
2217
2318
*/
2419
// global window Object
@@ -705,6 +700,8 @@ function installCustomElements(window, polyfill) {'use strict';
705700
// IE11 disconnectedCallback issue #
706701
// to be tested before any createElement patch
707702
if (MutationObserver) {
703+
// original fix:
704+
// https://github.com/javan/mutation-observer-inner-html-shim
708705
tmp = document.createElement('div');
709706
tmp.innerHTML = '<div><div></div></div>';
710707
new MutationObserver(function (mutations, observer) {
@@ -1442,13 +1439,14 @@ function installCustomElements(window, polyfill) {'use strict';
14421439
// if available test extends work as expected
14431440
try {
14441441
(function (DRE, options, name) {
1442+
var re = new RegExp('^<a\\s+is=(\'|")' + name + '\\1></a>$');
14451443
options[EXTENDS] = 'a';
14461444
DRE.prototype = create(HTMLAnchorElement.prototype);
14471445
DRE.prototype.constructor = DRE;
14481446
window.customElements.define(name, DRE, options);
14491447
if (
1450-
getAttribute.call(document.createElement('a', {is: name}), 'is') !== name ||
1451-
(usableCustomElements && getAttribute.call(new DRE(), 'is') !== name)
1448+
!re.test(document.createElement('a', {is: name}).outerHTML) ||
1449+
!re.test((new DRE()).outerHTML)
14521450
) {
14531451
throw options;
14541452
}

build/dre-ie8-upfront-fix.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/dre-ie8-upfront-fix.max.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
/*!
2+
ISC License
23
3-
Copyright (C) 2014-2016 by Andrea Giammarchi - @WebReflection
4+
Copyright (c) 2014-2018, Andrea Giammarchi, @WebReflection
45
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Permission to use, copy, modify, and/or distribute this software for any
7+
purpose with or without fee is hereby granted, provided that the above
8+
copyright notice and this permission notice appear in all copies.
119
12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
2217
2318
*/
2419
(function(window, Object, HTMLElement){

build/innerHTML.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/innerHTML.max.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
/*!
2+
ISC License
23
3-
Copyright (C) 2014-2016 by Andrea Giammarchi - @WebReflection
4+
Copyright (c) 2014-2018, Andrea Giammarchi, @WebReflection
45
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Permission to use, copy, modify, and/or distribute this software for any
7+
purpose with or without fee is hereby granted, provided that the above
8+
copyright notice and this permission notice appear in all copies.
119
12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
2217
2318
*/
2419
// see https://github.com/WebReflection/document-register-element/issues/21#issuecomment-102020311

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55
"description": "A stand-alone working lightweight version of the W3C Custom Elements specification",
66
"homepage": "https://github.com/WebReflection/document-register-element",
77
"keywords": [
8-
"Web",
8+
"Builtin",
99
"Components",
1010
"Custom",
1111
"Element",
1212
"Elements",
1313
"DOM",
14+
"Web",
1415
"W3C",
1516
"Polymer",
1617
"polyfill",
17-
"alternative"
18+
"ponyfill",
19+
"alternative",
20+
"extend"
1821
],
1922
"author": {
2023
"name": "Andrea Giammarchi",

0 commit comments

Comments
 (0)