| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * Copyright (C) 2013 Google Inc. All rights reserved. | 7 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
| 10 * modification, are permitted provided that the following conditions are | 10 * modification, are permitted provided that the following conditions are |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual void layoutBlock(bool relayoutChildren) override; | 58 virtual void layoutBlock(bool relayoutChildren) override; |
| 59 | 59 |
| 60 virtual void deleteLineBoxTree() override final; | 60 virtual void deleteLineBoxTree() override final; |
| 61 | 61 |
| 62 LayoutUnit availableLogicalWidthForLine(bool shouldIndentText) const | 62 LayoutUnit availableLogicalWidthForLine(bool shouldIndentText) const |
| 63 { | 63 { |
| 64 return max<LayoutUnit>(0, logicalRightOffsetForLine(shouldIndentText) -
logicalLeftOffsetForLine(shouldIndentText)); | 64 return max<LayoutUnit>(0, logicalRightOffsetForLine(shouldIndentText) -
logicalLeftOffsetForLine(shouldIndentText)); |
| 65 } | 65 } |
| 66 LayoutUnit logicalRightOffsetForLine(bool shouldIndentText) const | 66 LayoutUnit logicalRightOffsetForLine(bool shouldIndentText) const |
| 67 { | 67 { |
| 68 return logicalRightOffsetForLine(logicalRightOffsetForContent(), shouldI
ndentText); | 68 LayoutUnit right = logicalRightOffsetForContent(); |
| 69 if (shouldIndentText && !style()->isLeftToRightDirection()) |
| 70 right -= textIndentOffset(); |
| 71 return right; |
| 69 } | 72 } |
| 70 LayoutUnit logicalLeftOffsetForLine(bool shouldIndentText) const | 73 LayoutUnit logicalLeftOffsetForLine(bool shouldIndentText) const |
| 71 { | 74 { |
| 72 return logicalLeftOffsetForLine(logicalLeftOffsetForContent(), shouldInd
entText); | 75 LayoutUnit left = logicalLeftOffsetForContent(); |
| 76 if (shouldIndentText && style()->isLeftToRightDirection()) |
| 77 left += textIndentOffset(); |
| 78 return left; |
| 73 } | 79 } |
| 74 LayoutUnit startOffsetForLine(bool shouldIndentText) const | 80 LayoutUnit startOffsetForLine(bool shouldIndentText) const |
| 75 { | 81 { |
| 76 return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(shou
ldIndentText) | 82 return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(shou
ldIndentText) |
| 77 : logicalWidth() - logicalRightOffsetForLine(shouldIndentText); | 83 : logicalWidth() - logicalRightOffsetForLine(shouldIndentText); |
| 78 } | 84 } |
| 79 LayoutUnit endOffsetForLine(bool shouldIndentText) const | 85 LayoutUnit endOffsetForLine(bool shouldIndentText) const |
| 80 { | 86 { |
| 81 return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(sho
uldIndentText) | 87 return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(sho
uldIndentText) |
| 82 : logicalWidth() - logicalRightOffsetForLine(shouldIndentText); | 88 : logicalWidth() - logicalRightOffsetForLine(shouldIndentText); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*); | 124 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*); |
| 119 | 125 |
| 120 protected: | 126 protected: |
| 121 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); | 127 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); |
| 122 | 128 |
| 123 virtual bool updateLogicalWidthAndColumnWidth() override; | 129 virtual bool updateLogicalWidthAndColumnWidth() override; |
| 124 | 130 |
| 125 void determineLogicalLeftPositionForChild(RenderBox* child); | 131 void determineLogicalLeftPositionForChild(RenderBox* child); |
| 126 | 132 |
| 127 private: | 133 private: |
| 128 LayoutUnit logicalRightOffsetForLine(LayoutUnit fixedOffset, bool applyTextI
ndent) const | |
| 129 { | |
| 130 LayoutUnit right = fixedOffset; | |
| 131 if (applyTextIndent && !style()->isLeftToRightDirection()) | |
| 132 right -= textIndentOffset(); | |
| 133 return right; | |
| 134 } | |
| 135 LayoutUnit logicalLeftOffsetForLine(LayoutUnit fixedOffset, bool applyTextIn
dent) const | |
| 136 { | |
| 137 LayoutUnit left = fixedOffset; | |
| 138 if (applyTextIndent && style()->isLeftToRightDirection()) | |
| 139 left += textIndentOffset(); | |
| 140 return left; | |
| 141 } | |
| 142 | |
| 143 void layoutBlockFlow(bool relayoutChildren, SubtreeLayoutScope&); | 134 void layoutBlockFlow(bool relayoutChildren, SubtreeLayoutScope&); |
| 144 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); | 135 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); |
| 145 | 136 |
| 146 void layoutBlockChild(RenderBox* child); | 137 void layoutBlockChild(RenderBox* child); |
| 147 void adjustPositionedBlock(RenderBox* child); | 138 void adjustPositionedBlock(RenderBox* child); |
| 148 | 139 |
| 149 virtual void invalidatePaintForOverflow() override final; | 140 virtual void invalidatePaintForOverflow() override final; |
| 150 | 141 |
| 151 RootInlineBox* createRootInlineBox(); | 142 RootInlineBox* createRootInlineBox(); |
| 152 | 143 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 198 |
| 208 // END METHODS DEFINED IN RenderBlockLineLayout | 199 // END METHODS DEFINED IN RenderBlockLineLayout |
| 209 | 200 |
| 210 }; | 201 }; |
| 211 | 202 |
| 212 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); | 203 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); |
| 213 | 204 |
| 214 } // namespace blink | 205 } // namespace blink |
| 215 | 206 |
| 216 #endif // RenderBlockFlow_h | 207 #endif // RenderBlockFlow_h |
| OLD | NEW |