Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3

This commit is contained in:
WPT Sync Bot 2019-05-15 10:40:54 -04:00 committed by Josh Matthews
parent 6f8bb4dd40
commit edff458e23
791 changed files with 17647 additions and 10322 deletions

View file

@ -91,6 +91,38 @@ test_with_window(w => {
returnNotAnObject = true;
new ElementWithDynamicPrototype();
}, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's realm (autonomous custom elements)");
test_with_window(w => {
// We have to return an object during define(), but not during super()
let returnNotAnObject = false;
function TestElement() {
const o = Reflect.construct(w.HTMLElement, [], new.target);
assert_equals(Object.getPrototypeOf(new.target), window.Function.prototype);
assert_equals(Object.getPrototypeOf(o), window.HTMLElement.prototype,
"Must use the HTMLElement from the realm of NewTarget");
assert_not_equals(Object.getPrototypeOf(o), w.HTMLElement.prototype,
"Must not use the HTMLElement from the realm of the active function object (w.HTMLElement)");
return o;
}
// Create the proxy in the subframe, which should not affect what our
// prototype ends up as.
const ElementWithDynamicPrototype = new w.Proxy(TestElement, {
get: function (target, name) {
if (name == "prototype")
return returnNotAnObject ? notAnObject : {};
return target[name];
}
});
w.customElements.define("test-element", ElementWithDynamicPrototype);
returnNotAnObject = true;
new ElementWithDynamicPrototype();
}, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's GetFunctionRealm (autonomous custom elements)");
});
[null, undefined, 5, "string"].forEach(function (notAnObject) {
@ -122,6 +154,37 @@ test_with_window(w => {
returnNotAnObject = true;
new ElementWithDynamicPrototype();
}, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's realm (customized built-in elements)");
test_with_window(w => {
// We have to return an object during define(), but not during super()
let returnNotAnObject = false;
function TestElement() {
const o = Reflect.construct(w.HTMLParagraphElement, [], new.target);
assert_equals(Object.getPrototypeOf(o), window.HTMLParagraphElement.prototype,
"Must use the HTMLParagraphElement from the realm of NewTarget");
assert_not_equals(Object.getPrototypeOf(o), w.HTMLParagraphElement.prototype,
"Must not use the HTMLParagraphElement from the realm of the active function object (w.HTMLParagraphElement)");
return o;
}
// Create the proxy in the subframe, which should not affect what our
// prototype ends up as.
const ElementWithDynamicPrototype = new w.Proxy(TestElement, {
get: function (target, name) {
if (name == "prototype")
return returnNotAnObject ? notAnObject : {};
return target[name];
}
});
w.customElements.define("test-element", ElementWithDynamicPrototype, { extends: "p" });
returnNotAnObject = true;
new ElementWithDynamicPrototype();
}, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's GetFunctionRealm (customized built-in elements)");
});
test_with_window(w => {

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLStyleElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="media of HTMLStyleElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-style-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>
<script>
function getParentElement() {
return document.head;
}
testReflectAttributeWithParentNode(
'media', 'media', 'print',
'screen', 'media on HTMLStyleElement', 'style',
getParentElement, HTMLStyleElement
);
</script>

View file

@ -0,0 +1,63 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLTableCellElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="colSpan, rowSpan, headers, scope, abbr of
HTMLTableCellElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-td-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>
<table><tr id="colSpan"></table>
<table><tr id="rowSpan"><tr><tr></table>
<table><tr><th id="id1"><th id="id2"><tr id="td_headers"><tr id="th_headers"></table>
<script>
function getParentElement(id) {
let parentElement = document.getElementById(id);
return parentElement;
}
testReflectAttributeWithParentNode(
'colSpan', 'colspan', '2',
'3', 'colSpan on HTMLTableCellElement in td', 'td',
() => getParentElement('colSpan'), HTMLTableCellElement
);
testReflectAttributeWithParentNode(
'colSpan', 'colspan', '2',
'3', 'colSpan on HTMLTableCellElement in th', 'th',
() => getParentElement('colSpan'), HTMLTableCellElement
);
testReflectAttributeWithParentNode(
'rowSpan', 'rowspan', '2',
'3', 'rowSpan on HTMLTableCellElement in td', 'td',
() => getParentElement('rowSpan'), HTMLTableCellElement
);
testReflectAttributeWithParentNode(
'rowSpan', 'rowspan', '2',
'3', 'rowSpan on HTMLTableCellElement in th', 'th',
() => getParentElement('rowSpan'), HTMLTableCellElement
);
testReflectAttributeWithParentNode(
'headers', 'headers', 'id1',
'id2', 'headers on HTMLTableCellElement in td', 'td',
() => getParentElement('td_headers'), HTMLTableCellElement
);
testReflectAttributeWithParentNode(
'headers', 'headers', 'id1',
'id2', 'headers on HTMLTableCellElement in th', 'th',
() => getParentElement('th_headers'), HTMLTableCellElement
);
testReflectAttributeWithParentNode(
'scope', 'scope', 'row',
'col', 'scope on HTMLTableCellElement in th', 'th',
() => getParentElement('colSpan'), HTMLTableCellElement
);
testReflectAttributeWithParentNode(
'abbr', 'abbr', 'Model1',
'Model2', 'abbr on HTMLTableCellElement in th', 'th',
() => getParentElement('colSpan'), HTMLTableCellElement
);
</script>

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLTableColElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="span of HTMLTableColElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-colgroup-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>
<table id="tbl"></table>
<script>
function getParentElement() {
let parentElement = document.getElementById('tbl');
return parentElement;
}
testReflectAttributeWithParentNode(
'span', 'span', '2',
'1', 'span on HTMLTableColElement', 'colgroup',
getParentElement, HTMLTableColElement
);
</script>