<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>55370</bug_id>
          
          <creation_ts>2011-02-28 05:50:45 -0800</creation_ts>
          <short_desc>[Qt] QWebView fails to load first page with an Anchor</short_desc>
          <delta_ts>2011-03-03 08:33:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>420+</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>32723</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andy Nichols">andy.nichols</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aparna.nand</cc>
    
    <cc>benjamin</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>kling</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>359006</commentid>
    <comment_count>0</comment_count>
    <who name="Andy Nichols">andy.nichols</who>
    <bug_when>2011-02-28 05:50:45 -0800</bug_when>
    <thetext>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(&quot;http://doc.qt.nokia.com/4.7/qcombobox.html&quot;)));
    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(&quot;http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate&quot;)));
    return a.exec();
}

Will not update the webview at all.

Calling QWebView::load(QUrl(QString::fromLatin1(&quot;http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate&quot;)));
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(&quot;http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate&quot;)));
    webView.setUrl(QUrl(QString::fromLatin1(&quot;http://doc.qt.nokia.com/4.7/qcombobox.html#itemDelegate&quot;)));
    return a.exec();
}

It is worth noting that in FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr&lt;FormState&gt; prpFormState), WebCore/loader/FrameLoader.cpp:2077
if (shouldScrollToAnchor(isFormSubmission, policyChecker()-&gt;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>359031</commentid>
    <comment_count>1</comment_count>
      <attachid>84055</attachid>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-02-28 07:17:43 -0800</bug_when>
    <thetext>Created attachment 84055
Test case code</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>359781</commentid>
    <comment_count>2</comment_count>
    <who name="Aparna Nandyal">aparna.nand</who>
    <bug_when>2011-03-01 03:43:42 -0800</bug_when>
    <thetext>This bug is same as https://bugs.webkit.org/show_bug.cgi?id=32723

The root cause of the problem is same in both cases, the calls to 

d-&gt;frame-&gt;loader()-&gt;activeDocumentLoader()-&gt;writer()-&gt;begin(absolute);
d-&gt;frame-&gt;loader()-&gt;activeDocumentLoader()-&gt;writer()-&gt;end();

in QWebFrame::setUrl is causing this problem. Im looking into another bug (https://bugs.webkit.org/show_bug.cgi?id=54380) that will possibly refactor this code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>359792</commentid>
    <comment_count>3</comment_count>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-03-01 04:09:00 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 32723 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>84055</attachid>
            <date>2011-02-28 07:17:43 -0800</date>
            <delta_ts>2011-02-28 07:17:43 -0800</delta_ts>
            <desc>Test case code</desc>
            <filename>main.cpp</filename>
            <type>application/octet-stream</type>
            <size>276</size>
            <attacher name="Benjamin Poulain">benjamin</attacher>
            
              <data encoding="base64">I2luY2x1ZGUgPFF0R3VpPgojaW5jbHVkZSA8UXRXZWJLaXQ+CgppbnQgbWFpbihpbnQgYXJnYywg
Y2hhciAqYXJndltdKQp7CiAgICBRQXBwbGljYXRpb24gYShhcmdjLCBhcmd2KTsKICAgIFFXZWJW
aWV3IHdlYlZpZXc7CiAgICB3ZWJWaWV3LnNob3coKTsKICAgIHdlYlZpZXcuc2V0VXJsKFFVcmwo
UVN0cmluZzo6ZnJvbUxhdGluMSgiaHR0cDovL2RvYy5xdC5ub2tpYS5jb20vNC43L3Fjb21ib2Jv
eC5odG1sI2l0ZW1EZWxlZ2F0ZSIpKSk7CiAgICByZXR1cm4gYS5leGVjKCk7Cn0K
</data>

          </attachment>
      

    </bug>

</bugzilla>