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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 LayoutUnit height = m_block.logicalHeight(); | 64 LayoutUnit height = m_block.logicalHeight(); |
65 if (height < m_block.logicalTopForFloat(newFloat) || height >= m_block.logic
alBottomForFloat(newFloat)) | 65 if (height < m_block.logicalTopForFloat(newFloat) || height >= m_block.logic
alBottomForFloat(newFloat)) |
66 return; | 66 return; |
67 | 67 |
68 ShapeOutsideDeltas shapeDeltas; | 68 ShapeOutsideDeltas shapeDeltas; |
69 if (ShapeOutsideInfo* shapeOutsideInfo = newFloat.layoutObject()->shapeOutsi
deInfo()) { | 69 if (ShapeOutsideInfo* shapeOutsideInfo = newFloat.layoutObject()->shapeOutsi
deInfo()) { |
70 LayoutUnit lineHeight = m_block.lineHeight(m_isFirstLine, m_block.isHori
zontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes
); | 70 LayoutUnit lineHeight = m_block.lineHeight(m_isFirstLine, m_block.isHori
zontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes
); |
71 shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine(m_bl
ock, newFloat, m_block.logicalHeight(), lineHeight); | 71 shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine(m_bl
ock, newFloat, m_block.logicalHeight(), lineHeight); |
72 } | 72 } |
73 | 73 |
74 if (newFloat.type() == FloatingObject::FloatLeft) { | 74 if (newFloat.getType() == FloatingObject::FloatLeft) { |
75 float newLeft = m_block.logicalRightForFloat(newFloat).toFloat(); | 75 float newLeft = m_block.logicalRightForFloat(newFloat).toFloat(); |
76 if (shapeDeltas.isValid()) { | 76 if (shapeDeltas.isValid()) { |
77 if (shapeDeltas.lineOverlapsShape()) | 77 if (shapeDeltas.lineOverlapsShape()) |
78 newLeft += shapeDeltas.rightMarginBoxDelta(); | 78 newLeft += shapeDeltas.rightMarginBoxDelta(); |
79 else // Per the CSS Shapes spec, If the line doesn't overlap the sha
pe, then ignore this shape for this line. | 79 else // Per the CSS Shapes spec, If the line doesn't overlap the sha
pe, then ignore this shape for this line. |
80 newLeft = m_left; | 80 newLeft = m_left; |
81 } | 81 } |
82 if (indentText() == IndentText && m_block.style()->isLeftToRightDirectio
n()) | 82 if (indentText() == IndentText && m_block.style()->isLeftToRightDirectio
n()) |
83 newLeft += floorToInt(m_block.textIndentOffset()); | 83 newLeft += floorToInt(m_block.textIndentOffset()); |
84 m_left = std::max<float>(m_left, newLeft); | 84 m_left = std::max<float>(m_left, newLeft); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 updateLineDimension(lastFloatLogicalBottom, LayoutUnit(newLineWidth), newLin
eLeft, newLineRight); | 190 updateLineDimension(lastFloatLogicalBottom, LayoutUnit(newLineWidth), newLin
eLeft, newLineRight); |
191 } | 191 } |
192 | 192 |
193 void LineWidth::computeAvailableWidthFromLeftAndRight() | 193 void LineWidth::computeAvailableWidthFromLeftAndRight() |
194 { | 194 { |
195 m_availableWidth = max(0.0f, m_right - m_left) + m_overhangWidth; | 195 m_availableWidth = max(0.0f, m_right - m_left) + m_overhangWidth; |
196 } | 196 } |
197 | 197 |
198 } // namespace blink | 198 } // namespace blink |
OLD | NEW |