Changeset 28118 in webkit
- Timestamp:
- Nov 28, 2007, 2:04:44 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r28113 r28118 1 2007-11-28 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 - test for <rdar://problem/5612459> CrashTracer: [REGRESSION] 61 crashes in Safari at com.apple.WebCore: WebCore::AutoTableLayout::layout + 2046 6 7 * fast/table/empty-auto-column-zero-divide-expected.txt: Added. 8 * fast/table/empty-auto-column-zero-divide.html: Added. 9 1 10 2007-11-28 Jon Honeycutt <jhoneycutt@apple.com> 2 11 -
trunk/WebCore/ChangeLog
r28114 r28118 1 2007-11-28 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 - fix <rdar://problem/5612459> CrashTracer: [REGRESSION] 61 crashes in Safari at com.apple.WebCore: WebCore::AutoTableLayout::layout + 2046 6 7 Test: fast/table/empty-auto-column-zero-divide.html 8 9 * rendering/AutoTableLayout.cpp: 10 (WebCore::AutoTableLayout::recalcColumn): 11 (WebCore::AutoTableLayout::fullRecalc): 12 (WebCore::AutoTableLayout::calcEffectiveWidth): 13 (WebCore::AutoTableLayout::layout): When distributing the remaining 14 width among columns, skip those whose effective (rather than 15 specified) width is auto and contain only empty cells. 16 1 17 2007-11-28 Peter Kasting <zerodpx@gmail.com> 2 18 -
trunk/WebCore/rendering/AutoTableLayout.cpp
r25754 r28118 150 150 151 151 l.maxWidth = max(l.maxWidth, l.minWidth); 152 #ifdef DEBUG_LAYOUT153 qDebug("col %d, final min=%d, max=%d, width=%d(%d)", effCol, l.minWidth, l.maxWidth, l.width.value, l.width.type);154 #endif155 152 156 153 // ### we need to add col elements as well … … 184 181 w = Length(); 185 182 int cEffCol = m_table->colToEffCol(cCol); 186 #ifdef DEBUG_LAYOUT187 qDebug(" col element %d (eff=%d): Length=%d(%d), span=%d, effColSpan=%d", cCol, cEffCol, w.value, w.type, span, m_table->spanOfEffCol(cEffCol));188 #endif189 183 if (!w.isAuto() && span == 1 && cEffCol < nEffCols) { 190 184 if (m_table->spanOfEffCol(cEffCol) == 1) { … … 307 301 unsigned int nEffCols = m_layoutStruct.size(); 308 302 int hspacing = m_table->hBorderSpacing(); 309 #ifdef DEBUG_LAYOUT 310 qDebug("AutoTableLayout::calcEffectiveWidth for %d cols", nEffCols); 311 #endif 303 312 304 for (unsigned int i = 0; i < nEffCols; i++) { 313 305 m_layoutStruct[i].effWidth = m_layoutStruct[i].width; … … 513 505 nEffCols = m_table->numEffCols(); 514 506 } 515 #ifdef DEBUG_LAYOUT516 qDebug("AutoTableLayout::layout()");517 #endif518 507 519 508 if (m_effWidthDirty) 520 509 calcEffectiveWidth(); 521 522 #ifdef DEBUG_LAYOUT523 qDebug(" tableWidth=%d, nEffCols=%d", tableWidth, nEffCols);524 for (int i = 0; i < nEffCols; i++) {525 qDebug(" effcol %d is of type %d value %d, minWidth=%d, maxWidth=%d",526 i, m_layoutStruct[i].width.type, m_layoutStruct[i].width.value,527 m_layoutStruct[i].minWidth, m_layoutStruct[i].maxWidth);528 qDebug(" effective: type %d value %d, minWidth=%d, maxWidth=%d",529 m_layoutStruct[i].effWidth.type, m_layoutStruct[i].effWidth.value,530 m_layoutStruct[i].effMinWidth, m_layoutStruct[i].effMaxWidth);531 }532 #endif533 510 534 511 bool havePercent = false; … … 604 581 } 605 582 } 606 #ifdef DEBUG_LAYOUT607 qDebug("percent satisfied: available is %d", available);608 #endif609 583 610 584 // then allocate width to fixed cols … … 618 592 } 619 593 } 620 #ifdef DEBUG_LAYOUT621 qDebug("fixed satisfied: available is %d", available);622 #endif623 594 624 595 // now satisfy relative … … 648 619 } 649 620 } 650 #ifdef DEBUG_LAYOUT651 qDebug("variable satisfied: available is %d", available);652 #endif653 621 654 622 // spread over fixed columns … … 665 633 } 666 634 } 667 668 #ifdef DEBUG_LAYOUT 669 qDebug("after fixed distribution: available=%d", available); 670 #endif 671 635 672 636 // spread over percent colums 673 637 if (available > 0 && m_hasPercent && totalPercent < 100 * percentScaleFactor) { … … 685 649 } 686 650 687 #ifdef DEBUG_LAYOUT688 qDebug("after percent distribution: available=%d", available);689 #endif690 691 651 // spread over the rest 692 652 if (available > 0 && nEffCols > numAutoEmptyCellsOnly) { … … 696 656 while (i--) { 697 657 // variable columns with empty cells only don't get any width 698 if (m_layoutStruct[i]. width.isAuto() && m_layoutStruct[i].emptyCellsOnly)658 if (m_layoutStruct[i].effWidth.isAuto() && m_layoutStruct[i].emptyCellsOnly) 699 659 continue; 700 660 int w = available / total; … … 705 665 } 706 666 707 #ifdef DEBUG_LAYOUT708 qDebug("after equal distribution: available=%d", available);709 #endif710 667 // if we have overallocated, reduce every cell according to the difference between desired width and minwidth 711 668 // this seems to produce to the pixel exaxt results with IE. Wonder is some of this also holds for width distributing. … … 808 765 int pos = 0; 809 766 for (int i = 0; i < nEffCols; i++) { 810 #ifdef DEBUG_LAYOUT811 qDebug("col %d: %d (width %d)", i, pos, m_layoutStruct[i].calcWidth);812 #endif813 767 m_table->columnPositions()[i] = pos; 814 768 pos += m_layoutStruct[i].calcWidth + m_table->hBorderSpacing();
Note:
See TracChangeset
for help on using the changeset viewer.