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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return m_segments.size(); | 85 return m_segments.size(); |
86 } | 86 } |
87 | 87 |
88 bool ShapeInsideInfo::adjustLogicalLineTop(float minSegmentWidth) | 88 bool ShapeInsideInfo::adjustLogicalLineTop(float minSegmentWidth) |
89 { | 89 { |
90 const Shape* shape = computedShape(); | 90 const Shape* shape = computedShape(); |
91 if (!shape || m_lineHeight <= 0 || logicalLineTop() > shapeLogicalBottom()) | 91 if (!shape || m_lineHeight <= 0 || logicalLineTop() > shapeLogicalBottom()) |
92 return false; | 92 return false; |
93 | 93 |
94 LayoutUnit newLineTop; | 94 LayoutUnit newLineTop; |
95 if (shape->firstIncludedIntervalLogicalTop(m_shapeLineTop, LayoutSize(minSeg
mentWidth, m_lineHeight), newLineTop)) { | 95 if (shape->firstIncludedIntervalLogicalTop(m_shapeLineTop, FloatSize(minSegm
entWidth, m_lineHeight), newLineTop)) { |
96 if (newLineTop > m_shapeLineTop) { | 96 if (newLineTop > m_shapeLineTop) { |
97 m_shapeLineTop = newLineTop; | 97 m_shapeLineTop = newLineTop; |
98 return true; | 98 return true; |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 return false; | 102 return false; |
103 } | 103 } |
104 | 104 |
105 ShapeValue* ShapeInsideInfo::shapeValue() const | 105 ShapeValue* ShapeInsideInfo::shapeValue() const |
106 { | 106 { |
107 return m_renderer->style()->resolvedShapeInside(); | 107 return m_renderer->style()->resolvedShapeInside(); |
108 } | 108 } |
109 | 109 |
110 LayoutUnit ShapeInsideInfo::computeFirstFitPositionForFloat(const LayoutSize flo
atSize) const | 110 LayoutUnit ShapeInsideInfo::computeFirstFitPositionForFloat(const FloatSize& flo
atSize) const |
111 { | 111 { |
112 if (!computedShape() || !floatSize.width() || shapeLogicalBottom() < logical
LineTop()) | 112 if (!computedShape() || !floatSize.width() || shapeLogicalBottom() < logical
LineTop()) |
113 return 0; | 113 return 0; |
114 | 114 |
115 LayoutUnit firstFitPosition = 0; | 115 LayoutUnit firstFitPosition = 0; |
116 if (computedShape()->firstIncludedIntervalLogicalTop(m_shapeLineTop, floatSi
ze, firstFitPosition) && (m_shapeLineTop <= firstFitPosition)) | 116 if (computedShape()->firstIncludedIntervalLogicalTop(m_shapeLineTop, floatSi
ze, firstFitPosition) && (m_shapeLineTop <= firstFitPosition)) |
117 return firstFitPosition; | 117 return firstFitPosition; |
118 | 118 |
119 return 0; | 119 return 0; |
120 } | 120 } |
121 | 121 |
122 } | 122 } |
OLD | NEW |