Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2725343002: Migrate WTF::LinkedHashSet/ListHashSet::last() to ::back() (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3579 matching lines...) Expand 10 before | Expand all | Expand 10 after
3590 } 3590 }
3591 } 3591 }
3592 } 3592 }
3593 3593
3594 void LayoutBlockFlow::removeFloatingObjectsBelow(FloatingObject* lastFloat, 3594 void LayoutBlockFlow::removeFloatingObjectsBelow(FloatingObject* lastFloat,
3595 LayoutUnit logicalOffset) { 3595 LayoutUnit logicalOffset) {
3596 if (!containsFloats()) 3596 if (!containsFloats())
3597 return; 3597 return;
3598 3598
3599 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3599 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
3600 FloatingObject* curr = floatingObjectSet.last().get(); 3600 FloatingObject* curr = floatingObjectSet.back().get();
3601 while (curr != lastFloat && 3601 while (curr != lastFloat &&
3602 (!curr->isPlaced() || logicalTopForFloat(*curr) >= logicalOffset)) { 3602 (!curr->isPlaced() || logicalTopForFloat(*curr) >= logicalOffset)) {
3603 m_floatingObjects->remove(curr); 3603 m_floatingObjects->remove(curr);
3604 if (floatingObjectSet.isEmpty()) 3604 if (floatingObjectSet.isEmpty())
3605 break; 3605 break;
3606 curr = floatingObjectSet.last().get(); 3606 curr = floatingObjectSet.back().get();
3607 } 3607 }
3608 } 3608 }
3609 3609
3610 bool LayoutBlockFlow::placeNewFloats(LayoutUnit logicalTopMarginEdge, 3610 bool LayoutBlockFlow::placeNewFloats(LayoutUnit logicalTopMarginEdge,
3611 LineWidth* width) { 3611 LineWidth* width) {
3612 if (!m_floatingObjects) 3612 if (!m_floatingObjects)
3613 return false; 3613 return false;
3614 3614
3615 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3615 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
3616 if (floatingObjectSet.isEmpty()) 3616 if (floatingObjectSet.isEmpty())
3617 return false; 3617 return false;
3618 3618
3619 // If all floats have already been positioned, then we have no work to do. 3619 // If all floats have already been positioned, then we have no work to do.
3620 if (floatingObjectSet.last()->isPlaced()) 3620 if (floatingObjectSet.back()->isPlaced())
3621 return false; 3621 return false;
3622 3622
3623 // Move backwards through our floating object list until we find a float that 3623 // Move backwards through our floating object list until we find a float that
3624 // has already been positioned. Then we'll be able to move forward, 3624 // has already been positioned. Then we'll be able to move forward,
3625 // positioning all of the new floats that need it. 3625 // positioning all of the new floats that need it.
3626 FloatingObjectSetIterator it = floatingObjectSet.end(); 3626 FloatingObjectSetIterator it = floatingObjectSet.end();
3627 --it; // Go to last item. 3627 --it; // Go to last item.
3628 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 3628 FloatingObjectSetIterator begin = floatingObjectSet.begin();
3629 FloatingObject* lastPlacedFloatingObject = nullptr; 3629 FloatingObject* lastPlacedFloatingObject = nullptr;
3630 while (it != begin) { 3630 while (it != begin) {
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4606 } 4606 }
4607 4607
4608 void LayoutBlockFlow::invalidateDisplayItemClients( 4608 void LayoutBlockFlow::invalidateDisplayItemClients(
4609 PaintInvalidationReason invalidationReason) const { 4609 PaintInvalidationReason invalidationReason) const {
4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4611 invalidationReason); 4611 invalidationReason);
4612 } 4612 }
4613 4613
4614 } // namespace blink 4614 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698