Changeset 158963 in webkit
- Timestamp:
- Nov 8, 2013 3:24:40 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r158962 r158963 1 2013-11-08 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 Use references instead of pointers to RenderBlockFlow in FloatingObjects and ComputeFloatOffsetAdapter 4 https://bugs.webkit.org/show_bug.cgi?id=124074 5 6 Reviewed by Sam Weinig. 7 8 Just a straightforward conversion from const pointers to const references. 9 10 Also, remove unneeded argument from FloatingObjects constructor. 11 12 No new tests, no behavior change. 13 14 * rendering/FloatingObjects.cpp: 15 (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter): 16 (WebCore::FloatingObjects::findNextFloatLogicalBottomBelow): 17 (WebCore::FloatingObjects::findNextFloatLogicalBottomBelowForBlock): 18 (WebCore::FloatingObjects::FloatingObjects): 19 (WebCore::FloatingObjects::clearLineBoxTreePointers): 20 (WebCore::FloatingObjects::computePlacedFloatsTree): 21 (WebCore::shapeInfoForFloat): 22 (WebCore::::updateOffsetIfNeeded): 23 (WebCore::::collectIfNeeded): 24 (WebCore::::heightRemaining): 25 * rendering/FloatingObjects.h: 26 * rendering/RenderBlockFlow.cpp: 27 (WebCore::RenderBlockFlow::createFloatingObjects): 28 1 29 2013-11-08 Sam Weinig <sam@webkit.org> 2 30 -
trunk/Source/WebCore/rendering/FloatingObjects.cpp
r158954 r158963 126 126 typedef FloatingObjectInterval IntervalType; 127 127 128 ComputeFloatOffsetAdapter(const RenderBlockFlow *renderer, LayoutUnit lineTop, LayoutUnit lineBottom, LayoutUnit offset)128 ComputeFloatOffsetAdapter(const RenderBlockFlow& renderer, LayoutUnit lineTop, LayoutUnit lineBottom, LayoutUnit offset) 129 129 : m_renderer(renderer) 130 130 , m_lineTop(roundToInt(lineTop)) … … 146 146 bool updateOffsetIfNeeded(const FloatingObject*); 147 147 148 const RenderBlockFlow *m_renderer;148 const RenderBlockFlow& m_renderer; 149 149 int m_lineTop; 150 150 int m_lineBottom; … … 208 208 LayoutUnit FloatingObjects::findNextFloatLogicalBottomBelow(LayoutUnit logicalHeight) 209 209 { 210 FindNextFloatLogicalBottomAdapter adapter( *m_renderer, logicalHeight);210 FindNextFloatLogicalBottomAdapter adapter(m_renderer, logicalHeight); 211 211 placedFloatsTree().allOverlapsWithAdapter(adapter); 212 212 … … 216 216 LayoutUnit FloatingObjects::findNextFloatLogicalBottomBelowForBlock(LayoutUnit logicalHeight) 217 217 { 218 FindNextFloatLogicalBottomAdapter adapter( *m_renderer, logicalHeight);218 FindNextFloatLogicalBottomAdapter adapter(m_renderer, logicalHeight); 219 219 placedFloatsTree().allOverlapsWithAdapter(adapter); 220 220 … … 222 222 } 223 223 224 FloatingObjects::FloatingObjects(const RenderBlockFlow * renderer, bool horizontalWritingMode)224 FloatingObjects::FloatingObjects(const RenderBlockFlow& renderer) 225 225 : m_placedFloatsTree(UninitializedTree) 226 226 , m_leftObjectsCount(0) 227 227 , m_rightObjectsCount(0) 228 , m_horizontalWritingMode( horizontalWritingMode)228 , m_horizontalWritingMode(renderer.isHorizontalWritingMode()) 229 229 , m_renderer(renderer) 230 230 { … … 239 239 // Clear references to originating lines, since the lines are being deleted 240 240 for (auto it = m_set.begin(), end = m_set.end(); it != end; ++it) { 241 ASSERT(!((*it)->originatingLine()) || &((*it)->originatingLine()->renderer()) == m_renderer);241 ASSERT(!((*it)->originatingLine()) || &((*it)->originatingLine()->renderer()) == &m_renderer); 242 242 (*it)->setOriginatingLine(0); 243 243 } … … 342 342 if (m_set.isEmpty()) 343 343 return; 344 m_placedFloatsTree.initIfNeeded(m_renderer ->view().intervalArena());344 m_placedFloatsTree.initIfNeeded(m_renderer.view().intervalArena()); 345 345 for (auto it = m_set.begin(), end = m_set.end(); it != end; ++it) { 346 346 FloatingObject* floatingObject = it->get(); … … 358 358 359 359 #if ENABLE(CSS_SHAPES) 360 static inline ShapeOutsideInfo* shapeInfoForFloat(const FloatingObject* floatingObject, const RenderBlockFlow *containingBlock, LayoutUnit lineTop, LayoutUnit lineBottom)360 static inline ShapeOutsideInfo* shapeInfoForFloat(const FloatingObject* floatingObject, const RenderBlockFlow& containingBlock, LayoutUnit lineTop, LayoutUnit lineBottom) 361 361 { 362 362 if (floatingObject) { 363 363 if (ShapeOutsideInfo* shapeOutside = floatingObject->renderer().shapeOutsideInfo()) { 364 shapeOutside->updateDeltasForContainingBlockLine( containingBlock, floatingObject, lineTop, lineBottom - lineTop);364 shapeOutside->updateDeltasForContainingBlockLine(&containingBlock, floatingObject, lineTop, lineBottom - lineTop); 365 365 return shapeOutside; 366 366 } … … 434 434 inline bool ComputeFloatOffsetAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded(const FloatingObject* floatingObject) 435 435 { 436 LayoutUnit logicalRight = m_renderer ->logicalRightForFloat(floatingObject);436 LayoutUnit logicalRight = m_renderer.logicalRightForFloat(floatingObject); 437 437 if (logicalRight > m_offset) { 438 438 m_offset = logicalRight; … … 445 445 inline bool ComputeFloatOffsetAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded(const FloatingObject* floatingObject) 446 446 { 447 LayoutUnit logicalLeft = m_renderer ->logicalLeftForFloat(floatingObject);447 LayoutUnit logicalLeft = m_renderer.logicalLeftForFloat(floatingObject); 448 448 if (logicalLeft < m_offset) { 449 449 m_offset = logicalLeft; … … 462 462 // All the objects returned from the tree should be already placed. 463 463 ASSERT(floatingObject->isPlaced()); 464 ASSERT(rangesIntersect(m_renderer ->pixelSnappedLogicalTopForFloat(floatingObject), m_renderer->pixelSnappedLogicalBottomForFloat(floatingObject), m_lineTop, m_lineBottom));464 ASSERT(rangesIntersect(m_renderer.pixelSnappedLogicalTopForFloat(floatingObject), m_renderer.pixelSnappedLogicalBottomForFloat(floatingObject), m_lineTop, m_lineBottom)); 465 465 466 466 bool floatIsNewExtreme = updateOffsetIfNeeded(floatingObject); … … 472 472 LayoutUnit ComputeFloatOffsetAdapter<FloatTypeValue>::heightRemaining() const 473 473 { 474 return m_outermostFloat ? m_renderer ->logicalBottomForFloat(m_outermostFloat) - m_lineTop : LayoutUnit(1);474 return m_outermostFloat ? m_renderer.logicalBottomForFloat(m_outermostFloat) - m_lineTop : LayoutUnit(1); 475 475 } 476 476 -
trunk/Source/WebCore/rendering/FloatingObjects.h
r158954 r158963 125 125 WTF_MAKE_NONCOPYABLE(FloatingObjects); WTF_MAKE_FAST_ALLOCATED; 126 126 public: 127 FloatingObjects(const RenderBlockFlow *, bool horizontalWritingMode);127 FloatingObjects(const RenderBlockFlow&); 128 128 ~FloatingObjects(); 129 129 … … 162 162 unsigned m_rightObjectsCount; 163 163 bool m_horizontalWritingMode; 164 const RenderBlockFlow *m_renderer;164 const RenderBlockFlow& m_renderer; 165 165 }; 166 166 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r158954 r158963 1928 1928 void RenderBlockFlow::createFloatingObjects() 1929 1929 { 1930 m_floatingObjects = adoptPtr(new FloatingObjects( this, isHorizontalWritingMode()));1930 m_floatingObjects = adoptPtr(new FloatingObjects(*this)); 1931 1931 } 1932 1932
Note: See TracChangeset
for help on using the changeset viewer.