WebCore:
authorbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Oct 2006 18:28:00 +0000 (18:28 +0000)
committerbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Oct 2006 18:28:00 +0000 (18:28 +0000)
        Reviewed by Darin.

        This is the WebCore half of pushing elementAtPoint and the backend
        of WebElementDictionary into WebCore. Most of the changes below are
        to accommodate one of the following:

        -NodeInfo is now a stand-alone class called HitTestResult.
                Previously it was defined in RenderObject.h, but not for
                any particular reason. The WebElementDictionary
                functionality that was pushed into WebCore has been pushed
                specifically into the this class. In fact,
                WebElementDictionary now keeps a HitTestResult as a member
                varibale.

        -The enumeration AccessPolicy is now called
                ClipboardAccessPolicy and is defined in its own header. It
                was previously defined in ClipboardMac.h, but is now
                defined independently to avoid including ClipboardMac.h
                from within FrameMac.h since FrameMac.h is now included in
                WebElementDictionary.m in WebKit.

        -Element now has a virtual target() for the sake of
                NodeInfo::targetFrame()

        * WebCore.exp: Several WebCore functions are newly called from
        WebKit, so they have been added here.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOM.mm: Must include Image.h because of adjustments
        to ClipboardMac.
        * bridge/mac/FrameMac.h: Adjust to HitTestResult changes.
        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::freeClipboard): Adjust to ClipboardAccessPolicy
        and HitTestResult changes.
        (WebCore::FrameMac::eventMayStartDrag): Same.
        (WebCore::FrameMac::handleMouseMoveEvent): Same.
        (WebCore::FrameMac::dispatchCPPEvent): Same.
        (WebCore::FrameMac::mayDHTMLCut): Same.
        (WebCore::FrameMac::mayDHTMLCopy): Same.
        (WebCore::FrameMac::mayDHTMLPaste): Same.
        (WebCore::FrameMac::tryDHTMLCut): Same
        (WebCore::FrameMac::tryDHTMLCopy): Same.
        (WebCore::FrameMac::tryDHTMLPaste): Same.
        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject doAXTextMarkerForPosition:]): Adjust to
        HitTestResult changes.
        (-[WebCoreAXObject accessibilityHitTest:]): Same.
        * bridge/mac/WebCoreFrameBridge.h: Same.
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge dragOperationForDraggingInfo:]): Adjust for
        ClipboardAccessPolicy changes.
        (-[WebCoreFrameBridge dragExitedWithDraggingInfo:]): Same.
        (-[WebCoreFrameBridge concludeDragForDraggingInfo:]): Same.
        * dom/Document.cpp:
        (WebCore::Document::elementFromPoint): Adjust for HitTestResult
        changes.
        (WebCore::Document::prepareMouseEvent): Same.
        * dom/Element.h:
        (WebCore::Element::target): Now has a virtual target()
        * html/HTMLAnchorElement.h: Same.
        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::mapMouseEvent): Adjust for HitTestResult
        changes.
        * html/HTMLAreaElement.h: Virtual target()
        * html/HTMLBaseElement.h:
        (WebCore::HTMLBaseElement::target): Same.
        * html/HTMLFormElement.h: Same.
        * html/HTMLLinkElement.h: Same.
        * html/HTMLMapElement.cpp:
        (WebCore::HTMLMapElement::mapMouseEvent): Adjust for HitTestResult
        changes.
        * html/HTMLMapElement.h: Same.
        * page/Frame.cpp:
        (WebCore::Frame::isPointInsideSelection): Same.
        (WebCore::Frame::hitTestResultAtPoint): Same.
        * page/Frame.h: Same.
        * page/FrameView.cpp:
        (WebCore::FrameView::handleWheelEvent): Same.
        * platform/mac/ClipboardAccessPolicy.h: Added.
        (WebCore::):
        * platform/mac/ClipboardMac.h: Remove definition of AccessPolicy,
        include ClipboardAccessPolicy.h, and rename AccessPolicy to
        ClipboardAccessPolicy.
        * platform/mac/ClipboardMac.mm: Rename ClipboardAccessPolicy.
        (WebCore::ClipboardMac::ClipboardMac):
        (WebCore::ClipboardMac::setAccessPolicy):
        (WebCore::ClipboardMac::clearData):
        (WebCore::ClipboardMac::clearAllData):
        (WebCore::ClipboardMac::getData):
        (WebCore::ClipboardMac::setData):
        (WebCore::ClipboardMac::types):
        (WebCore::ClipboardMac::setDragImage):
        (WebCore::ClipboardMac::setDropEffect):
        (WebCore::ClipboardMac::setEffectAllowed):
        * rendering/EllipsisBox.cpp:
        (WebCore::EllipsisBox::nodeAtPoint): Adjust for HitTestResult
        changes.
        * rendering/EllipsisBox.h:
        * rendering/HitTestResult.cpp: Added.
        (WebCore::HitTestResult::HitTestResult):
        (WebCore::HitTestResult::~HitTestResult):
        (WebCore::HitTestResult::operator=):
        (WebCore::HitTestResult::setInnerNode):
        (WebCore::HitTestResult::setInnerNonSharedNode):
        (WebCore::HitTestResult::setURLElement):
        (WebCore::HitTestResult::setScrollbar):
        (WebCore::HitTestResult::targetFrame):
        (WebCore::HitTestResult::boundingBox):
        (WebCore::HitTestResult::isSelected):
        (WebCore::HitTestResult::title):
        * rendering/HitTestResult.h: Added.
        (WebCore::HitTestResult::readonly):
        (WebCore::HitTestResult::active):
        (WebCore::HitTestResult::mouseMove):
        (WebCore::HitTestResult::innerNode):
        (WebCore::HitTestResult::innerNonSharedNode):
        (WebCore::HitTestResult::point):
        (WebCore::HitTestResult::URLElement):
        (WebCore::HitTestResult::scrollbar):
        (WebCore::HitTestResult::setPoint):
        (WebCore::HitTestResult::setReadonly):
        (WebCore::HitTestResult::setActive):
        (WebCore::HitTestResult::setMouseMove):
        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::nodeAtPoint): Adjust to HitTestResult changes.
        * rendering/InlineBox.h: Same.
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::nodeAtPoint): Same.
        * rendering/InlineFlowBox.h: Same.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::nodeAtPoint): Same.
        * rendering/InlineTextBox.h: Same.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::isPointInScrollbar): Same.
        (WebCore::RenderBlock::nodeAtPoint): Same.
        * rendering/RenderBlock.h: Same.
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::nodeAtPoint): Same.
        * rendering/RenderBox.h: Same.
        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::hitTestLines): Same.
        * rendering/RenderFlow.h: Same.
        * rendering/RenderForeignObject.cpp:
        (WebCore::RenderForeignObject::nodeAtPoint): Same.
        * rendering/RenderForeignObject.h: Same.
        * rendering/RenderFrameSet.cpp:
        (WebCore::RenderFrameSet::nodeAtPoint): Same.
        * rendering/RenderFrameSet.h: Same.
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::nodeAtPoint): Same.
        * rendering/RenderImage.h: Same.
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::nodeAtPoint): Same.
        * rendering/RenderInline.h: Same.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::autoscroll): Same.
        (WebCore::RenderLayer::hitTest): Same.
        (WebCore::RenderLayer::hitTestLayer): Same.
        (WebCore::RenderLayer::updateHoverActiveState): Same.
        * rendering/RenderLayer.h: Same.
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::isPointInScrollbar): Same.
        * rendering/RenderListBox.h: Same.
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::hitTest): Same.
        (WebCore::RenderObject::setInnerNode): Same.
        (WebCore::RenderObject::nodeAtPoint): Same.
        * rendering/RenderObject.h: Remove NodeInfo class and forward
        declare HitTestResult.
        * rendering/RenderPath.cpp:
        (WebCore::RenderPath::nodeAtPoint): Adjust to HitTestResult
        changes.
        * rendering/RenderPath.h: Same.
        * rendering/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::nodeAtPoint): Same.
        * rendering/RenderSVGImage.h: Same
        * rendering/RenderSVGText.cpp:
        (WebCore::RenderSVGText::nodeAtPoint): Same.
        * rendering/RenderSVGText.h: Same.
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::nodeAtPoint): Same.
        * rendering/RenderTableRow.h: Same.
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::nodeAtPoint): Same.
        * rendering/RenderTableSection.h: Same.
        * rendering/RenderText.h: Same.
        (WebCore::RenderText::nodeAtPoint): Same.
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::nodeAtPoint): Same.
        * rendering/RenderTextControl.h: Same.
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::nodeAtPoint): Same.
        * rendering/RootInlineBox.h: Same.

WebKit:
        Reviewed by Darin.

        This is the WebKit half of pushing the guts of elementAtPoint and
        WebElementDictionary into WebCore. Among other things, this patch
        makes WebElementDictionary.m and WebHTMLView.m Objective-C++

        * MigrateHeaders.make: Add DOMElementInternal.h to the list of
        headers to migrate.
        * Misc/WebElementDictionary.h: Replaced DOMNode, DOMElement, and
        NSPoint member variables with a HitTestResult member variable.
        * Misc/WebElementDictionary.m:
        (addLookupKey): Formatting.
        (-[WebElementDictionary initWithHitTestResult:]): Constructor just
        takes a HitTestResult now and sets the member variable.
        (-[WebElementDictionary dealloc]): delete HitTestResult.
        (-[WebElementDictionary finalize]): Address HitTestResult.
        (-[WebElementDictionary _domNode]): Use HitTestResult and call into
        WebCore.
        (-[WebElementDictionary objectForKey:]): Same.
        (-[WebElementDictionary _webFrame]): Same.
        (-[WebElementDictionary _targetWebFrame]): Same.
        (-[WebElementDictionary _title]): Same.
        (-[WebElementDictionary _imageRect]): Same.
        (-[WebElementDictionary _isSelected]): Same.
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebFrame.mm:
        (core): Convert from DOMNode* to Node*
        (kit): Convert from Node* to DOMNode*
        * WebView/WebFrameInternal.h: Support for the above.
        * WebView/WebHTMLView.m:
        (-[WebHTMLView elementAtPoint:allowShadowContent:]): Call directly
        into Frame.cpp to get HitTestResult.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17399 268f45cc-cd09-0410-ab3c-d52691b4dbfc

78 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOM.mm
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/dom/Document.cpp
WebCore/dom/Element.h
WebCore/html/HTMLAnchorElement.h
WebCore/html/HTMLAreaElement.cpp
WebCore/html/HTMLAreaElement.h
WebCore/html/HTMLBaseElement.h
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLLinkElement.h
WebCore/html/HTMLMapElement.cpp
WebCore/html/HTMLMapElement.h
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FrameView.cpp
WebCore/platform/mac/ClipboardAccessPolicy.h [new file with mode: 0644]
WebCore/platform/mac/ClipboardMac.h
WebCore/platform/mac/ClipboardMac.mm
WebCore/rendering/EllipsisBox.cpp
WebCore/rendering/EllipsisBox.h
WebCore/rendering/HitTestResult.cpp [new file with mode: 0644]
WebCore/rendering/HitTestResult.h [new file with mode: 0644]
WebCore/rendering/InlineBox.cpp
WebCore/rendering/InlineBox.h
WebCore/rendering/InlineFlowBox.cpp
WebCore/rendering/InlineFlowBox.h
WebCore/rendering/InlineTextBox.cpp
WebCore/rendering/InlineTextBox.h
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBlock.h
WebCore/rendering/RenderBox.cpp
WebCore/rendering/RenderBox.h
WebCore/rendering/RenderFlow.cpp
WebCore/rendering/RenderFlow.h
WebCore/rendering/RenderForeignObject.cpp
WebCore/rendering/RenderForeignObject.h
WebCore/rendering/RenderFrameSet.cpp
WebCore/rendering/RenderFrameSet.h
WebCore/rendering/RenderImage.cpp
WebCore/rendering/RenderImage.h
WebCore/rendering/RenderInline.cpp
WebCore/rendering/RenderInline.h
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderLayer.h
WebCore/rendering/RenderListBox.cpp
WebCore/rendering/RenderListBox.h
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderObject.h
WebCore/rendering/RenderPath.cpp
WebCore/rendering/RenderPath.h
WebCore/rendering/RenderSVGImage.cpp
WebCore/rendering/RenderSVGImage.h
WebCore/rendering/RenderSVGText.cpp
WebCore/rendering/RenderSVGText.h
WebCore/rendering/RenderTableRow.cpp
WebCore/rendering/RenderTableRow.h
WebCore/rendering/RenderTableSection.cpp
WebCore/rendering/RenderTableSection.h
WebCore/rendering/RenderText.h
WebCore/rendering/RenderTextControl.cpp
WebCore/rendering/RenderTextControl.h
WebCore/rendering/RootInlineBox.cpp
WebCore/rendering/RootInlineBox.h
WebKit/ChangeLog
WebKit/MigrateHeaders.make
WebKit/Misc/WebElementDictionary.h
WebKit/Misc/WebElementDictionary.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebFrameInternal.h
WebKit/WebView/WebHTMLView.m

