mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Update web-platform-tests to revision a46616a5b18e83587ddbbed756c7b96cbb4b015d
This commit is contained in:
parent
3f07cfec7c
commit
578498ba24
4001 changed files with 159517 additions and 30260 deletions
|
@ -1,21 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML contextmenu event is a MouseEvent</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>#contextmenutarget { width: 100px; height: 100px; background-color: red; }</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id='contextmenutarget'>Trigger context menu in this box.</div>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var t = async_test('contextmenu event generated from user action is MouseEvent');
|
||||
document.querySelector("#contextmenutarget").addEventListener('contextmenu', t.step_func(function (e) {
|
||||
assert_equals(e.constructor, window.MouseEvent);
|
||||
document.querySelector("#contextmenutarget").style.backgroundColor = "green";
|
||||
t.done();
|
||||
}));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>menu element removed properties</title>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-menu-element">
|
||||
<link rel="help" href="https://github.com/whatwg/html/pull/2742">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<menu type="context" label="label">
|
||||
<menuitem>Text</menuitem>
|
||||
<menuitem type="checkbox" checked>Checked</menuitem>
|
||||
<menuitem disabled>Disabled</menuitem>
|
||||
<menuitem default>Default</menuitem>
|
||||
</menu>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
const menu = document.querySelector("menu");
|
||||
const menuitem = document.querySelector("menuitem");
|
||||
|
||||
test(() => {
|
||||
assert_false("HTMLMenuItemElement" in window, "the HTMLMenuItemElement interface must not exist");
|
||||
assert_equals(menuitem.constructor, HTMLUnknownElement, "A <menuitem> must be HTMLUnknownElement");
|
||||
|
||||
for (const prop of ["type", "label", "icon", "disabled", "checked", "radiogroup", "default"]) {
|
||||
assert_false(prop in menuitem, `menuitem.${prop} must not be present`);
|
||||
}
|
||||
}, "HTMLMenuItemElement must not be not present");
|
||||
|
||||
test(() => {
|
||||
const potentialBadLocations = [
|
||||
window,
|
||||
document,
|
||||
HTMLElement.prototype,
|
||||
SVGElement.prototype,
|
||||
Document.prototype,
|
||||
HTMLDocument.prototype,
|
||||
Element.prototype
|
||||
];
|
||||
for (const location of potentialBadLocations) {
|
||||
assert_false("onshow" in location,
|
||||
`${location.constructor.name} must not have a property "onshow"`);
|
||||
}
|
||||
}, `onshow must not be present on the GlobalEventHandlers locations`);
|
||||
|
||||
test(() => {
|
||||
assert_false("RelatedEvent" in window);
|
||||
}, "RelatedEvent must not be present");
|
||||
|
||||
test(() => {
|
||||
assert_false("contextMenu" in HTMLElement.prototype,
|
||||
"HTMLElement's prototype must not have a property \"contextMenu\"");
|
||||
assert_false("contextMenu" in document.createElement("div"),
|
||||
"A div must not have a property \"contextMenu\"");
|
||||
}, "el.contextMenu must not be present");
|
||||
|
||||
test(() => {
|
||||
assert_false("type" in menu);
|
||||
|
||||
menu.type = "toolbar";
|
||||
assert_equals(menu.getAttribute("type"), "context");
|
||||
}, "menu.type must not exist or reflect the content attribute");
|
||||
|
||||
test(() => {
|
||||
assert_false("label" in menu);
|
||||
|
||||
menu.label = "new label";
|
||||
assert_equals(menu.getAttribute("label"), "label");
|
||||
}, "menu.label must not exist or reflect the content attribute");
|
||||
|
||||
test(() => {
|
||||
assert_array_equals(document.querySelectorAll("menuitem:enabled"), []);
|
||||
}, ":enabled must not match menuitems");
|
||||
|
||||
test(() => {
|
||||
assert_array_equals(document.querySelectorAll("menuitem:disabled"), []);
|
||||
}, ":disabled must not match menuitems");
|
||||
|
||||
test(() => {
|
||||
assert_array_equals(document.querySelectorAll("menuitem:checked"), []);
|
||||
}, ":checked must not match menuitems");
|
||||
|
||||
test(() => {
|
||||
try {
|
||||
assert_array_equals(document.querySelectorAll("menuitem:default"), []);
|
||||
} catch (e) {
|
||||
// Not everyone has implemented :default as of the time of this writing.
|
||||
if (e.name !== "SyntaxError") {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}, ":default must not match menuitems");
|
||||
|
||||
test(() => {
|
||||
assert_equals(getComputedStyle(menu).display, "block");
|
||||
}, "The user-agent stylesheet must leave type=\"context\" menus as block display like other menus");
|
||||
|
||||
</script>
|
|
@ -1,18 +0,0 @@
|
|||
[
|
||||
{
|
||||
"id": "menus-intro",
|
||||
"original_id": "menus-intro"
|
||||
},
|
||||
{
|
||||
"id": "building-menus-and-toolbars",
|
||||
"original_id": "building-menus-and-toolbars"
|
||||
},
|
||||
{
|
||||
"id": "context-menus",
|
||||
"original_id": "context-menus"
|
||||
},
|
||||
{
|
||||
"id": "toolbars",
|
||||
"original_id": "toolbars"
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue