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

Side by Side Diff: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp

Issue 1287623002: Delete blink code for scroll-blocks-on (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months 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 | Annotate | Revision Log
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons()); 225 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons());
226 226
227 updateOpacity(layoutObject()->styleRef()); 227 updateOpacity(layoutObject()->styleRef());
228 updateTransform(layoutObject()->styleRef()); 228 updateTransform(layoutObject()->styleRef());
229 updateFilters(layoutObject()->styleRef()); 229 updateFilters(layoutObject()->styleRef());
230 230
231 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { 231 if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
232 updateLayerBlendMode(layoutObject()->styleRef()); 232 updateLayerBlendMode(layoutObject()->styleRef());
233 updateIsRootForIsolatedGroup(); 233 updateIsRootForIsolatedGroup();
234 } 234 }
235
236 updateScrollBlocksOn(layoutObject()->styleRef());
237 } 235 }
238 236
239 void CompositedDeprecatedPaintLayerMapping::destroyGraphicsLayers() 237 void CompositedDeprecatedPaintLayerMapping::destroyGraphicsLayers()
240 { 238 {
241 if (m_graphicsLayer) 239 if (m_graphicsLayer)
242 m_graphicsLayer->removeFromParent(); 240 m_graphicsLayer->removeFromParent();
243 241
244 m_ancestorClippingLayer = nullptr; 242 m_ancestorClippingLayer = nullptr;
245 m_graphicsLayer = nullptr; 243 m_graphicsLayer = nullptr;
246 m_foregroundLayer = nullptr; 244 m_foregroundLayer = nullptr;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 void CompositedDeprecatedPaintLayerMapping::updateIsRootForIsolatedGroup() 284 void CompositedDeprecatedPaintLayerMapping::updateIsRootForIsolatedGroup()
287 { 285 {
288 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants(); 286 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants();
289 287
290 // non stacking context layers should never isolate 288 // non stacking context layers should never isolate
291 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate); 289 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate);
292 290
293 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); 291 m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
294 } 292 }
295 293
296 void CompositedDeprecatedPaintLayerMapping::updateScrollBlocksOn(const ComputedS tyle& style)
297 {
298 // Note that blink determines the default scroll blocking policy, even
299 // when the scroll-blocks-on CSS feature isn't enabled.
300 WebScrollBlocksOn blockingMode = WebScrollBlocksOnStartTouch | WebScrollBloc ksOnWheelEvent;
301
302 if (RuntimeEnabledFeatures::cssScrollBlocksOnEnabled())
303 blockingMode = style.scrollBlocksOn();
304
305 m_graphicsLayer->setScrollBlocksOn(blockingMode);
306 }
307
308 void CompositedDeprecatedPaintLayerMapping::updateContentsOpaque() 294 void CompositedDeprecatedPaintLayerMapping::updateContentsOpaque()
309 { 295 {
310 ASSERT(m_isMainFrameLayoutViewLayer || !m_backgroundLayer); 296 ASSERT(m_isMainFrameLayoutViewLayer || !m_backgroundLayer);
311 if (isAcceleratedCanvas(layoutObject())) { 297 if (isAcceleratedCanvas(layoutObject())) {
312 // Determine whether the rendering context's external texture layer is o paque. 298 // Determine whether the rendering context's external texture layer is o paque.
313 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no de())->renderingContext(); 299 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no de())->renderingContext();
314 if (!context->hasAlpha()) 300 if (!context->hasAlpha())
315 m_graphicsLayer->setContentsOpaque(true); 301 m_graphicsLayer->setContentsOpaque(true);
316 else if (WebLayer* layer = context->platformLayer()) 302 else if (WebLayer* layer = context->platformLayer())
317 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()). hasAlpha()); 303 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()). hasAlpha());
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 updateBackgroundColor(); 714 updateBackgroundColor();
729 updateDrawsContent(); 715 updateDrawsContent();
730 updateContentsOpaque(); 716 updateContentsOpaque();
731 updateAfterPartResize(); 717 updateAfterPartResize();
732 updateRenderingContext(); 718 updateRenderingContext();
733 updateShouldFlattenTransform(); 719 updateShouldFlattenTransform();
734 updateChildrenTransform(); 720 updateChildrenTransform();
735 updateScrollParent(scrollParent()); 721 updateScrollParent(scrollParent());
736 registerScrollingLayers(); 722 registerScrollingLayers();
737 723
738 updateScrollBlocksOn(layoutObject()->styleRef());
739
740 updateCompositingReasons(); 724 updateCompositingReasons();
741 } 725 }
742 726
743 void CompositedDeprecatedPaintLayerMapping::updateMainGraphicsLayerGeometry(cons t IntRect& relativeCompositingBounds, const IntRect& localCompositingBounds, con st IntPoint& graphicsLayerParentLocation) 727 void CompositedDeprecatedPaintLayerMapping::updateMainGraphicsLayerGeometry(cons t IntRect& relativeCompositingBounds, const IntRect& localCompositingBounds, con st IntPoint& graphicsLayerParentLocation)
744 { 728 {
745 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location() - graphicsLayerParentLocation)); 729 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location() - graphicsLayerParentLocation));
746 m_graphicsLayer->setOffsetFromLayoutObject(toIntSize(localCompositingBounds. location())); 730 m_graphicsLayer->setOffsetFromLayoutObject(toIntSize(localCompositingBounds. location()));
747 731
748 FloatSize oldSize = m_graphicsLayer->size(); 732 FloatSize oldSize = m_graphicsLayer->size();
749 const IntSize& contentsSize = relativeCompositingBounds.size(); 733 const IntSize& contentsSize = relativeCompositingBounds.size();
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2356 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2373 name = "Scrolling Block Selection Layer"; 2357 name = "Scrolling Block Selection Layer";
2374 } else { 2358 } else {
2375 ASSERT_NOT_REACHED(); 2359 ASSERT_NOT_REACHED();
2376 } 2360 }
2377 2361
2378 return name; 2362 return name;
2379 } 2363 }
2380 2364
2381 } // namespace blink 2365 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698