<?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>62610</bug_id>
          
          <creation_ts>2011-06-13 16:55:14 -0700</creation_ts>
          <short_desc>WebFrame::url() should use the one true URL</short_desc>
          <delta_ts>2011-06-14 13:16:00 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Barth">abarth</reporter>
          <assigned_to name="Adam Barth">abarth</assigned_to>
          <cc>fishd</cc>
    
    <cc>viettrungluu</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>420054</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-13 16:55:14 -0700</bug_when>
    <thetext>WebFrame::url() should use the one true URL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420056</commentid>
    <comment_count>1</comment_count>
      <attachid>97034</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-13 16:56:15 -0700</bug_when>
    <thetext>Created attachment 97034
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420073</commentid>
    <comment_count>2</comment_count>
    <who name="Viet-Trung Luu">viettrungluu</who>
    <bug_when>2011-06-13 17:08:53 -0700</bug_when>
    <thetext>Thanks. You should update the comment in WebFrame.h too....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420081</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-13 17:17:39 -0700</bug_when>
    <thetext>&gt; You should update the comment in WebFrame.h too....

Silly comments.  This is WebKit!  :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420082</commentid>
    <comment_count>4</comment_count>
      <attachid>97040</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-13 17:19:13 -0700</bug_when>
    <thetext>Created attachment 97040
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420164</commentid>
    <comment_count>5</comment_count>
      <attachid>97040</attachid>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2011-06-13 19:40:15 -0700</bug_when>
    <thetext>Comment on attachment 97040
Patch

please confirm that this does not regress chromium tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420167</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2011-06-13 19:43:27 -0700</bug_when>
    <thetext>i think it would help if WebFrame.h documented that this url may not be the same as the datasource url.  that is not obvious.  we need people to understand when to use which.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420221</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-13 22:40:45 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; i think it would help if WebFrame.h documented that this url may not be the same as the datasource url.  that is not obvious.  we need people to understand when to use which.

Why would anyone want to use the datasource URL?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420494</commentid>
    <comment_count>8</comment_count>
      <attachid>97040</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-14 09:35:17 -0700</bug_when>
    <thetext>Comment on attachment 97040
Patch

I ran this patch through &quot;gcl try&quot; and got green boxes.  Let&apos;s try landing it for realz.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420502</commentid>
    <comment_count>9</comment_count>
      <attachid>97040</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-06-14 09:47:02 -0700</bug_when>
    <thetext>Comment on attachment 97040
Patch

Clearing flags on attachment: 97040

Committed r88812: &lt;http://trac.webkit.org/changeset/88812&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420503</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-06-14 09:47:06 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420552</commentid>
    <comment_count>11</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2011-06-14 10:41:42 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; i think it would help if WebFrame.h documented that this url may not be the same as the datasource url.  that is not obvious.  we need people to understand when to use which.
&gt; 
&gt; Why would anyone want to use the datasource URL?

Hmm, well... I&apos;m not sure.  Maybe it is useful if you want to see what URL was used to generate the document initially?  Are you saying that we should remove it?  I think it will be hard to remove WebURLRequest::url(), so we are left with the possibility for confusion between WebFrame::url() and WebDataSource::request().url().

The previous API had them as equivalents.  Now, they are different, and yet the documentation leaves this unclear.  Have you checked the chromium codebase to see who is using WebDataSource::request().url() versus WebFrame::url()?  Maybe there are some subtle issues that will result from making them different that are not covered by tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420553</commentid>
    <comment_count>12</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2011-06-14 10:42:58 -0700</bug_when>
    <thetext>By the way, I would have preferred to see WebFrame::url() removed in favor of adding WebDocument::url().  That may help make the distinction more clear between these two URLs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420556</commentid>
    <comment_count>13</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2011-06-14 10:43:40 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; By the way, I would have preferred to see WebFrame::url() removed in favor of adding WebDocument::url().  That may help make the distinction more clear between these two URLs.

I used the past tense improperly.  &quot;I now prefer&quot; ... sorry for not thinking this through so well back when I first reviewed the change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420576</commentid>
    <comment_count>14</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-14 11:01:30 -0700</bug_when>
    <thetext>&gt; Hmm, well... I&apos;m not sure.  Maybe it is useful if you want to see what URL was used to generate the document initially?  Are you saying that we should remove it?  I think it will be hard to remove WebURLRequest::url(), so we are left with the possibility for confusion between WebFrame::url() and WebDataSource::request().url().

I&apos;m not sure there are any use cases for looking at that URL.  I suspect any code that does so is wrong ins some obscure cases.

&gt; The previous API had them as equivalents.  Now, they are different, and yet the documentation leaves this unclear.

Which documentation?  I removed the comment in WebFrame.h.  There&apos;s no reason they&apos;re related at all.

&gt; Have you checked the chromium codebase to see who is using WebDataSource::request().url() versus WebFrame::url()?

Nope, but I see lots of confused code in ContentSettings.  It&apos;s confused in this way and a bunch of other ways.

