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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 } else { | 624 } else { |
625 // Just keep ignoring these spaces. | 625 // Just keep ignoring these spaces. |
626 nextCharacter(c, lastCharacter, secondToLastCharacter); | 626 nextCharacter(c, lastCharacter, secondToLastCharacter); |
627 continue; | 627 continue; |
628 } | 628 } |
629 } | 629 } |
630 | 630 |
631 wordMeasurements.grow(wordMeasurements.size() + 1); | 631 wordMeasurements.grow(wordMeasurements.size() + 1); |
632 WordMeasurement& wordMeasurement = wordMeasurements.last(); | 632 WordMeasurement& wordMeasurement = wordMeasurements.last(); |
633 | 633 |
634 wordMeasurement.renderer = layoutText; | 634 wordMeasurement.layoutText = layoutText; |
635 wordMeasurement.endOffset = m_current.offset(); | 635 wordMeasurement.endOffset = m_current.offset(); |
636 wordMeasurement.startOffset = lastSpace; | 636 wordMeasurement.startOffset = lastSpace; |
637 | 637 |
638 float additionalTempWidth; | 638 float additionalTempWidth; |
639 if (wordTrailingSpaceWidth && c == ' ') | 639 if (wordTrailingSpaceWidth && c == ' ') |
640 additionalTempWidth = textWidth(layoutText, lastSpace, m_current
.offset() + 1 - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &
wordMeasurement.fallbackFonts) - wordTrailingSpaceWidth; | 640 additionalTempWidth = textWidth(layoutText, lastSpace, m_current
.offset() + 1 - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &
wordMeasurement.fallbackFonts) - wordTrailingSpaceWidth; |
641 else | 641 else |
642 additionalTempWidth = textWidth(layoutText, lastSpace, m_current
.offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &word
Measurement.fallbackFonts); | 642 additionalTempWidth = textWidth(layoutText, lastSpace, m_current
.offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &word
Measurement.fallbackFonts); |
643 | 643 |
644 wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeas
urement; | 644 wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeas
urement; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 m_trailingObjects.clear(); | 789 m_trailingObjects.clear(); |
790 | 790 |
791 m_atStart = false; | 791 m_atStart = false; |
792 nextCharacter(c, lastCharacter, secondToLastCharacter); | 792 nextCharacter(c, lastCharacter, secondToLastCharacter); |
793 } | 793 } |
794 | 794 |
795 m_renderTextInfo.m_lineBreakIterator.setPriorContext(lastCharacter, secondTo
LastCharacter); | 795 m_renderTextInfo.m_lineBreakIterator.setPriorContext(lastCharacter, secondTo
LastCharacter); |
796 | 796 |
797 wordMeasurements.grow(wordMeasurements.size() + 1); | 797 wordMeasurements.grow(wordMeasurements.size() + 1); |
798 WordMeasurement& wordMeasurement = wordMeasurements.last(); | 798 WordMeasurement& wordMeasurement = wordMeasurements.last(); |
799 wordMeasurement.renderer = layoutText; | 799 wordMeasurement.layoutText = layoutText; |
800 | 800 |
801 // IMPORTANT: current.m_pos is > length here! | 801 // IMPORTANT: current.m_pos is > length here! |
802 float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(layoutText, las
tSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapse
WhiteSpace, &wordMeasurement.fallbackFonts); | 802 float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(layoutText, las
tSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapse
WhiteSpace, &wordMeasurement.fallbackFonts); |
803 wordMeasurement.startOffset = lastSpace; | 803 wordMeasurement.startOffset = lastSpace; |
804 wordMeasurement.endOffset = m_current.offset(); | 804 wordMeasurement.endOffset = m_current.offset(); |
805 wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpa
cingForWordMeasurement; | 805 wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpa
cingForWordMeasurement; |
806 additionalTempWidth += lastSpaceWordSpacing; | 806 additionalTempWidth += lastSpaceWordSpacing; |
807 | 807 |
808 LayoutUnit inlineLogicalTempWidth = inlineLogicalWidth(m_current.object(), !
m_appliedStartWidth, m_includeEndWidth); | 808 LayoutUnit inlineLogicalTempWidth = inlineLogicalWidth(m_current.object(), !
m_appliedStartWidth, m_includeEndWidth); |
809 m_width.addUncommittedWidth(additionalTempWidth + inlineLogicalTempWidth); | 809 m_width.addUncommittedWidth(additionalTempWidth + inlineLogicalTempWidth); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 | 896 |
897 if (style.textIndentType() == TextIndentHanging) | 897 if (style.textIndentType() == TextIndentHanging) |
898 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; | 898 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; |
899 | 899 |
900 return shouldIndentText; | 900 return shouldIndentText; |
901 } | 901 } |
902 | 902 |
903 } | 903 } |
904 | 904 |
905 #endif // BreakingContextInlineHeaders_h | 905 #endif // BreakingContextInlineHeaders_h |
OLD | NEW |