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

Side by Side Diff: third_party/WebKit/Source/core/layout/api/LineLayoutBoxModel.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 LineLayoutBoxModel_h 5 #ifndef LineLayoutBoxModel_h
6 #define LineLayoutBoxModel_h 6 #define LineLayoutBoxModel_h
7 7
8 #include "core/layout/LayoutBoxModelObject.h" 8 #include "core/layout/LayoutBoxModelObject.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 11
12 namespace blink { 12 namespace blink {
13 13
14 class LayoutBoxModelObject; 14 class LayoutBoxModelObject;
15 15
16 class LineLayoutBoxModel : public LineLayoutItem { 16 class LineLayoutBoxModel : public LineLayoutItem {
17 public: 17 public:
18 explicit LineLayoutBoxModel(LayoutBoxModelObject* layoutBox) 18 explicit LineLayoutBoxModel(LayoutBoxModelObject* layoutBox)
19 : LineLayoutItem(layoutBox) 19 : LineLayoutItem(layoutBox)
20 { 20 {
21 } 21 }
22 22
23 explicit LineLayoutBoxModel(const LineLayoutItem& item) 23 explicit LineLayoutBoxModel(const LineLayoutItem& item)
24 : LineLayoutItem(item) 24 : LineLayoutItem(item)
25 { 25 {
26 ASSERT(!item || item.isBoxModelObject()); 26 ASSERT(!item || item.isBoxModelObject());
27 } 27 }
28 28
29 LineLayoutBoxModel(std::nullptr_t) : LineLayoutItem(nullptr) { }
30
29 LineLayoutBoxModel() { } 31 LineLayoutBoxModel() { }
30 32
31 PaintLayer* layer() const 33 PaintLayer* layer() const
32 { 34 {
33 return toBoxModel()->layer(); 35 return toBoxModel()->layer();
34 } 36 }
35 37
36 LayoutUnit lineHeight(bool firstLine, LineDirectionMode lineDirectionMode, L inePositionMode linePositionMode = PositionOnContainingLine) const 38 LayoutUnit lineHeight(bool firstLine, LineDirectionMode lineDirectionMode, L inePositionMode linePositionMode = PositionOnContainingLine) const
37 { 39 {
38 return toBoxModel()->lineHeight(firstLine, lineDirectionMode, linePositi onMode); 40 return toBoxModel()->lineHeight(firstLine, lineDirectionMode, linePositi onMode);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 }; 191 };
190 192
191 inline LineLayoutBoxModel LineLayoutItem::enclosingBoxModelObject() const 193 inline LineLayoutBoxModel LineLayoutItem::enclosingBoxModelObject() const
192 { 194 {
193 return LineLayoutBoxModel(layoutObject()->enclosingBoxModelObject()); 195 return LineLayoutBoxModel(layoutObject()->enclosingBoxModelObject());
194 } 196 }
195 197
196 } // namespace blink 198 } // namespace blink
197 199
198 #endif // LineLayoutBoxModel_h 200 #endif // LineLayoutBoxModel_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698