<?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>200643</bug_id>
          
          <creation_ts>2019-08-12 14:28:34 -0700</creation_ts>
          <short_desc>CSS scroll-snap-related properties should propagate &lt;html&gt; to the viewport (but not from the body)</short_desc>
          <delta_ts>2022-08-15 10:28: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>Scrolling</component>
          <version>Safari 12</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=210469</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=210476</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>
          
          <blocked>218115</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Miriam Suzanne">miriam</reporter>
          <assigned_to name="Tim Nguyen (:ntim)">ntim</assigned_to>
          <cc>majidvp</cc>
    
    <cc>miriam</cc>
    
    <cc>mrobinson</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1560551</commentid>
    <comment_count>0</comment_count>
    <who name="Miriam Suzanne">miriam</who>
    <bug_when>2019-08-12 14:28:34 -0700</bug_when>
    <thetext>Example: 
- https://s.codepen.io/mirisuzanne/debug/yLBNpdQ

Expected Behavior:
- `scroll-padding` and `scroll-snap-type` should be applied to the default viewport scrolling.

Actual Behavior:
- Neither property is applied, so there is no scroll-snapping or scroll offset applied
- The demo only works if you set the properties on `body` instead of `html`, which is counter-to-spec and breaks the (proper) Firefox implementation

Related:
- Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=952711
- CSSWG discussion: https://github.com/w3c/csswg-drafts/issues/3740

[Note that *neither* `body` nor `html` seems to work inside an iframe, which is why I link to the &quot;debug&quot; view in codepen. The original pen is available here: https://codepen.io/mirisuzanne/pen/yLBNpdQ?editors=1100)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1560987</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-08-13 15:35:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/54277211&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1581845</commentid>
    <comment_count>2</comment_count>
    <who name="Majid Valipour">majidvp</who>
    <bug_when>2019-10-21 06:31:57 -0700</bug_when>
    <thetext>As of Chrome 78, Blink is changing its behavior [1] to match specification and Gecko. Hopefully we will manage to get this done without lots of compat issues which should help Safari to attempt the fix as well.


[1] https://bugs.chromium.org/p/chromium/issues/detail?id=952711</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1582142</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2019-10-21 16:43:28 -0700</bug_when>
    <thetext>I think the propagate from &lt;body&gt; too, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1582157</commentid>
    <comment_count>4</comment_count>
    <who name="Majid Valipour">majidvp</who>
    <bug_when>2019-10-21 17:12:33 -0700</bug_when>
    <thetext>&gt; I think the propagate from &lt;body&gt; too, right?

While that is true for &apos;overflow&apos; but it not the case for these more recent properties such as &apos;scroll-snap-type&apos; and others. The scroll-snap spec is explicit about this now: https://drafts.csswg.org/css-scroll-snap/#scroll-snap-type

&quot;UAs must apply the scroll-snap-type value set on the root element to the document viewport. Note that, unlike overflow, scroll-snap-type values are not propagated from HTML body.&quot;  

The relevant spec discussion and decision are documented here: 
https://github.com/w3c/csswg-drafts/issues/3740</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1705179</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2020-11-06 02:28:09 -0800</bug_when>
    <thetext>Now that issue 210469 is closed, these properties do propagate from &lt;html&gt;, but they still propagate from &lt;body&gt; for backwards-compatibility reasons. Perhaps this bug could be repurposed to track the possible eventual removal of propagation from &lt;body&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891091</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-08-12 22:31:19 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/3287</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891370</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-08-15 10:28:10 -0700</bug_when>
    <thetext>Committed 253430@main (54380c808801): &lt;https://commits.webkit.org/253430@main&gt;

Reviewed commits have been landed. Closing PR #3287 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>