Changeset 18516 in webkit
- Timestamp:
- Jan 1, 2007 8:37:43 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r18511 r18516 1 2007-01-01 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Darin. 4 5 - repaint test for http://bugs.webkit.org/show_bug.cgi?id=11359 6 Incomplete repaint of table cell's collapsed border when changing only the cell 7 8 * fast/repaint/table-cell-collapsed-border-expected.checksum: Added. 9 * fast/repaint/table-cell-collapsed-border-expected.png: Added. 10 * fast/repaint/table-cell-collapsed-border-expected.txt: Added. 11 * fast/repaint/table-cell-collapsed-border.html: Added. 12 1 13 2007-01-01 Mitz Pettel <mitz@webkit.org> 2 14 -
trunk/WebCore/ChangeLog
r18515 r18516 1 2007-01-01 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Darin. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=11359 6 Incomplete repaint of table cell's collapsed border when changing only the cell 7 8 Test: fast/repaint/table-cell-collapsed-border.html 9 10 * rendering/RenderTable.h: 11 Added needsSectionRecalc() accessor. 12 * rendering/RenderTableCell.cpp: 13 (WebCore::RenderTableCell::getAbsoluteRepaintRect): Overloaded to add the 14 outer half of any collapsed borders. This function checks the cell's borders' 15 widths but also the widths of the adjoining cells' borders, since they can 16 contribute to the length of this cell's borders perpendicular to them, making 17 such a border overflow the cell in both dimensions. 18 (WebCore::RenderTableCell::borderLeft): Split the collapsing borders case off to 19 borderHalfLeft(). 20 (WebCore::RenderTableCell::borderRight): Ditto. 21 (WebCore::RenderTableCell::borderTop): Ditto. 22 (WebCore::RenderTableCell::borderBottom): Ditto. 23 (WebCore::RenderTableCell::borderHalfLeft): Added. Takes an 'outer' boolean 24 parameter. When true, this function returns the width of the part of the border 25 that is outside the cell (different from the inner width when the total width is odd). 26 (WebCore::RenderTableCell::borderHalfRight): Ditto. 27 (WebCore::RenderTableCell::borderHalfTop): Ditto. 28 (WebCore::RenderTableCell::borderHalfBottom): Ditto. 29 * rendering/RenderTableCell.h: 30 1 31 2007-01-01 David Kilzer <ddkilzer@webkit.org> 2 32 -
trunk/WebCore/rendering/RenderTable.h
r17521 r18516 160 160 RenderTableCol* colElement(int col) const; 161 161 162 bool needsSectionRecalc() const { return needSectionRecalc; } 162 163 void setNeedSectionRecalc() { needSectionRecalc = true; } 163 164 -
trunk/WebCore/rendering/RenderTableCell.cpp
r18455 r18516 136 136 } 137 137 138 IntRect RenderTableCell::getAbsoluteRepaintRect() 139 { 140 // If the table grid is dirty, we cannot get reliable information about adjoining cells, 141 // so we ignore outside borders. This should not be a problem because it means that 142 // the table is going to recalculate the grid, relayout and repaint its current rect, which 143 // includes any outside borders of this cell. 144 if (table()->collapseBorders() && !table()->needsSectionRecalc()) { 145 bool rtl = table()->style()->direction() == RTL; 146 int outlineSize = style()->outlineSize(); 147 int left = max(borderHalfLeft(true), outlineSize); 148 int right = max(borderHalfRight(true), outlineSize); 149 int top = max(borderHalfTop(true), outlineSize); 150 int bottom = max(borderHalfBottom(true), outlineSize); 151 if (left && !rtl || right && rtl) { 152 if (RenderTableCell* before = table()->cellBefore(this)) { 153 top = max(top, before->borderHalfTop(true)); 154 bottom = max(bottom, before->borderHalfBottom(true)); 155 } 156 } 157 if (left && rtl || right && !rtl) { 158 if (RenderTableCell* after = table()->cellAfter(this)) { 159 top = max(top, after->borderHalfTop(true)); 160 bottom = max(bottom, after->borderHalfBottom(true)); 161 } 162 } 163 if (top) { 164 if (RenderTableCell* above = table()->cellAbove(this)) { 165 left = max(left, above->borderHalfLeft(true)); 166 right = max(right, above->borderHalfRight(true)); 167 } 168 } 169 if (bottom) { 170 if (RenderTableCell* below = table()->cellBelow(this)) { 171 left = max(left, below->borderHalfLeft(true)); 172 right = max(right, below->borderHalfRight(true)); 173 } 174 } 175 left = max(left, -overflowLeft(false)); 176 top = max(top, -overflowTop(false) - borderTopExtra()); 177 IntRect r(-left, -borderTopExtra() - top, left + max(width() + right, overflowWidth(false)), borderTopExtra() + top + max(height() + bottom + borderBottomExtra(), overflowHeight(false))); 178 computeAbsoluteRepaintRect(r); 179 return r; 180 } 181 return RenderBlock::getAbsoluteRepaintRect(); 182 } 183 138 184 void RenderTableCell::computeAbsoluteRepaintRect(IntRect& r, bool f) 139 185 { … … 488 534 int RenderTableCell::borderLeft() const 489 535 { 490 if (table()->collapseBorders()) { 491 CollapsedBorderValue border = collapsedLeftBorder(table()->style()->direction() == RTL); 492 if (border.exists()) 493 return (border.width() + 1) / 2; // Give the extra pixel to top and left. 494 return 0; 495 } 496 return RenderBlock::borderLeft(); 497 } 498 536 return table()->collapseBorders() ? borderHalfLeft(false) : RenderBlock::borderLeft(); 537 } 538 499 539 int RenderTableCell::borderRight() const 500 540 { 501 if (table()->collapseBorders()) { 502 CollapsedBorderValue border = collapsedRightBorder(table()->style()->direction() == RTL); 503 if (border.exists()) 504 return border.width() / 2; 505 return 0; 506 } 507 return RenderBlock::borderRight(); 541 return table()->collapseBorders() ? borderHalfRight(false) : RenderBlock::borderRight(); 508 542 } 509 543 510 544 int RenderTableCell::borderTop() const 511 545 { 512 if (table()->collapseBorders()) { 513 CollapsedBorderValue border = collapsedTopBorder(); 514 if (border.exists()) 515 return (border.width() + 1) / 2; // Give the extra pixel to top and left. 516 return 0; 517 } 518 return RenderBlock::borderTop(); 546 return table()->collapseBorders() ? borderHalfTop(false) : RenderBlock::borderTop(); 519 547 } 520 548 521 549 int RenderTableCell::borderBottom() const 522 550 { 523 if (table()->collapseBorders()) { 524 CollapsedBorderValue border = collapsedBottomBorder(); 525 if (border.exists()) 526 return border.width() / 2; 527 return 0; 528 } 529 return RenderBlock::borderBottom(); 551 return table()->collapseBorders() ? borderHalfBottom(false) : RenderBlock::borderBottom(); 552 } 553 554 int RenderTableCell::borderHalfLeft(bool outer) const 555 { 556 CollapsedBorderValue border = collapsedLeftBorder(table()->style()->direction() == RTL); 557 if (border.exists()) 558 return (border.width() + (outer ? 0 : 1)) / 2; // Give the extra pixel to top and left. 559 return 0; 560 } 561 562 int RenderTableCell::borderHalfRight(bool outer) const 563 { 564 CollapsedBorderValue border = collapsedRightBorder(table()->style()->direction() == RTL); 565 if (border.exists()) 566 return (border.width() + (outer ? 1 : 0)) / 2; 567 return 0; 568 } 569 570 int RenderTableCell::borderHalfTop(bool outer) const 571 { 572 CollapsedBorderValue border = collapsedTopBorder(); 573 if (border.exists()) 574 return (border.width() + (outer ? 0 : 1)) / 2; // Give the extra pixel to top and left. 575 return 0; 576 } 577 578 int RenderTableCell::borderHalfBottom(bool outer) const 579 { 580 CollapsedBorderValue border = collapsedBottomBorder(); 581 if (border.exists()) 582 return (border.width() + (outer ? 1 : 0)) / 2; 583 return 0; 530 584 } 531 585 -
trunk/WebCore/rendering/RenderTableCell.h
r18455 r18516 72 72 int borderBottom() const; 73 73 74 int borderHalfLeft(bool outer) const; 75 int borderHalfRight(bool outer) const; 76 int borderHalfTop(bool outer) const; 77 int borderHalfBottom(bool outer) const; 78 74 79 CollapsedBorderValue collapsedLeftBorder(bool rtl) const; 75 80 CollapsedBorderValue collapsedRightBorder(bool rtl) const; … … 92 97 virtual int yPos() const { return m_y + _topExtra; } 93 98 99 virtual IntRect getAbsoluteRepaintRect(); 94 100 virtual void computeAbsoluteRepaintRect(IntRect&, bool f=false); 95 101 virtual bool absolutePosition(int& xPos, int& yPos, bool f = false);
Note: See TracChangeset
for help on using the changeset viewer.