<?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>290146</bug_id>
          
          <creation_ts>2025-03-20 18:08:27 -0700</creation_ts>
          <short_desc>View Transitions Don&apos;t Pick up view-transition-name if CSS is loaded at the same time</short_desc>
          <delta_ts>2025-03-31 11:30:12 -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>CSS</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sebastian Markbåge">sebastian</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bramus</cc>
    
    <cc>karlcow</cc>
    
    <cc>koivisto</cc>
    
    <cc>mattwoodrow</cc>
    
    <cc>ntim</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2104824</commentid>
    <comment_count>0</comment_count>
    <who name="Sebastian Markbåge">sebastian</who>
    <bug_when>2025-03-20 18:08:27 -0700</bug_when>
    <thetext>https://repro-view-transition-reflow-bug.vercel.app

When a new link tag is inserted with a previously uncached CSS, this prevents the `view-transition-name` from getting picked up until there&apos;s some other layout event. If it&apos;s done at the same time as `startViewTransition` is called, then there hasn&apos;t been a layout calculation yet when the &quot;old&quot; snapshot is computed. This leads the &quot;old&quot; name not to get picked up.

The second time you load the repro the CSS might be cached and it works again. Therefore it&apos;s easiest to repro with caching turned off.

If you add something that forces layout like `clientWidth` then it works correctly. Even if the CSS isn&apos;t cached.

It seems like `startViewTransition` should itself force layout calculation before it takes the snapshot.

Reproduces on STP Release 215 (Safari 18.4, WebKit 20622.1.6.111.4) and iOS 18.4 Beta 4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2104839</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-03-20 18:56:41 -0700</bug_when>
    <thetext>Thanks Sebastian for the report. 
Safari Technology Preview  125/18.4          20622.1.6
Firefox Nightly            138.0a1       13825.3.11
Google Chrome Canary       136.0.7080.0  7080.0

Safari: indeed with cache disabled, doesn&apos;t pick up the smooth transition. It goes directly from Old to New
Chrome: Cache disabled too. Show the smooth transition
Firefox: Doesn&apos;t have it, stays on old.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2106665</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-03-27 18:09:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/148067360&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>