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

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

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 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::attachFrameContentLayersToIframeLay er(toLayoutPart(layer.layoutObject())); 100 parented = PaintLayerCompositor::parentFrameContentLayers(toLayoutPa rt(layer.layoutObject()));
101 101
102 if (!parented) 102 if (!parented)
103 currentCompositedLayerMapping->setSublayers(layerChildren); 103 currentCompositedLayerMapping->parentForSublayers()->setChildren(lay erChildren);
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 }
104 124
105 if (shouldAppendLayer(layer)) 125 if (shouldAppendLayer(layer))
106 info.childLayersOfEnclosingCompositedLayer->append(currentComposited LayerMapping->childForSuperlayers()); 126 info.childLayersOfEnclosingCompositedLayer->append(currentComposited LayerMapping->childForSuperlayers());
107 } 127 }
108 128
109 if (layer.scrollParent() 129 if (layer.scrollParent()
110 && layer.scrollParent()->hasCompositedLayerMapping() 130 && layer.scrollParent()->hasCompositedLayerMapping()
111 && layer.scrollParent()->compositedLayerMapping()->needsToReparentOverfl owControls() 131 && layer.scrollParent()->compositedLayerMapping()->needsToReparentOverfl owControls()
112 && layer.scrollParent()->scrollableArea()->topmostScrollChild() == &laye r) 132 && layer.scrollParent()->scrollableArea()->topmostScrollChild() == &laye r)
113 info.childLayersOfEnclosingCompositedLayer->append(layer.scrollParent()- >compositedLayerMapping()->detachLayerForOverflowControls(*info.enclosingComposi tedLayer)); 133 info.childLayersOfEnclosingCompositedLayer->append(layer.scrollParent()- >compositedLayerMapping()->detachLayerForOverflowControls(*info.enclosingComposi tedLayer));
114 } 134 }
115 135
116 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698