[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:29:59 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 018fde36b5f5e5160ea48145d67dc7778118b591
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 28 00:16:53 2010 +0000

    2010-01-27  Evan Martin  <evan at chromium.org>
    
            Reviewed by David Levin.
    
            [chromium] complex text draws newlines as bells
            https://bugs.webkit.org/show_bug.cgi?id=34186
    
            Revert r45496 -- once we've got a glyph array, it is too late to normalize
            because we could have had multiple codepoints combine into one glyph.  The
            Uniscribe code it mentions it's duplicating uses the log cluster map to fix
            this.
    
            Instead, we just normalize the input text if it contains any non-ascii-space
            whitespace.
    
            This fixes fast/text/international/hindi-whitespace, which currently has an
            incorrect baseline containing a square box glyph.
    
            * platform/graphics/chromium/FontLinux.cpp:
            (WebCore::TextRunWalker::getTextRun):
            (WebCore::TextRunWalker::getNormalizedTextRun):
            * platform/graphics/chromium/HarfbuzzSkia.cpp:
            (WebCore::stringToGlyphs):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53958 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cfb3c1a..f5ace10 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-01-27  Evan Martin  <evan at chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] complex text draws newlines as bells
+        https://bugs.webkit.org/show_bug.cgi?id=34186
+
+        Revert r45496 -- once we've got a glyph array, it is too late to normalize
+        because we could have had multiple codepoints combine into one glyph.  The
+        Uniscribe code it mentions it's duplicating uses the log cluster map to fix
+        this.
+
+        Instead, we just normalize the input text if it contains any non-ascii-space
+        whitespace.
+
+        This fixes fast/text/international/hindi-whitespace, which currently has an
+        incorrect baseline containing a square box glyph.
+
+        * platform/graphics/chromium/FontLinux.cpp:
+        (WebCore::TextRunWalker::getTextRun):
+        (WebCore::TextRunWalker::getNormalizedTextRun):
+        * platform/graphics/chromium/HarfbuzzSkia.cpp:
+        (WebCore::stringToGlyphs):
+
 2010-01-27  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index a4526a8..0254366 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -312,7 +312,8 @@ public:
 private:
     const TextRun& getTextRun(const TextRun& originalRun)
     {
-        // Convert the |originalRun| to NFC normalized form if combining diacritical marks
+        // Normalize the text run in two ways:
+        // 1) Convert the |originalRun| to NFC normalized form if combining diacritical marks
         // (U+0300..) are used in the run. This conversion is necessary since most OpenType
         // fonts (e.g., Arial) don't have substitution rules for the diacritical marks in
         // their GSUB tables.
@@ -321,9 +322,12 @@ private:
         // the API returns FALSE (= not normalized) for complex runs that don't require NFC
         // normalization (e.g., Arabic text). Unless the run contains the diacritical marks,
         // Harfbuzz will do the same thing for us using the GSUB table.
+        // 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
+        // for characters like '\n' otherwise.
         for (unsigned i = 0; i < originalRun.length(); ++i) {
-            UBlockCode block = ::ublock_getCode(originalRun[i]);
-            if (block == UBLOCK_COMBINING_DIACRITICAL_MARKS) {
+            UChar ch = originalRun[i];
+            UBlockCode block = ::ublock_getCode(ch);
+            if (block == UBLOCK_COMBINING_DIACRITICAL_MARKS || (Font::treatAsSpace(ch) && ch != ' ')) {
                 return getNormalizedTextRun(originalRun);
             }
         }
@@ -342,6 +346,11 @@ private:
         normalizedString.extract(m_normalizedBuffer.get(), normalizedString.length() + 1, error);
         ASSERT(U_SUCCESS(error));
 
+        for (unsigned i = 0; i < normalizedString.length(); ++i) {
+            if (Font::treatAsSpace(m_normalizedBuffer[i]))
+                m_normalizedBuffer[i] = ' ';
+        }
+
         m_normalizedRun.set(new TextRun(originalRun));
         m_normalizedRun->setText(m_normalizedBuffer.get(), normalizedString.length());
         return *m_normalizedRun;
diff --git a/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp b/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
index 621d674..9fd09e1 100644
--- a/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
+++ b/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
@@ -30,7 +30,6 @@
 
 #include "config.h"
 
-#include "Font.h"
 #include "FontPlatformData.h"
 #include "wtf/OwnArrayPtr.h"
 
@@ -42,7 +41,6 @@
 
 extern "C" {
 #include "harfbuzz-shaper.h"
-#include "harfbuzz-unicode.h"
 }
 
 // This file implements the callbacks which Harfbuzz requires by using Skia
@@ -67,29 +65,10 @@ static HB_Bool stringToGlyphs(HB_Font hbFont, const HB_UChar16* characters, hb_u
 
     // HB_Glyph is 32-bit, but Skia outputs only 16-bit numbers. So our
     // |glyphs| array needs to be converted.
-    // Additionally, if the CSS white-space property is inhibiting line
-    // breaking, we might find end-of-line charactors rendered via the complex
-    // text path. Fonts don't provide glyphs for these code points so, if we
-    // find one, we simulate the space glyph being interposed in this case.
-    // Because the input is variable-length per code point, we walk the input
-    // in step with the output.
-    // FIXME: it seems that this logic is duplicated in CoreTextController and UniscribeController
-    ssize_t indexOfNextCodePoint = 0;
-    uint16_t spaceGlyphNumber = 0;
     for (int i = numGlyphs - 1; i >= 0; --i) {
-        const uint32_t currentCodePoint = utf16_to_code_point(characters, length, &indexOfNextCodePoint);
-
         uint16_t value;
         // We use a memcpy to avoid breaking strict aliasing rules.
         memcpy(&value, reinterpret_cast<char*>(glyphs) + sizeof(uint16_t) * i, sizeof(uint16_t));
-
-        if (!value && Font::treatAsSpace(currentCodePoint)) {
-            static const uint16_t spaceUTF16 = ' ';
-            if (!spaceGlyphNumber)
-                paint.textToGlyphs(&spaceUTF16, sizeof(spaceUTF16), &spaceGlyphNumber);
-            value = spaceGlyphNumber;
-        }
-
         glyphs[i] = value;
     }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list