blob: eb9728e7c5ac2283dd1e636394e35af544c5f83b [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
'use strict';
let reactions = [];
</script>
<x-x id="a"></x-x>
<y-y id="x"></y-y>
<link id="import1" rel="import" href="resources/upgrade.html">
<x-x id="b"></x-x>
<y-y id="y"></y-y>
<script>
'use strict'
async_test((test) => {
window.onload = test.step_func_done(() => {
customElements.define('y-y', class extends HTMLElement {
constructor() {
super();
reactions.push({ type: 'constructor', element: this });
}
});
let elements = reactions.map(e => e.element.id);
assert_array_equals(elements, ['a', 'aa', 'b', 'x', 'bb', 'y']);
}, 'Upgrade of custom elements should happen in document order.');
});
</script>