Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ellipsis position for RTL elements
In ShapeResult::OffsetToFit() when the size to fit matches result.origin_x we were returning the left_character_index only if Direction() was RTL. However if line_direction is RTL we also want that index. With this change css/css-ui/text-overflow-028.html starts to pass on Linus and Windows, we add new tests here too (the RTL ones were failing before this patch). BUG=1063319 TEST=css/css-overflow/text-overflow-ellipsis-001.html TEST=css/css-overflow/text-overflow-ellipsis-rtl-001.html TEST=css/css-overflow/text-overflow-ellipsis-vertical-001.html TEST=css/css-overflow/text-overflow-ellipsis-vertical-ltr-001.html Change-Id: Idbaed07a63d4ec6335e722b7fb7b4e91f4076564
- Loading branch information
1 parent
f2c1dfe
commit 6680fe5
Showing
8 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
css/css-overflow/reference/text-overflow-ellipsis-001-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis reference file</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div>ppp</div> | ||
<div>pppp</div> | ||
<div>pppX</div> |
15 changes: 15 additions & 0 deletions
15
css/css-overflow/reference/text-overflow-ellipsis-rtl-001-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis reference file</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
white-space: pre; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div> ppp</div> | ||
<div>pppp</div> | ||
<div>Xppp</div> |
17 changes: 17 additions & 0 deletions
17
css/css-overflow/reference/text-overflow-ellipsis-vertical-001-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis reference file</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
height: 400px; | ||
display: inline-block; | ||
writing-mode: vertical-lr; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div>ppp</div> | ||
<div>pppp</div> | ||
<div>pppX</div> |
18 changes: 18 additions & 0 deletions
18
css/css-overflow/reference/text-overflow-ellipsis-vertical-rtl-001-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis reference file</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
height: 400px; | ||
display: inline-block; | ||
writing-mode: vertical-lr; | ||
direction: rtl; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div>ppp</div> | ||
<div>pppp</div> | ||
<div>Xppp</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#ellipsis-scrolling"> | ||
<link rel="match" href="reference/text-overflow-ellipsis-001-ref.html"> | ||
<meta name="assert" content="Check that ellipsis is placed on the right position on the container boundaries in elements with 'text-overflow: ellipsis'."> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
width: 400px; | ||
white-space: pre; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div>ppp</div> | ||
<div>pppp</div> | ||
<div>ppppp</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis RTL</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#ellipsis-scrolling"> | ||
<link rel="match" href="reference/text-overflow-ellipsis-rtl-001-ref.html"> | ||
<meta name="assert" content="Check that ellipsis is placed on the right position on the container boundaries in elements with 'text-overflow: ellipsis' in RTL."> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
width: 400px; | ||
white-space: pre; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
direction: rtl; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div>ppp</div> | ||
<div>pppp</div> | ||
<div>ppppp</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis vertical</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#ellipsis-scrolling"> | ||
<link rel="match" href="reference/text-overflow-ellipsis-vertical-001-ref.html"> | ||
<meta name="assert" content="Check that ellipsis is placed on the right position on the container boundaries in elements with 'text-overflow: ellipsis' in vertical writing mode."> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
height: 400px; | ||
white-space: pre; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
display: inline-block; | ||
writing-mode: vertical-lr; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div>ppp</div> | ||
<div>pppp</div> | ||
<div>ppppp</div> |
24 changes: 24 additions & 0 deletions
24
css/css-overflow/text-overflow-ellipsis-vertical-rtl-001.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: text-overflow: ellipsis vertical RTL</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#ellipsis-scrolling"> | ||
<link rel="match" href="reference/text-overflow-ellipsis-vertical-rtl-001-ref.html"> | ||
<meta name="assert" content="Check that ellipsis is placed on the right position on the container boundaries in elements with 'text-overflow: ellipsis' in vertical writing mode and RTL."> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> | ||
<style> | ||
div { | ||
font: 100px/1 Ahem; | ||
height: 400px; | ||
white-space: pre; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
display: inline-block; | ||
writing-mode: vertical-lr; | ||
direction: rtl; | ||
} | ||
</style> | ||
<p>The test passes if it matches the reference.</p> | ||
<div>ppp</div> | ||
<div>pppp</div> | ||
<div>ppppp</div> |