index 28d789314407b52780a5f217e0042c72c2edb7b1..fda186f2519300490826fede25608ea3aae2650a 100644 (file)
@@ -1,3 +1,198 @@
+2006-10-28  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Darin.
+
+        This is the WebCore half of pushing elementAtPoint and the backend 
+        of WebElementDictionary into WebCore. Most of the changes below are 
+        to accommodate one of the following:
+                
+        -NodeInfo is now a stand-alone class called HitTestResult. 
+                Previously it was defined in RenderObject.h, but not for 
+                any particular reason. The WebElementDictionary 
+                functionality that was pushed into WebCore has been pushed 
+                specifically into the this class. In fact, 
+                WebElementDictionary now keeps a HitTestResult as a member 
+                varibale.
+                
+        -The enumeration AccessPolicy is now called 
+                ClipboardAccessPolicy and is defined in its own header. It 
+                was previously defined in ClipboardMac.h, but is now 
+                defined independently to avoid including ClipboardMac.h 
+                from within FrameMac.h since FrameMac.h is now included in 
+                WebElementDictionary.m in WebKit.
+                
+        -Element now has a virtual target() for the sake of 
+                NodeInfo::targetFrame() 
+
+        * WebCore.exp: Several WebCore functions are newly called from 
+        WebKit, so they have been added here. 
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/DOM.mm: Must include Image.h because of adjustments 
+        to ClipboardMac.
+        * bridge/mac/FrameMac.h: Adjust to HitTestResult changes.
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::freeClipboard): Adjust to ClipboardAccessPolicy 
+        and HitTestResult changes.
+        (WebCore::FrameMac::eventMayStartDrag): Same.
+        (WebCore::FrameMac::handleMouseMoveEvent): Same.
+        (WebCore::FrameMac::dispatchCPPEvent): Same.
+        (WebCore::FrameMac::mayDHTMLCut): Same.
+        (WebCore::FrameMac::mayDHTMLCopy): Same.
+        (WebCore::FrameMac::mayDHTMLPaste): Same.
+        (WebCore::FrameMac::tryDHTMLCut): Same
+        (WebCore::FrameMac::tryDHTMLCopy): Same.
+        (WebCore::FrameMac::tryDHTMLPaste): Same.
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject doAXTextMarkerForPosition:]): Adjust to 
+        HitTestResult changes.
+        (-[WebCoreAXObject accessibilityHitTest:]): Same.
+        * bridge/mac/WebCoreFrameBridge.h: Same.
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge dragOperationForDraggingInfo:]): Adjust for 
+        ClipboardAccessPolicy changes.
+        (-[WebCoreFrameBridge dragExitedWithDraggingInfo:]): Same.
+        (-[WebCoreFrameBridge concludeDragForDraggingInfo:]): Same.
+        * dom/Document.cpp:
+        (WebCore::Document::elementFromPoint): Adjust for HitTestResult 
+        changes.
+        (WebCore::Document::prepareMouseEvent): Same.
+        * dom/Element.h:
+        (WebCore::Element::target): Now has a virtual target()
+        * html/HTMLAnchorElement.h: Same.
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::mapMouseEvent): Adjust for HitTestResult 
+        changes.
+        * html/HTMLAreaElement.h: Virtual target()
+        * html/HTMLBaseElement.h:
+        (WebCore::HTMLBaseElement::target): Same.
+        * html/HTMLFormElement.h: Same.
+        * html/HTMLLinkElement.h: Same.
+        * html/HTMLMapElement.cpp:
+        (WebCore::HTMLMapElement::mapMouseEvent): Adjust for HitTestResult 
+        changes.
+        * html/HTMLMapElement.h: Same.
+        * page/Frame.cpp:
+        (WebCore::Frame::isPointInsideSelection): Same.
+        (WebCore::Frame::hitTestResultAtPoint): Same. 
+        * page/Frame.h: Same.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::handleWheelEvent): Same.
+        * platform/mac/ClipboardAccessPolicy.h: Added.
+        (WebCore::):
+        * platform/mac/ClipboardMac.h: Remove definition of AccessPolicy, 
+        include ClipboardAccessPolicy.h, and rename AccessPolicy to 
+        ClipboardAccessPolicy.
+        * platform/mac/ClipboardMac.mm: Rename ClipboardAccessPolicy.
+        (WebCore::ClipboardMac::ClipboardMac):
+        (WebCore::ClipboardMac::setAccessPolicy):
+        (WebCore::ClipboardMac::clearData):
+        (WebCore::ClipboardMac::clearAllData):
+        (WebCore::ClipboardMac::getData):
+        (WebCore::ClipboardMac::setData):
+        (WebCore::ClipboardMac::types):
+        (WebCore::ClipboardMac::setDragImage):
+        (WebCore::ClipboardMac::setDropEffect):
+        (WebCore::ClipboardMac::setEffectAllowed):
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::nodeAtPoint): Adjust for HitTestResult 
+        changes.
+        * rendering/EllipsisBox.h:
+        * rendering/HitTestResult.cpp: Added.
+        (WebCore::HitTestResult::HitTestResult):
+        (WebCore::HitTestResult::~HitTestResult):
+        (WebCore::HitTestResult::operator=):
+        (WebCore::HitTestResult::setInnerNode):
+        (WebCore::HitTestResult::setInnerNonSharedNode):
+        (WebCore::HitTestResult::setURLElement):
+        (WebCore::HitTestResult::setScrollbar):
+        (WebCore::HitTestResult::targetFrame):
+        (WebCore::HitTestResult::boundingBox):
+        (WebCore::HitTestResult::isSelected):
+        (WebCore::HitTestResult::title):
+        * rendering/HitTestResult.h: Added.
+        (WebCore::HitTestResult::readonly):
+        (WebCore::HitTestResult::active):
+        (WebCore::HitTestResult::mouseMove):
+        (WebCore::HitTestResult::innerNode):
+        (WebCore::HitTestResult::innerNonSharedNode):
+        (WebCore::HitTestResult::point):
+        (WebCore::HitTestResult::URLElement):
+        (WebCore::HitTestResult::scrollbar):
+        (WebCore::HitTestResult::setPoint):
+        (WebCore::HitTestResult::setReadonly):
+        (WebCore::HitTestResult::setActive):
+        (WebCore::HitTestResult::setMouseMove):
+        * rendering/InlineBox.cpp:
+        (WebCore::InlineBox::nodeAtPoint): Adjust to HitTestResult changes.
+        * rendering/InlineBox.h: Same.
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::nodeAtPoint): Same.
+        * rendering/InlineFlowBox.h: Same.
+        * rendering/InlineTextBox.cpp: 
+        (WebCore::InlineTextBox::nodeAtPoint): Same.
+        * rendering/InlineTextBox.h: Same.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::isPointInScrollbar): Same.
+        (WebCore::RenderBlock::nodeAtPoint): Same.
+        * rendering/RenderBlock.h: Same.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::nodeAtPoint): Same.
+        * rendering/RenderBox.h: Same.
+        * rendering/RenderFlow.cpp:
+        (WebCore::RenderFlow::hitTestLines): Same.
+        * rendering/RenderFlow.h: Same.
+        * rendering/RenderForeignObject.cpp:
+        (WebCore::RenderForeignObject::nodeAtPoint): Same.
+        * rendering/RenderForeignObject.h: Same.
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::nodeAtPoint): Same.
+        * rendering/RenderFrameSet.h: Same.
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::nodeAtPoint): Same.
+        * rendering/RenderImage.h: Same.
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::nodeAtPoint): Same.
+        * rendering/RenderInline.h: Same.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::autoscroll): Same.
+        (WebCore::RenderLayer::hitTest): Same.
+        (WebCore::RenderLayer::hitTestLayer): Same.
+        (WebCore::RenderLayer::updateHoverActiveState): Same.
+        * rendering/RenderLayer.h: Same.
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::isPointInScrollbar): Same.
+        * rendering/RenderListBox.h: Same.
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::hitTest): Same.
+        (WebCore::RenderObject::setInnerNode): Same.
+        (WebCore::RenderObject::nodeAtPoint): Same.
+        * rendering/RenderObject.h: Remove NodeInfo class and forward 
+        declare HitTestResult.
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::nodeAtPoint): Adjust to HitTestResult 
+        changes.
+        * rendering/RenderPath.h: Same.
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::nodeAtPoint): Same.
+        * rendering/RenderSVGImage.h: Same
+        * rendering/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::nodeAtPoint): Same.
+        * rendering/RenderSVGText.h: Same.
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::nodeAtPoint): Same.
+        * rendering/RenderTableRow.h: Same.
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::nodeAtPoint): Same.
+        * rendering/RenderTableSection.h: Same.
+        * rendering/RenderText.h: Same.
+        (WebCore::RenderText::nodeAtPoint): Same.
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::nodeAtPoint): Same.
+        * rendering/RenderTextControl.h: Same.
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::nodeAtPoint): Same.
+        * rendering/RootInlineBox.h: Same.
+
 2006-10-27  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Anders.
index 9ad49bd5ac0fb9f871d9bb24c3a8eaa762334bee..4123850e9be98910216b3377f2b07dd4287317fe 100644 (file)
@@ -159,6 +159,10 @@ __ZN7WebCore11FrameLoader8safeLoadEP5NSURL
 __ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
 __ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
 __ZN7WebCore12AtomicString3addEPNS_10StringImplE
+__ZN7WebCore13HitTestResultC1ERKS0_
+__ZN7WebCore13HitTestResultC1Ebbb
+__ZN7WebCore13HitTestResultD1Ev
+__ZN7WebCore13HitTestResultaSERKS0_
 __ZN7WebCore14DocumentLoader12setCommittedEb
 __ZN7WebCore14DocumentLoader13attachToFrameEv
 __ZN7WebCore14DocumentLoader15detachFromFrameEv
@@ -181,6 +185,7 @@ __ZN7WebCore5Frame12canCachePageEv
 __ZN7WebCore5Frame12ownerElementEv
 __ZN7WebCore5Frame14scrollToAnchorERKNS_4KURLE
 __ZN7WebCore5Frame17setWindowHasFocusEb
+__ZN7WebCore5Frame20hitTestResultAtPointERKNS_8IntPointEb
 __ZN7WebCore5Frame20setSelectionFromNoneEv
 __ZN7WebCore5Frame21setProhibitsScrollingEb
 __ZN7WebCore5Frame26isSelectionInPasswordFieldEv
@@ -209,6 +214,7 @@ __ZN7WebCore8FrameMac26dashboardRegionsDictionaryEv
 __ZN7WebCore8FrameMac7mouseUpEP7NSEvent
 __ZN7WebCore8FrameMac8keyEventEP7NSEvent
 __ZN7WebCore8FrameMac9mouseDownEP7NSEvent
+__ZN7WebCore8IntPointC1ERK8_NSPoint
 __ZN7WebCore9FrameTree11appendChildEN3WTF10PassRefPtrINS_5FrameEEE
 __ZN7WebCore9FrameTree7setNameERKNS_12AtomicStringE
 __ZN7WebCore9TimerBase4stopEv
@@ -217,13 +223,19 @@ __ZN7WebCore9TimerBaseC2Ev
 __ZN7WebCore9TimerBaseD2Ev
 __ZNK7WebCore10StringImplcvP8NSStringEv
 __ZNK7WebCore10StringImplcvP8NSStringEv
+__ZNK7WebCore10StringImplcvP8NSStringEv
 __ZNK7WebCore11FrameLoader14documentLoaderEv
 __ZNK7WebCore11FrameLoader15defersCallbacksEv
 __ZNK7WebCore11FrameLoader15firstLayoutDoneEv
 __ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
 __ZNK7WebCore11FrameLoader21isQuickRedirectComingEv
+__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
 __ZNK7WebCore11FrameLoader6clientEv
 __ZNK7WebCore11FrameLoader8loadTypeEv
+__ZNK7WebCore13HitTestResult10isSelectedEv
+__ZNK7WebCore13HitTestResult11boundingBoxEv
+__ZNK7WebCore13HitTestResult11targetFrameEv
+__ZNK7WebCore13HitTestResult5titleEv
 __ZNK7WebCore14DocumentLoader10isStoppingEv
 __ZNK7WebCore14DocumentLoader11frameLoaderEv
 __ZNK7WebCore14DocumentLoader11isCommittedEv
@@ -257,14 +269,18 @@ __ZNK7WebCore5Frame4treeEv
 __ZNK7WebCore5Frame6loaderEv
 __ZNK7WebCore5Frame8documentEv
 __ZNK7WebCore5Frame8referrerEv
+__ZNK7WebCore5Frame8rendererEv
 __ZNK7WebCore7IntRectcv6CGRectEv
 __ZNK7WebCore7IntRectcv7_NSRectEv
+__ZNK7WebCore7IntRectcv7_NSRectEv
 __ZNK7WebCore8FrameMac14selectionImageEb
 __ZNK7WebCore8FrameMac17eventMayStartDragEP7NSEvent
 __ZNK7WebCore8FrameMac19bodyBackgroundColorEv
 __ZNK7WebCore8FrameMac31fontAttributesForSelectionStartEv
 __ZNK7WebCore9FloatRectcv6CGRectEv
 __ZNK7WebCore9FloatRectcv7_NSRectEv
+__ZNK7WebCore9FrameTree12traverseNextEPKNS_5FrameE
+__ZNK7WebCore9FrameTree14isDescendantOfEPKNS_5FrameE
 __ZNK7WebCore9FrameTree20traverseNextWithWrapEb
 __ZNK7WebCore9FrameTree24traversePreviousWithWrapEb
 __ZNK7WebCore9FrameTree4findERKNS_12AtomicStringE
@@ -324,7 +340,4 @@ _wkSignalCFReadStreamEnd
 _wkSignalCFReadStreamError
 _wkSignalCFReadStreamHasBytes
 _wkSupportsMultipartXMixedReplace
-__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
-__ZNK7WebCore9FrameTree12traverseNextEPKNS_5FrameE
-__ZNK7WebCore9FrameTree14isDescendantOfEPKNS_5FrameE
 
index 2ea078a56aa4a2c776ff24ddfb3147ffb6cb5be8..a674338749fb7b5fdd7e0e119c2adddbc7322279 100644 (file)
                85B498ED0ADB32FB00925CBB /* DOMCSSRuleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B498EC0ADB32FB00925CBB /* DOMCSSRuleInternal.h */; };
                85B498F30ADB336A00925CBB /* DOMCSSValueInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B498F20ADB336A00925CBB /* DOMCSSValueInternal.h */; };
                85B498F50ADB337A00925CBB /* DOMEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B498F40ADB337A00925CBB /* DOMEventInternal.h */; };
-               85B498FB0ADB340200925CBB /* DOMNodeInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B498FA0ADB340200925CBB /* DOMNodeInternal.h */; };
+               85B498FB0ADB340200925CBB /* DOMNodeInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B498FA0ADB340200925CBB /* DOMNodeInternal.h */; settings = {ATTRIBUTES = (); }; };
                85B498FF0ADB348100925CBB /* DOMStyleSheetInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B498FE0ADB348100925CBB /* DOMStyleSheetInternal.h */; };
                85B499010ADB34B300925CBB /* DOMSVGPathSegInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B499000ADB34B300925CBB /* DOMSVGPathSegInternal.h */; };
                85B4996B0ADB3FF500925CBB /* DOMSVGPathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B499690ADB3FF500925CBB /* DOMSVGPathElement.h */; };
                85E711950AC5D5350053270F /* DOMDocumentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711460AC5D5340053270F /* DOMDocumentInternal.h */; };
                85E711960AC5D5350053270F /* DOMDocumentTypeInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711470AC5D5340053270F /* DOMDocumentTypeInternal.h */; };
                85E711970AC5D5350053270F /* DOMDOMImplementationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711480AC5D5340053270F /* DOMDOMImplementationInternal.h */; };
-               85E711980AC5D5350053270F /* DOMElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711490AC5D5340053270F /* DOMElementInternal.h */; };
+               85E711980AC5D5350053270F /* DOMElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711490AC5D5340053270F /* DOMElementInternal.h */; settings = {ATTRIBUTES = (); }; };
                85E711990AC5D5350053270F /* DOMEntityInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E7114A0AC5D5340053270F /* DOMEntityInternal.h */; };
                85E7119A0AC5D5350053270F /* DOMEntityReferenceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E7114B0AC5D5340053270F /* DOMEntityReferenceInternal.h */; };
                85E7119B0AC5D5350053270F /* DOMHTMLAnchorElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E7114C0AC5D5340053270F /* DOMHTMLAnchorElementInternal.h */; };
                85E711D10AC5D5350053270F /* DOMMediaListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711820AC5D5350053270F /* DOMMediaListInternal.h */; };
                85E711D20AC5D5350053270F /* DOMNamedNodeMapInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711830AC5D5350053270F /* DOMNamedNodeMapInternal.h */; };
                85E711D30AC5D5350053270F /* DOMNodeListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711840AC5D5350053270F /* DOMNodeListInternal.h */; };
