[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

robert at webkit.org robert at webkit.org
Wed Dec 22 18:00:29 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 05e85676e41209bdd608c4939efb201e28a9d50f
Author: robert at webkit.org <robert at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Dec 5 15:10:18 2010 +0000

    2010-12-05  Robert Hogan  <robert at webkit.org>
    
            Reviewed by Andreas Kling.
    
            [Qt] Zero-sized font does not yet work
    
            Fix fast/text/font-size-zero.html
    
            https://bugs.webkit.org/show_bug.cgi?id=49759
    
            * platform/qt/Skipped:
    2010-12-05  Robert Hogan  <robert at webkit.org>
    
            Reviewed by Andreas Kling.
    
            [Qt] Zero-sized font does not yet work
    
            Fix fast/text/font-size-zero.html
    
            Copy other ports by setting minimumFontSize to 0 for DRT runs,
            copy a fix to SimpleFontData from chromium/safari, and set font
            size in FontPlatformData to zero if size zero is requested
            and QFont::pixelSize otherwise. (Note that QFont doesn't accept
            a pixel size of zero).
    
            Also fix QFont::setPixelSize in FontPlatformData to use
            description.computedPixelSize rather than computedSize and
            pixelSize() rather than pointSizeF - since the latter gets
            set to -1 if pixelSize is set at all.
    
            https://bugs.webkit.org/show_bug.cgi?id=49759
    
            * platform/graphics/qt/FontPlatformData.h:
            (WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
            (WebCore::FontPlatformData::pixelSize):
            * platform/graphics/qt/FontPlatformDataQt.cpp:
            (WebCore::FontPlatformData::FontPlatformData):
            * platform/graphics/qt/FontQt.cpp:
            (WebCore::drawTextCommon):
            * platform/graphics/qt/SimpleFontDataQt.cpp:
            (WebCore::SimpleFontData::platformInit):
            (WebCore::SimpleFontData::platformGlyphInit):
            (WebCore::SimpleFontData::platformCharWidthInit):
    2010-12-05  Robert Hogan  <robert at webkit.org>
    
            Reviewed by Andreas Kling.
    
            [Qt] Zero-sized font does not yet work
    
            Fix fast/text/font-size-zero.html
    
            Copy other ports by setting minimumFontSize to 0 for DRT runs.
    
            https://bugs.webkit.org/show_bug.cgi?id=49759
    
            * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
            (WebCore::WebPage::WebPage):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73341 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 187347b..8452ddd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-05  Robert Hogan  <robert at webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Zero-sized font does not yet work
+
+        Fix fast/text/font-size-zero.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=49759
+
+        * platform/qt/Skipped:
+
 2010-12-04  Daniel Bates  <dbates at rim.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=49641
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index c627d25..c4b50ef 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5342,10 +5342,6 @@ editing/pasteboard/paste-4039777-fix.html
 # https://bugs.webkit.org/show_bug.cgi?id=49749
 plugins/refcount-leaks.html
 
-# [Qt] Zero-sized font does not yet work
-# https://bugs.webkit.org/show_bug.cgi?id=49759
-fast/text/font-size-zero.html
-
 # [Qt] REGRESSION (r72351): fast/profiler/throw-exception-from-eval.html fails
 # https://bugs.webkit.org/show_bug.cgi?id=49801
 fast/profiler/throw-exception-from-eval.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b405787..9601161 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,36 @@
+2010-12-05  Robert Hogan  <robert at webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Zero-sized font does not yet work
+
+        Fix fast/text/font-size-zero.html
+
+        Copy other ports by setting minimumFontSize to 0 for DRT runs,
+        copy a fix to SimpleFontData from chromium/safari, and set font
+        size in FontPlatformData to zero if size zero is requested
+        and QFont::pixelSize otherwise. (Note that QFont doesn't accept
+        a pixel size of zero).
+
+        Also fix QFont::setPixelSize in FontPlatformData to use
+        description.computedPixelSize rather than computedSize and
+        pixelSize() rather than pointSizeF - since the latter gets
+        set to -1 if pixelSize is set at all.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49759
+
+        * platform/graphics/qt/FontPlatformData.h:
+        (WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
+        (WebCore::FontPlatformData::pixelSize):
+        * platform/graphics/qt/FontPlatformDataQt.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::drawTextCommon):
+        * platform/graphics/qt/SimpleFontDataQt.cpp:
+        (WebCore::SimpleFontData::platformInit):
+        (WebCore::SimpleFontData::platformGlyphInit):
+        (WebCore::SimpleFontData::platformCharWidthInit):
+
 2010-12-04  Daniel Bates  <dbates at rim.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/qt/FontPlatformData.h b/WebCore/platform/graphics/qt/FontPlatformData.h
index 2201f18..1c57e29 100644
--- a/WebCore/platform/graphics/qt/FontPlatformData.h
+++ b/WebCore/platform/graphics/qt/FontPlatformData.h
@@ -36,7 +36,7 @@ class FontPlatformDataPrivate : public Noncopyable {
 public:
     FontPlatformDataPrivate()
         : refCount(1)
-        , size(font.pointSizeF())
+        , size(font.pixelSize())
         , bold(font.bold())
         , oblique(false)
     {}
@@ -49,7 +49,7 @@ public:
     FontPlatformDataPrivate(const QFont& font)
         : refCount(1)
         , font(font)
-        , size(font.pointSizeF())
+        , size(font.pixelSize())
         , bold(font.bold())
         , oblique(false)
     {}
@@ -150,8 +150,12 @@ public:
     int pixelSize() const
     {
         Q_ASSERT(m_data != reinterpret_cast<FontPlatformDataPrivate*>(-1));
-        if (m_data)
+        if (m_data) {
+            // WebKit allows font size zero but QFont does not.
+            if (!m_data->size)
+                return m_data->size;
             return m_data->font.pixelSize();
+        }
         return 0;
     }
     
diff --git a/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp b/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
index 35e9e0c..4c9eb32 100644
--- a/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+++ b/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
@@ -50,8 +50,9 @@ FontPlatformData::FontPlatformData(const FontDescription& description, const Ato
     : m_data(new FontPlatformDataPrivate())
 {
     QFont& font = m_data->font;
+    int requestedSize = qRound(description.computedPixelSize());
     font.setFamily(familyName);
-    font.setPixelSize(qRound(description.computedSize()));
+    font.setPixelSize(qRound(requestedSize));
     font.setItalic(description.italic());
     font.setWeight(toQFontWeight(description.weight()));
     font.setWordSpacing(wordSpacing);
@@ -63,7 +64,10 @@ FontPlatformData::FontPlatformData(const FontDescription& description, const Ato
 #endif
 
     m_data->bold = font.bold();
-    m_data->size = font.pointSizeF();
+    // WebKit allows font size zero but QFont does not. We will return
+    // m_data->size if a font size of zero is requested and pixelSize()
+    // otherwise.
+    m_data->size = (!requestedSize) ? requestedSize : font.pixelSize();
 }
 
 FontPlatformData::~FontPlatformData()
diff --git a/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp b/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
index f093d7d..47ddf02 100644
--- a/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
+++ b/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
@@ -40,6 +40,18 @@ bool SimpleFontData::containsCharacters(const UChar*, int) const
 
 void SimpleFontData::platformInit()
 {
+    if (!m_platformData.size()) {
+         m_ascent = 0;
+         m_descent = 0;
+         m_lineGap = 0;
+         m_lineSpacing = 0;
+         m_avgCharWidth = 0;
+         m_maxCharWidth = 0;
+         m_xHeight = 0;
+         m_unitsPerEm = 0;
+         return;
+    }
+
     QFontMetrics fm(m_platformData.font());
 
     m_ascent = fm.ascent();
@@ -52,6 +64,8 @@ void SimpleFontData::platformInit()
 
 void SimpleFontData::platformGlyphInit()
 {
+    if (!m_platformData.size())
+        return;
     m_spaceGlyph = 0;
     m_adjustedSpaceWidth = m_spaceWidth;
     determinePitch();
@@ -61,6 +75,8 @@ void SimpleFontData::platformGlyphInit()
 
 void SimpleFontData::platformCharWidthInit()
 {
+    if (!m_platformData.size())
+        return;
     QFontMetrics fm(m_platformData.font());
     m_avgCharWidth = fm.averageCharWidth();
     m_maxCharWidth = fm.maxWidth();
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 68ec285..191ecd8 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2010-12-05  Robert Hogan  <robert at webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Zero-sized font does not yet work
+
+        Fix fast/text/font-size-zero.html
+
+        Copy other ports by setting minimumFontSize to 0 for DRT runs.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49759
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::WebPage::WebPage):
+
 2010-12-04  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Jon Honeycutt.
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 10a6af0..23546f0 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -138,7 +138,7 @@ WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
 {
     QWebSettings* globalSettings = QWebSettings::globalSettings();
 
-    globalSettings->setFontSize(QWebSettings::MinimumFontSize, 5);
+    globalSettings->setFontSize(QWebSettings::MinimumFontSize, 0);
     globalSettings->setFontSize(QWebSettings::MinimumLogicalFontSize, 5);
     globalSettings->setFontSize(QWebSettings::DefaultFontSize, 16);
     globalSettings->setFontSize(QWebSettings::DefaultFixedFontSize, 13);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list