From 6053d96eb23ccaf094502dc899ad1b099d7fec55 Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Sun, 26 Mar 2006 18:32:13 +0000 Subject: [PATCH] also limit the table pseudo frame processing if colgroups are the limiting frame, bug 329900, r/sr=bzbarsky --- layout/base/nsCSSFrameConstructor.cpp | 50 ++++++++++++++++----------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index da1fa73fe854..a5d4bae7c815 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -2684,16 +2684,10 @@ ProcessPseudoFrames(nsFrameConstructorState& aState, nsPresContext* presContext = aState.mPresContext; if (nsLayoutAtoms::tableFrame == pseudoFrames.mLowestType) { - // if the processing should be limited to the colgroup frame and the - // table frame is the lowest type of created pseudo frames that - // can have pseudo frame children, process only the colgroup pseudo frames - // and leave the table frame untouched. - if (nsLayoutAtoms::tableColGroupFrame == aHighestType) { - if (pseudoFrames.mColGroup.mFrame) { - rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, - aHighestFrame); - } - return rv; + if (pseudoFrames.mColGroup.mFrame) { + rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, + aHighestFrame); + if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv; } rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame); if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv; @@ -2714,7 +2708,11 @@ ProcessPseudoFrames(nsFrameConstructorState& aState, else if (nsLayoutAtoms::tableRowGroupFrame == pseudoFrames.mLowestType) { rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame); if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv; - + if (pseudoFrames.mColGroup.mFrame) { + rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, + aHighestFrame); + if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv; + } if (pseudoFrames.mTableOuter.mFrame) { rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame); if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv; @@ -2736,6 +2734,11 @@ ProcessPseudoFrames(nsFrameConstructorState& aState, rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame); if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv; } + if (pseudoFrames.mColGroup.mFrame) { + rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, + aHighestFrame); + if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv; + } if (pseudoFrames.mTableOuter.mFrame) { rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame); if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv; @@ -2757,6 +2760,11 @@ ProcessPseudoFrames(nsFrameConstructorState& aState, rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame); if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv; } + if (pseudoFrames.mColGroup.mFrame) { + rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, + aHighestFrame); + if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv; + } if (pseudoFrames.mTableOuter.mFrame) { rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame); } @@ -3150,15 +3158,17 @@ nsCSSFrameConstructor::GetPseudoColGroupFrame(nsTableCreator& aTableCre rv = CreatePseudoColGroupFrame(aTableCreator, aState, &aParentFrameIn); } else { - if (!pseudoFrames.mColGroup.mFrame) { - if (pseudoFrames.mRowGroup.mFrame && !(pseudoFrames.mRow.mFrame)) { - rv = CreatePseudoRowFrame(aTableCreator, aState); - } - if (pseudoFrames.mRow.mFrame && !(pseudoFrames.mCellOuter.mFrame)) { - rv = CreatePseudoCellFrame(aTableCreator, aState); - } - if (pseudoFrames.mCellOuter.mFrame && !(pseudoFrames.mTableOuter.mFrame)) { - rv = CreatePseudoTableFrame(aTableCreator, aState); + if (!pseudoFrames.mColGroup.mFrame) { + if (!pseudoFrames.mTableInner.mFrame) { + if (pseudoFrames.mRowGroup.mFrame && !(pseudoFrames.mRow.mFrame)) { + rv = CreatePseudoRowFrame(aTableCreator, aState); + } + if (pseudoFrames.mRow.mFrame && !(pseudoFrames.mCellOuter.mFrame)) { + rv = CreatePseudoCellFrame(aTableCreator, aState); + } + if (pseudoFrames.mCellOuter.mFrame && !(pseudoFrames.mTableOuter.mFrame)) { + rv = CreatePseudoTableFrame(aTableCreator, aState); + } } rv = CreatePseudoColGroupFrame(aTableCreator, aState); }