Bug 957128 - Report hyphen breaks also for word-wrap:break-word (to display soft-hyphens). r=smontagu

This commit is contained in:
Mats Palmgren 2014-01-29 14:45:23 +00:00
Родитель caedc4da28
Коммит 945c0cc094
6 изменённых файлов: 57 добавлений и 2 удалений

Просмотреть файл

@ -6400,7 +6400,7 @@ gfxTextRun::BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength,
if (lineBreakHere || hyphenation || wordWrapping) {
gfxFloat hyphenatedAdvance = advance;
if (!lineBreakHere && !wordWrapping) {
if (!lineBreakHere && hyphenation) {
hyphenatedAdvance += aProvider->GetHyphenWidth();
}
@ -6409,7 +6409,7 @@ gfxTextRun::BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength,
lastBreak = i;
lastBreakTrimmableChars = trimmableChars;
lastBreakTrimmableAdvance = trimmableAdvance;
lastBreakUsedHyphenation = !lineBreakHere && !wordWrapping;
lastBreakUsedHyphenation = !lineBreakHere && hyphenation;
*aBreakPriority = hyphenation || lineBreakHere ?
gfxBreakPriority::eNormalBreak : gfxBreakPriority::eWordWrapBreak;
}

Просмотреть файл

@ -33,6 +33,9 @@ fuzzy-if(Android,255,42) == pre-line-1.html pre-line-1-ref.html
== soft-hyphens-1a.html soft-hyphens-1-ref.html
== soft-hyphens-1b.html soft-hyphens-1-ref.html
== soft-hyphens-1c.html soft-hyphens-1-ref.html
== soft-hyphens-break-word-1a.html soft-hyphens-break-word-1-ref.html
== soft-hyphens-break-word-1b.html soft-hyphens-break-word-1-ref.html
== soft-hyphens-break-word-1c.html soft-hyphens-break-word-1-ref.html
# Tests for soft hyphens in table cells, bug 418975
!= soft-hyphen-in-table-1.html soft-hyphen-in-table-1-notref.html
== soft-hyphen-in-table-1.html soft-hyphen-in-table-1-ref.html

Просмотреть файл

@ -0,0 +1,13 @@
<html>
<body>
<div>
<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,13 @@
<html>
<body>
<div style="width:0; word-wrap:break-word;">
<p>Hy&shy;phen.
<p><span>H</span>y&shy;phen.
<p><span>Hy</span>&shy;phen.
<p><span>Hy&shy;</span>phen.
<p><span>Hy&shy;p</span>hen.
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,13 @@
<html>
<body>
<div style="width:0; word-wrap:break-word;">
<p>Hy&shy;&shy;phen.
<p><span>Hy</span>&shy;&shy;phen.
<p><span>Hy&shy;</span>&shy;phen.
<p><span>Hy&shy;&shy;</span>phen.
<p><span>Hy&shy;&shy;p</span>hen.
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,13 @@
<html>
<body>
<div style="width:0; word-wrap:break-word;">
<p><span>H</span><span>y&shy;phen</span>.
<p><span>Hy</span><span>&shy;phen</span>.
<p><span>Hy</span>&shy;<span>phen</span>.
<p><span>Hy&shy;</span><span>phen</span>.
<p><span>Hy&shy;p</span><span>hen</span>.
</div>
</body>
</html>