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 * | 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 26 matching lines...) Expand all Loading... | |
37 public: | 37 public: |
38 LayoutTextFragment(Node*, StringImpl*, int startOffset, int length); | 38 LayoutTextFragment(Node*, StringImpl*, int startOffset, int length); |
39 LayoutTextFragment(Node*, StringImpl*); | 39 LayoutTextFragment(Node*, StringImpl*); |
40 ~LayoutTextFragment() override; | 40 ~LayoutTextFragment() override; |
41 | 41 |
42 bool isTextFragment() const override { return true; } | 42 bool isTextFragment() const override { return true; } |
43 | 43 |
44 bool canBeSelectionLeaf() const override { return node() && node()->hasEdita bleStyle(); } | 44 bool canBeSelectionLeaf() const override { return node() && node()->hasEdita bleStyle(); } |
45 | 45 |
46 unsigned start() const { return m_start; } | 46 unsigned start() const { return m_start; } |
47 unsigned end() const { return m_end; } | |
48 | 47 |
49 unsigned textStartOffset() const override { return start(); } | 48 unsigned textStartOffset() const override { return start(); } |
50 | 49 |
51 void setContentString(StringImpl*); | 50 void setContentString(StringImpl*); |
52 StringImpl* contentString() const { return m_contentString.get(); } | 51 StringImpl* contentString() const { return m_contentString.get(); } |
53 // The complete text is all of the text in the associated DOM text node. | 52 // The complete text is all of the text in the associated DOM text node. |
54 PassRefPtr<StringImpl> completeText() const; | 53 PassRefPtr<StringImpl> completeText() const; |
55 // The fragment text is the text which will be used by this LayoutTextFragme nt. For | 54 // The fragment text is the text which will be used by this LayoutTextFragme nt. For |
56 // things like first-letter this may differ from the completeText as we mayb e using | 55 // things like first-letter this may differ from the completeText as we mayb e using |
57 // only a portion of the text nodes content. | 56 // only a portion of the text nodes content. |
(...skipping 16 matching lines...) Expand all Loading... | |
74 | 73 |
75 protected: | 74 protected: |
76 void willBeDestroyed() override; | 75 void willBeDestroyed() override; |
77 | 76 |
78 private: | 77 private: |
79 LayoutBlock* blockForAccompanyingFirstLetter() const; | 78 LayoutBlock* blockForAccompanyingFirstLetter() const; |
80 UChar previousCharacter() const override; | 79 UChar previousCharacter() const override; |
81 | 80 |
82 Text* associatedTextNode() const; | 81 Text* associatedTextNode() const; |
83 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; | 82 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; |
83 unsigned fragmentLength() const { return m_fragmentLength; } | |
yosin_UTC9
2015/10/27 01:06:52
Oops, I'm a first user of using |fragmentLength()|
| |
84 | 84 |
85 unsigned m_start; | 85 unsigned m_start; |
86 unsigned m_end; | 86 unsigned m_fragmentLength; |
87 bool m_isRemainingTextLayoutObject; | 87 bool m_isRemainingTextLayoutObject; |
88 RefPtr<StringImpl> m_contentString; | 88 RefPtr<StringImpl> m_contentString; |
89 // Reference back to FirstLetterPseudoElement; cleared by FirstLetterPseudoE lement::detach() if | 89 // Reference back to FirstLetterPseudoElement; cleared by FirstLetterPseudoE lement::detach() if |
90 // it goes away first. | 90 // it goes away first. |
91 GC_PLUGIN_IGNORE("http://crbug.com/509911") | 91 GC_PLUGIN_IGNORE("http://crbug.com/509911") |
92 FirstLetterPseudoElement* m_firstLetterPseudoElement; | 92 FirstLetterPseudoElement* m_firstLetterPseudoElement; |
93 }; | 93 }; |
94 | 94 |
95 DEFINE_TYPE_CASTS(LayoutTextFragment, LayoutObject, object, toLayoutText(object) ->isTextFragment(), toLayoutText(object).isTextFragment()); | 95 DEFINE_TYPE_CASTS(LayoutTextFragment, LayoutObject, object, toLayoutText(object) ->isTextFragment(), toLayoutText(object).isTextFragment()); |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
98 | 98 |
99 #endif // LayoutTextFragment_h | 99 #endif // LayoutTextFragment_h |
OLD | NEW |