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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h

Issue 1448253002: Clip scrollbars to box bounds when they don't fit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 GraphicsLayer* scrollingBlockSelectionLayer() const { return m_scrollingBloc kSelectionLayer.get(); } 104 GraphicsLayer* scrollingBlockSelectionLayer() const { return m_scrollingBloc kSelectionLayer.get(); }
105 105
106 bool hasMaskLayer() const { return m_maskLayer; } 106 bool hasMaskLayer() const { return m_maskLayer; }
107 GraphicsLayer* maskLayer() const { return m_maskLayer.get(); } 107 GraphicsLayer* maskLayer() const { return m_maskLayer.get(); }
108 108
109 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; } 109 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; }
110 GraphicsLayer* childClippingMaskLayer() const { return m_childClippingMaskLa yer.get(); } 110 GraphicsLayer* childClippingMaskLayer() const { return m_childClippingMaskLa yer.get(); }
111 111
112 GraphicsLayer* parentForSublayers() const; 112 GraphicsLayer* parentForSublayers() const;
113 GraphicsLayer* childForSuperlayers() const; 113 GraphicsLayer* childForSuperlayers() const;
114 void setSublayers(const GraphicsLayerVector&);
114 115
115 bool hasChildTransformLayer() const { return m_childTransformLayer; } 116 bool hasChildTransformLayer() const { return m_childTransformLayer; }
116 GraphicsLayer* childTransformLayer() const { return m_childTransformLayer.ge t(); } 117 GraphicsLayer* childTransformLayer() const { return m_childTransformLayer.ge t(); }
117 118
118 GraphicsLayer* squashingContainmentLayer() const { return m_squashingContain mentLayer.get(); } 119 GraphicsLayer* squashingContainmentLayer() const { return m_squashingContain mentLayer.get(); }
119 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); } 120 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); }
120 121
121 void setSquashingContentsNeedDisplay(); 122 void setSquashingContentsNeedDisplay();
122 void setContentsNeedDisplay(); 123 void setContentsNeedDisplay();
123 // LayoutRect is in the coordinate space of the layer's layout object. 124 // LayoutRect is in the coordinate space of the layer's layout object.
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 PaintLayer& m_owningLayer; 322 PaintLayer& m_owningLayer;
322 323
323 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this: 324 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
324 // 325 //
325 // + m_ancestorClippingLayer [OPTIONAL] 326 // + m_ancestorClippingLayer [OPTIONAL]
326 // + m_graphicsLayer 327 // + m_graphicsLayer
327 // + m_childTransformLayer [OPTIONAL] 328 // + m_childTransformLayer [OPTIONAL]
328 // | + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] 329 // | + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL]
329 // | + m_scrollingContentsL ayer [Present iff m_scrollingLayer is present] 330 // | + m_scrollingContentsL ayer [Present iff m_scrollingLayer is present]
330 // | + m_scrollingBlockSe lectionLayer [Present iff m_scrollingLayer is present] 331 // | + m_scrollingBlockSe lectionLayer [Present iff m_scrollingLayer is present]
331 // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow contro ls may need to be repositioned in the 332 // + m_overflowControlsAncestorClippingLayer [OPTIONAL] // *The overflo w controls may need to be repositioned in the
332 // + m_overflowControlsHostLayer [OPTIONAL] // graphics layer tree by the RLC to ensure that they stack 333 // + m_overflowControlsHostLayer [OPTIONAL] // graphics la yer tree by the RLC to ensure that they stack
333 // + m_layerForVerticalScrollbar [OPTIONAL] // above scrolling con tent. 334 // + m_layerForVerticalScrollbar [OPTIONAL] // above scrol ling content.
334 // + m_layerForHorizontalScrollbar [OPTIONAL] 335 // + m_layerForHorizontalScrollbar [OPTIONAL]
335 // + m_layerForScrollCorner [OPTIONAL] 336 // + m_layerForScrollCorner [OPTIONAL]
336 // 337 //
337 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the 338 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the
338 // clipping tree. Here's what that might look like. 339 // clipping tree. Here's what that might look like.
339 // 340 //
340 // Let A = the clipping ancestor, 341 // Let A = the clipping ancestor,
341 // B = the clip descendant, and 342 // B = the clip descendant, and
342 // SC = the stacking context that is the ancestor of A and B in the stac king tree. 343 // SC = the stacking context that is the ancestor of A and B in the stac king tree.
343 // 344 //
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // 391 //
391 // With the hierarchy set up like this, the root content layer is able to sc roll without affecting 392 // With the hierarchy set up like this, the root content layer is able to sc roll without affecting
392 // the background layer (or paint invalidation). 393 // the background layer (or paint invalidation).
393 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately. 394 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately.
394 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately. 395 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately.
395 396
396 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; 397 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
397 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; 398 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
398 OwnPtr<GraphicsLayer> m_layerForScrollCorner; 399 OwnPtr<GraphicsLayer> m_layerForScrollCorner;
399 400
400 // This layer exists to simplify the reparenting of overflow control that is occasionally required 401 // This layer contains the scrollbar and scroll corner layers and clips them to the border box
401 // to ensure that scrollbars appear above scrolling content. 402 // bounds of our LayoutObject. It is usually added to m_graphicsLayer, but m ay be reparented by
403 // GraphicsLayerTreeBuilder to ensure that scrollbars appear above scrolling content.
402 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer; 404 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer;
403 405
404 // The reparented overflow controls sometimes need to be clipped by a non-an cestor. In just the same 406 // The reparented overflow controls sometimes need to be clipped by a non-an cestor. In just the same
405 // way we need an ancestor clipping layer to clip this CLM's internal hierar chy, we add another layer 407 // way we need an ancestor clipping layer to clip this CLM's internal hierar chy, we add another layer
406 // to clip the overflow controls. It would be possible to make m_overflowCon trolsHostLayer be 408 // to clip the overflow controls. We could combine this with m_overflowContr olsHostLayer, but that
407 // responsible for applying this clip, but that could require repositioning all of the overflow 409 // would require manually intersecting their clips, and shifting the overflo w controls to compensate
408 // controls since the this clip may apply an offset. By using a separate lay er, the overflow controls 410 // for this clip's offset. By using a separate layer, the overflow controls can remain ignorant of
409 // can remain ignorant of the layers above them and still work correctly. 411 // ancestor clipping.
410 OwnPtr<GraphicsLayer> m_overflowControlsClippingLayer; 412 OwnPtr<GraphicsLayer> m_overflowControlsAncestorClippingLayer;
411 413
412 // A squashing CLM has two possible squashing-related structures. 414 // A squashing CLM has two possible squashing-related structures.
413 // 415 //
414 // If m_ancestorClippingLayer is present: 416 // If m_ancestorClippingLayer is present:
415 // 417 //
416 // m_ancestorClippingLayer 418 // m_ancestorClippingLayer
417 // + m_graphicsLayer 419 // + m_graphicsLayer
418 // + m_squashingLayer 420 // + m_squashingLayer
419 // 421 //
420 // If not: 422 // If not:
(...skipping 21 matching lines...) Expand all
442 unsigned m_scrollingContentsAreEmpty : 1; 444 unsigned m_scrollingContentsAreEmpty : 1;
443 445
444 mutable IntRect m_previousPaintInterestRect; 446 mutable IntRect m_previousPaintInterestRect;
445 447
446 friend class CompositedLayerMappingTest; 448 friend class CompositedLayerMappingTest;
447 }; 449 };
448 450
449 } // namespace blink 451 } // namespace blink
450 452
451 #endif // CompositedLayerMapping_h 453 #endif // CompositedLayerMapping_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698