diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index fa3e22f1ea3..fb3522ad2a9 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -6041,7 +6041,9 @@ nsTextFrame::Reflow(nsPresContext* aPresContext, eNormalBreak); } PRBool breakAfter = forceBreakAfter; - if (!breakAfter && charsFit == length && + // length == 0 means either the text is empty or it's all collapsed away + PRBool emptyTextAtStartOfLine = atStartOfLine && length == 0; + if (!breakAfter && charsFit == length && !emptyTextAtStartOfLine && transformedOffset + transformedLength == mTextRun->GetLength() && (mTextRun->GetFlags() & nsTextFrameUtils::TEXT_HAS_TRAILING_BREAK)) { // We placed all the text in the textrun and we have a break opportunity at diff --git a/layout/reftests/bugs/440149-1-ref.html b/layout/reftests/bugs/440149-1-ref.html new file mode 100644 index 00000000000..7fc5e06fc84 --- /dev/null +++ b/layout/reftests/bugs/440149-1-ref.html @@ -0,0 +1,13 @@ + + +
+