Changeset 78204 in webkit


Ignore:
Timestamp:
Feb 10, 2011 4:48:20 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-10 takano takumi <takano@apple.com>

Reviewed by Dan Bernstein.

A full-width character rotated leftward 90 degrees in text-combine
https://bugs.webkit.org/show_bug.cgi?id=54169

Added a test for this bug to existing text-combine test.

  • fast/text/international/text-combine-image-test.html:
  • platform/mac/fast/text/international/text-combine-image-test-expected.checksum:
  • platform/mac/fast/text/international/text-combine-image-test-expected.png:
  • platform/mac/fast/text/international/text-combine-image-test-expected.txt:

2011-02-10 takano takumi <takano@apple.com>

Reviewed by Dan Bernstein.

A full-width character rotated leftward 90 degrees in text-combine
https://bugs.webkit.org/show_bug.cgi?id=54169

  • rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::combineText):
  • Fixed by resetting font's orientation to horizontal when we decided to make combined text. Otherwise the text will be unexpectedly rotated in showGlyphsWithAdvances() in FontMac.mm.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r78191 r78204  
     12011-02-10  takano takumi  <takano@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        A full-width character rotated leftward 90 degrees in text-combine
     6        https://bugs.webkit.org/show_bug.cgi?id=54169
     7
     8        Added a test for this bug to existing text-combine test.
     9
     10        * fast/text/international/text-combine-image-test.html:
     11        * platform/mac/fast/text/international/text-combine-image-test-expected.checksum:
     12        * platform/mac/fast/text/international/text-combine-image-test-expected.png:
     13        * platform/mac/fast/text/international/text-combine-image-test-expected.txt:
     14
    1152011-02-10  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/LayoutTests/fast/text/international/text-combine-image-test.html

    r77153 r78204  
    1010
    1111#Hira24 {
    12     font-family: "HiraMinPro-W3";
     12    font-family: "HiraMinProN-W3";
    1313    font-size: 24pt;
    1414}
    1515
    16 #Hira24_float {
    17     font-family: "HiraMinPro-W3";
     16#Hira12 {
     17    font-family: "HiraMinProN-W3";
     18    font-size: 12pt;
     19}
     20
     21#Hira18_float {
     22    font-family: "HiraMinProN-W3";
    1823    font-size: 18pt;
    1924    float: right;
     
    4146<span id="Times24"><span id="combine">Times</span>=西暦<span id="combine">2010</span>年<span id="combine">1</span>月<span id="combine">20</span>日<span id="combine">365</span>回</span>
    4247<hr>
     48<span id="Hira24">OFF=字あAA%</span><br>
     49<span id="Hira24"><span id="combine">ON</span>=<span id="combine">字</span><span id="combine">あ</span><span id="combine">A</span><span id="combine">A</span><span id="combine">%</span>
     50<hr>
    4351<p>
    44 <span id="Hira24_float">float:right:<span id="combine">2010</span>年<span id="combine">1</span>月<span id="combine">20</span>日</span>
    45 その女がねかしつけに来てくれるまで、わたしはけっしてねどこにははいらなかった。冬のあらしがだんごのような雪をふきつけて窓ガラスを白くするじぶんになると、この女の人は両手の間にわたしの足をおさえて、歌を歌いながら暖めてくれた。その歌の節も文句も、いまに忘れずにいる。
     52<span id="Hira18_float">float:right:<span id="combine">2010</span>年<span id="combine">1</span>月<span id="combine">20</span>日</span>
     53<span id="Hira12">その女がねかしつけに来てくれるまで、わたしはけっしてねどこにははいらなかった。冬のあらしがだんごのような雪をふきつけて窓ガラスを白くするじぶんになると、この女の人は両手の間にわたしの足をおさえて、歌を歌いながら暖めてくれた。その歌の節も文句も、いまに忘れずにいる。</span>
    4654</p>
    4755</body>
  • trunk/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.checksum

    r77153 r78204  
    1 979b9476b03277b942201e289b7383d6
     13f73e6dddb786bf370ed93d315e6b10b
  • trunk/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.txt

    r77153 r78204  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (440,0) size 360x600
    4   RenderBlock {HTML} at (0,0) size 360x600
    5     RenderBody {BODY} at (8,8) size 336x584
     3layer at (166,0) size 634x600
     4  RenderBlock {HTML} at (0,0) size 634x600
     5    RenderBody {BODY} at (8,8) size 594x584
    66      RenderBlock {HR} at (0,0) size 2x584 [border: (1px inset #000000)]
    77      RenderBlock (anonymous) at (10,0) size 48x584
     
    6969        RenderText {#text} at (0,0) size 0x0
    7070      RenderBlock {HR} at (198,0) size 2x584 [border: (1px inset #000000)]
    71       RenderBlock {P} at (216,0) size 120x584
    72         RenderBlock (floating) {SPAN} at (0,316) size 38x268 [border: (1px solid #FF0000)]
    73           RenderText {#text} at (7,1) size 24x119
    74             text run at (7,1) width 119: "float:right:"
    75           RenderInline {SPAN} at (0,0) size 24x24
    76             RenderCombineText {#text} at (7,120) size 24x24
    77               text run at (7,120) width 24: "\x{FFFC}"
    78           RenderText {#text} at (7,144) size 24x25
    79             text run at (7,144) width 25: "\x{5E74}"
    80           RenderInline {SPAN} at (0,0) size 24x24
    81             RenderCombineText {#text} at (7,169) size 24x24
    82               text run at (7,169) width 24: "\x{FFFC}"
    83           RenderText {#text} at (7,193) size 24x25
    84             text run at (7,193) width 25: "\x{6708}"
    85           RenderInline {SPAN} at (0,0) size 24x24
    86             RenderCombineText {#text} at (7,218) size 24x24
    87               text run at (7,218) width 24: "\x{FFFC}"
    88           RenderText {#text} at (7,242) size 24x25
    89             text run at (7,242) width 25: "\x{65E5}"
    90         RenderText {#text} at (3,0) size 114x548
    91           text run at (3,0) width 291: "\x{305D}\x{306E}\x{5973}\x{304C}\x{306D}\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}\x{3001}"
    92           text run at (27,0) width 274: "\x{308F}\x{305F}\x{3057}\x{306F}\x{3051}\x{3063}\x{3057}\x{3066}\x{306D}\x{3069}\x{3053}\x{306B}\x{306F}\x{306F}\x{3044}\x{3089}\x{306A}"
    93           text run at (51,0) width 548: "\x{304B}\x{3063}\x{305F}\x{3002}\x{51AC}\x{306E}\x{3042}\x{3089}\x{3057}\x{304C}\x{3060}\x{3093}\x{3054}\x{306E}\x{3088}\x{3046}\x{306A}\x{96EA}\x{3092}\x{3075}\x{304D}\x{3064}\x{3051}\x{3066}\x{7A93}\x{30AC}\x{30E9}\x{30B9}\x{3092}\x{767D}\x{304F}\x{3059}\x{308B}\x{3058}"
    94           text run at (75,0) width 548: "\x{3076}\x{3093}\x{306B}\x{306A}\x{308B}\x{3068}\x{3001}\x{3053}\x{306E}\x{5973}\x{306E}\x{4EBA}\x{306F}\x{4E21}\x{624B}\x{306E}\x{9593}\x{306B}\x{308F}\x{305F}\x{3057}\x{306E}\x{8DB3}\x{3092}\x{304A}\x{3055}\x{3048}\x{3066}\x{3001}\x{6B4C}\x{3092}\x{6B4C}\x{3044}\x{306A}"
    95           text run at (99,0) width 468: "\x{304C}\x{3089}\x{6696}\x{3081}\x{3066}\x{304F}\x{308C}\x{305F}\x{3002}\x{305D}\x{306E}\x{6B4C}\x{306E}\x{7BC0}\x{3082}\x{6587}\x{53E5}\x{3082}\x{3001}\x{3044}\x{307E}\x{306B}\x{5FD8}\x{308C}\x{305A}\x{306B}\x{3044}\x{308B}\x{3002}"
     71      RenderBlock (anonymous) at (208,0) size 96x584
     72        RenderInline {SPAN} at (0,0) size 32x236
     73          RenderText {#text} at (8,0) size 32x236
     74            text run at (8,0) width 236: "OFF=\x{5B57}\x{3042}\x{FF21}A%"
     75        RenderBR {BR} at (15,236) size 18x0
     76        RenderInline {SPAN} at (0,0) size 32x214
     77          RenderInline {SPAN} at (0,0) size 32x32
     78            RenderCombineText {#text} at (56,0) size 32x32
     79              text run at (56,0) width 32: "\x{FFFC}"
     80          RenderText {#text} at (56,32) size 32x22
     81            text run at (56,32) width 22: "="
     82          RenderInline {SPAN} at (0,0) size 32x32
     83            RenderCombineText {#text} at (56,54) size 32x32
     84              text run at (56,54) width 32: "\x{FFFC}"
     85          RenderInline {SPAN} at (0,0) size 32x32
     86            RenderCombineText {#text} at (56,86) size 32x32
     87              text run at (56,86) width 32: "\x{FFFC}"
     88          RenderInline {SPAN} at (0,0) size 32x32
     89            RenderCombineText {#text} at (56,118) size 32x32
     90              text run at (56,118) width 32: "\x{FFFC}"
     91          RenderInline {SPAN} at (0,0) size 32x32
     92            RenderCombineText {#text} at (56,150) size 32x32
     93              text run at (56,150) width 32: "\x{FFFC}"
     94          RenderInline {SPAN} at (0,0) size 32x32
     95            RenderCombineText {#text} at (56,182) size 32x32
     96              text run at (56,182) width 32: "\x{FFFC}"
     97          RenderText {#text} at (0,0) size 0x0
     98      RenderBlock (anonymous) at (320,0) size 274x584
     99        RenderBlock {HR} at (0,0) size 2x584 [border: (1px inset #000000)]
     100        RenderBlock {P} at (34,0) size 240x584
     101          RenderBlock (floating) {SPAN} at (0,316) size 38x268 [border: (1px solid #FF0000)]
     102            RenderText {#text} at (7,1) size 24x119
     103              text run at (7,1) width 119: "float:right:"
     104            RenderInline {SPAN} at (0,0) size 24x24
     105              RenderCombineText {#text} at (7,120) size 24x24
     106                text run at (7,120) width 24: "\x{FFFC}"
     107            RenderText {#text} at (7,144) size 24x25
     108              text run at (7,144) width 25: "\x{5E74}"
     109            RenderInline {SPAN} at (0,0) size 24x24
     110              RenderCombineText {#text} at (7,169) size 24x24
     111                text run at (7,169) width 24: "\x{FFFC}"
     112            RenderText {#text} at (7,193) size 24x25
     113              text run at (7,193) width 25: "\x{6708}"
     114            RenderInline {SPAN} at (0,0) size 24x24
     115              RenderCombineText {#text} at (7,218) size 24x24
     116                text run at (7,218) width 24: "\x{FFFC}"
     117            RenderText {#text} at (7,242) size 24x25
     118              text run at (7,242) width 25: "\x{65E5}"
     119          RenderInline {SPAN} at (0,0) size 209x548
     120            RenderText {#text} at (15,0) size 209x548
     121              text run at (15,0) width 291: "\x{305D}\x{306E}\x{5973}\x{304C}\x{306D}\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}\x{3001}"
     122              text run at (63,0) width 548: "\x{308F}\x{305F}\x{3057}\x{306F}\x{3051}\x{3063}\x{3057}\x{3066}\x{306D}\x{3069}\x{3053}\x{306B}\x{306F}\x{306F}\x{3044}\x{3089}\x{306A}\x{304B}\x{3063}\x{305F}\x{3002}\x{51AC}\x{306E}\x{3042}\x{3089}\x{3057}\x{304C}\x{3060}\x{3093}\x{3054}\x{306E}\x{3088}\x{3046}\x{306A}"
     123              text run at (111,0) width 548: "\x{96EA}\x{3092}\x{3075}\x{304D}\x{3064}\x{3051}\x{3066}\x{7A93}\x{30AC}\x{30E9}\x{30B9}\x{3092}\x{767D}\x{304F}\x{3059}\x{308B}\x{3058}\x{3076}\x{3093}\x{306B}\x{306A}\x{308B}\x{3068}\x{3001}\x{3053}\x{306E}\x{5973}\x{306E}\x{4EBA}\x{306F}\x{4E21}\x{624B}\x{306E}\x{9593}"
     124              text run at (159,0) width 548: "\x{306B}\x{308F}\x{305F}\x{3057}\x{306E}\x{8DB3}\x{3092}\x{304A}\x{3055}\x{3048}\x{3066}\x{3001}\x{6B4C}\x{3092}\x{6B4C}\x{3044}\x{306A}\x{304C}\x{3089}\x{6696}\x{3081}\x{3066}\x{304F}\x{308C}\x{305F}\x{3002}\x{305D}\x{306E}\x{6B4C}\x{306E}\x{7BC0}\x{3082}\x{6587}\x{53E5}"
     125              text run at (207,0) width 194: "\x{3082}\x{3001}\x{3044}\x{307E}\x{306B}\x{5FD8}\x{308C}\x{305A}\x{306B}\x{3044}\x{308B}\x{3002}"
     126          RenderText {#text} at (0,0) size 0x0
     127      RenderBlock (anonymous) at (626,0) size 0x584
     128        RenderInline {SPAN} at (0,0) size 0x0
  • trunk/Source/WebCore/ChangeLog

    r78202 r78204  
     12011-02-10  takano takumi  <takano@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        A full-width character rotated leftward 90 degrees in text-combine
     6        https://bugs.webkit.org/show_bug.cgi?id=54169
     7
     8        * rendering/RenderCombineText.cpp:
     9        (WebCore::RenderCombineText::combineText):
     10        - Fixed by resetting font's orientation to horizontal when we decided to make combined text.
     11        Otherwise the text will be unexpectedly rotated in showGlyphsWithAdvances() in FontMac.mm.
     12
    1132011-02-10  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/Source/WebCore/rendering/RenderCombineText.cpp

    r77158 r78204  
    9494
    9595    TextRun run = TextRun(String(text()));
    96     float emWidth = style()->font().fontDescription().computedSize() * textCombineMargin;
     96    FontDescription description = style()->font().fontDescription();
     97    float emWidth = description.computedSize() * textCombineMargin;
     98    bool shouldUpdateFont = false;
     99
     100    description.setOrientation(Horizontal); // We are going to draw combined text horizontally.
    97101    m_combinedTextWidth = style()->font().floatWidth(run);
    98102    m_isCombined = m_combinedTextWidth <= emWidth;
    99103
    100     if (!m_isCombined) {
     104    if (m_isCombined)
     105        shouldUpdateFont = style()->setFontDescription(description); // Need to change font orientation to horizontal.
     106    else {
    101107        // Need to try compressed glyphs.
    102108        static const FontWidthVariant widthVariants[] = { HalfWidth, ThirdWidth, QuarterWidth };
    103         FontDescription compressedFontDescription = style()->font().fontDescription();
    104109        for (size_t i = 0 ; i < WTF_ARRAY_LENGTH(widthVariants) ; ++i) {
    105             compressedFontDescription.setWidthVariant(widthVariants[i]);
    106             Font compressedFont = Font(compressedFontDescription, style()->font().letterSpacing(), style()->font().wordSpacing());
     110            description.setWidthVariant(widthVariants[i]);
     111            Font compressedFont = Font(description, style()->font().letterSpacing(), style()->font().wordSpacing());
    107112            compressedFont.update(style()->font().fontSelector());
    108113            float runWidth = compressedFont.floatWidth(run);
     
    112117
    113118                // Replace my font with the new one.
    114                 if (style()->setFontDescription(compressedFontDescription))
    115                     style()->font().update(style()->font().fontSelector());
    116 
     119                shouldUpdateFont = style()->setFontDescription(description);
    117120                break;
    118121            }
    119122        }
    120123    }
     124
     125    if (shouldUpdateFont)
     126        style()->font().update(style()->font().fontSelector());
    121127
    122128    if (m_isCombined) {
Note: See TracChangeset for help on using the changeset viewer.