Auto merge of #8983 - Manishearth:cursors, r=jdm

Various textinput fixes

 - Currently the cursor sticks around if you click elsewhere. Now the text inputs are relayout-ed on blur.
 - Currently whitespace gets collapsed in text input (https://github.com/servo/servo/issues/8772). Not anymore.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8983)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-01-11 23:21:03 +05:30
commit 099beee85c
9 changed files with 117 additions and 7 deletions

View file

@ -0,0 +1,7 @@
Both input elements below should have more than one space between "foo" and "bar":
<form>
<input value="foo bar">
<input value="foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bar">
</form>

View file

@ -2443,6 +2443,30 @@
"url": "/_mozilla/css/input_placeholder_ref.html"
}
],
"css/input_whitespace.html": [
{
"path": "css/input_whitespace.html",
"references": [
[
"/_mozilla/css/input_whitespace_ref.html",
"=="
]
],
"url": "/_mozilla/css/input_whitespace.html"
}
],
"css/input_whitespace_ref.html": [
{
"path": "css/input_whitespace_ref.html",
"references": [
[
"/_mozilla/css/input_whitespace_ref.html",
"=="
]
],
"url": "/_mozilla/css/input_whitespace_ref.html"
}
],
"css/inset.html": [
{
"path": "css/inset.html",
@ -8434,6 +8458,30 @@
"url": "/_mozilla/css/input_placeholder_ref.html"
}
],
"css/input_whitespace.html": [
{
"path": "css/input_whitespace.html",
"references": [
[
"/_mozilla/css/input_whitespace_ref.html",
"=="
]
],
"url": "/_mozilla/css/input_whitespace.html"
}
],
"css/input_whitespace_ref.html": [
{
"path": "css/input_whitespace_ref.html",
"references": [
[
"/_mozilla/css/input_whitespace_ref.html",
"=="
]
],
"url": "/_mozilla/css/input_whitespace_ref.html"
}
],
"css/inset.html": [
{
"path": "css/inset.html",

View file

@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="match" href="input_whitespace_ref.html">
</head>
<body>
<div><input type="text" size="30" value="placeholder"></div>
<div><input type="text" size="30" value="place holder"></div>
<div><input type="text" size="30" value="place holder"></div>
<textarea rows="7" cols="50">a a a a a
b
b
</textarea>
</body>
</html>

View file

@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="match" href="input_whitespace_ref.html">
</head>
<body>
<div><input type="text" size="30" value="placeholder"></div>
<div><input type="text" size="30" value="place&nbsp;holder"></div>
<div><input type="text" size="30" value="place&nbsp;&nbsp;&nbsp;&nbsp;holder"></div>
<textarea rows="7" cols="50">a&nbsp;a&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;&nbsp;a
&nbsp;
b
&nbsp;
&nbsp;
b
</textarea>
</body>
</html>