Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
child.parent = self
children.add child
end
+
+ # Depth of `self` in the composite tree.
+ fun depth: Int do
+ if parent == null then return 0
+ return parent.depth + 1
+ end
end
# The `DocComposite` element that contains all the other.
end
# Level <hX> for HTML heading.
- private fun hlvl: Int do
- if parent == null then return 0
- return parent.hlvl + 1
- end
+ private fun hlvl: Int do return depth
# Is `self` not displayed in the page.
#