Source/WebCore: Reverted r129176, the fix for <http://webkit.org/b/97269>, because...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 18:18:05 +0000 (18:18 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 18:18:05 +0000 (18:18 +0000)
discrepancy between line breaking and max width computation.

Rubber-stamped by Anders Carlsson.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):

LayoutTests: Reveted r129176 and r129185.

Rubber-stamped by Anders Carlsson.

* platform/mac-lion/fast/writing-mode/text-orientation-basic-expected.txt:
* platform/mac/fast/text/emphasis-expected.png:
* platform/mac/fast/text/emphasis-expected.txt:
* platform/mac/fast/text/sticky-typesetting-features-expected.png:
* platform/mac/fast/text/sticky-typesetting-features-expected.txt:
* platform/mac/fast/text/thai-combining-mark-positioning-expected.png:
* platform/mac/fast/text/thai-combining-mark-positioning-expected.txt:
* platform/mac/fast/writing-mode/text-orientation-basic-expected.png:
* platform/mac/fast/writing-mode/text-orientation-basic-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129389 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-lion/fast/writing-mode/text-orientation-basic-expected.txt
LayoutTests/platform/mac/fast/text/emphasis-expected.png
LayoutTests/platform/mac/fast/text/emphasis-expected.txt
LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.png
LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.txt
LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.png
LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.txt
LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.png
LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/mac/ComplexTextController.cpp

index 7890274..847f0ec 100644 (file)
@@ -1,3 +1,19 @@
+2012-09-24  Dan Bernstein  <mitz@apple.com>
+
+        Reveted r129176 and r129185.
+
+        Rubber-stamped by Anders Carlsson.
+
+        * platform/mac-lion/fast/writing-mode/text-orientation-basic-expected.txt:
+        * platform/mac/fast/text/emphasis-expected.png:
+        * platform/mac/fast/text/emphasis-expected.txt:
+        * platform/mac/fast/text/sticky-typesetting-features-expected.png:
+        * platform/mac/fast/text/sticky-typesetting-features-expected.txt:
+        * platform/mac/fast/text/thai-combining-mark-positioning-expected.png:
+        * platform/mac/fast/text/thai-combining-mark-positioning-expected.txt:
+        * platform/mac/fast/writing-mode/text-orientation-basic-expected.png:
+        * platform/mac/fast/writing-mode/text-orientation-basic-expected.txt:
+
 2012-09-24  Bo Liu  <boliu@chromium.org>
 
         Reland "Add in-place reload behavior to ImagesEnabled setting" with optimizations
