Title: [87215] trunk
Revision
87215
Author
[email protected]
Date
2011-05-24 15:12:24 -0700 (Tue, 24 May 2011)

Log Message

2011-05-24  James Simonsen  <[email protected]>

        Reviewed by Eric Seidel.

        ASSERT_NOT_REACHED reached with broken ideograph and system fallback
        https://bugs.webkit.org/show_bug.cgi?id=53528

        * platform/chromium/test_expectations.txt: Remove CRASH from fixed test.
2011-05-24  James Simonsen  <[email protected]>

        Reviewed by Eric Seidel.

        ASSERT_NOT_REACHED reached with broken ideograph and system fallback
        https://bugs.webkit.org/show_bug.cgi?id=53528

        Test: fast/text/justify-ideograph-vertical.html (on chromium linux)

        * platform/graphics/FontFastPath.cpp:
        (WebCore::Font::glyphDataForCharacter): Identify and handle broken ideographs as any other variant.
        * platform/graphics/SimpleFontData.h:
        (WebCore::SimpleFontData::variantFontData): Added BrokenIdeographVariant.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87214 => 87215)


--- trunk/LayoutTests/ChangeLog	2011-05-24 22:10:03 UTC (rev 87214)
+++ trunk/LayoutTests/ChangeLog	2011-05-24 22:12:24 UTC (rev 87215)
@@ -1,3 +1,12 @@
+2011-05-24  James Simonsen  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        ASSERT_NOT_REACHED reached with broken ideograph and system fallback
+        https://bugs.webkit.org/show_bug.cgi?id=53528
+
+        * platform/chromium/test_expectations.txt: Remove CRASH from fixed test.
+
 2011-05-24  Ryosuke Niwa  <[email protected]>
 
         Skip fast/events/scroll-in-scaled-page-with-overflow-hidden.html on Mac WebKit2

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (87214 => 87215)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-05-24 22:10:03 UTC (rev 87214)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-05-24 22:12:24 UTC (rev 87215)
@@ -2820,15 +2820,11 @@
 BUGCR70942 WIN : editing/execCommand/break-out-of-empty-list-item.html = PASS TIMEOUT
 BUGRNIWA SLOW WIN : editing/execCommand/4786404-1.html = PASS
 
-// Added by and started crashing at http://trac.webkit.org/changeset/76743,
-// stopped crashing at some point after 80582, but see BUGCR75426!
-BUGCR71013 LINUX : fast/text/justify-ideograph-vertical.html = CRASH IMAGE+TEXT
-
 // Started failing at http://trac.webkit.org/changeset/76743
 BUGCR71022 WIN LINUX : fast/text/justify-ideograph-complex.html = IMAGE+TEXT
 BUGCR71022 MAC : fast/text/justify-ideograph-complex.html = IMAGE
 BUGCR71022 WIN LINUX : fast/text/justify-ideograph-simple.html = IMAGE+TEXT
-BUGCR71022 WIN : fast/text/justify-ideograph-vertical.html = IMAGE+TEXT
+BUGCR71022 WIN LINUX : fast/text/justify-ideograph-vertical.html = IMAGE+TEXT
 // Seems to have started failing at http://trac.webkit.org/changeset/80582
 BUGCR71022 LEOPARD : fast/text/justify-ideograph-vertical.html = IMAGE
 

Modified: trunk/Source/WebCore/ChangeLog (87214 => 87215)


--- trunk/Source/WebCore/ChangeLog	2011-05-24 22:10:03 UTC (rev 87214)
+++ trunk/Source/WebCore/ChangeLog	2011-05-24 22:12:24 UTC (rev 87215)
@@ -1,3 +1,17 @@
+2011-05-24  James Simonsen  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        ASSERT_NOT_REACHED reached with broken ideograph and system fallback
+        https://bugs.webkit.org/show_bug.cgi?id=53528
+
+        Test: fast/text/justify-ideograph-vertical.html (on chromium linux)
+
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::Font::glyphDataForCharacter): Identify and handle broken ideographs as any other variant.
+        * platform/graphics/SimpleFontData.h:
+        (WebCore::SimpleFontData::variantFontData): Added BrokenIdeographVariant.
+
 2011-05-24  Syed Idris Shah  <[email protected]>
 
         Reviewed by Andreas Kling.

Modified: trunk/Source/WebCore/platform/graphics/FontFastPath.cpp (87214 => 87215)


