<?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>300523</bug_id>
          
          <creation_ts>2025-10-10 14:21:29 -0700</creation_ts>
          <short_desc>REGRESSION (iOS 26): Safari on iPhones with Dynamic Island shifts the viewport upward when scrolling or closing the keyboard</short_desc>
          <delta_ts>2025-10-10 16:01:49 -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>Layout and Rendering</component>
          <version>Safari 26</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 26</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>oleksii.pokhylyi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2150060</commentid>
    <comment_count>0</comment_count>
    <who name="">oleksii.pokhylyi</who>
    <bug_when>2025-10-10 14:21:29 -0700</bug_when>
    <thetext>On iPhones with the Dynamic Island (tested on iPhone 15 Pro, iOS 26), Safari incorrectly calculates the visual viewport height after rendering or after the on-screen keyboard closes. The visible area slightly shifts upward (by a few pixels), causing fixed or sticky headers to move into the safe area under the Dynamic Island.

This behavior does not occur on older iPhones without the Dynamic Island (e.g., iPhone 13 Pro Max on iOS 18).

Steps to reproduce:
1. Open website with a fixed or sticky header (example: https://www.florasweets.de)
2. Scroll down and up several times, or open and close an input field (triggering the keyboard)
3. Observe that after closing the keyboard or re-rendering, the header area shifts upward into the safe-area zone.

Expected behavior:
The visual viewport should remain stable, respecting the safe-area-inset-top and keeping fixed/sticky elements aligned with the visible viewport edge.

Actual behavior:
Safari miscalculates the top offset and repositions the visual viewport, pushing content into the safe-area region under the Dynamic Island.

Reproducible: Always (100%) on iPhone 15 Pro with iOS 26  
Not reproducible on iPhone 13 Pro Max, iOS 18.  

Additional notes:

viewport-fit=cover and viewport-fit=contain do not fix the issue.

Applying env(safe-area-inset-top) padding or JS recalculations (window.visualViewport) doesn’t solve it either.

The issue seems to be related to how WebKit recalculates the layout viewport after changes to system UI (Dynamic Island expansion or keyboard close).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2150070</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-10-10 14:51:10 -0700</bug_when>
    <thetext>&lt;rdar://problem/162396204&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2150088</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2025-10-10 16:01:49 -0700</bug_when>
    <thetext>Please test the iOS 26.1 beta, where this should be fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>