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*); | |
| 23 LineLayoutBlockFlow(const LineLayoutItem&); | |
| 24 LineLayoutBlockFlow() { } | |
| 25 | |
| 26 LineLayoutItem firstChild() const | |
| 27 { | |
| 28 return toBlockFlow()->firstChild(); | |
| 29 } | |
| 30 LineLayoutItem lastChild() const | |
| 31 { | |
| 32 return toBlockFlow()->lastChild(); | |
| 33 } | |
| 34 | |
| 35 LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentT ext) | |
| 36 { | |
| 37 return toBlockFlow()->startAlignedOffsetForLine(position, shouldIndentTe xt); | |
| 38 } | |
| 39 | |
| 40 LayoutUnit textIndentOffset() const | |
| 41 { | |
| 42 return toBlockFlow()->textIndentOffset(); | |
| 43 } | |
| 44 | |
| 45 LayoutUnit logicalWidthForChild(const LayoutBox& child) const | |
| 46 { | |
| 47 return toBlockFlow()->logicalWidthForChild(child); | |
| 48 } | |
| 49 | |
| 50 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const | |
| 51 { | |
| 52 return toBlockFlow()->marginStartForChild(child); | |
| 53 } | |
| 54 | |
| 55 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const | |
| 56 { | |
| 57 return toBlockFlow()->marginEndForChild(child); | |
| 58 } | |
| 59 | |
| 60 LayoutUnit marginBeforeForChild(const LayoutBoxModelObject& child) const | |
| 61 { | |
| 62 return toBlockFlow()->marginBeforeForChild(child); | |
| 63 } | |
| 64 | |
| 65 LayoutUnit startOffsetForContent() const | |
| 66 { | |
| 67 return toBlockFlow()->startOffsetForContent(); | |
| 68 } | |
| 69 | |
| 70 LayoutUnit lineHeight(bool firstLine, LineDirectionMode direction, LinePosit ionMode linePositionMode) const | |
| 71 { | |
| 72 return toBlockFlow()->lineHeight(firstLine, direction, linePositionMode) ; | |
| 73 } | |
| 74 | |
| 75 LayoutUnit minLineHeightForReplacedObject(bool isFirstLine, LayoutUnit repla cedHeight) const | |
| 76 { | |
| 77 return toBlockFlow()->minLineHeightForReplacedObject(isFirstLine, replac edHeight); | |
| 78 } | |
| 79 | |
| 80 void setStaticInlinePositionForChild(LayoutBox& box, LayoutUnit inlinePositi on) | |
| 81 { | |
| 82 toBlockFlow()->setStaticInlinePositionForChild(box, inlinePosition); | |
| 83 } | |
| 84 | |
| 85 void updateStaticInlinePositionForChild(LayoutBox& box, LayoutUnit logicalTo p) | |
| 86 { | |
| 87 toBlockFlow()->updateStaticInlinePositionForChild(box, logicalTop); | |
| 88 } | |
| 89 | |
| 90 FloatingObject* insertFloatingObject(LayoutBox& box) | |
| 91 { | |
| 92 return toBlockFlow()->insertFloatingObject(box); | |
| 93 } | |
| 94 | |
| 95 bool positionNewFloats(LineWidth* width) | |
| 96 { | |
| 97 return toBlockFlow()->positionNewFloats(width); | |
| 98 } | |
| 99 | |
| 100 bool positionNewFloatOnLine(FloatingObject& newFloat, FloatingObject* lastFl oatFromPreviousLine, LineInfo& lineInfo, LineWidth& lineWidth) | |
| 101 { | |
| 102 return toBlockFlow()->positionNewFloatOnLine(newFloat, lastFloatFromPrev iousLine, lineInfo, lineWidth); | |
| 103 } | |
| 104 | |
| 105 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit logicalHeight, ShapeOutsid eFloatOffsetMode offsetMode = ShapeOutsideFloatMarginBoxOffset) const | |
| 106 { | |
| 107 return toBlockFlow()->nextFloatLogicalBottomBelow(logicalHeight, offsetM ode); | |
| 108 } | |
| 109 | |
| 110 FloatingObject* lastFloatFromPreviousLine() const | |
| 111 { | |
| 112 return toBlockFlow()->containsFloats() ? toBlockFlow()->m_floatingObject s->set().last().get() : 0; | |
|
esprehn
2015/06/17 20:16:27
Add a method to layoutBlockFlow for this.
| |
| 113 } | |
| 114 | |
| 115 LayoutUnit logicalTopForFloat(const FloatingObject& floatingObject) const | |
| 116 { | |
| 117 return toBlockFlow()->logicalTopForFloat(floatingObject); | |
| 118 } | |
| 119 | |
| 120 LayoutUnit logicalBottomForFloat(const FloatingObject& floatingObject) const | |
| 121 { | |
| 122 return toBlockFlow()->logicalBottomForFloat(floatingObject); | |
| 123 } | |
| 124 | |
| 125 LayoutUnit logicalLeftForFloat(const FloatingObject& floatingObject) const | |
| 126 { | |
| 127 return toBlockFlow()->logicalLeftForFloat(floatingObject); | |
| 128 } | |
| 129 | |
| 130 LayoutUnit logicalRightForFloat(const FloatingObject& floatingObject) const | |
| 131 { | |
| 132 return toBlockFlow()->logicalRightForFloat(floatingObject); | |
| 133 } | |
| 134 | |
| 135 LayoutUnit logicalWidthForFloat(const FloatingObject& floatingObject) const | |
| 136 { | |
| 137 return toBlockFlow()->logicalWidthForFloat(floatingObject); | |
| 138 } | |
| 139 | |
| 140 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentT ext, LayoutUnit logicalHeight = 0) const | |
| 141 { | |
| 142 return toBlockFlow()->logicalRightOffsetForLine(position, shouldIndentTe xt, logicalHeight); | |
| 143 } | |
| 144 | |
| 145 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentTe xt, LayoutUnit logicalHeight = 0) const | |
| 146 { | |
| 147 return toBlockFlow()->logicalLeftOffsetForLine(position, shouldIndentTex t, logicalHeight); | |
| 148 } | |
| 149 | |
| 150 private: | |
| 151 LayoutBlockFlow* toBlockFlow() { return toLayoutBlockFlow(layoutObject()); } ; | |
| 152 const LayoutBlockFlow* toBlockFlow() const { return toLayoutBlockFlow(layout Object()); }; | |
| 153 }; | |
| 154 | |
| 155 } // namespace blink | |
| 156 | |
| 157 #endif // LineLayoutBlockFlow_h | |
| OLD | NEW |