Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextFragment.h

Issue 2754653002: Cleanup anonymous text objects that pass the document as a node. (Closed)
Patch Set: Cleanup anonymous text objects that pass the document as a node. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698