Auto merge of #14989 - notriddle:ellipsis_reflow, r=emilio

Fix the incrmental reflow behavior of text-overflow

This patch allows Servo to incrementally reflow truncated fragments correctly.

* The untruncated version of a fragment is preserved, and when incrementally reflowing, the untruncated version is what gets reflowed. If it needs truncated, it will get truncated again.
* The ellipsis fragments are skipped when incrementally reflowing a line. If it is still needed, it will be recreated.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14952
- [X] There are tests for these changes OR

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14989)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-12 17:31:19 -08:00 committed by GitHub
commit 6a04aea4a5
6 changed files with 211 additions and 29 deletions

View file

@ -5544,6 +5544,18 @@
"url": "/_mozilla/css/text_overflow_ellipsis.html"
}
],
"css/text_overflow_reflow.html": [
{
"path": "css/text_overflow_reflow.html",
"references": [
[
"/_mozilla/css/text_overflow_reflow_ref.html",
"=="
]
],
"url": "/_mozilla/css/text_overflow_reflow.html"
}
],
"css/text_overflow_string.html": [
{
"path": "css/text_overflow_string.html",
@ -20880,6 +20892,18 @@
"url": "/_mozilla/css/text_overflow_ellipsis.html"
}
],
"css/text_overflow_reflow.html": [
{
"path": "css/text_overflow_reflow.html",
"references": [
[
"/_mozilla/css/text_overflow_reflow_ref.html",
"=="
]
],
"url": "/_mozilla/css/text_overflow_reflow.html"
}
],
"css/text_overflow_string.html": [
{
"path": "css/text_overflow_string.html",

View file

@ -0,0 +1,15 @@
<!doctype html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>Text overflow should disappear when the container becomes large enough</title>
<meta name="description" content="This test is targetted at bug #14952 in Servo's incremental reflow engine.">
<link rel="match" href="text_overflow_reflow_ref.html">
<style>html{font-family:Ahem}</style>
<div id=goat style="width:5em"><p style="text-overflow:ellipsis;overflow:hidden">XXXXXXXXXX</p></div>
<script>
var goat = document.getElementById("goat");
requestAnimationFrame(function() {
goat.style.width = "20em";
document.documentElement.className = "";
});
</script>

View file

@ -0,0 +1,5 @@
<!doctype html>
<meta charset="utf-8">
<title>Text overflow should disappear when the container becomes large enough</title>
<style>html{font-family:Ahem}</style>
<div style="width:20em"><p style="text-overflow:ellipsis;overflow:hidden">XXXXXXXXXX</p></div>