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

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: add transform with overflow hidden test case 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 | « Source/core/rendering/RenderObject.h ('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 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;
esprehn 2014/03/04 05:22:25 I think I'd prefer you just const_cast on |this| t
+ 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 | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698