Skip to content

Commit

Permalink
Paint nothing when feImage references svg inlines
Browse files Browse the repository at this point in the history
The spec states that non-image feImage references should be rendered
"according to the behavior of the use element"
(https://drafts.fxtf.org/filter-effects/#feImageElement), which is
nothing for the case of a standalone tspan.

Fixed: 383187487
Change-Id: If3f8438676c593f6e9aab4f879ea9212a0806621
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6111507
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1399218}
  • Loading branch information
progers authored and chromium-wpt-export-bot committed Dec 20, 2024
1 parent 61a2d96 commit f019be2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions css/filter-effects/svg-feimage-004.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<title>Filter Effects Test: feImage referencing a tspan</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#feImageElement">
<meta name="assert" content="feImage non-image references should render 'according to the behavior of the use element', which is nothing for a standalone tspan.">
<link rel="match" href="reference/svg-feimage-ref.html">
<p>The test passes if you see a black square and no red.</p>
<svg width="500" height="500">
<defs>
<filter id="filter-tspan" x="0" y="0" width="5" height="5">
<feImage href="#tspan"></feImage>
</filter>
<filter id="filter-use-tspan" x="0" y="0" width="5" height="5">
<feImage href="#use-tspan"></feImage>
</filter>
<text>
<tspan id="tspan" x="0" y="1em" fill="red">FAIL</tspan>
</text>
<use id="use-tspan" href="#tspan"></use>
</defs>
<rect width="300" height="300" fill="black"></rect>
<rect width="300" height="150" fill="red" filter="url(#filter-tspan)"></rect>
<rect width="300" height="150" fill="red" y="150" filter="url(#filter-use-tspan)"></rect>
</svg>

0 comments on commit f019be2

Please sign in to comment.