diff --git a/includes/CommentModifier.php b/includes/CommentModifier.php index 60429301c..eec92a844 100644 --- a/includes/CommentModifier.php +++ b/includes/CommentModifier.php @@ -291,7 +291,7 @@ class CommentModifier { $hasElements = false; foreach ( $nodes as $node ) { if ( $node instanceof Element ) { - if ( strtolower( $node->nodeName ) !== strtolower( $type ) ) { + if ( strtolower( $node->tagName ) !== strtolower( $type ) ) { return false; } $hasElements = true; diff --git a/includes/CommentParser.php b/includes/CommentParser.php index 4a98e78e6..98f32bcc5 100644 --- a/includes/CommentParser.php +++ b/includes/CommentParser.php @@ -598,7 +598,7 @@ class CommentParser { // if the timestamp node is the only child of a link node, use the link node instead // // Handle links nested in formatting elements. - if ( $event === 'leave' && $node instanceof Element && strtolower( $node->nodeName ) === 'a' ) { + if ( $event === 'leave' && $node instanceof Element && strtolower( $node->tagName ) === 'a' ) { $username = $this->getUsernameFromLink( $node ); if ( $username ) { // Accept the first link to the user namespace, then only accept links to that user diff --git a/includes/CommentUtils.php b/includes/CommentUtils.php index 3420e71be..d22d53d20 100644 --- a/includes/CommentUtils.php +++ b/includes/CommentUtils.php @@ -148,9 +148,9 @@ class CommentUtils { public static function isCommentSeparator( Node $node ): bool { return $node instanceof Element && ( // Empty paragraphs (`


`) between indented comments mess up indentation detection - strtolower( $node->nodeName ) === 'br' || + strtolower( $node->tagName ) === 'br' || // Horizontal line - strtolower( $node->nodeName ) === 'hr' || + strtolower( $node->tagName ) === 'hr' || // {{outdent}} templates DOMCompat::getClassList( $node )->contains( 'outdent-template' ) ); @@ -213,7 +213,7 @@ class CommentUtils { do { if ( $node instanceof Element && - in_array( strtolower( $node->nodeName ), $tagNames ) + in_array( strtolower( $node->tagName ), $tagNames ) ) { return $node; } diff --git a/modules/dt.ui.ReplyWidget.js b/modules/dt.ui.ReplyWidget.js index 7857be712..84c97725e 100644 --- a/modules/dt.ui.ReplyWidget.js +++ b/modules/dt.ui.ReplyWidget.js @@ -40,7 +40,7 @@ function ReplyWidget( commentController, commentDetails, config ) { // don't need to worry about transcluded replies. this.pageExists = mw.config.get( 'wgRelevantArticleId', 0 ) !== 0; var contextNode = utils.closestElement( threadItem.range.endContainer, [ 'dl', 'ul', 'ol' ] ); - this.context = contextNode ? contextNode.nodeName.toLowerCase() : 'dl'; + this.context = contextNode ? contextNode.tagName.toLowerCase() : 'dl'; // TODO: Should storagePrefix include pageName? this.storagePrefix = 'reply/' + threadItem.id; this.storage = controller.storage; diff --git a/modules/utils.js b/modules/utils.js index d01fe392b..d5c61a6a0 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -113,9 +113,9 @@ function cantHaveElementChildren( node ) { function isCommentSeparator( node ) { return node.nodeType === Node.ELEMENT_NODE && ( // Empty paragraphs (`


`) between indented comments mess up indentation detection - node.nodeName.toLowerCase() === 'br' || + node.tagName.toLowerCase() === 'br' || // Horizontal line - node.nodeName.toLowerCase() === 'hr' || + node.tagName.toLowerCase() === 'hr' || // {{outdent}} templates node.classList.contains( 'outdent-template' ) );