Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef LineLayoutBlockFlow_h | |
| 6 #define LineLayoutBlockFlow_h | |
| 7 | |
| 8 #include "core/layout/FloatingObjects.h" | |
| 9 #include "core/layout/LayoutBlockFlow.h" | |
| 10 #include "core/layout/api/LineLayoutBox.h" | |
| 11 #include "platform/LayoutUnit.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 class LayoutBlockFlow; | |
| 16 class FloatingObject; | |
| 17 class LineInfo; | |
| 18 class LineWidth; | |
| 19 | |
| 20 class LineLayoutBlockFlow : public LineLayoutBox { | |
| 21 public: | |
| 22 LineLayoutBlockFlow(LayoutBlockFlow* blockFlow) | |
|
leviw_travelin_and_unemployed
2015/06/23 20:29:10
We should make all these constructors explicit.
| |
| 23 : LineLayoutBox(blockFlow) | |
| 24 { | |
| 25 } | |
| 26 | |
| 27 LineLayoutBlockFlow(const LineLayoutItem& item) | |
| 28 : LineLayoutBox(item) | |
| 29 { | |
| 30 ASSERT(!item.hasLayoutObject() || item.isLayoutBlockFlow()); | |
| 31 } | |
| 32 | |
| 33 LineLayoutBlockFlow() { } | |
| 34 | |
| 35 LineLayoutItem firstChild() const | |
| 36 { | |
| 37 return toBlockFlow()->firstChild(); | |
| 38 } | |
| 39 LineLayoutItem lastChild() const | |
| 40 { | |
| 41 return toBlockFlow()->lastChild(); | |
| 42 } | |
| 43 | |
| 44 LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentT ext) | |
| 45 { | |
| 46 return toBlockFlow()->startAlignedOffsetForLine(position, shouldIndentTe xt); | |
| 47 } | |
| 48 | |
| 49 LayoutUnit textIndentOffset() const | |
| 50 { | |
| 51 return toBlockFlow()->textIndentOffset(); | |
| 52 } | |
| 53 | |
| 54 LayoutUnit logicalWidthForChild(const LayoutBox& child) const | |
| 55 { | |
| 56 return toBlockFlow()->logicalWidthForChild(child); | |
| 57 } | |
| 58 | |
| 59 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const | |
| 60 { | |
| 61 return toBlockFlow()->marginStartForChild(child); | |
| 62 } | |
| 63 | |
| 64 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const | |
| 65 { | |
| 66 return toBlockFlow()->marginEndForChild(child); | |
| 67 } | |
| 68 | |
| 69 LayoutUnit marginBeforeForChild(const LayoutBoxModelObject& child) const | |
| 70 { | |
| 71 return toBlockFlow()->marginBeforeForChild(child); | |
| 72 } | |
| 73 | |
| 74 LayoutUnit startOffsetForContent() const | |
| 75 { | |
| 76 return toBlockFlow()->startOffsetForContent(); | |
| 77 } | |
| 78 | |
| 79 LayoutUnit lineHeight(bool firstLine, LineDirectionMode direction, LinePosit ionMode linePositionMode) const | |
| 80 { | |
| 81 return toBlockFlow()->lineHeight(firstLine, direction, linePositionMode) ; | |
| 82 } | |
| 83 | |
| 84 LayoutUnit minLineHeightForReplacedObject(bool isFirstLine, LayoutUnit repla cedHeight) const | |
| 85 { | |
| 86 return toBlockFlow()->minLineHeightForReplacedObject(isFirstLine, replac edHeight); | |
| 87 } | |
| 88 | |
| 89 void setStaticInlinePositionForChild(LayoutBox& box, LayoutUnit inlinePositi on) | |
| 90 { | |
| 91 toBlockFlow()->setStaticInlinePositionForChild(box, inlinePosition); | |
| 92 } | |
| 93 | |
| 94 void updateStaticInlinePositionForChild(LayoutBox& box, LayoutUnit logicalTo p) | |
| 95 { | |
| 96 toBlockFlow()->updateStaticInlinePositionForChild(box, logicalTop); | |
| 97 } | |
| 98 | |
| 99 FloatingObject* insertFloatingObject(LayoutBox& box) | |
| 100 { | |
| 101 return toBlockFlow()->insertFloatingObject(box); | |
| 102 } | |
| 103 | |
| 104 bool positionNewFloats(LineWidth* width) | |
| 105 { | |
| 106 return toBlockFlow()->positionNewFloats(width); | |
| 107 } | |
| 108 | |
| 109 bool positionNewFloatOnLine(FloatingObject& newFloat, FloatingObject* lastFl oatFromPreviousLine, LineInfo& lineInfo, LineWidth& lineWidth) | |
| 110 { | |
| 111 return toBlockFlow()->positionNewFloatOnLine(newFloat, lastFloatFromPrev iousLine, lineInfo, lineWidth); | |
| 112 } | |
| 113 | |
| 114 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit logicalHeight, ShapeOutsid eFloatOffsetMode offsetMode = ShapeOutsideFloatMarginBoxOffset) const | |
| 115 { | |
| 116 return toBlockFlow()->nextFloatLogicalBottomBelow(logicalHeight, offsetM ode); | |
| 117 } | |
| 118 | |
| 119 FloatingObject* lastFloatFromPreviousLine() const | |
| 120 { | |
| 121 return toBlockFlow()->lastFloatFromPreviousLine(); | |
| 122 } | |
| 123 | |
| 124 LayoutUnit logicalTopForFloat(const FloatingObject& floatingObject) const | |
| 125 { | |
| 126 return toBlockFlow()->logicalTopForFloat(floatingObject); | |
| 127 } | |
| 128 | |
| 129 LayoutUnit logicalBottomForFloat(const FloatingObject& floatingObject) const | |
| 130 { | |
| 131 return toBlockFlow()->logicalBottomForFloat(floatingObject); | |
| 132 } | |
| 133 | |
| 134 LayoutUnit logicalLeftForFloat(const FloatingObject& floatingObject) const | |
| 135 { | |
| 136 return toBlockFlow()->logicalLeftForFloat(floatingObject); | |
| 137 } | |
| 138 | |
| 139 LayoutUnit logicalRightForFloat(const FloatingObject& floatingObject) const | |
| 140 { | |
| 141 return toBlockFlow()->logicalRightForFloat(floatingObject); | |
| 142 } | |
| 143 | |
| 144 LayoutUnit logicalWidthForFloat(const FloatingObject& floatingObject) const | |
| 145 { | |
| 146 return toBlockFlow()->logicalWidthForFloat(floatingObject); | |
| 147 } | |
| 148 | |
| 149 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentT ext, LayoutUnit logicalHeight = 0) const | |
| 150 { | |
| 151 return toBlockFlow()->logicalRightOffsetForLine(position, shouldIndentTe xt, logicalHeight); | |
| 152 } | |
| 153 | |
| 154 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentTe xt, LayoutUnit logicalHeight = 0) const | |
| 155 { | |
| 156 return toBlockFlow()->logicalLeftOffsetForLine(position, shouldIndentTex t, logicalHeight); | |
| 157 } | |
| 158 | |
| 159 private: | |
| 160 LayoutBlockFlow* toBlockFlow() { return toLayoutBlockFlow(layoutObject()); } ; | |
| 161 const LayoutBlockFlow* toBlockFlow() const { return toLayoutBlockFlow(layout Object()); }; | |
| 162 }; | |
| 163 | |
| 164 } // namespace blink | |
| 165 | |
| 166 #endif // LineLayoutBlockFlow_h | |
| OLD | NEW |