Bug 1964158 - If a filter is not valid, return the original dirty region r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D247798
This commit is contained in:
longsonr
2025-05-20 14:54:46 +00:00
committed by longsonr@gmail.com
parent 13387e6e59
commit ab0bcf2219
2 changed files with 15 additions and 1 deletions

View File

@@ -1490,7 +1490,7 @@ nsRegion FilterInstance::GetPreFilterNeededArea(
/* InputIsTainted */ true, nullptr, tm,
&aPostFilterDirtyRegion);
if (!instance.IsInitialized()) {
return nsRect();
return aPostFilterDirtyRegion;
}
// Now we can ask the instance to compute the area of the source

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<title>zero width filters are ignored</title>
<link rel="help" href="https://www.w3.org/TR/filter-effects-1/#filter-region">
<link rel="match" href="reference/green-100x100.html">
<svg width="200" height="200">
<defs>
<rect id="r" width="100" height="100" fill="green"/>
<filter x="0" y="0" id="f_off" width="0" height="0">
<feOffset/>
</filter>
</defs>
<rect width="100" height="100" fill="red"/>
<use style="filter:url(#f_off)" href="#r"/>
</svg>