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, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "core/layout/api/SelectionState.h" | 28 #include "core/layout/api/SelectionState.h" |
29 #include "core/layout/line/InlineBox.h" | 29 #include "core/layout/line/InlineBox.h" |
30 #include "platform/text/TextRun.h" | 30 #include "platform/text/TextRun.h" |
31 #include "wtf/Forward.h" | 31 #include "wtf/Forward.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class DocumentMarker; | 35 class DocumentMarker; |
36 class GraphicsContext; | 36 class GraphicsContext; |
37 | 37 |
| 38 // The two truncation values below are used as tokens representing truncation |
| 39 // state for the text box, are intended to be relative to |m_start|, and are set |
| 40 // directly into |m_truncation|. In the case where there is some truncation of |
| 41 // the text but it is not full, |m_truncation| is set to the character offset |
| 42 // from |m_start| representing the characters that are not truncated. |
| 43 // |
| 44 // Thus the maximum possible length of the text displayed before an ellipsis in |
| 45 // a single InlineTextBox is |USHRT_MAX - 2| to allow for the no-truncation and |
| 46 // full-truncation states. |
38 const unsigned short cNoTruncation = USHRT_MAX; | 47 const unsigned short cNoTruncation = USHRT_MAX; |
39 const unsigned short cFullTruncation = USHRT_MAX - 1; | 48 const unsigned short cFullTruncation = USHRT_MAX - 1; |
40 | 49 |
41 class CORE_EXPORT InlineTextBox : public InlineBox { | 50 class CORE_EXPORT InlineTextBox : public InlineBox { |
42 public: | 51 public: |
43 InlineTextBox(LineLayoutItem item, int start, unsigned short length) | 52 InlineTextBox(LineLayoutItem item, int start, unsigned short length) |
44 : InlineBox(item) | 53 : InlineBox(item) |
45 , m_prevTextBox(nullptr) | 54 , m_prevTextBox(nullptr) |
46 , m_nextTextBox(nullptr) | 55 , m_nextTextBox(nullptr) |
47 , m_start(start) | 56 , m_start(start) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 return (canHaveLeadingExpansion() ? TextRun::AllowLeadingExpansion : Tex
tRun::ForbidLeadingExpansion) | 190 return (canHaveLeadingExpansion() ? TextRun::AllowLeadingExpansion : Tex
tRun::ForbidLeadingExpansion) |
182 | (expansion() && nextLeafChild() ? TextRun::AllowTrailingExpansion
: TextRun::ForbidTrailingExpansion); | 191 | (expansion() && nextLeafChild() ? TextRun::AllowTrailingExpansion
: TextRun::ForbidTrailingExpansion); |
183 } | 192 } |
184 }; | 193 }; |
185 | 194 |
186 DEFINE_INLINE_BOX_TYPE_CASTS(InlineTextBox); | 195 DEFINE_INLINE_BOX_TYPE_CASTS(InlineTextBox); |
187 | 196 |
188 } // namespace blink | 197 } // namespace blink |
189 | 198 |
190 #endif // InlineTextBox_h | 199 #endif // InlineTextBox_h |
OLD | NEW |