Skip to content

Commit e56b944

Browse files
author
Andrea Giammarchi
committed
MS Edge Release
* fixed #221 through script creation via global document * fixed hyper.Component resulting in broken super() call
1 parent b40c8c7 commit e56b944

File tree

14 files changed

+3849
-3755
lines changed

14 files changed

+3849
-3755
lines changed

cjs/classes/Component.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const { WeakMap } = require('../shared/poorlyfills.js');
99
// The main difference is that declared components
1010
// will not automatically render on setState(...)
1111
// to simplify state handling on render.
12-
function Component() {}
12+
function Component() {
13+
return this; // this is needed in Edge !!!
14+
}
1315
Object.defineProperty(exports, '__esModule', {value: true}).default = Component
1416

1517
// Component is lazily setup because it needs

cjs/objects/Updates.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const Path = (m => m.__esModule ? m.default : m)(require('./Path.js'));
99
const Style = (m => m.__esModule ? m.default : m)(require('./Style.js'));
1010
const Intent = (m => m.__esModule ? m.default : m)(require('./Intent.js'));
1111
const domdiff = (m => m.__esModule ? m.default : m)(require('../shared/domdiff.js'));
12-
const { create: createElement, text } = require('../shared/easy-dom.js');
12+
// see /^script$/i.test(nodeName) bit down here
13+
// import { create as createElement, text } from '../shared/easy-dom.js';
14+
const { text } = require('../shared/easy-dom.js');
1315
const { Event, WeakSet, isArray, trim } = require('../shared/poorlyfills.js');
1416
const { createFragment, slice } = require('../shared/utils.js');
1517

@@ -161,18 +163,29 @@ const findAttributes = (node, paths, parts) => {
161163
}
162164
const len = remove.length;
163165
for (let i = 0; i < len; i++) {
164-
node.removeAttributeNode(remove[i]);
166+
// Edge HTML bug #16878726
167+
const attribute = remove[i];
168+
if (/^id$/i.test(attribute.name))
169+
node.removeAttribute(attribute.name);
170+
// standard browsers would work just fine here
171+
else
172+
node.removeAttributeNode(remove[i]);
165173
}
166174

