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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout() | 703 void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout() |
704 { | 704 { |
705 ASSERT(hasLayer()); | 705 ASSERT(hasLayer()); |
706 toRenderBoxModelObject(this)->layer()->setRepaintStatus(NeedsFullRepaintForP
ositionedMovementLayout); | 706 toRenderBoxModelObject(this)->layer()->setRepaintStatus(NeedsFullRepaintForP
ositionedMovementLayout); |
707 } | 707 } |
708 | 708 |
709 RenderBlock* RenderObject::containingBlock() const | 709 RenderBlock* RenderObject::containingBlock() const |
710 { | 710 { |
711 RenderObject* o = parent(); | 711 RenderObject* o = parent(); |
712 if (!isText() && m_style->position() == FixedPosition) { | 712 if (!isText() && m_style->position() == FixedPosition) { |
713 while (o && !o->isRenderView() && !(o->hasTransform() && o->isRenderBloc
k())) { | 713 while (o) { |
| 714 if (o->isRenderView()) |
| 715 break; |
| 716 if (o->hasTransform() && o->isRenderBlock()) |
| 717 break; |
714 #if ENABLE(SVG) | 718 #if ENABLE(SVG) |
715 // foreignObject is the containing block for its contents. | 719 // foreignObject is the containing block for its contents. |
716 if (o->isSVGForeignObject()) | 720 if (o->isSVGForeignObject()) |
717 break; | 721 break; |
718 #endif | 722 #endif |
719 o = o->parent(); | 723 o = o->parent(); |
720 } | 724 } |
| 725 ASSERT(!o->isAnonymousBlock()); |
721 } else if (!isText() && m_style->position() == AbsolutePosition) { | 726 } else if (!isText() && m_style->position() == AbsolutePosition) { |
722 while (o && (o->style()->position() == StaticPosition || (o->isInline()
&& !o->isReplaced())) && !o->isRenderView() && !(o->hasTransform() && o->isRende
rBlock())) { | 727 while (o) { |
723 // For relpositioned inlines, we return the nearest non-anonymous en
closing block. We don't try | 728 // For relpositioned inlines, we return the nearest non-anonymous en
closing block. We don't try |
724 // to return the inline itself. This allows us to avoid having a po
sitioned objects | 729 // to return the inline itself. This allows us to avoid having a po
sitioned objects |
725 // list in all RenderInlines and lets us return a strongly-typed Ren
derBlock* result | 730 // list in all RenderInlines and lets us return a strongly-typed Ren
derBlock* result |
726 // from this method. The container() method can actually be used to
obtain the | 731 // from this method. The container() method can actually be used to
obtain the |
727 // inline directly. | 732 // inline directly. |
| 733 if (!o->style()->position() == StaticPosition && !(o->isInline() &&
!o->isReplaced())) |
| 734 break; |
| 735 if (o->isRenderView()) |
| 736 break; |
| 737 if (o->hasTransform() && o->isRenderBlock()) |
| 738 break; |
| 739 |
728 if (o->style()->position() == RelativePosition && o->isInline() && !
o->isReplaced()) { | 740 if (o->style()->position() == RelativePosition && o->isInline() && !
o->isReplaced()) { |
729 RenderBlock* relPositionedInlineContainingBlock = o->containingB
lock(); | 741 o = o->containingBlock(); |
730 while (relPositionedInlineContainingBlock->isAnonymousBlock()) | 742 break; |
731 relPositionedInlineContainingBlock = relPositionedInlineCont
ainingBlock->containingBlock(); | |
732 return relPositionedInlineContainingBlock; | |
733 } | 743 } |
734 #if ENABLE(SVG) | 744 #if ENABLE(SVG) |
735 if (o->isSVGForeignObject()) //foreignObject is the containing block
for contents inside it | 745 if (o->isSVGForeignObject()) //foreignObject is the containing block
for contents inside it |
736 break; | 746 break; |
737 #endif | 747 #endif |
738 | 748 |
739 o = o->parent(); | 749 o = o->parent(); |
740 } | 750 } |
| 751 |
| 752 while (o && o->isAnonymousBlock()) |
| 753 o = o->containingBlock(); |
741 } else { | 754 } else { |
742 while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock())
) | 755 while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock())
) |
743 o = o->parent(); | 756 o = o->parent(); |
744 } | 757 } |
745 | 758 |
746 if (!o || !o->isRenderBlock()) | 759 if (!o || !o->isRenderBlock()) |
747 return 0; // This can still happen in case of an orphaned tree | 760 return 0; // This can still happen in case of an orphaned tree |
748 | 761 |
749 return toRenderBlock(o); | 762 return toRenderBlock(o); |
750 } | 763 } |
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2974 { | 2987 { |
2975 if (object1) { | 2988 if (object1) { |
2976 const WebCore::RenderObject* root = object1; | 2989 const WebCore::RenderObject* root = object1; |
2977 while (root->parent()) | 2990 while (root->parent()) |
2978 root = root->parent(); | 2991 root = root->parent(); |
2979 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 2992 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
2980 } | 2993 } |
2981 } | 2994 } |
2982 | 2995 |
2983 #endif | 2996 #endif |
OLD | NEW |