From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/svg/SVGUseElement.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'dom/svg/SVGUseElement.cpp') 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; } -- cgit v1.2.3