Fix invalid cast in WebCore::RenderBlock::blockSelectionGaps
authorCarlos Garcia Campos <carlosgc@webkit.org>
Fri, 6 Mar 2015 07:33:11 +0000 (07:33 +0000)
committerAlberto Garcia <berto@igalia.com>
Fri, 6 Mar 2015 07:33:11 +0000 (07:33 +0000)
===================================================================

Gbp-Pq: Name render-block-cast.patch

Source/WebCore/rendering/RenderBlock.cpp

index e495c1837f721758a15ea7242f493ee0c2d553a9..a3096410ef55951f88e6a065a7df7c58145e4c0f 100644 (file)
@@ -2040,7 +2040,7 @@ GapRects RenderBlock::blockSelectionGaps(RenderBlock& rootBlock, const LayoutPoi
             lastLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + curr->logicalBottom();
             lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, curr->logicalBottom(), cache);
             lastLogicalRight = logicalRightSelectionOffset(rootBlock, curr->logicalBottom(), cache);
-        } else if (childState != SelectionNone) {
+        } else if (childState != SelectionNone && curr->isRenderBlock()) {
             // We must be a block that has some selected object inside it.  Go ahead and recur.
             result.unite(toRenderBlock(curr)->selectionGaps(rootBlock, rootBlockPhysicalPosition, LayoutSize(offsetFromRootBlock.width() + curr->x(), offsetFromRootBlock.height() + curr->y()), 
                 lastLogicalTop, lastLogicalLeft, lastLogicalRight, childCache, paintInfo));