[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:16:53 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 35f01f0c34cc919951d7149947e2ecf0b0690922
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jul 16 16:08:38 2010 +0000
<rdar://problem/8198266> white-space: pre text containing tabs is not laid out correctly when the font lacks a space glyph
https://bugs.webkit.org/show_bug.cgi?id=42437
Reviewed by Anders Carlsson.
No test because none of the fonts available to DumpRenderTree are missing a space glyph.
Changed the tab width computation to use the width of the space glyph from the font that has
a space glyph, which may be a fallback font if the primary font lacks a space glyph.
* platform/graphics/Font.h: Removed 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@63556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d1652ae..986cedc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-07-16 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ <rdar://problem/8198266> white-space: pre text containing tabs is not laid out correctly when the font lacks a space glyph
+ https://bugs.webkit.org/show_bug.cgi?id=42437
+
+ No test because none of the fonts available to DumpRenderTree are missing a space glyph.
+
+ Changed the tab width computation to use the width of the space glyph from the font that has
+ a space glyph, which may be a fallback font if the primary font lacks a space glyph.
+
+ * platform/graphics/Font.h: Removed Font::tabWidth().
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+
2010-07-16 Yury Semikhatsky <yurys at chromium.org>
Unreviewed. Chromium build fix. Add missing include.
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index ecfde98..ebf30df 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -135,7 +135,6 @@ public:
float xHeight() const { return primaryFont()->xHeight(); }
unsigned unitsPerEm() const { return primaryFont()->unitsPerEm(); }
int spaceWidth() const { return (int)ceilf(primaryFont()->adjustedSpaceWidth() + m_letterSpacing); }
- int tabWidth() const { return 8 * spaceWidth(); }
const SimpleFontData* primaryFont() const;
const FontData* fontDataAt(unsigned) const;
diff --git a/WebCore/platform/graphics/WidthIterator.cpp b/WebCore/platform/graphics/WidthIterator.cpp
index 28a6311..741f923 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 = m_font->tabWidth();
+ float tabWidth = 8 * ceilf(fontData->adjustedSpaceWidth() + m_font->letterSpacing());
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 d882ba8..ea67471 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 = m_font.tabWidth();
+ float tabWidth = 8 * ceilf(fontData->adjustedSpaceWidth() + m_font.letterSpacing());
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