| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 * (C) 1997 Torben Weis (weis@kde.org) | 3 * (C) 1997 Torben Weis (weis@kde.org) |
| 4 * (C) 1998 Waldo Bastian (bastian@kde.org) | 4 * (C) 1998 Waldo Bastian (bastian@kde.org) |
| 5 * (C) 1999 Lars Knoll (knoll@kde.org) | 5 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 int top = relativeY - os; | 1015 int top = relativeY - os; |
| 1016 // binary search to find a row | 1016 // binary search to find a row |
| 1017 startrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), top) - m_r
owPos.begin(); | 1017 startrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), top) - m_r
owPos.begin(); |
| 1018 | 1018 |
| 1019 // The binary search above gives us the first row with | 1019 // The binary search above gives us the first row with |
| 1020 // a y position >= the top of the paint rect. Thus, the previous | 1020 // a y position >= the top of the paint rect. Thus, the previous |
| 1021 // may need to be repainted as well. | 1021 // may need to be repainted as well. |
| 1022 if (startrow == m_rowPos.size() || (startrow > 0 && (m_rowPos[startrow]
> top))) | 1022 if (startrow == m_rowPos.size() || (startrow > 0 && (m_rowPos[startrow]
> top))) |
| 1023 --startrow; | 1023 --startrow; |
| 1024 | 1024 |
| 1025 int bottom = relativeY + h + os - 1; | 1025 int bottom = relativeY + h + os; |
| 1026 endrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), bottom) - m_
rowPos.begin(); | 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)) | 1027 if (endrow == m_rowPos.size()) |
| 1028 --endrow; | 1028 --endrow; |
| 1029 | 1029 |
| 1030 if (!endrow && ty + m_rowPos[0] - table()->outerBorderTop() <= y + h + o
s) | 1030 if (!endrow && ty + m_rowPos[0] - table()->outerBorderTop() <= y + h + o
s) |
| 1031 ++endrow; | 1031 ++endrow; |
| 1032 } | 1032 } |
| 1033 unsigned startcol = 0; | 1033 unsigned startcol = 0; |
| 1034 unsigned endcol = totalCols; | 1034 unsigned endcol = totalCols; |
| 1035 // FIXME: Implement RTL. | 1035 // FIXME: Implement RTL. |
| 1036 if (!m_hasOverflowingCell && style()->direction() == LTR) { | 1036 if (!m_hasOverflowingCell && style()->direction() == LTR) { |
| 1037 int relativeX = x - tx; | 1037 int relativeX = x - tx; |
| 1038 int left = relativeX - os; | 1038 int left = relativeX - os; |
| 1039 Vector<int>& columnPos = table()->columnPositions(); | 1039 Vector<int>& columnPos = table()->columnPositions(); |
| 1040 startcol = std::lower_bound(columnPos.begin(), columnPos.end(), left) -
columnPos.begin(); | 1040 startcol = std::lower_bound(columnPos.begin(), columnPos.end(), left) -
columnPos.begin(); |
| 1041 if ((startcol == columnPos.size()) || (startcol > 0 && (columnPos[startc
ol] > left))) | 1041 if ((startcol == columnPos.size()) || (startcol > 0 && (columnPos[startc
ol] > left))) |
| 1042 --startcol; | 1042 --startcol; |
| 1043 | 1043 |
| 1044 int right = relativeX + w + os - 1; | 1044 int right = relativeX + w + os; |
| 1045 endcol = std::lower_bound(columnPos.begin(), columnPos.end(), right) - c
olumnPos.begin(); | 1045 endcol = std::lower_bound(columnPos.begin(), columnPos.end(), right) - c
olumnPos.begin(); |
| 1046 if (endcol == columnPos.size() || (endcol > 0 && (columnPos[endcol - 1]
== right))) | 1046 if (endcol == columnPos.size()) |
| 1047 --endcol; | 1047 --endcol; |
| 1048 | 1048 |
| 1049 if (!endcol && tx + table()->columnPositions()[0] - table()->outerBorder
Left() <= y + w + os) | 1049 if (!endcol && tx + table()->columnPositions()[0] - table()->outerBorder
Left() <= y + w + os) |
| 1050 ++endcol; | 1050 ++endcol; |
| 1051 } | 1051 } |
| 1052 if (startcol < endcol) { | 1052 if (startcol < endcol) { |
| 1053 if (!m_hasMultipleCellLevels) { | 1053 if (!m_hasMultipleCellLevels) { |
| 1054 // Draw the dirty cells in the order that they appear. | 1054 // Draw the dirty cells in the order that they appear. |
| 1055 for (unsigned r = startrow; r < endrow; r++) { | 1055 for (unsigned r = startrow; r < endrow; r++) { |
| 1056 for (unsigned c = startcol; c < endcol; c++) { | 1056 for (unsigned c = startcol; c < endcol; c++) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, xPos,
yPos, tx, ty, action)) { | 1235 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, xPos,
yPos, tx, ty, action)) { |
| 1236 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); | 1236 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); |
| 1237 return true; | 1237 return true; |
| 1238 } | 1238 } |
| 1239 } | 1239 } |
| 1240 return false; | 1240 return false; |
| 1241 | 1241 |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 } // namespace WebCore | 1244 } // namespace WebCore |
| OLD | NEW |