[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
mitz at apple.com
mitz at apple.com
Wed Dec 22 18:09:17 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 20e5bec862effafbaeec0a8eca9ca51981395437
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 8 01:37:57 2010 +0000
WebCore: Made tables repaint correctly in all writing modes
Part of: Make tables work with vertical text
https://bugs.webkit.org/show_bug.cgi?id=46417
Reviewed by Darin Adler.
Tests: fast/repaint/table-writing-modes-h.html
fast/repaint/table-writing-modes-v.html
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintObject): Compute the ranges of rows and
columns to repaint based on the logical extent of the repaint rect.
LayoutTests: Test that tables repaint correctly in all writing modes
Part of: Make tables work with vertical text
https://bugs.webkit.org/show_bug.cgi?id=46417
Reviewed by Darin Adler.
* fast/repaint/table-writing-modes-h-expected.checksum: Added.
* fast/repaint/table-writing-modes-h-expected.png: Added.
* fast/repaint/table-writing-modes-h-expected.txt: Added.
* fast/repaint/table-writing-modes-h.html: Added.
* fast/repaint/table-writing-modes-v-expected.checksum: Added.
* fast/repaint/table-writing-modes-v-expected.png: Added.
* fast/repaint/table-writing-modes-v-expected.txt: Added.
* fast/repaint/table-writing-modes-v.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 07a075a..0d0502b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-07 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Test that tables repaint correctly in all writing modes
+ Part of: Make tables work with vertical text
+ https://bugs.webkit.org/show_bug.cgi?id=46417
+
+ * fast/repaint/table-writing-modes-h-expected.checksum: Added.
+ * fast/repaint/table-writing-modes-h-expected.png: Added.
+ * fast/repaint/table-writing-modes-h-expected.txt: Added.
+ * fast/repaint/table-writing-modes-h.html: Added.
+ * fast/repaint/table-writing-modes-v-expected.checksum: Added.
+ * fast/repaint/table-writing-modes-v-expected.png: Added.
+ * fast/repaint/table-writing-modes-v-expected.txt: Added.
+ * fast/repaint/table-writing-modes-v.html: Added.
+
2010-12-07 Tony Chang <tony at chromium.org>
Unreviewed, mark a test as flaky on chromium drt linux.
diff --git a/LayoutTests/fast/repaint/table-writing-modes-h-expected.checksum b/LayoutTests/fast/repaint/table-writing-modes-h-expected.checksum
new file mode 100644
index 0000000..2c5f10d
--- /dev/null
+++ b/LayoutTests/fast/repaint/table-writing-modes-h-expected.checksum
@@ -0,0 +1 @@
+46b6ffd0cc9d6c2cfb161fa2fb296a3e
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/table-writing-modes-h-expected.png b/LayoutTests/fast/repaint/table-writing-modes-h-expected.png
new file mode 100644
index 0000000..5d8e875
Binary files /dev/null and b/LayoutTests/fast/repaint/table-writing-modes-h-expected.png differ
diff --git a/LayoutTests/fast/repaint/table-writing-modes-h-expected.txt b/LayoutTests/fast/repaint/table-writing-modes-h-expected.txt
new file mode 100644
index 0000000..0139b24
--- /dev/null
+++ b/LayoutTests/fast/repaint/table-writing-modes-h-expected.txt
@@ -0,0 +1,37 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x466
+ RenderBlock {HTML} at (0,0) size 800x466
+ RenderBody {BODY} at (8,10) size 784x446
+ RenderTable {TABLE} at (10,0) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 104x52
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 104x52
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
+ RenderTable {TABLE} at (10,114) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 52x104
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 52x104
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
+ RenderTable {TABLE} at (10,228) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 104x52
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 104x52
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
+ RenderTable {TABLE} at (10,342) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 52x104
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 52x104
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
diff --git a/LayoutTests/fast/repaint/table-writing-modes-h.html b/LayoutTests/fast/repaint/table-writing-modes-h.html
new file mode 100644
index 0000000..be5eee3
--- /dev/null
+++ b/LayoutTests/fast/repaint/table-writing-modes-h.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.testRepaint();
+ layoutTestController.repaintSweepHorizontally();
+ }
+</script>
+<style>
+ table { border-collapse: collapse; background-color: red; margin: 10px; }
+ td { width: 50px; height: 50px; background-color: green; }
+</style>
+<table>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
+<table style="-webkit-writing-mode: vertical-lr;">
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
+<table style="-webkit-writing-mode: horizontal-bt;">
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
+<table style="-webkit-writing-mode: vertical-rl;">
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
diff --git a/LayoutTests/fast/repaint/table-writing-modes-v-expected.checksum b/LayoutTests/fast/repaint/table-writing-modes-v-expected.checksum
new file mode 100644
index 0000000..2c5f10d
--- /dev/null
+++ b/LayoutTests/fast/repaint/table-writing-modes-v-expected.checksum
@@ -0,0 +1 @@
+46b6ffd0cc9d6c2cfb161fa2fb296a3e
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/table-writing-modes-v-expected.png b/LayoutTests/fast/repaint/table-writing-modes-v-expected.png
new file mode 100644
index 0000000..5d8e875
Binary files /dev/null and b/LayoutTests/fast/repaint/table-writing-modes-v-expected.png differ
diff --git a/LayoutTests/fast/repaint/table-writing-modes-v-expected.txt b/LayoutTests/fast/repaint/table-writing-modes-v-expected.txt
new file mode 100644
index 0000000..0139b24
--- /dev/null
+++ b/LayoutTests/fast/repaint/table-writing-modes-v-expected.txt
@@ -0,0 +1,37 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x466
+ RenderBlock {HTML} at (0,0) size 800x466
+ RenderBody {BODY} at (8,10) size 784x446
+ RenderTable {TABLE} at (10,0) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 104x52
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 104x52
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
+ RenderTable {TABLE} at (10,114) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 52x104
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 52x104
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
+ RenderTable {TABLE} at (10,228) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 104x52
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 104x52
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
+ RenderTable {TABLE} at (10,342) size 104x104 [bgcolor=#FF0000]
+ RenderTableSection {TBODY} at (0,0) size 104x104
+ RenderTableRow {TR} at (0,0) size 52x104
+ RenderTableCell {TD} at (0,25) size 52x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (0,77) size 52x2 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+ RenderTableRow {TR} at (0,52) size 52x104
+ RenderTableCell {TD} at (52,25) size 52x2 [bgcolor=#008000] [r=1 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (52,77) size 52x2 [bgcolor=#008000] [r=1 c=1 rs=1 cs=1]
diff --git a/LayoutTests/fast/repaint/table-writing-modes-v.html b/LayoutTests/fast/repaint/table-writing-modes-v.html
new file mode 100644
index 0000000..1cdad8e
--- /dev/null
+++ b/LayoutTests/fast/repaint/table-writing-modes-v.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.testRepaint();
+ }
+</script>
+<style>
+ table { border-collapse: collapse; background-color: red; margin: 10px; }
+ td { width: 50px; height: 50px; background-color: green; }
+</style>
+<table>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
+<table style="-webkit-writing-mode: vertical-lr;">
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
+<table style="-webkit-writing-mode: horizontal-bt;">
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
+<table style="-webkit-writing-mode: vertical-rl;">
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+</table>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e1737e5..ff3fb86 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-12-07 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Made tables repaint correctly in all writing modes
+ Part of: Make tables work with vertical text
+ https://bugs.webkit.org/show_bug.cgi?id=46417
+
+ Tests: fast/repaint/table-writing-modes-h.html
+ fast/repaint/table-writing-modes-v.html
+
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::paintObject): Compute the ranges of rows and
+ columns to repaint based on the logical extent of the repaint rect.
+
2010-12-07 Chris Marrin <cmarrin at apple.com>
Unreviewed.
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index 069e71a..19ad56b 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -952,53 +952,57 @@ void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty)
unsigned totalCols = table()->columns().size();
PaintPhase paintPhase = paintInfo.phase;
- int x = paintInfo.rect.x();
- int y = paintInfo.rect.y();
- int w = paintInfo.rect.width();
- int h = paintInfo.rect.height();
int os = 2 * maximalOutlineSize(paintPhase);
unsigned startrow = 0;
unsigned endrow = totalRows;
-
+
+ IntRect localRepaintRect = paintInfo.rect;
+ localRepaintRect.move(-tx, -ty);
+ if (style()->isFlippedBlocksWritingMode()) {
+ if (style()->isHorizontalWritingMode())
+ localRepaintRect.setY(height() - localRepaintRect.bottom());
+ else
+ localRepaintRect.setX(width() - localRepaintRect.right());
+ }
+
// If some cell overflows, just paint all of them.
if (!m_hasOverflowingCell) {
- int relativeY = y - ty;
- int top = relativeY - os;
+ int before = (style()->isHorizontalWritingMode() ? localRepaintRect.y() : localRepaintRect.x()) - os;
// binary search to find a row
- startrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), top) - m_rowPos.begin();
+ startrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), before) - m_rowPos.begin();
// The binary search above gives us the first row with
// a y position >= the top of the paint rect. Thus, the previous
// may need to be repainted as well.
- if (startrow == m_rowPos.size() || (startrow > 0 && (m_rowPos[startrow] > top)))
+ if (startrow == m_rowPos.size() || (startrow > 0 && (m_rowPos[startrow] > before)))
--startrow;
- int bottom = relativeY + h + os;
- endrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), bottom) - m_rowPos.begin();
+ int after = (style()->isHorizontalWritingMode() ? localRepaintRect.bottom() : localRepaintRect.right()) + os;
+ endrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), after) - m_rowPos.begin();
if (endrow == m_rowPos.size())
--endrow;
- if (!endrow && ty + m_rowPos[0] - table()->outerBorderTop() <= y + h + os)
+ if (!endrow && m_rowPos[0] - table()->outerBorderBefore() <= after)
++endrow;
}
+
unsigned startcol = 0;
unsigned endcol = totalCols;
// FIXME: Implement RTL.
if (!m_hasOverflowingCell && style()->isLeftToRightDirection()) {
- int relativeX = x - tx;
- int left = relativeX - os;
+ int start = (style()->isHorizontalWritingMode() ? localRepaintRect.x() : localRepaintRect.y()) - os;
Vector<int>& columnPos = table()->columnPositions();
- startcol = std::lower_bound(columnPos.begin(), columnPos.end(), left) - columnPos.begin();
- if ((startcol == columnPos.size()) || (startcol > 0 && (columnPos[startcol] > left)))
+ startcol = std::lower_bound(columnPos.begin(), columnPos.end(), start) - columnPos.begin();
+ if ((startcol == columnPos.size()) || (startcol > 0 && (columnPos[startcol] > start)))
--startcol;
- int right = relativeX + w + os;
- endcol = std::lower_bound(columnPos.begin(), columnPos.end(), right) - columnPos.begin();
+ int end = (style()->isHorizontalWritingMode() ? localRepaintRect.right() : localRepaintRect.bottom()) + os;
+ endcol = std::lower_bound(columnPos.begin(), columnPos.end(), end) - columnPos.begin();
if (endcol == columnPos.size())
--endcol;
- if (!endcol && tx + table()->columnPositions()[0] - table()->outerBorderLeft() <= y + w + os)
+ if (!endcol && columnPos[0] - table()->outerBorderStart() <= end)
++endcol;
}
if (startcol < endcol) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list