diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index f3e868239cd8..b6d9e4007770 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -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; } diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list index b1ab4b87cd52..61c641a197bc 100644 --- a/layout/reftests/text/reftest.list +++ b/layout/reftests/text/reftest.list @@ -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 diff --git a/layout/reftests/text/soft-hyphens-break-word-1-ref.html b/layout/reftests/text/soft-hyphens-break-word-1-ref.html new file mode 100644 index 000000000000..e33081021e7b --- /dev/null +++ b/layout/reftests/text/soft-hyphens-break-word-1-ref.html @@ -0,0 +1,13 @@ + + + +
+

H
y-
p
h
e
n
. +

H
y-
p
h
e
n
. +

H
y-
p
h
e
n
. +

H
y-
p
h
e
n
. +

H
y-
p
h
e
n
. +

+ + + diff --git a/layout/reftests/text/soft-hyphens-break-word-1a.html b/layout/reftests/text/soft-hyphens-break-word-1a.html new file mode 100644 index 000000000000..fd5a8099b397 --- /dev/null +++ b/layout/reftests/text/soft-hyphens-break-word-1a.html @@ -0,0 +1,13 @@ + + + +
+

Hy­phen. +

Hy­phen. +

Hy­phen. +

Hy­phen. +

Hy­phen. +

+ + + diff --git a/layout/reftests/text/soft-hyphens-break-word-1b.html b/layout/reftests/text/soft-hyphens-break-word-1b.html new file mode 100644 index 000000000000..74d58cc6a255 --- /dev/null +++ b/layout/reftests/text/soft-hyphens-break-word-1b.html @@ -0,0 +1,13 @@ + + + +
+

Hy­­phen. +

Hy­­phen. +

Hy­­phen. +

Hy­­phen. +

Hy­­phen. +

+ + + diff --git a/layout/reftests/text/soft-hyphens-break-word-1c.html b/layout/reftests/text/soft-hyphens-break-word-1c.html new file mode 100644 index 000000000000..130f0c26b15e --- /dev/null +++ b/layout/reftests/text/soft-hyphens-break-word-1c.html @@ -0,0 +1,13 @@ + + + +
+

Hy­phen. +

Hy­phen. +

Hy­phen. +

Hy­phen. +

Hy­phen. +

+ + +