From 481c2affc3e460c4d982f3a655ce4d5bda30a951 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 28 Feb 2007 22:42:20 +0000 Subject: [PATCH] Fix bug 371925 -- we need to allow for the case when the prev sibling is at index 0. r=bernd, sr=roc --- layout/reftests/bugs/371925-1-ref.html | 14 ++++++++++++++ layout/reftests/bugs/371925-1a.html | 22 ++++++++++++++++++++++ layout/reftests/bugs/371925-1b.html | 23 +++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 2 ++ layout/tables/nsTableFrame.cpp | 9 +++++++-- 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 layout/reftests/bugs/371925-1-ref.html create mode 100644 layout/reftests/bugs/371925-1a.html create mode 100644 layout/reftests/bugs/371925-1b.html diff --git a/layout/reftests/bugs/371925-1-ref.html b/layout/reftests/bugs/371925-1-ref.html new file mode 100644 index 000000000000..0d3e2761c984 --- /dev/null +++ b/layout/reftests/bugs/371925-1-ref.html @@ -0,0 +1,14 @@ + + + + + + + + + +
Header
BODY
+ + + + diff --git a/layout/reftests/bugs/371925-1a.html b/layout/reftests/bugs/371925-1a.html new file mode 100644 index 000000000000..fd1d69da37a6 --- /dev/null +++ b/layout/reftests/bugs/371925-1a.html @@ -0,0 +1,22 @@ + + + + + + + + + +
Header
Footer
BODY
+ + + + + diff --git a/layout/reftests/bugs/371925-1b.html b/layout/reftests/bugs/371925-1b.html new file mode 100644 index 000000000000..8db15e968be7 --- /dev/null +++ b/layout/reftests/bugs/371925-1b.html @@ -0,0 +1,23 @@ + + + + + + + + + + +
Header
Footer
BODY
+ + + + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 78a331a75fa6..32e192ce9f0a 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -157,3 +157,5 @@ fails == 368020-4.html 368020-4-ref.html # bug 368085 == 370629-1.html 370629-1-ref.html == 370629-2.html 370629-2-ref.html == 370692-1.xhtml 370692-1-ref.xhtml +== 371925-1a.html 371925-1-ref.html +== 371925-1b.html 371925-1-ref.html diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 19fd37661bf9..b244d64af7be 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -2284,8 +2284,12 @@ nsTableFrame::InsertFrames(nsIAtom* aListName, const nsStyleDisplay* display = aFrameList->GetStyleDisplay(); if (aPrevFrame) { const nsStyleDisplay* prevDisplay = aPrevFrame->GetStyleDisplay(); - if (display->mDisplay != prevDisplay->mDisplay) { + // Make sure they belong on the same frame list + if ((display->mDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP) != + (prevDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP)) { // the previous frame is not valid, see comment at ::AppendFrames + // XXXbz Using content indices here means XBL will get screwed + // over... Oh, well. nsIFrame* pseudoFrame = aFrameList; nsIContent* parentContent = GetContent(); nsIContent* content; @@ -2305,7 +2309,8 @@ nsTableFrame::InsertFrames(nsIAtom* aListName, else { kidFrame = mFrames.FirstChild(); } - PRInt32 lastIndex = 0; + // Important: need to start at a value smaller than all valid indices + PRInt32 lastIndex = -1; while (kidFrame) { if (isColGroup) { nsTableColGroupType groupType =