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

Side by Side Diff: Source/core/layout/api/LineLayoutBoxModel.h

Issue 1294483002: [Line Layout API] Convert InlineBox::boxModelObject to new API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/layout/api/LineLayoutItem.h » ('j') | 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 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"
(...skipping 15 matching lines...) Expand all
26 ASSERT(!item || item.isBoxModelObject()); 26 ASSERT(!item || item.isBoxModelObject());
27 } 27 }
28 28
29 LineLayoutBoxModel() { } 29 LineLayoutBoxModel() { }
30 30
31 DeprecatedPaintLayer* layer() const 31 DeprecatedPaintLayer* layer() const
32 { 32 {
33 return toBoxModel()->layer(); 33 return toBoxModel()->layer();
34 } 34 }
35 35
36 LayoutUnit lineHeight(bool firstLine, LineDirectionMode lineDirectionMode, L inePositionMode linePositionMode) const 36 LayoutUnit lineHeight(bool firstLine, LineDirectionMode lineDirectionMode, L inePositionMode linePositionMode = PositionOnContainingLine) const
37 { 37 {
38 return toBoxModel()->lineHeight(firstLine, lineDirectionMode, linePositi onMode); 38 return toBoxModel()->lineHeight(firstLine, lineDirectionMode, linePositi onMode);
39 } 39 }
40 40
41 int baselinePosition(FontBaseline fontBaseline, bool firstLine, LineDirectio nMode lineDirectionMode, LinePositionMode linePositionMode) const 41 int baselinePosition(FontBaseline fontBaseline, bool firstLine, LineDirectio nMode lineDirectionMode, LinePositionMode linePositionMode = PositionOnContainin gLine) const
42 { 42 {
43 return toBoxModel()->baselinePosition(fontBaseline, firstLine, lineDirec tionMode, linePositionMode); 43 return toBoxModel()->baselinePosition(fontBaseline, firstLine, lineDirec tionMode, linePositionMode);
44 } 44 }
45 45
46 bool hasSelfPaintingLayer() const
47 {
48 return toBoxModel()->hasSelfPaintingLayer();
49 }
50
51 LayoutUnit marginTop() const
52 {
53 return toBoxModel()->marginTop();
54 }
55
56 LayoutUnit marginBottom() const
57 {
58 return toBoxModel()->marginBottom();
59 }
60
61 LayoutUnit marginLeft() const
62 {
63 return toBoxModel()->marginLeft();
64 }
65
66 LayoutUnit marginRight() const
67 {
68 return toBoxModel()->marginRight();
69 }
70
71 LayoutUnit marginBefore(const ComputedStyle* otherStyle = nullptr) const
72 {
73 return toBoxModel()->marginBefore(otherStyle);
74 }
75
76 LayoutUnit marginAfter(const ComputedStyle* otherStyle = nullptr) const
77 {
78 return toBoxModel()->marginAfter(otherStyle);
79 }
80
81 LayoutUnit paddingTop() const
82 {
83 return toBoxModel()->paddingTop();
84 }
85
86 LayoutUnit paddingBottom() const
87 {
88 return toBoxModel()->paddingBottom();
89 }
90
91 LayoutUnit paddingLeft() const
92 {
93 return toBoxModel()->paddingLeft();
94 }
95
96 LayoutUnit paddingRight() const
97 {
98 return toBoxModel()->paddingRight();
99 }
100
101 LayoutUnit paddingBefore() const
102 {
103 return toBoxModel()->paddingBefore();
104 }
105
106 LayoutUnit paddingAfter() const
107 {
108 return toBoxModel()->paddingAfter();
109 }
110
111 int borderBefore() const
112 {
113 return toBoxModel()->borderBefore();
114 }
115
116 int borderAfter() const
117 {
118 return toBoxModel()->borderAfter();
119 }
120
121 LayoutSize relativePositionLogicalOffset() const
122 {
123 return toBoxModel()->relativePositionLogicalOffset();
124 }
125
126 bool hasInlineDirectionBordersOrPadding() const
127 {
128 return toBoxModel()->hasInlineDirectionBordersOrPadding();
129 }
130
131 LayoutUnit borderAndPaddingLogicalHeight() const
132 {
133 return toBoxModel()->borderAndPaddingLogicalHeight();
134 }
135
46 private: 136 private:
47 LayoutBoxModelObject* toBoxModel() { return toLayoutBoxModelObject(layoutObj ect()); } 137 LayoutBoxModelObject* toBoxModel() { return toLayoutBoxModelObject(layoutObj ect()); }
48 const LayoutBoxModelObject* toBoxModel() const { return toLayoutBoxModelObje ct(layoutObject()); } 138 const LayoutBoxModelObject* toBoxModel() const { return toLayoutBoxModelObje ct(layoutObject()); }
49 }; 139 };
50 140
51 } // namespace blink 141 } // namespace blink
52 142
53 #endif // LineLayoutBoxModel_h 143 #endif // LineLayoutBoxModel_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/layout/api/LineLayoutItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698