OLD | NEW |
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 4033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4044 for (RenderObject* child = firstChild(); child; child = child->nextSibli
ng()) { | 4044 for (RenderObject* child = firstChild(); child; child = child->nextSibli
ng()) { |
4045 if ((!floatToRemove && child->isFloatingOrPositioned()) || !child->i
sRenderBlock()) | 4045 if ((!floatToRemove && child->isFloatingOrPositioned()) || !child->i
sRenderBlock()) |
4046 continue; | 4046 continue; |
4047 RenderBlock* childBlock = toRenderBlock(child); | 4047 RenderBlock* childBlock = toRenderBlock(child); |
4048 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil
dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats()) | 4048 if ((floatToRemove ? childBlock->containsFloat(floatToRemove) : chil
dBlock->containsFloats()) || childBlock->shrinkToAvoidFloats()) |
4049 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove,
inLayout); | 4049 childBlock->markAllDescendantsWithFloatsForLayout(floatToRemove,
inLayout); |
4050 } | 4050 } |
4051 } | 4051 } |
4052 } | 4052 } |
4053 | 4053 |
4054 void RenderBlock::markSiblingsWithFloatsForLayout() | 4054 void RenderBlock::markSiblingsWithFloatsForLayout(RenderBox* floatToRemove) |
4055 { | 4055 { |
| 4056 if (!m_floatingObjects) |
| 4057 return; |
4056 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 4058 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
4057 FloatingObjectSetIterator end = floatingObjectSet.end(); | 4059 FloatingObjectSetIterator end = floatingObjectSet.end(); |
4058 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { | 4060 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { |
4059 if (logicalBottomForFloat(*it) > logicalHeight()) { | 4061 if (logicalBottomForFloat(*it) > logicalHeight()) { |
4060 RenderBox* floatingBox = (*it)->renderer(); | 4062 RenderBox* floatingBox = (*it)->renderer(); |
| 4063 if (floatToRemove && floatingBox != floatToRemove) |
| 4064 continue; |
4061 | 4065 |
4062 RenderObject* next = nextSibling(); | 4066 RenderObject* next = nextSibling(); |
4063 while (next) { | 4067 while (next) { |
4064 if (next->isRenderBlock() && !next->isFloatingOrPositioned() &&
!toRenderBlock(next)->avoidsFloats()) { | 4068 if (next->isRenderBlock() && !next->isFloatingOrPositioned() &&
!toRenderBlock(next)->avoidsFloats()) { |
4065 RenderBlock* nextBlock = toRenderBlock(next); | 4069 RenderBlock* nextBlock = toRenderBlock(next); |
4066 if (nextBlock->containsFloat(floatingBox)) | 4070 if (nextBlock->containsFloat(floatingBox)) |
4067 nextBlock->markAllDescendantsWithFloatsForLayout(floatin
gBox); | 4071 nextBlock->markAllDescendantsWithFloatsForLayout(floatin
gBox); |
4068 else | 4072 else |
4069 break; | 4073 break; |
4070 } | 4074 } |
(...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7063 } | 7067 } |
7064 | 7068 |
7065 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 7069 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
7066 { | 7070 { |
7067 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); | 7071 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); |
7068 } | 7072 } |
7069 | 7073 |
7070 #endif | 7074 #endif |
7071 | 7075 |
7072 } // namespace WebCore | 7076 } // namespace WebCore |
OLD | NEW |