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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/rendering/compositing/CompositingInputsUpdater.h" 6 #include "core/rendering/compositing/CompositingInputsUpdater.h"
7 7
8 #include "core/rendering/RenderBlock.h" 8 #include "core/rendering/RenderBlock.h"
9 #include "core/rendering/RenderLayer.h" 9 #include "core/rendering/RenderLayer.h"
10 #include "core/rendering/compositing/CompositedLayerMapping.h" 10 #include "core/rendering/compositing/CompositedLayerMapping.h"
(...skipping 17 matching lines...) Expand all
28 TRACE_EVENT0("blink", "CompositingInputsUpdater::update"); 28 TRACE_EVENT0("blink", "CompositingInputsUpdater::update");
29 updateRecursive(m_rootRenderLayer, DoNotForceUpdate, AncestorInfo()); 29 updateRecursive(m_rootRenderLayer, DoNotForceUpdate, AncestorInfo());
30 } 30 }
31 31
32 static const RenderLayer* findParentLayerOnClippingContainerChain(const RenderLa yer* layer) 32 static const RenderLayer* findParentLayerOnClippingContainerChain(const RenderLa yer* layer)
33 { 33 {
34 RenderObject* current = layer->renderer(); 34 RenderObject* current = layer->renderer();
35 while (current) { 35 while (current) {
36 if (current->style()->position() == FixedPosition) { 36 if (current->style()->position() == FixedPosition) {
37 for (current = current->parent(); current && !current->canContainFix edPositionObjects(); current = current->parent()) { 37 for (current = current->parent(); current && !current->canContainFix edPositionObjects(); current = current->parent()) {
38 // All types of clips apply to fixed-position descendants of oth er fixed-position elements.
39 // Note: it's unclear whether this is what the spec says. Firefo x does not clip, but Chrome does.
40 if (current->style()->position() == FixedPosition && current->ha sClipOrOverflowClip()) {
41 ASSERT(current->hasLayer());
42 return static_cast<const RenderLayerModelObject*>(current)-> layer();
43 }
44
38 // CSS clip applies to fixed position elements even for ancestor s that are not what the 45 // CSS clip applies to fixed position elements even for ancestor s that are not what the
39 // fixed element is positioned with respect to. 46 // fixed element is positioned with respect to.
40 if (current->hasClip()) { 47 if (current->hasClip()) {
41 ASSERT(current->hasLayer()); 48 ASSERT(current->hasLayer());
42 return static_cast<const RenderLayerModelObject*>(current)-> layer(); 49 return static_cast<const RenderLayerModelObject*>(current)-> layer();
43 } 50 }
44 } 51 }
45 } else { 52 } else {
46 current = current->containingBlock(); 53 current = current->containingBlock();
47 } 54 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ASSERT(!layer->childNeedsCompositingInputsUpdate()); 190 ASSERT(!layer->childNeedsCompositingInputsUpdate());
184 ASSERT(!layer->needsCompositingInputsUpdate()); 191 ASSERT(!layer->needsCompositingInputsUpdate());
185 192
186 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling()) 193 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling())
187 assertNeedsCompositingInputsUpdateBitsCleared(child); 194 assertNeedsCompositingInputsUpdateBitsCleared(child);
188 } 195 }
189 196
190 #endif 197 #endif
191 198
192 } // namespace blink 199 } // namespace blink
OLDNEW
« 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