<?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>37694</bug_id>
          
          <creation_ts>2010-04-15 20:46:50 -0700</creation_ts>
          <short_desc>[Qt] Issue with using QWebPage::setLinkDelegationPolicy...</short_desc>
          <delta_ts>2010-05-08 06:31:27 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Dawit A.">adawit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>jturcotte</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>213190</commentid>
    <comment_count>0</comment_count>
    <who name="Dawit A.">adawit</who>
    <bug_when>2010-04-15 20:46:50 -0700</bug_when>
    <thetext>Clicking on the type of links shown below completely renders QWebPage::setLinkDelegationPolicy(QWebPage::DelegateAllLinks) calls useless:

&lt;a href=&quot;javascript:window.location=&apos;http://qt.nokia.com&apos;&quot;&gt;Click me&lt;/a&gt;

When you click on a link like the one above, you will never receive the linkClicked signal. Instead the click will be treated as a non-click event and handled internally as if the default QWebPage::DontDelegateLinks is set. I guess this happens because the click triggers the execution of a javascript code which might do things other than making navigation requests. Regardless, the setLinkDelegationPolicy should mention this issue or perhaps there should be another NavigationType, QWebPage::NavigationTypeJavascript ???</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221713</commentid>
    <comment_count>1</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-06 09:02:45 -0700</bug_when>
    <thetext>In this case it is hard to know if the navigation was trigger by a user action from other types of events, so linkClicked cannot fit reliably.

A NavigationTypeJavascript might make sense if you cannot rely on re-implementing acceptNavigationRequest listening for NavigationTypeOther requests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221724</commentid>
    <comment_count>2</comment_count>
    <who name="Dawit A.">adawit</who>
    <bug_when>2010-05-06 09:25:14 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; In this case it is hard to know if the navigation was trigger by a user action
&gt; from other types of events, so linkClicked cannot fit reliably.
&gt; 
&gt; A NavigationTypeJavascript might make sense if you cannot rely on
&gt; re-implementing acceptNavigationRequest listening for NavigationTypeOther
&gt; requests.

Unfortunately that is the case. That is one cannot rely on the meaning of NavigationTypeOther since there is no way you can distinguish that from say a call that originated from QWebView::load(...). :( 

After opening this bug report I took a look at the Qtwebkit source code and realized that this issue is actually the result of QtWebKit directly relying on the navigation types present in WebKit. All the Navigation types in QtWebKit are an exact equivalent right down to the name of the ones that exist in WebKit ; so the problem I guess is beyond just QtWebKit. 

Anyhow, I guess I have to come up with yet another hack to distinguish between requests that originate from a user clicking on a javascript link and those that originated from other means. In the meantime could this perhaps be clearly documented in the API ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222253</commentid>
    <comment_count>3</comment_count>
      <attachid>55353</attachid>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-07 02:58:21 -0700</bug_when>
    <thetext>Created attachment 55353
Document the limitation

How about that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222294</commentid>
    <comment_count>4</comment_count>
      <attachid>55353</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-05-07 05:43:41 -0700</bug_when>
    <thetext>Comment on attachment 55353
Document the limitation


&gt; +    \note This signal possibly won&apos;t be emitted for clicked links which use
&gt; +    JavaScript to trigger navigation.

I don&apos;t like the &apos;possibly&apos;

\note The signal will not be emitted for navigation triggered by JavaScript, such as ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222877</commentid>
    <comment_count>5</comment_count>
      <attachid>55353</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-05-08 06:31:22 -0700</bug_when>
    <thetext>Comment on attachment 55353
Document the limitation

Clearing flags on attachment: 55353

Committed r59026: &lt;http://trac.webkit.org/changeset/59026&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222878</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-05-08 06:31:27 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>55353</attachid>
            <date>2010-05-07 02:58:21 -0700</date>
            <delta_ts>2010-05-08 06:31:22 -0700</delta_ts>
            <desc>Document the limitation</desc>
            <filename>linkclicked_doc.patch</filename>
            <type>text/plain</type>
            <size>965</size>
            <attacher name="Jocelyn Turcotte">jturcotte</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdC9xdC9BcGkvcXdlYnBhZ2UuY3BwIGIvV2ViS2l0L3F0L0FwaS9x
d2VicGFnZS5jcHAKaW5kZXggYzlmYzIxMC4uNDYxOGUwNiAxMDA2NDQKLS0tIGEvV2ViS2l0L3F0
L0FwaS9xd2VicGFnZS5jcHAKKysrIGIvV2ViS2l0L3F0L0FwaS9xd2VicGFnZS5jcHAKQEAgLTM0
OTUsNiArMzQ5NSw5IEBAIHF1aW50NjQgUVdlYlBhZ2U6OmJ5dGVzUmVjZWl2ZWQoKSBjb25zdAog
CiAgICA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