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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 416 |
417 // Create a new anonymous box of the appropriate type. | 417 // Create a new anonymous box of the appropriate type. |
418 RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock
() : createAnonymousColumnsBlock(); | 418 RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock
() : createAnonymousColumnsBlock(); |
419 children()->insertChildNode(this, newBox, newBeforeChild); | 419 children()->insertChildNode(this, newBox, newBeforeChild); |
420 newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0); | 420 newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0); |
421 return; | 421 return; |
422 } | 422 } |
423 | 423 |
424 RenderBlock* RenderBlock::containingColumnsBlock(bool allowAnonymousColumnBlock) | 424 RenderBlock* RenderBlock::containingColumnsBlock(bool allowAnonymousColumnBlock) |
425 { | 425 { |
| 426 RenderBlock* firstChildIgnoringAnonymousWrappers = 0; |
426 for (RenderObject* curr = this; curr; curr = curr->parent()) { | 427 for (RenderObject* curr = this; curr; curr = curr->parent()) { |
427 if (!curr->isRenderBlock() || curr->isFloatingOrPositioned() || curr->is
TableCell() || curr->isRoot() || curr->isRenderView() || curr->hasOverflowClip() | 428 if (!curr->isRenderBlock() || curr->isFloatingOrPositioned() || curr->is
TableCell() || curr->isRoot() || curr->isRenderView() || curr->hasOverflowClip() |
428 || curr->isInlineBlockOrInlineTable()) | 429 || curr->isInlineBlockOrInlineTable()) |
429 return 0; | 430 return 0; |
430 | 431 |
431 RenderBlock* currBlock = toRenderBlock(curr); | 432 RenderBlock* currBlock = toRenderBlock(curr); |
| 433 if (!currBlock->createsAnonymousWrapper()) |
| 434 firstChildIgnoringAnonymousWrappers = currBlock; |
| 435 |
432 if (currBlock->style()->specifiesColumns() && (allowAnonymousColumnBlock
|| !currBlock->isAnonymousColumnsBlock())) | 436 if (currBlock->style()->specifiesColumns() && (allowAnonymousColumnBlock
|| !currBlock->isAnonymousColumnsBlock())) |
433 return currBlock; | 437 return firstChildIgnoringAnonymousWrappers; |
434 | 438 |
435 if (currBlock->isAnonymousColumnSpanBlock()) | 439 if (currBlock->isAnonymousColumnSpanBlock()) |
436 return 0; | 440 return 0; |
437 } | 441 } |
438 return 0; | 442 return 0; |
439 } | 443 } |
440 | 444 |
441 RenderBlock* RenderBlock::clone() const | 445 RenderBlock* RenderBlock::clone() const |
442 { | 446 { |
443 RenderBlock* cloneBlock; | 447 RenderBlock* cloneBlock; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 // FIXME: This function is the gateway for the addition of column-span suppo
rt. It will | 664 // FIXME: This function is the gateway for the addition of column-span suppo
rt. It will |
661 // be added to in three stages: | 665 // be added to in three stages: |
662 // (1) Immediate children of a multi-column block can span. | 666 // (1) Immediate children of a multi-column block can span. |
663 // (2) Nested block-level children with only block-level ancestors between t
hem and the multi-column block can span. | 667 // (2) Nested block-level children with only block-level ancestors between t
hem and the multi-column block can span. |
664 // (3) Nested children with block or inline ancestors between them and the m
ulti-column block can span (this is when we | 668 // (3) Nested children with block or inline ancestors between them and the m
ulti-column block can span (this is when we |
665 // cross the streams and have to cope with both types of continuations mixed
together). | 669 // cross the streams and have to cope with both types of continuations mixed
together). |
666 // This function currently supports (1) and (2). | 670 // This function currently supports (1) and (2). |
667 RenderBlock* columnsBlockAncestor = 0; | 671 RenderBlock* columnsBlockAncestor = 0; |
668 if (!newChild->isText() && newChild->style()->columnSpan() && !newChild->isB
eforeOrAfterContent() | 672 if (!newChild->isText() && newChild->style()->columnSpan() && !newChild->isB
eforeOrAfterContent() |
669 && !newChild->isFloatingOrPositioned() && !newChild->isInline() && !isAn
onymousColumnSpanBlock()) { | 673 && !newChild->isFloatingOrPositioned() && !newChild->isInline() && !isAn
onymousColumnSpanBlock()) { |
670 if (style()->specifiesColumns()) | 674 columnsBlockAncestor = containingColumnsBlock(false); |
671 columnsBlockAncestor = this; | 675 if (columnsBlockAncestor) { |
672 else if (!isInline() && parent() && parent()->isRenderBlock()) { | 676 // Make sure that none of the parent ancestors have a continuation. |
673 columnsBlockAncestor = toRenderBlock(parent())->containingColumnsBlo
ck(false); | 677 // If yes, we do not want split the block into continuations. |
674 | 678 RenderObject* curr = this; |
675 if (columnsBlockAncestor) { | 679 while (curr && curr != columnsBlockAncestor) { |
676 // Make sure that none of the parent ancestors have a continuati
on. | 680 if (curr->isRenderBlock() && toRenderBlock(curr)->continuation()
) { |
677 // If yes, we do not want split the block into continuations. | 681 columnsBlockAncestor = 0; |
678 RenderObject* curr = this; | 682 break; |
679 while (curr && curr != columnsBlockAncestor) { | |
680 if (curr->isRenderBlock() && toRenderBlock(curr)->continuati
on()) { | |
681 columnsBlockAncestor = 0; | |
682 break; | |
683 } | |
684 curr = curr->parent(); | |
685 } | 683 } |
| 684 curr = curr->parent(); |
686 } | 685 } |
687 } | 686 } |
688 } | 687 } |
689 return columnsBlockAncestor; | 688 return columnsBlockAncestor; |
690 } | 689 } |
691 | 690 |
692 void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
RenderObject* beforeChild) | 691 void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
RenderObject* beforeChild) |
693 { | 692 { |
694 // Make sure we don't append things after :after-generated content if we hav
e it. | 693 // Make sure we don't append things after :after-generated content if we hav
e it. |
695 if (!beforeChild) | 694 if (!beforeChild) |
(...skipping 6381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7077 } | 7076 } |
7078 | 7077 |
7079 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 7078 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
7080 { | 7079 { |
7081 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); | 7080 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); |
7082 } | 7081 } |
7083 | 7082 |
7084 #endif | 7083 #endif |
7085 | 7084 |
7086 } // namespace WebCore | 7085 } // namespace WebCore |
OLD | NEW |