167175
// This is a very specific Firefox/Safari issue
168176
// but since it should be a not so common pattern,
169177
// it's probably worth patching regardless.
170178
// Basically, scripts created through strings are death.
171179
// You need to create fresh new scripts instead.
172-
// TODO: is there any other node that needs such nonsense ?
180+
// TODO: is there any other node that needs such nonsense?
173181
const nodeName = node.nodeName;
174182
if (/^script$/i.test(nodeName)) {
175-
const script = createElement(node, nodeName);
183+
// this used to be like that
184+
// const script = createElement(node, nodeName);
185+
// then Edge arrived and decided that scripts created
186+
// through template documents aren't worth executing
187+
// so it became this ... hopefully it won't hurt in the wild
188+
const script = document.createElement(nodeName);
176189
for (let i = 0; i < attributes.length; i++) {
177190
script.setAttributeNode(attributes[i].cloneNode(true));
178191
}

coverage/coverage.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

coverage/lcov-report/hyperHTML/index.c.js.html

Lines changed: 1331 additions & 1298 deletions
Large diffs are not rendered by default.

coverage/lcov-report/hyperHTML/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ <h1>
2222
<div class='fl pad1y space-right2'>
2323
<span class="strong">100% </span>
2424
<span class="quiet">Statements</span>
25-
<span class='fraction'>639/639</span>
25+
<span class='fraction'>643/643</span>
2626
</div>
2727
<div class='fl pad1y space-right2'>
2828
<span class="strong">100% </span>
2929
<span class="quiet">Branches</span>
30-
<span class='fraction'>349/349</span>
30+
<span class='fraction'>351/351</span>
3131
</div>
3232
<div class='fl pad1y space-right2'>
3333
<span class="strong">100% </span>
@@ -37,7 +37,7 @@ <h1>
3737
<div class='fl pad1y space-right2'>
3838
<span class="strong">100% </span>
3939
<span class="quiet">Lines</span>
40-
<span class='fraction'>628/628</span>
40+
<span class='fraction'>631/631</span>
4141
</div>
4242
<div class='fl pad1y'>
4343
<span class="strong">3 statements, 1 function, 8 branches</span>
@@ -66,13 +66,13 @@ <h1>
6666
<td class="file high" data-value="index.c.js"><a href="index.c.js.html">index.c.js</a></td>
6767
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
6868
<td data-value="100" class="pct high">100%</td>
69-
<td data-value="639" class="abs high">639/639</td>
69+
<td data-value="643" class="abs high">643/643</td>
7070
<td data-value="100" class="pct high">100%</td>
71-
<td data-value="349" class="abs high">349/349</td>
71+
<td data-value="351" class="abs high">351/351</td>
7272
<td data-value="100" class="pct high">100%</td>
7373
<td data-value="100" class="abs high">100/100</td>
7474
<td data-value="100" class="pct high">100%</td>
75-
<td data-value="628" class="abs high">628/628</td>
75+
<td data-value="631" class="abs high">631/631</td>
7676
</tr>
7777

7878
</tbody>
@@ -81,7 +81,7 @@ <h1>
8181
</div><!-- /wrapper -->
8282
<div class='footer quiet pad2 space-top1 center small'>
8383
Code coverage
84-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Apr 07 2018 18:37:05 GMT+0200 (CEST)
84+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Apr 11 2018 17:51:36 GMT+0200 (CEST)
8585
</div>
8686
</div>
8787
<script src="../prettify.js"></script>

coverage/lcov-report/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ <h1>
2222
<div class='fl pad1y space-right2'>
2323
<span class="strong">100% </span>
2424
<span class="quiet">Statements</span>
25-
<span class='fraction'>639/639</span>
25+
<span class='fraction'>643/643</span>
2626
</div>
2727
<div class='fl pad1y space-right2'>
2828
<span class="strong">100% </span>
2929
<span class="quiet">Branches</span>
30-
<span class='fraction'>349/349</span>
30+
<span class='fraction'>351/351</span>
3131
</div>
3232
<div class='fl pad1y space-right2'>
3333
<span class="strong">100% </span>
@@ -37,7 +37,7 @@ <h1>
3737
<div class='fl pad1y space-right2'>
3838
<span class="strong">100% </span>
3939
<span class="quiet">Lines</span>
40-
<span class='fraction'>628/628</span>
40+
<span class='fraction'>631/631</span>
4141
</div>
4242
<div class='fl pad1y'>
4343
<span class="strong">3 statements, 1 function, 8 branches</span>
@@ -66,13 +66,13 @@ <h1>
6666
<td class="file high" data-value="hyperHTML/"><a href="hyperHTML/index.html">hyperHTML/</a></td>
6767
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
6868
<td data-value="100" class="pct high">100%</td>
69-
<td data-value="639" class="abs high">639/639</td>
69+
<td data-value="643" class="abs high">643/643</td>
7070
<td data-value="100" class="pct high">100%</td>
71-
<td data-value="349" class="abs high">349/349</td>
71+
<td data-value="351" class="abs high">351/351</td>
7272
<td data-value="100" class="pct high">100%</td>
7373
<td data-value="100" class="abs high">100/100</td>
7474
<td data-value="100" class="pct high">100%</td>
75-
<td data-value="628" class="abs high">628/628</td>
75+
<td data-value="631" class="abs high">631/631</td>
7676
</tr>
7777

7878
</tbody>
@@ -81,7 +81,7 @@ <h1>
8181
</div><!-- /wrapper -->
8282
<div class='footer quiet pad2 space-top1 center small'>
8383
Code coverage
84-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Apr 07 2018 18:37:05 GMT+0200 (CEST)
84+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Apr 11 2018 17:51:36 GMT+0200 (CEST)
8585
</div>
8686
</div>
8787
<script src="prettify.js"></script>

0 commit comments

Comments
 (0)