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

Unified Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 7200036: Merge 89165 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBlock.cpp
===================================================================
--- Source/WebCore/rendering/RenderBlock.cpp (revision 89285)
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -262,12 +262,33 @@
}
// After our style changed, if we lose our ability to propagate floats into next sibling
- // blocks, then we need to mark our descendants with floats for layout and clear all floats
- // from next sibling blocks that exist in our floating objects list. See bug 56299.
+ // blocks, then we need to find the top most parent containing that overhanging float and
+ // then mark its descendants with floats for layout and clear all floats from its next
+ // sibling blocks that exist in our floating objects list. See bug 56299 and 62875.
bool canPropagateFloatIntoSibling = !isFloatingOrPositioned() && !avoidsFloats();
if (diff == StyleDifferenceLayout && s_canPropagateFloatIntoSibling && !canPropagateFloatIntoSibling && hasOverhangingFloats()) {
- markAllDescendantsWithFloatsForLayout();
- markSiblingsWithFloatsForLayout();
+ RenderBlock* parentBlock = this;
+ FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+ FloatingObjectSetIterator end = floatingObjectSet.end();
+
+ for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) {
+ if (curr->isRenderBlock()) {
+ RenderBlock* currBlock = toRenderBlock(curr);
+
+ if (currBlock->hasOverhangingFloats()) {
+ for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
+ RenderBox* renderer = (*it)->renderer();
+ if (currBlock->hasOverhangingFloat(renderer)) {
+ parentBlock = currBlock;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ parentBlock->markAllDescendantsWithFloatsForLayout();
+ parentBlock->markSiblingsWithFloatsForLayout();
}
}
@@ -3741,6 +3762,19 @@
return lowestFloatLogicalBottom;
}
+bool RenderBlock::hasOverhangingFloat(RenderBox* renderer)
+{
+ if (!m_floatingObjects || hasColumns() || !parent())
+ return false;
+
+ FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+ FloatingObjectSetIterator it = floatingObjectSet.find<RenderBox*, FloatingObjectHashTranslator>(renderer);
+ if (it == floatingObjectSet.end())
+ return false;
+
+ return logicalBottomForFloat(*it) > logicalHeight();
+}
+
void RenderBlock::addIntrudingFloats(RenderBlock* prev, int logicalLeftOffset, int logicalTopOffset)
{
// If the parent or previous sibling doesn't have any floats to add, don't bother.
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698