<?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>80697</bug_id>
          
          <creation_ts>2012-03-09 04:37:02 -0800</creation_ts>
          <short_desc>Broken behavior for back-button after history.pushState() + location.replace()</short_desc>
          <delta_ts>2020-06-19 11:01:46 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Sean Hogan">shogun70</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aroben</cc>
    
    <cc>beidson</cc>
    
    <cc>bugzilla</cc>
    
    <cc>fishd</cc>
    
    <cc>josh</cc>
    
    <cc>shogun70</cc>
    
    <cc>timdream</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>574811</commentid>
    <comment_count>0</comment_count>
    <who name="Sean Hogan">shogun70</who>
    <bug_when>2012-03-09 04:37:02 -0800</bug_when>
    <thetext>To reproduce:

1. Navigate to http://www.webkit.org/
2. Open the Javascript console and enter the following

    history.pushState({}, null, &quot;/blog/&quot;);

The address-bar now says http://www.webkit.org/blog/, but the page hasn&apos;t changed (expected behavior).

3. Now enter the following

    location.replace(&quot;/blog/&quot;);

The address-bar now says http://www.webkit.org/blog/, and the page reflects this.

4. Press the back-button. The address-bar now says http://www.webkit.org/, but the page hasn&apos;t changed from the &quot;/blog/&quot; contents.

This behavior is also observed in up-to-date Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>575488</commentid>
    <comment_count>1</comment_count>
    <who name="Sean Hogan">shogun70</who>
    <bug_when>2012-03-10 02:38:25 -0800</bug_when>
    <thetext>The same broken behavior is also exhibited if step 3 is:

    location.reload()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607151</commentid>
    <comment_count>2</comment_count>
    <who name="Sean Hogan">shogun70</who>
    <bug_when>2012-04-20 23:04:09 -0700</bug_when>
    <thetext>A work-around for this issue is to replace step #3 with:

    history.replaceState({}, null, currentURL);
    location.replace(nextURL);

where 
    currentURL = &quot;http://www.webkit.org/&quot; or &quot;/&quot; 
    nextURL = &quot;/blog/&quot;

for the demo given above. 

This work-around can cause a flash of the currentURL in the address bar, and it seems bizarre that this should work while the straight-forward code path fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607336</commentid>
    <comment_count>3</comment_count>
    <who name="Sean Hogan">shogun70</who>
    <bug_when>2012-04-22 05:26:09 -0700</bug_when>
    <thetext>An almost satisfactory work-around for this issue is to replace step #3 with:

    history.replaceState({}, null, &quot;#&quot;);
    location.replace(&quot;&quot;);

I guess this indicates that identified bug is only an issue when `location.replace(url)` is the precise equivalent of `location.reload()` (and there has been a previous invocation of `history.pushState`.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>982349</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2014-02-19 07:48:26 -0800</bug_when>
    <thetext>*** Bug 93506 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>982350</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2014-02-19 07:49:57 -0800</bug_when>
    <thetext>See https://bugs.webkit.org/show_bug.cgi?id=93506 for a live test case.

AFAICT this behavior disagrees with the spec and with Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1664423</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-06-19 11:01:46 -0700</bug_when>
    <thetext>&lt;rdar://problem/64537409&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>