Update web-platform-tests to revision a63c453b145fbf1ad72dd42c8cbf298fccd39825

This commit is contained in:
WPT Sync Bot 2020-04-16 08:19:16 +00:00
parent a4fbad2533
commit b34fc52dc2
169 changed files with 3407 additions and 3041 deletions

View file

@ -50,6 +50,39 @@ test_with_window(function (contentWindow) {
assert_connected_log_entry(log[5], element2);
}, 'Upgrading a custom element must invoke attributeChangedCallback and connectedCallback before start upgrading another element');
test_with_window(function (contentWindow) {
const contentDocument = contentWindow.document;
contentDocument.write('<test-element>');
const element = contentDocument.querySelector('test-element');
assert_equals(Object.getPrototypeOf(element), contentWindow.HTMLElement.prototype);
let log = [];
class TestElement extends contentWindow.HTMLElement {
constructor() {
super();
this.id = "foo";
this.setAttribute('id', 'foo');
this.removeAttribute('id');
this.style.fontSize = '10px';
log.push(create_constructor_log(this));
}
connectedCallback(...args) {
log.push(create_connected_callback_log(this, ...args));
}
attributeChangedCallback(...args) {
log.push(create_attribute_changed_callback_log(this, ...args));
}
static get observedAttributes() { return ['id', 'style']; }
}
contentWindow.customElements.define('test-element', TestElement);
assert_equals(Object.getPrototypeOf(element), TestElement.prototype);
assert_equals(log.length, 2);
assert_constructor_log_entry(log[0], element);
assert_connected_log_entry(log[1], element);
}, 'Upgrading a custom element must not invoke attributeChangedCallback for the attribute that is changed during upgrading');
test_with_window(function (contentWindow) {
const contentDocument = contentWindow.document;
contentDocument.write('<test-element id="first-element">');