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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:23:54 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 69081845ac6f3ccd2c41fdcdff12357b6e3f2f15
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 11 06:48:22 2002 +0000

    	- fixed 2973738 -- box characters
    
    	To be consistent with other browsers, we need to draw nothing for 0000-001F.
    	We were drawing boxes.
    
            * WebCoreSupport.subproj/IFTextRenderer.m:
            (-[IFTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]):
    	Add the skipControlCharacters parameter. If YES, don't include glyphs for characters
    	in the 0000-001F range.
            (-[IFTextRenderer slowPackGlyphsForCharacters:numCharacters:glyphBuffer:numGlyphs:]):
    	Pass skipControlCharacters:YES.
            (-[IFTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]):
    	Skip control characters when creating the glyph array.
            (-[IFTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]):
    	Pass skipControlCharacters:YES.
            (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]):
    	Skip control characters when computing the width.
            (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): Pass skipControlCharacters:NO.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1535 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c078ef4..2e8c3ff 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,26 @@
 2002-07-10  Darin Adler  <darin at apple.com>
 
+	- fixed 2973738 -- box characters
+
+	To be consistent with other browsers, we need to draw nothing for 0000-001F.
+	We were drawing boxes.
+
+        * WebCoreSupport.subproj/IFTextRenderer.m:
+        (-[IFTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]):
+	Add the skipControlCharacters parameter. If YES, don't include glyphs for characters
+	in the 0000-001F range.
+        (-[IFTextRenderer slowPackGlyphsForCharacters:numCharacters:glyphBuffer:numGlyphs:]):
+	Pass skipControlCharacters:YES.
+        (-[IFTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]):
+	Skip control characters when creating the glyph array.
+        (-[IFTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]):
+	Pass skipControlCharacters:YES.
+        (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]):
+	Skip control characters when computing the width.
+        (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): Pass skipControlCharacters:NO.
+
+2002-07-10  Darin Adler  <darin at apple.com>
+
 	- fixed 2986273 -- assert currentURL isEqual:[handle redirectedURL] ? [handle redirectedURL] : [handle url]
 
 	Since cancel prevents further notification from getting through, currentURL can get
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index c078ef4..2e8c3ff 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,26 @@
 2002-07-10  Darin Adler  <darin at apple.com>
 
+	- fixed 2973738 -- box characters
+
+	To be consistent with other browsers, we need to draw nothing for 0000-001F.
+	We were drawing boxes.
+
+        * WebCoreSupport.subproj/IFTextRenderer.m:
+        (-[IFTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]):
+	Add the skipControlCharacters parameter. If YES, don't include glyphs for characters
+	in the 0000-001F range.
+        (-[IFTextRenderer slowPackGlyphsForCharacters:numCharacters:glyphBuffer:numGlyphs:]):
+	Pass skipControlCharacters:YES.
+        (-[IFTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]):
+	Skip control characters when creating the glyph array.
+        (-[IFTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]):
+	Pass skipControlCharacters:YES.
+        (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]):
+	Skip control characters when computing the width.
+        (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): Pass skipControlCharacters:NO.
+
+2002-07-10  Darin Adler  <darin at apple.com>
+
 	- fixed 2986273 -- assert currentURL isEqual:[handle redirectedURL] ? [handle redirectedURL] : [handle url]
 
 	Since cancel prevents further notification from getting through, currentURL can get
diff --git a/WebKit/WebCoreSupport.subproj/IFTextRenderer.m b/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
index 08b9515..a37031f 100644
--- a/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
@@ -239,16 +239,16 @@ static unsigned int findLengthOfCharacterCluster(const UniChar *characters, unsi
 }
 
 
