Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e2873429150ba8df42e6acf17a0ff6ac64f1a69f
https://github.com/WebKit/WebKit/commit/e2873429150ba8df42e6acf17a0ff6ac64f1a69f
Author: Said Abou-Hallawa <[email protected]>
Date: 2025-04-24 (Thu, 24 Apr 2025)
Changed paths:
A LayoutTests/svg/filters/feMerge-nodes-unite-outsets-expected.html
A LayoutTests/svg/filters/feMerge-nodes-unite-outsets.html
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/platform/RectEdges.h
M Source/WebCore/svg/graphics/filters/SVGFilter.cpp
A Source/WebCore/svg/graphics/filters/SVGFilterEffectGraph.h
M Source/WebCore/svg/graphics/filters/SVGFilterGraph.h
A Source/WebCore/svg/graphics/filters/SVGFilterPrimitiveGraph.h
Log Message:
-----------
feMerge misplaces the HTML element when merging the same feMergeNode multiple
times
https://bugs.webkit.org/show_bug.cgi?id=291919
rdar://149431216
Reviewed by Simon Fraser.
Two bugs need to be fixed to get this scenario working:
1. Building SVGFilterPrimitiveGraph:
There are two graphs for SVGFiler. One is for the effects and the other is for
the primitives. The main difference between these two graphs is the effect graph
has entries for SourceGraphics and SourceAlpha. The primitive graph can't have
entries for these predefined effects. But there should not be an error when
handling them.
When looking for a named effect, we fall back to the lastEffect when there is no
matched named effect and it is not predefined effect. Since there is no
predefined
primitives, getNamedNode() was falling back to the lastNode when the name is
SourceGraphis or SourceAlpha. This was building a wrong primitives graph.
To make fixing this simple, SVGFilterPrimitiveGraph and SVGFilterEffectGraph
should be split and should be made sub-classes of SVGFilterGraph.
Only SVGFilterEffectGraph will handle the predefined effects.
2. The outsets of the sibling primitives should be their maximum:
SVGFilter::calculateOutsets() will push the outsets of the current primitive
associated with the its level into a stack. When the graph enumeration goes up
one level, all the outsets on the lower level will be popped out of the stack
and their maximum will expand the outsets of the top of outsets stack.
* LayoutTests/svg/filters/feMerge-nodes-unite-outsets-expected.html: Added.
* LayoutTests/svg/filters/feMerge-nodes-unite-outsets.html: Added.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/RectEdges.h:
(WebCore::blend):
(WebCore::max):
* Source/WebCore/svg/graphics/filters/SVGFilter.cpp:
(WebCore::buildFilterEffectGraph):
(WebCore::SVGFilter::buildExpression):
(WebCore::buildFilterPrimitiveGraph):
(WebCore::SVGFilter::isIdentity):
(WebCore::SVGFilter::calculateOutsets):
(WebCore::buildFilterEffectsGraph): Deleted.
(WebCore::buildFilterPrimitivesGraph): Deleted.
* Source/WebCore/svg/graphics/filters/SVGFilterEffectGraph.h: Added.
(WebCore::SVGFilterEffectGraph::SVGFilterEffectGraph):
(WebCore::SVGFilterEffectGraph::sourceGraphic const):
(WebCore::SVGFilterEffectGraph::sourceAlpha const):
* Source/WebCore/svg/graphics/filters/SVGFilterGraph.h:
(WebCore::SVGFilterGraph::isSourceName):
(WebCore::SVGFilterGraph::SVGFilterGraph): Deleted.
(WebCore::SVGFilterGraph::sourceGraphic const): Deleted.
(WebCore::SVGFilterGraph::sourceAlpha const): Deleted.
(WebCore::SVGFilterGraph::addNamedNode): Deleted.
(WebCore::SVGFilterGraph::getNamedNode const): Deleted.
* Source/WebCore/svg/graphics/filters/SVGFilterPrimitiveGraph.h: Added.
Canonical link: https://commits.webkit.org/294088@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes