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