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
+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.
__ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
__ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
__ZN7WebCore12AtomicString3addEPNS_10StringImplE
+__ZN7WebCore13HitTestResultC1ERKS0_
+__ZN7WebCore13HitTestResultC1Ebbb
+__ZN7WebCore13HitTestResultD1Ev
+__ZN7WebCore13HitTestResultaSERKS0_
__ZN7WebCore14DocumentLoader12setCommittedEb
__ZN7WebCore14DocumentLoader13attachToFrameEv
__ZN7WebCore14DocumentLoader15detachFromFrameEv
__ZN7WebCore5Frame12ownerElementEv
__ZN7WebCore5Frame14scrollToAnchorERKNS_4KURLE
__ZN7WebCore5Frame17setWindowHasFocusEb
+__ZN7WebCore5Frame20hitTestResultAtPointERKNS_8IntPointEb
__ZN7WebCore5Frame20setSelectionFromNoneEv
__ZN7WebCore5Frame21setProhibitsScrollingEb
__ZN7WebCore5Frame26isSelectionInPasswordFieldEv
__ZN7WebCore8FrameMac7mouseUpEP7NSEvent
__ZN7WebCore8FrameMac8keyEventEP7NSEvent
__ZN7WebCore8FrameMac9mouseDownEP7NSEvent
+__ZN7WebCore8IntPointC1ERK8_NSPoint
__ZN7WebCore9FrameTree11appendChildEN3WTF10PassRefPtrINS_5FrameEEE
__ZN7WebCore9FrameTree7setNameERKNS_12AtomicStringE
__ZN7WebCore9TimerBase4stopEv
__ZN7WebCore9TimerBaseD2Ev
__ZNK7WebCore10StringImplcvP8NSStringEv
__ZNK7WebCore10StringImplcvP8NSStringEv
+__ZNK7WebCore10StringImplcvP8NSStringEv
__ZNK7WebCore11FrameLoader14documentLoaderEv
__ZNK7WebCore11FrameLoader15defersCallbacksEv
__ZNK7WebCore11FrameLoader15firstLayoutDoneEv
__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader21isQuickRedirectComingEv
+__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
__ZNK7WebCore11FrameLoader6clientEv
__ZNK7WebCore11FrameLoader8loadTypeEv
+__ZNK7WebCore13HitTestResult10isSelectedEv
+__ZNK7WebCore13HitTestResult11boundingBoxEv
+__ZNK7WebCore13HitTestResult11targetFrameEv
+__ZNK7WebCore13HitTestResult5titleEv
__ZNK7WebCore14DocumentLoader10isStoppingEv
__ZNK7WebCore14DocumentLoader11frameLoaderEv
__ZNK7WebCore14DocumentLoader11isCommittedEv
__ZNK7WebCore5Frame6loaderEv
__ZNK7WebCore5Frame8documentEv
__ZNK7WebCore5Frame8referrerEv
+__ZNK7WebCore5Frame8rendererEv
__ZNK7WebCore7IntRectcv6CGRectEv
__ZNK7WebCore7IntRectcv7_NSRectEv
+__ZNK7WebCore7IntRectcv7_NSRectEv
__ZNK7WebCore8FrameMac14selectionImageEb
__ZNK7WebCore8FrameMac17eventMayStartDragEP7NSEvent
__ZNK7WebCore8FrameMac19bodyBackgroundColorEv
__ZNK7WebCore8FrameMac31fontAttributesForSelectionStartEv
__ZNK7WebCore9FloatRectcv6CGRectEv
__ZNK7WebCore9FloatRectcv7_NSRectEv
+__ZNK7WebCore9FrameTree12traverseNextEPKNS_5FrameE
+__ZNK7WebCore9FrameTree14isDescendantOfEPKNS_5FrameE
__ZNK7WebCore9FrameTree20traverseNextWithWrapEb
__ZNK7WebCore9FrameTree24traversePreviousWithWrapEb
__ZNK7WebCore9FrameTree4findERKNS_12AtomicStringE
_wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes
_wkSupportsMultipartXMixedReplace
-__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
-__ZNK7WebCore9FrameTree12traverseNextEPKNS_5FrameE
-__ZNK7WebCore9FrameTree14isDescendantOfEPKNS_5FrameE
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;
};
#import "HTMLDocument.h"
#import "HTMLNames.h"
#import "HTMLPlugInElement.h"
+#import "Image.h"
#import "IntRect.h"
#import "NodeFilter.h"
#import "NodeFilterCondition.h"
#ifndef FrameMac_h
#define FrameMac_h
-#import "ClipboardMac.h"
+#import "ClipboardAccessPolicy.h"
#import "Frame.h"
#import "IntRect.h"
#import "PlatformMouseEvent.h"
class WebCoreFrameBridge;
class WebScriptObject;
+typedef unsigned int NSDragOperation;
typedef int NSWritingDirection;
#endif
namespace WebCore {
+class ClipboardMac;
class DocumentFragment;
class EditorClient;
class FramePrivate;
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;
#import "CSSComputedStyleDeclaration.h"
#import "Cache.h"
#import "ClipboardEvent.h"
+#import "ClipboardMac.h"
#import "Cursor.h"
#import "WebDocumentLoader.h"
#import "DOMInternal.h"
#import "HTMLTableCellElement.h"
#import "Logging.h"
#import "MouseEventWithHitTestResults.h"
+#import "HitTestResult.h"
#import "PlatformKeyboardEvent.h"
#import "PlatformScrollBar.h"
#import "PlatformWheelEvent.h"
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.
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
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);
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.
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
// 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())
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());
bool noDefaultProcessing = evt->defaultPrevented();
// invalidate clipboard here for security
- clipboard->setAccessPolicy(ClipboardMac::Numb);
+ clipboard->setAccessPolicy(ClipboardNumb);
return !noDefaultProcessing;
}
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()
// 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()
// 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)
#import "HTMLMapElement.h"
#import "HTMLNames.h"
#import "HTMLSelectElement.h"
+#import "HitTestResult.h"
#import "RenderImage.h"
#import "RenderListMarker.h"
#import "RenderMenuList.h"
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;
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);
- (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;
#import "AXObjectCache.h"
#import "Cache.h"
+#import "ClipboardMac.h"
#import "DOMImplementation.h"
#import "DOMInternal.h"
#import "Decoder.h"
#import "LoaderNSURLRequestExtras.h"
#import "ModifySelectionListLevel.h"
#import "MoveSelectionCommand.h"
+#import "HitTestResult.h"
#import "Page.h"
#import "PlugInInfoStore.h"
#import "RenderImage.h"
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));
- (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();
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);
op = NSDragOperationNone;
}
}
- clipboard->setAccessPolicy(ClipboardMac::Numb); // invalidate clipboard here for security
+ clipboard->setAccessPolicy(ClipboardNumb); // invalidate clipboard here for security
return op;
}
}
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
}
}
}
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;
}
}
#include "MutationEvent.h"
#include "NameNodeList.h"
#include "NodeFilter.h"
+#include "HitTestResult.h"
#include "NodeIterator.h"
#include "PlatformKeyboardEvent.h"
#include "ProcessingInstruction.h"
if (!renderer())
return 0;
- 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)
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)
virtual String toString() const;
virtual bool isURLAttribute(Attribute *attr) const;
+ virtual String target() const { return String(); }
virtual void focus();
virtual void updateFocusAppearance();
int tabIndex() const;
void setTabIndex(int);
- String target() const;
+ virtual String target() const;
void setTarget(const String&);
String type() const;
#include "Document.h"
#include "HTMLNames.h"
#include "FloatRect.h"
-#include "IntSize.h"
+#include "HitTestResult.h"
+#include "RenderObject.h"
using namespace std;
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);
#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 };
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;
int tabIndex() const;
void setTabIndex(int);
- String target() const;
+ virtual String target() const;
void setTarget(const String&);
protected:
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();
String method() const;
void setMethod(const String&);
- String target() const;
+ virtual String target() const;
void setTarget(const String&);
friend class HTMLFormCollection;
String rev() const;
void setRev(const String&);
- String target() const;
+ virtual String target() const;
void setTarget(const String&);
String type() const;
#include "HTMLAreaElement.h"
#include "HTMLCollection.h"
#include "HTMLNames.h"
+#include "IntSize.h"
+#include "HitTestResult.h"
using namespace std;
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;
#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*);
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();
#include "loader/icon/IconLoader.h"
#include "MediaFeatureNames.h"
#include "MouseEventWithHitTestResults.h"
+#include "HitTestResult.h"
#include "NodeList.h"
#include "Page.h"
#include "PlatformScrollBar.h"
#include "Plugin.h"
#include "PluginDocument.h"
#include "RenderListBox.h"
+#include "RenderObject.h"
#include "RenderPart.h"
#include "RenderTextControl.h"
#include "RenderTheme.h"
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;
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();
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()
#include "FrameView.h"
#include "KURL.h"
#include "Node.h"
-#include "RenderObject.h"
#include "RenderLayer.h"
#include "ScrollBar.h"
#include "TextAffinity.h"
class Page;
class Plugin;
class MouseEventWithHitTestResults;
+class HitTestResult;
class Range;
class RenderLayer;
+class RenderObject;
class ResourceRequest;
class Selection;
class SelectionController;
friend class FrameQt;
#endif
- RenderObject::NodeInfo nodeInfoAtPoint(const IntPoint&, bool allowShadowContent);
+ HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent);
bool hasSelection();
String documentTypeString() const;
#include "Image.h"
#include "MouseEvent.h"
#include "MouseEventWithHitTestResults.h"
+#include "HitTestResult.h"
#include "OverflowEvent.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformScrollBar.h"
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);
--- /dev/null
+/*
+ * 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
#include "Image.h"
#include "IntPoint.h"
#include "Clipboard.h"
+#include "ClipboardAccessPolicy.h"
#include "CachedResourceClient.h"
#ifdef __OBJC__
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;
void setDestinationOperation(NSDragOperation op);
#endif
- void setAccessPolicy(AccessPolicy policy);
- AccessPolicy accessPolicy() const;
+ void setAccessPolicy(ClipboardAccessPolicy);
void setDragHasStarted() { m_dragStarted = true; }
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
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)
{
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();
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
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
String ClipboardMac::getData(const String &type, bool &success) const
{
success = false;
- if (m_policy != Readable) {
+ if (m_policy != ClipboardReadable) {
return String();
}
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
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];
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;
void ClipboardMac::setDropEffect(const String &s)
{
- if (m_policy == Readable || m_policy == TypesReadable) {
+ if (m_policy == ClipboardReadable || m_policy == ClipboardTypesReadable) {
m_dropEffect = s;
}
}
void ClipboardMac::setEffectAllowed(const String &s)
{
- if (m_policy == Writable)
+ if (m_policy == ClipboardWritable)
m_effectAllowed = s;
}
#include "Document.h"
#include "GraphicsContext.h"
+#include "HitTestResult.h"
#include "TextStyle.h"
namespace WebCore {
}
}
-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;
namespace WebCore {
+class HitTestResult;
+
class EllipsisBox : public InlineBox {
public:
EllipsisBox(RenderObject* obj, const AtomicString& ellipsisStr, InlineFlowBox* parent,
, 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;
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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_
#include "InlineBox.h"
#include "InlineFlowBox.h"
+#include "HitTestResult.h"
#include "RenderArena.h"
#include "RootInlineBox.h"
}
}
-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
namespace WebCore {
+class HitTestResult;
class RootInlineBox;
// InlineBox represents a rectangle that occurs on a line. It corresponds to
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();
#include "EllipsisBox.h"
#include "GraphicsContext.h"
#include "InlineTextBox.h"
+#include "HitTestResult.h"
+#include "RootInlineBox.h"
#include "RenderBlock.h"
#include "RenderFlow.h"
#include "RenderListMarker.h"
}
}
-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()) {
namespace WebCore {
+class HitTestResult;
+
class InlineFlowBox : public InlineRunBox {
public:
InlineFlowBox(RenderObject* obj)
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();
#include "Document.h"
#include "Frame.h"
#include "GraphicsContext.h"
+#include "HitTestResult.h"
#include "Range.h"
#include "RenderArena.h"
#include "RenderBlock.h"
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;
class String;
class StringImpl;
class MarkedTextUnderline;
+class HitTestResult;
class Position;
class InlineTextBox : public InlineRunBox {
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;
#include "Frame.h"
#include "GraphicsContext.h"
#include "InlineTextBox.h"
+#include "HitTestResult.h"
#include "RenderTableCell.h"
#include "RenderTextFragment.h"
#include "SelectionController.h"
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;
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();
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);
}
// 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;
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();
}
}
-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;
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();
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();
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();
#include "HTMLNames.h"
#include "TextStream.h"
#include "MouseEvent.h"
+#include "HitTestResult.h"
#include "RenderFrame.h"
#include "RenderView.h"
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)
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()); }
#include "HTMLInputElement.h"
#include "HTMLMapElement.h"
#include "HTMLNames.h"
+#include "HitTestResult.h"
#include "RenderView.h"
#include "TextStyle.h"
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);
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;
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);
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();
#include "GraphicsContext.h"
#include "HTMLMarqueeElement.h"
#include "HTMLNames.h"
+#include "HitTestResult.h"
#include "OverflowEvent.h"
#include "PlatformMouseEvent.h"
#include "RenderArena.h"
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);
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();
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;
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())
namespace WebCore {
class CachedResource;
+class HitTestResult;
class RenderView;
class RenderFrameSet;
class RenderObject;
// 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
// 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; }
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;
#include "HTMLOptionElement.h"
#include "HTMLOptGroupElement.h"
#include "HTMLSelectElement.h"
+#include "HitTestResult.h"
#include "PlatformScrollBar.h"
#include "RenderBR.h"
#include "RenderText.h"
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;
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);
#include "HTMLNames.h"
#include "HTMLOListElement.h"
#include "KURL.h"
+#include "HitTestResult.h"
#include "Position.h"
#include "RenderArena.h"
#include "RenderFlexibleBox.h"
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) {
return inside;
}
-void RenderObject::setInnerNode(NodeInfo& info)
+void RenderObject::setInnerNode(HitTestResult& info)
{
if (info.innerNode())
return;
}
}
-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;
class HTMLAreaElement;
class InlineBox;
class InlineFlowBox;
+class HitTestResult;
class PlatformScrollbar;
class Position;
class RenderArena;
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 {
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()); }
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)
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 {
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();
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();
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;
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();
}
// 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.
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(); }
}
// 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.
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
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>&);
#include "HTMLNames.h"
#include "HTMLTextAreaElement.h"
#include "HTMLTextFieldInnerElement.h"
+#include "HitTestResult.h"
#include "RenderTheme.h"
#include "SelectionController.h"
#include "TextIterator.h"
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).
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);
#if PLATFORM(MAC)
#include "FrameMac.h"
#endif
+#include "HitTestResult.h"
using namespace std;
#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)) {
namespace WebCore {
class EllipsisBox;
+class HitTestResult;
+
struct GapRects;
class RootInlineBox : public InlineFlowBox {
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();
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);
+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.
$(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 \
#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
#import <WebKit/DOMCore.h>
#import <WebKit/DOMExtensions.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/HitTestResult.h>
+
+using namespace WebCore;
typedef enum {
WebElementSelf,
static void addLookupKey(NSString *key, SEL selector, WebElementTargetObject target)
{
- WebElementMethod *elementMethod = static_cast<WebElementMethod*>(malloc(sizeof(WebElementMethod)));
+ WebElementMethod* elementMethod = static_cast<WebElementMethod*>(malloc(sizeof(WebElementMethod)));
elementMethod->target = target;
elementMethod->selector = selector;
CFDictionaryAddValue(lookupTable, key, elementMethod);
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);
return [_cache keyEnumerator];
}
+- (DOMNode *)_domNode
+{
+ return kit(_result->innerNonSharedNode());
+}
+
- (id)objectForKey:(id)key
{
id value = [_cache objectForKey:key];
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;
}
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
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 */,
);
#import "DOMDocumentInternal.h"
#import "DOMElementInternal.h"
#import "DOMHTMLElementInternal.h"
+#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
#import "WebBackForwardList.h"
#import "WebDataSourceInternal.h"
#import <WebKit/DOMDocument.h>
#import <WebKit/DOMElement.h>
#import <WebKit/DOMHTMLElement.h>
+#import <WebKit/DOMNode.h>
#import <WebKit/DOMRange.h>
/*
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];
#endif
@class DOMElement;
+@class DOMNode;
@class DOMRange;
@class WebInspector;
@class WebFrameView;
class FrameMac;
class FrameLoader;
class HTMLElement;
+ class Node;
class Range;
}
WebCore::Element* core(DOMElement *);
DOMElement *kit(WebCore::Element*);
+WebCore::Node* core(DOMNode *);
+DOMNode *kit(WebCore::Node*);
+
WebCore::Document* core(DOMDocument *);
DOMDocument *kit(WebCore::Document*);
#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>
- (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