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

mitz at apple.com mitz at apple.com
Wed Dec 22 11:17:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 46ff698a503ba5aafd164c31780a4fbf40ad9f43
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 19:23:58 2010 +0000

    Refinement of r63556: moved the tab width computation back to Font, but added a
    SimpleFontData parameter.
    
    Reviewed by Anders Carlsson.
    
    * platform/graphics/Font.h:
    (WebCore::Font::tabWidth):
    * platform/graphics/WidthIterator.cpp:
    (WebCore::WidthIterator::advance):
    * platform/graphics/mac/ComplexTextController.cpp:
    (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63570 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b14411d..65001fb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-07-16  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Refinement of r63556: moved the tab width computation back to Font, but added a
+        SimpleFontData parameter.
+
+        * platform/graphics/Font.h:
+        (WebCore::Font::tabWidth):
+        * platform/graphics/WidthIterator.cpp:
+        (WebCore::WidthIterator::advance):
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+
 2010-07-16  Tony Gentilcore  <tonyg at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index ebf30df..c7cd3ac 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -135,6 +135,7 @@ public:
     float xHeight() const { return primaryFont()->xHeight(); }
     unsigned unitsPerEm() const { return primaryFont()->unitsPerEm(); }
     int spaceWidth() const { return (int)ceilf(primaryFont()->adjustedSpaceWidth() + m_letterSpacing); }
+    float tabWidth(const SimpleFontData& fontData) const { return 8 * ceilf(fontData.adjustedSpaceWidth() + letterSpacing()); }
 
     const SimpleFontData* primaryFont() const;
     const FontData* fontDataAt(unsigned) const;
diff --git a/WebCore/platform/graphics/WidthIterator.cpp b/WebCore/platform/graphics/WidthIterator.cpp
index 741f923..ef047e8 100644
--- a/WebCore/platform/graphics/WidthIterator.cpp
+++ b/WebCore/platform/graphics/WidthIterator.cpp
@@ -133,7 +133,7 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
         // Now that we have a glyph and font data, get its width.
         float width;
         if (c == '\t' && m_run.allowTabs()) {
-            float tabWidth = 8 * ceilf(fontData->adjustedSpaceWidth() + m_font->letterSpacing());
+            float tabWidth = m_font->tabWidth(*fontData);
             width = tabWidth - fmodf(m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding, tabWidth);
         } else {
             width = fontData->widthForGlyph(glyph);
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.cpp b/WebCore/platform/graphics/mac/ComplexTextController.cpp
index ea67471..da381f2 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -474,7 +474,7 @@ void ComplexTextController::adjustGlyphsAndAdvances()
             CGSize advance = treatAsSpace ? CGSizeMake(fontData->spaceWidth(), advances[i].height) : advances[i];
 
             if (ch == '\t' && m_run.allowTabs()) {
-                float tabWidth = 8 * ceilf(fontData->adjustedSpaceWidth() + m_font.letterSpacing());
+                float tabWidth = m_font.tabWidth(*fontData);
                 advance.width = tabWidth - fmodf(m_run.xPos() + m_totalWidth + widthSinceLastRounding, tabWidth);
             } else if (ch == zeroWidthSpace || Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
                 advance.width = 0;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list