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: http://svn.webkit.org/repository/webkit/trunk@17399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/HTMLAreaElement.cpp b/WebCore/html/HTMLAreaElement.cpp
index 05ffa11..745c6de 100644
--- a/WebCore/html/HTMLAreaElement.cpp
+++ b/WebCore/html/HTMLAreaElement.cpp
@@ -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 @@
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);