summaryrefslogtreecommitdiffstats
path: root/dom/base/nsContentUtils.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 05:01:17 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 05:01:17 -0400
commit0d362ca50335d964a78dbba7e7d32574ee67899a (patch)
tree8b5de5f34019b97ad0b3c155c270a810608cd775 /dom/base/nsContentUtils.cpp
parentde45820b64ab03768336c7242622ef9f499347cf (diff)
downloadUXP-0d362ca50335d964a78dbba7e7d32574ee67899a.tar
UXP-0d362ca50335d964a78dbba7e7d32574ee67899a.tar.gz
UXP-0d362ca50335d964a78dbba7e7d32574ee67899a.tar.lz
UXP-0d362ca50335d964a78dbba7e7d32574ee67899a.tar.xz
UXP-0d362ca50335d964a78dbba7e7d32574ee67899a.zip
Bug 1330843 - Allow JS to create NAC pseudo-elements
Tag #1375
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r--dom/base/nsContentUtils.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index 6a819818c..c53b3d834 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -9871,3 +9871,16 @@ nsContentUtils::IsLocalRefURL(const nsString& aString)
return false;
}
+
+/* static */ Element*
+nsContentUtils::GetClosestNonNativeAnonymousAncestor(Element* aElement)
+{
+ MOZ_ASSERT(aElement);
+ MOZ_ASSERT(aElement->IsNativeAnonymous());
+
+ Element* e = aElement;
+ while (e && e->IsNativeAnonymous()) {
+ e = e->GetParentElement();
+ }
+ return e;
+}