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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/GraphicsLayerTreeBuilder.cpp

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: address chrishtr review comments 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Google Inc. All rights reserved. 3 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 infoForChildren.childLayersOfEnclosingCompositedLayer->append(curren tCompositedLayerMapping->foregroundLayer()); 90 infoForChildren.childLayersOfEnclosingCompositedLayer->append(curren tCompositedLayerMapping->foregroundLayer());
91 } 91 }
92 92
93 PaintLayerStackingNodeIterator iterator(*layer.stackingNode(), NormalFlowChi ldren | PositiveZOrderChildren); 93 PaintLayerStackingNodeIterator iterator(*layer.stackingNode(), NormalFlowChi ldren | PositiveZOrderChildren);
94 while (PaintLayerStackingNode* curNode = iterator.next()) 94 while (PaintLayerStackingNode* curNode = iterator.next())
95 rebuild(*curNode->layer(), infoForChildren); 95 rebuild(*curNode->layer(), infoForChildren);
96 96
97 if (hasCompositedLayerMapping) { 97 if (hasCompositedLayerMapping) {
98 bool parented = false; 98 bool parented = false;
99 if (layer.layoutObject()->isLayoutPart()) 99 if (layer.layoutObject()->isLayoutPart())
100 parented = PaintLayerCompositor::parentFrameContentLayers(toLayoutPa rt(layer.layoutObject())); 100 parented = PaintLayerCompositor::parentFrameContentLayers(toLayoutPa rt(layer.layoutObject()));
chrishtr 2015/11/20 01:20:42 So you figured out what this function does? Could
skobes 2015/11/20 01:35:21 Done. (It's less confusing when you realize "pare
101 101
102 if (!parented) 102 if (!parented)
103 currentCompositedLayerMapping->parentForSublayers()->setChildren(lay erChildren); 103 currentCompositedLayerMapping->setSublayers(layerChildren);
chrishtr 2015/11/20 01:20:42 How does this restore the various graphics layers
skobes 2015/11/20 01:35:21 They aren't in layerChildren. The relevant code i
104
105 // If the layer has a clipping layer the overflow controls layers will b e siblings of the clipping layer.
106 // Otherwise, the overflow control layers are normal children.
107 // FIXME: Why isn't this handled in CLM updateInternalHierarchy?
108 if (!currentCompositedLayerMapping->hasClippingLayer() && !currentCompos itedLayerMapping->hasScrollingLayer()) {
109 if (GraphicsLayer* overflowControlLayer = currentCompositedLayerMapp ing->layerForHorizontalScrollbar()) {
110 overflowControlLayer->removeFromParent();
111 currentCompositedLayerMapping->parentForSublayers()->addChild(ov erflowControlLayer);
112 }
113
114 if (GraphicsLayer* overflowControlLayer = currentCompositedLayerMapp ing->layerForVerticalScrollbar()) {
115 overflowControlLayer->removeFromParent();
116 currentCompositedLayerMapping->parentForSublayers()->addChild(ov erflowControlLayer);
117 }
118
119 if (GraphicsLayer* overflowControlLayer = currentCompositedLayerMapp ing->layerForScrollCorner()) {
120 overflowControlLayer->removeFromParent();
121 currentCompositedLayerMapping->parentForSublayers()->addChild(ov erflowControlLayer);
122 }
123 }
124 104
125 if (shouldAppendLayer(layer)) 105 if (shouldAppendLayer(layer))
126 info.childLayersOfEnclosingCompositedLayer->append(currentComposited LayerMapping->childForSuperlayers()); 106 info.childLayersOfEnclosingCompositedLayer->append(currentComposited LayerMapping->childForSuperlayers());
127 } 107 }
128 108
129 if (layer.scrollParent() 109 if (layer.scrollParent()
130 && layer.scrollParent()->hasCompositedLayerMapping() 110 && layer.scrollParent()->hasCompositedLayerMapping()
131 && layer.scrollParent()->compositedLayerMapping()->needsToReparentOverfl owControls() 111 && layer.scrollParent()->compositedLayerMapping()->needsToReparentOverfl owControls()
132 && layer.scrollParent()->scrollableArea()->topmostScrollChild() == &laye r) 112 && layer.scrollParent()->scrollableArea()->topmostScrollChild() == &laye r)
133 info.childLayersOfEnclosingCompositedLayer->append(layer.scrollParent()- >compositedLayerMapping()->detachLayerForOverflowControls(*info.enclosingComposi tedLayer)); 113 info.childLayersOfEnclosingCompositedLayer->append(layer.scrollParent()- >compositedLayerMapping()->detachLayerForOverflowControls(*info.enclosingComposi tedLayer));
134 } 114 }
135 115
136 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698