summaryrefslogtreecommitdiffstats
path: root/dom/base/nsContentUtils.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-09-16 13:30:35 +0000
committerMoonchild <moonchild@palemoon.org>2020-09-21 11:03:48 +0000
commited1f54ab7312f2e7f5b2f46bc5e9d693f4ee6f06 (patch)
treecc650f187b6b7d936de53a194235659febf8a47e /dom/base/nsContentUtils.h
parenteb1315e093fa9f540aecf35e03a7cf9f7390e55a (diff)
downloadUXP-ed1f54ab7312f2e7f5b2f46bc5e9d693f4ee6f06.tar
UXP-ed1f54ab7312f2e7f5b2f46bc5e9d693f4ee6f06.tar.gz
UXP-ed1f54ab7312f2e7f5b2f46bc5e9d693f4ee6f06.tar.lz
UXP-ed1f54ab7312f2e7f5b2f46bc5e9d693f4ee6f06.tar.xz
UXP-ed1f54ab7312f2e7f5b2f46bc5e9d693f4ee6f06.zip
Issue #1643 - Part 1: Add GetNodeDepth() to nsContentUtils.
Diffstat (limited to 'dom/base/nsContentUtils.h')
-rw-r--r--dom/base/nsContentUtils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h
index ffbd15e78..08587b5e4 100644
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -2745,6 +2745,14 @@ public:
static bool
IsLocalRefURL(const nsString& aString);
+ /**
+ * Returns the length of the parent-traversal path (in terms of the number of
+ * nodes) to an unparented/root node from aNode. An unparented/root node is
+ * considered to have a depth of 1, its children have a depth of 2, etc.
+ * aNode is expected to be non-null.
+ */
+ static uint32_t GetNodeDepth(nsINode* aNode);
+
private:
static bool InitializeEventTable();