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 28d7893..fda186f 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 9ad49bd..4123850 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 2ea078a..a674338 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 2978999..df953ba 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 d8ccaa1..2998be7 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 7267636..670a324 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 77d3f75..d38684e 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 ee5afc4..59bbb4c 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 c0370ce..eefaaef 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 fcc7297..2a742e5 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 900f741..674379d 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 4f53482..0184fb5 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 05ffa11..745c6de 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 31b1f10..b7aaed1 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 ee82f19..c5388cd 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 6768c35..2e025e7 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 aa53c36..b087a61 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 6971702..96ea678 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 d19de4e..484359f 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 a586050..867698e 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 362fbe6..b016983 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 eebe62f..9cc01f6 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 b36ae2d..fb59438 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 8790322..8482a03 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 3e51455..0728b33 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 656e865..f0dcfee 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 776f05e..b556b71 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 d28c433..03425a1 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 50e18fa..d1e07b8 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 9443ebb..910843a 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 2a32213..ab9b3f9 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 6a283a4..2847a88 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 a7091a1..4724928 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 0d7a19e..e5eb1c2 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 0e03c21..d08ff7d 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 4059c1e..4618004 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 08c0db8..50fbf6d 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 0779b60..ea38a26 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 415b376..96e3934 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 c9cea5f..70310f8 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 394bfb9..20edadb 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 3a15dc6..e1daf17 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 cbdb418..59de1d7 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 29285df..119251e 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 927bae5..686741f 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 a675830..822dbe5 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 081e142..f1a6cc4 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 bbddcff..120b546 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 cb8f3a1..4cc6824 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 cff41d7..cc59d8b 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 0d2bc62..65b43dd 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 2066e31..123b3a3 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 94b4f76..dc39628 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 1098c55..a487fc6 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 1c7de79..dc84715 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 65f1090..dacb376 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 7c5e876..050c62b 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 046733a..4e19fe5 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 3b4112f..330a8d7 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 75e59c0..f47b2a6 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 67abf18..7ed046d 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 a98ab35..bd97394 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 64cd6b5..01fe402 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 e6a45de..ee37f16 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 2169311..214240d 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 f74ae58..ab7ea4f 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 29be21c..90261ce 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 2ddeff7..3a3b55d 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 d9d16d9..26a85ab 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 54ef0df..b835b5c 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 d41854f..5320c0c 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 380f6a0..04b4b0c 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 fa0ac15..7dc1103 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 950ead8..ae60530 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 cdf428e..109c003 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