--- trunk/Source/WebCore/platform/graphics/FontFastPath.cpp	2011-05-24 22:10:03 UTC (rev 87214)
+++ trunk/Source/WebCore/platform/graphics/FontFastPath.cpp	2011-05-24 22:12:24 UTC (rev 87215)
@@ -70,7 +70,7 @@
             m_fontList->m_pageZero = node;
     }
 
-    GlyphPage* page;
+    GlyphPage* page = 0;
     if (variant == NormalVariant) {
         // Fastest loop, for the common case (normal variant).
         while (true) {
@@ -79,23 +79,14 @@
                 GlyphData data = ""
                 if (data.fontData && (data.fontData->platformData().orientation() == Horizontal || data.fontData->isTextOrientationFallback()))
                     return data;
-                
+
                 if (data.fontData) {
                     if (isCJKIdeographOrSymbol(c)) {
                         if (!data.fontData->hasVerticalGlyphs()) {
                             // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
                             // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
-                            const SimpleFontData* brokenIdeographFontData = data.fontData->brokenIdeographFontData();
-                            GlyphPageTreeNode* brokenIdeographNode = GlyphPageTreeNode::getRootChild(brokenIdeographFontData, pageNumber);
-                            const GlyphPage* brokenIdeographPage = brokenIdeographNode->page();
-                            if (brokenIdeographPage) {
-                                GlyphData brokenIdeographData = brokenIdeographPage->glyphDataForCharacter(c);
-                                if (brokenIdeographData.fontData)
-                                    return brokenIdeographData;
-                            }
-                            
-                            // Shouldn't be possible to even reach this point.
-                            ASSERT_NOT_REACHED();
+                            variant = BrokenIdeographVariant;
+                            break;
                         }
                     } else {
                         if (m_fontDescription.textOrientation() == TextOrientationVerticalRight) {
@@ -145,7 +136,8 @@
             else
                 m_fontList->m_pageZero = node;
         }
-    } else {
+    }
+    if (variant != NormalVariant) {
         while (true) {
             page = node->page();
             if (page) {
@@ -200,9 +192,13 @@
         codeUnitsLength = 2;
     }
     const SimpleFontData* characterFontData = fontCache()->getFontDataForCharacters(*this, codeUnits, codeUnitsLength);
-    if (variant != NormalVariant && characterFontData)
-        characterFontData = characterFontData->variantFontData(m_fontDescription, variant);
     if (characterFontData) {
+        if (characterFontData->platformData().orientation() == Vertical && !characterFontData->hasVerticalGlyphs() && isCJKIdeographOrSymbol(c))
+            variant = BrokenIdeographVariant;
+        if (variant != NormalVariant)
+            characterFontData = characterFontData->variantFontData(m_fontDescription, variant);
+    }
+    if (characterFontData) {
         // Got the fallback glyph and font.
         GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterFontData, pageNumber)->page();
         GlyphData data = "" && fallbackPage->fontDataForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();

Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.h (87214 => 87215)


--- trunk/Source/WebCore/platform/graphics/SimpleFontData.h	2011-05-24 22:10:03 UTC (rev 87214)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.h	2011-05-24 22:12:24 UTC (rev 87215)
@@ -65,7 +65,7 @@
 class FontDescription;
 class SharedBuffer;
 
-enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMarkVariant };
+enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMarkVariant, BrokenIdeographVariant };
 enum Pitch { UnknownPitch, FixedPitch, VariablePitch };
 
 class SimpleFontData : public FontData {
@@ -90,6 +90,7 @@
 
     SimpleFontData* smallCapsFontData(const FontDescription&) const;
     SimpleFontData* emphasisMarkFontData(const FontDescription&) const;
+    SimpleFontData* brokenIdeographFontData() const;
 
     SimpleFontData* variantFontData(const FontDescription& description, FontDataVariant variant) const
     {
@@ -98,6 +99,8 @@
             return smallCapsFontData(description);
         case EmphasisMarkVariant:
             return emphasisMarkFontData(description);
+        case BrokenIdeographVariant:
+            return brokenIdeographFontData();
         case AutoVariant:
         case NormalVariant:
             break;
@@ -108,7 +111,6 @@
 
     SimpleFontData* verticalRightOrientationFontData() const;
     SimpleFontData* uprightOrientationFontData() const;
-    SimpleFontData* brokenIdeographFontData() const;
 
     bool hasVerticalGlyphs() const { return m_hasVerticalGlyphs; }
     bool isTextOrientationFallback() const { return m_isTextOrientationFallback; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to