+2006-10-31 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Maciej.
+
+ Fix for http://bugs.webkit.org/show_bug.cgi?id=11461 HitTestResult
+ should be split into HitTestRequest and HitTestResult
+
+ This patch creates a new struct called HitTestRequest that holds
+ the three boolean values (readonly, active, and mouseMove) that
+ were formerly a part of HitTestRequest. all hitTest() and
+ nodeAtPoint() functions now take a HitTestRequest in addition to
+ the HitTestResult.
+
+ * WebCore.exp:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::eventMayStartDrag):
+ (WebCore::FrameMac::handleMouseMoveEvent):
+ * bridge/mac/WebCoreAXObject.mm:
+ (-[WebCoreAXObject doAXTextMarkerForPosition:]):
+ (-[WebCoreAXObject accessibilityHitTest:]):
+ * dom/Document.cpp:
+ (WebCore::Document::elementFromPoint):
+ (WebCore::Document::prepareMouseEvent):
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::contains):
+ * page/Frame.cpp:
+ (WebCore::Frame::hitTestResultAtPoint):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::handleWheelEvent):
+ * rendering/EllipsisBox.cpp:
+ (WebCore::EllipsisBox::nodeAtPoint):
+ * rendering/EllipsisBox.h:
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::HitTestResult):
+ (WebCore::HitTestResult::operator=):
+ * rendering/HitTestResult.h:
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::nodeAtPoint):
+ * rendering/InlineBox.h:
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::nodeAtPoint):
+ * rendering/InlineFlowBox.h:
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::nodeAtPoint):
+ * rendering/InlineTextBox.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::nodeAtPoint):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::nodeAtPoint):
+ * rendering/RenderBox.h:
+ * rendering/RenderFlow.cpp:
+ (WebCore::RenderFlow::hitTestLines):
+ * rendering/RenderFlow.h:
+ * rendering/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::nodeAtPoint):
+ * rendering/RenderForeignObject.h:
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::RenderFrameSet::nodeAtPoint):
+ * rendering/RenderFrameSet.h:
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::nodeAtPoint):
+ * rendering/RenderImage.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::nodeAtPoint):
+ * rendering/RenderInline.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::autoscroll):
+ (WebCore::RenderLayer::hitTest):
+ (WebCore::RenderLayer::hitTestLayer):
+ (WebCore::RenderLayer::updateHoverActiveState):
+ * rendering/RenderLayer.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::hitTest):
+ (WebCore::RenderObject::nodeAtPoint):
+ * rendering/RenderObject.h:
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::nodeAtPoint):
+ * rendering/RenderPath.h:
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::nodeAtPoint):
+ * rendering/RenderSVGImage.h:
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::nodeAtPoint):
+ * rendering/RenderSVGText.h:
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::nodeAtPoint):
+ * rendering/RenderTableRow.h:
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::nodeAtPoint):
+ * rendering/RenderTableSection.h:
+ * rendering/RenderText.h:
+ (WebCore::RenderText::nodeAtPoint):
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::nodeAtPoint):
+ * rendering/RenderTextControl.h:
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::nodeAtPoint):
+ * rendering/RootInlineBox.h:
+
2006-10-31 Lars Naesbye Christensen <larsnaesbye@stud.ku.dk>
Reviewed by Maciej.
__ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
__ZN7WebCore11selectRangeEPNS_19SelectionControllerEPNS_5RangeENS_9EAffinityEb
__ZN7WebCore12AtomicString3addEPNS_10StringImplE
-__ZN7WebCore13HitTestResultC1ERKNS_8IntPointEbbb
+__ZN7WebCore13HitTestResultC1ERKNS_8IntPointE
__ZN7WebCore13HitTestResultC1ERKS0_
__ZN7WebCore13HitTestResultD1Ev
__ZN7WebCore13HitTestResultaSERKS0_
9307F1130AF2C8BE00DBA31A /* DOMNodeInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85B498FA0ADB340200925CBB /* DOMNodeInternal.h */; };
9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */; };
9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 9307F1D60AF2D59000DBA31A /* HitTestResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 930908900AF7EDE40081DF01 /* HitTestRequest.h */; };
93126F6109D7A736008D9626 /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93126F6009D7A736008D9626 /* StringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
9326DC0B09DAD5BE00AFC847 /* CharsetData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9326DC0A09DAD5BE00AFC847 /* CharsetData.h */; };
9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; };
9307061309E0CA8200B17FE4 /* DerivedSources.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = DerivedSources.make; sourceTree = "<group>"; usesTabs = 1; };
9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestResult.cpp; sourceTree = "<group>"; };
9307F1D60AF2D59000DBA31A /* HitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestResult.h; sourceTree = "<group>"; };
+ 930908900AF7EDE40081DF01 /* HitTestRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestRequest.h; sourceTree = "<group>"; };
930CAAD609C495B600229C04 /* CanvasRenderingContext2D.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasRenderingContext2D.idl; sourceTree = "<group>"; };
930CAB8809C49EFA00229C04 /* CanvasGradient.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasGradient.idl; sourceTree = "<group>"; };
930CAB8F09C49F1B00229C04 /* CanvasPattern.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasPattern.idl; sourceTree = "<group>"; };
A8CFF0480A154F09000A4234 /* FixedTableLayout.cpp */,
A8CFF04A0A154F09000A4234 /* FixedTableLayout.h */,
935C477409AC4D8D00A6AAB4 /* GapRects.h */,
+ 930908900AF7EDE40081DF01 /* HitTestRequest.h */,
9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */,
9307F1D60AF2D59000DBA31A /* HitTestResult.h */,
A8CFF5DF0A155A05000A4234 /* InlineBox.cpp */,
B2A015B80AF6CD53006BCE0E /* SVGResourceMarker.h in Headers */,
B2A015BA0AF6CD53006BCE0E /* SVGResourceMasker.h in Headers */,
B2EBDC9D0AF77E3400AE4A68 /* SVGRenderTreeAsText.h in Headers */,
+ 930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
- projectRoot = "";
- shouldCheckCompatibility = 1;
targets = (
93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
#import "HTMLInputElement.h"
#import "HTMLNames.h"
#import "HTMLTableCellElement.h"
+#import "HitTestRequest.h"
#import "HitTestResult.h"
#import "Logging.h"
#import "MouseEventWithHitTestResults.h"
}
NSPoint loc = [event locationInWindow];
+ HitTestRequest request(true, false);
IntPoint mouseDownPos = d->m_view->windowToContents(IntPoint(loc));
- HitTestResult result(mouseDownPos, true, false);
- renderer()->layer()->hitTest(result);
+ HitTestResult result(mouseDownPos);
+ renderer()->layer()->hitTest(request, result);
bool srcIsDHTML;
return result.innerNode()->renderer()->draggableNode(DHTMLFlag, UAFlag, mouseDownPos.x(), mouseDownPos.y(), srcIsDHTML);
}
if (mouseDownMayStartDrag() && !_dragSrc) {
// try to find an element that wants to be dragged
- HitTestResult result(m_mouseDownPos, true, false);
- renderer()->layer()->hitTest(result);
+ HitTestRequest request(true, false);
+ HitTestResult result(m_mouseDownPos);
+ renderer()->layer()->hitTest(request, result);
Node *node = result.innerNode();
_dragSrc = (node && node->renderer()) ? node->renderer()->draggableNode(_dragSrcMayBeDHTML, _dragSrcMayBeUA, m_mouseDownPos.x(), m_mouseDownPos.y(), _dragSrcIsDHTML) : 0;
if (!_dragSrc) {
#import "HTMLMapElement.h"
#import "HTMLNames.h"
#import "HTMLSelectElement.h"
+#import "HitTestRequest.h"
#import "HitTestResult.h"
#import "RenderImage.h"
#import "RenderListMarker.h"
NSPoint windowCoord = [[view window] convertScreenToBase: point];
ourpoint = [view convertPoint:windowCoord fromView:nil];
- HitTestResult result(IntPoint(ourpoint), true, true);
- renderer->layer()->hitTest(result);
+ HitTestRequest request(true, true);
+ HitTestResult result = HitTestResult(IntPoint(ourpoint));
+ renderer->layer()->hitTest(request, result);
innerNode = result.innerNode();
if (!innerNode || !innerNode->renderer())
return nil;
if (!m_renderer)
return NSAccessibilityUnignoredAncestor(self);
- HitTestResult result(IntPoint(point), true, true);
- m_renderer->layer()->hitTest(result);
+ HitTestRequest request(true, true);
+ HitTestResult result = HitTestResult(IntPoint(point));
+ m_renderer->layer()->hitTest(request, result);
if (!result.innerNode())
return NSAccessibilityUnignoredAncestor(self);
Node* node = result.innerNode()->shadowAncestorNode();
#include "HTMLNameCollection.h"
#include "HTMLNames.h"
#include "HTMLStyleElement.h"
+#include "HitTestRequest.h"
+#include "HitTestResult.h"
#include "JSEditor.h"
#include "KeyboardEvent.h"
#include "Logging.h"
#include "MutationEvent.h"
#include "NameNodeList.h"
#include "NodeFilter.h"
-#include "HitTestResult.h"
#include "NodeIterator.h"
#include "PlatformKeyboardEvent.h"
#include "ProcessingInstruction.h"
if (!renderer())
return 0;
- HitTestResult result(IntPoint(x, y), true, true);
- renderer()->layer()->hitTest(result);
+ HitTestRequest request(true, true);
+ HitTestResult result(IntPoint(x, y));
+ renderer()->layer()->hitTest(request, result);
Node* n = result.innerNode();
while (n && !n->isElementNode())
return MouseEventWithHitTestResults(event, 0, 0, false);
assert(renderer()->isRenderView());
- HitTestResult result(point, readonly, active, mouseMove);
- renderer()->layer()->hitTest(result);
+ HitTestRequest request(readonly, active, mouseMove);
+ HitTestResult result(point);
+ renderer()->layer()->hitTest(request, result);
if (!readonly)
updateRendering();
#include "Frame.h"
#include "FrameTree.h"
#include "GraphicsContext.h"
+#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "RenderView.h"
#include "TextIterator.h"
if (!document->renderer())
return false;
- HitTestResult result(point, true, true);
- document->renderer()->layer()->hitTest(result);
+ HitTestRequest request(true, true);
+ HitTestResult result(point);
+ document->renderer()->layer()->hitTest(request, result);
Node *innerNode = result.innerNode();
if (!innerNode || !innerNode->renderer())
return false;
#include "HTMLNames.h"
#include "HTMLObjectElement.h"
#include "HTMLViewSourceDocument.h"
+#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "IconDatabase.h"
#include "IconLoader.h"
HitTestResult Frame::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent)
{
- HitTestResult result(point, true, true);
- renderer()->layer()->hitTest(result);
+ HitTestRequest request(true, true);
+ HitTestResult result(point);
+ renderer()->layer()->hitTest(request, result);
Node *n;
Widget *widget = 0;
widgetPoint.setX(widgetPoint.x() - absX + view->contentsX());
widgetPoint.setY(widgetPoint.y() - absY + view->contentsY());
- HitTestResult widgetHitTestResult(widgetPoint, true, true);
- frame->renderer()->layer()->hitTest(widgetHitTestResult);
+ HitTestRequest widgetHitTestRequest(true, true);
+ HitTestResult widgetHitTestResult(widgetPoint);
+ frame->renderer()->layer()->hitTest(widgetHitTestRequest, widgetHitTestResult);
result = widgetHitTestResult;
}
#include "HTMLFrameSetElement.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
+#include "HitTestRequest.h"
+#include "HitTestResult.h"
#include "Image.h"
#include "MouseEvent.h"
#include "MouseEventWithHitTestResults.h"
-#include "HitTestResult.h"
#include "OverflowEvent.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformScrollBar.h"
#include "Settings.h"
#include "cssstyleselector.h"
+
#ifdef SVG_SUPPORT
#include "XLinkNames.h"
#include "SVGNames.h"
if (docRenderer) {
IntPoint vPoint = windowToContents(e.pos());
- HitTestResult hitTestResult(vPoint, true, false);
- doc->renderer()->layer()->hitTest(hitTestResult);
+ HitTestRequest hitTestRequest(true, false);
+ HitTestResult hitTestResult(vPoint);
+ doc->renderer()->layer()->hitTest(hitTestRequest, hitTestResult);
Node *node = hitTestResult.innerNode();
Frame* subframe = subframeForTargetNode(node);
if (subframe && passWheelEventToSubframe(e, subframe)) {
}
}
-bool EllipsisBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty)
+bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
{
tx += m_x;
ty += m_y;
if (m_markupBox) {
int mtx = tx + m_width - m_markupBox->xPos();
int mty = ty + m_baseline - (m_markupBox->yPos() + m_markupBox->baseline());
- if (m_markupBox->nodeAtPoint(result, x, y, mtx, mty)) {
+ if (m_markupBox->nodeAtPoint(request, result, x, y, mtx, mty)) {
object()->setInnerNode(result);
return true;
}
namespace WebCore {
+class HitTestRequest;
class HitTestResult;
class EllipsisBox : public InlineBox {
}
virtual void paint(RenderObject::PaintInfo&, int _tx, int _ty);
- virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty);
private:
AtomicString m_str;
namespace WebCore {
-HitTestResult::HitTestResult(const IntPoint& point, bool readonly, bool active, bool mouseMove)
+HitTestResult::HitTestResult(const IntPoint& point)
: m_point(point)
- , m_readonly(readonly)
- , m_active(active)
- , m_mouseMove(mouseMove)
{
}
, m_point(other.point())
, m_innerURLElement(other.URLElement())
, m_scrollbar(other.scrollbar())
- , m_readonly(other.readonly())
- , m_active(other.active())
- , m_mouseMove(other.mouseMove())
{
}
m_point = other.point();
m_innerURLElement = other.URLElement();
m_scrollbar = other.scrollbar();
- m_readonly = other.readonly();
- m_active = other.active();
- m_mouseMove = other.mouseMove();
return *this;
}
class HitTestResult {
public:
- HitTestResult(const IntPoint&, bool readonly, bool active, bool mouseMove = false);
+ HitTestResult(const IntPoint&);
HitTestResult(const HitTestResult&);
~HitTestResult();
HitTestResult& operator=(const HitTestResult&);
- // These are not really part of the result. They are the parameters of the HitTest.
- // They should probably be in a different structure.
- bool readonly() const { return m_readonly; }
- bool active() const { return m_active; }
- bool mouseMove() const { return m_mouseMove; }
-
Node* innerNode() const { return m_innerNode.get(); }
Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); }
IntPoint point() const { return m_point; }
void setPoint(const IntPoint& p) { m_point = p; }
void setURLElement(Element*);
void setScrollbar(PlatformScrollbar*);
- void setReadonly(bool r) { m_readonly = r; }
- void setActive(bool a) { m_active = a; }
- void setMouseMove(bool m) { m_mouseMove = m; }
Frame* targetFrame() const;
IntRect boundingBox() const;
IntPoint m_point;
RefPtr<Element> m_innerURLElement;
RefPtr<PlatformScrollbar> m_scrollbar;
- bool m_readonly;
- bool m_active;
- bool m_mouseMove;
};
} // namespace WebCore
}
}
-bool InlineBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty)
+bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
{
// Hit test all phases of replaced elements atomically, as though the replaced element established its
// own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1
// specification.)
- return object()->hitTest(result, x, y, tx, ty);
+ return object()->hitTest(request, result, x, y, tx, ty);
}
bool InlineBox::isChildOfParent()
namespace WebCore {
+class HitTestRequest;
class HitTestResult;
class RootInlineBox;
virtual void adjustPosition(int dx, int dy);
virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
// Overloaded new operator.
void* operator new(size_t, RenderArena*) throw();
}
}
-bool InlineFlowBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty)
+bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
{
// Check children first.
for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) {
- if (!curr->object()->layer() && curr->nodeAtPoint(result, x, y, tx, ty)) {
+ if (!curr->object()->layer() && curr->nodeAtPoint(request, result, x, y, tx, ty)) {
object()->setInnerNode(result);
return true;
}
namespace WebCore {
+class HitTestRequest;
class HitTestResult;
class InlineFlowBox : public InlineRunBox {
int my, int mh, int _tx, int _ty, int w, int h);
virtual void paintDecorations(RenderObject::PaintInfo& i, int _tx, int _ty, bool paintedChildren = false);
virtual void paint(RenderObject::PaintInfo& i, int _tx, int _ty);
- virtual bool nodeAtPoint(HitTestResult&, int, int, int, int);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int);
int marginBorderPaddingLeft();
int marginBorderPaddingRight();
return object()->isBR() || (object()->style()->preserveNewline() && len() == 1 && (*textObject()->string())[start()] == '\n');
}
-bool InlineTextBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty)
+bool InlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
{
if (isLineBreak())
return false;
void selectionStartEnd(int& sPos, int& ePos);
virtual void paint(RenderObject::PaintInfo& i, int tx, int ty);
- virtual bool nodeAtPoint(HitTestResult&, int, int, int, int);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int);
RenderText* textObject() const;
return false;
}
-bool RenderBlock::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
bool inlineFlow = isInlineFlow();
m_layer->subtractScrollOffset(scrolledX, scrolledY);
if (childrenInline() && !isTable()) {
// We have to hit-test our line boxes.
- if (hitTestLines(result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
+ if (hitTestLines(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
setInnerNode(result);
return true;
}
for (RenderObject* child = lastChild(); child; child = child->previousSibling())
// FIXME: We have to skip over inline flows, since they can show up inside RenderTables at the moment (a demoted inline <form> for example). If we ever implement a
// table-specific hit-test method (which we should do for performance reasons anyway), then we can remove this check.
- if (!child->layer() && !child->isFloating() && !child->isInlineFlow() && child->nodeAtPoint(result, _x, _y, scrolledX, scrolledY, childHitTest)) {
+ if (!child->layer() && !child->isFloating() && !child->isInlineFlow() && child->nodeAtPoint(request, result, _x, _y, scrolledX, scrolledY, childHitTest)) {
setInnerNode(result);
return true;
}
FloatingObject* o;
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
for (it.toLast(); (o = it.current()); --it)
- if (!o->noPaint && !o->node->layer() && o->node->hitTest(result, _x, _y,
+ if (!o->noPaint && !o->node->layer() && o->node->hitTest(request, result, _x, _y,
scrolledX + o->left + o->node->marginLeft() - o->node->xPos(),
scrolledY + o->startY + o->node->marginTop() - o->node->yPos())) {
setInnerNode(result);
int leftRelOffset(int y, int fixedOffset, bool applyTextIndent = true, int* heightRemaining = 0) const;
int leftOffset(int y) const { return leftRelOffset(y, leftOffset(), true); }
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty);
}
// Hit Testing
-bool RenderBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
{
tx += m_x;
ty += m_y;
// at the moment (a demoted inline <form> for example). If we ever implement a
// table-specific hit-test method (which we should do for performance reasons anyway),
// then we can remove this check.
- if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(result, x, y, tx, ty, action)) {
+ if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, x, y, tx, ty, action)) {
setInnerNode(result);
return true;
}
virtual void setStyle(RenderStyle*);
virtual void paint(PaintInfo&, int _tx, int _ty);
- virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
virtual void destroy();
}
}
-bool RenderFlow::hitTestLines(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderFlow::hitTestLines(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
{
if (hitTestAction != HitTestForeground)
return false;
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevFlowBox()) {
if (y >= ty + curr->root()->topOverflow() && y < ty + curr->root()->bottomOverflow()) {
- bool inside = curr->nodeAtPoint(result, x, y, tx, ty);
+ bool inside = curr->nodeAtPoint(request, result, x, y, tx, ty);
if (inside) {
setInnerNode(result);
return true;
virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false);
void paintLines(PaintInfo&, int tx, int ty);
- bool hitTestLines(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ bool hitTestLines(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual IntRect getAbsoluteRepaintRect();
setNeedsLayout(false);
}
-bool RenderForeignObject::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderForeignObject::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
{
AffineTransform totalTransform = absoluteTransform();
totalTransform *= translationForAttributes();
double localX, localY;
totalTransform.invert().map(x, y, &localX, &localY);
- return RenderBlock::nodeAtPoint(result, static_cast<int>(localX), static_cast<int>(localY), tx, ty, hitTestAction);
+ return RenderBlock::nodeAtPoint(request, result, static_cast<int>(localX), static_cast<int>(localY), tx, ty, hitTestAction);
}
} // namespace WebCore
virtual bool requiresLayer();
virtual void layout();
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
private:
AffineTransform translationForAttributes();
#include "GraphicsContext.h"
#include "HTMLFrameSetElement.h"
#include "HTMLNames.h"
+#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "MouseEvent.h"
#include "RenderFrame.h"
delete [] m_vSplitVar;
}
-bool RenderFrameSet::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty,
- HitTestAction hitTestAction)
+bool RenderFrameSet::nodeAtPoint(const HitTestRequest& request, HitTestResult& result,
+ int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
if (hitTestAction != HitTestForeground)
return false;
- bool inside = RenderContainer::nodeAtPoint(result, _x, _y, _tx, _ty, hitTestAction) ||
+ bool inside = RenderContainer::nodeAtPoint(request, result, _x, _y, _tx, _ty, hitTestAction) ||
m_resizing || canResize(_x, _y);
- if (inside && element() && !element()->noResize() && !result.readonly() && !result.innerNode()) {
+ if (inside && element() && !element()->noResize() && !request.readonly && !result.innerNode()) {
result.setInnerNode(element());
result.setInnerNonSharedNode(element());
}
bool canResize(int x, int y);
void setResizing(bool);
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
HTMLFrameSetElement* element() const { return static_cast<HTMLFrameSetElement*>(RenderContainer::element()); }
return i ? i->document()->getImageMap(i->imageMap()) : 0;
}
-bool RenderImage::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
- bool inside = RenderReplaced::nodeAtPoint(result, _x, _y, _tx, _ty, hitTestAction);
+ bool inside = RenderReplaced::nodeAtPoint(request, result, _x, _y, _tx, _ty, hitTestAction);
if (inside && element()) {
int tx = _tx + m_x;
Image* image() { return m_cachedImage ? m_cachedImage->image() : nullImage(); }
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual int calcReplacedWidth() const;
virtual int calcReplacedHeight() const;
return "RenderInline";
}
-bool RenderInline::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderInline::nodeAtPoint(const HitTestRequest& request, HitTestResult& result,
+ int x, int y, int tx, int ty, HitTestAction hitTestAction)
{
- return hitTestLines(result, x, y, tx, ty, hitTestAction);
+ return hitTestLines(request, result, x, y, tx, ty, hitTestAction);
}
VisiblePosition RenderInline::positionForCoordinates(int x, int y)
virtual void paint(PaintInfo&, int tx, int ty);
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual void calcMinMaxWidth();
#include "GraphicsContext.h"
#include "HTMLMarqueeElement.h"
#include "HTMLNames.h"
+#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "OverflowEvent.h"
#include "PlatformMouseEvent.h"
IntPoint currentPos = currentFrame->view()->windowToContents(currentFrame->view()->currentMousePosition());
if (currentFrame->mouseDownMayStartSelect()) {
- HitTestResult result(currentPos, true, false, true);
- if (hitTest(result)) {
+ HitTestRequest request(true, false, true);
+ HitTestResult result(currentPos);
+ if (hitTest(request, result)) {
VisiblePosition pos(result.innerNode()->renderer()->positionForPoint(currentPos));
currentFrame->updateSelectionForMouseDragOverPosition(pos);
}
return enclosingIntRect(renderer->document()->frame()->view()->visibleContentRect());
}
-bool RenderLayer::hitTest(HitTestResult& result)
+bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result)
{
renderer()->document()->updateLayout();
IntRect boundsRect(m_x, m_y, width(), height());
boundsRect.intersect(frameVisibleRect(renderer()));
- RenderLayer* insideLayer = hitTestLayer(this, result, boundsRect);
+ RenderLayer* insideLayer = hitTestLayer(this, request, result, boundsRect);
// Now determine if the result is inside an anchor; make sure an image map wins if
// it already set URLElement and only use the innermost.
}
// Next set up the correct :hover/:active state along the new chain.
- updateHoverActiveState(result);
+ updateHoverActiveState(request, result);
// Now return whether we were inside this layer (this will always be true for the root
// layer).
return insideLayer;
}
-RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, HitTestResult& result, const IntRect& hitTestRect)
+RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, const HitTestRequest& request,
+ HitTestResult& result, const IntRect& hitTestRect)
{
// Calculate the clip rects we should use.
IntRect layerBounds;
// z-index.
if (m_posZOrderList) {
for (int i = m_posZOrderList->size() - 1; i >= 0; --i) {
- insideLayer = m_posZOrderList->at(i)->hitTestLayer(rootLayer, result, hitTestRect);
+ insideLayer = m_posZOrderList->at(i)->hitTestLayer(rootLayer, request, result, hitTestRect);
if (insideLayer)
return insideLayer;
}
// Now check our overflow objects.
if (m_overflowList) {
for (int i = m_overflowList->size() - 1; i >= 0; --i) {
- insideLayer = m_overflowList->at(i)->hitTestLayer(rootLayer, result, hitTestRect);
+ insideLayer = m_overflowList->at(i)->hitTestLayer(rootLayer, request, result, hitTestRect);
if (insideLayer)
return insideLayer;
}
// Next we want to see if the mouse pos is inside the child RenderObjects of the layer.
if (fgRect.contains(result.point()) &&
- renderer()->hitTest(result, result.point().x(), result.point().y(),
+ renderer()->hitTest(request, result, result.point().x(), result.point().y(),
layerBounds.x() - renderer()->xPos(),
- layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(), HitTestDescendants)) {
+ layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(),
+ HitTestDescendants)) {
// for positioned generated content, we might still not have a
// node by the time we get to the layer level, since none of
// the content in the layer has an element. So just walk up
// Now check our negative z-index children.
if (m_negZOrderList) {
for (int i = m_negZOrderList->size() - 1; i >= 0; --i) {
- insideLayer = m_negZOrderList->at(i)->hitTestLayer(rootLayer, result, hitTestRect);
+ insideLayer = m_negZOrderList->at(i)->hitTestLayer(rootLayer, request, result, hitTestRect);
if (insideLayer)
return insideLayer;
}
// contain the point so mouse move events keep getting delivered when dragging outside the
// window.
if (bgRect.contains(result.point()) &&
- renderer()->hitTest(result, result.point().x(), result.point().y(),
+ renderer()->hitTest(request, result, result.point().x(), result.point().y(),
layerBounds.x() - renderer()->xPos(),
layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(),
HitTestSelf))
// We didn't hit any layer. However if the mouse is down, we must always at least be inside
// the render view.
- if (result.active() && renderer()->isRenderView()) {
+ if (request.active && renderer()->isRenderView()) {
renderer()->setInnerNode(result);
return this;
}
return 0;
}
-void RenderLayer::updateHoverActiveState(HitTestResult& result)
+void RenderLayer::updateHoverActiveState(const HitTestRequest& request, HitTestResult& result)
{
// We don't update :hover/:active state when the result is marked as readonly.
- if (result.readonly())
+ if (request.readonly)
return;
Document* doc = renderer()->document();
if (!doc) return;
Node* activeNode = doc->activeNode();
- if (activeNode && !result.active()) {
+ if (activeNode && !request.active) {
// We are clearing the :active chain because the mouse has been released.
for (RenderObject* curr = activeNode->renderer(); curr; curr = curr->parent()) {
if (curr->element() && !curr->isText())
doc->setActiveNode(0);
} else {
Node* newActiveNode = result.innerNode();
- if (!activeNode && newActiveNode && result.active()) {
+ if (!activeNode && newActiveNode && request.active) {
// We are setting the :active chain and freezing it. If future moves happen, they
// will need to reference this chain.
for (RenderObject* curr = newActiveNode->renderer(); curr; curr = curr->parent()) {
// If the mouse is down and if this is a mouse move event, we want to restrict changes in
// :hover/:active to only apply to elements that are in the :active chain that we froze
// at the time the mouse went down.
- bool mustBeInActiveChain = result.active() && result.mouseMove();
+ bool mustBeInActiveChain = request.active && request.mouseMove;
// Check to see if the hovered node has changed. If not, then we don't need to
// do anything.
// Now set the hover state for our new object up to the root.
for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) {
if (curr->element() && !curr->isText() && (!mustBeInActiveChain || curr->element()->inActiveChain())) {
- curr->element()->setActive(result.active());
+ curr->element()->setActive(request.active);
curr->element()->setHovered(true);
}
}
namespace WebCore {
class CachedResource;
+class HitTestRequest;
class HitTestResult;
class PlatformScrollbar;
class RenderFrameSet;
// front. The hitTest method looks for mouse events by walking
// layers that intersect the point from front to back.
void paint(GraphicsContext*, const IntRect& damageRect, PaintRestriction = PaintRestrictionNone, RenderObject* paintingRoot = 0);
- bool hitTest(HitTestResult&);
+ bool hitTest(const HitTestRequest&, HitTestResult&);
// This method figures out our layerBounds in coordinates relative to
// |rootLayer}. It also computes our background and foreground clip rects
// Returns a bounding box for this layer only.
IntRect absoluteBoundingBox() const;
- void updateHoverActiveState(HitTestResult&);
+ void updateHoverActiveState(const HitTestRequest&, HitTestResult&);
IntRect repaintRect() const { return m_repaintRect; }
void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect,
bool haveTransparency, PaintRestriction, RenderObject* paintingRoot);
- RenderLayer* hitTestLayer(RenderLayer* rootLayer, HitTestResult&, const IntRect& hitTestRect);
+ RenderLayer* hitTestLayer(RenderLayer* rootLayer, const HitTestRequest&, HitTestResult&, const IntRect& hitTestRect);
void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0);
bool shouldBeOverflowOnly() const;
#include "HTMLNames.h"
#include "HTMLOListElement.h"
#include "KURL.h"
+#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "Position.h"
#include "RenderArena.h"
continuation()->updateDragState(dragOn);
}
-bool RenderObject::hitTest(HitTestResult& result, int x, int y, int tx, int ty, HitTestFilter hitTestFilter)
+bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestFilter hitTestFilter)
{
bool inside = false;
if (hitTestFilter != HitTestSelf) {
// First test the foreground layer (lines and inlines).
- inside = nodeAtPoint(result, x, y, tx, ty, HitTestForeground);
+ inside = nodeAtPoint(request, result, x, y, tx, ty, HitTestForeground);
// Test floats next.
if (!inside)
- inside = nodeAtPoint(result, x, y, tx, ty, HitTestFloat);
+ inside = nodeAtPoint(request, result, x, y, tx, ty, HitTestFloat);
// Finally test to see if the mouse is in the background (within a child block's background).
if (!inside)
- inside = nodeAtPoint(result, x, y, tx, ty, HitTestChildBlockBackgrounds);
+ inside = nodeAtPoint(request, result, x, y, tx, ty, HitTestChildBlockBackgrounds);
}
// See if the mouse is inside us but not any of our descendants
if (hitTestFilter != HitTestDescendants && !inside)
- inside = nodeAtPoint(result, x, y, tx, ty, HitTestBlockBackground);
+ inside = nodeAtPoint(request, result, x, y, tx, ty, HitTestBlockBackground);
return inside;
}
}
}
-bool RenderObject::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty,
- HitTestAction hitTestAction)
+bool RenderObject::nodeAtPoint(const HitTestRequest& request, HitTestResult& result,
+ int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
return false;
}
class HTMLAreaElement;
class InlineBox;
class InlineFlowBox;
+class HitTestRequest;
class HitTestResult;
class PlatformScrollbar;
class Position;
RepaintInfo(RenderObject* o, const IntRect& r) :m_object(o), m_repaintRect(r) {}
};
- bool hitTest(HitTestResult&, int x, int y, int tx, int ty, HitTestFilter hitTestFilter = HitTestAll);
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ bool hitTest(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestFilter hitTestFilter = HitTestAll);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
void setInnerNode(HitTestResult&);
virtual VisiblePosition positionForCoordinates(int x, int y);
return hitRules;
}
-bool RenderPath::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderPath::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
// We only draw in the forground phase, so we only hit-test then.
if (hitTestAction != HitTestForeground)
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
// FIXME: When the other SVG classes get pointer-events support this should be moved elsewhere
struct PointerEventsHitRules {
RenderImage::computeAbsoluteRepaintRect(r, f);
}
-bool RenderSVGImage::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderSVGImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
AffineTransform totalTransform = absoluteTransform();
totalTransform *= translationForAttributes();
double localX, localY;
totalTransform.invert().map(_x + _tx, _y + _ty, &localX, &localY);
- return RenderImage::nodeAtPoint(result, (int)localX, (int)localY, 0, 0, hitTestAction);
+ return RenderImage::nodeAtPoint(request, result, (int)localX, (int)localY, 0, 0, hitTestAction);
}
bool RenderSVGImage::requiresLayer()
virtual void computeAbsoluteRepaintRect(IntRect&, bool f);
- virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
private:
void translateForAttributes();
return flowBox;
}
-bool RenderSVGText::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderSVGText::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
{
AffineTransform totalTransform = absoluteTransform();
double localX, localY;
totalTransform.invert().map(_x, _y, &localX, &localY);
- return RenderBlock::nodeAtPoint(result, (int)localX, (int)localY, _tx, _ty, hitTestAction);
+ return RenderBlock::nodeAtPoint(request, result, (int)localX, (int)localY, _tx, _ty, hitTestAction);
}
void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
virtual AffineTransform localTransform() const { return m_transform; }
virtual void setLocalTransform(const AffineTransform& transform) { m_transform = transform; }
virtual void paint(PaintInfo& i, int _tx, int _ty);
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void computeAbsoluteRepaintRect(IntRect& r, bool f);
virtual bool requiresLayer();
}
// Hit Testing
-bool RenderTableRow::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
{
// Table rows cannot ever be hit tested. Effectively they do not exist.
// Just forward to our children always.
// at the moment (a demoted inline <form> for example). If we ever implement a
// table-specific hit-test method (which we should do for performance reasons anyway),
// then we can remove this check.
- if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(result, x, y, tx, ty, action)) {
+ if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, x, y, tx, ty, action)) {
setInnerNode(result);
return true;
}
virtual void position(InlineBox*) { }
virtual void layout();
virtual IntRect getAbsoluteRepaintRect();
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
// The only time rows get a layer is when they have transparency.
virtual bool requiresLayer() { return isTransparent() || hasOverflowClip(); }
}
// Hit Testing
-bool RenderTableSection::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
{
// Table sections cannot ever be hit tested. Effectively they do not exist.
// Just forward to our children always.
// at the moment (a demoted inline <form> for example). If we ever implement a
// table-specific hit-test method (which we should do for performance reasons anyway),
// then we can remove this check.
- if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(result, x, y, tx, ty, action)) {
+ if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, x, y, tx, ty, action)) {
setInnerNode(result);
return true;
}
virtual RenderObject* removeChildNode(RenderObject* child);
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
// this gets a cell grid data structure. changing the number of
// columns is done by the table
virtual void paint(PaintInfo& i, int tx, int ty) { assert(false); }
virtual void layout() { assert(false); }
- virtual bool nodeAtPoint(HitTestResult&, int, int, int, int, HitTestAction) { assert(false); return false; }
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction) { assert(false); return false; }
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void lineBoxRects(Vector<IntRect>&);
return RenderFlexibleBox::baselinePosition(b, isRootLineBox);
}
-bool RenderTextControl::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderTextControl::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
{
// If we're within the text control, we want to act as if we've hit the inner div, incase the point
// was on the control but not on the div (see Radar 4617841).
- if (RenderFlexibleBox::nodeAtPoint(result, x, y, tx, ty, hitTestAction)) {
+ if (RenderFlexibleBox::nodeAtPoint(request, result, x, y, tx, ty, hitTestAction)) {
result.setInnerNode(m_div.get());
return true;
}
virtual void updateFromElement();
virtual bool canHaveChildren() const { return false; }
virtual short baselinePosition( bool, bool ) const;
- virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
RenderStyle* createDivStyle(RenderStyle* startStyle);
#endif
}
-bool RootInlineBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty)
+bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
{
if (m_ellipsisBox && object()->style()->visibility() == VISIBLE) {
- if (m_ellipsisBox->nodeAtPoint(result, x, y, tx, ty)) {
+ if (m_ellipsisBox->nodeAtPoint(request, result, x, y, tx, ty)) {
object()->setInnerNode(result);
return true;
}
}
- return InlineFlowBox::nodeAtPoint(result, x, y, tx, ty);
+ return InlineFlowBox::nodeAtPoint(request, result, x, y, tx, ty);
}
void RootInlineBox::adjustPosition(int dx, int dy)
#endif
virtual void paint(RenderObject::PaintInfo& i, int _tx, int _ty);
- virtual bool nodeAtPoint(HitTestResult&, int, int, int, int);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int);
bool hasSelectedChildren() const { return m_hasSelectedChildren; }
void setHasSelectedChildren(bool b);
+2006-10-31 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Maciej.
+
+ Small tweaks to WebKit because of http://bugs.webkit.org/
+ show_bug.cgi?id=11461 HitTestResult should be split into
+ HitTestRequest and HitTestResult
+
+ * WebKit.xcodeproj/project.pbxproj:
+ * WebView/WebHTMLView.m:
+ (-[WebHTMLView elementAtPoint:allowShadowContent:]): The
+ HitTestResult initializer now just takes a point.
+
2006-10-31 Darin Adler <darin@apple.com>
Reviewed by Brady.
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
- projectRoot = "";
- shouldCheckCompatibility = 1;
targets = (
9398100A0824BF01008DF038 /* WebKit */,
);
- (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow;
{
Frame* frame = core([self _frame]);
- HitTestResult result(IntPoint(point), true, false);
+ HitTestResult result = HitTestResult(IntPoint(point));
if (frame->renderer())
result = frame->hitTestResultAtPoint(IntPoint(point), allow);
return [[[WebElementDictionary alloc] initWithHitTestResult:result] autorelease];