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

Unified Diff: Source/core/rendering/RenderLayer.h

Issue 14863002: Only update composited-scrolling state once after layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: subtreeHasOutOfFlowPositionedDescendant -> subtreeContainsOutOfFlowPositionedLayer Created 7 years, 7 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
Index: Source/core/rendering/RenderLayer.h
diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h
index e136bbce0247181e7583df4a5570be541f0e801d..8363037bff436410272eac48ef7b4a85b2c20174 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -554,14 +554,16 @@ public:
// Part of the issue is with subtree relayout: we don't check if our ancestors have some descendant flags dirty, missing some updates.
bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerDescendant; }
- // This returns true if we have an out of flow positioned descendant whose
- // containing block is not a descendant of ours. If this is true, we cannot
- // automatically opt into composited scrolling since this out of flow
- // positioned descendant would become clipped by us, possibly altering the
- // rendering of the page.
- // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty); here but we may hit the same bugs as visible content above.
+ // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty) here. See above.
bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositionedDescendant; }
+ void setHasOutOfFlowPositionedDescendant(bool hasDescendant) { m_hasOutOfFlowPositionedDescendant = hasDescendant; }
+ void setHasOutOfFlowPositionedDescendantDirty(bool dirty) { m_hasOutOfFlowPositionedDescendantDirty = dirty; }
+
+ bool hasUnclippedDescendant() const { return m_hasUnclippedDescendant; }
+ void setHasUnclippedDescendant(bool hasDescendant) { m_hasUnclippedDescendant = hasDescendant; }
+ void updateHasUnclippedDescendant();
+
// Gets the nearest enclosing positioned ancestor layer (also includes
// the <html> layer and the root layer).
RenderLayer* enclosingPositionedAncestor() const;
@@ -852,6 +854,9 @@ private:
void setAncestorChainHasSelfPaintingLayerDescendant();
void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
+ void setAncestorChainHasOutOfFlowPositionedDescendant();
+ void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
+
bool acceleratedCompositingForOverflowScrollEnabled() const;
void updateDescendantsAreContiguousInStackingOrder();
void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<const RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIteration);
@@ -876,11 +881,10 @@ private:
void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle);
void updateScrollbarsAfterLayout();
- void setAncestorChainHasOutOfFlowPositionedDescendant(RenderObject* containingBlock);
- void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
void updateOutOfFlowPositioned(const RenderStyle* oldStyle);
- void updateNeedsCompositedScrolling();
+ virtual void updateNeedsCompositedScrolling() OVERRIDE;
+ void setNeedsCompositedScrolling(bool);
void didUpdateNeedsCompositedScrolling();
// Returns true if the position changed.
@@ -1047,7 +1051,7 @@ private:
void dirtyAncestorChainVisibleDescendantStatus();
void setAncestorChainHasVisibleDescendant();
- void updateDescendantDependentFlags(HashSet<const RenderObject*>* outOfFlowDescendantContainingBlocks = 0);
+ void updateDescendantDependentFlags();
// This flag is computed by RenderLayerCompositor, which knows more about 3d hierarchies than we do.
void setHas3DTransformedDescendant(bool b) { m_has3DTransformedDescendant = b; }
@@ -1146,12 +1150,15 @@ protected:
bool m_hasSelfPaintingLayerDescendant : 1;
bool m_hasSelfPaintingLayerDescendantDirty : 1;
- // If we have no out of flow positioned descendants and no non-descendant
- // appears between our descendants in stacking order, then we may become a
- // stacking context.
bool m_hasOutOfFlowPositionedDescendant : 1;
bool m_hasOutOfFlowPositionedDescendantDirty : 1;
+ // This is true if we have an out-of-flow positioned descendant whose
+ // containing block is our ancestor. If this is the case, the descendant
+ // may fall outside of our clip preventing things like opting into
+ // composited scrolling (which causes clipping of all descendants).
+ bool m_hasUnclippedDescendant : 1;
+
bool m_needsCompositedScrolling : 1;
// If this is true, then no non-descendant appears between any of our

Powered by Google App Engine
This is Rietveld 408576698