[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 15:50:07 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 15b6d510ec8ed9b83e5580fd50d68febd14a708b
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Nov 14 04:04:24 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=49499
    
    Reviewed by Dan Bernstein.
    
    broken-ideographic-font.html causes layout test flakiness in release builds.  The reason for this is
    that the custom font data for m_brokenIdeographFontData was never getting pruned out of the tree.
    The same problem exists for custom small caps fonts, so I made sure that the small caps fonts get
    pruned as well.  In addition, custom small caps fonts were never getting deleted either.
    
    I also made allowsLigatures in FontPlatformData orientation-independent, and the callers check it
    instead.
    
    Unskip fast/blockflow/broken-ideographic-font.html
    
    * platform/graphics/SimpleFontData.cpp:
    (WebCore::SimpleFontData::~SimpleFontData):
    * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
    (WebCore::SimpleFontData::platformDestroy):
    (WebCore::SimpleFontData::smallCapsFontData):
    * platform/graphics/chromium/SimpleFontDataLinux.cpp:
    (WebCore::SimpleFontData::platformDestroy):
    (WebCore::SimpleFontData::smallCapsFontData):
    * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
    (WebCore::FontPlatformData::allowsLigatures):
    * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
    (WebCore::SimpleFontData::platformDestroy):
    (WebCore::SimpleFontData::smallCapsFontData):
    * platform/graphics/haiku/SimpleFontDataHaiku.cpp:
    (WebCore::SimpleFontData::platformDestroy):
    (WebCore::SimpleFontData::smallCapsFontData):
    * platform/graphics/mac/ComplexTextControllerATSUI.cpp:
    (WebCore::disableLigatures):
    * platform/graphics/mac/SimpleFontDataCoreText.cpp:
    (WebCore::SimpleFontData::getCFStringAttributes):
    * platform/graphics/mac/SimpleFontDataMac.mm:
    (WebCore::SimpleFontData::platformDestroy):
    * platform/graphics/win/SimpleFontDataWin.cpp:
    (WebCore::SimpleFontData::platformDestroy):
    (WebCore::SimpleFontData::smallCapsFontData):
    * platform/graphics/wx/SimpleFontDataWx.cpp:
    (WebCore::SimpleFontData::platformDestroy):
    (WebCore::SimpleFontData::smallCapsFontData):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71975 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index 4b6b99f..a0b2a72 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -277,4 +277,3 @@ fast/canvas/canvas-getImageData-negative-source.html
 # Times out because plugins aren't allowed to execute JS after NPP_Destroy has been called in WebKit1's OOP plugins implementation http://webkit.org/b/48929
 plugins/evaluate-js-after-removing-plugin-element.html
 
-fast/blockflow/broken-ideographic-font.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4f015ae..733d7db 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,50 @@
 2010-11-13  David Hyatt  <hyatt at apple.com>
 
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49499
+        
+        broken-ideographic-font.html causes layout test flakiness in release builds.  The reason for this is
+        that the custom font data for m_brokenIdeographFontData was never getting pruned out of the tree.
+        The same problem exists for custom small caps fonts, so I made sure that the small caps fonts get
+        pruned as well.  In addition, custom small caps fonts were never getting deleted either.
+        
+        I also made allowsLigatures in FontPlatformData orientation-independent, and the callers check it
+        instead.
+        
+        Unskip fast/blockflow/broken-ideographic-font.html
+
+        * platform/graphics/SimpleFontData.cpp:
+        (WebCore::SimpleFontData::~SimpleFontData):
+        * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
+        (WebCore::SimpleFontData::platformDestroy):
+        (WebCore::SimpleFontData::smallCapsFontData):
+        * platform/graphics/chromium/SimpleFontDataLinux.cpp:
+        (WebCore::SimpleFontData::platformDestroy):
+        (WebCore::SimpleFontData::smallCapsFontData):
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::FontPlatformData::allowsLigatures):
+        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
+        (WebCore::SimpleFontData::platformDestroy):
+        (WebCore::SimpleFontData::smallCapsFontData):
+        * platform/graphics/haiku/SimpleFontDataHaiku.cpp:
+        (WebCore::SimpleFontData::platformDestroy):
+        (WebCore::SimpleFontData::smallCapsFontData):
+        * platform/graphics/mac/ComplexTextControllerATSUI.cpp:
+        (WebCore::disableLigatures):
+        * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+        (WebCore::SimpleFontData::getCFStringAttributes):
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::SimpleFontData::platformDestroy):
+        * platform/graphics/win/SimpleFontDataWin.cpp:
+        (WebCore::SimpleFontData::platformDestroy):
+        (WebCore::SimpleFontData::smallCapsFontData):
+        * platform/graphics/wx/SimpleFontDataWx.cpp:
+        (WebCore::SimpleFontData::platformDestroy):
+        (WebCore::SimpleFontData::smallCapsFontData):
+
+2010-11-13  David Hyatt  <hyatt at apple.com>
+
         https://bugs.webkit.org/show_bug.cgi?id=49496
 
         Fix broken-ideographic-font.html.  I had the font installed locally on my machine, and this covered up
