[Webkit-unassigned] [Bug 55370] New: [Qt] QWebView fails to load first page with an Anchor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 28 05:50:45 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=55370

           Summary: [Qt] QWebView fails to load first page with an Anchor
           Product: WebKit
           Version: 420+
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: andy.nichols at nokia.com


If when using QWebView::setUrl() for the first time the URL contains an anchor(ex. #something) then the QWebView will fail to update.  For example:

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QWebView webView;
    webView.show();
    webView.setUrl(QUrl(QString::fromLatin1("http://doc.qt.nokia.com/4.7/qcombobox.html")));
    return a.exec();
}

will successfully update the view to display the page, while:

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QWebView webView;
    webView.show();
    webView.setUrl(QUrl(QString::fromLatin1("http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate")));
    return a.exec();
}

Will not update the webview at all.

Calling QWebView::load(QUrl(QString::fromLatin1("http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate")));
does work however, but the inconsistency of behavior when using anchors with QWebView::setUrl(...) is cause for concernt.

Also not that the following also works:
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QWebView webView;
    webView.show();
    webView.setUrl(QUrl(QString::fromLatin1("http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate")));
    webView.setUrl(QUrl(QString::fromLatin1("http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate")));
    return a.exec();
}

It is worth noting that in FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> prpFormState), WebCore/loader/FrameLoader.cpp:2077
if (shouldScrollToAnchor(isFormSubmission, policyChecker()->loadType(), newURL))
returns true for the first call to setUrl above
and false for the second.

Also, the Version of Webkit used is the one included with the Qt Master branch

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list