summaryrefslogtreecommitdiff
path: root/src/Nodes
diff options
context:
space:
mode:
Diffstat (limited to 'src/Nodes')
-rw-r--r--src/Nodes/NodeTrait.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Nodes/NodeTrait.php b/src/Nodes/NodeTrait.php
index 6aa5414..c08b59f 100644
--- a/src/Nodes/NodeTrait.php
+++ b/src/Nodes/NodeTrait.php
@@ -371,9 +371,11 @@ trait NodeTrait
*
* @return bool
*/
- public function hasAncestorTag($node, $tagName, $maxDepth = 3)
+ public function hasAncestorTag($tagName, $maxDepth = 3)
{
$depth = 0;
+ $node = $this;
+
while ($node->parentNode) {
if ($maxDepth > 0 && $depth > $maxDepth) {
return false;