mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
38 lines
No EOL
1.3 KiB
HTML
38 lines
No EOL
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html><head>
|
|
<meta charset="utf-8">
|
|
<title>CSS Test: :focus-within selector</title>
|
|
<link href="mailto:ethlin@mozilla.com" rel="author" title="Ethan Lin">
|
|
<link href="https://www.mozilla.org" rel="author" title="Mozilla">
|
|
<link href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo" rel="help">
|
|
<meta content="Test checks :focus-within works after focus change" name="assert">
|
|
<link href="reference/focus-within-1-ref.htm" rel="match">
|
|
<meta content="interact" name="flags">
|
|
<style type="text/css">
|
|
div {
|
|
border: solid 15px blue;
|
|
outline: none;
|
|
}
|
|
div:focus-within {
|
|
border-color: green;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<p>Test passes if, when the upper element is unfocused and the lower element is focused, the upper element is blue and the lower one is green, and they are surrounded by a thick green border.</p>
|
|
<div id="parent">
|
|
<div id="child1" tabindex="1"></div>
|
|
<div id="child2" tabindex="2"></div>
|
|
</div>
|
|
<script>
|
|
var child1 = document.getElementById('child1');
|
|
child1.focus();
|
|
document.body.offsetWidth;
|
|
|
|
var child2 = document.getElementById('child2');
|
|
child2.focus();
|
|
document.body.offsetWidth;
|
|
</script>
|
|
|
|
|
|
</body></html> |