<?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>316345</bug_id>
          
          <creation_ts>2026-06-04 15:08:29 -0700</creation_ts>
          <short_desc>[Site Isolation] Form state in nested frames is lost when restoring from back/forward cache with UseUIProcessForBackForwardItemLoading</short_desc>
          <delta_ts>2026-06-05 10:35:23 -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 Misc.</component>
          <version>WebKit 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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Basuke Suzuki">basuke</reporter>
          <assigned_to name="Basuke Suzuki">basuke</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2217751</commentid>
    <comment_count>0</comment_count>
    <who name="Basuke Suzuki">basuke</who>
    <bug_when>2026-06-04 15:08:29 -0700</bug_when>
    <thetext>When UseUIProcessForBackForwardItemLoading is enabled under Site Isolation (as it is in production via WebProcessPool::createWebPage), restoring a page that contains nested frames from the back/forward cache leaves the nested frames inaccessible: their contentDocument is null, so form state stored in nested frames is lost.

Reproduced by fast/loader/site-isolation/form-state-restore-with-frames.html once UseUIProcessForBackForwardItemLoading is coupled to Site Isolation in WebKitTestRunner. The test deterministically fails (5/5) with:
  FAIL frame$($(&quot;frame1&quot;), &quot;input2&quot;).value should be value2. Threw exception TypeError: null is not an object
  FAIL frame$(frame$($(&quot;frame1&quot;), &quot;frame2&quot;), &quot;input3&quot;).value should be value3. Threw exception TypeError: null is not an object (evaluating &apos;frame.contentDocument&apos;)

This was previously masked because the layout-test harness did not actually enable UseUIProcessForBackForwardItemLoading under Site Isolation: WebKitTestRunner&apos;s per-test preference reset clobbered the product&apos;s auto-enable (see bug 316344). Coupling the flag in the harness surfaces the underlying restoration defect.

EWS on the draft may reveal additional tests affected by the same root cause.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2217755</commentid>
    <comment_count>1</comment_count>
    <who name="Basuke Suzuki">basuke</who>
    <bug_when>2026-06-04 15:11:47 -0700</bug_when>
    <thetext>&lt;rdar://problem/178762633&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2217756</commentid>
    <comment_count>2</comment_count>
    <who name="Basuke Suzuki">basuke</who>
    <bug_when>2026-06-04 15:12:06 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/66494</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2218053</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-06-05 10:35:21 -0700</bug_when>
    <thetext>Committed 314648@main (1cff9b97d680): &lt;https://commits.webkit.org/314648@main&gt;

Reviewed commits have been landed. Closing PR #66494 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>