Reviewed by hyatt, landed by ap.
WebCore:
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
Test: fast/repaint/table-extra-bottom-grow.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
allow the normal overflow height to overlap with the bottom extra height.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
bottom extra height increased, just repaint the entire cell.
LayoutTests:
* fast/repaint/table-extra-bottom-grow-expected.checksum: Added.
* fast/repaint/table-extra-bottom-grow-expected.png: Added.
* fast/repaint/table-extra-bottom-grow-expected.txt: Added.
* fast/repaint/table-extra-bottom-grow.html: Added.
* fast/repaint/table-cell-moved-expected.checksum: Removed excessive painting.
* fast/repaint/table-cell-moved-expected.png: Ditto.
* fast/repaint/bugzilla-6278-expected.checksum: Ditto.
* fast/repaint/bugzilla-6278-expected.png: Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14101
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-04-28 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by hyatt, landed by ap.
+
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
+ REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
+
+ * fast/repaint/table-extra-bottom-grow-expected.checksum: Added.
+ * fast/repaint/table-extra-bottom-grow-expected.png: Added.
+ * fast/repaint/table-extra-bottom-grow-expected.txt: Added.
+ * fast/repaint/table-extra-bottom-grow.html: Added.
+ * fast/repaint/table-cell-moved-expected.checksum: Removed excessive painting.
+ * fast/repaint/table-cell-moved-expected.png: Ditto.
+ * fast/repaint/bugzilla-6278-expected.checksum: Ditto.
+ * fast/repaint/bugzilla-6278-expected.png: Ditto.
+
2006-04-28 Eric Seidel <eseidel@apple.com>
Reviewed by andersca.
-ce744fd2ed7b5cc42549f9f96e207743
\ No newline at end of file
+4714b953a386182e80f2e91dc04a3c11
\ No newline at end of file
-01b376508ae26977c599524ce333f0f9
\ No newline at end of file
+2baa577b2d2a75add31a3eb65fa02386
\ No newline at end of file
--- /dev/null
+504166a83f80f4c2956d16d4b0c60de9
+\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x238
+ RenderBlock {HTML} at (0,0) size 800x238
+ RenderBody {BODY} at (8,16) size 784x214
+ RenderBlock {P} at (0,0) size 784x18
+ RenderInline {B} at (0,0) size 62x18
+ RenderText {#text} at (0,0) size 62x18
+ text run at (0,0) width 62: "BUG ID:"
+ RenderText {#text} at (62,0) size 4x18
+ text run at (62,0) width 4: " "
+ RenderInline {A} at (0,0) size 117x18 [color=#0000EE]
+ RenderText {#text} at (66,0) size 117x18
+ text run at (66,0) width 117: "Bugzilla bug 6769"
+ RenderText {#text} at (183,0) size 489x18
+ text run at (183,0) width 489: " REGRESSION: Incomplete repaint when a cell's extra bottom margin grows"
+ RenderBlock {P} at (0,34) size 784x24 [bgcolor=#98FB98]
+ RenderInline {B} at (0,0) size 91x18
+ RenderText {#text} at (3,3) size 91x18
+ text run at (3,3) width 91: "TEST PASS:"
+ RenderText {#text} at (94,3) size 355x18
+ text run at (94,3) width 4: " "
+ text run at (98,3) width 351: "There should be only a green square below, and no red."
+ RenderBlock {P} at (0,74) size 784x24 [bgcolor=#FF3300]
+ RenderInline {B} at (0,0) size 90x18
+ RenderText {#text} at (3,3) size 90x18
+ text run at (3,3) width 90: "TEST FAIL:"
+ RenderText {#text} at (93,3) size 311x18
+ text run at (93,3) width 4: " "
+ text run at (97,3) width 307: "The lower-right quarter of the square will be red."
+ RenderTable {TABLE} at (0,114) size 100x100 [bgcolor=#008000]
+ RenderTableSection {TBODY} at (0,0) size 100x100
+ RenderTableRow {TR} at (0,0) size 100x100
+ RenderTableCell {TD} at (0,50) size 50x0 [r=0 c=0 rs=2 cs=1]
+ RenderTableCell {TD} at (50,0) size 50x0 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,100) size 100x0
+ RenderTableCell {TD} at (50,100) size 50x0 [bgcolor=#FF0000] [r=1 c=1 rs=1 cs=1]
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<script src="repaint.js"></script>
+<script>
+ function repaintTest()
+ {
+ document.getElementById("t").style.height='100px';
+ document.getElementById("s").style.height='0';
+ }
+</script>
+</head>
+<body onload="runRepaintTest();">
+<p><b>BUG ID:</b> <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=6769">Bugzilla bug 6769</a> REGRESSION: Incomplete repaint when a cell's extra bottom margin grows</p>
+
+<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b>
+There should be only a green square below, and no red.
+</p>
+
+<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>
+The lower-right quarter of the square will be red.
+</p>
+
+<table style="background: green;" cellspacing="0" cellpadding="0">
+ <tr>
+ <td style="height: 100px; width: 50px;" rowspan="2">
+ </td>
+ <td style="width: 50px; vertical-align: top; background: green; height: 50px;" id="t">
+ </td>
+ </tr>
+ <tr>
+ <td style="background: red;"></td>
+ </tr>
+</table>
+
+</body>
+</html>
+
+2006-04-28 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by hyatt, landed by ap.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
+ REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
+
+ Test: fast/repaint/table-extra-bottom-grow.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
+ allow the normal overflow height to overlap with the bottom extra height.
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
+ bottom extra height increased, just repaint the entire cell.
+
2006-04-28 Eric Seidel <eseidel@apple.com>
Reviewed by andersca.
return borderBox();
int l = overflowLeft(includeInterior);
int t = min(overflowTop(includeInterior), -borderTopExtra());
- return IntRect(l, t, overflowWidth(includeInterior) - 2*l, overflowHeight(includeInterior) + borderTopExtra() + borderBottomExtra() - 2*t);
+ return IntRect(l, t, overflowWidth(includeInterior) - l, max(overflowHeight(includeInterior), height() + borderBottomExtra()) - t);
}
bool RenderBlock::isSelfCollapsingBlock() const
if (child->needsLayout()) {
cell->calcVerticalMargins();
cell->layout();
- cell->setCellTopExtra(0);
- cell->setCellBottomExtra(0);
}
}
}
}
}
if (cellChildrenFlex) {
- cell->setOverrideSize(max(0,
- rHeight - cell->borderTop() - cell->paddingTop() -
- cell->borderBottom() - cell->paddingBottom()));
- cell->layoutIfNeeded();
-
// Alignment within a cell is based off the calculated
// height, which becomes irrelevant once the cell has
// been resized based off its percentage. -dwh
cell->setCellTopExtra(0);
cell->setCellBottomExtra(0);
- }
- else {
+
+ cell->setOverrideSize(max(0,
+ rHeight - cell->borderTop() - cell->paddingTop() -
+ cell->borderBottom() - cell->paddingBottom()));
+ cell->layoutIfNeeded();
+ } else {
EVerticalAlign va = cell->style()->verticalAlign();
int te = 0;
switch (va) {
break;
}
+ int oldTe = cell->borderTopExtra();
+ int oldBe = cell->borderBottomExtra();
+
+ int be = rHeight - cell->height() - te;
cell->setCellTopExtra(te);
- cell->setCellBottomExtra(rHeight - cell->height() - te);
+ cell->setCellBottomExtra(be);
+ if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout() && (te != oldTe || be > oldBe))
+ cell->repaint();
}
int oldCellX = cell->xPos();