Chromium Code Reviews| Index: Source/core/rendering/RenderGeometryMap.cpp |
| diff --git a/Source/core/rendering/RenderGeometryMap.cpp b/Source/core/rendering/RenderGeometryMap.cpp |
| index 6ff1b2404786f91daefa842e5770ebe9a672fff1..f2625d2d8782a1447e6be3838f03c9011794d929 100644 |
| --- a/Source/core/rendering/RenderGeometryMap.cpp |
| +++ b/Source/core/rendering/RenderGeometryMap.cpp |
| @@ -118,10 +118,12 @@ FloatPoint RenderGeometryMap::mapToContainer(const FloatPoint& p, const RenderLa |
| } |
| #if !ASSERT_DISABLED |
| - FloatPoint rendererMappedResult = m_mapping.last().m_renderer->localToAbsolute(p, m_mapCoordinatesFlags); |
| - ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)); |
| -// if (roundedIntPoint(rendererMappedResult) != roundedIntPoint(result)) |
| -// fprintf(stderr, "Mismatched point\n"); |
| + if (m_mapping.size() > 0) { |
| + FloatPoint rendererMappedResult = m_mapping.last().m_renderer->localToAbsolute(p, m_mapCoordinatesFlags); |
| + ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)); |
| + // if (roundedIntPoint(rendererMappedResult) != roundedIntPoint(result)) |
|
jamesr
2013/10/18 15:56:42
please remove before landing
|
| + // fprintf(stderr, "Mismatched point\n"); |
| + } |
| #endif |
| return result; |
| @@ -155,20 +157,22 @@ FloatQuad RenderGeometryMap::mapToContainer(const FloatRect& rect, const RenderL |
| } |
| #if !ASSERT_DISABLED |
| - const RenderObject* lastRenderer = m_mapping.last().m_renderer; |
| - const RenderLayer* layer = lastRenderer->enclosingLayer(); |
| - |
| - // Bounds for invisible layers are intentionally not calculated, and are |
| - // therefore not necessarily expected to be correct here. This is ok, |
| - // because they will be recomputed if the layer becomes visible. |
| - if (!layer || !layer->subtreeIsInvisible()) { |
| - FloatRect rendererMappedResult = lastRenderer->localToContainerQuad(rect, container, m_mapCoordinatesFlags).boundingBox(); |
| - |
| - // Inspector creates renderers with negative width <https://bugs.webkit.org/show_bug.cgi?id=87194>. |
| - // Taking FloatQuad bounds avoids spurious assertions because of that. |
| - ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(FloatQuad(result).boundingBox())); |
| -// if (enclosingIntRect(rendererMappedResult) != enclosingIntRect(FloatQuad(result).boundingBox())) |
| -// fprintf(stderr, "Mismatched rects\n"); |
| + if (m_mapping.size() > 0) { |
| + const RenderObject* lastRenderer = m_mapping.last().m_renderer; |
| + const RenderLayer* layer = lastRenderer->enclosingLayer(); |
| + |
| + // Bounds for invisible layers are intentionally not calculated, and are |
| + // therefore not necessarily expected to be correct here. This is ok, |
| + // because they will be recomputed if the layer becomes visible. |
| + if (!layer || !layer->subtreeIsInvisible()) { |
| + FloatRect rendererMappedResult = lastRenderer->localToContainerQuad(rect, container, m_mapCoordinatesFlags).boundingBox(); |
| + |
| + // Inspector creates renderers with negative width <https://bugs.webkit.org/show_bug.cgi?id=87194>. |
| + // Taking FloatQuad bounds avoids spurious assertions because of that. |
| + ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(FloatQuad(result).boundingBox())); |
| + // if (enclosingIntRect(rendererMappedResult) != enclosingIntRect(FloatQuad(result).boundingBox())) |
|
jamesr
2013/10/18 15:56:42
ditto
|
| + // fprintf(stderr, "Mismatched rects\n"); |
| + } |
| } |
| #endif |