| Index: Source/core/rendering/RenderObject.cpp
|
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
|
| index 35f06e3a4147574ce162536bc6ce6959ae9ec2d1..fad82562adb24917ac6240b8338ad0156fabbec1 100644
|
| --- a/Source/core/rendering/RenderObject.cpp
|
| +++ b/Source/core/rendering/RenderObject.cpp
|
| @@ -817,7 +817,21 @@ RenderBlock* RenderObject::containingBlock() const
|
|
|
| RenderObject* RenderObject::clippingContainer() const
|
| {
|
| - for (RenderObject* container = containingBlock(); container; container = container->containingBlock()) {
|
| + RenderObject* container = const_cast<RenderObject*>(this);
|
| + while (container) {
|
| + if (container->style()->position() == FixedPosition) {
|
| + for (container = container->parent(); container && !container->canContainFixedPositionObjects(); container = container->parent()) {
|
| + // 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;
|
| }
|
|
|