Changeset 197435 in webkit


Ignore:
Timestamp:
Mar 1, 2016 6:50:25 PM (8 years ago)
Author:
mmaxfield@apple.com
Message:

Small-caps non-BMP characters are garbled in the complex text codepath
https://bugs.webkit.org/show_bug.cgi?id=154875

Reviewed by Michael Saboff.

Source/WebCore:

We were assuming that all characters able to be capitalized are in BMP. This is not true.

Test: fast/text/complex-small-caps-non-bmp-capitalize.html

  • platform/graphics/mac/ComplexTextController.cpp:

(WebCore::capitalized):
(WebCore::ComplexTextController::collectComplexTextRuns):

LayoutTests:

  • fast/text/complex-small-caps-non-bmp-capitalize-expected.html: Added.
  • fast/text/complex-small-caps-non-bmp-capitalize.html: Added.
  • fast/text/regress-154875-expected.txt: Deleted
  • fast/text/regress-154875.html: Deleted
Location:
trunk
Files:
2 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r197426 r197435  
     12016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Small-caps non-BMP characters are garbled in the complex text codepath
     4        https://bugs.webkit.org/show_bug.cgi?id=154875
     5
     6        Reviewed by Michael Saboff.
     7
     8        * fast/text/complex-small-caps-non-bmp-capitalize-expected.html: Added.
     9        * fast/text/complex-small-caps-non-bmp-capitalize.html: Added.
     10        * fast/text/regress-154875-expected.txt: Deleted
     11        * fast/text/regress-154875.html: Deleted
     12
    1132016-03-01  Michael Saboff  <msaboff@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r197434 r197435  
     12016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Small-caps non-BMP characters are garbled in the complex text codepath
     4        https://bugs.webkit.org/show_bug.cgi?id=154875
     5
     6        Reviewed by Michael Saboff.
     7
     8        We were assuming that all characters able to be capitalized are in BMP. This is not true.
     9
     10        Test: fast/text/complex-small-caps-non-bmp-capitalize.html
     11
     12        * platform/graphics/mac/ComplexTextController.cpp:
     13        (WebCore::capitalized):
     14        (WebCore::ComplexTextController::collectComplexTextRuns):
     15
    1162016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp

    r197423 r197435  
    351351        synthesizedFont = &nextFont->noSynthesizableFeaturesFont();
    352352        smallSynthesizedFont = synthesizedFont->smallCapsFont(m_font.fontDescription());
    353         m_smallCapsBuffer[0] = capitalizedBase ? capitalizedBase.value() : cp[0];
    354         for (unsigned i = 1; cp + i < curr; ++i)
     353        UChar32 characterToWrite = capitalizedBase ? capitalizedBase.value() : cp[0];
     354        unsigned characterIndex = 0;
     355        U16_APPEND_UNSAFE(m_smallCapsBuffer, characterIndex, characterToWrite);
     356        for (unsigned i = characterIndex; cp + i < curr; ++i)
    355357            m_smallCapsBuffer[i] = cp[i];
    356358        nextIsSmallCaps = true;
     
    367369        if (synthesizedFont) {
    368370            if (auto capitalizedBase = capitalized(baseCharacter)) {
    369                 m_smallCapsBuffer[index] = capitalizedBase.value();
     371                unsigned characterIndex = index;
     372                U16_APPEND_UNSAFE(m_smallCapsBuffer, characterIndex, capitalizedBase.value());
    370373                for (unsigned i = 0; i < markCount; ++i)
    371                     m_smallCapsBuffer[index + i + 1] = cp[index + i + 1];
     374                    m_smallCapsBuffer[i + characterIndex] = cp[i + characterIndex];
    372375                nextIsSmallCaps = true;
    373376            } else {
Note: See TracChangeset for help on using the changeset viewer.