Fix incremental reflow of text selection changes

Also replace force_relayout methods with direct Node::dirty calls, for
clarity.
This commit is contained in:
Matt Brubeck 2016-04-01 11:20:11 -07:00
parent 0397e2a24d
commit 776aae6399
5 changed files with 83 additions and 20 deletions

View file

@ -2603,6 +2603,18 @@
"url": "/_mozilla/css/input_selection_a.html"
}
],
"css/input_selection_incremental_a.html": [
{
"path": "css/input_selection_incremental_a.html",
"references": [
[
"/_mozilla/css/input_selection_incremental_ref.html",
"=="
]
],
"url": "/_mozilla/css/input_selection_incremental_a.html"
}
],
"css/input_selection_ref.html": [
{
"path": "css/input_selection_ref.html",
@ -9025,6 +9037,18 @@
"url": "/_mozilla/css/input_selection_a.html"
}
],
"css/input_selection_incremental_a.html": [
{
"path": "css/input_selection_incremental_a.html",
"references": [
[
"/_mozilla/css/input_selection_incremental_ref.html",
"=="
]
],
"url": "/_mozilla/css/input_selection_incremental_a.html"
}
],
"css/input_selection_ref.html": [
{
"path": "css/input_selection_ref.html",

View file

@ -0,0 +1,31 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>input selection incremental test</title>
<link rel="match" href="input_selection_incremental_ref.html">
<style>
input {
font: 16px sans-serif;
border: 0 none;
margin: 0;
padding: 0;
}
::selection {
color: white;
background: rgba(176, 214, 255, 1.0);
}
</style>
</head>
<body>
<input value="Hello">
<script>
var input = document.querySelector("input");
input.focus();
input.setSelectionRange(0, 5);
document.body.offsetWidth; // force layout
input.setSelectionRange(0, 1);
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>input selection incremental reference</title>
<style>
body {
font: 16px sans-serif;
}
.selection {
color: white;
background: rgba(176, 214, 255, 1.0);
}
</style>
</head>
<body>
<span class="selection">H</span>ello
</body>
</html>