Chromium Code Reviews| Index: Source/core/rendering/RenderObject.cpp |
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
| index 595041c330ef6cc29bb42dc55922f705bb3a283a..83bc9fbc2669a95b667a05d064ce134958e0634b 100644 |
| --- a/Source/core/rendering/RenderObject.cpp |
| +++ b/Source/core/rendering/RenderObject.cpp |
| @@ -815,9 +815,23 @@ RenderBlock* RenderObject::containingBlock() const |
| return toRenderBlock(o); |
| } |
| -RenderObject* RenderObject::clippingContainer() const |
| -{ |
| - for (RenderObject* container = containingBlock(); container; container = container->containingBlock()) { |
| +RenderObject* RenderObject::clippingContainer() |
| +{ |
| + RenderObject* container = this; |
|
ojan
2014/02/26 20:55:27
Had to remove the const for this line. I think I c
|
| + while (container) { |
| + if (container->style()->position() == FixedPosition) { |
| + for (container = container->parent(); container && !container->canContainFixedPositionObjects(); container = container->parent()) { |
|
esprehn
2014/02/26 21:26:02
Is this right? Now if you run into something that
|
| + // CSS clip applies to fixed position elements even for ancestors that are not what the |
| + // fixed element is positioned with respect to. |
| + if (container->hasClip()) |
| + return container; |
| + } |
| + } else { |
| + container = container->containingBlock(); |
| + } |
| + |
| + if (!container) |
| + return 0; |
| if (container->hasClipOrOverflowClip()) |
| return container; |
| } |