[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:51:03 UTC 2010


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

    https://bugs.webkit.org/show_bug.cgi?id=49521
    
    Reviewed by Dan Bernstein.
    
    REGRESSION svg/W3C-SVG-1.1/fonts-desc-02-t.svg broken by r71979.
    
    Refine the font selection function for @font-face to be smarter about what fonts it prefers.  If
    a font is labeled as only supporting small-caps, then prefer it to one that claims to support both
    normal and small-caps.  The specialized font is more likely to be true small-caps and to not rely
    on synthesis.
    
    Added the same logic for italic as well.  Prefer the font that is specifically restricted to
    italic to one that claims it can support anything.
    
    * css/CSSFontSelector.cpp:
    (WebCore::compareFontFaces):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71993 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2fa0edd..5bccc86 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-11-14  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49521
+
+        REGRESSION svg/W3C-SVG-1.1/fonts-desc-02-t.svg broken by r71979.
+        
+        Refine the font selection function for @font-face to be smarter about what fonts it prefers.  If
+        a font is labeled as only supporting small-caps, then prefer it to one that claims to support both
+        normal and small-caps.  The specialized font is more likely to be true small-caps and to not rely
+        on synthesis.
+        
+        Added the same logic for italic as well.  Prefer the font that is specifically restricted to
+        italic to one that claims it can support anything.
+
+        * css/CSSFontSelector.cpp:
+        (WebCore::compareFontFaces):
+
 2010-11-14  Ryuan Choi  <ryuan.choi at samsung.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebCore/css/CSSFontSelector.cpp b/WebCore/css/CSSFontSelector.cpp
index 4f00ae8..94cb0cb 100644
--- a/WebCore/css/CSSFontSelector.cpp
+++ b/WebCore/css/CSSFontSelector.cpp
@@ -401,12 +401,30 @@ static inline bool compareFontFaces(CSSFontFace* first, CSSFontFace* second)
     if (firstHasDesiredVariant != secondHasDesiredVariant)
         return firstHasDesiredVariant;
 
+    if (desiredTraitsMaskForComparison & FontVariantSmallCapsMask) {
+        // Prefer a font that has indicated that it can only support small-caps to a font that claims to support
+        // all variants.  The specialized font is more likely to be true small-caps and not require synthesis.
+        bool firstRequiresSmallCaps = (firstTraitsMask & FontVariantSmallCapsMask) && !(firstTraitsMask & FontVariantNormalMask);
+        bool secondRequiresSmallCaps = (secondTraitsMask & FontVariantSmallCapsMask) && !(secondTraitsMask & FontVariantNormalMask);
+        if (firstRequiresSmallCaps != secondRequiresSmallCaps)
+            return firstRequiresSmallCaps;
+    }
+
     bool firstHasDesiredStyle = firstTraitsMask & desiredTraitsMaskForComparison & FontStyleMask;
     bool secondHasDesiredStyle = secondTraitsMask & desiredTraitsMaskForComparison & FontStyleMask;
 
     if (firstHasDesiredStyle != secondHasDesiredStyle)
         return firstHasDesiredStyle;
 
+    if (desiredTraitsMaskForComparison & FontStyleItalicMask) {
+        // Prefer a font that has indicated that it can only support italic to a font that claims to support
+        // all styles.  The specialized font is more likely to be what the author wants.
+        bool firstRequiresItalics = (firstTraitsMask & FontStyleItalicMask) && !(firstTraitsMask & FontStyleNormalMask);
+        bool secondRequiresItalics = (secondTraitsMask & FontStyleItalicMask) && !(secondTraitsMask & FontStyleNormalMask);
+        if (firstRequiresItalics != secondRequiresItalics)
+            return firstRequiresItalics;
+    }
+
     if (secondTraitsMask & desiredTraitsMaskForComparison & FontWeightMask)
         return false;
     if (firstTraitsMask & desiredTraitsMaskForComparison & FontWeightMask)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list