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

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

Issue 10533113: Merge 119914 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 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/svg/foreignObject/fixed-position-expected.svg ('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) 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
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 && !o->isRenderView() && !(o->hasTransform() && o->isRenderBloc k())) {
714 #if ENABLE(SVG)
715 // foreignObject is the containing block for its contents.
716 if (o->isSVGForeignObject())
717 break;
718 #endif
714 o = o->parent(); 719 o = o->parent();
720 }
715 } else if (!isText() && m_style->position() == AbsolutePosition) { 721 } else if (!isText() && m_style->position() == AbsolutePosition) {
716 while (o && (o->style()->position() == StaticPosition || (o->isInline() && !o->isReplaced())) && !o->isRenderView() && !(o->hasTransform() && o->isRende rBlock())) { 722 while (o && (o->style()->position() == StaticPosition || (o->isInline() && !o->isReplaced())) && !o->isRenderView() && !(o->hasTransform() && o->isRende rBlock())) {
717 // For relpositioned inlines, we return the nearest non-anonymous en closing block. We don't try 723 // For relpositioned inlines, we return the nearest non-anonymous en closing block. We don't try
718 // to return the inline itself. This allows us to avoid having a po sitioned objects 724 // to return the inline itself. This allows us to avoid having a po sitioned objects
719 // list in all RenderInlines and lets us return a strongly-typed Ren derBlock* result 725 // list in all RenderInlines and lets us return a strongly-typed Ren derBlock* result
720 // from this method. The container() method can actually be used to obtain the 726 // from this method. The container() method can actually be used to obtain the
721 // inline directly. 727 // inline directly.
722 if (o->style()->position() == RelativePosition && o->isInline() && ! o->isReplaced()) { 728 if (o->style()->position() == RelativePosition && o->isInline() && ! o->isReplaced()) {
723 RenderBlock* relPositionedInlineContainingBlock = o->containingB lock(); 729 RenderBlock* relPositionedInlineContainingBlock = o->containingB lock();
724 while (relPositionedInlineContainingBlock->isAnonymousBlock()) 730 while (relPositionedInlineContainingBlock->isAnonymousBlock())
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
2239 // tree yet. We don't call view() since it will assert if it 2245 // tree yet. We don't call view() since it will assert if it
2240 // can't get back to the canvas. Instead we just walk as high up 2246 // can't get back to the canvas. Instead we just walk as high up
2241 // as we can. If we're in the tree, we'll get the root. If we 2247 // as we can. If we're in the tree, we'll get the root. If we
2242 // aren't we'll get the root of our little subtree (most likely 2248 // aren't we'll get the root of our little subtree (most likely
2243 // we'll just return 0). 2249 // we'll just return 0).
2244 // FIXME: The definition of view() has changed to not crawl up the rende r tree. It might 2250 // FIXME: The definition of view() has changed to not crawl up the rende r tree. It might
2245 // be safe now to use it. 2251 // be safe now to use it.
2246 while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) { 2252 while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) {
2247 if (repaintContainerSkipped && o == repaintContainer) 2253 if (repaintContainerSkipped && o == repaintContainer)
2248 *repaintContainerSkipped = true; 2254 *repaintContainerSkipped = true;
2255 #if ENABLE(SVG)
2256 // foreignObject is the containing block for its contents.
2257 if (o->isSVGForeignObject())
2258 break;
2259 #endif
2249 o = o->parent(); 2260 o = o->parent();
2250 } 2261 }
2251 } else if (pos == AbsolutePosition) { 2262 } else if (pos == AbsolutePosition) {
2252 // Same goes here. We technically just want our containing block, but 2263 // Same goes here. We technically just want our containing block, but
2253 // we may not have one if we're part of an uninstalled subtree. We'll 2264 // we may not have one if we're part of an uninstalled subtree. We'll
2254 // climb as high as we can though. 2265 // climb as high as we can though.
2255 while (o && o->style()->position() == StaticPosition && !o->isRenderView () && !(o->hasTransform() && o->isRenderBlock())) { 2266 while (o && o->style()->position() == StaticPosition && !o->isRenderView () && !(o->hasTransform() && o->isRenderBlock())) {
2256 if (repaintContainerSkipped && o == repaintContainer) 2267 if (repaintContainerSkipped && o == repaintContainer)
2257 *repaintContainerSkipped = true; 2268 *repaintContainerSkipped = true;
2258 #if ENABLE(SVG) 2269 #if ENABLE(SVG)
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 { 2974 {
2964 if (object1) { 2975 if (object1) {
2965 const WebCore::RenderObject* root = object1; 2976 const WebCore::RenderObject* root = object1;
2966 while (root->parent()) 2977 while (root->parent())
2967 root = root->parent(); 2978 root = root->parent();
2968 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 2979 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
2969 } 2980 }
2970 } 2981 }
2971 2982
2972 #endif 2983 #endif
OLDNEW
« no previous file with comments | « LayoutTests/svg/foreignObject/fixed-position-expected.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698