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


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

    https://bugs.webkit.org/show_bug.cgi?id=49505
    
    Reviewed by Dan Bernstein.
    
    REGRESSION: @font-face doesn't work with the small-caps variant.  This was broken by the addition of SVG fonts
    support long ago.  This patch fixes the SVG code so that it doesn't break non-SVG fonts.
    
    Added fast/blockflow/broken-ideograph-small-caps.html
    
    WebCore:
    
    * css/CSSFontFace.cpp:
    (WebCore::CSSFontFace::hasSVGFontFaceSource):
    * css/CSSFontFace.h:
    * css/CSSFontFaceSource.cpp:
    (WebCore::CSSFontFaceSource::getFontData):
    * css/CSSFontFaceSource.h:
    * css/CSSFontSelector.cpp:
    (WebCore::CSSFontSelector::addFontFaceRule):
    (WebCore::CSSFontSelector::getFontData):
    
    LayoutTests:
    
    * fast/blockflow/broken-ideograph-small-caps.html: Added.
    * platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.checksum: Added.
    * platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.png: Added.
    * platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71979 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a234aa2..7a0feae 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-13  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49505
+        
+        REGRESSION: @font-face doesn't work with the small-caps variant.  This was broken by the addition of SVG fonts
+        support long ago.  This patch fixes the SVG code so that it doesn't break non-SVG fonts.
+
+        Added fast/blockflow/broken-ideograph-small-caps.html
+
+        * fast/blockflow/broken-ideograph-small-caps.html: Added.
+        * platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.checksum: Added.
+        * platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.png: Added.
+        * platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.txt: Added.
+
 2010-11-13  Rob Buis  <rwlbuis at gmail.com>
 
         Unreviewed test expectation rebaseline.
diff --git a/LayoutTests/fast/blockflow/broken-ideograph-small-caps.html b/LayoutTests/fast/blockflow/broken-ideograph-small-caps.html
new file mode 100644
index 0000000..547ffb8
--- /dev/null
+++ b/LayoutTests/fast/blockflow/broken-ideograph-small-caps.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Broken Ideographic Font</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  
+<style type="text/css">
+ at font-face {
+    src: url(resources/MakibaFont13.ttf);
+    font-family: MakibaFace;
+}
+
+body {
+  margin: 50px;
+  font-size: 20px;
+  font-family: MakibaFace;
+  font-variant: small-caps;
+}
+
+.lrblock {
+  writing-mode: tb-lr;  /* IE */
+  -webkit-writing-mode: vertical-lr;
+  height: 275px;
+  margin-bottom: 50px;
+  padding: 1px;
+  background-color: #eee;
+}
+
+.basic {
+  width: 275px;
+  margin: 0;
+  padding: 1px;
+  writing-mode: lr-tb;  /* IE */
+  -webkit-writing-mode: horizontal-tb;
+}
+
+div.d0 {
+  background-color: #fee;
+}
+
+div.d1 {
+  background-color: #ffe;
+}
+p {
+  margin: 10% 5% 10% 5%;
+  background-color: #faa;
+  border-left: 20px solid #f88;
+  border-right: 20px solid #f88;
+  line-height: 1em;
+  padding: 1px;
+}
+
+.vert {
+  writing-mode: tb-rl;  /* IE */
+  -webkit-writing-mode: vertical-rl;
+}
+
+</style>
+  
+<script type="text/javascript">
+
+</script>
+  
+</head>
+<body>
+
+<div class="lrblock">
+<div class="basic d0"><p>第一段落 Paragraph 1</p><p>第二段落 Paragraph 2</p></div>
+<div class="basic d1 vert"><p>第一段落 Paragraph 1</p><p>第二段落 Paragraph 2</p></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.checksum
new file mode 100644
index 0000000..29c602c
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.checksum
@@ -0,0 +1 @@
+76d0c80c1f02ca72ea8fba3d166a98d1
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.png b/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.png
new file mode 100644
index 0000000..9886a72
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.txt b/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.txt
new file mode 100644
index 0000000..b5f8ef2
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/broken-ideograph-small-caps-expected.txt
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x377
+  RenderBlock {HTML} at (0,0) size 800x377
+    RenderBody {BODY} at (50,50) size 700x277
+      RenderBlock {DIV} at (0,0) size 556x277 [bgcolor=#EEEEEE]
+        RenderBlock {DIV} at (1,1) size 277x127 [bgcolor=#FFEEEE]
+          RenderBlock {P} at (14,28) size 249x22 [bgcolor=#FFAAAA] [border: (20px solid #FF8888) none (20px solid #FF8888)]
+            RenderText {#text} at (21,1) size 176x20
+              text run at (21,1) width 176: "\x{7B2C}\x{4E00}\x{6BB5}\x{843D} Paragraph 1"
+          RenderBlock {P} at (14,77) size 249x22 [bgcolor=#FFAAAA] [border: (20px solid #FF8888) none (20px solid #FF8888)]
+            RenderText {#text} at (21,1) size 176x20
+              text run at (21,1) width 176: "\x{7B2C}\x{4E8C}\x{6BB5}\x{843D} Paragraph 2"
+        RenderBlock {DIV} at (278,1) size 277x275 [bgcolor=#FFFFEE]
+          RenderBlock {P} at (14,28) size 62x219 [bgcolor=#FFAAAA] [border: (20px solid #FF8888) none (20px solid #FF8888)]
+            RenderText {#text} at (21,1) size 20x176
+              text run at (21,1) width 176: "\x{7B2C}\x{4E00}\x{6BB5}\x{843D} Paragraph 1"
+          RenderBlock {P} at (89,28) size 62x219 [bgcolor=#FFAAAA] [border: (20px solid #FF8888) none (20px solid #FF8888)]
+            RenderText {#text} at (21,1) size 20x176
+              text run at (21,1) width 176: "\x{7B2C}\x{4E8C}\x{6BB5}\x{843D} Paragraph 2"
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ccea03e..d9ddb7c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-11-13  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49505
+        
+        REGRESSION: @font-face doesn't work with the small-caps variant.  This was broken by the addition of SVG fonts
+        support long ago.  This patch fixes the SVG code so that it doesn't break non-SVG fonts.
+
+        Added fast/blockflow/broken-ideograph-small-caps.html
+
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::hasSVGFontFaceSource):
+        * css/CSSFontFace.h:
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::getFontData):
+        * css/CSSFontFaceSource.h:
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule):
+        (WebCore::CSSFontSelector::getFontData):
+
 2010-11-13  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Dave Hyatt.
diff --git a/WebCore/css/CSSFontFace.cpp b/WebCore/css/CSSFontFace.cpp
index 70cd9bb..2c50a04 100644
--- a/WebCore/css/CSSFontFace.cpp
+++ b/WebCore/css/CSSFontFace.cpp
@@ -118,5 +118,16 @@ SimpleFontData* CSSFontFace::getFontData(const FontDescription& fontDescription,
     return 0;
 }
 
+#if ENABLE(SVG_FONTS)
+bool CSSFontFace::hasSVGFontFaceSource() const
+{
+    for (unsigned i = 0; i < m_sources.size(); i++) {
+        if (m_sources[i]->isSVGFontFaceSource())
+            return true;
+    }
+    return false;
+}
+#endif
+
 }
 
diff --git a/WebCore/css/CSSFontFace.h b/WebCore/css/CSSFontFace.h
index 4e2fee5..4872727 100644
--- a/WebCore/css/CSSFontFace.h
+++ b/WebCore/css/CSSFontFace.h
@@ -79,6 +79,10 @@ public:
         UChar32 m_to;
     };
 
+#if ENABLE(SVG_FONTS)
+    bool hasSVGFontFaceSource() const;
+#endif
+
 private:
     CSSFontFace(FontTraitsMask traitsMask)
         : m_traitsMask(traitsMask)
diff --git a/WebCore/css/CSSFontFaceSource.cpp b/WebCore/css/CSSFontFaceSource.cpp
index 29e0481..30a0072 100644
--- a/WebCore/css/CSSFontFaceSource.cpp
+++ b/WebCore/css/CSSFontFaceSource.cpp
@@ -189,4 +189,11 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
     return fontDataRawPtr;
 }
 
+#if ENABLE(SVG_FONTS)
+bool CSSFontFaceSource::isSVGFontFaceSource() const
+{
+    return m_svgFontFaceElement || (m_font && m_font->isSVGFont());
+}
+#endif
+
 }
diff --git a/WebCore/css/CSSFontFaceSource.h b/WebCore/css/CSSFontFaceSource.h
index 4ec54d6..e2057cc 100644
--- a/WebCore/css/CSSFontFaceSource.h
+++ b/WebCore/css/CSSFontFaceSource.h
@@ -65,6 +65,7 @@ public:
 #if ENABLE(SVG_FONTS)
     SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement; }
     void setSVGFontFaceElement(SVGFontFaceElement* element) { m_svgFontFaceElement = element; }
+    bool isSVGFontFaceSource() const;
 #endif
 
 private:
diff --git a/WebCore/css/CSSFontSelector.cpp b/WebCore/css/CSSFontSelector.cpp
index d97589d..4f00ae8 100644
--- a/WebCore/css/CSSFontSelector.cpp
+++ b/WebCore/css/CSSFontSelector.cpp
@@ -224,7 +224,7 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
             }
         }
     } else
