<?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>236153</bug_id>
          
          <creation_ts>2022-02-04 12:46:01 -0800</creation_ts>
          <short_desc>Implement overflow-clip-margin</short_desc>
          <delta_ts>2026-03-09 09:21: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>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=308522</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rob Buis">rbuis</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>709922234</cc>
    
    <cc>ahmad.saleem792</cc>
    
    <cc>contact</cc>
    
    <cc>fotis.papadogeorgopoulos</cc>
    
    <cc>karlcow</cc>
    
    <cc>kyle.bavender</cc>
    
    <cc>pinkhominid</cc>
    
    <cc>sebastianzartner</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>woodlxf00</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1837561</commentid>
    <comment_count>0</comment_count>
    <who name="Rob Buis">rbuis</who>
    <bug_when>2022-02-04 12:46:01 -0800</bug_when>
    <thetext>Implement overflow-clip-margin:
https://drafts.csswg.org/css-overflow/#overflow-clip-margin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1840495</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-02-11 12:46:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/88830478&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1921950</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-12-26 16:53:45 -0800</bug_when>
    <thetext>https://wpt.fyi/results/css/css-overflow?label=master&amp;label=experimental&amp;aligned&amp;view=subtest&amp;q=overflow-clip%20safari%3Afail</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2165855</commentid>
    <comment_count>3</comment_count>
    <who name="Suraj">contact</who>
    <bug_when>2025-12-15 01:58:13 -0800</bug_when>
    <thetext>I would like to take a stab at implementing this feature. I’m working on familiarizing myself with how clipping is implemented in the WebKit codebase.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2165861</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-12-15 02:32:49 -0800</bug_when>
    <thetext>(In reply to Suraj from comment #3)
&gt; I would like to take a stab at implementing this feature. I’m working on
&gt; familiarizing myself with how clipping is implemented in the WebKit codebase.

Sure, please go ahead and also join Open Source WebKit slack to ask any question in #dev channel.

How to join - https://webkit.org/getting-started/#staying-in-touch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2167378</commentid>
    <comment_count>5</comment_count>
    <who name="Suraj">contact</who>
    <bug_when>2025-12-19 12:48:52 -0800</bug_when>
    <thetext>Quick update for anyone tracking this feature -

I made some progress in implementing this feature. To implement this feature, most likely, the dimensions calculated in RenderBox::overflowClipRect need to be updated based on the value of the overflow clip margin property - https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderBox.cpp#2265. I started by implementing the parsing logic for this property. I defined a new CSS property in CSSProperties.json file and created a new RenderStyle class named &quot;OverflowClipMargin&quot;. I managed to compile the code and get it running. More than half of the WPT parsing tests defined here are passing - http://wpt.live/css/css-overflow/parsing/overflow-clip-margin.html. All the failing tests are due to the error &quot;serialization should be canonical&quot;. I&apos;m working through such errors by trying to understand how CSS style serialization is implemented and make changes to the OverflowClipMargin RenderStyle class accordingly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2167394</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-12-19 13:35:03 -0800</bug_when>
    <thetext>(In reply to Suraj from comment #5)
&gt; Quick update for anyone tracking this feature -
&gt; 
&gt; I made some progress in implementing this feature. To implement this
&gt; feature, most likely, the dimensions calculated in
&gt; RenderBox::overflowClipRect need to be updated based on the value of the
&gt; overflow clip margin property -
&gt; https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderBox.
&gt; cpp#2265. I started by implementing the parsing logic for this property. I
&gt; defined a new CSS property in CSSProperties.json file and created a new
&gt; RenderStyle class named &quot;OverflowClipMargin&quot;. I managed to compile the code
&gt; and get it running. More than half of the WPT parsing tests defined here are
&gt; passing -
&gt; http://wpt.live/css/css-overflow/parsing/overflow-clip-margin.html. All the
&gt; failing tests are due to the error &quot;serialization should be canonical&quot;. I&apos;m
&gt; working through such errors by trying to understand how CSS style
&gt; serialization is implemented and make changes to the OverflowClipMargin
&gt; RenderStyle class accordingly.

Thanks for an update, if you want feedback and input while you iterate, you can do draft PR and tag engineers. You should join our Open Source WebKit Slack channel as well, where in #dev or #help channel, you can ask for inputs as well.

How to join - https://webkit.org/getting-started/#staying-in-touch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2167415</commentid>
    <comment_count>7</comment_count>
    <who name="Suraj">contact</who>
    <bug_when>2025-12-19 15:15:51 -0800</bug_when>
    <thetext>Sure, I didn’t know we could draft PRs. Thanks for letting me know.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2179751</commentid>
    <comment_count>8</comment_count>
    <who name="Suraj">contact</who>
    <bug_when>2026-02-09 22:18:38 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/58276</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2179753</commentid>
    <comment_count>9</comment_count>
    <who name="Suraj">contact</who>
    <bug_when>2026-02-09 22:25:04 -0800</bug_when>
    <thetext>I&apos;m back after a long hiatus. I submitted a Draft PR for feedback. The PR comment has information about what works and doesn&apos;t. I&apos;m currently working through fixing the failing WPT tests</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>