From 0df022faac2ae975471d482f967608a816b87aad Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Mon, 10 Dec 2007 17:14:25 -0800 Subject: [PATCH] Bug 407397. Don't 'optimize' by not reflowing when a 0x0 frame is removed. Bad Kipp. r+sr=dbaron --- layout/generic/nsContainerFrame.cpp | 22 ++++++---------------- layout/reftests/bugs/407937-1-ref.html | 5 +++++ layout/reftests/bugs/407937-1.html | 5 +++++ layout/reftests/bugs/reftest.list | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 layout/reftests/bugs/407937-1-ref.html create mode 100644 layout/reftests/bugs/407937-1.html diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 3bbcd4a24cc7..6559f1a9e3cb 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -198,24 +198,14 @@ nsContainerFrame::RemoveFrame(nsIAtom* aListName, // If the frame we are removing is a brFrame, we need a reflow so // the line the brFrame was on can attempt to pull up any frames // that can fit from lines below it. - PRBool generateReflowCommand = - aOldFrame->GetType() == nsGkAtoms::brFrame; - + PRBool generateReflowCommand = PR_TRUE; +#ifdef IBMBIDI + if (nsGkAtoms::nextBidi == aListName) { + generateReflowCommand = PR_FALSE; + } +#endif nsContainerFrame* parent = static_cast(aOldFrame->GetParent()); while (aOldFrame) { -#ifdef IBMBIDI - if (nsGkAtoms::nextBidi != aListName) { -#endif - // If the frame being removed has zero size then don't bother - // generating a reflow command, otherwise make sure we do. - nsRect bbox = aOldFrame->GetRect(); - if (bbox.width || bbox.height) { - generateReflowCommand = PR_TRUE; - } -#ifdef IBMBIDI - } -#endif - // When the parent is an inline frame we have a simple task - just // remove the frame from its parents list and generate a reflow // command. diff --git a/layout/reftests/bugs/407937-1-ref.html b/layout/reftests/bugs/407937-1-ref.html new file mode 100644 index 000000000000..b2025a4d39b4 --- /dev/null +++ b/layout/reftests/bugs/407937-1-ref.html @@ -0,0 +1,5 @@ + + +
TT
+ + diff --git a/layout/reftests/bugs/407937-1.html b/layout/reftests/bugs/407937-1.html new file mode 100644 index 000000000000..54b187bf7147 --- /dev/null +++ b/layout/reftests/bugs/407937-1.html @@ -0,0 +1,5 @@ + + +
T T
+ + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 7dcbb19f41ee..f1d3600ece16 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -511,4 +511,4 @@ random == 403134-1.html 403134-1-ref.html # bug 405377 == 406568-1.html 406568-1-ref.html == 407111-1.html 407111-1-ref.html == 407227-1.html 407227-1-ref.html - +== 407937-1.html 407937-1-ref.html