OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * Copyright (C) 2013 Adobe Systems Incorporated. | 5 * Copyright (C) 2013 Adobe Systems Incorporated. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 font.width(constructTextRun(font, &spaceCharacter, 1, style, style.direc
tion())) + wordSpacing | 605 font.width(constructTextRun(font, &spaceCharacter, 1, style, style.direc
tion())) + wordSpacing |
606 : 0; | 606 : 0; |
607 | 607 |
608 UChar lastCharacter = m_layoutTextInfo.m_lineBreakIterator.lastCharacter(); | 608 UChar lastCharacter = m_layoutTextInfo.m_lineBreakIterator.lastCharacter(); |
609 UChar secondToLastCharacter = m_layoutTextInfo.m_lineBreakIterator.secondToL
astCharacter(); | 609 UChar secondToLastCharacter = m_layoutTextInfo.m_lineBreakIterator.secondToL
astCharacter(); |
610 for (; m_current.offset() < layoutText.textLength(); m_current.fastIncrement
InTextNode()) { | 610 for (; m_current.offset() < layoutText.textLength(); m_current.fastIncrement
InTextNode()) { |
611 bool previousCharacterIsSpace = m_currentCharacterIsSpace; | 611 bool previousCharacterIsSpace = m_currentCharacterIsSpace; |
612 UChar c = m_current.current(); | 612 UChar c = m_current.current(); |
613 m_currentCharacterIsSpace = c == spaceCharacter || c == tabulationCharac
ter || (!m_preservesNewline && (c == newlineCharacter)); | 613 m_currentCharacterIsSpace = c == spaceCharacter || c == tabulationCharac
ter || (!m_preservesNewline && (c == newlineCharacter)); |
614 | 614 |
615 if (!m_collapseWhiteSpace || !m_currentCharacterIsSpace) | 615 if (!m_collapseWhiteSpace || !m_currentCharacterIsSpace) { |
616 m_lineInfo.setEmpty(false, m_block, &m_width); | 616 m_lineInfo.setEmpty(false, m_block, &m_width); |
| 617 m_width.setTrailingWhitespaceWidth(0); |
| 618 } |
617 | 619 |
618 if (c == softHyphenCharacter && m_autoWrap && !hyphenWidth) { | 620 if (c == softHyphenCharacter && m_autoWrap && !hyphenWidth) { |
619 hyphenWidth = layoutText.hyphenWidth(font, textDirectionFromUnicode(
m_resolver.position().direction())); | 621 hyphenWidth = layoutText.hyphenWidth(font, textDirectionFromUnicode(
m_resolver.position().direction())); |
620 m_width.addUncommittedWidth(hyphenWidth); | 622 m_width.addUncommittedWidth(hyphenWidth); |
621 } | 623 } |
622 | 624 |
623 bool applyWordSpacing = false; | 625 bool applyWordSpacing = false; |
624 | 626 |
625 // Determine if we should try breaking in the middle of a word. | 627 // Determine if we should try breaking in the middle of a word. |
626 if (breakWords && !midWordBreak && !U16_IS_TRAIL(c)) { | 628 if (breakWords && !midWordBreak && !U16_IS_TRAIL(c)) { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 | 981 |
980 if (style.getTextIndentType() == TextIndentHanging) | 982 if (style.getTextIndentType() == TextIndentHanging) |
981 indentText = indentText == IndentText ? DoNotIndentText : IndentText; | 983 indentText = indentText == IndentText ? DoNotIndentText : IndentText; |
982 | 984 |
983 return indentText; | 985 return indentText; |
984 } | 986 } |
985 | 987 |
986 } // namespace blink | 988 } // namespace blink |
987 | 989 |
988 #endif // BreakingContextInlineHeaders_h | 990 #endif // BreakingContextInlineHeaders_h |
OLD | NEW |