Changeset 63556 in webkit
- Timestamp:
- Jul 16, 2010 9:08:38 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63554 r63556 1 2010-07-16 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/8198266> white-space: pre text containing tabs is not laid out correctly when the font lacks a space glyph 6 https://bugs.webkit.org/show_bug.cgi?id=42437 7 8 No test because none of the fonts available to DumpRenderTree are missing a space glyph. 9 10 Changed the tab width computation to use the width of the space glyph from the font that has 11 a space glyph, which may be a fallback font if the primary font lacks a space glyph. 12 13 * platform/graphics/Font.h: Removed Font::tabWidth(). 14 * platform/graphics/WidthIterator.cpp: 15 (WebCore::WidthIterator::advance): 16 * platform/graphics/mac/ComplexTextController.cpp: 17 (WebCore::ComplexTextController::adjustGlyphsAndAdvances): 18 1 19 2010-07-16 Yury Semikhatsky <yurys@chromium.org> 2 20 -
trunk/WebCore/platform/graphics/Font.h
r61253 r63556 136 136 unsigned unitsPerEm() const { return primaryFont()->unitsPerEm(); } 137 137 int spaceWidth() const { return (int)ceilf(primaryFont()->adjustedSpaceWidth() + m_letterSpacing); } 138 int tabWidth() const { return 8 * spaceWidth(); }139 138 140 139 const SimpleFontData* primaryFont() const; -
trunk/WebCore/platform/graphics/WidthIterator.cpp
r63357 r63556 134 134 float width; 135 135 if (c == '\t' && m_run.allowTabs()) { 136 float tabWidth = m_font->tabWidth();136 float tabWidth = 8 * ceilf(fontData->adjustedSpaceWidth() + m_font->letterSpacing()); 137 137 width = tabWidth - fmodf(m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding, tabWidth); 138 138 } else { -
trunk/WebCore/platform/graphics/mac/ComplexTextController.cpp
r63357 r63556 475 475 476 476 if (ch == '\t' && m_run.allowTabs()) { 477 float tabWidth = m_font.tabWidth();477 float tabWidth = 8 * ceilf(fontData->adjustedSpaceWidth() + m_font.letterSpacing()); 478 478 advance.width = tabWidth - fmodf(m_run.xPos() + m_totalWidth + widthSinceLastRounding, tabWidth); 479 479 } else if (ch == zeroWidthSpace || Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
Note: See TracChangeset
for help on using the changeset viewer.