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

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

Issue 179833006: Fix clippingContainer for fixed position elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderObject.h ('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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock()) ) 808 while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock()) )
809 o = o->parent(); 809 o = o->parent();
810 } 810 }
811 811
812 if (!o || !o->isRenderBlock()) 812 if (!o || !o->isRenderBlock())
813 return 0; // This can still happen in case of an orphaned tree 813 return 0; // This can still happen in case of an orphaned tree
814 814
815 return toRenderBlock(o); 815 return toRenderBlock(o);
816 } 816 }
817 817
818 RenderObject* RenderObject::clippingContainer() const 818 RenderObject* RenderObject::clippingContainer()
819 { 819 {
820 for (RenderObject* container = containingBlock(); container; container = con tainer->containingBlock()) { 820 RenderObject* container = this;
ojan 2014/02/26 20:55:27 Had to remove the const for this line. I think I c
821 while (container) {
822 if (container->style()->position() == FixedPosition) {
823 for (container = container->parent(); container && !container->canCo ntainFixedPositionObjects(); container = container->parent()) {
esprehn 2014/02/26 21:26:02 Is this right? Now if you run into something that
824 // CSS clip applies to fixed position elements even for ancestor s that are not what the
825 // fixed element is positioned with respect to.
826 if (container->hasClip())
827 return container;
828 }
829 } else {
830 container = container->containingBlock();
831 }
832
833 if (!container)
834 return 0;
821 if (container->hasClipOrOverflowClip()) 835 if (container->hasClipOrOverflowClip())
822 return container; 836 return container;
823 } 837 }
824 return 0; 838 return 0;
825 } 839 }
826 840
827 static bool mustRepaintFillLayers(const RenderObject* renderer, const FillLayer* layer) 841 static bool mustRepaintFillLayers(const RenderObject* renderer, const FillLayer* layer)
828 { 842 {
829 // Nobody will use multiple layers without wanting fancy positioning. 843 // Nobody will use multiple layers without wanting fancy positioning.
830 if (layer->next()) 844 if (layer->next())
(...skipping 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after
3339 { 3353 {
3340 if (object1) { 3354 if (object1) {
3341 const WebCore::RenderObject* root = object1; 3355 const WebCore::RenderObject* root = object1;
3342 while (root->parent()) 3356 while (root->parent())
3343 root = root->parent(); 3357 root = root->parent();
3344 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3358 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3345 } 3359 }
3346 } 3360 }
3347 3361
3348 #endif 3362 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698