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)
commita82970379c3cc0a614955fcda4c6123b3e9e6278
tree9f82587108716161833b99c4b9d8bec40f0e14f7
parent7a6daf4c5d87b920426d25902d615b0aa990cd1d
WebCore:
        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