From 7667ee1d126afef6bbec0455935bf92a18da51b4 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Wed, 3 Sep 2014 14:14:01 -0400 Subject: [PATCH] Bug 1061028 - IsInlineFrame() is a synonym for IsFrameOfType(nsIFrame::eLineParticipant) so it matches text frames too, which are not nsContainerFrames. r=roc --- layout/base/nsCSSFrameConstructor.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 896bd566f2d..81ac535f63f 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -10549,12 +10549,15 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext, break; } else if (IsInlineFrame(kid)) { - // Look inside child inline frame for the letter frame - RemoveFirstLetterFrames(aPresContext, aPresShell, - static_cast(kid), - aBlockFrame, aStopLooking); - if (*aStopLooking) { - break; + nsContainerFrame* kidAsContainerFrame = do_QueryFrame(kid); + if (kidAsContainerFrame) { + // Look inside child inline frame for the letter frame. + RemoveFirstLetterFrames(aPresContext, aPresShell, + kidAsContainerFrame, + aBlockFrame, aStopLooking); + if (*aStopLooking) { + break; + } } } prevSibling = kid;