From 3327ae5ee9964c3111e7917730563fbb4ff21210 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Tue, 11 Dec 2007 16:42:20 -0800 Subject: [PATCH] Bug 405380. Bidi reordering moves frames around so we can't trust pfd->mBounds in nsLineLayout::RelativePositionFrames. r+sr=dbaron --- layout/generic/nsFrame.cpp | 2 ++ layout/generic/nsIFrame.h | 4 ++-- layout/reftests/bugs/405380-1-ref.html | 7 +++++++ layout/reftests/bugs/405380-1.html | 8 ++++++++ layout/reftests/bugs/reftest.list | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 layout/reftests/bugs/405380-1-ref.html create mode 100644 layout/reftests/bugs/405380-1.html diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 56a35d144a99..9e54c9c8ac5c 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -2817,6 +2817,7 @@ nsIFrame::InlineMinWidthData::ForceBreak(nsIRenderingContext *aRenderingContext) } floats.Clear(); trailingTextFrame = nsnull; + skipWhitespace = PR_TRUE; } void @@ -2880,6 +2881,7 @@ nsIFrame::InlinePrefWidthData::ForceBreak(nsIRenderingContext *aRenderingContext currentLine = NSCoordSaturatingSubtract(currentLine, trailingWhitespace, nscoord_MAX); prevLines = PR_MAX(prevLines, currentLine); currentLine = trailingWhitespace = 0; + skipWhitespace = PR_TRUE; } static void diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 28b4307f818b..f57e8aed8255 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1158,8 +1158,8 @@ public: nscoord currentLine; // True if initial collapsable whitespace should be skipped. This - // should be true at the beginning of a block and when the last text - // ended with whitespace. + // should be true at the beginning of a block, after hard breaks + // and when the last text ended with whitespace. PRBool skipWhitespace; // This contains the width of the trimmable whitespace at the end of diff --git a/layout/reftests/bugs/405380-1-ref.html b/layout/reftests/bugs/405380-1-ref.html new file mode 100644 index 000000000000..ab6c27f8f128 --- /dev/null +++ b/layout/reftests/bugs/405380-1-ref.html @@ -0,0 +1,7 @@ + + + +
f l
s l l
+
f l
second l l
+ + diff --git a/layout/reftests/bugs/405380-1.html b/layout/reftests/bugs/405380-1.html new file mode 100644 index 000000000000..ef0334737361 --- /dev/null +++ b/layout/reftests/bugs/405380-1.html @@ -0,0 +1,8 @@ + + + +
f l
+s l l
+
f l
second l l
+ + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 627d935bd65b..a88dbc275232 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -505,6 +505,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377 == 404666-2.html 404666-2-ref.html == 405186-1.xhtml about:blank == 405305-1.html 405305-1-ref.html +== 405380-1.html 405380-1-ref.html == 405577-1.html 405577-1-ref.html == 405584-1.html 405584-1-ref.html == 406484-1.html 406484-1-ref.html