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

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

Issue 10202001: Merge 113825 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
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 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after
4279 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats()) 4279 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats())
4280 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove, inLayout); 4280 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove, inLayout);
4281 } 4281 }
4282 } 4282 }
4283 } 4283 }
4284 4284
4285 void RenderBlock::markSiblingsWithFloatsForLayout(RenderBox* floatToRemove) 4285 void RenderBlock::markSiblingsWithFloatsForLayout(RenderBox* floatToRemove)
4286 { 4286 {
4287 if (!m_floatingObjects) 4287 if (!m_floatingObjects)
4288 return; 4288 return;
4289
4289 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 4290 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
4290 FloatingObjectSetIterator end = floatingObjectSet.end(); 4291 FloatingObjectSetIterator end = floatingObjectSet.end();
4291 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++ it) { 4292
4292 if (logicalBottomForFloat(*it) > logicalHeight()) { 4293 for (RenderObject* next = nextSibling(); next; next = next->nextSibling()) {
4294 if (!next->isRenderBlock() || next->isFloatingOrPositioned() || toRender Block(next)->avoidsFloats())
4295 continue;
4296
4297 RenderBlock* nextBlock = toRenderBlock(next);
4298 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end ; ++it) {
4293 RenderBox* floatingBox = (*it)->renderer(); 4299 RenderBox* floatingBox = (*it)->renderer();
4294 if (floatToRemove && floatingBox != floatToRemove) 4300 if (floatToRemove && floatingBox != floatToRemove)
4295 continue; 4301 continue;
4296 4302 if (nextBlock->containsFloat(floatingBox))
4297 RenderObject* next = nextSibling(); 4303 nextBlock->markAllDescendantsWithFloatsForLayout(floatingBox);
4298 while (next) {
4299 if (next->isRenderBlock() && !next->isFloatingOrPositioned() && !toRenderBlock(next)->avoidsFloats()) {
4300 RenderBlock* nextBlock = toRenderBlock(next);
4301 if (nextBlock->containsFloat(floatingBox))
4302 nextBlock->markAllDescendantsWithFloatsForLayout(floatin gBox);
4303 else
4304 break;
4305 }
4306
4307 next = next->nextSibling();
4308 }
4309 } 4304 }
4310 } 4305 }
4311 } 4306 }
4312 4307
4313 LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop) 4308 LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop)
4314 { 4309 {
4315 // There is no need to compute clearance if we have no floats. 4310 // There is no need to compute clearance if we have no floats.
4316 if (!containsFloats()) 4311 if (!containsFloats())
4317 return 0; 4312 return 0;
4318 4313
(...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after
7272 } 7267 }
7273 7268
7274 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7269 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7275 { 7270 {
7276 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7271 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7277 } 7272 }
7278 7273
7279 #endif 7274 #endif
7280 7275
7281 } // namespace WebCore 7276 } // 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