Title: [132589] trunk/Source/WebCore
Revision
132589
Author
[email protected]
Date
2012-10-26 02:09:09 -0700 (Fri, 26 Oct 2012)

Log Message

local(Helvetica) in src descriptor prevent fallback
https://bugs.webkit.org/show_bug.cgi?id=100446

Reviewed by Dan Bernstein.

FontCache::getCachedFontData() has a mechanism that aliases a few pairs
of font family names, so that if the family name specified in the font-family
property is not available on the system, but the its alias is available,
it will be used instead. This is appropriate for the font-family property,
but not for font family names specified in the local() function of the src
descriptor in a @font-face rule.

This patch disables the mechanism while checking src descriptor of @font-face.

No new tests. It's difficult to test the change because 'Helvetica' can
be mapped any other font. For example, chromium DRT uses FontConfig to
map Helvetica to Times New Roman. Other ports may map Helvetica to other
fonts. We can't define the expected result.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
Call fontCache()->getCachedFontData() with checkingAlternateName = true.
This disables aliasing font family names in FontCache.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (132588 => 132589)


--- trunk/Source/WebCore/ChangeLog	2012-10-26 09:06:34 UTC (rev 132588)
+++ trunk/Source/WebCore/ChangeLog	2012-10-26 09:09:09 UTC (rev 132589)
@@ -1,3 +1,29 @@
+2012-10-26  Kenichi Ishibashi  <[email protected]>
+
+        local(Helvetica) in src descriptor prevent fallback
+        https://bugs.webkit.org/show_bug.cgi?id=100446
+
+        Reviewed by Dan Bernstein.
+
+        FontCache::getCachedFontData() has a mechanism that aliases a few pairs
+        of font family names, so that if the family name specified in the font-family
+        property is not available on the system, but the its alias is available,
+        it will be used instead. This is appropriate for the font-family property,
+        but not for font family names specified in the local() function of the src
+        descriptor in a @font-face rule.
+
+        This patch disables the mechanism while checking src descriptor of @font-face.
+
+        No new tests. It's difficult to test the change because 'Helvetica' can
+        be mapped any other font. For example, chromium DRT uses FontConfig to
+        map Helvetica to Times New Roman. Other ports may map Helvetica to other
+        fonts. We can't define the expected result.
+
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::getFontData):
+        Call fontCache()->getCachedFontData() with checkingAlternateName = true.
+        This disables aliasing font family names in FontCache.
+
 2012-10-26  Eugene Klyuchnikov  <[email protected]>
 
         Web Inspector: Doctype Audits panel code

Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (132588 => 132589)


--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2012-10-26 09:06:34 UTC (rev 132588)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2012-10-26 09:09:09 UTC (rev 132589)
@@ -106,7 +106,8 @@
 #endif
     ) {
         // We're local. Just return a SimpleFontData from the normal cache.
-        return fontCache()->getCachedFontData(fontDescription, m_string);
+        // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
+        return fontCache()->getCachedFontData(fontDescription, m_string, true);
     }
 
     // See if we have a mapping in our FontData cache.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to