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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 // Used to represent a text substring of an element, e.g., for text runs that ar
e split because of | 32 // Used to represent a text substring of an element, e.g., for text runs that ar
e split because of |
33 // first letter and that must therefore have different styles (and positions in
the render tree). | 33 // first letter and that must therefore have different styles (and positions in
the render tree). |
34 // We cache offsets so that text transformations can be applied in such a way th
at we can recover | 34 // We cache offsets so that text transformations can be applied in such a way th
at we can recover |
35 // the original unaltered string from our corresponding DOM node. | 35 // the original unaltered string from our corresponding DOM node. |
36 class RenderTextFragment final : public RenderText { | 36 class RenderTextFragment final : public RenderText { |
37 public: | 37 public: |
38 RenderTextFragment(Node*, StringImpl*, int startOffset, int length); | 38 RenderTextFragment(Node*, StringImpl*, int startOffset, int length); |
39 RenderTextFragment(Node*, StringImpl*); | 39 RenderTextFragment(Node*, StringImpl*); |
40 virtual ~RenderTextFragment(); | 40 virtual ~RenderTextFragment(); |
41 virtual void trace(Visitor*) override; | |
42 virtual void destroy() override; | 41 virtual void destroy() override; |
43 | 42 |
44 virtual bool isTextFragment() const override { return true; } | 43 virtual bool isTextFragment() const override { return true; } |
45 | 44 |
46 virtual bool canBeSelectionLeaf() const override { return node() && node()->
hasEditableStyle(); } | 45 virtual bool canBeSelectionLeaf() const override { return node() && node()->
hasEditableStyle(); } |
47 | 46 |
48 unsigned start() const { return m_start; } | 47 unsigned start() const { return m_start; } |
49 unsigned end() const { return m_end; } | 48 unsigned end() const { return m_end; } |
50 | 49 |
51 virtual unsigned textStartOffset() const override { return start(); } | 50 virtual unsigned textStartOffset() const override { return start(); } |
(...skipping 24 matching lines...) Expand all Loading... |
76 private: | 75 private: |
77 RenderBlock* blockForAccompanyingFirstLetter() const; | 76 RenderBlock* blockForAccompanyingFirstLetter() const; |
78 virtual UChar previousCharacter() const override; | 77 virtual UChar previousCharacter() const override; |
79 | 78 |
80 Text* associatedTextNode() const; | 79 Text* associatedTextNode() const; |
81 | 80 |
82 unsigned m_start; | 81 unsigned m_start; |
83 unsigned m_end; | 82 unsigned m_end; |
84 bool m_isRemainingTextRenderer; | 83 bool m_isRemainingTextRenderer; |
85 RefPtr<StringImpl> m_contentString; | 84 RefPtr<StringImpl> m_contentString; |
86 RawPtrWillBeMember<FirstLetterPseudoElement> m_firstLetterPseudoElement; | 85 // Reference back to FirstLetterPseudoElement; cleared by FirstLetterPseudoE
lement::detach() if |
| 86 // it goes away first. |
| 87 FirstLetterPseudoElement* m_firstLetterPseudoElement; |
87 }; | 88 }; |
88 | 89 |
89 DEFINE_TYPE_CASTS(RenderTextFragment, RenderObject, object, toRenderText(object)
->isTextFragment(), toRenderText(object).isTextFragment()); | 90 DEFINE_TYPE_CASTS(RenderTextFragment, RenderObject, object, toRenderText(object)
->isTextFragment(), toRenderText(object).isTextFragment()); |
90 | 91 |
91 } // namespace blink | 92 } // namespace blink |
92 | 93 |
93 #endif // RenderTextFragment_h | 94 #endif // RenderTextFragment_h |
OLD | NEW |