| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 } | 449 } |
| 450 | 450 |
| 451 RenderBlock* RenderBlock::clone() const | 451 RenderBlock* RenderBlock::clone() const |
| 452 { | 452 { |
| 453 RenderBlock* cloneBlock; | 453 RenderBlock* cloneBlock; |
| 454 if (isAnonymousBlock()) { | 454 if (isAnonymousBlock()) { |
| 455 cloneBlock = createAnonymousBlock(); | 455 cloneBlock = createAnonymousBlock(); |
| 456 cloneBlock->setChildrenInline(childrenInline()); | 456 cloneBlock->setChildrenInline(childrenInline()); |
| 457 } | 457 } |
| 458 else { | 458 else { |
| 459 cloneBlock = new (renderArena()) RenderBlock(node()); | 459 RenderObject* cloneRenderer = node()->createRenderer(renderArena(), styl
e()); |
| 460 cloneBlock = toRenderBlock(cloneRenderer); |
| 460 cloneBlock->setStyle(style()); | 461 cloneBlock->setStyle(style()); |
| 461 | 462 |
| 462 // This takes care of setting the right value of childrenInline in case | 463 // This takes care of setting the right value of childrenInline in case |
| 463 // generated content is added to cloneBlock and 'this' does not have | 464 // generated content is added to cloneBlock and 'this' does not have |
| 464 // generated content added yet. | 465 // generated content added yet. |
| 465 cloneBlock->setChildrenInline(cloneBlock->firstChild() ? cloneBlock->fir
stChild()->isInline() : childrenInline()); | 466 cloneBlock->setChildrenInline(cloneBlock->firstChild() ? cloneBlock->fir
stChild()->isInline() : childrenInline()); |
| 466 } | 467 } |
| 467 return cloneBlock; | 468 return cloneBlock; |
| 468 } | 469 } |
| 469 | 470 |
| 470 void RenderBlock::splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, | 471 void RenderBlock::splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, |
| 471 RenderBlock* middleBlock, | 472 RenderBlock* middleBlock, |
| 472 RenderObject* beforeChild, RenderBoxModelObject* o
ldCont) | 473 RenderObject* beforeChild, RenderBoxModelObject* o
ldCont) |
| 473 { | 474 { |
| 474 // Create a clone of this inline. | 475 // Create a clone of this inline. |
| 475 RenderBlock* cloneBlock = clone(); | 476 RenderBlock* cloneBlock = clone(); |
| 476 if (!isAnonymousBlock()) | 477 if (!isAnonymousBlock()) |
| 477 cloneBlock->setContinuation(oldCont); | 478 cloneBlock->setContinuation(oldCont); |
| 478 | 479 |
| 480 if (!beforeChild && isAfterContent(lastChild())) |
| 481 beforeChild = lastChild(); |
| 482 |
| 483 // If we are moving inline children from |this| to cloneBlock, then we need |
| 484 // to clear our line box tree. |
| 485 if (beforeChild && childrenInline()) |
| 486 deleteLineBoxTree(); |
| 487 |
| 479 // Now take all of the children from beforeChild to the end and remove | 488 // Now take all of the children from beforeChild to the end and remove |
| 480 // them from |this| and place them in the clone. | 489 // them from |this| and place them in the clone. |
| 481 if (!beforeChild && isAfterContent(lastChild())) | |
| 482 beforeChild = lastChild(); | |
| 483 moveChildrenTo(cloneBlock, beforeChild, 0, true); | 490 moveChildrenTo(cloneBlock, beforeChild, 0, true); |
| 484 | 491 |
| 485 // Hook |clone| up as the continuation of the middle block. | 492 // Hook |clone| up as the continuation of the middle block. |
| 486 if (!cloneBlock->isAnonymousBlock()) | 493 if (!cloneBlock->isAnonymousBlock()) |
| 487 middleBlock->setContinuation(cloneBlock); | 494 middleBlock->setContinuation(cloneBlock); |
| 488 | 495 |
| 489 // We have been reparented and are now under the fromBlock. We need | 496 // We have been reparented and are now under the fromBlock. We need |
| 490 // to walk up our block parent chain until we hit the containing anonymous c
olumns block. | 497 // to walk up our block parent chain until we hit the containing anonymous c
olumns block. |
| 491 // Once we hit the anonymous columns block we're done. | 498 // Once we hit the anonymous columns block we're done. |
| 492 RenderBoxModelObject* curr = toRenderBoxModelObject(parent()); | 499 RenderBoxModelObject* curr = toRenderBoxModelObject(parent()); |
| (...skipping 6670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7163 } | 7170 } |
| 7164 | 7171 |
| 7165 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 7172 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
| 7166 { | 7173 { |
| 7167 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); | 7174 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); |
| 7168 } | 7175 } |
| 7169 | 7176 |
| 7170 #endif | 7177 #endif |
| 7171 | 7178 |
| 7172 } // namespace WebCore | 7179 } // namespace WebCore |
| OLD | NEW |