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

Unified 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: const_cast Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/css/transformed-overflow-hidden-clips-fixed-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « LayoutTests/fast/css/transformed-overflow-hidden-clips-fixed-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698