OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 return true; | 50 return true; |
51 case ShapeValue::Outside: | 51 case ShapeValue::Outside: |
52 return false; | 52 return false; |
53 } | 53 } |
54 | 54 |
55 return false; | 55 return false; |
56 } | 56 } |
57 | 57 |
58 void ShapeOutsideInfo::updateDeltasForContainingBlockLine(const RenderBlockFlow*
containingBlock, const FloatingObject* floatingObject, LayoutUnit lineTop, Layo
utUnit lineHeight) | 58 void ShapeOutsideInfo::updateDeltasForContainingBlockLine(const RenderBlockFlow*
containingBlock, const FloatingObject* floatingObject, LayoutUnit lineTop, Layo
utUnit lineHeight) |
59 { | 59 { |
60 LayoutUnit shapeTop = containingBlock->logicalTopForFloat(floatingObject) +
std::max(LayoutUnit(), containingBlock->marginBeforeForChild(m_renderer)); | 60 LayoutUnit borderBoxTop = containingBlock->logicalTopForFloat(floatingObject
) + std::max(LayoutUnit(), containingBlock->marginBeforeForChild(m_renderer)); |
61 LayoutUnit floatRelativeLineTop = lineTop - shapeTop; | 61 LayoutUnit borderBoxLineTop = lineTop - borderBoxTop; |
62 | 62 |
63 if (shapeSizeDirty() || m_lineTop != floatRelativeLineTop || m_lineHeight !=
lineHeight) { | 63 if (isShapeDirty() || m_borderBoxLineTop != borderBoxLineTop || m_lineHeight
!= lineHeight) { |
64 m_lineTop = floatRelativeLineTop; | 64 m_borderBoxLineTop = borderBoxLineTop; |
65 m_shapeLineTop = floatRelativeLineTop - logicalTopOffset(); | 65 m_referenceBoxLineTop = borderBoxLineTop - logicalTopOffset(); |
66 m_lineHeight = lineHeight; | 66 m_lineHeight = lineHeight; |
67 | 67 |
68 LayoutUnit floatMarginBoxWidth = containingBlock->logicalWidthForFloat(f
loatingObject); | 68 LayoutUnit floatMarginBoxWidth = containingBlock->logicalWidthForFloat(f
loatingObject); |
69 | 69 |
70 if (lineOverlapsShapeBounds()) { | 70 if (lineOverlapsShapeBounds()) { |
71 SegmentList segments = computeSegmentsForLine(floatRelativeLineTop,
lineHeight); | 71 SegmentList segments = computeSegmentsForLine(borderBoxLineTop, line
Height); |
72 if (segments.size()) { | 72 if (segments.size()) { |
73 LayoutUnit rawLeftMarginBoxDelta = segments.first().logicalLeft
+ containingBlock->marginStartForChild(m_renderer); | 73 LayoutUnit rawLeftMarginBoxDelta = segments.first().logicalLeft
+ containingBlock->marginStartForChild(m_renderer); |
74 m_leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMarginBoxDelta
, LayoutUnit(), floatMarginBoxWidth); | 74 m_leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMarginBoxDelta
, LayoutUnit(), floatMarginBoxWidth); |
75 | 75 |
76 LayoutUnit rawRightMarginBoxDelta = segments.last().logicalRight
- containingBlock->logicalWidthForChild(m_renderer) - containingBlock->marginEn
dForChild(m_renderer); | 76 LayoutUnit rawRightMarginBoxDelta = segments.last().logicalRight
- containingBlock->logicalWidthForChild(m_renderer) - containingBlock->marginEn
dForChild(m_renderer); |
77 m_rightMarginBoxDelta = clampTo<LayoutUnit>(rawRightMarginBoxDel
ta, -floatMarginBoxWidth, LayoutUnit()); | 77 m_rightMarginBoxDelta = clampTo<LayoutUnit>(rawRightMarginBoxDel
ta, -floatMarginBoxWidth, LayoutUnit()); |
78 m_lineOverlapsShape = true; | 78 m_lineOverlapsShape = true; |
79 return; | 79 return; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 // Lines that do not overlap the shape should act as if the float | 83 // Lines that do not overlap the shape should act as if the float |
84 // wasn't there for layout purposes. So we set the deltas to remove the | 84 // wasn't there for layout purposes. So we set the deltas to remove the |
85 // entire width of the float. | 85 // entire width of the float. |
86 m_leftMarginBoxDelta = floatMarginBoxWidth; | 86 m_leftMarginBoxDelta = floatMarginBoxWidth; |
87 m_rightMarginBoxDelta = -floatMarginBoxWidth; | 87 m_rightMarginBoxDelta = -floatMarginBoxWidth; |
88 m_lineOverlapsShape = false; | 88 m_lineOverlapsShape = false; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 ShapeValue* ShapeOutsideInfo::shapeValue() const | 92 ShapeValue* ShapeOutsideInfo::shapeValue() const |
93 { | 93 { |
94 return m_renderer->style()->shapeOutside(); | 94 return m_renderer->style()->shapeOutside(); |
95 } | 95 } |
96 | 96 |
97 } | 97 } |
OLD | NEW |