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

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

Issue 1433253003: [Line Layout API] Convert AbstractInlineTextBox to new line layout API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add constructors so we can assign nullptr to LineLayoutItem descendants Created 5 years, 1 month 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef LineLayoutText_h 5 #ifndef LineLayoutText_h
6 #define LineLayoutText_h 6 #define LineLayoutText_h
7 7
8 #include "core/layout/LayoutText.h" 8 #include "core/layout/LayoutText.h"
9 #include "core/layout/api/LineLayoutItem.h" 9 #include "core/layout/api/LineLayoutItem.h"
10 #include "platform/LayoutUnit.h" 10 #include "platform/LayoutUnit.h"
11 #include "platform/text/TextPath.h" 11 #include "platform/text/TextPath.h"
12 #include "wtf/Forward.h" 12 #include "wtf/Forward.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class LayoutText; 16 class LayoutText;
17 17
18 class LineLayoutText : public LineLayoutItem { 18 class LineLayoutText : public LineLayoutItem {
19 public: 19 public:
20 explicit LineLayoutText(LayoutText* layoutObject) : LineLayoutItem(layoutObj ect) { } 20 explicit LineLayoutText(LayoutText* layoutObject) : LineLayoutItem(layoutObj ect) { }
21 21
22 explicit LineLayoutText(const LineLayoutItem& item) 22 explicit LineLayoutText(const LineLayoutItem& item)
23 : LineLayoutItem(item) 23 : LineLayoutItem(item)
24 { 24 {
25 ASSERT(!item || item.isText()); 25 ASSERT(!item || item.isText());
26 } 26 }
27 27
28 LineLayoutText(std::nullptr_t) : LineLayoutItem(nullptr) { }
29
28 LineLayoutText() { } 30 LineLayoutText() { }
29 31
30 InlineTextBox* firstTextBox() const 32 InlineTextBox* firstTextBox() const
31 { 33 {
32 return toText()->firstTextBox(); 34 return toText()->firstTextBox();
33 } 35 }
34 36
35 void extractTextBox(InlineTextBox* inlineTextBox) 37 void extractTextBox(InlineTextBox* inlineTextBox)
36 { 38 {
37 toText()->extractTextBox(inlineTextBox); 39 toText()->extractTextBox(inlineTextBox);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 140 }
139 141
140 private: 142 private:
141 LayoutText* toText() { return toLayoutText(layoutObject()); } 143 LayoutText* toText() { return toLayoutText(layoutObject()); }
142 const LayoutText* toText() const { return toLayoutText(layoutObject()); } 144 const LayoutText* toText() const { return toLayoutText(layoutObject()); }
143 }; 145 };
144 146
145 } // namespace blink 147 } // namespace blink
146 148
147 #endif // LineLayoutText_h 149 #endif // LineLayoutText_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698