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

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: fix assertion in clipTypeAsDebugString 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 PaintLayer& m_owningLayer; 323 PaintLayer& m_owningLayer;
323 324
324 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this: 325 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
325 // 326 //
326 // + m_ancestorClippingLayer [OPTIONAL] 327 // + m_ancestorClippingLayer [OPTIONAL]
327 // + m_graphicsLayer 328 // + m_graphicsLayer
328 // + m_childTransformLayer [OPTIONAL] 329 // + m_childTransformLayer [OPTIONAL]
329 // | + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] 330 // | + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL]
330 // | + m_scrollingContentsL ayer [Present iff m_scrollingLayer is present] 331 // | + m_scrollingContentsL ayer [Present iff m_scrollingLayer is present]
331 // | + m_scrollingBlockSe lectionLayer [Present iff m_scrollingLayer is present] 332 // | + m_scrollingBlockSe lectionLayer [Present iff m_scrollingLayer is present]
332 // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow contro ls may need to be repositioned in the 333 // + m_overflowControlsAncestorClippingLayer [OPTIONAL] // *The overflo w controls may need to be repositioned in the
333 // + m_overflowControlsHostLayer [OPTIONAL] // graphics layer tree by the RLC to ensure that they stack 334 // + m_overflowControlsHostLayer [OPTIONAL] // graphics la yer tree by the RLC to ensure that they stack
334 // + m_layerForVerticalScrollbar [OPTIONAL] // above scrolling con tent. 335 // + m_layerForVerticalScrollbar [OPTIONAL] // above scrol ling content.
335 // + m_layerForHorizontalScrollbar [OPTIONAL] 336 // + m_layerForHorizontalScrollbar [OPTIONAL]
336 // + m_layerForScrollCorner [OPTIONAL] 337 // + m_layerForScrollCorner [OPTIONAL]
337 // 338 //
338 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the 339 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the
339 // clipping tree. Here's what that might look like. 340 // clipping tree. Here's what that might look like.
340 // 341 //
341 // Let A = the clipping ancestor, 342 // Let A = the clipping ancestor,
342 // B = the clip descendant, and 343 // B = the clip descendant, and
343 // SC = the stacking context that is the ancestor of A and B in the stac king tree. 344 // SC = the stacking context that is the ancestor of A and B in the stac king tree.
344 // 345 //
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // 392 //
392 // With the hierarchy set up like this, the root content layer is able to sc roll without affecting 393 // With the hierarchy set up like this, the root content layer is able to sc roll without affecting
393 // the background layer (or paint invalidation). 394 // the background layer (or paint invalidation).
394 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately. 395 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately.
395 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately. 396 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately.
396 397
397 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; 398 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
398 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; 399 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
399 OwnPtr<GraphicsLayer> m_layerForScrollCorner; 400 OwnPtr<GraphicsLayer> m_layerForScrollCorner;
400 401
401 // This layer exists to simplify the reparenting of overflow control that is occasionally required 402 // This layer contains the scrollbar and scroll corner layers and clips them to the border box
402 // to ensure that scrollbars appear above scrolling content. 403 // bounds of our LayoutObject. It is usually added to m_graphicsLayer, but m ay be reparented by
404 // GraphicsLayerTreeBuilder to ensure that scrollbars appear above scrolling content.
403 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer; 405 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer;
404 406
405 // The reparented overflow controls sometimes need to be clipped by a non-an cestor. In just the same 407 // The reparented overflow controls sometimes need to be clipped by a non-an cestor. In just the same
406 // way we need an ancestor clipping layer to clip this CLM's internal hierar chy, we add another layer 408 // way we need an ancestor clipping layer to clip this CLM's internal hierar chy, we add another layer
407 // to clip the overflow controls. It would be possible to make m_overflowCon trolsHostLayer be 409 // to clip the overflow controls. We could combine this with m_overflowContr olsHostLayer, but that
408 // responsible for applying this clip, but that could require repositioning all of the overflow 410 // would require manually intersecting their clips, and shifting the overflo w controls to compensate
409 // controls since the this clip may apply an offset. By using a separate lay er, the overflow controls 411 // for this clip's offset. By using a separate layer, the overflow controls can remain ignorant of
410 // can remain ignorant of the layers above them and still work correctly. 412 // ancestor clipping.
411 OwnPtr<GraphicsLayer> m_overflowControlsClippingLayer; 413 OwnPtr<GraphicsLayer> m_overflowControlsAncestorClippingLayer;
412 414
413 // A squashing CLM has two possible squashing-related structures. 415 // A squashing CLM has two possible squashing-related structures.
414 // 416 //
415 // If m_ancestorClippingLayer is present: 417 // If m_ancestorClippingLayer is present:
416 // 418 //
417 // m_ancestorClippingLayer 419 // m_ancestorClippingLayer
418 // + m_graphicsLayer 420 // + m_graphicsLayer
419 // + m_squashingLayer 421 // + m_squashingLayer
420 // 422 //
421 // If not: 423 // If not:
(...skipping 19 matching lines...) Expand all
441 443
442 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; 444 unsigned m_backgroundLayerPaintsFixedRootBackground : 1;
443 unsigned m_scrollingContentsAreEmpty : 1; 445 unsigned m_scrollingContentsAreEmpty : 1;
444 446
445 friend class CompositedLayerMappingTest; 447 friend class CompositedLayerMappingTest;
446 }; 448 };
447 449
448 } // namespace blink 450 } // namespace blink
449 451
450 #endif // CompositedLayerMapping_h 452 #endif // CompositedLayerMapping_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698