Bug 104087 - [Qt] "hitTestContent" function bug for <span> tag
Summary: [Qt] "hitTestContent" function bug for <span> tag
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 417.x
Hardware: Other Linux
: P3 Major
Assignee: Nobody
URL:
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2012-12-04 22:03 PST by kkpatel
Modified: 2019-02-06 09:19 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kkpatel 2012-12-04 22:03:30 PST
I have implemented a code to get a name of html tag from webpage where user clicked.
To get tag name, I have used “hitTestContent” function. Below is the code which I used in Qt 4.8 demo browser:-

void WebView::mousePressEvent(QMouseEvent *event)
{
    m_page->m_pressedButtons = event->buttons();
    m_page->m_keyboardModifiers = event->modifiers();
    QWebView::mousePressEvent(event);
    QWebFrame *pFrame = m_page->frameAt(event->pos());
    QWebHitTestResult HitResult = pFrame->hitTestContent(event->pos());
    QWebElement WebElement = HitResult.element();

    if (!WebElement.isNull())  //Control does not enter in this loop for <span> tag
        {
            qDebug() << "Mouse Pressed:" << WebElement.localName() << WebElement.parent().localName();
        }
}

I am able to get almost all tag name when I clicked on webpage. But this code fails for <span> tag. I have checked this in Qt 4.7, but the result is same.
Comment 1 Antonio Gomes 2013-08-21 09:04:24 PDT
Do you have a test case?
Comment 2 bugmenot 2013-12-11 20:34:47 PST
I suspect this is a duplicate of bug #87341, which I hope will be fixed.

I am experiencing a problem (Qt 4.7.1) with QWebHitTestResult::element(). Whenever any TEXT is hit by the point passed to hitTestContent(), the element returned is null, even though the QWebHitTestResult::boundingRect() is correct and valid. 

Regards
Ryan Cuthbertson
Comment 3 Jocelyn Turcotte 2014-02-03 03:23:47 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.
Comment 4 Lucas Forschler 2019-02-06 09:19:02 PST
Mass move bugs into the DOM component.