index fdfe33b..ff11234 100644 (file)
@@ -49,8 +49,8 @@ layer at (0,0) size 785x704
             RenderText {#text} at (94,1) size 36x198
               text run at (94,1) width 198: "Hello world"
           RenderBR {BR} at (112,199) size 0x0
-          RenderInline {SPAN} at (0,0) size 36x198
-            RenderText {#text} at (148,1) size 36x198
-              text run at (148,1) width 198: "Hello world"
-          RenderBR {BR} at (166,199) size 0x0
+          RenderInline {SPAN} at (0,0) size 36x222
+            RenderText {#text} at (148,1) size 36x222
+              text run at (148,1) width 222: "Hello world"
+          RenderBR {BR} at (166,223) size 0x0
         RenderText {#text} at (0,0) size 0x0
index 40a0e94..879ab26 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/text/emphasis-expected.png and b/LayoutTests/platform/mac/fast/text/emphasis-expected.png differ
index 7844228..f7adaf8 100644 (file)
@@ -25,9 +25,9 @@ layer at (0,0) size 800x562
         RenderInline {SPAN} at (0,0) size 217x28
           RenderText {#text} at (3,45) size 217x28
             text run at (3,45) width 217: "consectetur adipiscing"
-        RenderText {#text} at (220,45) size 134x28
+        RenderText {#text} at (220,45) size 135x28
           text run at (220,45) width 6: " "
-          text run at (226,45) width 128: "elit. Aliquam"
+          text run at (226,45) width 129: "elit. Aliquam"
         RenderInline {SPAN} at (0,0) size 111x28
           RenderText {#text} at (3,73) size 111x28
             text run at (3,73) width 111: "odio sa\x{300}pien"
index ff24610..17c48e0 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.png and b/LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.png differ
index 3a1b8aa..5a406a4 100644 (file)
@@ -13,5 +13,5 @@ layer at (0,0) size 800x600
         RenderText {#text} at (0,0) size 324x18
           text run at (0,0) width 324: "This should be rendered with kerning and ligatures:"
       RenderBlock {DIV} at (0,250) size 784x166
-        RenderText {#text} at (0,0) size 751x166
-          text run at (0,0) width 751: "Office Today"
+        RenderText {#text} at (0,0) size 754x166
+          text run at (0,0) width 754: "Office Today"
index aca6db0..9dd966c 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.png and b/LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.png differ
index a114f89..94156ea 100644 (file)
@@ -4,5 +4,5 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x101
-        RenderText {#text} at (0,0) size 385x101
-          text run at (0,0) width 385: "\x{E43}\x{E2B}\x{E49}\x{E21}\x{E35}\x{E02}\x{E36}\x{E49}\x{E19} \x{E01}\x{E32}\x{E23}\x{E17}\x{E4D}\x{E32}\x{E43}\x{E2B}\x{E49}"
+        RenderText {#text} at (0,0) size 384x101
+          text run at (0,0) width 384: "\x{E43}\x{E2B}\x{E49}\x{E21}\x{E35}\x{E02}\x{E36}\x{E49}\x{E19} \x{E01}\x{E32}\x{E23}\x{E17}\x{E4D}\x{E32}\x{E43}\x{E2B}\x{E49}"
index d37655a..5936c77 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.png and b/LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.png differ
index 22aa99d..b10705d 100644 (file)
@@ -49,8 +49,8 @@ layer at (0,0) size 785x704
             RenderText {#text} at (94,1) size 36x197
               text run at (94,1) width 197: "Hello world"
           RenderBR {BR} at (112,198) size 0x0
-          RenderInline {SPAN} at (0,0) size 36x197
-            RenderText {#text} at (148,1) size 36x197
-              text run at (148,1) width 197: "Hello world"
-          RenderBR {BR} at (166,198) size 0x0
+          RenderInline {SPAN} at (0,0) size 36x221
+            RenderText {#text} at (148,1) size 36x221
+              text run at (148,1) width 221: "Hello world"
+          RenderBR {BR} at (166,222) size 0x0
         RenderText {#text} at (0,0) size 0x0
index 49a943e..00c1fc5 100644 (file)
@@ -1,3 +1,13 @@
+2012-09-24  Dan Bernstein  <mitz@apple.com>
+
+        Reverted r129176, the fix for <http://webkit.org/b/97269>, because it introduced a
+        discrepancy between line breaking and max width computation.
+
+        Rubber-stamped by Anders Carlsson.
+
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+
 2012-09-24  Bo Liu  <boliu@chromium.org>
 
         Reland "Add in-place reload behavior to ImagesEnabled setting" with optimizations
index edc74fb..3553a97 100644 (file)
@@ -575,14 +575,8 @@ void ComplexTextController::adjustGlyphsAndAdvances()
                 nextCh = *(m_complexTextRuns[r + 1]->characters() + m_complexTextRuns[r + 1]->indexAt(0));
 
             bool treatAsSpace = Font::treatAsSpace(ch);
-            CGGlyph glyph = glyphs[i];
-            CGSize advance = advances[i];
-            // FIXME: We should find a way to substitute spaces for characters that are treated as spaces
-            // before handing them off to Core Text, so that kerning can be applied as if they were spaces.
-            if (treatAsSpace && ch != ' ') {
-                glyph = fontData->spaceGlyph();
-                advance.width = spaceWidth;
-            }
+            CGGlyph glyph = treatAsSpace ? fontData->spaceGlyph() : glyphs[i];
+            CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
 
             if (ch == '\t' && m_run.allowTabs())
                 advance.width = m_font.tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);