summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderTable.cpp
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-05-24 21:45:32 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-05-24 21:45:32 -0700
commita149172322a9067c14e8b474a53e63649aa17cad (patch)
tree19e2be990222e93b9fc75553b57e5abd9708f0b9 /WebCore/rendering/RenderTable.cpp
parent8b2ec69eaf97dd8a817342ca54044d74da6b4b19 (diff)
parent17dcead8ee9edfa8f75e7e2d2284ed3c6f4bd403 (diff)
downloadexternal_webkit-a149172322a9067c14e8b474a53e63649aa17cad.zip
external_webkit-a149172322a9067c14e8b474a53e63649aa17cad.tar.gz
external_webkit-a149172322a9067c14e8b474a53e63649aa17cad.tar.bz2
Merge "First draft to add a fat point to WebKit hit test."
Diffstat (limited to 'WebCore/rendering/RenderTable.cpp')
-rw-r--r--WebCore/rendering/RenderTable.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp
index 0a61a93..eac5c5d 100644
--- a/WebCore/rendering/RenderTable.cpp
+++ b/WebCore/rendering/RenderTable.cpp
@@ -31,6 +31,9 @@
#include "Document.h"
#include "FixedTableLayout.h"
#include "FrameView.h"
+#ifdef ANDROID_HITTEST_WITHSIZE
+#include "HitTestResult.h"
+#endif
#include "HTMLNames.h"
#include "RenderLayer.h"
#include "RenderTableCell.h"
@@ -1202,7 +1205,11 @@ bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
ty += y();
// Check kids first.
+#ifdef ANDROID_HITTEST_WITHSIZE
+ if (!hasOverflowClip() || result.intersects(xPos, yPos, overflowClipRect(tx, ty))) {
+#else
if (!hasOverflowClip() || overflowClipRect(tx, ty).contains(xPos, yPos)) {
+#endif
for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption) &&
child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {
@@ -1213,8 +1220,21 @@ bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
}
// Check our bounds next.
+#ifdef ANDROID_HITTEST_WITHSIZE
+ IntRect boundsRect = IntRect(tx, ty, width(), height());
+ if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && result.intersects(xPos, yPos, boundsRect)) {
+#else
if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && IntRect(tx, ty, width(), height()).contains(xPos, yPos)) {
+#endif
updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
+#ifdef ANDROID_HITTEST_WITHSIZE
+ if (result.isRegionTest()) {
+ ASSERT(node() || isAnonymous());
+ result.addRawNode(node());
+ if (!result.containedBy(xPos, yPos, boundsRect))
+ return false;
+ }
+#endif
return true;
}