OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 | 80 |
81 #if ENABLE(ASSERT) | 81 #if ENABLE(ASSERT) |
82 bool isInPlacedTree() const { return m_isInPlacedTree; } | 82 bool isInPlacedTree() const { return m_isInPlacedTree; } |
83 void setIsInPlacedTree(bool value) { m_isInPlacedTree = value; } | 83 void setIsInPlacedTree(bool value) { m_isInPlacedTree = value; } |
84 #endif | 84 #endif |
85 | 85 |
86 bool shouldPaint() const { return m_shouldPaint; } | 86 bool shouldPaint() const { return m_shouldPaint; } |
87 void setShouldPaint(bool shouldPaint) { m_shouldPaint = shouldPaint; } | 87 void setShouldPaint(bool shouldPaint) { m_shouldPaint = shouldPaint; } |
88 bool isDescendant() const { return m_isDescendant; } | 88 bool isDescendant() const { return m_isDescendant; } |
89 void setIsDescendant(bool isDescendant) { m_isDescendant = isDescendant; } | 89 void setIsDescendant(bool isDescendant) { m_isDescendant = isDescendant; } |
90 bool isLowestNonOverhangingFloatInChild() const { return m_isLowestNonOverha ngingFloatInChild; } | |
91 void setIsLowestNonOverhangingFloatInChild(bool isLowestNonOverhangingFloatI nChild) { m_isLowestNonOverhangingFloatInChild = isLowestNonOverhangingFloatInCh ild; } | |
90 | 92 |
91 // FIXME: Callers of these methods are dangerous and should be whitelisted e xplicitly or removed. | 93 // FIXME: Callers of these methods are dangerous and should be whitelisted e xplicitly or removed. |
92 RootInlineBox* originatingLine() const { return m_originatingLine; } | 94 RootInlineBox* originatingLine() const { return m_originatingLine; } |
93 void setOriginatingLine(RootInlineBox* line) { m_originatingLine = line; } | 95 void setOriginatingLine(RootInlineBox* line) { m_originatingLine = line; } |
94 | 96 |
95 private: | 97 private: |
96 explicit FloatingObject(LayoutBox*); | 98 explicit FloatingObject(LayoutBox*); |
97 FloatingObject(LayoutBox*, Type, const LayoutRect&, bool shouldPaint, bool i sDescendant); | 99 FloatingObject(LayoutBox*, Type, const LayoutRect&, bool shouldPaint, bool i sDescendant, bool isLowestNonOverhangingFloatInChild); |
98 | 100 |
99 LayoutBox* m_layoutObject; | 101 LayoutBox* m_layoutObject; |
100 RootInlineBox* m_originatingLine; | 102 RootInlineBox* m_originatingLine; |
101 LayoutRect m_frameRect; | 103 LayoutRect m_frameRect; |
102 int m_paginationStrut; // FIXME: Is this class size-sensitive? Does this nee d 32-bits? | 104 int m_paginationStrut; // FIXME: Is this class size-sensitive? Does this nee d 32-bits? |
103 | 105 |
104 unsigned m_type : 2; // Type (left or right aligned) | 106 unsigned m_type : 2; // Type (left or right aligned) |
105 unsigned m_shouldPaint : 1; | 107 unsigned m_shouldPaint : 1; |
106 unsigned m_isDescendant : 1; | 108 unsigned m_isDescendant : 1; |
107 unsigned m_isPlaced : 1; | 109 unsigned m_isPlaced : 1; |
108 #if ENABLE(ASSERT) | 110 #if ENABLE(ASSERT) |
109 unsigned m_isInPlacedTree : 1; | 111 unsigned m_isInPlacedTree : 1; |
110 #endif | 112 #endif |
113 unsigned m_isLowestNonOverhangingFloatInChild : 1; | |
leviw_travelin_and_unemployed
2015/05/22 20:52:01
Nit: I'd put this above the assertion-only member.
| |
111 }; | 114 }; |
112 | 115 |
113 struct FloatingObjectHashFunctions { | 116 struct FloatingObjectHashFunctions { |
114 static unsigned hash(FloatingObject* key) { return DefaultHash<LayoutBox*>:: Hash::hash(key->layoutObject()); } | 117 static unsigned hash(FloatingObject* key) { return DefaultHash<LayoutBox*>:: Hash::hash(key->layoutObject()); } |
115 static unsigned hash(const OwnPtr<FloatingObject>& key) { return hash(key.ge t()); } | 118 static unsigned hash(const OwnPtr<FloatingObject>& key) { return hash(key.ge t()); } |
116 static unsigned hash(const PassOwnPtr<FloatingObject>& key) { return hash(ke y.get()); } | 119 static unsigned hash(const PassOwnPtr<FloatingObject>& key) { return hash(ke y.get()); } |
117 static bool equal(OwnPtr<FloatingObject>& a, FloatingObject* b) { return a-> layoutObject() == b->layoutObject(); } | 120 static bool equal(OwnPtr<FloatingObject>& a, FloatingObject* b) { return a-> layoutObject() == b->layoutObject(); } |
118 static bool equal(OwnPtr<FloatingObject>& a, const OwnPtr<FloatingObject>& b ) { return equal(a, b.get()); } | 121 static bool equal(OwnPtr<FloatingObject>& a, const OwnPtr<FloatingObject>& b ) { return equal(a, b.get()); } |
119 static bool equal(OwnPtr<FloatingObject>& a, const PassOwnPtr<FloatingObject >& b) { return equal(a, b.get()); } | 122 static bool equal(OwnPtr<FloatingObject>& a, const PassOwnPtr<FloatingObject >& b) { return equal(a, b.get()); } |
120 | 123 |
(...skipping 30 matching lines...) Expand all Loading... | |
151 const FloatingObjectSet& set() const { return m_set; } | 154 const FloatingObjectSet& set() const { return m_set; } |
152 void clearLineBoxTreePointers(); | 155 void clearLineBoxTreePointers(); |
153 | 156 |
154 LayoutUnit logicalLeftOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight); | 157 LayoutUnit logicalLeftOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight); |
155 LayoutUnit logicalRightOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight); | 158 LayoutUnit logicalRightOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight); |
156 | 159 |
157 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit fixedOffset, Layo utUnit logicalTop, LayoutUnit* heightRemaining); | 160 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit fixedOffset, Layo utUnit logicalTop, LayoutUnit* heightRemaining); |
158 LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit fixedOffset, Lay outUnit logicalTop, LayoutUnit* heightRemaining); | 161 LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit fixedOffset, Lay outUnit logicalTop, LayoutUnit* heightRemaining); |
159 | 162 |
160 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type); | 163 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type); |
164 FloatingObject* lowestFloatObject() { return m_lowestFloatObject; } | |
161 | 165 |
162 private: | 166 private: |
163 bool hasLowestFloatLogicalBottomCached(bool isHorizontal, FloatingObject::Ty pe floatType) const; | 167 bool hasLowestFloatLogicalBottomCached(bool isHorizontal, FloatingObject::Ty pe floatType) const; |
164 LayoutUnit getCachedlowestFloatLogicalBottom(FloatingObject::Type floatType) const; | 168 LayoutUnit getCachedlowestFloatLogicalBottom(FloatingObject::Type floatType) const; |
165 void setCachedLowestFloatLogicalBottom(bool isHorizontal, FloatingObject::Ty pe floatType, LayoutUnit value); | 169 void setCachedLowestFloatLogicalBottom(bool isHorizontal, FloatingObject::Ty pe floatType, LayoutUnit value); |
170 void setLowestFloatObject(FloatingObject* object) { m_lowestFloatObject = ob ject; } | |
166 void markLowestFloatLogicalBottomCacheAsDirty(); | 171 void markLowestFloatLogicalBottomCacheAsDirty(); |
167 | 172 |
168 void computePlacedFloatsTree(); | 173 void computePlacedFloatsTree(); |
169 const FloatingObjectTree& placedFloatsTree() | 174 const FloatingObjectTree& placedFloatsTree() |
170 { | 175 { |
171 if (!m_placedFloatsTree.isInitialized()) | 176 if (!m_placedFloatsTree.isInitialized()) |
172 computePlacedFloatsTree(); | 177 computePlacedFloatsTree(); |
173 return m_placedFloatsTree; | 178 return m_placedFloatsTree; |
174 } | 179 } |
175 void increaseObjectsCount(FloatingObject::Type); | 180 void increaseObjectsCount(FloatingObject::Type); |
176 void decreaseObjectsCount(FloatingObject::Type); | 181 void decreaseObjectsCount(FloatingObject::Type); |
177 FloatingObjectInterval intervalForFloatingObject(FloatingObject*); | 182 FloatingObjectInterval intervalForFloatingObject(FloatingObject*); |
178 | 183 |
179 FloatingObjectSet m_set; | 184 FloatingObjectSet m_set; |
180 FloatingObjectTree m_placedFloatsTree; | 185 FloatingObjectTree m_placedFloatsTree; |
181 unsigned m_leftObjectsCount; | 186 unsigned m_leftObjectsCount; |
182 unsigned m_rightObjectsCount; | 187 unsigned m_rightObjectsCount; |
183 bool m_horizontalWritingMode; | 188 bool m_horizontalWritingMode; |
184 const LayoutBlockFlow* m_layoutObject; | 189 const LayoutBlockFlow* m_layoutObject; |
185 | 190 |
186 struct FloatBottomCachedValue { | 191 struct FloatBottomCachedValue { |
187 FloatBottomCachedValue(); | 192 FloatBottomCachedValue(); |
188 LayoutUnit value; | 193 LayoutUnit value; |
189 bool dirty; | 194 bool dirty; |
190 }; | 195 }; |
191 FloatBottomCachedValue m_lowestFloatBottomCache[2]; | 196 FloatBottomCachedValue m_lowestFloatBottomCache[2]; |
192 bool m_cachedHorizontalWritingMode; | 197 bool m_cachedHorizontalWritingMode; |
198 FloatingObject* m_lowestFloatObject; | |
leviw_travelin_and_unemployed
2015/05/22 20:52:01
m_lowestFloatingObject?
Would it maybe make sense
rhogan
2015/05/23 11:56:51
Yes, I think it might. I'll try it and see.
rhogan
2015/05/23 12:12:08
It doesn't fit well with m_lowestFloatBottomCache
| |
193 }; | 199 }; |
194 | 200 |
195 #ifndef NDEBUG | 201 #ifndef NDEBUG |
196 // These structures are used by PODIntervalTree for debugging purposes. | 202 // These structures are used by PODIntervalTree for debugging purposes. |
197 template <> struct ValueToString<int> { | 203 template <> struct ValueToString<int> { |
198 static String string(const int value); | 204 static String string(const int value); |
199 }; | 205 }; |
200 template<> struct ValueToString<FloatingObject*> { | 206 template<> struct ValueToString<FloatingObject*> { |
201 static String string(const FloatingObject*); | 207 static String string(const FloatingObject*); |
202 }; | 208 }; |
203 #endif | 209 #endif |
204 | 210 |
205 } // namespace blink | 211 } // namespace blink |
206 | 212 |
207 #endif // FloatingObjects_h | 213 #endif // FloatingObjects_h |
OLD | NEW |