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 @@ + + + +
+ diff --git a/layout/reftests/bugs/440149-1.html b/layout/reftests/bugs/440149-1.html new file mode 100644 index 00000000000..c041f733837 --- /dev/null +++ b/layout/reftests/bugs/440149-1.html @@ -0,0 +1,13 @@ + + + +
+ diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 920a30e36c1..fbc76d10463 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -929,6 +929,7 @@ random == 429849-1.html 429849-1-ref.html # bug 432288 == 439004-1.html 439004-1-ref.html == 439639-1.html 439639-1-ref.html == 439910.html 439910-ref.html +== 440149-1.html 440149-1-ref.html == 441259-1.html 441259-1-ref.html fails == 441259-2.html 441259-2-ref.html # bug 441400 == 442542-1.html 442542-1-ref.html