1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/tables/nsTableColGroupFrame.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,530 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 +#include "nsTableColGroupFrame.h" 1.9 +#include "nsTableColFrame.h" 1.10 +#include "nsTableFrame.h" 1.11 +#include "nsStyleContext.h" 1.12 +#include "nsStyleConsts.h" 1.13 +#include "nsPresContext.h" 1.14 +#include "nsHTMLParts.h" 1.15 +#include "nsGkAtoms.h" 1.16 +#include "nsCOMPtr.h" 1.17 +#include "nsCSSRendering.h" 1.18 +#include "nsIPresShell.h" 1.19 + 1.20 +#define COL_GROUP_TYPE_BITS (NS_FRAME_STATE_BIT(30) | \ 1.21 + NS_FRAME_STATE_BIT(31)) 1.22 +#define COL_GROUP_TYPE_OFFSET 30 1.23 + 1.24 +nsTableColGroupType 1.25 +nsTableColGroupFrame::GetColType() const 1.26 +{ 1.27 + return (nsTableColGroupType)((mState & COL_GROUP_TYPE_BITS) >> COL_GROUP_TYPE_OFFSET); 1.28 +} 1.29 + 1.30 +void nsTableColGroupFrame::SetColType(nsTableColGroupType aType) 1.31 +{ 1.32 + NS_ASSERTION(GetColType() == eColGroupContent, 1.33 + "should only call nsTableColGroupFrame::SetColType with aType " 1.34 + "!= eColGroupContent once"); 1.35 + uint32_t type = aType - eColGroupContent; 1.36 + RemoveStateBits(COL_GROUP_TYPE_BITS); 1.37 + AddStateBits(nsFrameState(type << COL_GROUP_TYPE_OFFSET)); 1.38 +} 1.39 + 1.40 +void nsTableColGroupFrame::ResetColIndices(nsIFrame* aFirstColGroup, 1.41 + int32_t aFirstColIndex, 1.42 + nsIFrame* aStartColFrame) 1.43 +{ 1.44 + nsTableColGroupFrame* colGroupFrame = (nsTableColGroupFrame*)aFirstColGroup; 1.45 + int32_t colIndex = aFirstColIndex; 1.46 + while (colGroupFrame) { 1.47 + if (nsGkAtoms::tableColGroupFrame == colGroupFrame->GetType()) { 1.48 + // reset the starting col index for the first cg only if we should reset 1.49 + // the whole colgroup (aStartColFrame defaults to nullptr) or if 1.50 + // aFirstColIndex is smaller than the existing starting col index 1.51 + if ((colIndex != aFirstColIndex) || 1.52 + (colIndex < colGroupFrame->GetStartColumnIndex()) || 1.53 + !aStartColFrame) { 1.54 + colGroupFrame->SetStartColumnIndex(colIndex); 1.55 + } 1.56 + nsIFrame* colFrame = aStartColFrame; 1.57 + if (!colFrame || (colIndex != aFirstColIndex)) { 1.58 + colFrame = colGroupFrame->GetFirstPrincipalChild(); 1.59 + } 1.60 + while (colFrame) { 1.61 + if (nsGkAtoms::tableColFrame == colFrame->GetType()) { 1.62 + ((nsTableColFrame*)colFrame)->SetColIndex(colIndex); 1.63 + colIndex++; 1.64 + } 1.65 + colFrame = colFrame->GetNextSibling(); 1.66 + } 1.67 + } 1.68 + colGroupFrame = static_cast<nsTableColGroupFrame*> 1.69 + (colGroupFrame->GetNextSibling()); 1.70 + } 1.71 +} 1.72 + 1.73 + 1.74 +nsresult 1.75 +nsTableColGroupFrame::AddColsToTable(int32_t aFirstColIndex, 1.76 + bool aResetSubsequentColIndices, 1.77 + const nsFrameList::Slice& aCols) 1.78 +{ 1.79 + nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); 1.80 + 1.81 + tableFrame->InvalidateFrameSubtree(); 1.82 + 1.83 + // set the col indices of the col frames and and add col info to the table 1.84 + int32_t colIndex = aFirstColIndex; 1.85 + nsFrameList::Enumerator e(aCols); 1.86 + for (; !e.AtEnd(); e.Next()) { 1.87 + ((nsTableColFrame*)e.get())->SetColIndex(colIndex); 1.88 + mColCount++; 1.89 + tableFrame->InsertCol((nsTableColFrame &)*e.get(), colIndex); 1.90 + colIndex++; 1.91 + } 1.92 + 1.93 + for (nsFrameList::Enumerator eTail = e.GetUnlimitedEnumerator(); 1.94 + !eTail.AtEnd(); 1.95 + eTail.Next()) { 1.96 + ((nsTableColFrame*)eTail.get())->SetColIndex(colIndex); 1.97 + colIndex++; 1.98 + } 1.99 + 1.100 + // We have already set the colindex for all the colframes in this 1.101 + // colgroup that come after the first inserted colframe, but there could 1.102 + // be other colgroups following this one and their colframes need 1.103 + // correct colindices too. 1.104 + if (aResetSubsequentColIndices && GetNextSibling()) { 1.105 + ResetColIndices(GetNextSibling(), colIndex); 1.106 + } 1.107 + 1.108 + return NS_OK; 1.109 +} 1.110 + 1.111 + 1.112 +nsTableColGroupFrame* 1.113 +nsTableColGroupFrame::GetLastRealColGroup(nsTableFrame* aTableFrame) 1.114 +{ 1.115 + nsFrameList colGroups = aTableFrame->GetColGroups(); 1.116 + 1.117 + nsIFrame* nextToLastColGroup = nullptr; 1.118 + nsFrameList::FrameLinkEnumerator link(colGroups); 1.119 + for ( ; !link.AtEnd(); link.Next()) { 1.120 + nextToLastColGroup = link.PrevFrame(); 1.121 + } 1.122 + 1.123 + if (!link.PrevFrame()) { 1.124 + return nullptr; // there are no col group frames 1.125 + } 1.126 + 1.127 + nsTableColGroupType lastColGroupType = 1.128 + static_cast<nsTableColGroupFrame*>(link.PrevFrame())->GetColType(); 1.129 + if (eColGroupAnonymousCell == lastColGroupType) { 1.130 + return static_cast<nsTableColGroupFrame*>(nextToLastColGroup); 1.131 + } 1.132 + 1.133 + return static_cast<nsTableColGroupFrame*>(link.PrevFrame()); 1.134 +} 1.135 + 1.136 +// don't set mColCount here, it is done in AddColsToTable 1.137 +nsresult 1.138 +nsTableColGroupFrame::SetInitialChildList(ChildListID aListID, 1.139 + nsFrameList& aChildList) 1.140 +{ 1.141 + if (!mFrames.IsEmpty()) { 1.142 + // We already have child frames which means we've already been 1.143 + // initialized 1.144 + NS_NOTREACHED("unexpected second call to SetInitialChildList"); 1.145 + return NS_ERROR_UNEXPECTED; 1.146 + } 1.147 + if (aListID != kPrincipalList) { 1.148 + // All we know about is the principal child list. 1.149 + NS_NOTREACHED("unknown frame list"); 1.150 + return NS_ERROR_INVALID_ARG; 1.151 + } 1.152 + nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); 1.153 + if (aChildList.IsEmpty()) { 1.154 + tableFrame->AppendAnonymousColFrames(this, GetSpan(), eColAnonymousColGroup, 1.155 + false); 1.156 + return NS_OK; 1.157 + } 1.158 + 1.159 + mFrames.AppendFrames(this, aChildList); 1.160 + return NS_OK; 1.161 +} 1.162 + 1.163 +/* virtual */ void 1.164 +nsTableColGroupFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext) 1.165 +{ 1.166 + nsContainerFrame::DidSetStyleContext(aOldStyleContext); 1.167 + 1.168 + if (!aOldStyleContext) //avoid this on init 1.169 + return; 1.170 + 1.171 + nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); 1.172 + if (tableFrame->IsBorderCollapse() && 1.173 + tableFrame->BCRecalcNeeded(aOldStyleContext, StyleContext())) { 1.174 + int32_t colCount = GetColCount(); 1.175 + if (!colCount) 1.176 + return; // this is a degenerated colgroup 1.177 + nsIntRect damageArea(GetFirstColumn()->GetColIndex(), 0, colCount, 1.178 + tableFrame->GetRowCount()); 1.179 + tableFrame->AddBCDamageArea(damageArea); 1.180 + } 1.181 +} 1.182 + 1.183 +nsresult 1.184 +nsTableColGroupFrame::AppendFrames(ChildListID aListID, 1.185 + nsFrameList& aFrameList) 1.186 +{ 1.187 + NS_ASSERTION(aListID == kPrincipalList, "unexpected child list"); 1.188 + 1.189 + nsTableColFrame* col = GetFirstColumn(); 1.190 + nsTableColFrame* nextCol; 1.191 + while (col && col->GetColType() == eColAnonymousColGroup) { 1.192 + // this colgroup spans one or more columns but now that there is a 1.193 + // real column below, spanned anonymous columns should be removed, 1.194 + // since the HTML spec says to ignore the span of a colgroup if it 1.195 + // has content columns in it. 1.196 + nextCol = col->GetNextCol(); 1.197 + RemoveFrame(kPrincipalList, col); 1.198 + col = nextCol; 1.199 + } 1.200 + 1.201 + const nsFrameList::Slice& newFrames = 1.202 + mFrames.AppendFrames(this, aFrameList); 1.203 + InsertColsReflow(GetStartColumnIndex() + mColCount, newFrames); 1.204 + return NS_OK; 1.205 +} 1.206 + 1.207 +nsresult 1.208 +nsTableColGroupFrame::InsertFrames(ChildListID aListID, 1.209 + nsIFrame* aPrevFrame, 1.210 + nsFrameList& aFrameList) 1.211 +{ 1.212 + NS_ASSERTION(aListID == kPrincipalList, "unexpected child list"); 1.213 + NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this, 1.214 + "inserting after sibling frame with different parent"); 1.215 + 1.216 + nsTableColFrame* col = GetFirstColumn(); 1.217 + nsTableColFrame* nextCol; 1.218 + while (col && col->GetColType() == eColAnonymousColGroup) { 1.219 + // this colgroup spans one or more columns but now that there is a 1.220 + // real column below, spanned anonymous columns should be removed, 1.221 + // since the HTML spec says to ignore the span of a colgroup if it 1.222 + // has content columns in it. 1.223 + nextCol = col->GetNextCol(); 1.224 + if (col == aPrevFrame) { 1.225 + // This can happen when we're being appended to 1.226 + NS_ASSERTION(!nextCol || nextCol->GetColType() != eColAnonymousColGroup, 1.227 + "Inserting in the middle of our anonymous cols?"); 1.228 + // We'll want to insert at the beginning 1.229 + aPrevFrame = nullptr; 1.230 + } 1.231 + RemoveFrame(kPrincipalList, col); 1.232 + col = nextCol; 1.233 + } 1.234 + 1.235 + NS_ASSERTION(!aPrevFrame || aPrevFrame == aPrevFrame->LastContinuation(), 1.236 + "Prev frame should be last in continuation chain"); 1.237 + NS_ASSERTION(!aPrevFrame || !GetNextColumn(aPrevFrame) || 1.238 + GetNextColumn(aPrevFrame)->GetColType() != eColAnonymousCol, 1.239 + "Shouldn't be inserting before a spanned colframe"); 1.240 + 1.241 + const nsFrameList::Slice& newFrames = 1.242 + mFrames.InsertFrames(this, aPrevFrame, aFrameList); 1.243 + nsIFrame* prevFrame = nsTableFrame::GetFrameAtOrBefore(this, aPrevFrame, 1.244 + nsGkAtoms::tableColFrame); 1.245 + 1.246 + int32_t colIndex = (prevFrame) ? ((nsTableColFrame*)prevFrame)->GetColIndex() + 1 : GetStartColumnIndex(); 1.247 + InsertColsReflow(colIndex, newFrames); 1.248 + 1.249 + return NS_OK; 1.250 +} 1.251 + 1.252 +void 1.253 +nsTableColGroupFrame::InsertColsReflow(int32_t aColIndex, 1.254 + const nsFrameList::Slice& aCols) 1.255 +{ 1.256 + AddColsToTable(aColIndex, true, aCols); 1.257 + 1.258 + PresContext()->PresShell()->FrameNeedsReflow(this, 1.259 + nsIPresShell::eTreeChange, 1.260 + NS_FRAME_HAS_DIRTY_CHILDREN); 1.261 +} 1.262 + 1.263 +void 1.264 +nsTableColGroupFrame::RemoveChild(nsTableColFrame& aChild, 1.265 + bool aResetSubsequentColIndices) 1.266 +{ 1.267 + int32_t colIndex = 0; 1.268 + nsIFrame* nextChild = nullptr; 1.269 + if (aResetSubsequentColIndices) { 1.270 + colIndex = aChild.GetColIndex(); 1.271 + nextChild = aChild.GetNextSibling(); 1.272 + } 1.273 + mFrames.DestroyFrame(&aChild); 1.274 + mColCount--; 1.275 + if (aResetSubsequentColIndices) { 1.276 + if (nextChild) { // reset inside this and all following colgroups 1.277 + ResetColIndices(this, colIndex, nextChild); 1.278 + } 1.279 + else { 1.280 + nsIFrame* nextGroup = GetNextSibling(); 1.281 + if (nextGroup) // reset next and all following colgroups 1.282 + ResetColIndices(nextGroup, colIndex); 1.283 + } 1.284 + } 1.285 + 1.286 + PresContext()->PresShell()->FrameNeedsReflow(this, 1.287 + nsIPresShell::eTreeChange, 1.288 + NS_FRAME_HAS_DIRTY_CHILDREN); 1.289 +} 1.290 + 1.291 +nsresult 1.292 +nsTableColGroupFrame::RemoveFrame(ChildListID aListID, 1.293 + nsIFrame* aOldFrame) 1.294 +{ 1.295 + NS_ASSERTION(aListID == kPrincipalList, "unexpected child list"); 1.296 + 1.297 + if (!aOldFrame) return NS_OK; 1.298 + bool contentRemoval = false; 1.299 + 1.300 + if (nsGkAtoms::tableColFrame == aOldFrame->GetType()) { 1.301 + nsTableColFrame* colFrame = (nsTableColFrame*)aOldFrame; 1.302 + if (colFrame->GetColType() == eColContent) { 1.303 + contentRemoval = true; 1.304 + // Remove any anonymous column frames this <col> produced via a colspan 1.305 + nsTableColFrame* col = colFrame->GetNextCol(); 1.306 + nsTableColFrame* nextCol; 1.307 + while (col && col->GetColType() == eColAnonymousCol) { 1.308 +#ifdef DEBUG 1.309 + nsIFrame* providerFrame = colFrame->GetParentStyleContextFrame(); 1.310 + if (colFrame->StyleContext()->GetParent() == 1.311 + providerFrame->StyleContext()) { 1.312 + NS_ASSERTION(col->StyleContext() == colFrame->StyleContext() && 1.313 + col->GetContent() == colFrame->GetContent(), 1.314 + "How did that happen??"); 1.315 + } 1.316 + // else colFrame is being removed because of a frame 1.317 + // reconstruct on it, and its style context is still the old 1.318 + // one, so we can't assert anything about how it compares to 1.319 + // col's style context. 1.320 +#endif 1.321 + nextCol = col->GetNextCol(); 1.322 + RemoveFrame(kPrincipalList, col); 1.323 + col = nextCol; 1.324 + } 1.325 + } 1.326 + 1.327 + int32_t colIndex = colFrame->GetColIndex(); 1.328 + // The RemoveChild call handles calling FrameNeedsReflow on us. 1.329 + RemoveChild(*colFrame, true); 1.330 + 1.331 + nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); 1.332 + tableFrame->RemoveCol(this, colIndex, true, true); 1.333 + if (mFrames.IsEmpty() && contentRemoval && 1.334 + GetColType() == eColGroupContent) { 1.335 + tableFrame->AppendAnonymousColFrames(this, GetSpan(), 1.336 + eColAnonymousColGroup, true); 1.337 + } 1.338 + } 1.339 + else { 1.340 + mFrames.DestroyFrame(aOldFrame); 1.341 + } 1.342 + 1.343 + return NS_OK; 1.344 +} 1.345 + 1.346 +int 1.347 +nsTableColGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const 1.348 +{ 1.349 + int skip = 0; 1.350 + if (nullptr != GetPrevInFlow()) { 1.351 + skip |= 1 << LOGICAL_SIDE_B_START; 1.352 + } 1.353 + if (nullptr != GetNextInFlow()) { 1.354 + skip |= 1 << LOGICAL_SIDE_B_END; 1.355 + } 1.356 + return skip; 1.357 +} 1.358 + 1.359 +nsresult nsTableColGroupFrame::Reflow(nsPresContext* aPresContext, 1.360 + nsHTMLReflowMetrics& aDesiredSize, 1.361 + const nsHTMLReflowState& aReflowState, 1.362 + nsReflowStatus& aStatus) 1.363 +{ 1.364 + DO_GLOBAL_REFLOW_COUNT("nsTableColGroupFrame"); 1.365 + DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus); 1.366 + NS_ASSERTION(nullptr!=mContent, "bad state -- null content for frame"); 1.367 + nsresult rv=NS_OK; 1.368 + 1.369 + const nsStyleVisibility* groupVis = StyleVisibility(); 1.370 + bool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE == groupVis->mVisible); 1.371 + if (collapseGroup) { 1.372 + nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); 1.373 + tableFrame->SetNeedToCollapse(true); 1.374 + } 1.375 + // for every content child that (is a column thingy and does not already have a frame) 1.376 + // create a frame and adjust it's style 1.377 + 1.378 + for (nsIFrame *kidFrame = mFrames.FirstChild(); kidFrame; 1.379 + kidFrame = kidFrame->GetNextSibling()) { 1.380 + // Give the child frame a chance to reflow, even though we know it'll have 0 size 1.381 + nsHTMLReflowMetrics kidSize(aReflowState); 1.382 + nsHTMLReflowState kidReflowState(aPresContext, aReflowState, kidFrame, 1.383 + nsSize(0,0)); 1.384 + 1.385 + nsReflowStatus status; 1.386 + ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, 0, 0, 0, status); 1.387 + FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0, 0); 1.388 + } 1.389 + 1.390 + aDesiredSize.Width() = 0; 1.391 + aDesiredSize.Height() = 0; 1.392 + aStatus = NS_FRAME_COMPLETE; 1.393 + NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); 1.394 + return rv; 1.395 +} 1.396 + 1.397 +nsTableColFrame * nsTableColGroupFrame::GetFirstColumn() 1.398 +{ 1.399 + return GetNextColumn(nullptr); 1.400 +} 1.401 + 1.402 +nsTableColFrame * nsTableColGroupFrame::GetNextColumn(nsIFrame *aChildFrame) 1.403 +{ 1.404 + nsTableColFrame *result = nullptr; 1.405 + nsIFrame *childFrame = aChildFrame; 1.406 + if (!childFrame) { 1.407 + childFrame = mFrames.FirstChild(); 1.408 + } 1.409 + else { 1.410 + childFrame = childFrame->GetNextSibling(); 1.411 + } 1.412 + while (childFrame) 1.413 + { 1.414 + if (NS_STYLE_DISPLAY_TABLE_COLUMN == 1.415 + childFrame->StyleDisplay()->mDisplay) 1.416 + { 1.417 + result = (nsTableColFrame *)childFrame; 1.418 + break; 1.419 + } 1.420 + childFrame = childFrame->GetNextSibling(); 1.421 + } 1.422 + return result; 1.423 +} 1.424 + 1.425 +int32_t nsTableColGroupFrame::GetSpan() 1.426 +{ 1.427 + return StyleTable()->mSpan; 1.428 +} 1.429 + 1.430 +void nsTableColGroupFrame::SetContinuousBCBorderWidth(uint8_t aForSide, 1.431 + BCPixelSize aPixelValue) 1.432 +{ 1.433 + switch (aForSide) { 1.434 + case NS_SIDE_TOP: 1.435 + mTopContBorderWidth = aPixelValue; 1.436 + return; 1.437 + case NS_SIDE_BOTTOM: 1.438 + mBottomContBorderWidth = aPixelValue; 1.439 + return; 1.440 + default: 1.441 + NS_ERROR("invalid side arg"); 1.442 + } 1.443 +} 1.444 + 1.445 +void nsTableColGroupFrame::GetContinuousBCBorderWidth(nsMargin& aBorder) 1.446 +{ 1.447 + int32_t aPixelsToTwips = nsPresContext::AppUnitsPerCSSPixel(); 1.448 + nsTableFrame* table = nsTableFrame::GetTableFrame(this); 1.449 + nsTableColFrame* col = table->GetColFrame(mStartColIndex + mColCount - 1); 1.450 + col->GetContinuousBCBorderWidth(aBorder); 1.451 + aBorder.top = BC_BORDER_BOTTOM_HALF_COORD(aPixelsToTwips, 1.452 + mTopContBorderWidth); 1.453 + aBorder.bottom = BC_BORDER_TOP_HALF_COORD(aPixelsToTwips, 1.454 + mBottomContBorderWidth); 1.455 +} 1.456 + 1.457 +/* ----- global methods ----- */ 1.458 + 1.459 +nsIFrame* 1.460 +NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) 1.461 +{ 1.462 + return new (aPresShell) nsTableColGroupFrame(aContext); 1.463 +} 1.464 + 1.465 +NS_IMPL_FRAMEARENA_HELPERS(nsTableColGroupFrame) 1.466 + 1.467 +nsIAtom* 1.468 +nsTableColGroupFrame::GetType() const 1.469 +{ 1.470 + return nsGkAtoms::tableColGroupFrame; 1.471 +} 1.472 + 1.473 +void 1.474 +nsTableColGroupFrame::InvalidateFrame(uint32_t aDisplayItemKey) 1.475 +{ 1.476 + nsIFrame::InvalidateFrame(aDisplayItemKey); 1.477 + GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey); 1.478 +} 1.479 + 1.480 +void 1.481 +nsTableColGroupFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey) 1.482 +{ 1.483 + nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey); 1.484 + // If we have filters applied that would affects our bounds, then 1.485 + // we get an inactive layer created and this is computed 1.486 + // within FrameLayerBuilder 1.487 + GetParent()->InvalidateFrameWithRect(aRect + GetPosition(), aDisplayItemKey); 1.488 +} 1.489 + 1.490 +#ifdef DEBUG_FRAME_DUMP 1.491 +nsresult 1.492 +nsTableColGroupFrame::GetFrameName(nsAString& aResult) const 1.493 +{ 1.494 + return MakeFrameName(NS_LITERAL_STRING("TableColGroup"), aResult); 1.495 +} 1.496 + 1.497 +void nsTableColGroupFrame::Dump(int32_t aIndent) 1.498 +{ 1.499 + char* indent = new char[aIndent + 1]; 1.500 + if (!indent) return; 1.501 + for (int32_t i = 0; i < aIndent + 1; i++) { 1.502 + indent[i] = ' '; 1.503 + } 1.504 + indent[aIndent] = 0; 1.505 + 1.506 + printf("%s**START COLGROUP DUMP**\n%s startcolIndex=%d colcount=%d span=%d coltype=", 1.507 + indent, indent, GetStartColumnIndex(), GetColCount(), GetSpan()); 1.508 + nsTableColGroupType colType = GetColType(); 1.509 + switch (colType) { 1.510 + case eColGroupContent: 1.511 + printf(" content "); 1.512 + break; 1.513 + case eColGroupAnonymousCol: 1.514 + printf(" anonymous-column "); 1.515 + break; 1.516 + case eColGroupAnonymousCell: 1.517 + printf(" anonymous-cell "); 1.518 + break; 1.519 + } 1.520 + // verify the colindices 1.521 + int32_t j = GetStartColumnIndex(); 1.522 + nsTableColFrame* col = GetFirstColumn(); 1.523 + while (col) { 1.524 + NS_ASSERTION(j == col->GetColIndex(), "wrong colindex on col frame"); 1.525 + col = col->GetNextCol(); 1.526 + j++; 1.527 + } 1.528 + NS_ASSERTION((j - GetStartColumnIndex()) == GetColCount(), 1.529 + "number of cols out of sync"); 1.530 + printf("\n%s**END COLGROUP DUMP** ", indent); 1.531 + delete [] indent; 1.532 +} 1.533 +#endif