Bug 1061028 - IsInlineFrame() is a synonym for IsFrameOfType(nsIFrame::eLineParticipant) so it matches text frames too, which are not nsContainerFrames. r=roc
authorMats Palmgren <mats@mozilla.com>
Wed, 03 Sep 2014 14:14:01 -0400
changeset 203409 d88bb355ca22ff283308a936f932f38a01e44f5c
parent 203408 18ec1157a217238b7f1be89b3b0fa5cf49175492
child 203410 bbc66ed2e4ce3db7b974d345f913ebcf21583bda
push id27425
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 20:38:59 +0000
treeherdermozilla-central@acbdce59da2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1061028
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -10544,22 +10544,25 @@ nsCSSFrameConstructor::RemoveFirstLetter
 
       *aStopLooking = true;
       NS_ASSERTION(!aBlockFrame->GetPrevContinuation(),
                    "should have the first continuation here");
       aBlockFrame->RemoveStateBits(NS_BLOCK_HAS_FIRST_LETTER_CHILD);
       break;
     }
     else if (IsInlineFrame(kid)) {
-      // Look inside child inline frame for the letter frame
-      RemoveFirstLetterFrames(aPresContext, aPresShell,
-                              static_cast<nsContainerFrame*>(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;
     kid = kid->GetNextSibling();
   }
 
   return NS_OK;
 }