OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 m_isFirstLine, | 73 m_isFirstLine, |
74 m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, | 74 m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, |
75 PositionOfInteriorLineBoxes); | 75 PositionOfInteriorLineBoxes); |
76 shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine( | 76 shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine( |
77 m_block, newFloat, m_block.logicalHeight(), lineHeight); | 77 m_block, newFloat, m_block.logicalHeight(), lineHeight); |
78 } | 78 } |
79 | 79 |
80 if (newFloat.getType() == FloatingObject::FloatLeft) { | 80 if (newFloat.getType() == FloatingObject::FloatLeft) { |
81 LayoutUnit newLeft = m_block.logicalRightForFloat(newFloat); | 81 LayoutUnit newLeft = m_block.logicalRightForFloat(newFloat); |
82 if (shapeDeltas.isValid()) { | 82 if (shapeDeltas.isValid()) { |
83 if (shapeDeltas.lineOverlapsShape()) | 83 if (shapeDeltas.lineOverlapsShape()) { |
84 newLeft += shapeDeltas.rightMarginBoxDelta(); | 84 newLeft += shapeDeltas.rightMarginBoxDelta(); |
85 else // Per the CSS Shapes spec, If the line doesn't overlap the shape, t
hen ignore this shape for this line. | 85 } else { |
| 86 // Per the CSS Shapes spec, If the line doesn't overlap the shape, then |
| 87 // ignore this shape for this line. |
86 newLeft = m_left; | 88 newLeft = m_left; |
| 89 } |
87 } | 90 } |
88 if (indentText() == IndentText && m_block.style()->isLeftToRightDirection()) | 91 if (indentText() == IndentText && m_block.style()->isLeftToRightDirection()) |
89 newLeft += floorToInt(m_block.textIndentOffset()); | 92 newLeft += floorToInt(m_block.textIndentOffset()); |
90 m_left = std::max(m_left, newLeft); | 93 m_left = std::max(m_left, newLeft); |
91 } else { | 94 } else { |
92 LayoutUnit newRight = m_block.logicalLeftForFloat(newFloat); | 95 LayoutUnit newRight = m_block.logicalLeftForFloat(newFloat); |
93 if (shapeDeltas.isValid()) { | 96 if (shapeDeltas.isValid()) { |
94 if (shapeDeltas.lineOverlapsShape()) | 97 if (shapeDeltas.lineOverlapsShape()) { |
95 newRight += shapeDeltas.leftMarginBoxDelta(); | 98 newRight += shapeDeltas.leftMarginBoxDelta(); |
96 else // Per the CSS Shapes spec, If the line doesn't overlap the shape, t
hen ignore this shape for this line. | 99 } else { |
| 100 // Per the CSS Shapes spec, If the line doesn't overlap the shape, then |
| 101 // ignore this shape for this line. |
97 newRight = m_right; | 102 newRight = m_right; |
| 103 } |
98 } | 104 } |
99 if (indentText() == IndentText && | 105 if (indentText() == IndentText && |
100 !m_block.style()->isLeftToRightDirection()) | 106 !m_block.style()->isLeftToRightDirection()) |
101 newRight -= floorToInt(m_block.textIndentOffset()); | 107 newRight -= floorToInt(m_block.textIndentOffset()); |
102 m_right = std::min(m_right, newRight); | 108 m_right = std::min(m_right, newRight); |
103 } | 109 } |
104 | 110 |
105 computeAvailableWidthFromLeftAndRight(); | 111 computeAvailableWidthFromLeftAndRight(); |
106 } | 112 } |
107 | 113 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 updateLineDimension(lastFloatLogicalBottom, LayoutUnit(newLineWidth), | 221 updateLineDimension(lastFloatLogicalBottom, LayoutUnit(newLineWidth), |
216 newLineLeft, newLineRight); | 222 newLineLeft, newLineRight); |
217 } | 223 } |
218 | 224 |
219 void LineWidth::computeAvailableWidthFromLeftAndRight() { | 225 void LineWidth::computeAvailableWidthFromLeftAndRight() { |
220 m_availableWidth = (m_right - m_left).clampNegativeToZero() + | 226 m_availableWidth = (m_right - m_left).clampNegativeToZero() + |
221 LayoutUnit::fromFloatCeil(m_overhangWidth); | 227 LayoutUnit::fromFloatCeil(m_overhangWidth); |
222 } | 228 } |
223 | 229 |
224 } // namespace blink | 230 } // namespace blink |
OLD | NEW |