&gt; Maybe there are some subtle issues that will result from making them different that are not covered by tests?

I&apos;m not sure I understand where you&apos;re coming from.  The URL of the document is a function of the DOM.  Anything related to WebURLRequest is related to the network stack.  There&apos;s no necessary connection between the network stack and the DOM.  Any connection that might exist is an implementation detail of WebKit and not something the embedder should know about.

&gt; By the way, I would have preferred to see WebFrame::url() removed in favor of adding WebDocument::url().  That may help make the distinction more clear between these two URLs.

Ok.  I&apos;m happy to remove any APIs on WebFrame that relate to the document and force them all to go through WebDocument.  That&apos;s what we&apos;ve been doing internally in WebCore for a while now.  In principle, WebFrame shouldn&apos;t know anything about the contained document except which document it contains.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420664</commentid>
    <comment_count>15</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2011-06-14 12:48:43 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; &gt; Hmm, well... I&apos;m not sure.  Maybe it is useful if you want to see what URL was used to generate the document initially?  Are you saying that we should remove it?  I think it will be hard to remove WebURLRequest::url(), so we are left with the possibility for confusion between WebFrame::url() and WebDataSource::request().url().
&gt; 
&gt; I&apos;m not sure there are any use cases for looking at that URL.  I suspect any code that does so is wrong ins some obscure cases.

Probably so.


&gt; &gt; The previous API had them as equivalents.  Now, they are different, and yet the documentation leaves this unclear.
&gt; 
&gt; Which documentation?  I removed the comment in WebFrame.h.  There&apos;s no reason they&apos;re related at all.

I meant the _lack of_ documentation leaves this unclear.  One might guess that the two URLs are the same thing.

 
&gt; &gt; Have you checked the chromium codebase to see who is using WebDataSource::request().url() versus WebFrame::url()?
&gt; 
&gt; Nope, but I see lots of confused code in ContentSettings.  It&apos;s confused in this way and a bunch of other ways.
&gt; 
&gt; &gt; Maybe there are some subtle issues that will result from making them different that are not covered by tests?
&gt; 
&gt; I&apos;m not sure I understand where you&apos;re coming from.  The URL of the document is a function of the DOM.  Anything related to WebURLRequest is related to the network stack.  There&apos;s no necessary connection between the network stack and the DOM.  Any connection that might exist is an implementation detail of WebKit and not something the embedder should know about.

Maybe this change will only have the function of fixing bugs.  Or, maybe it will introduce some subtle regression?  I can&apos;t tell.


&gt; &gt; By the way, I would have preferred to see WebFrame::url() removed in favor of adding WebDocument::url().  That may help make the distinction more clear between these two URLs.
&gt; 
&gt; Ok.  I&apos;m happy to remove any APIs on WebFrame that relate to the document and force them all to go through WebDocument.  That&apos;s what we&apos;ve been doing internally in WebCore for a while now.  In principle, WebFrame shouldn&apos;t know anything about the contained document except which document it contains.

Yeah, I think moving it to WebDocument will be a win in many regards.  It makes it self-documenting that it is the URL of the document.  One can see the connection to the DOM spec if they are unsure.  It also makes the relationship to WebDataSource::request().url() more distant.  The WebDocument doesn&apos;t have a WebDataSource.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420684</commentid>
    <comment_count>16</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-06-14 13:16:00 -0700</bug_when>
    <thetext>OK.  Will do.  Thanks.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>97034</attachid>
            <date>2011-06-13 16:56:15 -0700</date>
            <delta_ts>2011-06-13 17:19:10 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-62610-20110613165614.patch</filename>
            <type>text/plain</type>
            <size>1270</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQvY2hyb21pdW0vQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNv
