OLD | NEW |
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 Loading... |
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 const RenderObject* ownerRenderer = child->ownerRenderer(); |
398 LayerFrameMap::iterator iter = map->find(containingLayer); | 398 if (!ownerRenderer) |
399 if (iter == map->end()) | 399 continue; |
400 map->add(containingLayer, Vector<const LocalFrame*>()).storedVal
ue->value.append(child); | 400 const RenderLayer* containingLayer = ownerRenderer->enclosingLayer(); |
401 else | 401 LayerFrameMap::iterator iter = map->find(containingLayer); |
402 iter->value.append(child); | 402 if (iter == map->end()) |
403 } | 403 map->add(containingLayer, Vector<const LocalFrame*>()).storedValue->
value.append(child); |
| 404 else |
| 405 iter->value.append(child); |
404 } | 406 } |
405 } | 407 } |
406 | 408 |
407 static void convertLayerRectsToEnclosingCompositedLayerRecursive( | 409 static void convertLayerRectsToEnclosingCompositedLayerRecursive( |
408 const RenderLayer* curLayer, | 410 const RenderLayer* curLayer, |
409 const LayerHitTestRects& layerRects, | 411 const LayerHitTestRects& layerRects, |
410 LayerHitTestRects& compositorRects, | 412 LayerHitTestRects& compositorRects, |
411 RenderGeometryMap& geometryMap, | 413 RenderGeometryMap& geometryMap, |
412 HashSet<const RenderLayer*>& layersWithRects, | 414 HashSet<const RenderLayer*>& layersWithRects, |
413 LayerFrameMap& layerChildFrameMap) | 415 LayerFrameMap& layerChildFrameMap) |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 bool frameIsScrollable = frameView && frameView->isScrollable(); | 956 bool frameIsScrollable = frameView && frameView->isScrollable(); |
955 if (frameIsScrollable != m_wasFrameScrollable) | 957 if (frameIsScrollable != m_wasFrameScrollable) |
956 return true; | 958 return true; |
957 | 959 |
958 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | 960 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) |
959 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 961 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
960 return false; | 962 return false; |
961 } | 963 } |
962 | 964 |
963 } // namespace WebCore | 965 } // namespace WebCore |
OLD | NEW |