QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest) : isContentEditable(false) , isContentSelected(false) { if (!hitTest.innerNode()) return; pos = hitTest.point(); boundingRect = hitTest.boundingBox(); title = hitTest.title(); linkText = hitTest.textContent(); linkUrl = hitTest.absoluteLinkURL(); linkTitle = hitTest.titleDisplayString(); alternateText = hitTest.altDisplayString(); imageUrl = hitTest.absoluteImageURL(); innerNonSharedNode = hitTest.innerNonSharedNode(); WebCore::Image *img = hitTest.image(); if (img) { QPixmap *pix = img->nativeImageForCurrentFrame(); if (pix) pixmap = *pix; } WebCore::Frame *wframe = hitTest.targetFrame(); if (wframe) linkTargetFrame = QWebFramePrivate::kit(wframe); isContentEditable = hitTest.isContentEditable(); isContentSelected = hitTest.isSelected(); if (innerNonSharedNode && innerNonSharedNode->document() && innerNonSharedNode->document()->frame()) frame = QWebFramePrivate::kit(innerNonSharedNode->document()->frame()); }
wxWebViewDOMElementInfo wxWebFrame::HitTest(const wxPoint& pos) const { wxWebViewDOMElementInfo domInfo; if (m_impl->frame->view()) { WebCore::HitTestResult result = m_impl->frame->eventHandler()->hitTestResultAtPoint(m_impl->frame->view()->windowToContents(pos), false); if (result.innerNode()) { domInfo.SetLink(result.absoluteLinkURL().string()); domInfo.SetText(result.textContent()); domInfo.SetImageSrc(result.absoluteImageURL().string()); domInfo.SetSelected(result.isSelected()); } } return domInfo; }
QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest) : isContentEditable(false) , isContentSelected(false) , isScrollBar(false) , webCoreFrame(0) { if (!hitTest.innerNode()) return; pos = hitTest.roundedPointInInnerNodeFrame(); WebCore::TextDirection dir; title = hitTest.title(dir); linkText = hitTest.textContent(); linkUrl = hitTest.absoluteLinkURL(); linkTitle = hitTest.titleDisplayString(); alternateText = hitTest.altDisplayString(); imageUrl = hitTest.absoluteImageURL(); innerNode = hitTest.innerNode(); innerNode->ref(); innerNonSharedNode = hitTest.innerNonSharedNode(); innerNonSharedNode->ref(); boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect() : IntRect(); WebCore::Image *img = hitTest.image(); if (img) { QPixmap* pix = img->nativeImageForCurrentFrame(); if (pix) pixmap = *pix; } WebCore::Frame *wframe = hitTest.targetFrame(); if (wframe) { linkTargetFrame = QWebFrameAdapter::kit(wframe)->handle(); webCoreFrame = wframe; webCoreFrame->ref(); } linkElement = QWebElement(hitTest.URLElement()); isContentEditable = hitTest.isContentEditable(); isContentSelected = hitTest.isSelected(); isScrollBar = hitTest.scrollbar(); WebCore::Frame *innerNodeFrame = hitTest.innerNodeFrame(); if (innerNodeFrame) frame = QWebFrameAdapter::kit(innerNodeFrame)->handle(); enclosingBlock = QWebElement(WebCore::enclosingBlock(innerNode)); }
QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest) : isContentEditable(false) , isContentSelected(false) , isScrollBar(false) { if (!hitTest.innerNode()) return; pos = hitTest.point(); boundingRect = hitTest.boundingBox(); title = hitTest.title(); linkText = hitTest.textContent(); linkUrl = hitTest.absoluteLinkURL(); linkTitle = hitTest.titleDisplayString(); alternateText = hitTest.altDisplayString(); imageUrl = hitTest.absoluteImageURL(); innerNode = hitTest.innerNode(); innerNonSharedNode = hitTest.innerNonSharedNode(); WebCore::Image *img = hitTest.image(); if (img) { QPixmap *pix = img->nativeImageForCurrentFrame(); if (pix) pixmap = *pix; } WebCore::Frame *wframe = hitTest.targetFrame(); if (wframe) linkTargetFrame = QWebFramePrivate::kit(wframe); isContentEditable = hitTest.isContentEditable(); isContentSelected = hitTest.isSelected(); isScrollBar = hitTest.scrollbar(); if (innerNonSharedNode && innerNonSharedNode->document() && innerNonSharedNode->document()->frame()) frame = QWebFramePrivate::kit(innerNonSharedNode->document()->frame()); if (Node *block = WebCore::enclosingBlock(innerNode.get())) { RenderObject *renderBlock = block->renderer(); while (renderBlock && renderBlock->isListItem()) renderBlock = renderBlock->containingBlock(); if (renderBlock) enclosingBlock = renderBlock->absoluteClippedOverflowRect(); } }