-               85E711D40AC5D5350053270F /* DOMNotationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711850AC5D5350053270F /* DOMNotationInternal.h */; };
+               85E711D40AC5D5350053270F /* DOMNotationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711850AC5D5350053270F /* DOMNotationInternal.h */; settings = {ATTRIBUTES = (); }; };
                85E711D50AC5D5350053270F /* DOMProcessingInstructionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711860AC5D5350053270F /* DOMProcessingInstructionInternal.h */; };
                85E711D60AC5D5350053270F /* DOMRectInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711870AC5D5350053270F /* DOMRectInternal.h */; };
                85E711D70AC5D5350053270F /* DOMStyleSheetListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711880AC5D5350053270F /* DOMStyleSheetListInternal.h */; };
                85FF315B0AAFBFCB00374F38 /* DOMKeyboardEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */; };
                93032CC809AEC34300F82A18 /* PathCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93032CC709AEC34300F82A18 /* PathCG.cpp */; };
                93032CCA09AEC34B00F82A18 /* Path.h in Headers */ = {isa = PBXBuildFile; fileRef = 93032CC909AEC34B00F82A18 /* Path.h */; };
+               930500200AF025D300FFF491 /* ClipboardAccessPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9305001F0AF025D300FFF491 /* ClipboardAccessPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9305B24D098F1B6B00C28855 /* Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9305B24C098F1B6B00C28855 /* Timer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9307056C09E0AF8F00B17FE4 /* csshelper.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4786097CAAC80094C9E4 /* csshelper.h */; };
                930705D809E0C9B700B17FE4 /* JSCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930705D709E0C9B700B17FE4 /* JSCounter.cpp */; };
                930705DA09E0C9BF00B17FE4 /* JSCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 930705D909E0C9BF00B17FE4 /* JSCounter.h */; };
                930705E909E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930705E809E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp */; };
                930705EB09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */; };
+               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, ); }; };
                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 */; };
                BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A37A8097C715F0019F3D8 /* DOMTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */; };
                BC1A37C0097C715F0019F3D8 /* DOMViews.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A37AA097C715F0019F3D8 /* DOMViews.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */; };
+               BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */; settings = {ATTRIBUTES = (); }; };
                BC6B7BAF0993603C0052867B /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6B7BAE0993603C0052867B /* Image.cpp */; };
                BC6B7ECF0998AC7F0052867B /* ImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6B7ECE0998AC7F0052867B /* ImageSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC6D6DD209AF906600F59759 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6D6DD009AF906600F59759 /* Font.cpp */; };
                                1CB4214A0AF2B2CA0085AD91 /* DOMDocumentInternal.h in Copy Generated Headers */,
                                1CB4214B0AF2B2CA0085AD91 /* DOMElementInternal.h in Copy Generated Headers */,
                                1CB4214C0AF2B2CA0085AD91 /* DOMHTMLElementInternal.h in Copy Generated Headers */,
+                               9307F1130AF2C8BE00DBA31A /* DOMNodeInternal.h in Copy Generated Headers */,
                                1CB4214D0AF2B2CA0085AD91 /* DOMRangeInternal.h in Copy Generated Headers */,
                                85B916870AEBDBC4008DD727 /* DOMHTMLFormElementPrivate.h in Copy Generated Headers */,
                                85A795BA0AD754A30006B9D8 /* DOMRangePrivate.h in Copy Generated Headers */,
                85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMKeyboardEvent.mm; sourceTree = "<group>"; };
                93032CC709AEC34300F82A18 /* PathCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathCG.cpp; sourceTree = "<group>"; };
                93032CC909AEC34B00F82A18 /* Path.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Path.h; sourceTree = "<group>"; };
+               9305001F0AF025D300FFF491 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = "<group>"; };
                9305B24C098F1B6B00C28855 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
                9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 4; path = CSSPrimitiveValue.idl; sourceTree = "<group>"; };
                930705C709E0C95F00B17FE4 /* Counter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Counter.idl; sourceTree = "<group>"; };
                930705E809E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSPrimitiveValue.cpp; sourceTree = "<group>"; };
                930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSPrimitiveValue.h; sourceTree = "<group>"; };
                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>"; };
                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>"; };
                        children = (
                                65A640F00533BB1F0085E777 /* BlockExceptions.h */,
                                65F80697054D9F86008BF776 /* BlockExceptions.mm */,
+                               9305001F0AF025D300FFF491 /* ClipboardAccessPolicy.h */,
                                2D90660B0665D937006B6F1A /* ClipboardMac.h */,
                                2D90660C0665D937006B6F1A /* ClipboardMac.mm */,
                                6582A14909999D6C00BEEB6D /* ColorMac.mm */,
                                A8CFF0480A154F09000A4234 /* FixedTableLayout.cpp */,
                                A8CFF04A0A154F09000A4234 /* FixedTableLayout.h */,
                                935C477409AC4D8D00A6AAB4 /* GapRects.h */,
+                               9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */,
+                               9307F1D60AF2D59000DBA31A /* HitTestResult.h */,
                                A8CFF5DF0A155A05000A4234 /* InlineBox.cpp */,
                                A8CFF5DE0A155A05000A4234 /* InlineBox.h */,
                                A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */,
                                655A81BA0AEF67D3000975F0 /* WebCoreResourceLoader.h in Headers */,
                                655A81BB0AEF67D4000975F0 /* WebCoreResourceLoaderImp.h in Headers */,
                                655A81BE0AEF67E6000975F0 /* HTTPHeaderMap.h in Headers */,
+                               930500200AF025D300FFF491 /* ClipboardAccessPolicy.h in Headers */,
+                               9307F1D80AF2D59000DBA31A /* HitTestResult.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 */,
                                853CA9F00AEEC657002372DC /* RenderPath.cpp in Sources */,
                                654F68880AF1B7C50065BDD6 /* CachedResourceMac.mm in Sources */,
                                655A81BC0AEF67D4000975F0 /* WebCoreResourceLoaderImp.mm in Sources */,
+                               9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 297899932bd02dd680f47d95dae9a12af6364361..df953bae4adb9d75672dafea28226dc7655bc272 100644 (file)
@@ -47,6 +47,7 @@
 #import "HTMLDocument.h"
 #import "HTMLNames.h"
 #import "HTMLPlugInElement.h"
+#import "Image.h"
 #import "IntRect.h"
 #import "NodeFilter.h"
 #import "NodeFilterCondition.h"
index d8ccaa1acb411a098e7e22f5bd313986707e3121..2998be7628c4688ceeeb55f4b4b2b1be51908ee4 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef FrameMac_h
 #define FrameMac_h
 
-#import "ClipboardMac.h"
+#import "ClipboardAccessPolicy.h"
 #import "Frame.h"
 #import "IntRect.h"
 #import "PlatformMouseEvent.h"
@@ -84,12 +84,14 @@ class NSView;
 class WebCoreFrameBridge;
 class WebScriptObject;
 
+typedef unsigned int NSDragOperation;
 typedef int NSWritingDirection;
 
 #endif
 
 namespace WebCore {
 
+class ClipboardMac;
 class DocumentFragment;
 class EditorClient;
 class FramePrivate;
@@ -337,7 +339,7 @@ private:
     NSView* nextKeyViewInFrame(Node* startingPoint, SelectionDirection, bool* focusCallResultedInViewBeingCreated = 0);
     static NSView* documentViewForNode(Node*);
     
-    bool dispatchCPPEvent(const AtomicString &eventType, ClipboardMac::AccessPolicy policy);
+    bool dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy);
 
     NSImage* imageFromRect(NSRect) const;
 
index 726763654690c7c66b0488738533a7212544d9b1..670a3242354d1d6e8e72f1d1c7e6bd8841d3b346 100644 (file)
@@ -33,6 +33,7 @@
 #import "CSSComputedStyleDeclaration.h"
 #import "Cache.h"
 #import "ClipboardEvent.h"
+#import "ClipboardMac.h"
 #import "Cursor.h"
 #import "WebDocumentLoader.h"
 #import "DOMInternal.h"
@@ -58,6 +59,7 @@
 #import "HTMLTableCellElement.h"
 #import "Logging.h"
 #import "MouseEventWithHitTestResults.h"
+#import "HitTestResult.h"
 #import "PlatformKeyboardEvent.h"
 #import "PlatformScrollBar.h"
 #import "PlatformWheelEvent.h"
@@ -382,7 +384,7 @@ Frame* FrameMac::createFrame(const KURL& url, const String& name, Element* owner
 void FrameMac::freeClipboard()
 {
     if (_dragClipboard)
-        _dragClipboard->setAccessPolicy(ClipboardMac::Numb);
+        _dragClipboard->setAccessPolicy(ClipboardNumb);
 }
 
 // Either get cached regexp or build one that matches any of the labels.
@@ -1556,10 +1558,10 @@ bool FrameMac::eventMayStartDrag(NSEvent *event) const
 
     NSPoint loc = [event locationInWindow];
     IntPoint mouseDownPos = d->m_view->windowToContents(IntPoint(loc));
-    RenderObject::NodeInfo nodeInfo(true, false);
-    renderer()->layer()->hitTest(nodeInfo, mouseDownPos);
+    HitTestResult result(true, false);
+    renderer()->layer()->hitTest(result, mouseDownPos);
     bool srcIsDHTML;
-    return nodeInfo.innerNode()->renderer()->draggableNode(DHTMLFlag, UAFlag, mouseDownPos.x(), mouseDownPos.y(), srcIsDHTML);
+    return result.innerNode()->renderer()->draggableNode(DHTMLFlag, UAFlag, mouseDownPos.x(), mouseDownPos.y(), srcIsDHTML);
 }
 
 // The link drag hysteresis is much larger than the others because there
