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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(floatRelativeLineTop,
lineHeight); |
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 return; | 79 return; |
79 } | 80 } |
80 } | 81 } |
81 | 82 |
82 // 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 |
83 // 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 |
84 // entire width of the float. | 85 // entire width of the float. |
85 // FIXME: The latest CSS Shapes spec says that in this case, the | |
86 // content should interact with previously stacked floats on the line | |
87 // as if this outermost float did not exist. Perhaps obviously, this | |
88 // solution cannot do that, and will be revisted when that part of the | |
89 // spec is implemented. | |
90 m_leftMarginBoxDelta = floatMarginBoxWidth; | 86 m_leftMarginBoxDelta = floatMarginBoxWidth; |
91 m_rightMarginBoxDelta = -floatMarginBoxWidth; | 87 m_rightMarginBoxDelta = -floatMarginBoxWidth; |
| 88 m_lineOverlapsShape = false; |
92 } | 89 } |
93 } | 90 } |
94 | 91 |
95 ShapeValue* ShapeOutsideInfo::shapeValue() const | 92 ShapeValue* ShapeOutsideInfo::shapeValue() const |
96 { | 93 { |
97 return m_renderer->style()->shapeOutside(); | 94 return m_renderer->style()->shapeOutside(); |
98 } | 95 } |
99 | 96 |
100 } | 97 } |
OLD | NEW |