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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 215773002: Don't call RenderObject::enclosingLayer on a null pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // In order to do a DFS cross-frame walk of the RenderLayer tree, we need to kno w which 387 // In order to do a DFS cross-frame walk of the RenderLayer tree, we need to kno w which
388 // RenderLayers have child frames inside of them. This computes a mapping for th e 388 // RenderLayers have child frames inside of them. This computes a mapping for th e
389 // current frame which we can consult while walking the layers of that frame. 389 // current frame which we can consult while walking the layers of that frame.
390 // Whenever we descend into a new frame, a new map will be created. 390 // Whenever we descend into a new frame, a new map will be created.
391 typedef HashMap<const RenderLayer*, Vector<const LocalFrame*> > LayerFrameMap; 391 typedef HashMap<const RenderLayer*, Vector<const LocalFrame*> > LayerFrameMap;
392 static void makeLayerChildFrameMap(const LocalFrame* currentFrame, LayerFrameMap * map) 392 static void makeLayerChildFrameMap(const LocalFrame* currentFrame, LayerFrameMap * map)
393 { 393 {
394 map->clear(); 394 map->clear();
395 const FrameTree& tree = currentFrame->tree(); 395 const FrameTree& tree = currentFrame->tree();
396 for (const LocalFrame* child = tree.firstChild(); child; child = child->tree ().nextSibling()) { 396 for (const LocalFrame* child = tree.firstChild(); child; child = child->tree ().nextSibling()) {
397 if (const RenderLayer* containingLayer = child->ownerRenderer()->enclosi ngLayer()) { 397 if (const RenderObject* ownerRenderer = child->ownerRenderer()) {
esprehn 2014/03/27 23:54:28 Might be nicer to use a "continue" instead of nest
398 const RenderLayer* containingLayer = ownerRenderer->enclosingLayer() ;
398 LayerFrameMap::iterator iter = map->find(containingLayer); 399 LayerFrameMap::iterator iter = map->find(containingLayer);
399 if (iter == map->end()) 400 if (iter == map->end())
400 map->add(containingLayer, Vector<const LocalFrame*>()).storedVal ue->value.append(child); 401 map->add(containingLayer, Vector<const LocalFrame*>()).storedVal ue->value.append(child);
401 else 402 else
402 iter->value.append(child); 403 iter->value.append(child);
403 } 404 }
404 } 405 }
405 } 406 }
406 407
407 static void convertLayerRectsToEnclosingCompositedLayerRecursive( 408 static void convertLayerRectsToEnclosingCompositedLayerRecursive(
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 bool frameIsScrollable = frameView && frameView->isScrollable(); 955 bool frameIsScrollable = frameView && frameView->isScrollable();
955 if (frameIsScrollable != m_wasFrameScrollable) 956 if (frameIsScrollable != m_wasFrameScrollable)
956 return true; 957 return true;
957 958
958 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 959 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
959 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 960 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
960 return false; 961 return false;
961 } 962 }
962 963
963 } // namespace WebCore 964 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698