diff --git a/WebCore/platform/graphics/SimpleFontData.cpp b/WebCore/platform/graphics/SimpleFontData.cpp
index 15598d8..391873a 100644
--- a/WebCore/platform/graphics/SimpleFontData.cpp
+++ b/WebCore/platform/graphics/SimpleFontData.cpp
@@ -184,12 +184,17 @@ SimpleFontData::~SimpleFontData()
 #endif
         platformDestroy();
 
-    if (!isCustomFont()) {
-        if (m_smallCapsFontData)
-            fontCache()->releaseFontData(m_smallCapsFontData);
+    if (!isCustomFont())
         GlyphPageTreeNode::pruneTreeFontData(this);
+    else {
+        if (m_smallCapsFontData)
+            GlyphPageTreeNode::pruneTreeCustomFontData(m_smallCapsFontData);
+
+        if (m_brokenIdeographFontData)
+            GlyphPageTreeNode::pruneTreeCustomFontData(m_brokenIdeographFontData);
     }
-    
+
+    delete m_smallCapsFontData;
     delete m_brokenIdeographFontData;
 }
 
diff --git a/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp b/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
index f3d8b86..deebd31 100644
--- a/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
@@ -98,9 +98,6 @@ void SimpleFontData::platformCharWidthInit()
 
 void SimpleFontData::platformDestroy()
 {
-    // We don't hash this on Win32, so it's effectively owned by us.
-    delete m_smallCapsFontData;
-    m_smallCapsFontData = 0;
 }
 
 SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
@@ -114,7 +111,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
         winFont.lfHeight = -lroundf(smallCapsSize);
         HFONT hfont = CreateFontIndirect(&winFont);
         m_smallCapsFontData =
-            new SimpleFontData(FontPlatformData(hfont, smallCapsSize));
+            new SimpleFontData(FontPlatformData(hfont, smallCapsSize), isCustomFont(), false);
     }
     return m_smallCapsFontData;
 }
diff --git a/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp b/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
index d03c615..e7ff9ee 100644
--- a/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
+++ b/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
@@ -127,15 +127,13 @@ void SimpleFontData::platformCharWidthInit()
 
 void SimpleFontData::platformDestroy()
 {
-    delete m_smallCapsFontData;
-    m_smallCapsFontData = 0;
 }
 
 SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
 {
     if (!m_smallCapsFontData) {
         const float smallCapsSize = lroundf(fontDescription.computedSize() * smallCapsFraction);
-        m_smallCapsFontData = new SimpleFontData(FontPlatformData(m_platformData, smallCapsSize));
+        m_smallCapsFontData = new SimpleFontData(FontPlatformData(m_platformData, smallCapsSize), isCustomFont(), false);
     }
 
     return m_smallCapsFontData;
diff --git a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
index c57d7a3..d902d3c 100644
--- a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
+++ b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
@@ -167,7 +167,7 @@ bool FontPlatformData::roundsGlyphAdvances() const
 
 bool FontPlatformData::allowsLigatures() const
 {
-    return m_orientation == Horizontal && ![[m_font coveredCharacterSet] characterIsMember:'a'];
+    return ![[m_font coveredCharacterSet] characterIsMember:'a'];
 }
 
 CTFontRef FontPlatformData::ctFont() const
diff --git a/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp b/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
index d350294..cb096c3 100644
--- a/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
+++ b/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
@@ -77,8 +77,6 @@ void SimpleFontData::platformCharWidthInit()
 
 void SimpleFontData::platformDestroy()
 {
-    delete m_smallCapsFontData;
-    m_smallCapsFontData = 0;
 }
 
 SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
@@ -87,7 +85,8 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
     if (!m_smallCapsFontData)
         m_smallCapsFontData = new SimpleFontData(
             FontPlatformData(cairo_scaled_font_get_font_face(m_platformData.scaledFont()),
-            0.70f * fontDescription.computedSize(), m_platformData.syntheticBold(), m_platformData.syntheticOblique()));
+            0.70f * fontDescription.computedSize(), m_platformData.syntheticBold(), m_platformData.syntheticOblique()),
+            isCustomFont(), false);
 
     return m_smallCapsFontData;
 }
diff --git a/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp b/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp
index 96027cc..a960972 100644
--- a/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp
@@ -64,8 +64,6 @@ void SimpleFontData::platformCharWidthInit()
 
 void SimpleFontData::platformDestroy()
 {
-    delete m_smallCapsFontData;
-    m_smallCapsFontData = 0;
 }
 
 SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
