Changeset 129233 in webkit
- Timestamp:
- Sep 21, 2012, 9:21:08 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r129230 r129233 1 2012-09-21 Dan Bernstein <mitz@apple.com> 2 3 REGRESSION (r126763): Incorrect line breaking when both kerning and word spacing are enabled 4 https://bugs.webkit.org/show_bug.cgi?id=97280 5 6 Reviewed by Adele Peterson. 7 8 * fast/text/word-space-with-kerning-2-expected.html: Added. 9 * fast/text/word-space-with-kerning-2.html: Added. 10 1 11 2012-09-21 Sudarsana Nagineni <sudarsana.nagineni@intel.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r129227 r129233 1 2012-09-21 Dan Bernstein <mitz@apple.com> 2 3 REGRESSION (r126763): Incorrect line breaking when both kerning and word spacing are enabled 4 https://bugs.webkit.org/show_bug.cgi?id=97280 5 6 Reviewed by Adele Peterson. 7 8 Font::width() never applies word spacing to the first character in the TextRun. The 9 TextLayout optimization tried to achieve this behavior by not applying word spacing to 10 any character, which led to this bug. 11 12 Test: fast/text/word-space-with-kerning-2.html 13 14 * platform/graphics/mac/ComplexTextController.cpp: 15 (WebCore::TextLayout::TextLayout): Changed to use the given font rather than a version 16 without word spacing. 17 (WebCore::TextLayout::width): Added a check if the run starts with a space at a non-zero 18 offset. If that is the case, then the ComplexTextController has added word spacing to that 19 space, so subtract it here in order to maintain the behavior described above. 20 1 21 2012-09-21 Sheriff Bot <webkit.review.bot@gmail.com> 2 22 -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
r129176 r129233 49 49 50 50 TextLayout(RenderText* text, const Font& font, float xPos) 51 : m_font(font WithNoWordSpacing(font))51 : m_font(font) 52 52 , m_run(constructTextRun(text, font, xPos)) 53 53 , m_controller(adoptPtr(new ComplexTextController(&m_font, m_run, true))) … … 59 59 m_controller->advance(from, 0, ByWholeGlyphs); 60 60 float beforeWidth = m_controller->runWidthSoFar(); 61 if (m_font.wordSpacing() && from && Font::treatAsSpace(m_run[from])) 62 beforeWidth += m_font.wordSpacing(); 61 63 m_controller->advance(from + len, 0, ByWholeGlyphs); 62 64 float afterWidth = m_controller->runWidthSoFar(); … … 65 67 66 68 private: 67 static Font fontWithNoWordSpacing(const Font& originalFont)68 {69 Font font(originalFont);70 font.setWordSpacing(0);71 return font;72 }73 74 69 static TextRun constructTextRun(RenderText* text, const Font& font, float xPos) 75 70 {
Note:
See TracChangeset
for help on using the changeset viewer.