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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 return *shape; | 177 return *shape; |
178 | 178 |
179 AutoReset<bool> isInComputingShape(&m_isComputingShape, true); | 179 AutoReset<bool> isInComputingShape(&m_isComputingShape, true); |
180 | 180 |
181 const ComputedStyle& style = *m_layoutBox.style(); | 181 const ComputedStyle& style = *m_layoutBox.style(); |
182 ASSERT(m_layoutBox.containingBlock()); | 182 ASSERT(m_layoutBox.containingBlock()); |
183 const ComputedStyle& containingBlockStyle = | 183 const ComputedStyle& containingBlockStyle = |
184 *m_layoutBox.containingBlock()->style(); | 184 *m_layoutBox.containingBlock()->style(); |
185 | 185 |
186 WritingMode writingMode = containingBlockStyle.getWritingMode(); | 186 WritingMode writingMode = containingBlockStyle.getWritingMode(); |
187 // Make sure contentWidth is not negative. This can happen when containing blo
ck has a vertical scrollbar and | 187 // Make sure contentWidth is not negative. This can happen when containing |
188 // its content is smaller than the scrollbar width. | 188 // block has a vertical scrollbar and its content is smaller than the |
| 189 // scrollbar width. |
189 LayoutUnit maximumValue = | 190 LayoutUnit maximumValue = |
190 m_layoutBox.containingBlock() | 191 m_layoutBox.containingBlock() |
191 ? std::max(LayoutUnit(), | 192 ? std::max(LayoutUnit(), |
192 m_layoutBox.containingBlock()->contentWidth()) | 193 m_layoutBox.containingBlock()->contentWidth()) |
193 : LayoutUnit(); | 194 : LayoutUnit(); |
194 float margin = floatValueForLength(m_layoutBox.style()->shapeMargin(), | 195 float margin = floatValueForLength(m_layoutBox.style()->shapeMargin(), |
195 maximumValue.toFloat()); | 196 maximumValue.toFloat()); |
196 | 197 |
197 float shapeImageThreshold = style.shapeImageThreshold(); | 198 float shapeImageThreshold = style.shapeImageThreshold(); |
198 ASSERT(style.shapeOutside()); | 199 ASSERT(style.shapeOutside()); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 return result; | 434 return result; |
434 } | 435 } |
435 | 436 |
436 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const { | 437 FloatSize ShapeOutsideInfo::shapeToLayoutObjectSize(FloatSize size) const { |
437 if (!m_layoutBox.style()->isHorizontalWritingMode()) | 438 if (!m_layoutBox.style()->isHorizontalWritingMode()) |
438 return size.transposedSize(); | 439 return size.transposedSize(); |
439 return size; | 440 return size; |
440 } | 441 } |
441 | 442 |
442 } // namespace blink | 443 } // namespace blink |
OLD | NEW |