blob: 5332dcf4c4f94e723844c559d4251de436b64da3 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/js-test.js"></script>
<body>
<script>
description('Tests basic web-exposure of Custom Elements');
function evalAndLogValue(s) {
debug(evalAndLog(s));
debug('');
}
evalAndLogValue('Document.prototype.hasOwnProperty("registerElement")');
evalAndLogValue('typeof Document.prototype.registerElement');
evalAndLogValue('document.createElement("x-a") instanceof HTMLUnknownElement');
var div = document.createElement('div');
div.innerHTML = '<div is="x-b">';
document.body.appendChild(div);
evalAndLogValue('document.querySelector(":unresolved")');
div.remove();
var span = document.createElement('span', 'type-extension');
evalAndLogValue('span.getAttribute("is")');
class A extends HTMLButtonElement {
constructor() {
super();
}
}
if (shouldNotThrow('window.customElements.define("a-a", A, {extends: "b"})')) {
if (window.internals) {
shouldBeTrue(window.internals.runtimeFlags.customElementsBuiltinEnabled);
}
}
successfullyParsed = true;
</script>