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

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

Issue 1441443003: [Line Layout API] Convert LayoutBlockFlowLine to use new line layout API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: promote selectionState() to LineLayoutItem, simplify caller 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/LineLayoutItem.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 float width(unsigned from, unsigned len, LayoutUnit xPos, TextDirection text Direction, bool firstLine) const 120 float width(unsigned from, unsigned len, LayoutUnit xPos, TextDirection text Direction, bool firstLine) const
121 { 121 {
122 return toText()->width(from, len, xPos, textDirection, firstLine); 122 return toText()->width(from, len, xPos, textDirection, firstLine);
123 } 123 }
124 124
125 float hyphenWidth(const Font& font, TextDirection textDirection) 125 float hyphenWidth(const Font& font, TextDirection textDirection)
126 { 126 {
127 return toText()->hyphenWidth(font, textDirection); 127 return toText()->hyphenWidth(font, textDirection);
128 } 128 }
129 129
130 SelectionState selectionState() const
131 {
132 return toText()->selectionState();
133 }
134
135 void selectionStartEnd(int& spos, int& epos) const 130 void selectionStartEnd(int& spos, int& epos) const
136 { 131 {
137 return toText()->selectionStartEnd(spos, epos); 132 return toText()->selectionStartEnd(spos, epos);
138 } 133 }
139 134
140 unsigned textStartOffset() const 135 unsigned textStartOffset() const
141 { 136 {
142 return toText()->textStartOffset(); 137 return toText()->textStartOffset();
143 } 138 }
144 139
145 private: 140 private:
146 LayoutText* toText() { return toLayoutText(layoutObject()); } 141 LayoutText* toText() { return toLayoutText(layoutObject()); }
147 const LayoutText* toText() const { return toLayoutText(layoutObject()); } 142 const LayoutText* toText() const { return toLayoutText(layoutObject()); }
148 }; 143 };
149 144
150 } // namespace blink 145 } // namespace blink
151 146
152 #endif // LineLayoutText_h 147 #endif // LineLayoutText_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/LineLayoutItem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698