Commit 32afb795 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Fix <clipPath> descendant check for filter effects on SVG elements

Don't advance past the inner-most resource container and don't consider
a resource container itself to be a <clipPath> descendant.

Bug: 109224, 1131088
Change-Id: I87e766f6247e868b31eefba90ca35bf8b1a7bdac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2425055Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#809837}
parent cd75a470
......@@ -1280,12 +1280,16 @@ static bool HasReferenceFilterOnly(const ComputedStyle& style) {
}
static bool IsClipPathDescendant(const LayoutObject& object) {
// If the object itself is a resource container (root of a resource subtree)
// it is not considered a clipPath descendant since it is independent of its
// ancestors.
if (object.IsSVGResourceContainer())
return false;
const LayoutObject* parent = object.Parent();
while (parent) {
if (parent->IsSVGResourceContainer()) {
auto* container = ToLayoutSVGResourceContainer(parent);
if (container->ResourceType() == kClipperResourceType)
return true;
return container->ResourceType() == kClipperResourceType;
}
parent = parent->Parent();
}
......
<!doctype html>
<title>Filtered &lt;marker> with &lt;clipPath> ancestor on &lt;polygon></title>
<link rel="match" href="../../struct/reftests/reference/green-100x100.html">
<svg>
<clipPath>
<marker id="m" filter="url(#f)"/>
<filter id="f"/>
</clipPath>
<polygon points="0,0 100,0 100,100 0,100" fill="green" marker-start="url(#m)"/>
</svg>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment