[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:59:38 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 7384f5ad1175f39f976ee5224970598a55e00159
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 3 21:57:15 2003 +0000

    	Fixed some edge case issue (control characters after end of word) with our rounding hack.
    
            Reviewed by Darin.
    
            * WebCoreSupport.subproj/WebTextRenderer.m:
            (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 75f467e..b9a7e63 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2003-10-03  Richard Williamson (Home0  <rjw at apple.com>
+
+	Fixed some edge case issue (control characters after end of word) with our rounding hack.
+
+        Reviewed by Darin.
+
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]):
+
 2003-10-03  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by Darin, with much help from Maciej and Hyatt
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 774cdd1..be02a46 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -1435,31 +1435,51 @@ static const char *joiningNames[] = {
             c = SPACE;
         }
         
-        // Skip control characters.
-        if (isControlCharacter(c)) {
-            if (glyphBuffer && i < (unsigned)to && endGlyph)
-                *endGlyph = numGlyphs-1;
-            continue;
-        }
-        
         // Drop out early if we've measured to the end of the requested
         // fragment.
         if ((int)i - pos >= len) {
-            // Check if next character is a space. If so, we have to apply rounding.
-            if (c == SPACE && style->applyRounding) {
-                float delta = CEIL_TO_INT(widthFromStart) - widthFromStart;
-                if (i >= (unsigned)pos)
-                    totalWidth += delta;
-                widthFromStart += delta;
-                if (widthBuffer && numGlyphs > 0)
-                    widthBuffer[numGlyphs - 1] += delta;
+            if (style->applyRounding) {
+                BOOL needsRounding = NO;
+                
+                // Check if next character is a space. If so, we have to apply rounding.
+                if (c == SPACE) {
+                    needsRounding = YES;
+                }
+                // Also check if we have a run of control characters followed by a space
+                // or end of string.  If so, we have to apply rounding.
+                else {
+                    i++;
+                    while (isControlCharacter(c) && i < stringLength){
+                        c = characters[i];
+                        i++;
+                    }
+                    if (i == stringLength || c == SPACE) {
+                        needsRounding = YES;
+                    }
+                }
+                
+                if (needsRounding) {
+                    float delta = CEIL_TO_INT(widthFromStart) - widthFromStart;
+                    if (i >= (unsigned)pos)
+                        totalWidth += delta;
+                    widthFromStart += delta;
+                    if (widthBuffer && numGlyphs > 0)
+                        widthBuffer[numGlyphs - 1] += delta;
+                }
             }
-
             if (glyphBuffer && i < (unsigned)to && endGlyph)
                 *endGlyph = numGlyphs-1;
 
             break;
         }
+
+        // Skip control characters.
+        if (isControlCharacter(c)) {
+            if (glyphBuffer && i < (unsigned)to && endGlyph)
+                *endGlyph = numGlyphs-1;
+            continue;
+        }
+        
         // Deal with surrogate pairs
         if (c >= HighSurrogateRangeStart && c <= HighSurrogateRangeEnd){
             high = c;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list