@@ -74,7 +72,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
         FontDescription desc = FontDescription(fontDescription);
         desc.setSpecifiedSize(0.70f * fontDescription.computedSize());
         FontPlatformData fontPlatformData(desc, desc.family().family());
-        m_smallCapsFontData = new SimpleFontData(fontPlatformData);
+        m_smallCapsFontData = new SimpleFontData(fontPlatformData, isCustomFont(), false);
     }
     return m_smallCapsFontData;
 }
diff --git a/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp b/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp
index 1656854..7ff316c 100644
--- a/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp
@@ -262,7 +262,7 @@ static void disableLigatures(const SimpleFontData* fontData, ATSUStyle atsuStyle
     // Don't be too aggressive: if the font doesn't contain 'a', then assume that any ligatures it contains are
     // in characters that always go through ATSUI, and therefore allow them. Geeza Pro is an example.
     // See bugzilla 5166.
-    if ((typesettingFeatures & Ligatures) || fontData->platformData().allowsLigatures())
+    if ((typesettingFeatures & Ligatures) || (fontData->orientation() == Horizontal && fontData->platformData().allowsLigatures()))
         return;
 
     ATSUFontFeatureType featureTypes[] = { kLigaturesType };
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
index 544c571..db6de49 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
+++ b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
@@ -47,7 +47,7 @@ CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typese
     if (!addResult.second)
         return attributesDictionary.get();
 
-    bool allowLigatures = platformData().allowsLigatures() || (typesettingFeatures & Ligatures);
+    bool allowLigatures = (orientation() == Horizontal && platformData().allowsLigatures()) || (typesettingFeatures & Ligatures);
 
     static const int ligaturesNotAllowedValue = 0;
     static CFNumberRef ligaturesNotAllowed = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &ligaturesNotAllowedValue);
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
index e72565d..27f9588 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
@@ -357,6 +357,11 @@ void SimpleFontData::platformCharWidthInit()
 
 void SimpleFontData::platformDestroy()
 {
+    if (m_smallCapsFontData && !isCustomFont()) {
+        fontCache()->releaseFontData(m_smallCapsFontData);
+        m_smallCapsFontData = 0;
+    }
+
 #ifdef BUILDING_ON_TIGER
     if (m_styleGroup)
         wkReleaseStyleGroup(m_styleGroup);
diff --git a/WebCore/platform/graphics/win/SimpleFontDataWin.cpp b/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
index 7010c8a..cf80ec4 100644
--- a/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
+++ b/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
@@ -94,10 +94,6 @@ void SimpleFontData::initGDIFont()
 
 void SimpleFontData::platformDestroy()
 {
-    // We don't hash this on Win32, so it's effectively owned by us.
-    delete m_smallCapsFontData;
-    m_smallCapsFontData = 0;
-
     ScriptFreeCache(&m_scriptCache);
     delete m_scriptFontProperties;
 }
@@ -115,7 +111,8 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
             GetObject(m_platformData.hfont(), sizeof(LOGFONT), &winfont);
             winfont.lfHeight = -lroundf(smallCapsHeight * (m_platformData.useGDI() ? 1 : 32));
             HFONT hfont = CreateFontIndirect(&winfont);
-            m_smallCapsFontData = new SimpleFontData(FontPlatformData(hfont, smallCapsHeight, m_platformData.syntheticBold(), m_platformData.syntheticOblique(), m_platformData.useGDI()));
+            m_smallCapsFontData = new SimpleFontData(FontPlatformData(hfont, smallCapsHeight, m_platformData.syntheticBold(), m_platformData.syntheticOblique(), m_platformData.useGDI()),
+                                                     isCustomFont(), false);
         }
     }
     return m_smallCapsFontData;
diff --git a/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp b/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
index e899715..96129f9 100644
--- a/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
+++ b/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
@@ -79,9 +79,6 @@ void SimpleFontData::platformCharWidthInit()
 
 void SimpleFontData::platformDestroy()
 {
-    delete m_smallCapsFontData;
-    m_smallCapsFontData = 0;
-    
 #if OS(WINDOWS)
     if (m_scriptFontProperties) {
         delete m_scriptFontProperties;
@@ -99,7 +96,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
         FontDescription desc = FontDescription(fontDescription);
         desc.setSpecifiedSize(0.70f * fontDescription.computedSize());
         FontPlatformData platformData(desc, desc.family().family());
-        m_smallCapsFontData = new SimpleFontData(platformData);
+        m_smallCapsFontData = new SimpleFontData(platformData, isCustomFont(), false);
     }
     return m_smallCapsFontData;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list