<?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>227474</bug_id>
          
          <creation_ts>2021-06-28 19:44:46 -0700</creation_ts>
          <short_desc>history pushState and replaceState do not work if iframe src changed</short_desc>
          <delta_ts>2021-07-05 19:45:17 -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>History</component>
          <version>Safari 14</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>richy.liu.2002</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>beidson</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1773307</commentid>
    <comment_count>0</comment_count>
      <attachid>432448</attachid>
    <who name="">richy.liu.2002</who>
    <bug_when>2021-06-28 19:44:46 -0700</bug_when>
    <thetext>Created attachment 432448
minimal working example

Calling history.pushState or history.replaceState in an iframe whose src was changed has no effect. These functions do work correctly when the iframe&apos;s src was not changed, or if they are not in an iframe at all. Calling pushState after the iframe loads but before the pushState in the iframe is called seems to fix the issue.

To reproduce the issue, unzip the attached zip which contains index.html and embed.html. Open index.html. It will load embed.html into an iframe. Open the console and click &apos;push history&apos; under &apos;frame 2 (src change)&apos;. See that history.length does not change. Then click &apos;push history&apos; under &apos;frame 1 (no src change)&apos;. See that history.length does change.

Replicated on Safari 14.1.1, latest WebKit (r279353), and iOS Safari on iOS 14.6. Firefox and Chrome do not have this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1774888</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-07-05 19:45:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/80190653&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>432448</attachid>
            <date>2021-06-28 19:44:46 -0700</date>
            <delta_ts>2021-06-28 19:44:46 -0700</delta_ts>
            <desc>minimal working example</desc>
            <filename>test_case.zip</filename>
            <type>application/zip</type>
            <size>867</size>
            <attacher>richy.liu.2002</attacher>
            
              <data encoding="base64">UEsDBBQAAAAIAEWZ3FJsVIzvTQEAAMsCAAAKABwAaW5kZXguaHRtbFVUCQADAoHaYEGB2mB1eAsA
AQT1AQAABBQAAACNUkFPgzAYvfsrPuuhkBkIuw4wUZfoSRO9eFqgfEC1tAt8LJJl/126jmUzxuxA
+uC9773X0vj68eXh/eN1CTU1Kr2K3QIQ15gVFoyQJClM876KQwctH06CODfFcFAWcuOQNYjSss0a
hAg8baBrBYg60xX642x0lEknkkXC9ihiVpowbHIsAluHpXHoVIeU8Bjzd+AcvEvT5pemOdyJVq5p
ciuM6BvUFFRIS4UW3g/PhcedNfcDW2OWAL/Zd5G6WlGNq75VfHEwnxzda94TGQ1GCyXFV8LWfVc/
yY5MO3g+S8dzJJAaXD8fLA214+PQDaenTYGGNSaM8JvCz2yTua9s2kDZa0FyDDzLge2BBhBGd0Zh
oEzl8RxL0yJwmE2ZgUJdUe0vjgMTYQ3fKCP0trtb4Hx87kpj+In0zDsrCdv/rHe/zstid/HG/7u/
sz9QSwMEFAAAAAgAtZncUpjtS27YAAAAfQEAAAoAHABlbWJlZC5odG1sVVQJAA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