Created
December 27, 2018 11:58
-
-
Save jarrodek/aba67f64ed8df89cccfe8a509b58f0d1 to your computer and use it in GitHub Desktop.
A description of the issue for webcomponentsjs library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"> | |
<title>Issue reproduction</title> | |
<script src="../../webcomponentsjs/webcomponents-loader.js"></script> | |
<style> | |
html, | |
body { | |
margin: 0; | |
padding: 0; | |
} | |
header { | |
padding: 12px 24px; | |
background-color: #C5E1A5; | |
} | |
output { | |
max-width: 600px; | |
margin: 40px auto; | |
display: block; | |
white-space: pre-wrap; | |
} | |
</style> | |
</head> | |
<body> | |
<header> | |
<h1>Webcomponents.js issue</h1> | |
</header> | |
<output id="out"></output> | |
<script> | |
(function() { | |
const load = function() { | |
let log = ''; | |
try { | |
const doc = document.implementation.createDocument('', '', null); | |
const main = doc.createElement('child-element'); | |
doc.appendChild(main); | |
const s = new XMLSerializer(); | |
const value = s.serializeToString(doc); | |
log = value; | |
} catch (e) { | |
if (e.stack) { | |
log += e.stack; | |
} else { | |
log = e.message; | |
} | |
console.error(e); | |
} | |
document.getElementById('out').innerText = log; | |
}; | |
window.addEventListener('WebComponentsReady', load); | |
})(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment