diff options
Diffstat (limited to 'WebCore/rendering')
-rw-r--r-- | WebCore/rendering/HitTestResult.cpp | 17 | ||||
-rw-r--r-- | WebCore/rendering/RenderBlock.cpp | 9 | ||||
-rw-r--r-- | WebCore/rendering/RenderBox.cpp | 5 | ||||
-rw-r--r-- | WebCore/rendering/RenderLayer.cpp | 6 | ||||
-rw-r--r-- | WebCore/rendering/RenderLineBoxList.cpp | 3 | ||||
-rw-r--r-- | WebCore/rendering/RenderSVGRoot.cpp | 7 |
6 files changed, 2 insertions, 45 deletions
diff --git a/WebCore/rendering/HitTestResult.cpp b/WebCore/rendering/HitTestResult.cpp index 8a986d6..dd96e0e 100644 --- a/WebCore/rendering/HitTestResult.cpp +++ b/WebCore/rendering/HitTestResult.cpp @@ -57,13 +57,9 @@ HitTestResult::HitTestResult(const IntPoint& centerPoint, const IntSize& padding : m_point(centerPoint) , m_isOverWidget(false) { -#ifdef ANDROID_HITTEST_WITHSIZE - m_isRectBased = !padding.isEmpty(); -#else // If a zero padding is passed in or either width or height is negative, then it // is not a valid padding and hence not a rect based hit test. m_isRectBased = !(padding.isZero() || (padding.width() < 0 || padding.height() < 0)); -#endif m_padding = m_isRectBased ? padding : IntSize(); } @@ -76,16 +72,12 @@ HitTestResult::HitTestResult(const HitTestResult& other) , m_scrollbar(other.scrollbar()) , m_isOverWidget(other.isOverWidget()) { -#ifndef ANDROID_HITTEST_WITHSIZE // Only copy the padding and ListHashSet in case of rect hit test. // Copying the later is rather expensive. if ((m_isRectBased = other.isRectBasedTest())) { -#endif m_padding = other.padding(); m_rectBasedTestResult = other.rectBasedTestResult(); -#ifndef ANDROID_HITTEST_WITHSIZE } -#endif } HitTestResult::~HitTestResult() @@ -101,16 +93,12 @@ HitTestResult& HitTestResult::operator=(const HitTestResult& other) m_innerURLElement = other.URLElement(); m_scrollbar = other.scrollbar(); m_isOverWidget = other.isOverWidget(); -#ifndef ANDROID_HITTEST_WITHSIZE // Only copy the padding and ListHashSet in case of rect hit test. // Copying the later is rather expensive. if ((m_isRectBased = other.isRectBasedTest())) { -#endif m_padding = other.padding(); m_rectBasedTestResult = other.rectBasedTestResult(); -#ifndef ANDROID_HITTEST_WITHSIZE } -#endif return *this; } @@ -404,17 +392,12 @@ bool HitTestResult::addNodeToRectBasedTestResult(Node* node, int x, int y, const if (!isRectBasedTest()) return false; -#ifdef ANDROID_HITTEST_WITHSIZE - if (node) - m_rectBasedTestResult.add(node); -#else // If node is null, return true so the hit test can continue. if (!node) return true; node = node->shadowAncestorNode(); m_rectBasedTestResult.add(node); -#endif return !rect.contains(rectFromPoint(x, y)); } diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp index 574d389..02b0079 100644 --- a/WebCore/rendering/RenderBlock.cpp +++ b/WebCore/rendering/RenderBlock.cpp @@ -3774,17 +3774,8 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) && isPointInOverflowControl(result, _x, _y, tx, ty)) { updateHitTestResult(result, IntPoint(_x - tx, _y - ty)); // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet. -#ifdef ANDROID_HITTEST_WITHSIZE - // FIXME: This looks wrong - the return value does not depend on the hit test result. - result.addNodeToRectBasedTestResult(node(), _x, _y); - if (result.isRectBasedTest()) - ASSERT(node() || isAnonymous()); - else - return true; -#else if (!result.addNodeToRectBasedTestResult(node(), _x, _y)) return true; -#endif } // If we have clipping, then we can't have any spillout. diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp index 8a3ea8e..d614081 100644 --- a/WebCore/rendering/RenderBox.cpp +++ b/WebCore/rendering/RenderBox.cpp @@ -35,9 +35,6 @@ #include "htmlediting.h" #include "HTMLElement.h" #include "HTMLNames.h" -#ifdef ANDROID_HITTEST_WITHSIZE -#include "HitTestResult.h" -#endif #include "ImageBuffer.h" #include "FloatQuad.h" #include "Frame.h" @@ -563,6 +560,8 @@ bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result } } + // Check our bounds next. For this purpose always assume that we can only be hit in the + // foreground phase (which is true for replaced elements like images). IntRect boundsRect = IntRect(tx, ty, width(), height()); if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectFromPoint(xPos, yPos))) { updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp index 7c63af9..df80a7c 100644 --- a/WebCore/rendering/RenderLayer.cpp +++ b/WebCore/rendering/RenderLayer.cpp @@ -2997,15 +2997,9 @@ RenderLayer* RenderLayer::hitTestList(Vector<RenderLayer*>* list, RenderLayer* r result.append(tempResult); if (isHitCandidate(hitLayer, depthSortDescendants, zOffset, unflattenedTransformState)) { -#ifdef ANDROID_HITTEST_WITHSIZE - if (!result.isRectBasedTest()) - resultLayer = hitLayer; - result = tempResult; -#else resultLayer = hitLayer; if (!result.isRectBasedTest()) result = tempResult; -#endif if (!depthSortDescendants) break; } diff --git a/WebCore/rendering/RenderLineBoxList.cpp b/WebCore/rendering/RenderLineBoxList.cpp index d8b4e75..4d0dcd6 100644 --- a/WebCore/rendering/RenderLineBoxList.cpp +++ b/WebCore/rendering/RenderLineBoxList.cpp @@ -31,9 +31,6 @@ #include "HitTestResult.h" #include "InlineTextBox.h" -#ifdef ANDROID_HITTEST_WITHSIZE -#include "HitTestResult.h" -#endif #include "RenderArena.h" #include "RenderInline.h" #include "RenderView.h" diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp index 75e2bd2..b66a870 100644 --- a/WebCore/rendering/RenderSVGRoot.cpp +++ b/WebCore/rendering/RenderSVGRoot.cpp @@ -334,14 +334,7 @@ bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& re updateHitTestResult(result, pointInBorderBox); // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet. result.addNodeToRectBasedTestResult(child->node(), _x, _y); -#ifdef ANDROID_HITTEST_WITHSIZE - if (result.isRectBasedTest()) - ASSERT(node() || isAnonymous()); - else - return true; -#else return true; -#endif } } |