[webkit-dev] how do i know that i'm clicking on a flash movie?

Shi Yan billconan at gmail.com
Tue Jun 23 13:54:19 PDT 2009


hi guys,

i want to make a correction on my previous message. i've just tried another
online video site, it turned out that the webview does respond to flash
click. but youtube is different. and i guess i should not post the message
here, it seems to be a QT question.

On Tue, Jun 23, 2009 at 1:24 PM, Shi Yan <billconan at gmail.com> wrote:

> hello guys,
>
> i'm trying to implement a feature with the Qt webkit such that when
> the user clicks on a web page, i can know the corresponding html tag
> that he/she is clicking. for example, if the user clicks an image, i
> should be able to get <img> tag and also the src attribute.
>
> i modified the hitTestContent function in this way:
>
> QWebHitTestResult QWebFrame::hitTestContent(const QPoint &pos) const
> {
>    if (!d->frame->view() || !d->frame->contentRenderer())
>        return QWebHitTestResult();
>
>    HitTestResult result =
>
> d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos),
> /*allowShadowContent*/ false);
>
>        printf("Inner Node Type:%d;\n",result.innerNode()->nodeType());
>
>        std::cout<<"node value:"<<(result.innerNode()->nodeValue().operator
> QString()).toStdString()<<std::endl;
>
>        if(result.innerNode()->nodeType()==Node::ELEMENT_NODE)
>        {
>                Element* oldElement =
> static_cast<Element*>(result.innerNode());
>                std::cout<<(oldElement->tagName().operator
> QString()).toStdString()<<std::endl;
>        }
>        else if(result.innerNode()->nodeType()==Node::TEXT_NODE)
>        {
>                printf("text node!\n");
>        }
>    return QWebHitTestResult(new QWebHitTestResultPrivate(result));
> }
>
>
> this code works for text nodes and element nodes. but when i click on
> a piece of flash movie, such as a youtube movie, the hitTestContent
> isn't called. i don't know can i get the flash information by
> clicking. thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090623/9353464f/attachment.html>


More information about the webkit-dev mailing list