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 25 matching lines...) Expand all Loading... |
36 // styles (and positions in the layout tree). | 36 // styles (and positions in the layout tree). |
37 // We cache offsets so that text transformations can be applied in such a way | 37 // We cache offsets so that text transformations can be applied in such a way |
38 // that we can recover the original unaltered string from our corresponding DOM | 38 // that we can recover the original unaltered string from our corresponding DOM |
39 // node. | 39 // node. |
40 class LayoutTextFragment final : public LayoutText { | 40 class LayoutTextFragment final : public LayoutText { |
41 public: | 41 public: |
42 LayoutTextFragment(Node*, StringImpl*, int startOffset, int length); | 42 LayoutTextFragment(Node*, StringImpl*, int startOffset, int length); |
43 LayoutTextFragment(Node*, StringImpl*); | 43 LayoutTextFragment(Node*, StringImpl*); |
44 ~LayoutTextFragment() override; | 44 ~LayoutTextFragment() override; |
45 | 45 |
| 46 static LayoutTextFragment* createAnonymous(PseudoElement&, StringImpl*); |
| 47 static LayoutTextFragment* createAnonymous(PseudoElement&, |
| 48 StringImpl*, |
| 49 unsigned start, |
| 50 unsigned length); |
| 51 |
46 bool isTextFragment() const override { return true; } | 52 bool isTextFragment() const override { return true; } |
47 | 53 |
48 bool canBeSelectionLeaf() const override { | 54 bool canBeSelectionLeaf() const override { |
49 return node() && hasEditableStyle(*node()); | 55 return node() && hasEditableStyle(*node()); |
50 } | 56 } |
51 | 57 |
52 unsigned start() const { return m_start; } | 58 unsigned start() const { return m_start; } |
53 unsigned fragmentLength() const { return m_fragmentLength; } | 59 unsigned fragmentLength() const { return m_fragmentLength; } |
54 | 60 |
55 unsigned textStartOffset() const override { return start(); } | 61 unsigned textStartOffset() const override { return start(); } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 113 |
108 DEFINE_TYPE_CASTS(LayoutTextFragment, | 114 DEFINE_TYPE_CASTS(LayoutTextFragment, |
109 LayoutObject, | 115 LayoutObject, |
110 object, | 116 object, |
111 toLayoutText(object)->isTextFragment(), | 117 toLayoutText(object)->isTextFragment(), |
112 toLayoutText(object).isTextFragment()); | 118 toLayoutText(object).isTextFragment()); |
113 | 119 |
114 } // namespace blink | 120 } // namespace blink |
115 | 121 |
116 #endif // LayoutTextFragment_h | 122 #endif // LayoutTextFragment_h |
OLD | NEW |