Changeset 143289 in webkit
- Timestamp:
- Feb 18, 2013 7:38:46 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143287 r143289 1 2013-02-18 Ryosuke Niwa <rniwa@webkit.org> 2 3 Encapsulate FloatingObject's constructor inside create 4 https://bugs.webkit.org/show_bug.cgi?id=110169 5 6 Reviewed by Darin Adler. 7 8 Added FloatingObject::create and made FloatingObject's constructor private. 9 Also added RenderBlock::ensureFloatingObjects to help lazily creating FloatingObjects. 10 11 * rendering/RenderBlock.cpp: 12 (WebCore::RenderBlock::insertFloatingObject): 13 (WebCore::RenderBlock::addOverhangingFloats): 14 (WebCore::RenderBlock::addIntrudingFloats): 15 (WebCore::RenderBlock::ensureFloatingObjects): 16 (WebCore::RenderBlock::FloatingObjects::create): 17 (WebCore::RenderBlock::FloatingObjects::FloatingObjects): 18 * rendering/RenderBlock.h: 19 (FloatingObjects): 20 (RenderBlock): 21 1 22 2013-02-18 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r143284 r143289 3889 3889 // Create the list of special objects if we don't aleady have one 3890 3890 if (!m_floatingObjects) 3891 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMode()));3891 createFloatingObjects(); 3892 3892 else { 3893 3893 // Don't insert the object again if it's already in the list … … 4656 4656 // We create the floating object list lazily. 4657 4657 if (!m_floatingObjects) 4658 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMode())); 4659 4658 createFloatingObjects(); 4660 4659 m_floatingObjects->add(floatingObj); 4661 4660 } … … 4729 4728 // We create the floating object list lazily. 4730 4729 if (!m_floatingObjects) 4731 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMode()));4730 createFloatingObjects(); 4732 4731 m_floatingObjects->add(floatingObj); 4733 4732 } … … 7761 7760 } 7762 7761 7762 inline RenderBlock::FloatingObjects::FloatingObjects(const RenderBlock* renderer, bool horizontalWritingMode) 7763 : m_placedFloatsTree(UninitializedTree) 7764 , m_leftObjectsCount(0) 7765 , m_rightObjectsCount(0) 7766 , m_horizontalWritingMode(horizontalWritingMode) 7767 , m_renderer(renderer) 7768 { 7769 } 7770 7771 inline PassOwnPtr<RenderBlock::FloatingObjects> RenderBlock::FloatingObjects::create(const RenderBlock* renderer, bool horizontalWritingMode) 7772 { 7773 return adoptPtr(new FloatingObjects(renderer, horizontalWritingMode)); 7774 } 7775 7776 void RenderBlock::createFloatingObjects() 7777 { 7778 if (m_floatingObjects) 7779 return; 7780 m_floatingObjects = FloatingObjects::create(this, isHorizontalWritingMode()); 7781 } 7782 7763 7783 inline void RenderBlock::FloatingObjects::clear() 7764 7784 { -
trunk/Source/WebCore/rendering/RenderBlock.h
r142974 r143289 1140 1140 1141 1141 class FloatingObjects { 1142 WTF_MAKE_NONCOPYABLE(FloatingObjects); WTF_MAKE_FAST_ALLOCATED; 1142 1143 public: 1143 FloatingObjects(const RenderBlock* renderer, bool horizontalWritingMode) 1144 : m_placedFloatsTree(UninitializedTree) 1145 , m_leftObjectsCount(0) 1146 , m_rightObjectsCount(0) 1147 , m_horizontalWritingMode(horizontalWritingMode) 1148 , m_renderer(renderer) 1149 { 1150 } 1151 1144 static PassOwnPtr<FloatingObjects> create(const RenderBlock*, bool horizontalWritingMode); 1152 1145 void clear(); 1153 1146 void add(FloatingObject*); … … 1166 1159 } 1167 1160 private: 1161 FloatingObjects(const RenderBlock*, bool horizontalWritingMode); 1168 1162 void computePlacedFloatsTree(); 1169 1163 inline void computePlacedFloatsTreeIfNeeded() … … 1183 1177 const RenderBlock* m_renderer; 1184 1178 }; 1179 1185 1180 OwnPtr<FloatingObjects> m_floatingObjects; 1181 1182 void createFloatingObjects(); 1183 1186 1184 1187 1185 // Allocated only when some of these fields have non-default values
Note: See TracChangeset
for help on using the changeset viewer.