Index: Source/core/testing/Internals.cpp |
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp |
index ce2ca45f8752fb756c7fe3e424985011ba0c07e0..487754cc0ff91168eb59b931bf8706acd8c769d2 100644 |
--- a/Source/core/testing/Internals.cpp |
+++ b/Source/core/testing/Internals.cpp |
@@ -1199,7 +1199,8 @@ unsigned Internals::touchEventHandlerCount(Document* document) |
static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, GraphicsLayer* graphicsLayer, IntSize* layerOffset, String* layerType) |
{ |
*layerOffset = IntSize(); |
- if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot->compositedLayerMapping()->mainGraphicsLayer()) { |
+ |
+ if (searchRoot->compositedLayerMapping() && graphicsLayer == searchRoot->compositedLayerMapping()->mainGraphicsLayer()) { |
LayoutRect rect; |
RenderLayer::mapRectToPaintBackingCoordinates(searchRoot->renderer(), rect); |
*layerOffset = IntSize(rect.x(), rect.y()); |
@@ -1592,14 +1593,16 @@ String Internals::elementLayerTreeAsText(Element* element, unsigned flags, Excep |
} |
RenderLayer* layer = toRenderBox(renderer)->layer(); |
- if (!layer |
- || !layer->hasCompositedLayerMapping() |
- || !layer->compositedLayerMapping()->mainGraphicsLayer()) { |
+ if (!layer) |
+ return String(); |
+ |
+ CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping(); |
+ if (!compositedLayerMapping || !compositedLayerMapping->mainGraphicsLayer()) { |
// Don't raise exception in these cases which may be normally used in tests. |
return String(); |
} |
- return layer->compositedLayerMapping()->mainGraphicsLayer()->layerTreeAsText(flags); |
+ return compositedLayerMapping->mainGraphicsLayer()->layerTreeAsText(flags); |
} |
String Internals::scrollingStateTreeAsText(Document*) const |