<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199890] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199890">199890</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-04-22 12:24:42 -0700 (Fri, 22 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Crash under FontCache::purgeInactiveFontData()
https://bugs.webkit.org/show_bug.cgi?id=156822
&lt;rdar://problem/25373970&gt;

Reviewed by Darin Adler.

In some rare cases, the Font constructor would mutate the FontPlatformData
that is being passed in. This is an issue because because our FontCache
uses the FontPlatformData as key for the cached fonts. This could lead to
crashes because the WTFMove() in FontCache::purgeInactiveFontData() would
nullify values in our HashMap but we would then fail to remove them from
the HashMap (because the key did not match). We would then reference the
null font when looping again when doing font-&gt;hasOneRef().

This patch marks Font::m_platformData member as const to avoid such issues
in the future and moves the code altering the FontPlatformData from the
Font constructor into the FontPlatformData constructor. The purpose of
that code was to initialize FontPlatformData::m_cgFont in case the CGFont
passed in the constructor was null.

* platform/graphics/Font.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForPlatformData):
(WebCore::FontCache::purgeInactiveFontData):
* platform/graphics/FontPlatformData.cpp:
(WebCore::FontPlatformData::FontPlatformData):
* platform/graphics/FontPlatformData.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::webFallbackFontFamily): Deleted.
(WebCore::Font::platformInit): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::webFallbackFontFamily):
(WebCore::FontPlatformData::setFallbackCGFont):
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::setFallbackCGFont):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFonth">trunk/Source/WebCore/platform/graphics/Font.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCachecpp">trunk/Source/WebCore/platform/graphics/FontCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp">trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatah">trunk/Source/WebCore/platform/graphics/FontPlatformData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDatah">trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinFontPlatformDataCGWincpp">trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinFontPlatformDataCairoWincpp">trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinSimpleFontDataCGWincpp">trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinSimpleFontDataCairoWincpp">trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/ChangeLog        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -1,5 +1,43 @@
</span><span class="cx"> 2016-04-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Crash under FontCache::purgeInactiveFontData()
+        https://bugs.webkit.org/show_bug.cgi?id=156822
+        &lt;rdar://problem/25373970&gt;
+
+        Reviewed by Darin Adler.
+
+        In some rare cases, the Font constructor would mutate the FontPlatformData
+        that is being passed in. This is an issue because because our FontCache
+        uses the FontPlatformData as key for the cached fonts. This could lead to
+        crashes because the WTFMove() in FontCache::purgeInactiveFontData() would
+        nullify values in our HashMap but we would then fail to remove them from
+        the HashMap (because the key did not match). We would then reference the
+        null font when looping again when doing font-&gt;hasOneRef().
+
+        This patch marks Font::m_platformData member as const to avoid such issues
+        in the future and moves the code altering the FontPlatformData from the
+        Font constructor into the FontPlatformData constructor. The purpose of
+        that code was to initialize FontPlatformData::m_cgFont in case the CGFont
+        passed in the constructor was null.
+
+        * platform/graphics/Font.h:
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::fontForPlatformData):
+        (WebCore::FontCache::purgeInactiveFontData):
+        * platform/graphics/FontPlatformData.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/graphics/FontPlatformData.h:
+        * platform/graphics/cocoa/FontCocoa.mm:
+        (WebCore::webFallbackFontFamily): Deleted.
+        (WebCore::Font::platformInit): Deleted.
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::webFallbackFontFamily):
+        (WebCore::FontPlatformData::setFallbackCGFont):
+        * platform/graphics/win/FontPlatformDataCGWin.cpp:
+        (WebCore::FontPlatformData::setFallbackCGFont):
+
+2016-04-22  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Support disabling at runtime IndexedDB constructors exposed to workers
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=156883
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Font.h (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Font.h        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/Font.h        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx">     float m_maxCharWidth;
</span><span class="cx">     float m_avgCharWidth;
</span><span class="cx"> 
</span><del>-    FontPlatformData m_platformData;
</del><ins>+    const FontPlatformData m_platformData;
</ins><span class="cx"> 
</span><span class="cx">     mutable RefPtr&lt;GlyphPage&gt; m_glyphPageZero;
</span><span class="cx">     mutable HashMap&lt;unsigned, RefPtr&lt;GlyphPage&gt;&gt; m_glyphPages;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.cpp        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -396,6 +396,8 @@
</span><span class="cx">     if (addResult.isNewEntry)
</span><span class="cx">         addResult.iterator-&gt;value = Font::create(platformData);
</span><span class="cx"> 
</span><ins>+    ASSERT(addResult.iterator-&gt;value-&gt;platformData() == platformData);
+
</ins><span class="cx">     return *addResult.iterator-&gt;value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -435,8 +437,10 @@
</span><span class="cx">         // Fonts may ref other fonts so we loop until there are no changes.
</span><span class="cx">         if (fontsToDelete.isEmpty())
</span><span class="cx">             break;
</span><del>-        for (auto&amp; font : fontsToDelete)
-            cachedFonts().remove(font-&gt;platformData());
</del><ins>+        for (auto&amp; font : fontsToDelete) {
+            bool success = cachedFonts().remove(font-&gt;platformData());
+            ASSERT_UNUSED(success, success);
+        }
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FontPlatformDataCacheKey&gt; keysToRemove;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -58,6 +58,8 @@
</span><span class="cx">     : FontPlatformData(size, syntheticBold, syntheticOblique, orientation, widthVariant, textRenderingMode)
</span><span class="cx"> {
</span><span class="cx">     m_cgFont = cgFont;
</span><ins>+    if (!m_cgFont)
+        setFallbackCGFont();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -216,6 +216,9 @@
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     void platformDataInit(HFONT, float size, HDC, WCHAR* faceName);
</span><span class="cx"> #endif
</span><ins>+#if USE(CG)
+    void setFallbackCGFont();
+#endif
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     bool m_syntheticBold { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -79,13 +79,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(APPKIT)
-static NSString *webFallbackFontFamily(void)
-{
-    static NSString *webFallbackFontFamily = [[[NSFont systemFontOfSize:16.0f] familyName] retain];
-    return webFallbackFontFamily;
-}
-#else
</del><ins>+#if !USE(APPKIT)
</ins><span class="cx"> bool fontFamilyShouldNotBeUsedForArabic(CFStringRef fontFamilyName)
</span><span class="cx"> {
</span><span class="cx">     if (!fontFamilyName)
</span><span class="lines">@@ -104,59 +98,6 @@
</span><span class="cx"> #if USE(APPKIT)
</span><span class="cx">     m_syntheticBoldOffset = m_platformData.m_syntheticBold ? 1.0f : 0.f;
</span><span class="cx"> 
</span><del>-    bool failedSetup = false;
-    if (!platformData().cgFont()) {
-        // Ack! Something very bad happened, like a corrupt font.
-        // Try looking for an alternate 'base' font for this renderer.
-
-        // Special case hack to use &quot;Times New Roman&quot; in place of &quot;Times&quot;.
-        // &quot;Times RO&quot; is a common font whose family name is &quot;Times&quot;.
-        // It overrides the normal &quot;Times&quot; family font.
-        // It also appears to have a corrupt regular variant.
-        NSString *fallbackFontFamily;
-        if ([[m_platformData.nsFont() familyName] isEqual:@&quot;Times&quot;])
-            fallbackFontFamily = @&quot;Times New Roman&quot;;
-        else
-            fallbackFontFamily = webFallbackFontFamily();
-        
-        // Try setting up the alternate font.
-        // This is a last ditch effort to use a substitute font when something has gone wrong.
-#if !ERROR_DISABLED
-        RetainPtr&lt;NSFont&gt; initialFont = m_platformData.nsFont();
-#endif
-        if (m_platformData.font())
-            m_platformData.setNSFont([[NSFontManager sharedFontManager] convertFont:m_platformData.nsFont() toFamily:fallbackFontFamily]);
-        else
-            m_platformData.setNSFont([NSFont fontWithName:fallbackFontFamily size:m_platformData.size()]);
-        if (!platformData().cgFont()) {
-            if ([fallbackFontFamily isEqual:@&quot;Times New Roman&quot;]) {
-                // OK, couldn't setup Times New Roman as an alternate to Times, fallback
-                // on the system font.  If this fails we have no alternative left.
-                m_platformData.setNSFont([[NSFontManager sharedFontManager] convertFont:m_platformData.nsFont() toFamily:webFallbackFontFamily()]);
-                if (!platformData().cgFont()) {
-                    // We tried, Times, Times New Roman, and the system font. No joy. We have to give up.
-                    LOG_ERROR(&quot;unable to initialize with font %@&quot;, initialFont.get());
-                    failedSetup = true;
-                }
-            } else {
-                // We tried the requested font and the system font. No joy. We have to give up.
-                LOG_ERROR(&quot;unable to initialize with font %@&quot;, initialFont.get());
-                failedSetup = true;
-            }
-        }
-
-        // Report the problem.
-        LOG_ERROR(&quot;Corrupt font detected, using %@ in place of %@.&quot;,
-            [m_platformData.nsFont() familyName], [initialFont.get() familyName]);
-    }
-
-    // If all else fails, try to set up using the system font.
-    // This is probably because Times and Times New Roman are both unavailable.
-    if (failedSetup) {
-        m_platformData.setNSFont([NSFont systemFontOfSize:[m_platformData.nsFont() pointSize]]);
-        LOG_ERROR(&quot;failed to set up font, using system font %s&quot;, m_platformData.font());
-    }
-
</del><span class="cx"> #if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101100
</span><span class="cx">     // Work around &lt;rdar://problem/19433490&gt;
</span><span class="cx">     CGGlyph dummyGlyphs[] = {0, 0};
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -58,6 +58,77 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(APPKIT)
+
+static NSString *webFallbackFontFamily(void)
+{
+    static NSString *webFallbackFontFamily = [[[NSFont systemFontOfSize:16.0f] familyName] retain];
+    return webFallbackFontFamily;
+}
+
+void FontPlatformData::setFallbackCGFont()
+{
+    if (cgFont())
+        return;
+
+    // Ack! Something very bad happened, like a corrupt font.
+    // Try looking for an alternate 'base' font for this renderer.
+
+    // Special case hack to use &quot;Times New Roman&quot; in place of &quot;Times&quot;.
+    // &quot;Times RO&quot; is a common font whose family name is &quot;Times&quot;.
+    // It overrides the normal &quot;Times&quot; family font.
+    // It also appears to have a corrupt regular variant.
+    NSString *fallbackFontFamily;
+    if ([[nsFont() familyName] isEqual:@&quot;Times&quot;])
+        fallbackFontFamily = @&quot;Times New Roman&quot;;
+    else
+        fallbackFontFamily = webFallbackFontFamily();
+
+    // Try setting up the alternate font.
+    // This is a last ditch effort to use a substitute font when something has gone wrong.
+#if !ERROR_DISABLED
+    RetainPtr&lt;NSFont&gt; initialFont = nsFont();
+#endif
+    if (font())
+        setNSFont([[NSFontManager sharedFontManager] convertFont:nsFont() toFamily:fallbackFontFamily]);
+    else
+        setNSFont([NSFont fontWithName:fallbackFontFamily size:size()]);
+
+    if (cgFont())
+        return;
+
+    if ([fallbackFontFamily isEqual:@&quot;Times New Roman&quot;]) {
+        // OK, couldn't setup Times New Roman as an alternate to Times, fallback
+        // on the system font. If this fails we have no alternative left.
+        setNSFont([[NSFontManager sharedFontManager] convertFont:nsFont() toFamily:webFallbackFontFamily()]);
+        if (cgFont())
+            return;
+
+        // We tried, Times, Times New Roman, and the system font. No joy. We have to give up.
+        LOG_ERROR(&quot;unable to initialize with font %@&quot;, initialFont.get());
+    } else {
+        // We tried the requested font and the system font. No joy. We have to give up.
+        LOG_ERROR(&quot;unable to initialize with font %@&quot;, initialFont.get());
+    }
+
+    // Report the problem.
+    LOG_ERROR(&quot;Corrupt font detected, using %@ in place of %@.&quot;, [nsFont() familyName], [initialFont.get() familyName]);
+
+    // If all else fails, try to set up using the system font.
+    // This is probably because Times and Times New Roman are both unavailable.
+    ASSERT(!cgFont());
+    setNSFont([NSFont systemFontOfSize:[nsFont() pointSize]]);
+    LOG_ERROR(&quot;failed to set up font, using system font %s&quot;, font());
+}
+
+#else
+
+void FontPlatformData::setFallbackCGFont()
+{
+}
+
+#endif
+
</ins><span class="cx"> void FontPlatformData::platformDataInit(const FontPlatformData&amp; f)
</span><span class="cx"> {
</span><span class="cx">     m_font = f.m_font;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> 
</span><span class="cx">     HarfBuzzFace* harfBuzzFace() const;
</span><span class="cx"> 
</span><del>-    bool isFixedPitch();
</del><ins>+    bool isFixedPitch() const;
</ins><span class="cx">     float size() const { return m_size; }
</span><span class="cx">     void setSize(float size) { m_size = size; }
</span><span class="cx">     bool syntheticBold() const { return m_syntheticBold; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -273,7 +273,7 @@
</span><span class="cx">     return m_harfBuzzFace.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FontPlatformData::isFixedPitch()
</del><ins>+bool FontPlatformData::isFixedPitch() const
</ins><span class="cx"> {
</span><span class="cx">     return m_fixedWidth;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinFontPlatformDataCGWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -113,6 +113,8 @@
</span><span class="cx">     LOGFONT logfont;
</span><span class="cx">     GetObject(font, sizeof(logfont), &amp;logfont);
</span><span class="cx">     m_cgFont = adoptCF(CGFontCreateWithPlatformFont(&amp;logfont));
</span><ins>+    if (!m_useGDI)
+        m_isSystemFont = !wcscmp(faceName, L&quot;Lucida Grande&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontPlatformData::FontPlatformData(GDIObject&lt;HFONT&gt; hfont, CGFontRef font, float size, bool bold, bool oblique, bool useGDI)
</span><span class="lines">@@ -155,4 +157,8 @@
</span><span class="cx">         &amp;&amp; m_useGDI == other.m_useGDI;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FontPlatformData::setFallbackCGFont()
+{
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinFontPlatformDataCairoWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -54,6 +54,9 @@
</span><span class="cx"> 
</span><span class="cx">     m_scaledFont = cairo_scaled_font_create(fontFace, &amp;sizeMatrix, &amp;ctm, fontOptions);
</span><span class="cx">     cairo_font_face_destroy(fontFace);
</span><ins>+
+    if (!m_useGDI &amp;&amp; m_size)
+        m_isSystemFont = !wcscmp(faceName, L&quot;Lucida Grande&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontPlatformData::FontPlatformData(GDIObject&lt;HFONT&gt; font, cairo_font_face_t* fontFace, float size, bool bold, bool oblique)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinSimpleFontDataCGWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -86,7 +86,6 @@
</span><span class="cx">         int faceLength = GetTextFace(dc, 0, 0);
</span><span class="cx">         Vector&lt;WCHAR&gt; faceName(faceLength);
</span><span class="cx">         GetTextFace(dc, faceLength, faceName.data());
</span><del>-        m_platformData.setIsSystemFont(!wcscmp(faceName.data(), L&quot;Lucida Grande&quot;));
</del><span class="cx">         SelectObject(dc, oldFont);
</span><span class="cx"> 
</span><span class="cx">         fAscent = ascentConsideringMacAscentHack(faceName.data(), fAscent, fDescent);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinSimpleFontDataCairoWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp (199889 => 199890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp        2016-04-22 19:22:54 UTC (rev 199889)
+++ trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp        2016-04-22 19:24:42 UTC (rev 199890)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx">     m_syntheticBoldOffset = m_platformData.syntheticBold() ? 1.0f : 0.f;
</span><span class="cx">     m_scriptCache = 0;
</span><span class="cx">     m_scriptFontProperties = 0;
</span><del>-    m_platformData.setIsSystemFont(false);
</del><span class="cx"> 
</span><span class="cx">     if (m_platformData.useGDI())
</span><span class="cx">        return initGDIFont();
</span><span class="lines">@@ -55,7 +54,6 @@
</span><span class="cx">         m_fontMetrics.reset();
</span><span class="cx">         m_avgCharWidth = 0;
</span><span class="cx">         m_maxCharWidth = 0;
</span><del>-        m_platformData.setIsSystemFont(false);
</del><span class="cx">         m_scriptCache = 0;
</span><span class="cx">         m_scriptFontProperties = 0;
</span><span class="cx">         return;
</span><span class="lines">@@ -87,11 +85,6 @@
</span><span class="cx">     }
</span><span class="cx">     float xHeight = ascent * 0.56f; // Best guess for xHeight for non-Truetype fonts.
</span><span class="cx"> 
</span><del>-    int faceLength = ::GetTextFace(dc, 0, 0);
-    Vector&lt;WCHAR&gt; faceName(faceLength);
-    ::GetTextFace(dc, faceLength, faceName.data());
-    m_platformData.setIsSystemFont(!wcscmp(faceName.data(), L&quot;Lucida Grande&quot;));
-
</del><span class="cx">     m_fontMetrics.setAscent(ascent);
</span><span class="cx">     m_fontMetrics.setDescent(descent);
</span><span class="cx">     m_fontMetrics.setLineGap(lineGap);
</span></span></pre>
</div>
</div>

</body>
</html>