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 21 matching lines...) Expand all Loading... |
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; | 41 virtual void trace(Visitor*) override; |
| 42 virtual void destroy() override; |
42 | 43 |
43 virtual bool isTextFragment() const override { return true; } | 44 virtual bool isTextFragment() const override { return true; } |
44 | 45 |
45 virtual bool canBeSelectionLeaf() const override { return node() && node()->
hasEditableStyle(); } | 46 virtual bool canBeSelectionLeaf() const override { return node() && node()->
hasEditableStyle(); } |
46 | 47 |
47 unsigned start() const { return m_start; } | 48 unsigned start() const { return m_start; } |
48 unsigned end() const { return m_end; } | 49 unsigned end() const { return m_end; } |
49 virtual unsigned textStartOffset() const override { return start(); } | 50 virtual unsigned textStartOffset() const override { return start(); } |
50 | 51 |
51 StringImpl* contentString() const { return m_contentString.get(); } | 52 StringImpl* contentString() const { return m_contentString.get(); } |
(...skipping 27 matching lines...) Expand all Loading... |
79 bool m_isRemainingTextRenderer; | 80 bool m_isRemainingTextRenderer; |
80 RefPtr<StringImpl> m_contentString; | 81 RefPtr<StringImpl> m_contentString; |
81 RawPtrWillBeMember<FirstLetterPseudoElement> m_firstLetterPseudoElement; | 82 RawPtrWillBeMember<FirstLetterPseudoElement> m_firstLetterPseudoElement; |
82 }; | 83 }; |
83 | 84 |
84 DEFINE_TYPE_CASTS(RenderTextFragment, RenderObject, object, toRenderText(object)
->isTextFragment(), toRenderText(object).isTextFragment()); | 85 DEFINE_TYPE_CASTS(RenderTextFragment, RenderObject, object, toRenderText(object)
->isTextFragment(), toRenderText(object).isTextFragment()); |
85 | 86 |
86 } // namespace blink | 87 } // namespace blink |
87 | 88 |
88 #endif // RenderTextFragment_h | 89 #endif // RenderTextFragment_h |
OLD | NEW |