| 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 12 matching lines...) Expand all Loading... |
| 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 * SUCH DAMAGE. | 27 * SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #ifndef ShapeOutsideInfo_h | 30 #ifndef ShapeOutsideInfo_h |
| 31 #define ShapeOutsideInfo_h | 31 #define ShapeOutsideInfo_h |
| 32 | 32 |
| 33 #include "core/layout/api/LineLayoutBlockFlow.h" |
| 33 #include "core/layout/shapes/Shape.h" | 34 #include "core/layout/shapes/Shape.h" |
| 34 #include "core/style/ComputedStyle.h" | 35 #include "core/style/ComputedStyle.h" |
| 35 #include "core/style/ShapeValue.h" | 36 #include "core/style/ShapeValue.h" |
| 36 #include "platform/geometry/FloatRect.h" | 37 #include "platform/geometry/FloatRect.h" |
| 37 #include "platform/geometry/LayoutSize.h" | 38 #include "platform/geometry/LayoutSize.h" |
| 38 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class LayoutBlockFlow; | 43 class LayoutBlockFlow; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 LayoutUnit shapeLogicalTop() const { return computedShape().shapeMarginLogic
alBoundingBox().y() + logicalTopOffset(); } | 89 LayoutUnit shapeLogicalTop() const { return computedShape().shapeMarginLogic
alBoundingBox().y() + logicalTopOffset(); } |
| 89 LayoutUnit shapeLogicalBottom() const { return computedShape().shapeMarginLo
gicalBoundingBox().maxY() + logicalTopOffset(); } | 90 LayoutUnit shapeLogicalBottom() const { return computedShape().shapeMarginLo
gicalBoundingBox().maxY() + logicalTopOffset(); } |
| 90 LayoutUnit shapeLogicalLeft() const { return computedShape().shapeMarginLogi
calBoundingBox().x() + logicalLeftOffset(); } | 91 LayoutUnit shapeLogicalLeft() const { return computedShape().shapeMarginLogi
calBoundingBox().x() + logicalLeftOffset(); } |
| 91 LayoutUnit shapeLogicalRight() const { return computedShape().shapeMarginLog
icalBoundingBox().maxX() + logicalLeftOffset(); } | 92 LayoutUnit shapeLogicalRight() const { return computedShape().shapeMarginLog
icalBoundingBox().maxX() + logicalLeftOffset(); } |
| 92 LayoutUnit shapeLogicalWidth() const { return computedShape().shapeMarginLog
icalBoundingBox().width(); } | 93 LayoutUnit shapeLogicalWidth() const { return computedShape().shapeMarginLog
icalBoundingBox().width(); } |
| 93 LayoutUnit shapeLogicalHeight() const { return computedShape().shapeMarginLo
gicalBoundingBox().height(); } | 94 LayoutUnit shapeLogicalHeight() const { return computedShape().shapeMarginLo
gicalBoundingBox().height(); } |
| 94 | 95 |
| 95 static PassOwnPtr<ShapeOutsideInfo> createInfo(const LayoutBox& layoutBox) {
return adoptPtr(new ShapeOutsideInfo(layoutBox)); } | 96 static PassOwnPtr<ShapeOutsideInfo> createInfo(const LayoutBox& layoutBox) {
return adoptPtr(new ShapeOutsideInfo(layoutBox)); } |
| 96 static bool isEnabledFor(const LayoutBox&); | 97 static bool isEnabledFor(const LayoutBox&); |
| 97 | 98 |
| 98 ShapeOutsideDeltas computeDeltasForContainingBlockLine(const LayoutBlockFlow
&, const FloatingObject&, LayoutUnit lineTop, LayoutUnit lineHeight); | 99 ShapeOutsideDeltas computeDeltasForContainingBlockLine(LineLayoutBlockFlow,
const FloatingObject&, LayoutUnit lineTop, LayoutUnit lineHeight); |
| 99 | 100 |
| 100 static ShapeOutsideInfo& ensureInfo(const LayoutBox& key) | 101 static ShapeOutsideInfo& ensureInfo(const LayoutBox& key) |
| 101 { | 102 { |
| 102 InfoMap& infoMap = ShapeOutsideInfo::infoMap(); | 103 InfoMap& infoMap = ShapeOutsideInfo::infoMap(); |
| 103 if (ShapeOutsideInfo* info = infoMap.get(&key)) | 104 if (ShapeOutsideInfo* info = infoMap.get(&key)) |
| 104 return *info; | 105 return *info; |
| 105 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn
fo(key)); | 106 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn
fo(key)); |
| 106 return *result.storedValue->value; | 107 return *result.storedValue->value; |
| 107 } | 108 } |
| 108 static void removeInfo(const LayoutBox& key) { infoMap().remove(&key); } | 109 static void removeInfo(const LayoutBox& key) { infoMap().remove(&key); } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 139 | 140 |
| 140 const LayoutBox& m_layoutBox; | 141 const LayoutBox& m_layoutBox; |
| 141 mutable OwnPtr<Shape> m_shape; | 142 mutable OwnPtr<Shape> m_shape; |
| 142 LayoutSize m_referenceBoxLogicalSize; | 143 LayoutSize m_referenceBoxLogicalSize; |
| 143 ShapeOutsideDeltas m_shapeOutsideDeltas; | 144 ShapeOutsideDeltas m_shapeOutsideDeltas; |
| 144 mutable bool m_isComputingShape; | 145 mutable bool m_isComputingShape; |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 } | 148 } |
| 148 #endif | 149 #endif |
| OLD | NEW |