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

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

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

Powered by Google App Engine
This is Rietveld 408576698