summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-11-13 19:28:44 +0100
committerMoonchild <moonchild@palemoon.org>2023-11-13 19:28:44 +0100
commitf1f7466a72f963807e54123fb9b5e2d2ec6143b1 (patch)
tree9dfdf2182a385558082f268565cf0f242b20618b
parenta36a691826d9ea9ad4c564f2d27905f267a5e53d (diff)
downloaduxp-f1f7466a72f963807e54123fb9b5e2d2ec6143b1.tar.gz
No issue - Stop supporting data: scheme in SVG <use> elements.
-rw-r--r--dom/svg/SVGUseElement.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/dom/svg/SVGUseElement.cpp b/dom/svg/SVGUseElement.cpp
index acd8941b4e..8da90634ad 100644
--- a/dom/svg/SVGUseElement.cpp
+++ b/dom/svg/SVGUseElement.cpp
@@ -426,6 +426,17 @@ SVGUseElement::LookupHref()
nsCOMPtr<nsIURI> targetURI;
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
GetComposedDoc(), baseURI);
+
+ // Do not allow 'data:' schemes in <use> elements.
+ // See spec update: https://github.com/w3c/svgwg/pull/901
+ if (targetURI) {
+ bool isData;
+ mozilla::Unused << targetURI->SchemeIs("data", &isData);
+ if (isData) {
+ return;
+ }
+ }
+
mSource.Reset(this, targetURI);
}