Chromium Code Reviews| 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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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; |
|
esprehn
2014/03/04 05:22:25
I think I'd prefer you just const_cast on |this| t
| |
| 821 while (container) { | |
| 822 if (container->style()->position() == FixedPosition) { | |
| 823 for (container = container->parent(); container && !container->canCo ntainFixedPositionObjects(); container = container->parent()) { | |
| 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 Loading... | |
| 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 |
| OLD | NEW |