This bug report originated from issue QTBUG-3889 <http://bugreports.qt.nokia.com/browse/QTBUG-3889> --- Description --- QWebFrame: When a relative url is loaded then it will make it absolute internally, however this strips out any query/fragments
Created attachment 50712 [details] Testcase
Reproduced with r55986.
Reproduced on Snow Leopard with Qt 4.7 trunk (HEAD 03f8f1df0d88f5ffe0b3120cffce614cbeefdb70) and WebKit trunk (r59155).
Created attachment 82506 [details] Patch for review In function ensureAbsoluteUrl, call is made to QUrl::toLocalFile() which strips the query, fragment part out. Patch corrects this to resolve it before returning absolute url.
Comment on attachment 82506 [details] Patch for review Needs a test. :)
(In reply to comment #5) > (From update of attachment 82506 [details]) > Needs a test. :) Kling as discussed yesterday, I am able to write an automation test. The patch can get tested only when a relative url is passed to QWebView. But the way automation test framework is designed, the test html files are stored in resources directory and an absolute path like qrc:///resources/local.html needs to be passed. When this is passed, the code that needs to be tested is not hit. Tested the below code by passing relative url and it works fine. void tst_QWebView::loadRelativeUrl() { QWebView view; QSignalSpy spy(view.page(), SIGNAL(loadFinished(bool))); // This is the line that should be in the final test. But its absolute path // QUrl url("qrc:///resources/local.html"); // This url actually tests the patch QUrl url("local.html"); url.setFragment("Overview"); view.load(url); ::waitForSignal(&view, SIGNAL(loadFinished(bool))); QCOMPARE(spy.count(), 1); QUrl loadedUrl = view.page()->mainFrame()->url(); QVERIFY(loadedUrl.hasFragment()); } Any suggestions to get around this problem.
Comment on attachment 82506 [details] Patch for review Clearing flags on attachment: 82506 Committed r78688: <http://trac.webkit.org/changeset/78688>
All reviewed patches have been landed. Closing bug.