| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
| 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 return m_maxWidth; | 850 return m_maxWidth; |
| 851 } | 851 } |
| 852 | 852 |
| 853 void LayoutText::computePreferredLogicalWidths(float leadWidth) | 853 void LayoutText::computePreferredLogicalWidths(float leadWidth) |
| 854 { | 854 { |
| 855 HashSet<const SimpleFontData*> fallbackFonts; | 855 HashSet<const SimpleFontData*> fallbackFonts; |
| 856 FloatRect glyphBounds; | 856 FloatRect glyphBounds; |
| 857 computePreferredLogicalWidths(leadWidth, fallbackFonts, glyphBounds); | 857 computePreferredLogicalWidths(leadWidth, fallbackFonts, glyphBounds); |
| 858 } | 858 } |
| 859 | 859 |
| 860 static inline float hyphenWidth(LayoutText* layoutObject, const Font& font, Text
Direction direction) | 860 float LayoutText::hyphenWidth(LayoutText* layoutText, const Font& font, TextDire
ction direction) |
| 861 { | 861 { |
| 862 const ComputedStyle& style = layoutObject->styleRef(); | 862 const ComputedStyle& style = layoutText->styleRef(); |
| 863 return font.width(constructTextRun(layoutObject, font, style.hyphenString().
string(), style, direction)); | 863 return font.width(constructTextRun(layoutText, font, style.hyphenString().st
ring(), style, direction)); |
| 864 } | 864 } |
| 865 | 865 |
| 866 void LayoutText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
mpleFontData*>& fallbackFonts, FloatRect& glyphBounds) | 866 void LayoutText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
mpleFontData*>& fallbackFonts, FloatRect& glyphBounds) |
| 867 { | 867 { |
| 868 ASSERT(m_hasTab || preferredLogicalWidthsDirty() || !m_knownToHaveNoOverflow
AndNoFallbackFonts); | 868 ASSERT(m_hasTab || preferredLogicalWidthsDirty() || !m_knownToHaveNoOverflow
AndNoFallbackFonts); |
| 869 | 869 |
| 870 m_minWidth = 0; | 870 m_minWidth = 0; |
| 871 m_maxWidth = 0; | 871 m_maxWidth = 0; |
| 872 m_firstLineMinWidth = 0; | 872 m_firstLineMinWidth = 0; |
| 873 m_lastLineLineMinWidth = 0; | 873 m_lastLineLineMinWidth = 0; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 cachedWordTrailingSpaceWidth[textDirection] = f.width(constr
uctTextRun(this, f, &spaceCharacter, 1, styleToUse, textDirection)) + wordSpacin
g; | 1012 cachedWordTrailingSpaceWidth[textDirection] = f.width(constr
uctTextRun(this, f, &spaceCharacter, 1, styleToUse, textDirection)) + wordSpacin
g; |
| 1013 wordTrailingSpaceWidth = cachedWordTrailingSpaceWidth[textDirect
ion]; | 1013 wordTrailingSpaceWidth = cachedWordTrailingSpaceWidth[textDirect
ion]; |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 float w; | 1016 float w; |
| 1017 if (wordTrailingSpaceWidth && isSpace) { | 1017 if (wordTrailingSpaceWidth && isSpace) { |
| 1018 w = widthFromFont(f, i, wordLen + 1, leadWidth, currMaxWidth, te
xtDirection, &fallbackFonts, &glyphBounds) - wordTrailingSpaceWidth; | 1018 w = widthFromFont(f, i, wordLen + 1, leadWidth, currMaxWidth, te
xtDirection, &fallbackFonts, &glyphBounds) - wordTrailingSpaceWidth; |
| 1019 } else { | 1019 } else { |
| 1020 w = widthFromFont(f, i, wordLen, leadWidth, currMaxWidth, textDi
rection, &fallbackFonts, &glyphBounds); | 1020 w = widthFromFont(f, i, wordLen, leadWidth, currMaxWidth, textDi
rection, &fallbackFonts, &glyphBounds); |
| 1021 if (c == softHyphenCharacter) | 1021 if (c == softHyphenCharacter) |
| 1022 currMinWidth += hyphenWidth(this, f, textDirection); | 1022 currMinWidth += LayoutText::hyphenWidth(this, f, textDirecti
on); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 currMinWidth += w; | 1025 currMinWidth += w; |
| 1026 if (betweenWords) { | 1026 if (betweenWords) { |
| 1027 if (lastWordBoundary == i) | 1027 if (lastWordBoundary == i) |
| 1028 currMaxWidth += w; | 1028 currMaxWidth += w; |
| 1029 else | 1029 else |
| 1030 currMaxWidth += widthFromFont(f, lastWordBoundary, j - lastW
ordBoundary, leadWidth, currMaxWidth, textDirection, &fallbackFonts, &glyphBound
s); | 1030 currMaxWidth += widthFromFont(f, lastWordBoundary, j - lastW
ordBoundary, leadWidth, currMaxWidth, textDirection, &fallbackFonts, &glyphBound
s); |
| 1031 lastWordBoundary = j; | 1031 lastWordBoundary = j; |
| 1032 } | 1032 } |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 void LayoutText::invalidateDisplayItemClients(const LayoutBoxModelObject& paintI
nvalidationContainer) const | 1864 void LayoutText::invalidateDisplayItemClients(const LayoutBoxModelObject& paintI
nvalidationContainer) const |
| 1865 { | 1865 { |
| 1866 LayoutObject::invalidateDisplayItemClients(paintInvalidationContainer); | 1866 LayoutObject::invalidateDisplayItemClients(paintInvalidationContainer); |
| 1867 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) | 1867 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) |
| 1868 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); | 1868 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 } // namespace blink | 1871 } // namespace blink |
| OLD | NEW |