<?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>189256</bug_id>
          
          <creation_ts>2018-09-03 21:59:32 -0700</creation_ts>
          <short_desc>feFlood with explicit size in CSS filter doesn&apos;t render</short_desc>
          <delta_ts>2023-04-10 17:56:33 -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>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1456263</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-09-03 21:59:32 -0700</bug_when>
    <thetext>Attached test case doesn&apos;t render in Safari; it does in FF and Chrome (differently).

Oddly, toggling dismay:none on the SVG changes behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1456264</commentid>
    <comment_count>1</comment_count>
      <attachid>348805</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-09-03 21:59:52 -0700</bug_when>
    <thetext>Created attachment 348805
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1947492</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-04-08 06:22:47 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 16.4 and green rect is on 0,0 while Chrome Canary 114 and Firefox Nightly 113 does not start from 0,0 but has margin around it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1947677</commentid>
    <comment_count>3</comment_count>
      <attachid>465833</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2023-04-10 10:53:25 -0700</bug_when>
    <thetext>Created attachment 465833
unclipped filtered element

I think the display in WebKit is more correct than Chrome and FireFox. The default filterRegion of the SVGFilter is { -10%, -10%, 110%, 110% }. Because the filtered element dimension is { 100, 100 }, the filterRegion will be extended 10 pixels from all directions.

In WebKit, this is drawn with no clipping. But in Chrome and FireFox, the top and the left extended areas are clipped. See the attached new test case where a filtered element is drawn and an another overlay element with the same dimension is drawn on top of it. The overlay element only draws the border.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1947682</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2023-04-10 11:09:01 -0700</bug_when>
    <thetext>I don&apos;t think this config changed; if our rendering differs from Chrome and Firefox and we think the behavior is correct, we should open a spec issue to have the spec clarify behavior.

