Changeset 101537 in webkit


Ignore:
Timestamp:
Nov 30, 2011 11:30:08 AM (12 years ago)
Author:
timothy_horton@apple.com
Message:

dx causes non-BMP characters to fail to render
https://bugs.webkit.org/show_bug.cgi?id=18039
<rdar://problem/10422142>

Reviewed by Simon Fraser.

Don't split the surrogate pairs of non-BMP characters across
elements of <text> positioning lists.

Test: svg/text/non-bmp-positioning-lists.svg

  • rendering/svg/SVGTextLayoutAttributesBuilder.cpp:

(WebCore::SVGTextLayoutAttributesBuilder::propagateLayoutAttributes):

Add a test combining non-BMP characters and positioning lists.

  • platform/mac/svg/text/non-bmp-positioning-lists-expected.png: Added.
  • platform/mac/svg/text/non-bmp-positioning-lists-expected.txt: Added.
  • svg/text/non-bmp-positioning-lists.svg: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101522 r101537  
     12011-11-30  Tim Horton  <timothy_horton@apple.com>
     2
     3        dx causes non-BMP characters to fail to render
     4        https://bugs.webkit.org/show_bug.cgi?id=18039
     5        <rdar://problem/10422142>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add a test combining non-BMP characters and positioning lists.
     10
     11        * platform/mac/svg/text/non-bmp-positioning-lists-expected.png: Added.
     12        * platform/mac/svg/text/non-bmp-positioning-lists-expected.txt: Added.
     13        * svg/text/non-bmp-positioning-lists.svg: Added.
     14
    1152011-11-30  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r101535 r101537  
     12011-11-30  Tim Horton  <timothy_horton@apple.com>
     2
     3        dx causes non-BMP characters to fail to render
     4        https://bugs.webkit.org/show_bug.cgi?id=18039
     5        <rdar://problem/10422142>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Don't split the surrogate pairs of non-BMP characters across
     10        elements of <text> positioning lists.
     11
     12        Test: svg/text/non-bmp-positioning-lists.svg
     13
     14        * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
     15        (WebCore::SVGTextLayoutAttributesBuilder::propagateLayoutAttributes):
     16
    1172011-11-29  Robin Dunn  <robin@alldunn.com>
    218
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp

    r100075 r101537  
    204204                const UChar& currentCharacter = characters[textPosition];
    205205
    206                 SVGTextMetrics startToCurrentMetrics = SVGTextMetrics::measureCharacterRange(text, 0, textPosition + 1);
    207                 SVGTextMetrics currentMetrics = SVGTextMetrics::measureCharacterRange(text, textPosition, 1);
    208                 metricsLength = currentMetrics.length();
    209 
    210                 // Eventually handle surrogate pairs here.
    211                 if (!metricsLength) {
    212                     if (textPosition + 1 == textLength)
    213                         break;
    214 
     206                SVGTextMetrics startToCurrentMetrics;
     207                SVGTextMetrics currentMetrics;
     208                unsigned valueListAdvance = 0;
     209
     210                if (U16_IS_LEAD(currentCharacter) && (textPosition + 1) < textLength && U16_IS_TRAIL(characters[textPosition + 1])) {
     211                    // Handle surrogate pairs.
    215212                    startToCurrentMetrics = SVGTextMetrics::measureCharacterRange(text, 0, textPosition + 2);
    216213                    currentMetrics = SVGTextMetrics::measureCharacterRange(text, textPosition, 2);
    217214                    metricsLength = currentMetrics.length();
     215                    valueListAdvance = 1;
     216                } else {
     217                    // Handle BMP characters.
     218                    startToCurrentMetrics = SVGTextMetrics::measureCharacterRange(text, 0, textPosition + 1);
     219                    currentMetrics = SVGTextMetrics::measureCharacterRange(text, textPosition, 1);
     220                    metricsLength = currentMetrics.length();
     221                    valueListAdvance = metricsLength;
    218222                }
    219223
     
    248252
    249253                lastCharacter = currentCharacter;
    250                 valueListPosition += metricsLength;
     254                valueListPosition += valueListAdvance;
    251255            }
    252256
Note: See TracChangeset for help on using the changeset viewer.