<?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>210009</bug_id>
          
          <creation_ts>2020-04-04 13:01:53 -0700</creation_ts>
          <short_desc>window.innerHeight is broken in WKWebView with viewport-fit=cover</short_desc>
          <delta_ts>2025-11-18 11:04:27 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Local Build</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=254868</see_also>
          <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>evangun2001</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>f.miguel.r.oliveira</cc>
    
    <cc>hi</cc>
    
    <cc>ik</cc>
    
    <cc>schauerte</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>xtassin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1637728</commentid>
    <comment_count>0</comment_count>
    <who name="">evangun2001</who>
    <bug_when>2020-04-04 13:01:53 -0700</bug_when>
    <thetext>When `viewport-fit=cover` is used in Cordova with the WKWebView plugin, `window.innerHeight` reports a wrong value.
Instead of reporting the proper window height, it reports the window height MINUS the safe areas insets.

Even a minimalistic snippet will demonstrate the issue: https://gist.github.com/louisameline/d5ae03b07db8185051346b8da55a2704

The issue happens only if the content of the page is smaller in height than the window height.
Exemple: if my iPhone window is 812px high, and the &quot;natural height&quot; of my page is 500, `window.innerHeight` returns 734 (= 812 - 44 top safe area inset - 34 bottom safe area inset). If my page content is 750px high, `window.innerHeight` returns 750, and if my page content overflows the window, `window.innerHeight` returns 812.

Additional notes:
- The `window.innerHeight` value is not longer false after a rotation of the screen
- The bug does not happen in Chrome, Safari, UIWebView, Ionic WKWebView, Capacitor
- It was previously brought to the Cordova team, who suggested to report it here: https://github.com/apache/cordova-plugin-wkwebview-engine/issues/108

Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1637732</commentid>
    <comment_count>1</comment_count>
    <who name="">evangun2001</who>
    <bug_when>2020-04-04 13:05:30 -0700</bug_when>
    <thetext>Tested on iPhone XS, iOS 13.4, Xcode 11.4, cordova-ios 5.1.1, cordova-plugin-wkwebview-engine 1.2.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638463</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-04-06 22:55:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/61378008&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851826</commentid>
    <comment_count>3</comment_count>
    <who name="">ik</who>
    <bug_when>2022-03-16 08:39:44 -0700</bug_when>
    <thetext>This also affects standalone web apps, see https://bugs.webkit.org/show_bug.cgi?id=237961</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>