Skip to content

Commit

Permalink
Fix feImage rendering of SVG images in some cases
Browse files Browse the repository at this point in the history
The FEImage class is relying on the bogus size from SVGImage. Make it
use SVGImageForContainer instead.

Bug: 41357911
Change-Id: I1853f321cb788378c71da332847fa8d1d2a57915
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6105795
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/main@{#1398507}
  • Loading branch information
Fredrik Söderquist authored and chromium-wpt-export-bot committed Dec 19, 2024
1 parent 9ff7e54 commit e24bf6f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions css/filter-effects/svg-feimage-003.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<title>Filter Effects Test: feImage referencing an data URL</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#feImageElement">
<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" x="0" y="0" width="1" height="1">
<feImage href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'>
<rect y='150' width='300' height='150'/>
</svg>"
preserveAspectRatio="none"/>
</filter>
</defs>
<rect width="300" height="151" fill="black"/>
<rect x="1" y="151" width="298" height="148" fill="red"/>
<rect width="300" height="300" fill="red" filter="url(#filter)"/>
</svg>

0 comments on commit e24bf6f

Please sign in to comment.