<?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>244232</bug_id>
          
          <creation_ts>2022-08-22 19:13:48 -0700</creation_ts>
          <short_desc>overscroll-behavior: none doesn&apos;t prevent overscroll when page is too small to scroll</short_desc>
          <delta_ts>2023-01-23 11:18:32 -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>Scrolling</component>
          <version>Other</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Kurt Revis">krevis</reporter>
          <assigned_to name="Nikos Mouchtaris">nmouchtaris</assigned_to>
          <cc>karlcow</cc>
    
    <cc>nmouchtaris</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1893136</commentid>
    <comment_count>0</comment_count>
    <who name="Kurt Revis">krevis</who>
    <bug_when>2022-08-22 19:13:48 -0700</bug_when>
    <thetext>When a document has overscroll-behavior: none, but the page&apos;s height is too small to be scrollable, the page can still be overscrolled using a touch (iOS) or trackpad scroll (iOS, Mac).

Steps:
1. Load attached html file in Safari Technical Preview 151 on macOS 12, or Safari on iOS/iPadOS 16 beta, or Safari in macOS 13 beta
2. On Mac, scroll up and down using two-finger scroll gesture on trackpad.
3. On iPhone, scroll up and down with touch.
4. On iPad, scroll up and down with touch, or with two-finger scroll gesture on trackpad, or with mouse wheel.

Expected: Since the html and body elements have `overscroll-behavior: none`, overscroll aka &quot;bouncing&quot; should not happen.
Actual: Overscroll aka &quot;bouncing&quot; does happen. If you click on the element that increases the body height, so scrolling is possible, then overscroll stops working.

Notes:

Both Chrome and Firefox behave as expected. (Chrome 104.0.5112.101 and Firefox 103.0.2 on macOS 12.5.1.)

The Overscroll Behavior spec says, about overscroll-behavior: none, that &quot;this element must also not perform local boundary default actions such as showing any overscroll affordances&quot;. 
https://drafts.csswg.org/css-overscroll/#valdef-overscroll-behavior-none

Also, &quot;If a scroll container has no potential to scroll, because it does not overflow in the direction of the scroll, the element is always considered to be at the scroll boundary.&quot;
https://drafts.csswg.org/css-overscroll/#scroll-boundary

Nothing in the spec appears to say that the overscroll-behavior should be ignored in this case. 

There&apos;s an existing bug with a similar complaint:  https://bugs.webkit.org/show_bug.cgi?id=243452
but this case is simpler, with no nested scroll views, just a simple document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1893137</commentid>
    <comment_count>1</comment_count>
      <attachid>461811</attachid>
    <who name="Kurt Revis">krevis</who>
    <bug_when>2022-08-22 19:15:13 -0700</bug_when>
    <thetext>Created attachment 461811
Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1893138</commentid>
    <comment_count>2</comment_count>
    <who name="Kurt Revis">krevis</who>
    <bug_when>2022-08-22 19:19:52 -0700</bug_when>
    <thetext>I&apos;m suspicious of this code in WebCore/page/FrameView.cpp:

OverscrollBehavior FrameView::verticalOverscrollBehavior()  const
{
    auto* document = frame().document();
    auto scrollingObject = document &amp;&amp; document-&gt;documentElement() ? document-&gt;documentElement()-&gt;renderer() : nullptr;
    if (scrollingObject &amp;&amp; renderView() &amp;&amp; renderView()-&gt;canBeScrolledAndHasScrollableArea())
        return scrollingObject-&gt;style().overscrollBehaviorY();
    return OverscrollBehavior::Auto;
}

When renderView()-&gt;canBeScrolledAndHasScrollableArea() is false, we ignore the style and return Auto instead. What is that check trying to accomplish?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1893169</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-23 00:10:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/99018981&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926756</commentid>
    <comment_count>4</comment_count>
    <who name="Nikos Mouchtaris">nmouchtaris</who>
    <bug_when>2023-01-19 16:40:42 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/8859</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1927523</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-23 11:18:29 -0800</bug_when>
    <thetext>Committed 259227@main (487c9dfe271c): &lt;https://commits.webkit.org/259227@main&gt;

Reviewed commits have been landed. Closing PR #8859 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>461811</attachid>
            <date>2022-08-22 19:15:13 -0700</date>
            <delta_ts>2022-08-22 19:15:13 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>244232.html</filename>
            <type>text/html</type>
            <size>1185</size>
            <attacher name="Kurt Revis">krevis</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIiA+CjxoZWFkPgogIDxzdHlsZT4KICAgIGh0
bWwgeyAvKiBGb3IgU2FmYXJpIGFuZCBGaXJlZm94ICovCiAgICAgIG92ZXJzY3JvbGwtYmVoYXZp
b3I6IG5vbmU7CiAgICB9CiAgICBib2R5IHsgLyogRm9yIENocm9tZSAqLwogICAgICBvdmVyc2Ny
b2xsLWJlaGF2aW9yOiBub25lOwogICAgfQogIDwvc3R5bGU+CiAgPG1ldGEgY2hhcnNldD0iVVRG
LTgiPgogIDx0aX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