[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

mitz at apple.com mitz at apple.com
Sun Feb 20 23:07:41 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 78de1d02e1a6a35a0ed04f0d31b12592397acb48
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 17 23:14:18 2011 +0000

    Use of invalid hash map key in CSSFontFaceSource::getFontData() with 0-sized remote font
    https://bugs.webkit.org/show_bug.cgi?id=52598
    
    Reviewed by Darin Adler.
    
    Source/WebCore:
    
    Test: fast/css/font-face-zero-hash-key.html
    
    * css/CSSFontFaceSource.cpp:
    (WebCore::CSSFontFaceSource::getFontData): Add 1 to the font size to avoid a 0 hash key.
    * css/CSSSegmentedFontFace.cpp:
    (WebCore::CSSSegmentedFontFace::getFontData): Ditto.
    
    LayoutTests:
    
    * fast/css/font-face-zero-hash-key-expected.txt: Added.
    * fast/css/font-face-zero-hash-key.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75975 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4ae3315..7ac1e2e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-17  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Use of invalid hash map key in CSSFontFaceSource::getFontData() with 0-sized remote font
+        https://bugs.webkit.org/show_bug.cgi?id=52598
+
+        * fast/css/font-face-zero-hash-key-expected.txt: Added.
+        * fast/css/font-face-zero-hash-key.html: Added.
+
 2011-01-17  Helder Correia  <helder at sencha.com>
 
         Reviewed by Andreas Kling.
diff --git a/LayoutTests/fast/css/font-face-zero-hash-key-expected.txt b/LayoutTests/fast/css/font-face-zero-hash-key-expected.txt
new file mode 100644
index 0000000..2272834
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-zero-hash-key-expected.txt
@@ -0,0 +1,3 @@
+Test for an assertion failure when specifying a 0 size for a remote font.
+
+Invisible text.
diff --git a/LayoutTests/fast/css/font-face-zero-hash-key.html b/LayoutTests/fast/css/font-face-zero-hash-key.html
new file mode 100644
index 0000000..5a16a5c
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-zero-hash-key.html
@@ -0,0 +1,16 @@
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<style>
+    @font-face {
+        font-family: test;
+        src: url(resources/Ahem.ttf);
+    }
+</style>
+<p>
+    Test for an assertion failure when specifying a 0 size for a remote font.
+</p>
+<p style="font-family: test; font-size: 0;">
+    Invisible text.
+</p>
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index b0249df..01f2381 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-17  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Use of invalid hash map key in CSSFontFaceSource::getFontData() with 0-sized remote font
+        https://bugs.webkit.org/show_bug.cgi?id=52598
+
+        Test: fast/css/font-face-zero-hash-key.html
+
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::getFontData): Add 1 to the font size to avoid a 0 hash key.
+        * css/CSSSegmentedFontFace.cpp:
+        (WebCore::CSSSegmentedFontFace::getFontData): Ditto.
+
 2011-01-17  David Kilzer  <ddkilzer at apple.com>
 
         <http://webkit.org/b/52596> Add missing DOMDocument/DOMDocumentFragment headers to Xcode project
diff --git a/Source/WebCore/css/CSSFontFaceSource.cpp b/Source/WebCore/css/CSSFontFaceSource.cpp
index 12d2e1e..034b22e 100644
--- a/Source/WebCore/css/CSSFontFaceSource.cpp
+++ b/Source/WebCore/css/CSSFontFaceSource.cpp
@@ -115,7 +115,7 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
     }
 
     // See if we have a mapping in our FontData cache.
-    unsigned hashKey = fontDescription.computedPixelSize() << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
+    unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
     if (SimpleFontData* cachedData = m_fontDataTable.get(hashKey))
         return cachedData;
 
diff --git a/Source/WebCore/css/CSSSegmentedFontFace.cpp b/Source/WebCore/css/CSSSegmentedFontFace.cpp
index cdabec1..1f6e20d 100644
--- a/Source/WebCore/css/CSSSegmentedFontFace.cpp
+++ b/Source/WebCore/css/CSSSegmentedFontFace.cpp
@@ -88,7 +88,7 @@ FontData* CSSSegmentedFontFace::getFontData(const FontDescription& fontDescripti
         return 0;
 
     FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
-    unsigned hashKey = (fontDescription.computedPixelSize() << (FontTraitsMaskWidth + 1)) | ((fontDescription.orientation() == Vertical ? 1 : 0) << FontTraitsMaskWidth) | desiredTraitsMask;
+    unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + 1)) | ((fontDescription.orientation() == Vertical ? 1 : 0) << FontTraitsMaskWidth) | desiredTraitsMask;
 
     SegmentedFontData* fontData = m_fontDataTable.get(hashKey);
     if (fontData)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list