Changeset 80380 in webkit
- Timestamp:
- Mar 4, 2011 3:07:15 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80379 r80380 1 2011-03-04 Yuqiang Xian <yuqiang.xian@intel.com> 2 3 Reviewed by Darin Adler. 4 5 improve layout performance by reducing the traversal time of the floating objects 6 https://bugs.webkit.org/show_bug.cgi?id=55440 7 8 We observered large overhead on traversing the floating objects list 9 in logicalLeftOffsetForLine() and logicalRightOffsetForLine() especially 10 when the list becomes enormous, for example in the default 30x30 maze test 11 from http://ie.microsoft.com/testdrive/Performance/MazeSolver/Default.html 12 there're >3700 floating objects. When placing a new floating object the 13 entire list (from begin to end) is traversed for multiple times. 14 There's a low hanging fruit to reduce the chances to do the traversal 15 which is especially applicable in logicalLeftOffsetForLine and logicalRightOffsetForLine. 16 As the two routines either cares about FloatLeft objects or FloatRight objects only, 17 if we know there's no corresponding type floating objects in the list 18 we can avoid the traversal actually. One thing we could do is to record 19 the number of FloatLeft objects and the number of FloatRight objects and 20 add a check before doing the traversal. This can reduce the time by 45% 21 to resolve the 30x30 Maze measured on N470 Netbook MeeGo using latest 22 Chromium browser 11 (from 503s to 269s). 23 24 No new tests, relying on existing layout tests. 25 26 * rendering/RenderBlock.cpp: 27 (WebCore::RenderBlock::~RenderBlock): 28 (WebCore::RenderBlock::addOverflowFromFloats): 29 (WebCore::RenderBlock::repaintOverhangingFloats): 30 (WebCore::RenderBlock::paintFloats): 31 (WebCore::RenderBlock::selectionGaps): 32 (WebCore::RenderBlock::insertFloatingObject): 33 (WebCore::RenderBlock::removeFloatingObject): 34 (WebCore::RenderBlock::removeFloatingObjectsBelow): 35 (WebCore::RenderBlock::positionNewFloats): 36 (WebCore::RenderBlock::positionNewFloatOnLine): 37 (WebCore::RenderBlock::logicalLeftOffsetForLine): 38 (WebCore::RenderBlock::logicalRightOffsetForLine): 39 (WebCore::RenderBlock::nextFloatLogicalBottomBelow): 40 (WebCore::RenderBlock::lowestFloatLogicalBottom): 41 (WebCore::RenderBlock::clearFloats): 42 (WebCore::RenderBlock::addOverhangingFloats): 43 (WebCore::RenderBlock::addIntrudingFloats): 44 (WebCore::RenderBlock::containsFloat): 45 (WebCore::RenderBlock::hitTestFloats): 46 (WebCore::RenderBlock::adjustForBorderFit): 47 (WebCore::RenderBlock::FloatingObjects::clear): 48 (WebCore::RenderBlock::FloatingObjects::increaseObjectsCount): 49 (WebCore::RenderBlock::FloatingObjects::decreaseObjectsCount): 50 * rendering/RenderBlock.h: 51 (WebCore::RenderBlock::containsFloats): 52 (WebCore::RenderBlock::FloatingObjects::FloatingObjects): 53 (WebCore::RenderBlock::FloatingObjects::hasLeftObjects): 54 (WebCore::RenderBlock::FloatingObjects::hasRightObjects): 55 (WebCore::RenderBlock::FloatingObjects::set): 56 * rendering/RenderBlockLineLayout.cpp: 57 (WebCore::RenderBlock::layoutInlineChildren): 58 (WebCore::RenderBlock::matchedEndLine): 59 1 60 2011-03-04 Rik Cabanier <cabanier@gmail.com> 2 61 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r80221 r80380 124 124 { 125 125 if (m_floatingObjects) 126 deleteAllValues( *m_floatingObjects);126 deleteAllValues(m_floatingObjects->set()); 127 127 128 128 if (hasColumns()) … … 1381 1381 return; 1382 1382 1383 FloatingObjectSetIterator end = m_floatingObjects->end(); 1384 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 1383 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 1384 FloatingObjectSetIterator end = floatingObjectSet.end(); 1385 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 1385 1386 FloatingObject* r = *it; 1386 1387 if (r->m_isDescendant) … … 2178 2179 // in this block. Better yet would be to push extra state for the containers of other floats. 2179 2180 view()->disableLayoutState(); 2180 FloatingObjectSetIterator end = m_floatingObjects->end(); 2181 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 2181 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 2182 FloatingObjectSetIterator end = floatingObjectSet.end(); 2183 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 2182 2184 FloatingObject* r = *it; 2183 2185 // Only repaint the object if it is overhanging, is not in its own layer, and … … 2504 2506 return; 2505 2507 2506 FloatingObjectSetIterator end = m_floatingObjects->end(); 2507 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 2508 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 2509 FloatingObjectSetIterator end = floatingObjectSet.end(); 2510 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 2508 2511 FloatingObject* r = *it; 2509 2512 // Only paint the object if our m_shouldPaint flag is set. … … 2756 2759 clipOutPositionedObjects(paintInfo, IntPoint(cb->x(), cb->y()), cb->m_positionedObjects.get()); // FIXME: Not right for flipped writing modes. 2757 2760 if (m_floatingObjects) { 2758 FloatingObjectSetIterator end = m_floatingObjects->end(); 2759 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 2761 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 2762 FloatingObjectSetIterator end = floatingObjectSet.end(); 2763 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 2760 2764 FloatingObject* r = *it; 2761 2765 IntRect floatBox = IntRect(offsetFromRootBlock.width() + xPositionForFloatIncludingMargin(r), … … 3066 3070 // Create the list of special objects if we don't aleady have one 3067 3071 if (!m_floatingObjects) 3068 m_floatingObjects = adoptPtr(new FloatingObject Set);3072 m_floatingObjects = adoptPtr(new FloatingObjects); 3069 3073 else { 3070 3074 // Don't insert the object again if it's already in the list 3071 FloatingObjectSetIterator it = m_floatingObjects->find<RenderBox*, FloatingObjectHashTranslator>(o); 3072 if (it != m_floatingObjects->end()) 3075 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3076 FloatingObjectSetIterator it = floatingObjectSet.find<RenderBox*, FloatingObjectHashTranslator>(o); 3077 if (it != floatingObjectSet.end()) 3073 3078 return *it; 3074 3079 } … … 3097 3102 newObj->m_renderer = o; 3098 3103 3099 m_floatingObjects->add(newObj); 3104 m_floatingObjects->increaseObjectsCount(newObj->type()); 3105 m_floatingObjects->set().add(newObj); 3100 3106 3101 3107 return newObj; … … 3105 3111 { 3106 3112 if (m_floatingObjects) { 3107 FloatingObjectSet::iterator it = m_floatingObjects->find<RenderBox*, FloatingObjectHashTranslator>(o); 3108 if (it != m_floatingObjects->end()) { 3113 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3114 FloatingObjectSet::iterator it = floatingObjectSet.find<RenderBox*, FloatingObjectHashTranslator>(o); 3115 if (it != floatingObjectSet.end()) { 3109 3116 FloatingObject* r = *it; 3110 3117 if (childrenInline()) { … … 3123 3130 markLinesDirtyInBlockRange(0, logicalBottom); 3124 3131 } 3125 m_floatingObjects->remove(it); 3132 m_floatingObjects->decreaseObjectsCount(r->type()); 3133 floatingObjectSet.remove(it); 3126 3134 delete r; 3127 3135 } … … 3134 3142 return; 3135 3143 3136 FloatingObject* curr = m_floatingObjects->last(); 3144 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3145 FloatingObject* curr = floatingObjectSet.last(); 3137 3146 while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) >= logicalOffset)) { 3138 m_floatingObjects->removeLast(); 3147 m_floatingObjects->decreaseObjectsCount(curr->type()); 3148 floatingObjectSet.removeLast(); 3139 3149 delete curr; 3140 curr = m_floatingObjects->last();3150 curr = floatingObjectSet.last(); 3141 3151 } 3142 3152 } … … 3147 3157 return false; 3148 3158 3149 if (m_floatingObjects->isEmpty()) 3159 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3160 if (floatingObjectSet.isEmpty()) 3150 3161 return false; 3151 3162 3152 3163 // If all floats have already been positioned, then we have no work to do. 3153 if ( m_floatingObjects->last()->isPlaced())3164 if (floatingObjectSet.last()->isPlaced()) 3154 3165 return false; 3155 3166 … … 3157 3168 // already been positioned. Then we'll be able to move forward, positioning all of 3158 3169 // the new floats that need it. 3159 FloatingObjectSetIterator it = m_floatingObjects->end();3170 FloatingObjectSetIterator it = floatingObjectSet.end(); 3160 3171 --it; // Go to last item. 3161 FloatingObjectSetIterator begin = m_floatingObjects->begin();3172 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 3162 3173 FloatingObject* lastPlacedFloatingObject = 0; 3163 3174 while (it != begin) { … … 3176 3187 logicalTop = max(logicalTopForFloat(lastPlacedFloatingObject), logicalTop); 3177 3188 3178 FloatingObjectSetIterator end = m_floatingObjects->end();3189 FloatingObjectSetIterator end = floatingObjectSet.end(); 3179 3190 // Now walk through the set of unpositioned floats and place them. 3180 3191 for (; it != end; ++it) { … … 3275 3286 return didPosition; 3276 3287 3277 ASSERT(m_floatingObjects->last() == newFloat); 3288 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3289 ASSERT(floatingObjectSet.last() == newFloat); 3278 3290 3279 3291 int floatLogicalTop = logicalTopForFloat(newFloat); … … 3283 3295 return didPosition; 3284 3296 3285 FloatingObjectSetIterator it = m_floatingObjects->end();3297 FloatingObjectSetIterator it = floatingObjectSet.end(); 3286 3298 --it; // Last float is newFloat, skip that one. 3287 FloatingObjectSetIterator begin = m_floatingObjects->begin();3299 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 3288 3300 while (it != begin) { 3289 3301 --it; … … 3393 3405 { 3394 3406 int left = fixedOffset; 3395 if (m_floatingObjects ) {3407 if (m_floatingObjects && m_floatingObjects->hasLeftObjects()) { 3396 3408 if (heightRemaining) 3397 3409 *heightRemaining = 1; 3398 3410 3399 FloatingObjectSetIterator end = m_floatingObjects->end(); 3400 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 3411 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3412 FloatingObjectSetIterator end = floatingObjectSet.end(); 3413 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 3401 3414 FloatingObject* r = *it; 3402 3415 if (r->isPlaced() && logicalTopForFloat(r) <= logicalTop && logicalBottomForFloat(r) > logicalTop … … 3424 3437 int right = fixedOffset; 3425 3438 3426 if (m_floatingObjects ) {3439 if (m_floatingObjects && m_floatingObjects->hasRightObjects()) { 3427 3440 if (heightRemaining) 3428 3441 *heightRemaining = 1; 3429 FloatingObjectSetIterator end = m_floatingObjects->end(); 3430 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 3442 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3443 FloatingObjectSetIterator end = floatingObjectSet.end(); 3444 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 3431 3445 FloatingObject* r = *it; 3432 3446 if (r->isPlaced() && logicalTopForFloat(r) <= logicalTop && logicalBottomForFloat(r) > logicalTop … … 3462 3476 3463 3477 int bottom = INT_MAX; 3464 FloatingObjectSetIterator end = m_floatingObjects->end(); 3465 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 3478 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3479 FloatingObjectSetIterator end = floatingObjectSet.end(); 3480 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 3466 3481 FloatingObject* r = *it; 3467 3482 int floatBottom = logicalBottomForFloat(r); … … 3478 3493 return 0; 3479 3494 int lowestFloatBottom = 0; 3480 FloatingObjectSetIterator end = m_floatingObjects->end(); 3481 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 3495 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3496 FloatingObjectSetIterator end = floatingObjectSet.end(); 3497 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 3482 3498 FloatingObject* r = *it; 3483 3499 if (r->isPlaced() && r->type() & floatType) … … 3510 3526 if (avoidsFloats() || isRoot() || isRenderView() || isFloatingOrPositioned() || isTableCell()) { 3511 3527 if (m_floatingObjects) { 3512 deleteAllValues( *m_floatingObjects);3528 deleteAllValues(m_floatingObjects->set()); 3513 3529 m_floatingObjects->clear(); 3514 3530 } … … 3520 3536 3521 3537 if (m_floatingObjects) { 3538 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3522 3539 if (childrenInline()) { 3523 FloatingObjectSet::iterator end = m_floatingObjects->end();3524 for (FloatingObjectSet::iterator it = m_floatingObjects->begin(); it != end; ++it) {3540 FloatingObjectSet::iterator end = floatingObjectSet.end(); 3541 for (FloatingObjectSet::iterator it = floatingObjectSet.begin(); it != end; ++it) { 3525 3542 FloatingObject* f = *it; 3526 3543 floatMap.add(f->m_renderer, f); 3527 3544 } 3528 3545 } else 3529 deleteAllValues( *m_floatingObjects);3546 deleteAllValues(floatingObjectSet); 3530 3547 m_floatingObjects->clear(); 3531 3548 } … … 3574 3591 int changeLogicalBottom = numeric_limits<int>::min(); 3575 3592 if (m_floatingObjects) { 3576 FloatingObjectSetIterator end = m_floatingObjects->end(); 3577 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 3593 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3594 FloatingObjectSetIterator end = floatingObjectSet.end(); 3595 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 3578 3596 FloatingObject* f = *it; 3579 3597 FloatingObject* oldFloatingObject = floatMap.get(f->m_renderer); … … 3622 3640 // Floats that will remain the child's responsibility to paint should factor into its 3623 3641 // overflow. 3624 FloatingObjectSetIterator childEnd = child->m_floatingObjects-> end();3625 for (FloatingObjectSetIterator childIt = child->m_floatingObjects-> begin(); childIt != childEnd; ++childIt) {3642 FloatingObjectSetIterator childEnd = child->m_floatingObjects->set().end(); 3643 for (FloatingObjectSetIterator childIt = child->m_floatingObjects->set().begin(); childIt != childEnd; ++childIt) { 3626 3644 FloatingObject* r = *childIt; 3627 3645 int logicalBottom = child->logicalTop() + logicalBottomForFloat(r); … … 3649 3667 // We create the floating object list lazily. 3650 3668 if (!m_floatingObjects) 3651 m_floatingObjects = adoptPtr(new FloatingObjectSet); 3652 3653 m_floatingObjects->add(floatingObj); 3669 m_floatingObjects = adoptPtr(new FloatingObjects); 3670 3671 m_floatingObjects->increaseObjectsCount(floatingObj->type()); 3672 m_floatingObjects->set().add(floatingObj); 3654 3673 } 3655 3674 } else { … … 3681 3700 logicalLeftOffset += (style()->isHorizontalWritingMode() ? marginLeft() : marginTop()); 3682 3701 3683 FloatingObjectSetIterator prevEnd = prev->m_floatingObjects->end(); 3684 for (FloatingObjectSetIterator prevIt = prev->m_floatingObjects->begin(); prevIt != prevEnd; ++prevIt) { 3702 FloatingObjectSet& prevSet = prev->m_floatingObjects->set(); 3703 FloatingObjectSetIterator prevEnd = prevSet.end(); 3704 for (FloatingObjectSetIterator prevIt = prevSet.begin(); prevIt != prevEnd; ++prevIt) { 3685 3705 FloatingObject* r = *prevIt; 3686 3706 if (logicalBottomForFloat(r) > logicalTopOffset) { 3687 if (!m_floatingObjects || !m_floatingObjects-> contains(r)) {3707 if (!m_floatingObjects || !m_floatingObjects->set().contains(r)) { 3688 3708 int leftOffset = style()->isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset; 3689 3709 int topOffset = style()->isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset; … … 3708 3728 // We create the floating object list lazily. 3709 3729 if (!m_floatingObjects) 3710 m_floatingObjects = adoptPtr(new FloatingObjectSet); 3711 m_floatingObjects->add(floatingObj); 3730 m_floatingObjects = adoptPtr(new FloatingObjects); 3731 m_floatingObjects->increaseObjectsCount(floatingObj->type()); 3732 m_floatingObjects->set().add(floatingObj); 3712 3733 } 3713 3734 } … … 3723 3744 bool RenderBlock::containsFloat(RenderBox* renderer) 3724 3745 { 3725 return m_floatingObjects && m_floatingObjects-> contains<RenderBox*, FloatingObjectHashTranslator>(renderer);3746 return m_floatingObjects && m_floatingObjects->set().contains<RenderBox*, FloatingObjectHashTranslator>(renderer); 3726 3747 } 3727 3748 … … 3881 3902 } 3882 3903 3883 FloatingObjectSetIterator begin = m_floatingObjects->begin(); 3884 for (FloatingObjectSetIterator it = m_floatingObjects->end(); it != begin;) { 3904 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3905 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 3906 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { 3885 3907 --it; 3886 3908 FloatingObject* floatingObject = *it; … … 5509 5531 5510 5532 if (m_floatingObjects) { 5511 FloatingObjectSetIterator end = m_floatingObjects->end(); 5512 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 5533 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 5534 FloatingObjectSetIterator end = floatingObjectSet.end(); 5535 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 5513 5536 FloatingObject* r = *it; 5514 5537 // Only examine the object if our m_shouldPaint flag is set. … … 6218 6241 } 6219 6242 6243 inline void RenderBlock::FloatingObjects::clear() 6244 { 6245 m_set.clear(); 6246 m_leftObjectsCount = 0; 6247 m_rightObjectsCount = 0; 6248 } 6249 6250 inline void RenderBlock::FloatingObjects::increaseObjectsCount(FloatingObject::Type type) 6251 { 6252 if (type == FloatingObject::FloatLeft) 6253 m_leftObjectsCount++; 6254 else 6255 m_rightObjectsCount++; 6256 } 6257 6258 inline void RenderBlock::FloatingObjects::decreaseObjectsCount(FloatingObject::Type type) 6259 { 6260 if (type == FloatingObject::FloatLeft) 6261 m_leftObjectsCount--; 6262 else 6263 m_rightObjectsCount--; 6264 } 6265 6220 6266 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderBlock.h
r80015 r80380 96 96 virtual void markForPaginationRelayoutIfNeeded(); 97 97 98 bool containsFloats() { return m_floatingObjects && !m_floatingObjects-> isEmpty(); }98 bool containsFloats() { return m_floatingObjects && !m_floatingObjects->set().isEmpty(); } 99 99 bool containsFloat(RenderBox*); 100 100 … … 713 713 typedef ListHashSet<FloatingObject*, 4, FloatingObjectHashFunctions> FloatingObjectSet; 714 714 typedef FloatingObjectSet::const_iterator FloatingObjectSetIterator; 715 OwnPtr<FloatingObjectSet> m_floatingObjects; 715 class FloatingObjects { 716 public: 717 FloatingObjects() 718 : m_leftObjectsCount(0) 719 , m_rightObjectsCount(0) 720 { 721 } 722 723 void clear(); 724 void increaseObjectsCount(FloatingObject::Type); 725 void decreaseObjectsCount(FloatingObject::Type); 726 bool hasLeftObjects() const { return m_leftObjectsCount > 0; } 727 bool hasRightObjects() const { return m_rightObjectsCount > 0; } 728 FloatingObjectSet& set() { return m_set; } 729 730 private: 731 FloatingObjectSet m_set; 732 unsigned m_leftObjectsCount; 733 unsigned m_rightObjectsCount; 734 }; 735 OwnPtr<FloatingObjects> m_floatingObjects; 716 736 717 737 typedef PositionedObjectsListHashSet::const_iterator Iterator; -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r80288 r80380 619 619 } 620 620 621 FloatingObject* lastFloat = (m_floatingObjects && !m_floatingObjects-> isEmpty()) ? m_floatingObjects->last() : 0;621 FloatingObject* lastFloat = (m_floatingObjects && !m_floatingObjects->set().isEmpty()) ? m_floatingObjects->set().last() : 0; 622 622 623 623 LineMidpointState& lineMidpointState = resolver.midpointState(); … … 689 689 690 690 InlineIterator oldEnd = end; 691 FloatingObject* lastFloatFromPreviousLine = (m_floatingObjects && !m_floatingObjects-> isEmpty()) ? m_floatingObjects->last() : 0;691 FloatingObject* lastFloatFromPreviousLine = (m_floatingObjects && !m_floatingObjects->set().isEmpty()) ? m_floatingObjects->set().last() : 0; 692 692 end = findNextLineBreak(resolver, firstLine, isLineEmpty, lineBreakIteratorInfo, previousLineBrokeCleanly, hyphenated, &clear, lastFloatFromPreviousLine); 693 693 if (resolver.position().atEnd()) { … … 840 840 841 841 if (m_floatingObjects && lastRootBox()) { 842 FloatingObjectSetIterator it = m_floatingObjects->begin(); 843 FloatingObjectSetIterator end = m_floatingObjects->end(); 842 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 843 FloatingObjectSetIterator it = floatingObjectSet.begin(); 844 FloatingObjectSetIterator end = floatingObjectSet.end(); 844 845 if (lastFloat) { 845 FloatingObjectSetIterator lastFloatIterator = m_floatingObjects->find(lastFloat);846 FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.find(lastFloat); 846 847 ASSERT(lastFloatIterator != end); 847 848 ++lastFloatIterator; … … 857 858 floatIndex++; 858 859 } 859 lastFloat = ! m_floatingObjects->isEmpty() ? m_floatingObjects->last() : 0;860 lastFloat = !floatingObjectSet.isEmpty() ? floatingObjectSet.last() : 0; 860 861 } 861 862 … … 921 922 } 922 923 923 FloatingObjectSetIterator it = m_floatingObjects->begin(); 924 FloatingObjectSetIterator end = m_floatingObjects->end(); 924 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 925 FloatingObjectSetIterator it = floatingObjectSet.begin(); 926 FloatingObjectSetIterator end = floatingObjectSet.end(); 925 927 if (lastFloat) { 926 FloatingObjectSetIterator lastFloatIterator = m_floatingObjects->find(lastFloat);928 FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.find(lastFloat); 927 929 ASSERT(lastFloatIterator != end); 928 930 ++lastFloatIterator; … … 931 933 for (; it != end; ++it) 932 934 lastRootBox()->floats().append((*it)->m_renderer); 933 lastFloat = ! m_floatingObjects->isEmpty() ? m_floatingObjects->last() : 0;935 lastFloat = !floatingObjectSet.isEmpty() ? floatingObjectSet.last() : 0; 934 936 } 935 937 size_t floatCount = floats.size(); … … 1168 1170 int logicalBottom = lastLine->blockLogicalHeight() + abs(delta); 1169 1171 1170 FloatingObjectSetIterator end = m_floatingObjects->end(); 1171 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 1172 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 1173 FloatingObjectSetIterator end = floatingObjectSet.end(); 1174 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 1172 1175 FloatingObject* f = *it; 1173 1176 if (logicalBottomForFloat(f) >= logicalTop && logicalBottomForFloat(f) < logicalBottom) … … 1204 1207 int logicalBottom = lastLine->blockLogicalHeight() + abs(delta); 1205 1208 1206 FloatingObjectSetIterator end = m_floatingObjects->end(); 1207 for (FloatingObjectSetIterator it = m_floatingObjects->begin(); it != end; ++it) { 1209 FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 1210 FloatingObjectSetIterator end = floatingObjectSet.end(); 1211 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 1208 1212 FloatingObject* f = *it; 1209 1213 if (logicalBottomForFloat(f) >= logicalTop && logicalBottomForFloat(f) < logicalBottom)
Note: See TracChangeset
for help on using the changeset viewer.