Changeset 18634 in webkit
- Timestamp:
- Jan 5, 2007 3:03:50 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r18620 r18634 1 2007-01-05 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Hyatt. 4 5 - repaint tests and updated results for 6 http://bugs.webkit.org/show_bug.cgi?id=12079 7 Nested tables don't repaint properly when a certain row is added 8 9 * fast/repaint/table-section-overflow-expected.checksum: Added. 10 * fast/repaint/table-section-overflow-expected.png: Added. 11 * fast/repaint/table-section-overflow-expected.txt: Added. 12 * fast/repaint/table-section-overflow.html: Added. 13 * fast/repaint/table-section-repaint-expected.checksum: Added. 14 * fast/repaint/table-section-repaint-expected.png: Added. 15 * fast/repaint/table-section-repaint-expected.txt: Added. 16 * fast/repaint/table-section-repaint.html: Added. 17 * tables/mozilla/core/misc-expected.txt: 18 * tables/mozilla/core/misc-expected.png: 19 * tables/mozilla/core/misc-expected.checksum: 20 1 21 2007-01-05 Alexey Proskuryakov <ap@webkit.org> 2 22 -
trunk/LayoutTests/tables/mozilla/core/misc-expected.checksum
r16432 r18634 1 70242afa1f6d5c7d6c7dc9bec4eeed53 1 f3e8ac5f89b07679968161599c0e5f42 -
trunk/LayoutTests/tables/mozilla/core/misc-expected.txt
r15011 r18634 1 1 layer at (0,0) size 812x585 2 2 RenderView at (0,0) size 800x585 3 layer at (0,0) size 8 00x5853 layer at (0,0) size 812x585 4 4 RenderBlock {HTML} at (0,0) size 800x585 5 5 RenderBody {BODY} at (8,8) size 784x569 -
trunk/WebCore/ChangeLog
r18633 r18634 1 2007-01-05 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Hyatt. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=12079 6 Nested tables don't repaint properly when a certain row is added 7 8 Tests: fast/repaint/table-section-repaint.html 9 fast/repaint/table-section-overflow.html 10 11 Fixed repainting when table sections move during layout. 12 13 Made table cells' overflows propagate to table sections and gave tables 14 overflows. 15 16 * rendering/RenderTable.cpp: 17 (WebCore::RenderTable::layout): Added computation of horizontal and vertical overflows 18 based on the caption's and the table sections' overflows. 19 Added checks for table sections that change position during layout. When that happens, 20 we assume all sections below the first section that moved also moved, and repaint 21 everything downwards from there. 22 Added calls to repaintDuringLayoutIfMoved() for the caption. 23 Changed the way table sections are iterated over and added a FIXME to change it again 24 once bug 12124 is fixed. 25 (WebCore::RenderTable::paint): Changed to paint overflow. 26 (WebCore::RenderTable::outerBorderBottom): 27 * rendering/RenderTableSection.cpp: 28 (WebCore::RenderTableSection::RenderTableSection): 29 (WebCore::RenderTableSection::layoutRows): Added code to compute the section's overflow 30 and a flag saying whether any cells in this section overflow. 31 (WebCore::RenderTableSection::paint): Changed to paint overflow. If any cell 32 in the section has overflow, then all cells are given a chance to paint. This is needed 33 because there can be internal overflow, and external overflow can be coming from any 34 cell inside. 35 * rendering/RenderTableSection.h: 36 (WebCore::RenderTableSection::overflowWidth): 37 (WebCore::RenderTableSection::overflowLeft): 38 1 39 2007-01-05 Beth Dakin <bdakin@apple.com> 2 40 -
trunk/WebCore/rendering/RenderTable.cpp
r18608 r18634 33 33 #include "Document.h" 34 34 #include "FixedTableLayout.h" 35 #include "FrameView.h" 35 36 #include "HTMLNames.h" 36 37 #include "RenderTableCell.h" 37 38 #include "RenderTableCol.h" 38 39 #include "RenderTableSection.h" 40 #include "RenderView.h" 39 41 #include "TextStream.h" 40 42 … … 256 258 m_height = 0; 257 259 m_overflowHeight = 0; 260 m_overflowTop = 0; 258 261 initMaxMarginValues(); 259 262 260 263 //int oldWidth = m_width; 261 264 calcWidth(); 265 266 m_overflowWidth = m_width + (collapseBorders() ? outerBorderRight() - borderRight() : 0); 267 m_overflowLeft = collapseBorders() ? borderLeft() - outerBorderLeft() : 0; 262 268 263 269 // FIXME: The optimisation below doesn't work since the internal table … … 272 278 // layout child objects 273 279 int calculatedHeight = 0; 280 int oldTableTop = m_caption ? m_caption->height() + m_caption->marginTop() + m_caption->marginBottom() : 0; 274 281 275 282 RenderObject* child = firstChild(); … … 285 292 } 286 293 287 m_overflowWidth = m_width + (collapseBorders() ? outerBorderRight() - borderRight() : 0); 288 m_overflowLeft = collapseBorders() ? borderLeft() - outerBorderLeft() : 0; 294 // If any table section moved vertically, we will just repaint everything from that 295 // section down (it is quite unlikely that any of the following sections 296 // did not shift). 297 bool sectionMoved = false; 298 int movedSectionTop = 0; 289 299 290 300 // FIXME: Collapse caption margin. 291 301 if (m_caption && m_caption->style()->captionSide() != CAPBOTTOM) { 302 IntRect captionRect(m_caption->xPos(), m_caption->yPos(), m_caption->width(), m_caption->height()); 303 292 304 m_caption->setPos(m_caption->marginLeft(), m_height); 305 if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout()) 306 m_caption->repaintDuringLayoutIfMoved(captionRect); 307 293 308 m_height += m_caption->height() + m_caption->marginTop() + m_caption->marginBottom(); 309 m_overflowLeft = min(m_overflowLeft, m_caption->xPos() + m_caption->overflowLeft(false)); 310 m_overflowWidth = max(m_overflowWidth, m_caption->xPos() + m_caption->overflowWidth(false)); 311 m_overflowTop = min(m_overflowTop, m_caption->yPos() + m_caption->overflowTop(false)); 312 m_overflowHeight = max(m_overflowHeight, m_caption->yPos() + m_caption->overflowHeight(false)); 313 314 if (m_height != oldTableTop) { 315 sectionMoved = true; 316 movedSectionTop = min(m_height, oldTableTop); 317 } 294 318 } 295 319 … … 333 357 334 358 // position the table sections 335 if (m_head) { 336 m_head->setPos(bl, m_height); 337 m_height += m_head->height(); 338 } 339 for (RenderObject* body = m_firstBody; body; body = body->nextSibling()) { 340 if (body != m_head && body != m_foot && body->isTableSection()) { 341 body->setPos(bl, m_height); 342 m_height += body->height(); 343 } 344 } 345 if (m_foot) { 346 m_foot->setPos(bl, m_height); 347 m_height += m_foot->height(); 359 RenderObject* section = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot); 360 while (section) { 361 if (!sectionMoved && section->yPos() != m_height) { 362 sectionMoved = true; 363 movedSectionTop = min(m_height, section->yPos()); 364 } 365 section->setPos(bl, m_height); 366 367 m_height += section->height(); 368 m_overflowLeft = min(m_overflowLeft, section->xPos() + section->overflowLeft(false)); 369 m_overflowWidth = max(m_overflowWidth, section->xPos() + section->overflowWidth(false)); 370 // FIXME: Use sectionBelow() instead of the following once sectionBelow() is fixed. 371 // See http://bugs.webkit.org/show_bug.cgi?id=12124 372 if (section == m_foot) 373 break; 374 if (section == m_head) 375 section = m_firstBody ? m_firstBody : m_foot; 376 else { 377 do { 378 section = section->nextSibling(); 379 } while (section && (section == m_head || section == m_foot || !section->isTableSection())); 380 if (!section) 381 section = m_foot; 382 } 348 383 } 349 384 350 385 m_height += bpBottom; 351 386 352 387 if (m_caption && m_caption->style()->captionSide() == CAPBOTTOM) { 388 IntRect captionRect(m_caption->xPos(), m_caption->yPos(), m_caption->width(), m_caption->height()); 389 353 390 m_caption->setPos(m_caption->marginLeft(), m_height); 391 if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout()) 392 m_caption->repaintDuringLayoutIfMoved(captionRect); 393 354 394 m_height += m_caption->height() + m_caption->marginTop() + m_caption->marginBottom(); 395 m_overflowLeft = min(m_overflowLeft, m_caption->xPos() + m_caption->overflowLeft(false)); 396 m_overflowWidth = max(m_overflowWidth, m_caption->xPos() + m_caption->overflowWidth(false)); 355 397 } 356 398 357 399 if (isPositioned()) 358 400 calcHeight(); 401 402 m_overflowHeight = max(m_overflowHeight, m_height); 359 403 360 404 // table can be containing block of positioned elements. … … 362 406 layoutPositionedObjects(true); 363 407 408 bool didFullRepaint = true; 364 409 // Repaint with our new bounds if they are different from our old bounds. 365 410 if (checkForRepaint) 366 repaintAfterLayoutIfNeeded(oldBounds, oldFullBounds); 411 didFullRepaint = repaintAfterLayoutIfNeeded(oldBounds, oldFullBounds); 412 if (!didFullRepaint && sectionMoved) { 413 IntRect repaintRect(m_overflowLeft, movedSectionTop, m_overflowWidth - m_overflowLeft, m_overflowHeight - movedSectionTop); 414 view()->frameView()->addRepaintInfo(this, repaintRect); 415 } 367 416 368 417 setNeedsLayout(false); … … 385 434 386 435 int os = 2 * maximalOutlineSize(paintPhase); 387 if (ty >= paintInfo.rect.bottom() + os || ty + height() <= paintInfo.rect.y() - os)436 if (ty + overflowTop() >= paintInfo.rect.bottom() + os || ty + overflowHeight() <= paintInfo.rect.y() - os) 388 437 return; 389 if (tx >= paintInfo.rect.right() + os || tx + width() <= paintInfo.rect.x() - os)438 if (tx + overflowLeft() >= paintInfo.rect.right() + os || tx + overflowWidth() <= paintInfo.rect.x() - os) 390 439 return; 391 440 … … 797 846 else { 798 847 RenderObject* child; 799 for (child = lastChild(); child && !child->isTableSection(); child = child->previousSibling()); 848 for (child = lastChild(); child && !child->isTableSection(); child = child->previousSibling()) 849 ; 800 850 bottomSection = child ? static_cast<RenderTableSection*>(child) : 0; 801 851 } -
trunk/WebCore/rendering/RenderTableSection.cpp
r18608 r18634 54 54 , m_outerBorderTop(0) 55 55 , m_outerBorderBottom(0) 56 , m_overflowLeft(0) 57 , m_overflowWidth(0) 58 , m_hasOverflowingCell(false) 56 59 { 57 60 // init RenderObject attributes … … 362 365 // Set the width of our section now. The rows will also be this width. 363 366 m_width = table()->contentWidth(); 367 m_overflowLeft = 0; 368 m_overflowWidth = m_width; 369 m_hasOverflowingCell = false; 370 364 371 if (table()->collapseBorders()) 365 372 recalcOuterBorder(); … … 430 437 for (int r = 0; r < totalRows; r++) { 431 438 // Set the row's x/y position and width/height. 432 if ( m_grid[r].rowRenderer) {433 m_grid[r].rowRenderer->setPos(0, m_rowPos[r]);434 m_grid[r].rowRenderer->setWidth(m_width);435 m_grid[r].rowRenderer->setHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing);439 if (RenderObject* rowRenderer = m_grid[r].rowRenderer) { 440 rowRenderer->setPos(0, m_rowPos[r]); 441 rowRenderer->setWidth(m_width); 442 rowRenderer->setHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing); 436 443 } 437 444 … … 444 451 continue; 445 452 446 if ((rindx = r - cell->rowSpan() + 1) < 0) 447 rindx = 0; 453 rindx = max(0, r - cell->rowSpan() + 1); 448 454 449 455 rHeight = m_rowPos[r + 1] - m_rowPos[rindx] - vspacing; … … 516 522 cell->setCellTopExtra(te); 517 523 cell->setCellBottomExtra(be); 518 if ( !table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout() && (te != oldTe || be > oldBe))524 if ((te != oldTe || be > oldBe) && !table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout()) 519 525 cell->repaint(); 520 526 } … … 526 532 } else 527 533 cell->setPos(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]); 534 535 m_overflowLeft = min(m_overflowLeft, cell->xPos() + cell->overflowLeft(false)); 536 m_overflowWidth = max(m_overflowWidth, cell->xPos() + cell->overflowWidth(false)); 537 m_hasOverflowingCell |= cell->overflowLeft(false) || cell->overflowWidth(false) > cell->width(); 528 538 529 539 // If the cell moved, we have to repaint it as well as any floating/positioned … … 835 845 unsigned startcol = 0; 836 846 unsigned endcol = totalCols; 837 if (style()->direction() == LTR) { 847 // If some cell overflows, just paint all of them. 848 // FIXME: Implement RTL. 849 if (!m_hasOverflowingCell && style()->direction() == LTR) { 838 850 for (; startcol < totalCols; startcol++) { 839 851 if (tx + table()->columnPositions()[startcol + 1] >= x - os) -
trunk/WebCore/rendering/RenderTableSection.h
r18615 r18634 81 81 void splitColumn(int pos, int newSize); 82 82 83 virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_width : m_overflowWidth; } 84 virtual int overflowLeft(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowLeft; } 85 83 86 virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const; 84 87 virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const; … … 141 144 int m_outerBorderTop; 142 145 int m_outerBorderBottom; 146 int m_overflowLeft; 147 int m_overflowWidth; 148 bool m_hasOverflowingCell; 143 149 }; 144 150
Note: See TracChangeset
for help on using the changeset viewer.