diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/svg/SVGUseElement.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/svg/SVGUseElement.cpp')
-rw-r--r-- | dom/svg/SVGUseElement.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/dom/svg/SVGUseElement.cpp b/dom/svg/SVGUseElement.cpp index 5e671fc802..2db8649ba1 100644 --- a/dom/svg/SVGUseElement.cpp +++ b/dom/svg/SVGUseElement.cpp @@ -19,6 +19,7 @@ #include "mozilla/dom/SVGGraphicsElement.h" #include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGSVGElement.h" +#include "mozilla/dom/SVGSwitchElement.h" #include "mozilla/dom/SVGSymbolElement.h" #include "mozilla/dom/SVGUseElementBinding.h" #include "nsGkAtoms.h" @@ -166,8 +167,8 @@ nsresult SVGUseElement::BindToTree(BindContext& aContext, nsINode& aParent) { return NS_OK; } -void SVGUseElement::UnbindFromTree(bool aNullParent) { - SVGUseElementBase::UnbindFromTree(aNullParent); +void SVGUseElement::UnbindFromTree(UnbindContext& aContext) { + SVGUseElementBase::UnbindFromTree(aContext); OwnerDoc()->UnscheduleSVGUseElementShadowTreeUpdate(*this); } @@ -251,7 +252,17 @@ static bool NodeCouldBeRendered(const nsINode& aNode) { if (const auto* symbol = SVGSymbolElement::FromNode(aNode)) { return symbol->CouldBeRendered(); } - // TODO: Do we have other cases we can optimize out easily? + if (const auto* svgGraphics = SVGGraphicsElement::FromNode(aNode)) { + if (!svgGraphics->PassesConditionalProcessingTests()) { + return false; + } + } + if (auto* svgSwitch = + SVGSwitchElement::FromNodeOrNull(aNode.GetParentNode())) { + if (&aNode != svgSwitch->GetActiveChild()) { + return false; + } + } return true; } |