diff --git a/layout/base/crashtests/501878-1.html b/layout/base/crashtests/501878-1.html new file mode 100644 index 00000000000..879f163fbe5 --- /dev/null +++ b/layout/base/crashtests/501878-1.html @@ -0,0 +1,5 @@ + + +Hello diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index 6cef7318745..215edcf0370 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -239,3 +239,4 @@ load 492112-1.xhtml load 492163-1.xhtml load 495350-1.html load 500467-1.html +load 501878-1.html diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 403185f3e14..65ba061681c 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -5532,16 +5532,15 @@ nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState& aState, // We don't do it for content that may have XBL anonymous siblings, // because they make it difficult to correctly create the frame // due to dynamic changes. + // We don't do it for text that's not a line participant (i.e. SVG text). if (AtLineBoundary(aIter) && !styleContext->GetStyleText()->NewlineIsSignificant() && aIter.List()->ParentHasNoXBLChildren() && !(aState.mAdditionalStateBits & NS_FRAME_GENERATED_CONTENT) && + (item.mFCData->mBits & FCDATA_IS_LINE_PARTICIPANT) && item.IsWhitespace()) return NS_OK; - // XXXroc Right now if you start with whitespace and then start adding chars - // (e.g. while editing) we reframe on every change, which seems dumb. - // Maybe we should use another flag here, or something. return ConstructTextFrame(item.mFCData, aState, item.mContent, adjParentFrame, styleContext, aFrameItems);