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

Unified Diff: Source/core/rendering/compositing/CompositingInputsUpdater.cpp

Issue 543123003: Don't squash fixed-position elements into another fixed-position element that has a clip. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed. Created 6 years, 3 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/compositing/squashing/no-squashing-into-fixed-position-that-clips-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/CompositingInputsUpdater.cpp
diff --git a/Source/core/rendering/compositing/CompositingInputsUpdater.cpp b/Source/core/rendering/compositing/CompositingInputsUpdater.cpp
index 1bf13b16fa3e2e005f16332e49345f086274f9bd..c73e4b63219bd4afeea9b825404fcf8164850dd2 100644
--- a/Source/core/rendering/compositing/CompositingInputsUpdater.cpp
+++ b/Source/core/rendering/compositing/CompositingInputsUpdater.cpp
@@ -35,6 +35,13 @@ static const RenderLayer* findParentLayerOnClippingContainerChain(const RenderLa
while (current) {
if (current->style()->position() == FixedPosition) {
for (current = current->parent(); current && !current->canContainFixedPositionObjects(); current = current->parent()) {
+ // All types of clips apply to fixed-position descendants of other fixed-position elements.
+ // Note: it's unclear whether this is what the spec says. Firefox does not clip, but Chrome does.
+ if (current->style()->position() == FixedPosition && current->hasClipOrOverflowClip()) {
+ ASSERT(current->hasLayer());
+ return static_cast<const RenderLayerModelObject*>(current)->layer();
+ }
+
// CSS clip applies to fixed position elements even for ancestors that are not what the
// fixed element is positioned with respect to.
if (current->hasClip()) {
« no previous file with comments | « LayoutTests/compositing/squashing/no-squashing-into-fixed-position-that-clips-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698