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

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

Issue 9570040: Merge 109140 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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/multicol/span/before-child-anonymous-column-block-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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild); 374 beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild);
375 } 375 }
376 376
377 377
378 void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, Render Object* beforeChild) 378 void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, Render Object* beforeChild)
379 { 379 {
380 ASSERT(!continuation()); // We don't yet support column spans that aren't im mediate children of the multi-column block. 380 ASSERT(!continuation()); // We don't yet support column spans that aren't im mediate children of the multi-column block.
381 381
382 // The goal is to locate a suitable box in which to place our child. 382 // The goal is to locate a suitable box in which to place our child.
383 RenderBlock* beforeChildParent = toRenderBlock(beforeChild && beforeChild->p arent()->isRenderBlock() ? beforeChild->parent() : lastChild()); 383 RenderBlock* beforeChildParent = 0;
384 384 if (beforeChild) {
385 RenderObject* curr = beforeChild;
386 while (curr && curr->parent() != this)
387 curr = curr->parent();
388 beforeChildParent = toRenderBlock(curr);
389 ASSERT(beforeChildParent);
390 ASSERT(beforeChildParent->isAnonymousColumnsBlock() || beforeChildParent ->isAnonymousColumnSpanBlock());
391 } else
392 beforeChildParent = toRenderBlock(lastChild());
393
385 // If the new child is floating or positioned it can just go in that block. 394 // If the new child is floating or positioned it can just go in that block.
386 if (newChild->isFloatingOrPositioned()) { 395 if (newChild->isFloatingOrPositioned()) {
387 beforeChildParent->addChildIgnoringAnonymousColumnBlocks(newChild, befor eChild); 396 beforeChildParent->addChildIgnoringAnonymousColumnBlocks(newChild, befor eChild);
388 return; 397 return;
389 } 398 }
390 399
391 // See if the child can be placed in the box. 400 // See if the child can be placed in the box.
392 bool newChildHasColumnSpan = newChild->style()->columnSpan() && !newChild->i sInline(); 401 bool newChildHasColumnSpan = newChild->style()->columnSpan() && !newChild->i sInline();
393 bool beforeChildParentHoldsColumnSpans = beforeChildParent->isAnonymousColum nSpanBlock(); 402 bool beforeChildParentHoldsColumnSpans = beforeChildParent->isAnonymousColum nSpanBlock();
394 403
(...skipping 6814 matching lines...) Expand 10 before | Expand all | Expand 10 after
7209 } 7218 }
7210 7219
7211 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7220 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7212 { 7221 {
7213 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7222 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7214 } 7223 }
7215 7224
7216 #endif 7225 #endif
7217 7226
7218 } // namespace WebCore 7227 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/span/before-child-anonymous-column-block-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698