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

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.h

Issue 397713004: Overlay scrollbars must respect ancestor clip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 5 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/compositing/CompositedLayerMapping.h
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.h b/Source/core/rendering/compositing/CompositedLayerMapping.h
index df715b25af8a6052eef1f6abbab6fac39adefb2e..e58821b699bb79c258cf0bb02dedcd9f202883be 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.h
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.h
@@ -90,7 +90,7 @@ public:
RenderLayer& owningLayer() const { return m_owningLayer; }
bool updateGraphicsLayerConfiguration();
- void updateGraphicsLayerGeometry(const RenderLayer* compositingContainer, Vector<RenderLayer*>& layersNeedingPaintInvalidation);
+ void updateGraphicsLayerGeometry(const RenderLayer* compositingContainer, const RenderLayer* compositingStackingContext, Vector<RenderLayer*>& layersNeedingPaintInvalidation);
// Update whether layer needs blending.
void updateContentsOpaque();
@@ -185,6 +185,13 @@ public:
GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
+ // Returns true if the overflow controls cannot be positioned within this
+ // CLM's internal hierarchy without incorrectly stacking under some
+ // scrolling content. If this returns true, these controls must be
+ // repositioned in the graphics layer tree to ensure that they stack above
+ // scrolling content.
+ bool needsToReparentOverflowControls() const;
+
// Removes the overflow controls host layer from its parent and positions it
// so that it can be inserted as a sibling to this CLM without changing
// position.
@@ -226,6 +233,7 @@ private:
void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAncestor, const IntPoint& graphicsLayerParentLocation, const RenderLayer& referenceLayer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offsetFromTransformedAncestor, Vector<RenderLayer*>& layersNeedingPaintInvalidation);
void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBounds, const IntRect& localCompositingBounds, IntPoint& graphicsLayerParentLocation);
void updateAncestorClippingLayerGeometry(const RenderLayer* compositingContainer, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLayerParentLocation);
+ void updateOverflowControlsHostLayerGeometry(const RenderLayer* compositingStackingContext);
void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const IntRect& localCompositingBounds);
void updateChildTransformLayerGeometry();
void updateMaskLayerGeometry();
@@ -249,7 +257,7 @@ private:
void updatePaintingPhases();
bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip);
bool updateChildTransformLayer(bool needsChildTransformLayer);
- bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer);
+ bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer, bool needsAncestorClip);
bool updateForegroundLayer(bool needsForegroundLayer);
bool updateBackgroundLayer(bool needsBackgroundLayer);
bool updateMaskLayer(bool needsMaskLayer);
@@ -320,8 +328,14 @@ private:
// + m_ancestorClippingLayer [OPTIONAL]
// + m_graphicsLayer
// + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTIONAL] <-OR-> m_childTransformLayer
- // + m_scrollingContentsLayer [Present iff m_scrollingLayer is present]
- // + m_scrollingBlockSelectionLayer [Present iff m_scrollingLayer is present]
+ // | + m_scrollingContentsLayer [Present iff m_scrollingLayer is present]
+ // | + m_scrollingBlockSelectionLayer [Present iff m_scrollingLayer is present]
+ // |
+ // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow controls may need to be repositioned in the
+ // + m_overflowControlsHostLayer // graphics layer tree by the RLC to ensure that they stack
+ // + m_layerForVerticalScrollbar // above scrolling content.
+ // + m_layerForHorizontalScrollbar
+ // + m_layerForScrollCorner
//
// We need an ancestor clipping layer if our clipping ancestor is not our ancestor in the
// clipping tree. Here's what that might look like.
@@ -385,8 +399,19 @@ private:
OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
OwnPtr<GraphicsLayer> m_layerForScrollCorner;
+
+ // This layer exists to simplify the reparenting of overflow control that is occasionally required
+ // to ensure that scrollbars appear above scrolling content.
OwnPtr<GraphicsLayer> m_overflowControlsHostLayer;
+ // The reparented overflow controls sometimes need to be clipped by a non-ancestor. In just the same
+ // way we need an ancestor clipping layer to clip this CLM's internal hierarchy, we add another layer
+ // to clip the overflow controls. It would be possible to make m_overflowControlsHostLayer be
+ // responsible for applying this clip, but that could require repositioning all of the overflow
+ // controls since the this clip may apply an offset. By using a separate layer, the overflow controls
+ // can remain ignorant of the layers above them and still work correctly.
+ OwnPtr<GraphicsLayer> m_overflowControlsClippingLayer;
+
// A squashing CLM has two possible squashing-related structures.
//
// If m_ancestorClippingLayer is present:

Powered by Google App Engine
This is Rietveld 408576698