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

Side by Side Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 10203001: Merge 113825 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « LayoutTests/fast/block/float/intruding-float-not-removed-from-next-sibling-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4417 matching lines...) Expand 10 before | Expand all | Expand 10 after
4428 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats()) 4428 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats())
4429 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove, inLayout); 4429 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove, inLayout);
4430 } 4430 }
4431 } 4431 }
4432 } 4432 }
4433 4433
4434 void RenderBlock::markSiblingsWithFloatsForLayout(RenderBox* floatToRemove) 4434 void RenderBlock::markSiblingsWithFloatsForLayout(RenderBox* floatToRemove)
4435 { 4435 {
4436 if (!m_floatingObjects) 4436 if (!m_floatingObjects)
4437 return; 4437 return;
4438
4438 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 4439 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
4439 FloatingObjectSetIterator end = floatingObjectSet.end(); 4440 FloatingObjectSetIterator end = floatingObjectSet.end();
4440 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++ it) { 4441
4441 if (logicalBottomForFloat(*it) > logicalHeight()) { 4442 for (RenderObject* next = nextSibling(); next; next = next->nextSibling()) {
4443 if (!next->isRenderBlock() || next->isFloatingOrPositioned() || toRender Block(next)->avoidsFloats())
4444 continue;
4445
4446 RenderBlock* nextBlock = toRenderBlock(next);
4447 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end ; ++it) {
4442 RenderBox* floatingBox = (*it)->renderer(); 4448 RenderBox* floatingBox = (*it)->renderer();
4443 if (floatToRemove && floatingBox != floatToRemove) 4449 if (floatToRemove && floatingBox != floatToRemove)
4444 continue; 4450 continue;
4445 4451 if (nextBlock->containsFloat(floatingBox))
4446 RenderObject* next = nextSibling(); 4452 nextBlock->markAllDescendantsWithFloatsForLayout(floatingBox);
4447 while (next) {
4448 if (next->isRenderBlock() && !next->isFloatingOrPositioned() && !toRenderBlock(next)->avoidsFloats()) {
4449 RenderBlock* nextBlock = toRenderBlock(next);
4450 if (nextBlock->containsFloat(floatingBox))
4451 nextBlock->markAllDescendantsWithFloatsForLayout(floatin gBox);
4452 else
4453 break;
4454 }
4455
4456 next = next->nextSibling();
4457 }
4458 } 4453 }
4459 } 4454 }
4460 } 4455 }
4461 4456
4462 LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop) 4457 LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop)
4463 { 4458 {
4464 // There is no need to compute clearance if we have no floats. 4459 // There is no need to compute clearance if we have no floats.
4465 if (!containsFloats()) 4460 if (!containsFloats())
4466 return 0; 4461 return 0;
4467 4462
(...skipping 2975 matching lines...) Expand 10 before | Expand all | Expand 10 after
7443 } 7438 }
7444 7439
7445 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7440 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7446 { 7441 {
7447 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7442 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7448 } 7443 }
7449 7444
7450 #endif 7445 #endif
7451 7446
7452 } // namespace WebCore 7447 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/block/float/intruding-float-not-removed-from-next-sibling-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698