Changeset 65539 in webkit
- Timestamp:
- Aug 17, 2010 1:57:15 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 25 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65538 r65539 1 2010-08-17 Fady Samuel <fsamuel@chromium.org> 2 3 Reviewed by David Hyatt. 4 5 Updated table cell hit testing and painting to use binary search instead of a linear scan. 6 7 Layout tests check that hit testing of empty cells, overlapping cells, 8 cells with outlines, right-to-left tables, and large 9 tables all work as expected. 10 11 Improved Table Hit Testing and Painting Performance 12 https://bugs.webkit.org/show_bug.cgi?id=43933 13 14 * fast/table/simple_paint.html: Added. 15 * platform/chromium-linux/fast/table/simple_paint-expected.checksum: Added. 16 * platform/chromium-linux/fast/table/simple_paint-expected.png: Added. 17 * platform/chromium-linux/fast/table/simple_paint-expected.txt: Added. 18 * platform/chromium-linux/tables/hittesting/filltable-emptycells-expected.txt: Added. 19 * platform/chromium-linux/tables/hittesting/filltable-levels-expected.txt: Added. 20 * platform/chromium-linux/tables/hittesting/filltable-outline-expected.txt: Added. 21 * platform/chromium-linux/tables/hittesting/filltable-rtl-expected.txt: Added. 22 * platform/chromium-linux/tables/hittesting/filltable-stress-expected.txt: Added. 23 * platform/chromium/test_expectations.txt: 24 * platform/gtk/tables/hittesting/filltable-emptycells-expected.txt: Added. 25 * platform/gtk/tables/hittesting/filltable-levels-expected.txt: Added. 26 * platform/gtk/tables/hittesting/filltable-outline-expected.txt: Added. 27 * platform/gtk/tables/hittesting/filltable-rtl-expected.txt: Added. 28 * platform/gtk/tables/hittesting/filltable-stress-expected.txt: Added. 29 * tables/hittesting/filltable-emptycells.html: Added. 30 * tables/hittesting/filltable-levels.html: Added. 31 * tables/hittesting/filltable-outline.html: Added. 32 * tables/hittesting/filltable-rtl.html: Added. 33 * tables/hittesting/filltable-stress.html: Added. 34 1 35 2010-08-17 Abhishek Arya <inferno@chromium.org> 2 36 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r65535 r65539 3164 3164 BUG51854 WIN SLOW : http/tests/storage/callbacks-are-called-in-correct-context.html = PASS 3165 3165 3166 // Temporarily there until we baseline for Windows and Mac 3167 BUG43933 WIN MAC : tables/hittesting/filltable-stress.html = FAIL 3168 BUG43933 WIN MAC : tables/hittesting/filltable-rtl.html = FAIL 3169 BUG43933 WIN MAC : tables/hittesting/filltable-outline.html = FAIL 3170 BUG43933 WIN MAC : tables/hittesting/filltable-levels.html = FAIL 3171 BUG43933 WIN MAC : tables/hittesting/filltable-emptycells.html = FAIL 3172 BUG43933 WIN MAC : fast/table/simple_paint.html = FAIL 3173 3166 3174 // Regressions from r65229 3167 3175 BUGWK43912 WIN LINUX : svg/W3C-SVG-1.1/masking-intro-01-f.svg = IMAGE … … 3183 3191 BUGWK43912 WIN LINUX : svg/zoom/page/zoom-mask-with-percentages.svg = IMAGE 3184 3192 BUGWK43912 WIN LINUX : svg/custom/absolute-sized-content-with-resources.xhtml = IMAGE 3193 3185 3194 // Same symptoms, failing as of r65449 3186 3195 BUGWK43912 : svg/W3C-SVG-1.1/filters-color-01-b.svg = IMAGE -
trunk/WebCore/ChangeLog
r65538 r65539 1 2010-08-17 Fady Samuel <fsamuel@chromium.org> 2 3 Reviewed by David Hyatt. 4 5 Updated table cell hit testing and painting to use binary search instead of linear scan. 6 7 Improved Table Hit Testing and Painting Performance 8 https://bugs.webkit.org/show_bug.cgi?id=43933 9 10 Tests: fast/table/simple_paint.html 11 tables/hittesting/filltable-emptycells.html 12 tables/hittesting/filltable-levels.html 13 tables/hittesting/filltable-outline.html 14 tables/hittesting/filltable-rtl.html 15 tables/hittesting/filltable-stress.html 16 17 * rendering/RenderTableSection.cpp: 18 (WebCore::RenderTableSection::paintObject): Dirty rect determined using binary search. 19 (WebCore::RenderTableSection::nodeAtPoint): Cell hit determined using binary search 20 1 21 2010-08-17 Abhishek Arya <inferno@chromium.org> 2 22 -
trunk/WebCore/rendering/RenderTableSection.cpp
r64272 r65539 26 26 #include "config.h" 27 27 #include "RenderTableSection.h" 28 29 28 #include "CachedImage.h" 30 29 #include "Document.h" … … 1013 1012 // If some cell overflows, just paint all of them. 1014 1013 if (!m_hasOverflowingCell) { 1015 for (; startrow < totalRows; startrow++) { 1016 if (ty + m_rowPos[startrow + 1] >= y - os) 1017 break; 1018 } 1019 if (startrow == totalRows && ty + m_rowPos[totalRows] + table()->outerBorderBottom() >= y - os) 1020 startrow--; 1021 1022 for (; endrow > 0; endrow--) { 1023 if (ty + m_rowPos[endrow - 1] <= y + h + os) 1024 break; 1025 } 1014 int relativeY = y - ty; 1015 int top = relativeY - os; 1016 // binary search to find a row 1017 startrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), top) - m_rowPos.begin(); 1018 1019 // The binary search above gives us the first row with 1020 // a y position >= the top of the paint rect. Thus, the previous 1021 // may need to be repainted as well. 1022 if (startrow == m_rowPos.size() || (startrow > 0 && (m_rowPos[startrow] > top))) 1023 --startrow; 1024 1025 int bottom = relativeY + h + os - 1; 1026 endrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), bottom) - m_rowPos.begin(); 1027 if ((endrow == m_rowPos.size()) || (endrow > 0 && m_rowPos[endrow - 1] == bottom)) 1028 --endrow; 1029 1026 1030 if (!endrow && ty + m_rowPos[0] - table()->outerBorderTop() <= y + h + os) 1027 endrow++; 1028 } 1029 1031 ++endrow; 1032 } 1030 1033 unsigned startcol = 0; 1031 1034 unsigned endcol = totalCols; 1032 1035 // FIXME: Implement RTL. 1033 1036 if (!m_hasOverflowingCell && style()->direction() == LTR) { 1034 for (; startcol < totalCols; startcol++) { 1035 if (tx + table()->columnPositions()[startcol + 1] >= x - os) 1036 break; 1037 } 1038 if (startcol == totalCols && tx + table()->columnPositions()[totalCols] + table()->outerBorderRight() >= x - os) 1039 startcol--; 1040 1041 for (; endcol > 0; endcol--) { 1042 if (tx + table()->columnPositions()[endcol - 1] <= x + w + os) 1043 break; 1044 } 1037 int relativeX = x - tx; 1038 int left = relativeX - os; 1039 Vector<int>& columnPos = table()->columnPositions(); 1040 startcol = std::lower_bound(columnPos.begin(), columnPos.end(), left) - columnPos.begin(); 1041 if ((startcol == columnPos.size()) || (startcol > 0 && (columnPos[startcol] > left))) 1042 --startcol; 1043 1044 int right = relativeX + w + os - 1; 1045 endcol = std::lower_bound(columnPos.begin(), columnPos.end(), right) - columnPos.begin(); 1046 if (endcol == columnPos.size() || (endcol > 0 && (columnPos[endcol - 1] == right))) 1047 --endcol; 1048 1045 1049 if (!endcol && tx + table()->columnPositions()[0] - table()->outerBorderLeft() <= y + w + os) 1046 endcol++;1050 ++endcol; 1047 1051 } 1048 1052 if (startcol < endcol) { … … 1174 1178 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action) 1175 1179 { 1180 // If we have no children then we have nothing to do. 1181 if (!firstChild()) 1182 return false; 1183 1176 1184 // Table sections cannot ever be hit tested. Effectively they do not exist. 1177 1185 // Just forward to our children always. … … 1182 1190 return false; 1183 1191 1184 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { 1185 // FIXME: We have to skip over inline flows, since they can show up inside table rows 1186 // at the moment (a demoted inline <form> for example). If we ever implement a 1187 // table-specific hit-test method (which we should do for performance reasons anyway), 1188 // then we can remove this check. 1189 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) { 1192 if (m_hasOverflowingCell) { 1193 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { 1194 // FIXME: We have to skip over inline flows, since they can show up inside table rows 1195 // at the moment (a demoted inline <form> for example). If we ever implement a 1196 // table-specific hit-test method (which we should do for performance reasons anyway), 1197 // then we can remove this check. 1198 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) { 1199 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); 1200 return true; 1201 } 1202 } 1203 return false; 1204 } 1205 1206 int relativeY = yPos - ty; 1207 // leftrow corresponds to the first row that starts after the y mouse position 1208 unsigned leftrow = std::upper_bound(m_rowPos.begin(), m_rowPos.end(), relativeY) - m_rowPos.begin(); 1209 if (leftrow == m_rowPos.size()) 1210 return false; 1211 // Grab the last row that starts before the y mouse position. 1212 if (leftrow > 0) 1213 --leftrow; 1214 1215 Vector<int>& columnPos = table()->columnPositions(); 1216 bool rtl = style()->direction() == RTL; 1217 int relativeX = xPos - tx; 1218 if (rtl) 1219 relativeX = columnPos[columnPos.size() - 1] - relativeX; 1220 1221 unsigned leftcol = std::lower_bound(columnPos.begin(), columnPos.end(), relativeX) - columnPos.begin(); 1222 if (leftcol == columnPos.size()) 1223 return false; 1224 if (leftcol > 0) 1225 --leftcol; 1226 1227 CellStruct& current = cellAt(leftrow, leftcol); 1228 1229 // If the cell is empty, there's nothing to do 1230 if (!current.hasCells()) 1231 return false; 1232 1233 for (int i = current.cells.size() - 1; i >= 0; --i) { 1234 RenderTableCell* cell = current.cells[i]; 1235 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) { 1190 1236 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); 1191 1237 return true; … … 1193 1239 } 1194 1240 return false; 1241 1195 1242 } 1196 1243
Note: See TracChangeset
for help on using the changeset viewer.