It&apos;s not clear to me that WebKit behavior is correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1947791</commentid>
    <comment_count>5</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2023-04-10 17:26:51 -0700</bug_when>
    <thetext>(In reply to Simon Fraser (smfr) from comment #4)
&gt; I don&apos;t think this config changed; if our rendering differs from Chrome and
&gt; Firefox and we think the behavior is correct, we should open a spec issue to
&gt; have the spec clarify behavior.

But the specs is clear for applying an SVGFilter on an SVGElement. The geometry of the filterRegion is { -10%, -10%, 110%, 110% }, see https://drafts.fxtf.org/filter-effects/#filter-region. 

The problem happens when applying the SVGFilter to an HTMLElement. Do we apply the filterRegion geometry outside the HTMLElement border box? 

&gt; 
&gt; It&apos;s not clear to me that WebKit behavior is correct.

I am not sure why the rendering of Chrome and FireFox is correct. They clip the top and left filter extension and they keep the right and the bottom.

And I think we need at least to retitle this bug and preferably close this one and open a new one. The original bug was fixed (not drawing the filter itself). We now want to discuss: The filterRegion geometry of the SVGFilter when applied on an HTMLElement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1947796</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2023-04-10 17:56:33 -0700</bug_when>
    <thetext>I’m OK with doing that.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>348805</attachid>
            <date>2018-09-03 21:59:52 -0700</date>
            <delta_ts>2018-09-03 21:59:52 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>reference-filter-set-filter-regions.html</filename>
            <type>text/html</type>
            <size>806</size>
            <attacher name="Simon Fraser (smfr)">simon.fraser</attacher>
            
              <data encoding="base64">PGhlYWQ+CiAgICA8c3R5bGU+CiAgICAgICAgLmJveCB7CiAgICAgICAgICB3aWR0aDogMTAwcHg7
CiAgICAgICAgICBoZWlnaHQ6IDEwMHB4OwogICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogZ3Jl
ZW47CiAgICAgICAgICBmaWx0ZXI6IHVybCgjZmlsdGVyKTsKICAgICAgICB9CiAgICAgICAgCiAg
ICAgICAgc3ZnIHsKLyogICAgICAgICAgICBkaXNwbGF5OiBub25lOyAvKiBGbGlwcyBiZWhhdmlv
ciBpbiBGaXJlZm94IGFuZCBTYWZhcmkhICovKi8KICAgICAgICB9CiAgICA8L3N0eWxlPgogICAg
PHNjcmlwdD4KICAgICAgICBmdW5jdGlvbiBkb1Rlc3QoKQogICAgICAgIHsKICAgICAgICAgICAg
dmFyIGJveCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdib3gnKTsKICAgICAgICAgICAgYm94
LmNsYXNzTGlzdC5hZGQoJ2FuaW1hdGluZycpOwogICAgICAgIH0KICAgICAgICB3aW5kb3cuYWRk
RXZlbnRMaXN0ZW5lcignbG9hZCcsIGRvVGVzdCwgZmFsc2UpOwogICAgPC9zY3JpcHQ+CjwvaGVh
ZD4KPGJvZHk+CiAgIDxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0
aD0iMCIgaGVpZ2h0PSIwIiB2ZXJzaW9uPSIxLjEiPgogICAgPGRlZnM+CiAgICAgICAgPGZpbHRl
ciBpZD0iZmlsdGVyIj4KICAgICAgICAgICAgPGZlRmxvb2QgeD0iMCIgeT0iMCIgd2lkdGg9IjQw
MCIgaGVpZ2h0PSI0MDAiIGZsb29kLWNvbG9yPSJncmVlbiIgLz4KICAgICAgICA8L2ZpbHRlcj4K
ICAgIDwvZGVmcz4KICA8L3N2Zz4KCiAgPGRpdiBpZD0iYm94IiBjbGFzcz0iYm94Ij48L2Rpdj4K
PC9ib2R5Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>465833</attachid>
            <date>2023-04-10 10:53:25 -0700</date>
            <delta_ts>2023-04-10 10:53:25 -0700</delta_ts>
            <desc>unclipped filtered element</desc>
            <filename>test-feFlood.html</filename>
            <type>text/html</type>
            <size>880</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PGhlYWQ+CiAgICA8c3R5bGU+CiAgICAgICAgLmNvbnRhaW5lciB7CiAgICAgICAgICAgIHdpZHRo
OiAxMDBweDsKICAgICAgICAgICAgaGVpZ2h0OiAxMDBweDsKICAgICAgICAgICAgcG9zaXRpb246
IHJlbGF0aXZlOwogICAgICAgIH0KICAgICAgICAuYm94IHsKICAgICAgICAgICAgd2lkdGg6IDEw
MCU7CiAgICAgICAgICAgIGhlaWdodDogMTAwJTsKICAgICAgICAgICAgcG9zaXRpb246IGFic29s
dXRlOwogICAgICAgICAgICB0b3A6IDA7CiAgICAgICAgICAgIGxlZnQ6IDA7CiAgICAgICAgfQog
ICAgICAgIC5maWx0ZXJlZCB7CiAgICAgICAgICAgIGZpbHRlcjogdXJsKCNmaWx0ZXIpOwogICAg
ICAgIH0KICAgICAgICAuYm9yZGVyZWQgewogICAgICAgICAgICB6LWluZGV4OiA5OwogICAgICAg
ICAgICBib3JkZXI6IDJweCBzb2xpZCB5ZWxsb3c7CiAgICAgICAgfQogICAgPC9zdHlsZT4KPC9o
ZWFkPgo8Ym9keT4KICAgIDxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3
aWR0aD0iMCIgaGVpZ2h0PSIwIiB2ZXJzaW9uPSIxLjEiPgogICAgICAgIDxkZWZzPgogICAgICAg
ICAgICA8ZmlsdGVyIGlkPSJmaWx0ZXIiPgogICAgICAgICAgICAgICAgPGZlRmxvb2QgeD0iMCIg
eT0iMCIgd2lkdGg9IjQwMCIgaGVpZ2h0PSI0MDAiIGZsb29kLWNvbG9yPSIjMDA1N2UzIiBmbG9v
ZC1vcGFjaXR5PSIwLjciLz4KICAgICAgICAgICAgPC9maWx0ZXI+CiAgICAgICAgPC9kZWZzPgog
ICAgPC9zdmc+CiAgICA8ZGl2IGNsYXNzPSJjb250YWluZXIiPgogICAgICAgIDxkaXYgY2xhc3M9
ImJveCBmaWx0ZXJlZCI+PC9kaXY+CiAgICAgICAgPGRpdiBjbGFzcz0iYm94IGJvcmRlcmVkIj48
L2Rpdj4KICAgIDwvZGl2Pgo8L2JvZHk+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>