dXJjZS9XZWJLaXQvY2hyb21pdW0vQ2hhbmdlTG9nCShyZXZpc2lvbiA4ODczMykKKysrIFNvdXJj
ZS9XZWJLaXQvY2hyb21pdW0vQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYg
QEAKKzIwMTEtMDYtMTMgIEFkYW0gQmFydGggIDxhYmFydGhAd2Via2l0Lm9yZz4KKworICAgICAg
ICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBXZWJGcmFtZTo6dXJsKCkg
c2hvdWxkIHVzZSB0aGUgb25lIHRydWUgVVJMCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQu
b3JnL3Nob3dfYnVnLmNnaT9pZD02MjYxMAorCisgICAgICAgIFRoZSBEb2N1bWVudCdzIFVSTCBp
cyB0aGUgb25lIHRydWUgVVJMLiAgVGhvdSBzaGFsdCBoYXZlIG5vIFVSTHMgYmVmb3JlCisgICAg
ICAgIERvY3VtZW50Ojp1cmwoKS4KKworICAgICAgICAqIHNyYy9XZWJGcmFtZUltcGwuY3BwOgor
ICAgICAgICAoV2ViS2l0OjpXZWJGcmFtZUltcGw6OnVybCk6CisKIDIwMTEtMDYtMTMgIERtaXRy
eSBMb21vdiAgPGRzbG9tb3ZAZ29vZ2xlLmNvbT4KIAogICAgICAgICBSZXZpZXdlZCBieSBBZGFt
IEJhcnRoLgpJbmRleDogU291cmNlL1dlYktpdC9jaHJvbWl1bS9zcmMvV2ViRnJhbWVJbXBsLmNw
cAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2ViS2l0L2Nocm9taXVtL3NyYy9XZWJGcmFtZUltcGwu
Y3BwCShyZXZpc2lvbiA4ODczMSkKKysrIFNvdXJjZS9XZWJLaXQvY2hyb21pdW0vc3JjL1dlYkZy
YW1lSW1wbC5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTUxOSwxMCArNTE5LDcgQEAgbG9uZyBsb25n
IFdlYkZyYW1lSW1wbDo6aWRlbnRpZmllcigpIGNvbgogCiBXZWJVUkwgV2ViRnJhbWVJbXBsOjp1
cmwoKSBjb25zdAogewotICAgIGNvbnN0IFdlYkRhdGFTb3VyY2UqIGRzID0gZGF0YVNvdXJjZSgp
OwotICAgIGlmICghZHMpCi0gICAgICAgIHJldHVybiBXZWJVUkwoKTsKLSAgICByZXR1cm4gZHMt
PnJlcXVlc3QoKS51cmwoKTsKKyAgICByZXR1cm4gbV9mcmFtZS0+ZG9jdW1lbnQoKS0+dXJsKCk7
CiB9CiAKIFdlYlZlY3RvcjxXZWJJY29uVVJMPiBXZWJGcmFtZUltcGw6Omljb25VUkxzKGludCBp
Y29uVHlwZXMpIGNvbnN0Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>97040</attachid>
            <date>2011-06-13 17:19:13 -0700</date>
            <delta_ts>2011-06-14 09:47:02 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-62610-20110613171912.patch</filename>
            <type>text/plain</type>
            <size>1928</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQvY2hyb21pdW0vQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNv
dXJjZS9XZWJLaXQvY2hyb21pdW0vQ2hhbmdlTG9nCShyZXZpc2lvbiA4ODczMykKKysrIFNvdXJj
ZS9XZWJLaXQvY2hyb21pdW0vQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYg
QEAKKzIwMTEtMDYtMTMgIEFkYW0gQmFydGggIDxhYmFydGhAd2Via2l0Lm9yZz4KKworICAgICAg
ICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBXZWJGcmFtZTo6dXJsKCkg
c2hvdWxkIHVzZSB0aGUgb25lIHRydWUgVVJMCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQu
b3JnL3Nob3dfYnVnLmNnaT9pZD02MjYxMAorCisgICAgICAgIFRoZSBEb2N1bWVudCdzIFVSTCBp
cyB0aGUgb25lIHRydWUgVVJMLiAgVGhvdSBzaGFsdCBoYXZlIG5vIFVSTHMgYmVmb3JlCisgICAg
ICAgIERvY3VtZW50Ojp1cmwoKS4KKworICAgICAgICAqIHNyYy9XZWJGcmFtZUltcGwuY3BwOgor
ICAgICAgICAoV2ViS2l0OjpXZWJGcmFtZUltcGw6OnVybCk6CisKIDIwMTEtMDYtMTMgIERtaXRy
eSBMb21vdiAgPGRzbG9tb3ZAZ29vZ2xlLmNvbT4KIAogICAgICAgICBSZXZpZXdlZCBieSBBZGFt
IEJhcnRoLgpJbmRleDogU291cmNlL1dlYktpdC9jaHJvbWl1bS9wdWJsaWMvV2ViRnJhbWUuaAo9
PT09PT09PT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JGcmFtZUltcGwuY3BwCSh3b3JraW5nIGNvcHkp
CkBAIC01MTksMTAgKzUxOSw3IEBAIGxvbmcgbG9uZyBXZWJGcmFtZUltcGw6OmlkZW50aWZpZXIo
KSBjb24KIAogV2ViVVJMIFdlYkZyYW1lSW1wbDo6dXJsKCkgY29uc3QKIHsKLSAgICBjb25zdCBX
ZWJEYXRhU291cmNlKiBkcyA9IGRhdGFTb3VyY2UoKTsKLSAgICBpZiAoIWRzKQotICAgICAgICBy
ZXR1cm4gV2ViVVJMKCk7Ci0gICAgcmV0dXJuIGRzLT5yZXF1ZXN0KCkudXJsKCk7CisgICAgcmV0
dXJuIG1fZnJhbWUtPmRvY3VtZW50KCktPnVybCgpOwogfQogCiBXZWJWZWN0b3I8V2ViSWNvblVS
TD4gV2ViRnJhbWVJbXBsOjppY29uVVJMcyhpbnQgaWNvblR5cGVzKSBjb25zdAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>