-/* Convert non-breaking spaces into spaces. */
-- (void)convertCharacters: (const UniChar *)characters length: (unsigned)numCharacters toGlyphs: (ATSGlyphVector *)glyphs
+/* Convert non-breaking spaces into spaces, and skip control characters. */
+- (void)convertCharacters: (const UniChar *)characters length: (unsigned)numCharacters toGlyphs: (ATSGlyphVector *)glyphs skipControlCharacters:(BOOL)skipControlCharacters
 {
-    unsigned i;
+    unsigned i, numCharactersInBuffer;
     UniChar localBuffer[LOCAL_BUFFER_SIZE];
     UniChar *buffer = localBuffer;
     OSStatus status;
     
     for (i = 0; i < numCharacters; i++) {
-        if (characters[i] == NON_BREAKING_SPACE) {
+        if ((skipControlCharacters && characters[i] < 0x0020) || characters[i] == NON_BREAKING_SPACE) {
             break;
         }
     }
@@ -258,15 +258,17 @@ static unsigned int findLengthOfCharacterCluster(const UniChar *characters, unsi
             buffer = (UniChar *)malloc(sizeof(UniChar) * numCharacters);
         }
         
+        numCharactersInBuffer = 0;
         for (i = 0; i < numCharacters; i++) {
             if (characters[i] == NON_BREAKING_SPACE) {
-                buffer[i] = SPACE;
-            } else {
-                buffer[i] = characters[i];
+                buffer[numCharactersInBuffer++] = SPACE;
+            } else if (!(skipControlCharacters && characters[i] < 0x0020)) {
+                buffer[numCharactersInBuffer++] = characters[i];
             }
         }
         
         characters = buffer;
+        numCharacters = numCharactersInBuffer;
     }
     
     status = ATSUConvertCharToGlyphs(styleGroup, characters, 0, numCharacters, 0, glyphs);
@@ -385,7 +387,7 @@ static unsigned int findLengthOfCharacterCluster(const UniChar *characters, unsi
     ATSLayoutRecord *glyphRecord;
 
     ATSInitializeGlyphVector(numCharacters, 0, &glyphVector);
-    [self convertCharacters: characters length: numCharacters toGlyphs: &glyphVector];
+    [self convertCharacters: characters length: numCharacters toGlyphs: &glyphVector skipControlCharacters: YES];
 
     *numGlyphs = glyphVector.numGlyphs;
     *glyphBuffer = glyphBufPtr = (CGGlyph *)malloc (*numGlyphs * sizeof(CGGlyph));
@@ -564,7 +566,7 @@ typedef enum {
 
 - (_IFFailedDrawReason)_drawCharacters:(const UniChar *)characters length: (unsigned int)length fromCharacterPosition: (int)from toCharacterPosition:(int)to atPoint:(NSPoint)point withTextColor:(NSColor *)textColor backgroundColor: (NSColor *)backgroundColor
 {
-    uint i;
+    uint i, numGlyphs;
     CGGlyph *glyphs, localGlyphBuffer[LOCAL_BUFFER_SIZE];
     ATSGlyphRef glyphID;
     _IFFailedDrawReason result = _IFDrawSucceeded;
@@ -584,8 +586,14 @@ typedef enum {
     // Pack the glyph buffer and ensure that we have glyphs for all the
     // characters.  If we're missing a glyph or have a non-base character
     // stop drawing and return a failure code.
+    numGlyphs = 0;
     for (i = 0; i < length; i++) {
         UniChar c = characters[i];
+        
+        // Skip control characters.
+        if (c < 0x0020) {
+            continue;
+        }
 
         // Icky.  Deal w/ non breaking spaces.
         if (c == NON_BREAKING_SPACE)
@@ -608,15 +616,15 @@ typedef enum {
             goto cleanup;
         }
             
-        glyphs[i] = glyphID;
+        glyphs[numGlyphs++] = glyphID;
     }
 
     if (from == -1)
         from = 0;
     if (to == -1)
-        to = length;
-        
-    [self drawGlyphs: glyphs numGlyphs: length fromGlyphPosition: from toGlyphPosition:to atPoint: point withTextColor: textColor backgroundColor: backgroundColor];
+        to = numGlyphs;
+    
+    [self drawGlyphs:glyphs numGlyphs:numGlyphs fromGlyphPosition:from toGlyphPosition:to atPoint:point withTextColor:textColor backgroundColor:backgroundColor];
 
 cleanup:
     if (glyphs != localGlyphBuffer) {
@@ -699,7 +707,7 @@ cleanup:
     float lastWidth = 0;
     
     ATSInitializeGlyphVector(length, 0, &glyphVector);
-    [self convertCharacters: characters length: length toGlyphs: &glyphVector];
+    [self convertCharacters: characters length: length toGlyphs: &glyphVector skipControlCharacters: YES];
     numGlyphs = glyphVector.numGlyphs;
     glyphRecord = (ATSLayoutRecord *)glyphVector.firstRecord;
     for (i = 0; i < numGlyphs; i++){
@@ -770,22 +778,27 @@ cleanup:
     for (i = pos; i < stringLength; i++) {
         UniChar c = characters[i];
         
+        // Skip control characters.
+        if (c < 0x0020) {
+            continue;
+        }
+        
         if (c == NON_BREAKING_SPACE) {
             c = SPACE;
         }
         
         // 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){
+        if ((int)i - pos >= len) {
+            // Check if next character is a space. If so, we have to apply rounding.
+            if (c == SPACE) {
                 totalWidth -= lastWidth;
                 totalWidth += ROUND_TO_INT(lastWidth);
             }
             break;
         }
 
-        if (IsNonBaseChar(c)){
+        if (IsNonBaseChar(c)) {
             return [self slowFloatWidthForCharacters: &characters[pos] stringLength: stringLength-pos fromCharacterPostion: 0 numberOfCharacters: len applyRounding: applyRounding];
         }
 
@@ -879,7 +892,7 @@ cleanup:
     }
 
     ATSInitializeGlyphVector(count, 0, &glyphVector);
-    [self convertCharacters: &buffer[0] length: count toGlyphs: &glyphVector];
+    [self convertCharacters: &buffer[0] length: count toGlyphs: &glyphVector skipControlCharacters: NO];
     if (glyphVector.numGlyphs != count)
         [NSException raise:NSInternalInconsistencyException format:@"Optimization assumption violation:  count and glyphID count not equal - for %@ %f", self, [font displayName], [font pointSize]];
             
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 08b9515..a37031f 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -239,16 +239,16 @@ static unsigned int findLengthOfCharacterCluster(const UniChar *characters, unsi
 }
 
 
-/* Convert non-breaking spaces into spaces. */
-- (void)convertCharacters: (const UniChar *)characters length: (unsigned)numCharacters toGlyphs: (ATSGlyphVector *)glyphs
+/* Convert non-breaking spaces into spaces, and skip control characters. */
+- (void)convertCharacters: (const UniChar *)characters length: (unsigned)numCharacters toGlyphs: (ATSGlyphVector *)glyphs skipControlCharacters:(BOOL)skipControlCharacters
 {
-    unsigned i;
+    unsigned i, numCharactersInBuffer;
     UniChar localBuffer[LOCAL_BUFFER_SIZE];
     UniChar *buffer = localBuffer;
     OSStatus status;
     
     for (i = 0; i < numCharacters; i++) {
-        if (characters[i] == NON_BREAKING_SPACE) {
+        if ((skipControlCharacters && characters[i] < 0x0020) || characters[i] == NON_BREAKING_SPACE) {
             break;
         }
     }
@@ -258,15 +258,17 @@ static unsigned int findLengthOfCharacterCluster(const UniChar *characters, unsi
             buffer = (UniChar *)malloc(sizeof(UniChar) * numCharacters);
         }
         
+        numCharactersInBuffer = 0;
         for (i = 0; i < numCharacters; i++) {
             if (characters[i] == NON_BREAKING_SPACE) {
-                buffer[i] = SPACE;
-            } else {
-                buffer[i] = characters[i];
+                buffer[numCharactersInBuffer++] = SPACE;
+            } else if (!(skipControlCharacters && characters[i] < 0x0020)) {
+                buffer[numCharactersInBuffer++] = characters[i];
             }
         }
         
         characters = buffer;
+        numCharacters = numCharactersInBuffer;
     }
     
     status = ATSUConvertCharToGlyphs(styleGroup, characters, 0, numCharacters, 0, glyphs);
@@ -385,7 +387,7 @@ static unsigned int findLengthOfCharacterCluster(const UniChar *characters, unsi
     ATSLayoutRecord *glyphRecord;
 
     ATSInitializeGlyphVector(numCharacters, 0, &glyphVector);
-    [self convertCharacters: characters length: numCharacters toGlyphs: &glyphVector];
+    [self convertCharacters: characters length: numCharacters toGlyphs: &glyphVector skipControlCharacters: YES];
 
     *numGlyphs = glyphVector.numGlyphs;
     *glyphBuffer = glyphBufPtr = (CGGlyph *)malloc (*numGlyphs * sizeof(CGGlyph));
@@ -564,7 +566,7 @@ typedef enum {
 
 - (_IFFailedDrawReason)_drawCharacters:(const UniChar *)characters length: (unsigned int)length fromCharacterPosition: (int)from toCharacterPosition:(int)to atPoint:(NSPoint)point withTextColor:(NSColor *)textColor backgroundColor: (NSColor *)backgroundColor
 {
-    uint i;
+    uint i, numGlyphs;
     CGGlyph *glyphs, localGlyphBuffer[LOCAL_BUFFER_SIZE];
     ATSGlyphRef glyphID;
     _IFFailedDrawReason result = _IFDrawSucceeded;
@@ -584,8 +586,14 @@ typedef enum {
     // Pack the glyph buffer and ensure that we have glyphs for all the
     // characters.  If we're missing a glyph or have a non-base character
     // stop drawing and return a failure code.
+    numGlyphs = 0;
     for (i = 0; i < length; i++) {
         UniChar c = characters[i];
+        
+        // Skip control characters.
+        if (c < 0x0020) {
+            continue;
+        }
 
         // Icky.  Deal w/ non breaking spaces.
         if (c == NON_BREAKING_SPACE)
@@ -608,15 +616,15 @@ typedef enum {
             goto cleanup;
         }
             
-        glyphs[i] = glyphID;
+        glyphs[numGlyphs++] = glyphID;
     }
 
     if (from == -1)
         from = 0;
     if (to == -1)
-        to = length;
-        
-    [self drawGlyphs: glyphs numGlyphs: length fromGlyphPosition: from toGlyphPosition:to atPoint: point withTextColor: textColor backgroundColor: backgroundColor];
+        to = numGlyphs;
+    
+    [self drawGlyphs:glyphs numGlyphs:numGlyphs fromGlyphPosition:from toGlyphPosition:to atPoint:point withTextColor:textColor backgroundColor:backgroundColor];
 
 cleanup:
     if (glyphs != localGlyphBuffer) {
@@ -699,7 +707,7 @@ cleanup:
     float lastWidth = 0;
     
     ATSInitializeGlyphVector(length, 0, &glyphVector);
-    [self convertCharacters: characters length: length toGlyphs: &glyphVector];
+    [self convertCharacters: characters length: length toGlyphs: &glyphVector skipControlCharacters: YES];
     numGlyphs = glyphVector.numGlyphs;
     glyphRecord = (ATSLayoutRecord *)glyphVector.firstRecord;
     for (i = 0; i < numGlyphs; i++){
@@ -770,22 +778,27 @@ cleanup:
     for (i = pos; i < stringLength; i++) {
         UniChar c = characters[i];
         
+        // Skip control characters.
+        if (c < 0x0020) {
+            continue;
+        }
+        
         if (c == NON_BREAKING_SPACE) {
             c = SPACE;
         }
         
         // 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){
+        if ((int)i - pos >= len) {
+            // Check if next character is a space. If so, we have to apply rounding.
+            if (c == SPACE) {
                 totalWidth -= lastWidth;
                 totalWidth += ROUND_TO_INT(lastWidth);
             }
             break;
         }
 
-        if (IsNonBaseChar(c)){
+        if (IsNonBaseChar(c)) {
             return [self slowFloatWidthForCharacters: &characters[pos] stringLength: stringLength-pos fromCharacterPostion: 0 numberOfCharacters: len applyRounding: applyRounding];
         }
 
@@ -879,7 +892,7 @@ cleanup:
     }
 
     ATSInitializeGlyphVector(count, 0, &glyphVector);
-    [self convertCharacters: &buffer[0] length: count toGlyphs: &glyphVector];
+    [self convertCharacters: &buffer[0] length: count toGlyphs: &glyphVector skipControlCharacters: NO];
     if (glyphVector.numGlyphs != count)
         [NSException raise:NSInternalInconsistencyException format:@"Optimization assumption violation:  count and glyphID count not equal - for %@ %f", self, [font displayName], [font pointSize]];
             

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list