mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Auto merge of #10176 - mbrubeck:selection-range, r=pcwalton
Highlight selected text in input fields Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10176) <!-- Reviewable:end -->
This commit is contained in:
commit
bed91b3334
17 changed files with 264 additions and 77 deletions
|
@ -2540,6 +2540,30 @@
|
|||
"url": "/_mozilla/css/input_placeholder_ref.html"
|
||||
}
|
||||
],
|
||||
"css/input_selection_a.html": [
|
||||
{
|
||||
"path": "css/input_selection_a.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/input_selection_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/input_selection_a.html"
|
||||
}
|
||||
],
|
||||
"css/input_selection_ref.html": [
|
||||
{
|
||||
"path": "css/input_selection_ref.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/input_selection_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/input_selection_ref.html"
|
||||
}
|
||||
],
|
||||
"css/input_whitespace.html": [
|
||||
{
|
||||
"path": "css/input_whitespace.html",
|
||||
|
@ -8842,6 +8866,30 @@
|
|||
"url": "/_mozilla/css/input_placeholder_ref.html"
|
||||
}
|
||||
],
|
||||
"css/input_selection_a.html": [
|
||||
{
|
||||
"path": "css/input_selection_a.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/input_selection_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/input_selection_a.html"
|
||||
}
|
||||
],
|
||||
"css/input_selection_ref.html": [
|
||||
{
|
||||
"path": "css/input_selection_ref.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/input_selection_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/input_selection_ref.html"
|
||||
}
|
||||
],
|
||||
"css/input_whitespace.html": [
|
||||
{
|
||||
"path": "css/input_whitespace.html",
|
||||
|
|
28
tests/wpt/mozilla/tests/css/input_selection_a.html
Normal file
28
tests/wpt/mozilla/tests/css/input_selection_a.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>input selection test</title>
|
||||
<link rel="match" href="input_selection_ref.html">
|
||||
<style>
|
||||
input {
|
||||
font: 16px sans-serif;
|
||||
border: 0 none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
::selection {
|
||||
color: white;
|
||||
background: rgba(255, 127, 0, 1.0);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<input value="Hello">
|
||||
<script>
|
||||
var input = document.querySelector("input");
|
||||
input.focus();
|
||||
input.setSelectionRange(0, 5);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
18
tests/wpt/mozilla/tests/css/input_selection_ref.html
Normal file
18
tests/wpt/mozilla/tests/css/input_selection_ref.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>input selection test</title>
|
||||
<link rel="match" href="input_selection_ref.html">
|
||||
<style>
|
||||
span {
|
||||
font: 16px sans-serif;
|
||||
color: white;
|
||||
background: rgba(255, 128, 0, 1.0);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span>Hello</span>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue