<?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>12720</bug_id>
          
          <creation_ts>2007-02-09 15:37:45 -0800</creation_ts>
          <short_desc>Re-defining window.location.toString function keeps re-loading forever</short_desc>
          <delta_ts>2007-03-07 12:47:44 -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>DOM</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Feng Qian">ian.eng.webkit</reporter>
          <assigned_to name="Feng Qian">ian.eng.webkit</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>24565</commentid>
    <comment_count>0</comment_count>
    <who name="Feng Qian">ian.eng.webkit</who>
    <bug_when>2007-02-09 15:37:45 -0800</bug_when>
    <thetext>Create a page with a statement:

window.location.toString = function() { return &quot;www.cnn.com&quot;; }

Open it in a new window, it keeps re-loading the page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24562</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-02-09 15:57:34 -0800</bug_when>
    <thetext>Behavior confirmed in shipping Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8N1037) and a local debug build of WebKit r19537 with the same software.

Both Firefox 2.0.0.1 and Opera 9.10 don&apos;t appear to log any errors when the test case is loaded--they just silently refuse to change the built-in function.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24550</commentid>
    <comment_count>2</comment_count>
      <attachid>13098</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-02-09 15:58:14 -0800</bug_when>
    <thetext>Created attachment 13098
Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20992</commentid>
    <comment_count>3</comment_count>
      <attachid>13417</attachid>
    <who name="Feng Qian">ian.eng.webkit</who>
    <bug_when>2007-02-27 18:41:01 -0800</bug_when>
    <thetext>Created attachment 13417
patch

The bug is caused by Location::put if the property name is a function name in the LocationTable. It does not change URL, but put() will think the URL was changed and reload the file again, and into an infinite loop. The fix just returns early when it founds the property name is in the LocationTable, but not changing URL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20993</commentid>
    <comment_count>4</comment_count>
      <attachid>13418</attachid>
    <who name="Feng Qian">ian.eng.webkit</who>
    <bug_when>2007-02-27 18:45:16 -0800</bug_when>
    <thetext>Created attachment 13418
a better test with expected output</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20995</commentid>
    <comment_count>5</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-02-27 18:50:23 -0800</bug_when>
    <thetext>This looks ok, but it might be better to mark the functions that should not be replaceable as read-only.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20935</commentid>
    <comment_count>6</comment_count>
      <attachid>13418</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-02-27 22:53:35 -0800</bug_when>
    <thetext>Comment on attachment 13418
a better test with expected output

After further consideration this fix seems ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20807</commentid>
    <comment_count>7</comment_count>
    <who name="Feng Qian">ian.eng.webkit</who>
    <bug_when>2007-03-01 12:04:51 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; This looks ok, but it might be better to mark the functions that should not be
&gt; replaceable as read-only.
&gt; 

How does ReadOnly attribute work? Will the call be returned before calling Location::put ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20275</commentid>
    <comment_count>8</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-03-06 19:30:41 -0800</bug_when>
    <thetext>Landed in r19995.

Thanks for the patch Ian.  Can you please ensure that you use spaces rather than tabs in your ChangeLog entries, and that they are consistent in formatting with other entries.  I&apos;m specifically thinking of new lines between description and file list, and the presence of the &quot;Reviewed by NOBODY&quot; line.  The latter will ensure that the patch cannot be landed unless the reviewer is added.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20277</commentid>
    <comment_count>9</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-03-06 19:44:32 -0800</bug_when>
    <thetext>I also just noticed that you forgot to include a changelog for the LayoutTests portion of your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20266</commentid>
    <comment_count>10</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-03-06 20:30:07 -0800</bug_when>
    <thetext>Not to keep going on... but the expected results you provided didn&apos;t match the test.  I updated the test in r20002 to make things pass.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20024</commentid>
    <comment_count>11</comment_count>
    <who name="Feng Qian">ian.eng.webkit</who>
    <bug_when>2007-03-07 12:47:44 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; Landed in r19995.
&gt; 
&gt; Thanks for the patch Ian.  Can you please ensure that you use spaces rather
&gt; than tabs in your ChangeLog entries, and that they are consistent in formatting
&gt; with other entries.  I&apos;m specifically thinking of new lines between description
&gt; and file list, and the presence of the &quot;Reviewed by NOBODY&quot; line.  The latter
&gt; will ensure that the patch cannot be landed unless the reviewer is added.

Thanks Mike. I will try my best to remember these style rules.

&gt; 

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>13098</attachid>
            <date>2007-02-09 15:58:14 -0800</date>
            <delta_ts>2007-02-09 15:58:14 -0800</delta_ts>
            <desc>Test case</desc>
            <filename>bug-12720-test.html</filename>
            <type>text/html</type>
            <size>83</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">PHNjcmlwdD4Kd2luZG93LmxvY2F0aW9uLnRvU3RyaW5nID0gZnVuY3Rpb24oKSB7IHJldHVybiAi
d3d3LmNubi5jb20iOyB9Cjwvc2NyaXB0Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>13417</attachid>
            <date>2007-02-27 18:41:01 -0800</date>
            <delta_ts>2007-02-27 18:45:16 -0800</delta_ts>
            <desc>patch</desc>
            <filename>bug12720.patch</filename>
            <type>text/plain</type>
            <size>1570</size>
            <attacher name="Feng Qian">ian.eng.webkit</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvYmluZGluZ3MvanMva2pzX3dpbmRvdy5jcHAKPT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g
V2ViQ29yZS9iaW5kaW5ncy9qcy9ranNfd2luZG93LmNwcAkocmV2aXNpb24gMTk4NTUpCisrKyBX
ZWJDb3JlL2JpbmRpbmdzL2pzL2tqc193aW5kb3cuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yMjE0
LDYgKzIyMTQsMTAgQEAgdm9pZCBMb2NhdGlvbjo6cHV0KEV4ZWNTdGF0ZSAqZXhlYywgY29ucwog
ICAgIGNhc2UgU2VhcmNoOgogICAgICAgdXJsLnNldFF1ZXJ5KHN0cik7CiAgICAgICBicmVhazsK
KyAgICBkZWZhdWx0OgorICAgICAgLy8gRGlzYWxsb3cgY2hhbmdpbmcgb3RoZXIgcHJvcGVydGll
cyBpbiBMb2NhdGlvblRhYm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tcmVwbGFj
ZS1mdW5jdGlvbnMuaHRtbAkocmV2aXNpb24gMCkKKysrIExheW91dFRlc3RzL2Zhc3QvZG9tL1dp
bmRvdy93aW5kb3ctbG9jYXRpb24tcmVwbGFjZS1mdW5jdGlvbnMuaHRtbAkocmV2aXNpb24gMCkK
QEAgLTAsMCArMSw3IEBACis8aHRtbD4KKzxzY3JpcHQ+d2luZG93LmxvY2F0aW9uLnRvU3RyaW5n
ID0gZnVuY3Rpb24oKSB7IHJldHVybiAiaHR0cDovL3dlYmtpdC5vcmciOyB9Cis8L3NjcmlwdD4K
Kzxib2R5PgorPHNjcmlwdD5kb2N1bWVudC53cml0ZSh3aW5kb3cubG9jYXRpb24udG9TdHJpbmco
KSk7PC9zY3JpcHQ+Cis8L2JvZHk+Cis8L2h0bWw+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>13418</attachid>
            <date>2007-02-27 18:45:16 -0800</date>
            <delta_ts>2007-02-27 22:53:35 -0800</delta_ts>
            <desc>a better test with expected output</desc>
            <filename>bug12720.patch</filename>
            <type>text/plain</type>
            <size>1900</size>
            <attacher name="Feng Qian">ian.eng.webkit</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvYmluZGluZ3MvanMva2pzX3dpbmRvdy5jcHAKPT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g
V2ViQ29yZS9iaW5kaW5ncy9qcy9ranNfd2luZG93LmNwcAkocmV2aXNpb24gMTk4NTUpCisrKyBX
ZWJDb3JlL2JpbmRpbmdzL2pzL2tqc193aW5kb3cuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yMjE0
LDYgKzIyMTQsMTAgQEAgdm9pZCBMb2NhdGlvbjo6cHV0KEV4ZWNTdGF0ZSAqZXhlYywgY29ucwog
ICAgIGNhc2UgU2VhcmNoOgogICAgICAgdXJsLnNldFF1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K
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PQotLS0gTGF5b3V0VGVzdHMvZmFzdC9kb20vV2luZG93L3dpbmRvdy1sb2NhdGlv
bi1yZXBsYWNlLWZ1bmN0aW9ucy1leHBlY3RlZC50eHQJKHJldmlzaW9uIDApCisrKyBMYXlvdXRU
ZXN0cy9mYXN0L2RvbS9XaW5kb3cvd2luZG93LWxvY2F0aW9uLXJlcGxhY2UtZnVuY3Rpb25zLWV4
cGVjdGVkLnR4dAkocmV2aXNpb24gMCkKQEAgLTAsMCArMSBAQAorWW91IHNob3VsZCBzZWUgdGhp
cy4KSW5kZXg6IExheW91dFRlc3RzL2Zhc3QvZG9tL1dpbmRvdy93aW5kb3ctbG9jYXRpb24tcmVw
bGFjZS1mdW5jdGlvbnMuaHRtbAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBMYXlvdXRUZXN0cy9mYXN0L2RvbS9X
aW5kb3cvd2luZG93LWxvY2F0aW9uLXJlcGxhY2UtZnVuY3Rpb25zLmh0bWwJKHJldmlzaW9uIDAp
CisrKyBMYXlvdXRUZXN0cy9mYXN0L2RvbS9XaW5kb3cvd2luZG93LWxvY2F0aW9uLXJlcGxhY2Ut
ZnVuY3Rpb25zLmh0bWwJKHJldmlzaW9uIDApCkBAIC0wLDAgKzEsNyBAQAorPGh0bWw+Cis8c2Ny
aXB0PndpbmRvdy5sb2NhdGlvbi50b1N0cmluZyA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gImh0dHA6
Ly93ZWJraXQub3JnIjsgfQorPC9zY3JpcHQ+Cis8Ym9keT4KK1lvdSBzaG91bGQgc2VlIHRoaXMu
Cis8L2JvZHk+Cis8L2h0bWw+Cg==
</data>
<flag name="review"
          id="5283"
          type_id="1"
          status="+"
          setter="mjs"
    />
          </attachment>
      

    </bug>

</bugzilla>