<?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>227704</bug_id>
          
          <creation_ts>2021-07-06 07:20:11 -0700</creation_ts>
          <short_desc>[LegacySVG] clip-path inset is incorrectly applied to the svg element.</short_desc>
          <delta_ts>2024-08-22 16:29:59 -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>SVG</component>
          <version>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/47754</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>justas543</reporter>
          <assigned_to name="Simon Fraser (smfr)">simon.fraser</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>rbuis</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1774936</commentid>
    <comment_count>0</comment_count>
      <attachid>432924</attachid>
    <who name="">justas543</who>
    <bug_when>2021-07-06 07:20:11 -0700</bug_when>
    <thetext>Created attachment 432924
safari incorrect clipping

clip-path inset is incorrectly applied to the svg element.

Go to https://jsfiddle.net/byo2kenj/5/
Observe that when clip-path is applied to div it is working correctly.
Observe that when the same clip-path is applied to exact same size svg it is clipping it incorrectly.

Both Firefox and Chrome are working as intended only Safari is breaking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1776621</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-07-13 07:21:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/80516912&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1995788</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-29 18:15:51 -0800</bug_when>
    <thetext>It is fixed in Layer based SVG Engine (LBSE).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2050571</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2024-08-04 12:03:24 -0700</bug_when>
    <thetext>This is causing a number of WPT tests to fail:

imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-reference-box-004.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-borderBox-1c.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-contentBox-1c.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-fillBox-1a.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-paddingBox-1c.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-strokeBox-1a.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-viewBox-1c.html [ ImageOnlyFailure ]


The issue is that we get the wrong referenceBox in SVGRenderSupport::clipContextToCSSClippingArea; we get the size of the SVG before scaling, not the size of the renderer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2050575</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2024-08-04 12:27:53 -0700</bug_when>
    <thetext>Actually when CSS applies clip-path on the SVG root element, RenderLayer::setupClipPath() does need to apply the clip-path, because it needs to clip CSS borders etc. So the early return in RenderLayer::setupClipPath() is wrong (and we&apos;ll need to avoid clipping twice).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2050688</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2024-08-05 10:38:01 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/31726</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2050918</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-08-06 09:04:15 -0700</bug_when>
    <thetext>Committed 281893@main (891e5f194137): &lt;https://commits.webkit.org/281893@main&gt;

Reviewed commits have been landed. Closing PR #31726 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2054837</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2024-08-22 16:29:59 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/47754</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>432924</attachid>
            <date>2021-07-06 07:20:11 -0700</date>
            <delta_ts>2021-07-06 07:20:11 -0700</delta_ts>
            <desc>safari incorrect clipping</desc>
            <filename>safari-clip-bug.png</filename>
            <type>image/png</type>
            <size>921</size>
            <attacher>justas543</attacher>
            
              <data encoding="base64">iVBORw0KGgoAAAANSUhEUgAAADQAAAA+CAYAAABk4ziNAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAMuSURBVGhD7ZtLaBNRFIbPpLVdKIpUXFS76cKA
KIpPRNxYEMQHLoSiLlQUQUXEYhEEURQXgsViq6VVKuJOsBVcuVCkbtwo2oWKuvIJKoqC+GiT+J1k
SrVo72RIMidhfvh7H72T3m/OvZfMSeplkFSQEn5ZMao4oOySy1zrl0xbO80Crr6mlZI4fpS/4Pkd
JZLypDu7MsNebWZYagrmVPMWXjidvV+llL/kinAuRHTWxIeCdcVA1uUEesiBcVnS8o0yyDY/JSlp
kiE5QRnFseAEes60epicTvQx9Z9+///0lDED+EkkOAGAvuIHTO4SUToL1E3K97Rd040GJ+AeGsbv
cC8wnUBdp3zGlH9kf2tLeR0Ketdv8/MkQD14kLpG0JLyAhrRG0DOE6lWYqdLMEVfVEtsrEIBqXQZ
3gfjCDgttF5R176oFRpII6J76CO1Dz6MhSiFBqrCjeLJJl5iK606vy9qhQKajJcBs53Ld4KxinIK
7dB3p4DKew4zcBOX7QZkF54HSIkf4cZVICCdcA2up6ZL7BjeiHWZWVMgIIVJ4m4icliqZTaXWdgv
/5ITqAHvYNgVQFZQTqJtaYmNlRNoAUP2EI+kD+O6YD9j+4E/SBkFuBNoGk4ytQm5plPzGbuWl10Y
URwD7aFyUgxkXTGQdeVy2+e6JL3vAG+XC/h+uWGmeEuX+I2/5S1eJF5rS1Hy3sUDGkfehvWS6Lta
FKBollwRb1x8KFhXDGRdTiBN6fZJWr6bSIG45QTSXHW3pOQCUC+o//L7rcoJ9AnfBaQdqF58D7DP
tK3GK9AeGsIv8WlgzgB1i/ItSNpvTXkdCml8A5BD1C7i1wbjlBfQiBSkg0jpxyvWkEIBaXL+i29r
CgWk0sjoErSm0EB6ocXcXCigiXiOeDI3oszOeMobaCrm8Uz2culmbA0pMJAOrMWa025jsW3D08s1
QprbnoVzue2q8s5t1+NmhnVItaym1E8gFNCqnED6+Y/mtpcztI661ciMKECEvOwhYDkqfyrQHion
xUDWFQNZVy4V/GhQ5M4AzRI93TQ2irdujd8orEb/96GUX0su4pfTR4EqQiK/AS8Ze9QscWeSAAAA
AElFTkSuQmCC
</data>

          </attachment>
      

    </bug>

</bugzilla>