-        traitsMask |= FontVariantNormalMask;
+        traitsMask |= FontVariantMask;
 
     // Each item in the src property's list is a single CSSFontFaceSource. Put them all into a CSSFontFace.
     RefPtr<CSSFontFace> fontFace;
@@ -317,13 +317,6 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
         if (familyName.isEmpty())
             continue;
 
-#if ENABLE(SVG_FONTS)
-        // SVG allows several <font> elements with the same font-family, differing only
-        // in ie. font-variant. Be sure to pick up the right one - in getFontData below.
-        if (foundSVGFont && (traitsMask & FontVariantSmallCapsMask))
-            familyName += "-webkit-svg-small-caps";
-#endif
-
         Vector<RefPtr<CSSFontFace> >* familyFontFaces = m_fontFaces.get(familyName);
         if (!familyFontFaces) {
             familyFontFaces = new Vector<RefPtr<CSSFontFace> >;
@@ -469,11 +462,6 @@ FontData* CSSFontSelector::getFontData(const FontDescription& fontDescription, c
 
     String family = familyName.string();
 
-#if ENABLE(SVG_FONTS)
-    if (fontDescription.smallCaps())
-        family += "-webkit-svg-small-caps";
-#endif
-
     Vector<RefPtr<CSSFontFace> >* familyFontFaces = m_fontFaces.get(family);
     // If no face was found, then return 0 and let the OS come up with its best match for the name.
     if (!familyFontFaces || familyFontFaces->isEmpty()) {
@@ -504,6 +492,12 @@ FontData* CSSFontSelector::getFontData(const FontDescription& fontDescription, c
                 continue;
             if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask))
                 continue;
+#if ENABLE(SVG_FONTS)
+            // For SVG Fonts that specify that they only support the "normal" variant, we will assume they are incapable
+            // of small-caps synthesis and just ignore the font face as a candidate.
+            if (candidate->hasSVGFontFaceSource() && (traitsMask & FontVariantSmallCapsMask) && !(candidateTraitsMask & FontVariantSmallCapsMask))
+                continue;
+#endif
             candidateFontFaces.append(candidate);
         }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list