Changeset 102538 in webkit


Ignore:
Timestamp:
Dec 11, 2011, 11:06:56 AM (13 years ago)
Author:
mitz@apple.com
Message:

Source/WebCore: <rdar://problem/10561285> REGRESSION (r80438): First word on a line or after collapsed space may not be hyphenated even though it should
https://bugs.webkit.org/show_bug.cgi?id=74239

Reviewed by Anders Carlsson.

Tests: fast/text/hyphenate-first-word-after-skipped-space-expected.html

fast/text/hyphenate-first-word-after-skipped-space.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::tryHyphenating): Replaced the assumption that the character at lastSpace is a space
iff lastSpace is non-zero with a test of whether it is a space, in the sense that it should
not be counted as part of the prefix when comparing it to the value of hyphenate-limit-before.

LayoutTests: Test and updated results for <rdar://problem/10561285> REGRESSION (r80438): First word on a line or after collapsed space may not be hyphenated even though it should
https://bugs.webkit.org/show_bug.cgi?id=74239

Reviewed by Anders Carlsson.

  • fast/text/hyphenate-first-word-after-skipped-space-expected.html: Added.
  • fast/text/hyphenate-first-word-after-skipped-space.html: Added.
  • platform/mac/fast/text/hyphenate-limit-lines-expected.txt:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LayoutTests/ChangeLog

    r102528 r102538  
     12011-12-11  Dan Bernstein  <mitz@apple.com>
     2
     3        Test and updated results for <rdar://problem/10561285> REGRESSION (r80438): First word on a line or after collapsed space may not be hyphenated even though it should
     4        https://bugs.webkit.org/show_bug.cgi?id=74239
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * fast/text/hyphenate-first-word-after-skipped-space-expected.html: Added.
     9        * fast/text/hyphenate-first-word-after-skipped-space.html: Added.
     10        * platform/mac/fast/text/hyphenate-limit-lines-expected.txt:
     11
    1122011-12-09  Robert Hogan  <robert@webkit.org>
    213
  • TabularUnified trunk/LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.txt

    r94710 r102538  
    7979          text run at (1,156) width 200: "pleasures and de" + hyphen string "-"
    8080          text run at (1,187) width 200: "sires into"
    81           text run at (1,218) width 200: "necessary and"
    82           text run at (1,249) width 155: "unnecessary\x{2014}"
    83           text run at (1,280) width 200: "these and other"
    84           text run at (1,311) width 200: "great forms of"
    85           text run at (1,342) width 200: "thought are all of"
    86           text run at (1,373) width 66: "them "
    87           text run at (67,373) width 134: "to be found"
    88           text run at (1,404) width 200: "in the Republic,"
    89           text run at (1,435) width 200: "and were probably"
     81          text run at (1,218) width 165: "necessary and "
     82          text run at (166,218) width 35: "un" + hyphen string "-"
     83          text run at (1,249) width 183: "necessary\x{2014}these"
     84          text run at (1,280) width 200: "and other great"
     85          text run at (1,311) width 200: "forms of thought"
     86          text run at (1,342) width 180: "are all of them "
     87          text run at (181,342) width 20: "to"
     88          text run at (1,373) width 200: "be found in the"
     89          text run at (1,404) width 200: "Republic, and"
     90          text run at (1,435) width 200: "were probably"
    9091          text run at (1,466) width 200: "first invented by"
    9192          text run at (1,497) width 60: "Plato."
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r102535 r102538  
     12011-12-11  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10561285> REGRESSION (r80438): First word on a line or after collapsed space may not be hyphenated even though it should
     4        https://bugs.webkit.org/show_bug.cgi?id=74239
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Tests: fast/text/hyphenate-first-word-after-skipped-space-expected.html
     9               fast/text/hyphenate-first-word-after-skipped-space.html
     10
     11        * rendering/RenderBlockLineLayout.cpp:
     12        (WebCore::tryHyphenating): Replaced the assumption that the character at lastSpace is a space
     13        iff lastSpace is non-zero with a test of whether it is a space, in the sense that it should
     14        not be counted as part of the prefix when comparing it to the value of hyphenate-limit-before.
     15
    1162011-12-10  Benjamin Poulain  <bpoulain@apple.com>
    217
  • TabularUnified trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r101733 r102538  
    19411941
    19421942    prefixLength = lastHyphenLocation(text->characters() + lastSpace, pos - lastSpace, min(prefixLength, static_cast<unsigned>(pos - lastSpace - minimumSuffixLength)) + 1, localeIdentifier);
    1943     // FIXME: The following assumes that the character at lastSpace is a space (and therefore should not factor
    1944     // into hyphenate-limit-before) unless lastSpace is 0. This is wrong in the rare case of hyphenating
    1945     // the first word in a text node which has leading whitespace.
    1946     if (!prefixLength || prefixLength - (lastSpace ? 1 : 0) < static_cast<unsigned>(minimumPrefixLength))
     1943    if (!prefixLength || prefixLength < static_cast<unsigned>(minimumPrefixLength))
    19471944        return;
     1945
     1946    // When lastSapce is a space, which it always is except sometimes at the beginning of a line or after collapsed
     1947    // space, it should not count towards hyphenate-limit-before.
     1948    if (prefixLength == static_cast<unsigned>(minimumPrefixLength)) {
     1949        UChar characterAtLastSpace = text->characters()[lastSpace];
     1950        if (characterAtLastSpace == ' ' || characterAtLastSpace == '\n' || characterAtLastSpace == '\t' || characterAtLastSpace == noBreakSpace)
     1951            return;
     1952    }
    19481953
    19491954    ASSERT(pos - lastSpace - prefixLength >= static_cast<unsigned>(minimumSuffixLength));
Note: See TracChangeset for help on using the changeset viewer.