mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 14f4f8e2c8ec5868a7c50fe647555cd966ba08a3
This commit is contained in:
parent
3097eb7de9
commit
714a3cfe1e
101 changed files with 2305 additions and 206 deletions
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body id="body">
|
||||
<dialog>
|
||||
This is a dialog
|
||||
</dialog>
|
||||
<input />
|
||||
<script>
|
||||
"use strict";
|
||||
function testFocus(element, expectFocus) {
|
||||
var focusedElement = null;
|
||||
element.addEventListener('focus', function() { focusedElement = element; }, false);
|
||||
element.focus();
|
||||
var theElement = element;
|
||||
assert_equals(focusedElement === theElement, expectFocus, element.id);
|
||||
}
|
||||
|
||||
test(function() {
|
||||
var dialog = document.querySelector('dialog');
|
||||
dialog.showModal();
|
||||
|
||||
var input = document.querySelector('input');
|
||||
testFocus(input, false);
|
||||
|
||||
dialog.remove();
|
||||
testFocus(input, true);
|
||||
}, "Test that removing dialog unblocks the document.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue