mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
Implement the :focus pseudo-class selector
Fixes #5460. This supports for simple focusable elements that are their own DOM anchors, like text `input` fields.
This commit is contained in:
parent
ad6c511a5e
commit
791fa3757d
10 changed files with 106 additions and 9 deletions
|
@ -102,6 +102,7 @@ flaky_cpu == append_style_a.html append_style_b.html
|
|||
== floated_generated_content_a.html floated_generated_content_b.html
|
||||
== floated_list_item_a.html floated_list_item_ref.html
|
||||
== floated_table_with_margin_a.html floated_table_with_margin_ref.html
|
||||
== focus_selector.html focus_selector_ref.html
|
||||
== font_advance.html font_advance_ref.html
|
||||
== font_size.html font_size_ref.html
|
||||
== font_style.html font_style_ref.html
|
||||
|
|
18
tests/ref/focus_selector.html
Normal file
18
tests/ref/focus_selector.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
input:focus {
|
||||
outline: 2px solid orange;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<input id="a">
|
||||
<input id="b">
|
||||
<script>
|
||||
document.getElementById("a").focus();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
15
tests/ref/focus_selector_ref.html
Normal file
15
tests/ref/focus_selector_ref.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
#a {
|
||||
outline: 2px solid orange;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<input id="a">
|
||||
<input id="b">
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue