<?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>236561</bug_id>
          
          <creation_ts>2022-02-13 05:48:29 -0800</creation_ts>
          <short_desc>REGRESSION?: overflow:hidden on documentElement behaves inconsistently in iOS Safari 15.3.1</short_desc>
          <delta_ts>2022-05-24 13:24:45 -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>Scrolling</component>
          <version>Safari 15</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=199693</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=240859</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>ik</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ik</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1840979</commentid>
    <comment_count>0</comment_count>
    <who name="">ik</who>
    <bug_when>2022-02-13 05:48:29 -0800</bug_when>
    <thetext>When I set `overflow: hidden;` on documentElement and/or scrollingElement, it only prevents scrolling when the scrollTop = 0 and the Safari UI is visible.

If I scroll first, then set `overflow: hidden;`, I can scroll until scrollTop = 0 and Safari UI becomes visible - *then* it locks.

Note: Only tested this on iPad Mini, iOS 15.3.1

I think this is a regression, #153852 covers overflow on body and was marked as fixed:
https://bugs.webkit.org/show_bug.cgi?id=153852

Related tickets (regarding overflow in standalone / home screen apps):
* https://bugs.webkit.org/show_bug.cgi?id=220908
* https://bugs.webkit.org/show_bug.cgi?id=214781</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1840980</commentid>
    <comment_count>1</comment_count>
    <who name="">ik</who>
    <bug_when>2022-02-13 06:05:36 -0800</bug_when>
    <thetext>For people stumbling across this:

My current workaround after a bit of testing and weighing the pros and cons is to detect iOS and force the scrollTop = 0. This is not a solution, however, as it&apos;s going to become annoying for users very quickly when the page jumps to the top. The alternative, however, may feel even buggier.

Added bonus: Setting scrollbarGutter will prevent layout shifts when the scrollbar dis-/reappears.

// Lock
if (__isIOS) documentElement.scrollTop = 0;
http://documentElement.style.overflow = &apos;hidden&apos;;
http://documentElement.style.scrollbarGutter = &apos;stable&apos;;

// Unlock
http://documentElement.style.overflow = &apos;&apos;;
http://documentElement.style.scrollbarGutter = &apos;&apos;;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1841147</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-02-13 23:56:04 -0800</bug_when>
    <thetext>&lt;rdar://problem/88890931&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1841345</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-02-14 12:00:25 -0800</bug_when>
    <thetext>We allow scrolling when the visual viewport is smaller than the layout viewport (this is necessary to avoid getting locked in when zoomed), but we allow scrolling to the entire document. Ideally we&apos;d only allow panning around in the layout viewport.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1848051</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-03-03 13:27:47 -0800</bug_when>
    <thetext>scrollbarGutter is not implemented in WebKit so I&apos;m not sure what that has any impact.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>