@@ -1616,18 +1618,18 @@ void FrameMac::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
         
         if (mouseDownMayStartDrag() && !_dragSrc) {
             // try to find an element that wants to be dragged
-            RenderObject::NodeInfo nodeInfo(true, false);
-            renderer()->layer()->hitTest(nodeInfo, m_mouseDownPos);
-            Node *node = nodeInfo.innerNode();
+            HitTestResult result(true, false);
+            renderer()->layer()->hitTest(result, m_mouseDownPos);
+            Node *node = result.innerNode();
             _dragSrc = (node && node->renderer()) ? node->renderer()->draggableNode(_dragSrcMayBeDHTML, _dragSrcMayBeUA, m_mouseDownPos.x(), m_mouseDownPos.y(), _dragSrcIsDHTML) : 0;
             if (!_dragSrc) {
                 setMouseDownMayStartDrag(false);     // no element is draggable
             } else {
-                // remember some facts about this source, while we have a NodeInfo handy
-                node = nodeInfo.URLElement();
+                // remember some facts about this source, while we have a HitTestResult handy
+                node = result.URLElement();
                 _dragSrcIsLink = node && node->isLink();
 
-                node = nodeInfo.innerNonSharedNode();
+                node = result.innerNonSharedNode();
                 _dragSrcIsImage = node && node->renderer() && node->renderer()->isImage();
                 
                 _dragSrcInSelection = isPointInsideSelection(m_mouseDownPos);
@@ -1666,7 +1668,7 @@ void FrameMac::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
                     
                     freeClipboard();    // would only happen if we missed a dragEnd.  Do it anyway, just
                                         // to make sure it gets numbified
-                    _dragClipboard = new ClipboardMac(true, pasteboard, ClipboardMac::Writable, this);
+                    _dragClipboard = new ClipboardMac(true, pasteboard, ClipboardWritable, this);
                     
                     // If this is drag of an element, get set up to generate a default image.  Otherwise
                     // WebKit will generate the default, the element doesn't override.
@@ -1680,7 +1682,7 @@ void FrameMac::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
                     setMouseDownMayStartDrag(dispatchDragSrcEvent(dragstartEvent, m_mouseDown) && mayCopy());
                     // Invalidate clipboard here against anymore pasteboard writing for security.  The drag
                     // image can still be changed as we drag, but not the pasteboard data.
-                    _dragClipboard->setAccessPolicy(ClipboardMac::ImageWritable);
+                    _dragClipboard->setAccessPolicy(ClipboardImageWritable);
                     
                     if (mouseDownMayStartDrag()) {
                         // gather values from DHTML element, if it set any
@@ -1738,7 +1740,7 @@ void FrameMac::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
 
 // Returns whether caller should continue with "the default processing", which is the same as 
 // the event handler NOT setting the return value to false
-bool FrameMac::dispatchCPPEvent(const AtomicString &eventType, ClipboardMac::AccessPolicy policy)
+bool FrameMac::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy)
 {
     Node* target = selectionController()->start().element();
     if (!target && document())
@@ -1748,7 +1750,7 @@ bool FrameMac::dispatchCPPEvent(const AtomicString &eventType, ClipboardMac::Acc
     if (target->isShadowNode())
         target = target->shadowParentNode();
     
-    RefPtr<ClipboardMac> clipboard = new ClipboardMac(false, [NSPasteboard generalPasteboard], (ClipboardMac::AccessPolicy)policy);
+    RefPtr<ClipboardMac> clipboard = new ClipboardMac(false, [NSPasteboard generalPasteboard], (ClipboardAccessPolicy)policy);
 
     ExceptionCode ec = 0;
     RefPtr<Event> evt = new ClipboardEvent(eventType, true, true, clipboard.get());
@@ -1756,7 +1758,7 @@ bool FrameMac::dispatchCPPEvent(const AtomicString &eventType, ClipboardMac::Acc
     bool noDefaultProcessing = evt->defaultPrevented();
 
     // invalidate clipboard here for security
-    clipboard->setAccessPolicy(ClipboardMac::Numb);
+    clipboard->setAccessPolicy(ClipboardNumb);
 
     return !noDefaultProcessing;
 }
@@ -1768,17 +1770,17 @@ bool FrameMac::dispatchCPPEvent(const AtomicString &eventType, ClipboardMac::Acc
 
 bool FrameMac::mayDHTMLCut()
 {
-    return mayCopy() && !dispatchCPPEvent(beforecutEvent, ClipboardMac::Numb);
+    return mayCopy() && !dispatchCPPEvent(beforecutEvent, ClipboardNumb);
 }
 
 bool FrameMac::mayDHTMLCopy()
 {
-    return mayCopy() && !dispatchCPPEvent(beforecopyEvent, ClipboardMac::Numb);
+    return mayCopy() && !dispatchCPPEvent(beforecopyEvent, ClipboardNumb);
 }
 
 bool FrameMac::mayDHTMLPaste()
 {
-    return !dispatchCPPEvent(beforepasteEvent, ClipboardMac::Numb);
+    return !dispatchCPPEvent(beforepasteEvent, ClipboardNumb);
 }
 
 bool FrameMac::tryDHTMLCut()
@@ -1790,7 +1792,7 @@ bool FrameMac::tryDHTMLCut()
     // also done for security, as it erases data from the last copy/paste.
     [[NSPasteboard generalPasteboard] declareTypes:[NSArray array] owner:nil];
 
-    return !dispatchCPPEvent(cutEvent, ClipboardMac::Writable);
+    return !dispatchCPPEvent(cutEvent, ClipboardWritable);
 }
 
 bool FrameMac::tryDHTMLCopy()
@@ -1802,12 +1804,12 @@ bool FrameMac::tryDHTMLCopy()
     // also done for security, as it erases data from the last copy/paste.
     [[NSPasteboard generalPasteboard] declareTypes:[NSArray array] owner:nil];
 
-    return !dispatchCPPEvent(copyEvent, ClipboardMac::Writable);
+    return !dispatchCPPEvent(copyEvent, ClipboardWritable);
 }
 
 bool FrameMac::tryDHTMLPaste()
 {
-    return !dispatchCPPEvent(pasteEvent, ClipboardMac::Readable);
+    return !dispatchCPPEvent(pasteEvent, ClipboardReadable);
 }
 
 void FrameMac::handleMouseReleaseEvent(const MouseEventWithHitTestResults& event)
index 77d3f7582513b76a85fa9973a95dc8f1e19ffac6..d38684e8749248d2f47d219a08e7afb76c605e5f 100644 (file)
@@ -42,6 +42,7 @@
 #import "HTMLMapElement.h"
 #import "HTMLNames.h"
 #import "HTMLSelectElement.h"
+#import "HitTestResult.h"
 #import "RenderImage.h"
 #import "RenderListMarker.h"
 #import "RenderMenuList.h"
@@ -1262,9 +1263,9 @@ static IntRect boundingBoxRect(RenderObject* obj)
         NSPoint windowCoord = [[view window] convertScreenToBase: point];
         ourpoint = [view convertPoint:windowCoord fromView:nil];
         
-        RenderObject::NodeInfo nodeInfo(true, true);
-        renderer->layer()->hitTest(nodeInfo, IntPoint(ourpoint));
-        innerNode = nodeInfo.innerNode();
+        HitTestResult result(true, true);
+        renderer->layer()->hitTest(result, IntPoint(ourpoint));
+        innerNode = result.innerNode();
         if (!innerNode || !innerNode->renderer())
             return nil;
 
@@ -2302,11 +2303,11 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
     if (!m_renderer)
         return NSAccessibilityUnignoredAncestor(self);
     
-    RenderObject::NodeInfo nodeInfo(true, true);
-    m_renderer->layer()->hitTest(nodeInfo, IntPoint(point));
-    if (!nodeInfo.innerNode())
+    HitTestResult result(true, true);
+    m_renderer->layer()->hitTest(result, IntPoint(point));
+    if (!result.innerNode())
         return NSAccessibilityUnignoredAncestor(self);
-    Node* node = nodeInfo.innerNode()->shadowAncestorNode();
+    Node* node = result.innerNode()->shadowAncestorNode();
     RenderObject* obj = node->renderer();
     if (!obj)
         return NSAccessibilityUnignoredAncestor(self);
index ee5afc44637a9b205b7b09b5870e8194c94b3a45..59bbb4c40cdb3c1b8726fbf1c87e0f8846dc53c2 100644 (file)
@@ -252,7 +252,6 @@ typedef enum {
 - (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier;
 - (NSString *)renderTreeAsExternalRepresentation;
 
-- (void)getInnerNonSharedNode:(DOMNode **)innerNonSharedNode innerNode:(DOMNode **)innerNode URLElement:(DOMElement **)URLElement atPoint:(NSPoint)point allowShadowContent:(BOOL)allow;
 - (BOOL)isPointInsideSelection:(NSPoint)point;
 
 - (NSURL *)URLWithAttributeString:(NSString *)string;
index c0370ce6af82ea304f5a5235e23bb9688ceac577..eefaaef743333228eeb7dd5676cd89a655aefd91 100644 (file)
@@ -30,6 +30,7 @@
 
 #import "AXObjectCache.h"
 #import "Cache.h"
+#import "ClipboardMac.h"
 #import "DOMImplementation.h"
 #import "DOMInternal.h"
 #import "Decoder.h"
@@ -54,6 +55,7 @@
 #import "LoaderNSURLRequestExtras.h"
 #import "ModifySelectionListLevel.h"
 #import "MoveSelectionCommand.h"
+#import "HitTestResult.h"
 #import "Page.h"
 #import "PlugInInfoStore.h"
 #import "RenderImage.h"
@@ -995,22 +997,6 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     return m_frame->matchLabelsAgainstElement(labels, [element _element]);
 }
 
-- (void)getInnerNonSharedNode:(DOMNode **)innerNonSharedNode innerNode:(DOMNode **)innerNode URLElement:(DOMElement **)URLElement atPoint:(NSPoint)point allowShadowContent:(BOOL) allow
-{
-    RenderObject *renderer = m_frame->renderer();
-    if (!renderer) {
-        *innerNonSharedNode = nil;
-        *innerNode = nil;
-        *URLElement = nil;
-        return;
-    }
-
-    RenderObject::NodeInfo nodeInfo = m_frame->nodeInfoAtPoint(IntPoint(point), allow);
-    *innerNonSharedNode = [DOMNode _nodeWith:nodeInfo.innerNonSharedNode()];
-    *innerNode = [DOMNode _nodeWith:nodeInfo.innerNode()];
-    *URLElement = [DOMElement _elementWith:nodeInfo.URLElement()];
-}
-
 - (BOOL)isPointInsideSelection:(NSPoint)point
 {
     return m_frame->isPointInsideSelection(IntPoint(point));
@@ -1743,7 +1729,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
 - (VisiblePosition)_visiblePositionForPoint:(NSPoint)point
 {
     IntPoint outerPoint(point);
-    Node* node = m_frame->nodeInfoAtPoint(outerPoint, true).innerNode();
+    Node* node = m_frame->hitTestResultAtPoint(outerPoint, true).innerNode();
     if (!node)
         return VisiblePosition();
     RenderObject* renderer = node->renderer();
@@ -1913,7 +1899,7 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
     if (m_frame) {
         RefPtr<FrameView> v = m_frame->view();
         if (v) {
-            ClipboardMac::AccessPolicy policy = m_frame->baseURL().isLocalFile() ? ClipboardMac::Readable : ClipboardMac::TypesReadable;
+            ClipboardAccessPolicy policy = m_frame->baseURL().isLocalFile() ? ClipboardReadable : ClipboardTypesReadable;
             RefPtr<ClipboardMac> clipboard = new ClipboardMac(true, [info draggingPasteboard], policy);
             NSDragOperation srcOp = [info draggingSourceOperationMask];
             clipboard->setSourceOperation(srcOp);
@@ -1938,7 +1924,7 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
                     op = NSDragOperationNone;
                 }
             }
-            clipboard->setAccessPolicy(ClipboardMac::Numb);    // invalidate clipboard here for security
+            clipboard->setAccessPolicy(ClipboardNumb);    // invalidate clipboard here for security
             return op;
         }
     }
@@ -1951,11 +1937,11 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
         RefPtr<FrameView> v = m_frame->view();
         if (v) {
             // Sending an event can result in the destruction of the view and part.
-            ClipboardMac::AccessPolicy policy = m_frame->baseURL().isLocalFile() ? ClipboardMac::Readable : ClipboardMac::TypesReadable;
+            ClipboardAccessPolicy policy = m_frame->baseURL().isLocalFile() ? ClipboardReadable : ClipboardTypesReadable;
             RefPtr<ClipboardMac> clipboard = new ClipboardMac(true, [info draggingPasteboard], policy);
             clipboard->setSourceOperation([info draggingSourceOperationMask]);            
             v->cancelDragAndDrop(createMouseEventFromDraggingInfo([self window], info), clipboard.get());
-            clipboard->setAccessPolicy(ClipboardMac::Numb);    // invalidate clipboard here for security
+            clipboard->setAccessPolicy(ClipboardNumb);    // invalidate clipboard here for security
         }
     }
 }
@@ -1966,10 +1952,10 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
         RefPtr<FrameView> v = m_frame->view();
         if (v) {
             // Sending an event can result in the destruction of the view and part.
-            RefPtr<ClipboardMac> clipboard = new ClipboardMac(true, [info draggingPasteboard], ClipboardMac::Readable);
+            RefPtr<ClipboardMac> clipboard = new ClipboardMac(true, [info draggingPasteboard], ClipboardReadable);
             clipboard->setSourceOperation([info draggingSourceOperationMask]);
             BOOL result = v->performDragAndDrop(createMouseEventFromDraggingInfo([self window], info), clipboard.get());
-            clipboard->setAccessPolicy(ClipboardMac::Numb);    // invalidate clipboard here for security
+            clipboard->setAccessPolicy(ClipboardNumb);    // invalidate clipboard here for security
             return result;
         }
     }
index fcc72970052f35badbac75ee0ffbf6b02a8ce5b9..2a742e5fe2521ddfd86ef96bdef6d5612c2ec256 100644 (file)
@@ -64,6 +64,7 @@
 #include "MutationEvent.h"
 #include "NameNodeList.h"
 #include "NodeFilter.h"
+#include "HitTestResult.h"
 #include "NodeIterator.h"
 #include "PlatformKeyboardEvent.h"
 #include "ProcessingInstruction.h"
@@ -676,10 +677,10 @@ Element* Document::elementFromPoint(int x, int y) const
     if (!renderer())
         return 0;
 
-    RenderObject::NodeInfo nodeInfo(true, true);
-    renderer()->layer()->hitTest(nodeInfo, IntPoint(x, y)); 
+    HitTestResult result(true, true);
+    renderer()->layer()->hitTest(result, IntPoint(x, y)); 
 
-    Node* n = nodeInfo.innerNode();
+    Node* n = result.innerNode();
     while (n && !n->isElementNode())
         n = n->parentNode();
     if (n)
@@ -1673,7 +1674,7 @@ MouseEventWithHitTestResults Document::prepareMouseEvent(bool readonly, bool act
         return MouseEventWithHitTestResults(event, 0, 0, false);
 
     assert(renderer()->isRenderView());
-    RenderObject::NodeInfo renderInfo(readonly, active, mouseMove);
+    HitTestResult renderInfo(readonly, active, mouseMove);
     renderer()->layer()->hitTest(renderInfo, point);
 
     if (!readonly)
index 900f7413e29f0bf5f474ed325cf78028a91abfa7..674379d9d595bc72495028b01dfc460a9433f1f3 100644 (file)
@@ -154,6 +154,7 @@ public:
     virtual String toString() const;
 
     virtual bool isURLAttribute(Attribute *attr) const;
+    virtual String target() const { return String(); }
         
     virtual void focus();
     virtual void updateFocusAppearance();
index 4f534825d0ba288b729e7cca4413ead360319daa..0184fb5530c632d821ebf8b9773b08158e2aac3a 100644 (file)
@@ -80,7 +80,7 @@ public:
     int tabIndex() const;
     void setTabIndex(int);
 
-    String target() const;
+    virtual String target() const;
     void setTarget(const String&);
 
     String type() const;
index 05ffa1106c675b524d688499c426373340156af1..745c6deaa57a65786c991826003231237d8a9347 100644 (file)
@@ -26,7 +26,8 @@
 #include "Document.h"
 #include "HTMLNames.h"
 #include "FloatRect.h"
-#include "IntSize.h"
+#include "HitTestResult.h"
+#include "RenderObject.h"
 
 using namespace std;
 
@@ -68,7 +69,7 @@ void HTMLAreaElement::parseMappedAttribute(MappedAttribute *attr)
         HTMLAnchorElement::parseMappedAttribute(attr);
 }
 
-bool HTMLAreaElement::mapMouseEvent(int x, int y, const IntSize& size, RenderObject::NodeInfo& info)
+bool HTMLAreaElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestResult& info)
 {
     if (m_lastSize != size) {
         region = getRegion(size);
index 31b1f1044d8333ed8316de0794acc61a697a7703..b7aaed1702472c77b3f77b70530f97af9fe0ba0e 100644 (file)
 #define HTMLAreaElement_H
 
 #include "HTMLAnchorElement.h"
+#include "IntSize.h"
 #include "Path.h"
-#include "RenderObject.h" // for RenderObject::NodeInfo
 
 namespace WebCore {
 
+class HitTestResult;
+
 class HTMLAreaElement : public HTMLAnchorElement {
 public:
     enum Shape { Default, Poly, Rect, Circle, Unknown };
@@ -45,7 +47,7 @@ public:
 
     bool isDefault() const { return m_shape == Default; }
 
-    bool mapMouseEvent(int x, int y, const IntSize&, RenderObject::NodeInfo&);
+    bool mapMouseEvent(int x, int y, const IntSize&, HitTestResult&);
 
     virtual IntRect getRect(RenderObject*) const;
 
@@ -70,7 +72,7 @@ public:
     int tabIndex() const;
     void setTabIndex(int);
 
-    String target() const;
+    virtual String target() const;
     void setTarget(const String&);
 
 protected:
index ee82f199d064562e576d4b263b3288a148047acf..c5388cdd4877eb1969f10bcffe9a988bd31a2cfb 100644 (file)
@@ -38,7 +38,7 @@ public:
     virtual int tagPriority() const { return 0; }
 
     String href() const { return m_href; }
-    String target() const { return m_target; }
+    virtual String target() const { return m_target; }
 
     virtual void parseMappedAttribute(MappedAttribute*);
     virtual void insertedIntoDocument();
index 6768c35941c2c59030f38a5e2eab70ec1dfb90cb..2e025e736bed4b5d13a8b6c0dcb66f8742a0553e 100644 (file)
@@ -97,7 +97,7 @@ public:
     String method() const;
     void setMethod(const String&);
 
-    String target() const;
+    virtual String target() const;
     void setTarget(const String&);
 
     friend class HTMLFormCollection;
index aa53c36c8614291c2fb5723f19b94b003d83a7b0..b087a619412bbbc3c69e1d801abefa1889cec88a 100644 (file)
@@ -62,7 +62,7 @@ public:
     String rev() const;
     void setRev(const String&);
 
-    String target() const;
+    virtual String target() const;
     void setTarget(const String&);
 
     String type() const;
index 69717026927ddf84470e761f64b91a17ee27b782..96ea6784ebb5184aaec5113982d1c4e09b14f3e1 100644 (file)
@@ -27,6 +27,8 @@
 #include "HTMLAreaElement.h"
 #include "HTMLCollection.h"
 #include "HTMLNames.h"
+#include "IntSize.h"
+#include "HitTestResult.h"
 
 using namespace std;
 
@@ -50,7 +52,7 @@ bool HTMLMapElement::checkDTD(const Node* newChild)
     return newChild->hasTagName(areaTag) || newChild->hasTagName(scriptTag) || inBlockTagList(newChild);
 }
 
-bool HTMLMapElement::mapMouseEvent(int x, int y, const IntSize& size, RenderObject::NodeInfo& info)
+bool HTMLMapElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestResult& info)
 {
     HTMLAreaElement* defaultArea = 0;
     Node *node = this;
index d19de4e1aef4681c7f1829deb93f51e8819746b8..484359fa7508e4e01c54e1715c4a3bd0c0568c1a 100644 (file)
 #define HTMLMapElement_H
 
 #include "HTMLElement.h"
-#include "RenderObject.h" // for RenderObject::NodeInfo
 
 namespace WebCore {
 
+class IntSize;
+class HitTestResult;
+
 class HTMLMapElement : public HTMLElement {
 public:
     HTMLMapElement(Document*);
@@ -43,7 +45,7 @@ public:
 
     virtual void parseMappedAttribute(MappedAttribute*);
 
-    bool mapMouseEvent(int x, int y, const IntSize&, RenderObject::NodeInfo&);
+    bool mapMouseEvent(int x, int y, const IntSize&, HitTestResult&);
 
     PassRefPtr<HTMLCollection> areas();
 
index a58605071aef47c8526795a59c327ec9d1761c02..867698e99df3cbb9a51245e86d431e589a32c541 100644 (file)
@@ -60,6 +60,7 @@
 #include "loader/icon/IconLoader.h"
 #include "MediaFeatureNames.h"
 #include "MouseEventWithHitTestResults.h"
+#include "HitTestResult.h"
 #include "NodeList.h"
 #include "Page.h"
 #include "PlatformScrollBar.h"
@@ -67,6 +68,7 @@
 #include "Plugin.h"
 #include "PluginDocument.h"
 #include "RenderListBox.h"
+#include "RenderObject.h"
 #include "RenderPart.h"
 #include "RenderTextControl.h"
 #include "RenderTheme.h"
@@ -1789,9 +1791,9 @@ bool Frame::isPointInsideSelection(const IntPoint& point)
     if (!document()->renderer()) 
         return false;
     
-    RenderObject::NodeInfo nodeInfo(true, true);
-    document()->renderer()->layer()->hitTest(nodeInfo, point);
-    Node *innerNode = nodeInfo.innerNode();
+    HitTestResult result(true, true);
+    document()->renderer()->layer()->hitTest(result, point);
+    Node *innerNode = result.innerNode();
     if (!innerNode || !innerNode->renderer())
         return false;
     
@@ -2922,17 +2924,17 @@ void Frame::setAutoscrollRenderer(RenderObject* renderer)
     d->m_autoscrollRenderer = renderer;
 }
 
-RenderObject::NodeInfo Frame::nodeInfoAtPoint(const IntPoint& point, bool allowShadowContent)
+HitTestResult Frame::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent)
 {
-    RenderObject::NodeInfo nodeInfo(true, true);
-    renderer()->layer()->hitTest(nodeInfo, point);
+    HitTestResult result(true, true);
+    renderer()->layer()->hitTest(result, point);
 
     Node *n;
     Widget *widget = 0;
     IntPoint widgetPoint(point);
     
     while (true) {
-        n = nodeInfo.innerNode();
+        n = result.innerNode();
         if (!n || !n->renderer() || !n->renderer()->isWidget())
             break;
         widget = static_cast<RenderWidget*>(n->renderer())->widget();
@@ -2947,22 +2949,23 @@ RenderObject::NodeInfo Frame::nodeInfoAtPoint(const IntPoint& point, bool allowS
         widgetPoint.setX(widgetPoint.x() - absX + view->contentsX());
         widgetPoint.setY(widgetPoint.y() - absY + view->contentsY());
 
-        RenderObject::NodeInfo widgetNodeInfo(true, true);
-        frame->renderer()->layer()->hitTest(widgetNodeInfo, widgetPoint);
-        nodeInfo = widgetNodeInfo;
+        HitTestResult widgetHitTestResult(true, true);
+        frame->renderer()->layer()->hitTest(widgetHitTestResult, widgetPoint);
+        result = widgetHitTestResult;
+        result.setPoint(widgetPoint);
     }
     
     if (!allowShadowContent) {
-        Node* node = nodeInfo.innerNode();
+        Node* node = result.innerNode();
         if (node)
             node = node->shadowAncestorNode();
-        nodeInfo.setInnerNode(node);
-        node = nodeInfo.innerNonSharedNode();
+        result.setInnerNode(node);
+        node = result.innerNonSharedNode();
         if (node)
             node = node->shadowAncestorNode();
-        nodeInfo.setInnerNonSharedNode(node); 
+        result.setInnerNonSharedNode(node); 
     }
-    return nodeInfo;
+    return result;
 }
 
 bool Frame::hasSelection()
index 362fbe6a455846a8873f22a09329037010c4c5ac..b01698319a1af90d25ea8b112cae697727252042 100644 (file)
@@ -33,7 +33,6 @@
 #include "FrameView.h"
 #include "KURL.h"
 #include "Node.h"
-#include "RenderObject.h"
 #include "RenderLayer.h"
 #include "ScrollBar.h"
 #include "TextAffinity.h"
@@ -73,8 +72,10 @@ class KJSProxy;
 class Page;
 class Plugin;
 class MouseEventWithHitTestResults;
+class HitTestResult;
 class Range;
 class RenderLayer;
+class RenderObject;
 class ResourceRequest;
 class Selection;
 class SelectionController;
@@ -800,7 +801,7 @@ public:
   friend class FrameQt;
 #endif
 
-  RenderObject::NodeInfo nodeInfoAtPoint(const IntPoint&, bool allowShadowContent);
+  HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent);
   bool hasSelection();
   String documentTypeString() const;
 
index eebe62f7ee0970fedabe356a84c3f4fcd0e46aaa..9cc01f6b90e137328fbd9cd39e40d118ccf34c09 100644 (file)
@@ -40,6 +40,7 @@
 #include "Image.h"
 #include "MouseEvent.h"
 #include "MouseEventWithHitTestResults.h"
+#include "HitTestResult.h"
 #include "OverflowEvent.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformScrollBar.h"
@@ -1238,7 +1239,7 @@ void FrameView::handleWheelEvent(PlatformWheelEvent& e)
         if (docRenderer) {
             IntPoint vPoint = windowToContents(e.pos());
 
-            RenderObject::NodeInfo hitTestResult(true, false);
+            HitTestResult hitTestResult(true, false);
             doc->renderer()->layer()->hitTest(hitTestResult, vPoint); 
             Node *node = hitTestResult.innerNode();
             Frame* subframe = subframeForTargetNode(node);
diff --git a/WebCore/platform/mac/ClipboardAccessPolicy.h b/WebCore/platform/mac/ClipboardAccessPolicy.h
new file mode 100644 (file)
index 0000000..7a54009
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+#ifndef ClipboardAccessPolicy_h
+#define ClipboardAccessPolicy_h
+
+namespace WebCore {
+
+enum ClipboardAccessPolicy {
+    ClipboardNumb, ClipboardImageWritable, ClipboardWritable, ClipboardTypesReadable, ClipboardReadable
+};
+
+} // namespace
+
+#endif
index b36ae2d491e500cbc4d8d21d195245433068e29f..fb59438256c8498f7b4ea6360deaa209b14b8b0c 100644 (file)
@@ -31,6 +31,7 @@
 #include "Image.h"
 #include "IntPoint.h"
 #include "Clipboard.h"
+#include "ClipboardAccessPolicy.h"
 #include "CachedResourceClient.h"
 
 #ifdef __OBJC__
@@ -48,12 +49,7 @@ class FrameMac;
 
 class ClipboardMac : public Clipboard, public CachedResourceClient {
 public:
-    // security mechanisms
-    typedef enum {
-        Numb, ImageWritable, Writable, TypesReadable, Readable
-    } AccessPolicy;
-
-    ClipboardMac(bool forDragging, NSPasteboard *pasteboard, AccessPolicy policy, FrameMac *frame = 0);
+    ClipboardMac(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, FrameMac *frame = 0);
     virtual ~ClipboardMac();
 
     bool isForDragging() const;
@@ -86,8 +82,7 @@ public:
     void setDestinationOperation(NSDragOperation op);
 #endif
 
-    void setAccessPolicy(AccessPolicy policy);
-    AccessPolicy accessPolicy() const;
+    void setAccessPolicy(ClipboardAccessPolicy);
     void setDragHasStarted() { m_dragStarted = true; }
     
 private:
@@ -100,7 +95,7 @@ private:
     IntPoint m_dragLoc;
     CachedImage* m_dragImage;
     RefPtr<Node> m_dragImageElement;
-    AccessPolicy m_policy;
+    ClipboardAccessPolicy m_policy;
     int m_changeCount;
     bool m_dragStarted;
     FrameMac *m_frame;   // used on the source side to generate dragging images
index 87903225548668109d2e0f2dddc7a0d6c444aac3..8482a03e825121e3ce8612c1d2eeee6054da8634 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-ClipboardMac::ClipboardMac(bool forDragging, NSPasteboard *pasteboard, AccessPolicy policy, FrameMac *frame)
+ClipboardMac::ClipboardMac(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, FrameMac *frame)
   : m_pasteboard(HardRetain(pasteboard)), m_forDragging(forDragging), m_dragImage(0),
     m_policy(policy), m_dragStarted(false), m_frame(frame)
 {
@@ -50,18 +50,13 @@ bool ClipboardMac::isForDragging() const
     return m_forDragging;
 }
 
-void ClipboardMac::setAccessPolicy(AccessPolicy policy)
+void ClipboardMac::setAccessPolicy(ClipboardAccessPolicy policy)
 {
     // once you go numb, can never go back
-    ASSERT(m_policy != Numb || policy == Numb);
+    ASSERT(m_policy != ClipboardNumb || policy == ClipboardNumb);
     m_policy = policy;
 }
 
-ClipboardMac::AccessPolicy ClipboardMac::accessPolicy() const
-{
-    return m_policy;
-}
-
 static NSString *cocoaTypeFromMIMEType(const String &type)
 {
     String qType = type.stripWhiteSpace();
@@ -121,7 +116,7 @@ static DeprecatedString MIMETypeFromCocoaType(NSString *type)
 
 void ClipboardMac::clearData(const String &type)
 {
-    if (m_policy != Writable) {
+    if (m_policy != ClipboardWritable) {
         return;
     }
     // note NSPasteboard enforces changeCount itself on writing - can't write if not the owner
@@ -134,7 +129,7 @@ void ClipboardMac::clearData(const String &type)
 
 void ClipboardMac::clearAllData()
 {
-    if (m_policy != Writable) {
+    if (m_policy != ClipboardWritable) {
         return;
     }
     // note NSPasteboard enforces changeCount itself on writing - can't write if not the owner
@@ -145,7 +140,7 @@ void ClipboardMac::clearAllData()
 String ClipboardMac::getData(const String &type, bool &success) const
 {
     success = false;
-    if (m_policy != Readable) {
+    if (m_policy != ClipboardReadable) {
         return String();
     }
     
@@ -207,7 +202,7 @@ String ClipboardMac::getData(const String &type, bool &success) const
 
 bool ClipboardMac::setData(const String &type, const String &data)
 {
-    if (m_policy != Writable)
+    if (m_policy != ClipboardWritable)
         return false;
     // note NSPasteboard enforces changeCount itself on writing - can't write if not the owner
 
@@ -240,7 +235,7 @@ bool ClipboardMac::setData(const String &type, const String &data)
 
 HashSet<String> ClipboardMac::types() const
 {
-    if (m_policy != Readable && m_policy != TypesReadable)
+    if (m_policy != ClipboardReadable && m_policy != ClipboardTypesReadable)
         return HashSet<String>();
 
     NSArray *types = [m_pasteboard types];
@@ -296,7 +291,7 @@ void ClipboardMac::setDragImageElement(Node *node, const IntPoint &loc)
 
 void ClipboardMac::setDragImage(CachedImage* image, Node *node, const IntPoint &loc)
 {
-    if (m_policy == ImageWritable || m_policy == Writable) {
+    if (m_policy == ClipboardImageWritable || m_policy == ClipboardWritable) {
         if (m_dragImage)
             m_dragImage->deref(this);
         m_dragImage = image;
@@ -362,7 +357,7 @@ String ClipboardMac::dropEffect() const
 
 void ClipboardMac::setDropEffect(const String &s)
 {
-    if (m_policy == Readable || m_policy == TypesReadable) {
+    if (m_policy == ClipboardReadable || m_policy == ClipboardTypesReadable) {
         m_dropEffect = s;
     }
 }
@@ -374,7 +369,7 @@ String ClipboardMac::effectAllowed() const
 
 void ClipboardMac::setEffectAllowed(const String &s)
 {
-    if (m_policy == Writable)
+    if (m_policy == ClipboardWritable)
         m_effectAllowed = s;
 }
 
index 3e5145538257da968aa3a4f7c23711b0369489fb..0728b33b74da38ceb0d1f678c956805a28396e0c 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "Document.h"
 #include "GraphicsContext.h"
+#include "HitTestResult.h"
 #include "TextStyle.h"
 
 namespace WebCore {
@@ -60,7 +61,7 @@ void EllipsisBox::paint(RenderObject::PaintInfo& i, int _tx, int _ty)
     }
 }
 
-bool EllipsisBox::nodeAtPoint(RenderObject::NodeInfo& info, int x, int y, int tx, int ty)
+bool EllipsisBox::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty)
 {
     tx += m_x;
     ty += m_y;
index 656e86590fa228184eb9a0ada7ddefd80d3ee6c1..f0dcfee26d770f41c577abd4a664d6325d0e52d3 100644 (file)
@@ -26,6 +26,8 @@
 
 namespace WebCore {
 
+class HitTestResult;
+
 class EllipsisBox : public InlineBox {
 public:
     EllipsisBox(RenderObject* obj, const AtomicString& ellipsisStr, InlineFlowBox* parent,
@@ -35,9 +37,9 @@ public:
         , m_markupBox(markupBox)
     {
     }
-
-    virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
-    virtual bool nodeAtPoint(RenderObject::NodeInfo&, int x, int y, int tx, int ty);
+    
+    virtual void paint(RenderObject::PaintInfo& i, int _tx, int _ty);
+    virtual bool nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty);
 
 private:
     AtomicString m_str;
diff --git a/WebCore/rendering/HitTestResult.cpp b/WebCore/rendering/HitTestResult.cpp
new file mode 100644 (file)
index 0000000..9295459
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * This file is part of the HTML rendering engine for KDE.
+ *
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+*/
+
+#include "config.h"
+#include "HitTestResult.h"
+
+#include "Document.h"
+#include "Frame.h"
+#include "FrameTree.h"
+#include "HTMLElement.h"
+#include "PlatformScrollbar.h"
+#include "RenderObject.h"
+
+namespace WebCore {
+
+HitTestResult::HitTestResult(bool readonly, bool active, bool mouseMove)
+    : m_readonly(readonly)
+    , m_active(active)
+    , m_mouseMove(mouseMove)
+{
+}
+
+HitTestResult::HitTestResult(const HitTestResult& other)
+    : m_innerNode(other.innerNode())
+    , m_innerNonSharedNode(other.innerNonSharedNode())
+    , m_point(other.point())
+    , m_innerURLElement(other.URLElement())
+    , m_scrollbar(other.scrollbar())
+    , m_readonly(other.readonly())
+    , m_active(other.active())
+    , m_mouseMove(other.mouseMove())
+{
+}
+
+HitTestResult::~HitTestResult()
+{
+}
+
+HitTestResult& HitTestResult::operator=(const HitTestResult& other)
+{
+    m_innerNode = other.innerNode();
+    m_innerNonSharedNode = other.innerNonSharedNode();
+    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;
+}
+
+void HitTestResult::setInnerNode(Node* n)
+{
+    m_innerNode = n;
+}
+    
+void HitTestResult::setInnerNonSharedNode(Node* n)
+{
+    m_innerNonSharedNode = n;
+}
+
+void HitTestResult::setURLElement(Element* n) 
+{ 
+    m_innerURLElement = n; 
+}
+
+void HitTestResult::setScrollbar(PlatformScrollbar* s)
+{
+    m_scrollbar = s;
+}
+
+Frame* HitTestResult::targetFrame() const
+{
+    if (!m_innerURLElement)
+        return 0;
+
+    Frame* frame = m_innerURLElement->document()->frame();
+    if (!frame)
+        return 0;
+
+    return frame->tree()->find(m_innerURLElement->target());
+}
+
+IntRect HitTestResult::boundingBox() const
+{
+    if (m_innerNonSharedNode) {
+        RenderObject* renderer = m_innerNonSharedNode->renderer();
+        if (renderer)
+            return renderer->absoluteBoundingBoxRect();
+    }
+    
+    return IntRect();
+}
+
+bool HitTestResult::isSelected() const
+{
+    if (!m_innerNonSharedNode)
+        return false;
+
+    Frame* frame = m_innerNonSharedNode->document()->frame();
+    if (!frame)
+        return false;
+
+    return frame->isPointInsideSelection(m_point);
+}
+
+String HitTestResult::title() const
+{
+    // Find the title in the nearest enclosing DOM node.
+    // For <area> tags in image maps, walk the tree for the <area>, not the <img> using it.
+    for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = titleNode->parentNode()) {
+        if (titleNode->isHTMLElement()) {
+            HTMLElement* titleHTMLNode = static_cast<HTMLElement*>(titleNode);
+            String title = titleHTMLNode->title();
+            if (!title.isEmpty())
+                return title;
+        }
+    }
+    return String();
+} 
+
+} // namespace WebCore
diff --git a/WebCore/rendering/HitTestResult.h b/WebCore/rendering/HitTestResult.h
new file mode 100644 (file)
index 0000000..8d786c6
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * This file is part of the HTML rendering engine for KDE.
+ *
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+*/
+#ifndef HitTestResult_h_
+#define HitTestResult_h_
+
+#include "IntPoint.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Element;
+class Frame;
+class IntRect;
+class Node;
+class PlatformScrollbar;
+class String;
+
+class HitTestResult {
+public:
+    HitTestResult(bool readonly, bool active, bool mouseMove = false);
+    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; }
+    Element* URLElement() const { return m_innerURLElement.get(); }
+    PlatformScrollbar* scrollbar() const { return m_scrollbar.get(); }
+
+    void setInnerNode(Node*);
+    void setInnerNonSharedNode(Node*);
+    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;
+    bool isSelected() const;
+    String title() const;
+
+private:
+    RefPtr<Node> m_innerNode;
+    RefPtr<Node> m_innerNonSharedNode;
+    IntPoint m_point;
+    RefPtr<Element> m_innerURLElement;
+    RefPtr<PlatformScrollbar> m_scrollbar;
+    bool m_readonly;
+    bool m_active;
+    bool m_mouseMove;
+};
+
+} // namespace WebCore
+
+#endif // HitTestResult_h_
index 776f05e80943b9b19310e51a476be0983754a102..b556b71126704f46e276e481f3e7e4220054531a 100644 (file)
@@ -23,6 +23,7 @@
 #include "InlineBox.h"
 
 #include "InlineFlowBox.h"
+#include "HitTestResult.h"
 #include "RenderArena.h"
 #include "RootInlineBox.h"
 
@@ -148,7 +149,7 @@ void InlineBox::paint(RenderObject::PaintInfo& i, int tx, int ty)
     }
 }
 
-bool InlineBox::nodeAtPoint(RenderObject::NodeInfo& i, int x, int y, int tx, int ty)
+bool InlineBox::nodeAtPoint(HitTestResult& i, 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
index d28c433d35db54f77c663484f45af606b2298fba..03425a16f399aa02019c757b1f28e0413dadf491 100644 (file)
@@ -27,6 +27,7 @@
 
 namespace WebCore {
 
+class HitTestResult;
 class RootInlineBox;
 
 // InlineBox represents a rectangle that occurs on a line.  It corresponds to
@@ -81,7 +82,7 @@ public:
     virtual void adjustPosition(int dx, int dy);
 
     virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
-    virtual bool nodeAtPoint(RenderObject::NodeInfo&, int x, int y, int tx, int ty);
+    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty);
 
     // Overloaded new operator.
     void* operator new(size_t, RenderArena*) throw();
index 50e18fa6fcbcfc4aa92f77eeaaa6d7c8052cf2f0..d1e07b8b48feb980473d52e9462fcdc6c134d28c 100644 (file)
@@ -27,6 +27,8 @@
 #include "EllipsisBox.h"
 #include "GraphicsContext.h"
 #include "InlineTextBox.h"
+#include "HitTestResult.h"
+#include "RootInlineBox.h"
 #include "RenderBlock.h"
 #include "RenderFlow.h"
 #include "RenderListMarker.h"
@@ -521,7 +523,7 @@ void InlineFlowBox::shrinkBoxesWithNoTextChildren(int topPos, int bottomPos)
     }
 }
 
-bool InlineFlowBox::nodeAtPoint(RenderObject::NodeInfo& i, int x, int y, int tx, int ty)
+bool InlineFlowBox::nodeAtPoint(HitTestResult& i, int x, int y, int tx, int ty)
 {
     // Check children first.
     for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) {
index 9443ebbfcf2ca6a0a42f8602b03c319024ae075f..910843a0f8e123f220c9818565bc21d65bb4997e 100644 (file)
@@ -27,6 +27,8 @@
 
 namespace WebCore {
 
+class HitTestResult;
+
 class InlineFlowBox : public InlineRunBox {
 public:
     InlineFlowBox(RenderObject* obj)
@@ -70,14 +72,14 @@ public:
 
     virtual void clearTruncation();
 
-    virtual void paintBackgroundAndBorder(RenderObject::PaintInfo&, int tx, int ty);
-    void paintBackgrounds(GraphicsContext*, const Color&, const BackgroundLayer*,
-                          int my, int mh, int tx, int ty, int w, int h);
-    void paintBackground(GraphicsContext*, const Color&, const BackgroundLayer*,
-                         int my, int mh, int tx, int ty, int w, int h);
-    virtual void paintDecorations(RenderObject::PaintInfo&, int tx, int ty, bool paintedChildren = false);
-    virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
-    virtual bool nodeAtPoint(RenderObject::NodeInfo&, int x, int y, int tx, int ty);
+    virtual void paintBackgroundAndBorder(RenderObject::PaintInfo& i, int _tx, int _ty);
+    void paintBackgrounds(GraphicsContext* p, const Color& c, const BackgroundLayer* bgLayer,
+                          int my, int mh, int _tx, int _ty, int w, int h);
+    void paintBackground(GraphicsContext* p, const Color& c, const BackgroundLayer* bgLayer,
+                         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);
 
     int marginBorderPaddingLeft();
     int marginBorderPaddingRight();
index 2a322138a9d345f79b5c7693b5b95d15dba4a48f..ab9b3f9bcf9281b8d312b7441bdb5ffb5c4ea1ea 100644 (file)
@@ -28,6 +28,7 @@
 #include "Document.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
+#include "HitTestResult.h"
 #include "Range.h"
 #include "RenderArena.h"
 #include "RenderBlock.h"
@@ -219,7 +220,7 @@ bool InlineTextBox::isLineBreak() const
     return object()->isBR() || (object()->style()->preserveNewline() && len() == 1 && (*textObject()->string())[start()] == '\n');
 }
 
-bool InlineTextBox::nodeAtPoint(RenderObject::NodeInfo& i, int x, int y, int tx, int ty)
+bool InlineTextBox::nodeAtPoint(HitTestResult& i, int x, int y, int tx, int ty)
 {
     if (isLineBreak())
         return false;
index 6a283a47e5360869f0076fe7fba67815771f004d..2847a88a9e8afe6a3746610f58e6a9dfc6f939b7 100644 (file)
@@ -37,6 +37,7 @@ const int cFullTruncation = -2;
 class String;
 class StringImpl;
 class MarkedTextUnderline;
+class HitTestResult;
 class Position;
 
 class InlineTextBox : public InlineRunBox {
@@ -69,9 +70,9 @@ public:
     IntRect selectionRect(int absx, int absy, int startPos, int endPos);
     bool isSelected(int startPos, int endPos) const;
     void selectionStartEnd(int& sPos, int& ePos);
-
-    virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
-    virtual bool nodeAtPoint(RenderObject::NodeInfo&, int x, int y, int tx, int ty);
+    
+    virtual void paint(RenderObject::PaintInfo& i, int tx, int ty);
+    virtual bool nodeAtPoint(HitTestResult&, int, int, int, int);
 
     RenderText* textObject() const;
 
index a7091a11378536c61cad3a4734beca6f54647c5f..4724928db64bd6c500f7bdd06f977c9f06dd9113 100644 (file)
@@ -29,6 +29,7 @@
 #include "Frame.h"
 #include "GraphicsContext.h"
 #include "InlineTextBox.h"
+#include "HitTestResult.h"
 #include "RenderTableCell.h"
 #include "RenderTextFragment.h"
 #include "SelectionController.h"
@@ -2498,7 +2499,7 @@ int RenderBlock::getClearDelta(RenderObject *child)
     return result;
 }
 
-bool RenderBlock::isPointInScrollbar(NodeInfo& info, int _x, int _y, int _tx, int _ty)
+bool RenderBlock::isPointInScrollbar(HitTestResult& info, int _x, int _y, int _tx, int _ty)
 {
     if (!scrollsOverflow())
         return false;
@@ -2528,7 +2529,7 @@ bool RenderBlock::isPointInScrollbar(NodeInfo& info, int _x, int _y, int _tx, in
     return false;    
 }
 
-bool RenderBlock::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderBlock::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
 {
     bool inlineFlow = isInlineFlow();
 
index 0d7a19ef635b9627826274adc6722343254af77a..e5eb1c2136b7d5840b468caebf9f01689718c091 100644 (file)
@@ -198,10 +198,10 @@ public:
                       int *heightRemaining = 0) const;
     int leftOffset(int y) const { return leftRelOffset(y, leftOffset(), true); }
 
-    virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty,
+    virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty,
                              HitTestAction hitTestAction);
 
-    virtual bool isPointInScrollbar(NodeInfo& info, int x, int y, int tx, int ty);
+    virtual bool isPointInScrollbar(HitTestResult& info, int x, int y, int tx, int ty);
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
     
index 0e03c217dcd4f975321bf4b49c9378d1587ab1c6..d08ff7d4247c68f415281c99eef4a843670905c6 100644 (file)
@@ -254,7 +254,7 @@ int RenderBox::calcContentBoxHeight(int h) const
 }
 
 // Hit Testing
-bool RenderBox::nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderBox::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action)
 {
     tx += m_x;
     ty += m_y;
index 4059c1e53873d04012784650cabe2d23485b7977..4618004f27240c9f7cc016116b065611b18ed6f8 100644 (file)
@@ -43,7 +43,7 @@ public:
 
     virtual void setStyle(RenderStyle*);
     virtual void paint(PaintInfo& i, int _tx, int _ty);
-    virtual bool nodeAtPoint(NodeInfo& i, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction);
+    virtual bool nodeAtPoint(HitTestResult& i, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction);
 
     virtual void destroy();
     
index 08c0db82b82c9e70086642acfdafcb2c725707e2..50fbf6d7fb1582ae4725e295d91ffda43766e407 100644 (file)
@@ -416,7 +416,7 @@ void RenderFlow::paintLines(PaintInfo& i, int _tx, int _ty)
     }
 }
 
-bool RenderFlow::hitTestLines(NodeInfo& i, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderFlow::hitTestLines(HitTestResult& i, int x, int y, int tx, int ty, HitTestAction hitTestAction)
 {
     if (hitTestAction != HitTestForeground)
         return false;
index 0779b604ff8e112798801cb1f2bf0c1bef466dc9..ea38a26263b200ca289f9a81cf049d7ecfcd56eb 100644 (file)
@@ -76,7 +76,7 @@ public:
     virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false);
     
     void paintLines(PaintInfo& i, int _tx, int _ty);
-    bool hitTestLines(NodeInfo& i, int x, int y, int tx, int ty, HitTestAction hitTestAction);
+    bool hitTestLines(HitTestResult& i, int x, int y, int tx, int ty, HitTestAction hitTestAction);
 
     virtual IntRect getAbsoluteRepaintRect();
     
index 415b37609ea00b3b1d7d1694e3af59156ed1275b..96e3934185e0282d09e156de29dbd90d8b6ef915 100644 (file)
@@ -118,7 +118,7 @@ void RenderForeignObject::layout()
     setNeedsLayout(false);
 }
 
-bool RenderForeignObject::nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderForeignObject::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction hitTestAction)
 {
     AffineTransform totalTransform = absoluteTransform();
     totalTransform *= translationForAttributes();
index c9cea5fd6a0e91530e29225f5f0300812ea3d995..70310f8052dd6c9eef28825d1680dbe691c78aaf 100644 (file)
@@ -46,7 +46,7 @@ public:
     virtual bool requiresLayer();
     virtual void layout();
 
-    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
  private:
     AffineTransform translationForAttributes();
index 394bfb9928eeb3ad5b4bcd46a40f79017daca2a4..20edadbde702ce503cd44549d929266b2c421bd8 100644 (file)
@@ -33,6 +33,7 @@
 #include "HTMLNames.h"
 #include "TextStream.h"
 #include "MouseEvent.h"
+#include "HitTestResult.h"
 #include "RenderFrame.h"
 #include "RenderView.h"
 
@@ -74,7 +75,7 @@ RenderFrameSet::~RenderFrameSet()
       delete [] m_vSplitVar;
 }
 
-bool RenderFrameSet::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
+bool RenderFrameSet::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty,
                                  HitTestAction hitTestAction)
 {
     if (hitTestAction != HitTestForeground)
index 3a15dc6b46d554a4286b081174158fab2c25dc57..e1daf17755ff4b493bf48c65e4a144794b5d730f 100644 (file)
@@ -54,7 +54,7 @@ public:
     bool canResize(int x, int y);
     void setResizing(bool);
 
-    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
     HTMLFrameSetElement* element() const
         { return static_cast<HTMLFrameSetElement*>(RenderContainer::element()); }
index cbdb418744f171259b8fa9557aa348ef45bd2dfc..59de1d7ea37785af2d4923be06e0cc28bd066aea 100644 (file)
@@ -34,6 +34,7 @@
 #include "HTMLInputElement.h"
 #include "HTMLMapElement.h"
 #include "HTMLNames.h"
+#include "HitTestResult.h"
 #include "RenderView.h"
 #include "TextStyle.h"
 
@@ -310,7 +311,7 @@ HTMLMapElement* RenderImage::imageMap()
     return i ? i->document()->getImageMap(i->imageMap()) : 0;
 }
 
-bool RenderImage::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderImage::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
 {
     bool inside = RenderReplaced::nodeAtPoint(info, _x, _y, _tx, _ty, hitTestAction);
 
index 29285dfdea858bd60331818dc047916eea26e2c8..119251edb5b1a5e654a854e18099cac664b29530 100644 (file)
@@ -68,7 +68,7 @@ public:
     
     Image* image() { return m_cachedImage ? m_cachedImage->image() : nullImage(); }
 
-    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     
     virtual int calcReplacedWidth() const;
     virtual int calcReplacedHeight() const;
index 927bae5b0a123278872e1f29dbf56436bd2e1537..686741fbf0df62b214dfde06a1d027f522b230f4 100644 (file)
@@ -335,7 +335,7 @@ const char *RenderInline::renderName() const
     return "RenderInline";
 }
 
-bool RenderInline::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
+bool RenderInline::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty,
                                HitTestAction hitTestAction)
 {
     return hitTestLines(info, _x, _y, _tx, _ty, hitTestAction);
index a675830942452da186773175242206787963e036..822dbe548b504e83ac5de9d31ba691f1384c54ff 100644 (file)
@@ -59,7 +59,7 @@ public:
     
     virtual void paint(PaintInfo& i, int tx, int ty);
 
-    virtual bool nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
+    virtual bool nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty,
                              HitTestAction hitTestAction);
     
     virtual void calcMinMaxWidth();
index 081e142bbb3183b15dc2444e16ccf8d052aab7ea..f1a6cc46a3a9f679285bc139e9d260f000d7b0da 100644 (file)
@@ -53,6 +53,7 @@
 #include "GraphicsContext.h"
 #include "HTMLMarqueeElement.h"
 #include "HTMLNames.h"
+#include "HitTestResult.h"
 #include "OverflowEvent.h"
 #include "PlatformMouseEvent.h"
 #include "RenderArena.h"
@@ -864,7 +865,7 @@ void RenderLayer::autoscroll()
     IntPoint currentPos = currentFrame->view()->windowToContents(currentFrame->view()->currentMousePosition());
     
     if (currentFrame->mouseDownMayStartSelect()) {
-        RenderObject::NodeInfo renderInfo(true, false, true);
+        HitTestResult renderInfo(true, false, true);
         if (hitTest(renderInfo, currentPos)) {
             VisiblePosition pos(renderInfo.innerNode()->renderer()->positionForPoint(currentPos));
             currentFrame->updateSelectionForMouseDragOverPosition(pos);
@@ -1470,7 +1471,7 @@ static inline IntRect frameVisibleRect(RenderObject* renderer)
     return enclosingIntRect(renderer->document()->frame()->view()->visibleContentRect());
 }
 
-bool RenderLayer::hitTest(RenderObject::NodeInfo& info, const IntPoint& point)
+bool RenderLayer::hitTest(HitTestResult& info, const IntPoint& point)
 {
     renderer()->document()->updateLayout();
     
@@ -1496,8 +1497,7 @@ bool RenderLayer::hitTest(RenderObject::NodeInfo& info, const IntPoint& point)
     return insideLayer;
 }
 
-RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderObject::NodeInfo& info,
-                                       const IntPoint& mousePos, const IntRect& hitTestRect)
+RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, HitTestResult& info, const IntPoint& mousePos, const IntRect& hitTestRect)
 {
     // Calculate the clip rects we should use.
     IntRect layerBounds;
@@ -1829,7 +1829,7 @@ static RenderObject* commonAncestor(RenderObject* obj1, RenderObject* obj2)
     return 0;
 }
 
-void RenderLayer::updateHoverActiveState(RenderObject::NodeInfo& info)
+void RenderLayer::updateHoverActiveState(HitTestResult& info)
 {
     // We don't update :hover/:active state when the info is marked as readonly.
     if (info.readonly())
index bbddcff563ca75122bdd8f9bc3e5d7a1b9f9add1..120b546e8c6af6996e1fe20b706f89683c0932fe 100644 (file)
@@ -51,6 +51,7 @@
 namespace WebCore {
 
 class CachedResource;
+class HitTestResult;
 class RenderView;
 class RenderFrameSet;
 class RenderObject;
@@ -291,7 +292,7 @@ public:
     // 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(RenderObject::NodeInfo&, const IntPoint&);
+    bool hitTest(HitTestResult&, const IntPoint&);
 
     // This method figures out our layerBounds in coordinates relative to
     // |rootLayer}.  It also computes our background and foreground clip rects
@@ -308,7 +309,7 @@ public:
     // Returns a bounding box for this layer only.
     IntRect absoluteBoundingBox() const;
 
-    void updateHoverActiveState(RenderObject::NodeInfo& info);
+    void updateHoverActiveState(HitTestResult&);
     
     IntRect repaintRect() const { return m_repaintRect; }
 
@@ -336,7 +337,7 @@ private:
 
     void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect,
         bool haveTransparency, PaintRestriction, RenderObject* paintingRoot);
-    RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderObject::NodeInfo&, const IntPoint&, const IntRect& hitTestRect);
+    RenderLayer* hitTestLayer(RenderLayer* rootLayer, HitTestResult&, const IntPoint&, const IntRect& hitTestRect);
     void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0);
 
     bool shouldBeOverflowOnly() const;
index cb8f3a16e7779a2a0f91bf4b1630e1ff8989a6d0..4cc6824ba33885473bbf61eeb7ba9fe9d736c45a 100644 (file)
@@ -32,6 +32,7 @@
 #include "HTMLOptionElement.h"
 #include "HTMLOptGroupElement.h"
 #include "HTMLSelectElement.h"
+#include "HitTestResult.h"
 #include "PlatformScrollBar.h" 
 #include "RenderBR.h"
 #include "RenderText.h"
@@ -325,7 +326,7 @@ void RenderListBox::paintItemBackground(PaintInfo& i, int tx, int ty, int listIn
         i.p->fillRect(itemBoundingBoxRect(tx, ty, listIndex), backColor);
 }
 
-bool RenderListBox::isPointInScrollbar(NodeInfo& info, int _x, int _y, int _tx, int _ty)
+bool RenderListBox::isPointInScrollbar(HitTestResult& info, int _x, int _y, int _tx, int _ty)
 {
     if (!m_vBar)
         return false;
index cff41d753b760451159879bf8ff25ea3441d5142..cc59d8bd276c2c088c00609c06e7f76acebd0836 100644 (file)
@@ -44,7 +44,7 @@ public:
     virtual bool canHaveChildren() const { return false; }
     virtual const char* renderName() const { return "RenderListBox"; }
     virtual void paintObject(PaintInfo&, int tx, int ty);
-    virtual bool isPointInScrollbar(NodeInfo&, int x, int y, int tx, int ty);
+    virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty);
 
     virtual bool scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier=1.0);
 
index 0d2bc624a7ad6507edad3bfba437fab5f17d0693..65b43dd38800ba892d88aa1c7edc0ca8d5b342e9 100644 (file)
@@ -42,6 +42,7 @@
 #include "HTMLNames.h"
 #include "HTMLOListElement.h"
 #include "KURL.h"
+#include "HitTestResult.h"
 #include "Position.h"
 #include "RenderArena.h"
 #include "RenderFlexibleBox.h"
@@ -2533,7 +2534,7 @@ void RenderObject::updateDragState(bool dragOn)
         continuation()->updateDragState(dragOn);
 }
 
-bool RenderObject::hitTest(NodeInfo& info, int x, int y, int tx, int ty, HitTestFilter hitTestFilter)
+bool RenderObject::hitTest(HitTestResult& info, int x, int y, int tx, int ty, HitTestFilter hitTestFilter)
 {
     bool inside = false;
     if (hitTestFilter != HitTestSelf) {
@@ -2556,7 +2557,7 @@ bool RenderObject::hitTest(NodeInfo& info, int x, int y, int tx, int ty, HitTest
     return inside;
 }
 
-void RenderObject::setInnerNode(NodeInfo& info)
+void RenderObject::setInnerNode(HitTestResult& info)
 {
     if (info.innerNode())
         return;
@@ -2577,7 +2578,7 @@ void RenderObject::setInnerNode(NodeInfo& info)
     }
 }
 
-bool RenderObject::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
+bool RenderObject::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty,
                                HitTestAction hitTestAction)
 {
     return false;
index 2066e318ef24f2348aa9b1fd23d3605d6c20e449..123b3a36d1e1205328e9e63c56cfdf002ab88973 100644 (file)
@@ -57,6 +57,7 @@ class FrameView;
 class HTMLAreaElement;
 class InlineBox;
 class InlineFlowBox;
+class HitTestResult;
 class PlatformScrollbar;
 class Position;
 class RenderArena;
@@ -490,39 +491,6 @@ public:
     void addDashboardRegions(Vector<DashboardRegionValue>&);
     void collectDashboardRegions(Vector<DashboardRegionValue>&);
 
-    // does a query on the rendertree and finds the innernode
-    // and overURL for the given position
-    // if readonly == false, it will recalc hover styles accordingly
-    class NodeInfo {
-    public:
-        NodeInfo(bool readonly, bool active, bool mouseMove = false)
-            : m_innerNode(0), m_innerNonSharedNode(0), m_innerURLElement(0), 
-              m_scrollbar(0), m_readonly(readonly), m_active(active), m_mouseMove(mouseMove)
-            { }
-
-        Node* innerNode() const { return m_innerNode; }
-        Node* innerNonSharedNode() const { return m_innerNonSharedNode; }
-        Element* URLElement() const { return m_innerURLElement; }
-        PlatformScrollbar* scrollbar() const { return m_scrollbar; }
-        bool readonly() const { return m_readonly; }
-        bool active() const { return m_active; }
-        bool mouseMove() const { return m_mouseMove; }
-        
-        void setInnerNode(Node* n) { m_innerNode = n; }
-        void setInnerNonSharedNode(Node* n) { m_innerNonSharedNode = n; }
-        void setURLElement(Element* n) { m_innerURLElement = n; }
-        void setScrollbar(PlatformScrollbar* s) { m_scrollbar = s; }
-
-    private:
-        Node* m_innerNode;
-        Node* m_innerNonSharedNode;
-        Element* m_innerURLElement;
-        PlatformScrollbar* m_scrollbar;
-        bool m_readonly;
-        bool m_active;
-        bool m_mouseMove;
-    };
-
     // Used to signal a specific subrect within an object that must be repainted after
     // layout is complete.
     struct RepaintInfo {
@@ -532,10 +500,10 @@ public:
         RepaintInfo(RenderObject* o, const IntRect& r) :m_object(o), m_repaintRect(r) {}
     };
     
-    bool hitTest(NodeInfo& info, int x, int y, int tx, int ty, HitTestFilter hitTestFilter = HitTestAll);
-    virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty,
+    bool hitTest(HitTestResult& info, int x, int y, int tx, int ty, HitTestFilter hitTestFilter = HitTestAll);
+    virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty,
                              HitTestAction hitTestAction);
-    void setInnerNode(NodeInfo& info);
+    void setInnerNode(HitTestResult& info);
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
     VisiblePosition positionForPoint(const IntPoint& point) { return positionForCoordinates(point.x(), point.y()); }
index 94b4f76842444a6a686b03e6859f5b17b606c96c..dc3962866512d9cc3e769ed4199c0f69bc7f4711 100644 (file)
@@ -283,7 +283,7 @@ RenderPath::PointerEventsHitRules RenderPath::pointerEventsHitRules()
     return hitRules;
 }
 
-bool RenderPath::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderPath::nodeAtPoint(HitTestResult& info, 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)
index 1098c55b93308f748731b0e58f5629877aff6a59..a487fc625822d7ef8bccc44d7be997e2ec35e4c9 100644 (file)
@@ -71,7 +71,7 @@ public:
  
     virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
-    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(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 {
index 1c7de7918b8c6491d26e730c21c4e31a9c451b3d..dc8471574ea63609a592d1c222b42f14a59b9050 100644 (file)
@@ -205,7 +205,7 @@ void RenderSVGImage::computeAbsoluteRepaintRect(IntRect& r, bool f)
     RenderImage::computeAbsoluteRepaintRect(r, f);
 }
 
-bool RenderSVGImage::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderSVGImage::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
 {
     AffineTransform totalTransform = absoluteTransform();
     totalTransform *= translationForAttributes();
index 65f1090a85560e2039a78e69c6e6f49fa6f9af65..dacb37663830dc66a89a1ca91cdad4df03e1c7dc 100644 (file)
@@ -54,7 +54,7 @@ namespace WebCore {
 
         virtual void computeAbsoluteRepaintRect(IntRect&, bool f);
 
-        virtual bool nodeAtPoint(NodeInfo&, int _x, int _y, int _tx, int _ty, HitTestAction);
+        virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
 
     private:
         void translateForAttributes();
index 7c5e8768af9b6a252ddb54362ebbea1b7a6a7615..050c62bd0fe3bd34e3117f129c1f2f8dcbb3b544 100644 (file)
@@ -95,7 +95,7 @@ InlineBox* RenderSVGText::createInlineBox(bool makePlaceHolderBox, bool isRootLi
     return flowBox;
 }
 
-bool RenderSVGText::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderSVGText::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
 {
     AffineTransform totalTransform = absoluteTransform();
     double localX, localY;
index 046733af07f24c4465a93ca9a935ebc7138f30dc..4e19fe5c1e5e1152e3775e40e0ef85cc8b7d832a 100644 (file)
@@ -41,7 +41,7 @@ public:
     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(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(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();
index 3b4112fc4058980ac6499027c6dcb4a51937c055..330a8d71ee7c1961a6a1f446ba4a956dd5db7612 100644 (file)
@@ -138,7 +138,7 @@ IntRect RenderTableRow::getAbsoluteRepaintRect()
 }
 
 // Hit Testing
-bool RenderTableRow::nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderTableRow::nodeAtPoint(HitTestResult& info, 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.
index 75e59c001b954fd1cee986704ca05ffa9b4b88b3..f47b2a6adf34e511b53daa90db695b1181c455fa 100644 (file)
@@ -45,7 +45,7 @@ public:
     virtual void position(InlineBox*) { }
     virtual void layout();
     virtual IntRect getAbsoluteRepaintRect();
-    virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction action);
+    virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action);
 
     // The only time rows get a layer is when they have transparency.
     virtual bool requiresLayer() { return isTransparent() || hasOverflowClip(); }
index 67abf18b879cc9e2c4ed7a361221d609d059d921..7ed046dd31ad01408d9252bb6a62dcfa9e4071aa 100644 (file)
@@ -986,7 +986,7 @@ RenderObject* RenderTableSection::removeChildNode(RenderObject* child)
 }
 
 // Hit Testing
-bool RenderTableSection::nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderTableSection::nodeAtPoint(HitTestResult& info, 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.
index a98ab35c8514d61fc055f1dfb06e2414f48385f3..bd9739483de7cb8b9c064fd7be7a4fcc0d2d1e64 100644 (file)
@@ -111,7 +111,7 @@ public:
 
     virtual RenderObject* removeChildNode(RenderObject* child);
 
-    virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction action);
+    virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action);
 
     // this gets a cell grid data structure. changing the number of
     // columns is done by the table
index 64cd6b55d97f84e7bc4b626f80d34f44a121a95a..01fe402fe9f815d0f431ea1faffa261c80a99a51 100644 (file)
@@ -70,7 +70,7 @@ public:
     virtual void paint(PaintInfo& i, int tx, int ty) { assert(false); }
     virtual void layout() { assert(false); }
 
-    virtual bool nodeAtPoint(NodeInfo&, int, int, int, int, HitTestAction) { assert(false); return false; }
+    virtual bool nodeAtPoint(HitTestResult&, int, int, int, int, HitTestAction) { assert(false); return false; }
 
     virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
     virtual void lineBoxRects(Vector<IntRect>&);
index e6a45dea81bb00d475e5dfd8b4197b891336112e..ee37f16f49f5930b87aeba5905b3ebb796b66f11 100644 (file)
@@ -30,6 +30,7 @@
 #include "HTMLNames.h"
 #include "HTMLTextAreaElement.h"
 #include "HTMLTextFieldInnerElement.h"
+#include "HitTestResult.h"
 #include "RenderTheme.h"
 #include "SelectionController.h"
 #include "TextIterator.h"
@@ -344,7 +345,7 @@ short RenderTextControl::baselinePosition(bool b, bool isRootLineBox) const
     return RenderFlexibleBox::baselinePosition(b, isRootLineBox);
 }
 
-bool RenderTextControl::nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderTextControl::nodeAtPoint(HitTestResult& info, 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).
index 2169311fc065560f8fc477d486f46038f23e54da..214240dca0262f1c446074b71175bb48b738ebfe 100644 (file)
@@ -40,7 +40,7 @@ public:
     virtual void updateFromElement();
     virtual bool canHaveChildren() const { return false; }
     virtual short baselinePosition( bool, bool ) const;
-    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
                              
     RenderStyle* createDivStyle(RenderStyle* startStyle);
 
index f74ae58d86502d67594f8754cb44fa5c87341d4f..ab7ea4f1b8606449040d30c03673204f31eea4a1 100644 (file)
@@ -30,6 +30,7 @@
 #if PLATFORM(MAC)
 #include "FrameMac.h"
 #endif
+#include "HitTestResult.h"
 
 using namespace std;
 
@@ -141,7 +142,7 @@ void RootInlineBox::paint(RenderObject::PaintInfo& i, int tx, int ty)
 #endif
 }
 
-bool RootInlineBox::nodeAtPoint(RenderObject::NodeInfo& i, int x, int y, int tx, int ty)
+bool RootInlineBox::nodeAtPoint(HitTestResult& i, int x, int y, int tx, int ty)
 {
     if (m_ellipsisBox && object()->style()->visibility() == VISIBLE) {
         if (m_ellipsisBox->nodeAtPoint(i, x, y, tx, ty)) {
index 29be21cda48d72e125065ad4d96ee7d153fd05a8..90261ce3ec6379ee2b47e94ecde63a75bfb0b807 100644 (file)
@@ -29,6 +29,8 @@
 namespace WebCore {
 
 class EllipsisBox;
+class HitTestResult;
+
 struct GapRects;
 
 class RootInlineBox : public InlineFlowBox {
@@ -85,8 +87,10 @@ public:
     virtual int placeEllipsisBox(bool ltr, int blockEdge, int ellipsisWidth, bool&);
 
     EllipsisBox* ellipsisBox() const { return m_ellipsisBox; }
-    void paintEllipsisBox(RenderObject::PaintInfo&, int tx, int ty) const;
-    bool hitTestEllipsisBox(RenderObject::NodeInfo&, int x, int y, int tx, int ty, HitTestAction, bool inBox);
+
+    void paintEllipsisBox(RenderObject::PaintInfo& i, int _tx, int _ty) const;
+    bool hitTestEllipsisBox(HitTestResult& info, int _x, int _y, int _tx, int _ty,
+                            HitTestAction hitTestAction, bool inBox);
     
     virtual void clearTruncation();
 
@@ -95,8 +99,8 @@ public:
     void paintCustomHighlight(RenderObject::PaintInfo&, int tx, int ty, const AtomicString& highlightType);
 #endif
 
-    virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
-    virtual bool nodeAtPoint(RenderObject::NodeInfo&, int x, int y, int tx, int ty);
+    virtual void paint(RenderObject::PaintInfo& i, int _tx, int _ty);
+    virtual bool nodeAtPoint(HitTestResult&, int, int, int, int);
 
     bool hasSelectedChildren() const { return m_hasSelectedChildren; }
     void setHasSelectedChildren(bool b);
index 2ddeff7e395131c20b4abb9fba6462b4ee7c6c4e..3a3b55dffeeb04b9015c603542d18531b5145d75 100644 (file)
@@ -1,3 +1,38 @@
+2006-10-28  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Darin.
+
+        This is the WebKit half of pushing the guts of elementAtPoint and 
+        WebElementDictionary into WebCore. Among other things, this patch 
+        makes WebElementDictionary.m and WebHTMLView.m Objective-C++
+
+        * MigrateHeaders.make: Add DOMElementInternal.h to the list of 
+        headers to migrate.
+        * Misc/WebElementDictionary.h: Replaced DOMNode, DOMElement, and 
+        NSPoint member variables with a HitTestResult member variable.
+        * Misc/WebElementDictionary.m:
+        (addLookupKey): Formatting.
+        (-[WebElementDictionary initWithHitTestResult:]): Constructor just 
+        takes a HitTestResult now and sets the member variable.
+        (-[WebElementDictionary dealloc]): delete HitTestResult.
+        (-[WebElementDictionary finalize]): Address HitTestResult.
+        (-[WebElementDictionary _domNode]): Use HitTestResult and call into 
+        WebCore.
+        (-[WebElementDictionary objectForKey:]): Same.
+        (-[WebElementDictionary _webFrame]): Same.
+        (-[WebElementDictionary _targetWebFrame]): Same.
+        (-[WebElementDictionary _title]): Same.
+        (-[WebElementDictionary _imageRect]): Same.
+        (-[WebElementDictionary _isSelected]): Same.
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebFrame.mm:
+        (core): Convert from DOMNode* to Node*
+        (kit): Convert from Node* to DOMNode*
+        * WebView/WebFrameInternal.h: Support for the above.
+        * WebView/WebHTMLView.m:
+        (-[WebHTMLView elementAtPoint:allowShadowContent:]): Call directly 
+        into Frame.cpp to get HitTestResult.
+
 2006-10-27  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by John & Adam.
index d9d16d9923c3884315a83e94bda1d5086330bef9..26a85ab1409d8bffe948fb41e65128330fe0e673 100644 (file)
@@ -155,6 +155,7 @@ all : \
     $(PUBLIC_HEADERS_DIR)/DOMMutationEvent.h \
     $(PUBLIC_HEADERS_DIR)/DOMNamedNodeMap.h \
     $(PUBLIC_HEADERS_DIR)/DOMNode.h \
+    $(INTERNAL_HEADERS_DIR)/DOMNodeInternal.h \
     $(PRIVATE_HEADERS_DIR)/DOMNodePrivate.h \
     $(PUBLIC_HEADERS_DIR)/DOMNodeFilter.h \
     $(PUBLIC_HEADERS_DIR)/DOMNodeIterator.h \
index 54ef0df32358cf2cf4681124083694308815b053..b835b5c6fdc1dcb406d723bdfb87b0b371170540 100644 (file)
 
 #import <Foundation/NSDictionary.h>
 
-@class DOMNode;
-@class DOMElement;
+namespace WebCore { 
+    class HitTestResult;
+}
 
 @interface WebElementDictionary : NSDictionary {
-    DOMNode *_innerNode;
-    DOMNode *_innerNonSharedNode;
-    DOMElement *_URLElement;
+    WebCore::HitTestResult* _result;
     NSMutableDictionary *_cache;
     NSMutableSet *_nilValues;
-    NSPoint _point;
     BOOL _cacheComplete;
 }
-- (id)initWithInnerNonSharedNode:(DOMNode *)innerNonSharedNode innerNode:(DOMNode *)innerNode URLElement:(DOMElement *)URLElement andPoint:(NSPoint)point;
+- (id)initWithHitTestResult:(const WebCore::HitTestResult&)result;
 @end
index d41854f864d9fe90561f82ff2fc235346a4d90f7..5320c0c4441b4a2151d875b14cd3069610094cdd 100644 (file)
 
 #import <WebKit/DOMCore.h>
 #import <WebKit/DOMExtensions.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/HitTestResult.h>
+
+using namespace WebCore;
 
 typedef enum {
     WebElementSelf,
@@ -54,7 +58,7 @@ static CFMutableDictionaryRef lookupTable = NULL;
 
 static void addLookupKey(NSString *key, SEL selector, WebElementTargetObject target)
 {
-    WebElementMethod *elementMethod = static_cast<WebElementMethod*>(malloc(sizeof(WebElementMethod)));
+    WebElementMethodelementMethod = static_cast<WebElementMethod*>(malloc(sizeof(WebElementMethod)));
     elementMethod->target = target;
     elementMethod->selector = selector;
     CFDictionaryAddValue(lookupTable, key, elementMethod);
@@ -88,27 +92,28 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
     addLookupKey(WebElementLinkLabelKey, @selector(textContent), WebElementURLElement);
 }
 
-- (id)initWithInnerNonSharedNode:(DOMNode *)innerNonSharedNode innerNode:(DOMNode *)innerNode URLElement:(DOMElement *)URLElement andPoint:(NSPoint)point
+- (id)initWithHitTestResult:(const HitTestResult&)result
 {
     [[self class] initializeLookupTable];
     [super init];
-    _point = point;
-    _innerNode = [innerNode retain];
-    _innerNonSharedNode = [innerNonSharedNode retain];
-    _URLElement = [URLElement retain];
+    _result = new HitTestResult(result);
     return self;
 }
 
 - (void)dealloc
 {
-    [_innerNode release];
-    [_innerNonSharedNode release];
-    [_URLElement release];
+    delete _result;
     [_cache release];
     [_nilValues release];
     [super dealloc];
 }
 
+- (void)finalize
+{
+    delete _result;
+    [super finalize];
+}
+
 - (void)_fillCache
 {
     CFDictionaryApplyFunction(lookupTable, cacheValueForKey, self);
@@ -129,6 +134,11 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
     return [_cache keyEnumerator];
 }
 
+- (DOMNode *)_domNode
+{
+    return kit(_result->innerNonSharedNode());
+}
+
 - (id)objectForKey:(id)key
 {
     id value = [_cache objectForKey:key];
@@ -145,13 +155,13 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
             target = self;
             break;
         case WebElementInnerNonSharedNode:
-            target = _innerNonSharedNode;
+            target = [self _domNode];
             break;
         case WebElementInnerNode:
-            target = _innerNode;
+            target = kit(_result->innerNode());
             break;
         case WebElementURLElement:
-            target = _URLElement;
+            target = kit(_result->URLElement());
             break;
     }
 
@@ -175,50 +185,31 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
     return value;
 }
 
-- (DOMNode *)_domNode
-{
-    return [[_innerNonSharedNode retain] autorelease];
-}
-
 - (WebFrame *)_webFrame
 {
-    return [[_innerNonSharedNode ownerDocument] webFrame];
+    return [[[self _domNode] ownerDocument] webFrame];
 }
 
 - (WebFrame *)_targetWebFrame
 {
-    if (!_URLElement || ![_URLElement respondsToSelector:@selector(target)])
-        return nil;
-    WebFrame *webFrame = [[_innerNonSharedNode ownerDocument] webFrame];
-    NSString *targetName = [_URLElement performSelector:@selector(target)];
-    if ([targetName length])
-        return [webFrame findFrameNamed:targetName];
-    return webFrame;
+    FrameMac* webCoreFrame = Mac(_result->targetFrame());
+    return kit(webCoreFrame);
 }
 
 - (NSString *)_title
 {
-    // Find the title in the nearest enclosing DOM node.
-    // For <area> tags in image maps, walk the tree for the <area>, not the <img> using it.
-    for (DOMNode *titleNode = _innerNode; titleNode; titleNode = [titleNode parentNode]) {
-        if ([titleNode isKindOfClass:[DOMHTMLElement class]]) {
-            NSString *title = [(DOMHTMLElement *)titleNode titleDisplayString];
-            if ([title length])
-                return title;
-        }
-    }
-    return nil;
+    return _result->title();
 }
 
 - (NSValue *)_imageRect
 {
     if ([self objectForKey:WebElementImageURLKey])
-        return [NSValue valueWithRect:[_innerNonSharedNode boundingBox]];
+        return [NSValue valueWithRect:_result->boundingBox()];
     return nil;
 }
 
 - (NSNumber *)_isSelected
 {
-    return [NSNumber numberWithBool:[[[[_innerNonSharedNode ownerDocument] webFrame] _bridge] isPointInsideSelection:_point]];
+    return [NSNumber numberWithBool:_result->isSelected()];
 }
 @end
index 380f6a03248a6c928994419a2d49b320f2eba1c3..04b4b0ca0897628a85b2c93598f6f30736ed4427 100644 (file)
                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 */,
                        );
index fa0ac15883fc3e5b83c31f4394a7a8643cb4988a..7dc1103225f296bb8800ad06420af0fa9c28e03c 100644 (file)
@@ -31,6 +31,7 @@
 #import "DOMDocumentInternal.h"
 #import "DOMElementInternal.h"
 #import "DOMHTMLElementInternal.h"
+#import "DOMNodeInternal.h"
 #import "DOMRangeInternal.h"
 #import "WebBackForwardList.h"
 #import "WebDataSourceInternal.h"
@@ -71,6 +72,7 @@
 #import <WebKit/DOMDocument.h>
 #import <WebKit/DOMElement.h>
 #import <WebKit/DOMHTMLElement.h>
+#import <WebKit/DOMNode.h>
 #import <WebKit/DOMRange.h>
 
 /*
@@ -159,6 +161,16 @@ DOMElement *kit(Element* element)
     return [DOMElement _elementWith:element];
 }
 
+Node* core(DOMNode *node)
+{
+    return [node _node];
+}
+
+DOMNode *kit(Node* node)
+{
+    return [DOMNode _nodeWith:node];
+}
+
 Document* core(DOMDocument *document)
 {
     return [document _document];
index 950ead844d2ba3b1c4d04c62a1dc3db7008fbf1b..ae6053077035fb71adb580d508400aa7ccfb4f89 100644 (file)
@@ -35,6 +35,7 @@
 #endif
 
 @class DOMElement;
+@class DOMNode;
 @class DOMRange;
 @class WebInspector;
 @class WebFrameView;
@@ -52,6 +53,7 @@ namespace WebCore {
     class FrameMac;
     class FrameLoader;
     class HTMLElement;
+    class Node;
     class Range;
 }
 
@@ -61,6 +63,9 @@ WebFrame *kit(WebCore::Frame *);
 WebCore::Element* core(DOMElement *);
 DOMElement *kit(WebCore::Element*);
 
+WebCore::Node* core(DOMNode *);
+DOMNode *kit(WebCore::Node*);
+
 WebCore::Document* core(DOMDocument *);
 DOMDocument *kit(WebCore::Document*);
 
index cdf428e1ac1b8c1708659a723c9e7a52cbab21e1..109c003b50c63093afd590c35ff7049b06a2a056 100644 (file)
@@ -68,6 +68,7 @@
 #import <ApplicationServices/ApplicationServices.h>
 #import <WebCore/FloatRect.h>
 #import <WebCore/FrameMac.h>
+#import <WebCore/HitTestResult.h>
 #import <WebCore/SelectionController.h>
 #import <WebCore/WebCoreTextRenderer.h>
 #import <WebCore/WebDataProtocol.h>
@@ -6042,13 +6043,11 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow;
 {
-    DOMNode *innerNode = nil;
-    DOMNode *innerNonSharedNode = nil;
-    DOMElement *URLElement = nil;
-    [[self _bridge] getInnerNonSharedNode:&innerNonSharedNode innerNode:&innerNode URLElement:&URLElement atPoint:point allowShadowContent:allow];
-    NSView *innerView = [[[[innerNonSharedNode ownerDocument] webFrame] frameView] documentView];
-    NSPoint innerPoint = innerView ? [self convertPoint:point toView:innerView] : point;
-    return [[[WebElementDictionary alloc] initWithInnerNonSharedNode:innerNonSharedNode innerNode:innerNode URLElement:URLElement andPoint:innerPoint] autorelease];
+    Frame* frame = core([self _frame]);
+    HitTestResult result(true, false);
+    if (frame->renderer())
+        result = frame->hitTestResultAtPoint(IntPoint(point), allow);
+    return [[[WebElementDictionary alloc] initWithHitTestResult:result] autorelease];
 }
 
 @end