-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(removeEmptyContainers): skip if filter is applied via styles as w…
…ell (#2089) Fixes a bug where we were too eager to remove empty containers. We already had logic to skip removing empty containers if it had the filter attribute, which is needed to apply a filter to the whole area. However, the filter can also be defined through CSS. We did not properly handle this case, and treated the node as if it had no filter at all. This computes the styles and checks the stylesheet as well. (We also move the logic down to avoid computing the styles eagerly.)
- Loading branch information
Showing
5 changed files
with
59 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Empty <g> nodes should not be removed if they contain a filter, including | ||
filters applied via CSS. | ||
|
||
=== | ||
|
||
<svg viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"> | ||
<filter id="a" x="0" y="0" width="50" height="50" filterUnits="userSpaceOnUse"> | ||
<feFlood flood-color="#aaa"/> | ||
</filter> | ||
<mask id="b" x="0" y="0" width="50" height="50"> | ||
<g style="filter: url(#a)"/> | ||
</mask> | ||
<text x="16" y="16" style="mask: url(#b)">•ᴗ•</text> | ||
</svg> | ||
|
||
|
||
@@@ | ||
|
||
<svg viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"> | ||
<filter id="a" x="0" y="0" width="50" height="50" filterUnits="userSpaceOnUse"> | ||
<feFlood flood-color="#aaa"/> | ||
</filter> | ||
<mask id="b" x="0" y="0" width="50" height="50"> | ||
<g style="filter: url(#a)"/> | ||
</mask> | ||
<text x="16" y="16" style="mask: url(#b)">•ᴗ•</text> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters