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 4110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4121 } | 4121 } |
4122 | 4122 |
4123 void RenderBlock::clearFloats(BlockLayoutPass layoutPass) | 4123 void RenderBlock::clearFloats(BlockLayoutPass layoutPass) |
4124 { | 4124 { |
4125 if (m_floatingObjects) | 4125 if (m_floatingObjects) |
4126 m_floatingObjects->setHorizontalWritingMode(isHorizontalWritingMode()); | 4126 m_floatingObjects->setHorizontalWritingMode(isHorizontalWritingMode()); |
4127 | 4127 |
4128 // Clear our positioned floats boolean. | 4128 // Clear our positioned floats boolean. |
4129 m_hasPositionedFloats = false; | 4129 m_hasPositionedFloats = false; |
4130 | 4130 |
4131 HashSet<RenderBox*> oldIntrudingFloatSet; | |
4132 if (!childrenInline() && m_floatingObjects) { | |
4133 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | |
4134 FloatingObjectSetIterator end = floatingObjectSet.end(); | |
4135 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end ; ++it) { | |
4136 FloatingObject* floatingObject = *it; | |
4137 if (!floatingObject->isDescendant()) | |
Hironori Bono
2012/04/23 00:29:15
It seems the M19 branch does not have RenderBlock:
| |
4138 oldIntrudingFloatSet.add(floatingObject->m_renderer); | |
4139 } | |
4140 } | |
4141 | |
4131 // Inline blocks are covered by the isReplaced() check in the avoidFloats me thod. | 4142 // Inline blocks are covered by the isReplaced() check in the avoidFloats me thod. |
4132 if (avoidsFloats() || isRoot() || isRenderView() || isFloatingOrPositioned() || isTableCell()) { | 4143 if (avoidsFloats() || isRoot() || isRenderView() || isFloatingOrPositioned() || isTableCell()) { |
4133 if (m_floatingObjects) { | 4144 if (m_floatingObjects) { |
4134 deleteAllValues(m_floatingObjects->set()); | 4145 deleteAllValues(m_floatingObjects->set()); |
4135 m_floatingObjects->clear(); | 4146 m_floatingObjects->clear(); |
4136 } | 4147 } |
4137 if (layoutPass == PositionedFloatLayoutPass) | 4148 if (layoutPass == PositionedFloatLayoutPass) |
4138 addPositionedFloats(); | 4149 addPositionedFloats(); |
4150 if (!oldIntrudingFloatSet.isEmpty()) | |
4151 markAllDescendantsWithFloatsForLayout(); | |
4139 return; | 4152 return; |
4140 } | 4153 } |
4141 | 4154 |
4142 typedef HashMap<RenderObject*, FloatingObject*> RendererToFloatInfoMap; | 4155 typedef HashMap<RenderObject*, FloatingObject*> RendererToFloatInfoMap; |
4143 RendererToFloatInfoMap floatMap; | 4156 RendererToFloatInfoMap floatMap; |
4144 | 4157 |
4145 if (m_floatingObjects) { | 4158 if (m_floatingObjects) { |
4146 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 4159 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
4147 if (childrenInline()) { | 4160 if (childrenInline()) { |
4148 FloatingObjectSetIterator end = floatingObjectSet.end(); | 4161 FloatingObjectSetIterator end = floatingObjectSet.end(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4239 for (RendererToFloatInfoMap::iterator it = floatMap.begin(); it != end; ++it) { | 4252 for (RendererToFloatInfoMap::iterator it = floatMap.begin(); it != end; ++it) { |
4240 FloatingObject* floatingObject = (*it).second; | 4253 FloatingObject* floatingObject = (*it).second; |
4241 if (!floatingObject->m_isDescendant) { | 4254 if (!floatingObject->m_isDescendant) { |
4242 changeLogicalTop = 0; | 4255 changeLogicalTop = 0; |
4243 changeLogicalBottom = max(changeLogicalBottom, logicalBottomForF loat(floatingObject)); | 4256 changeLogicalBottom = max(changeLogicalBottom, logicalBottomForF loat(floatingObject)); |
4244 } | 4257 } |
4245 } | 4258 } |
4246 deleteAllValues(floatMap); | 4259 deleteAllValues(floatMap); |
4247 | 4260 |
4248 markLinesDirtyInBlockRange(changeLogicalTop, changeLogicalBottom); | 4261 markLinesDirtyInBlockRange(changeLogicalTop, changeLogicalBottom); |
4262 } else if (!oldIntrudingFloatSet.isEmpty()) { | |
4263 // If there are previously intruding floats that no longer intrude, then children with floats | |
4264 // should also get layout because they might need their floating object lists cleared. | |
4265 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | |
4266 FloatingObjectSetIterator end = floatingObjectSet.end(); | |
4267 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end ; ++it) | |
4268 oldIntrudingFloatSet.remove((*it)->m_renderer); | |
4269 if (!oldIntrudingFloatSet.isEmpty()) | |
4270 markAllDescendantsWithFloatsForLayout(); | |
4249 } | 4271 } |
4250 } | 4272 } |
4251 | 4273 |
4252 LayoutUnit RenderBlock::addOverhangingFloats(RenderBlock* child, bool makeChildP aintOtherFloats) | 4274 LayoutUnit RenderBlock::addOverhangingFloats(RenderBlock* child, bool makeChildP aintOtherFloats) |
4253 { | 4275 { |
4254 // Prevent floats from being added to the canvas by the root element, e.g., <html>. | 4276 // Prevent floats from being added to the canvas by the root element, e.g., <html>. |
4255 if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot() || child->hasColumns() || child->isWritingModeRoot()) | 4277 if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot() || child->hasColumns() || child->isWritingModeRoot()) |
4256 return 0; | 4278 return 0; |
4257 | 4279 |
4258 LayoutUnit childLogicalTop = child->logicalTop(); | 4280 LayoutUnit childLogicalTop = child->logicalTop(); |
(...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7414 } | 7436 } |
7415 | 7437 |
7416 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) | 7438 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) |
7417 { | 7439 { |
7418 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); | 7440 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); |
7419 } | 7441 } |
7420 | 7442 |
7421 #endif | 7443 #endif |
7422 | 7444 |
7423 } // namespace WebCore | 7445 } // namespace WebCore |
OLD | NEW |