Merge "Use DOMCompat::getFirstElementChild() now that it is available from Parsoid"

This commit is contained in:
jenkins-bot 2024-11-14 11:05:15 +00:00 committed by Gerrit Code Review
commit 1fa7271beb

View file

@ -54,7 +54,7 @@ class ErrorUtils {
): DocumentFragment { ): DocumentFragment {
$extApi->addTrackingCategory( 'cite-tracking-category-cite-error' ); $extApi->addTrackingCategory( 'cite-tracking-category-cite-error' );
$fragment = $extApi->createInterfaceI18nFragment( 'cite_error', [ $error ] ); $fragment = $extApi->createInterfaceI18nFragment( 'cite_error', [ $error ] );
$fragSpan = DOMCompat::getLastElementChild( $fragment ); $fragSpan = DOMCompat::getFirstElementChild( $fragment );
DOMUtils::addAttributes( $fragSpan, [ 'class' => 'error mw-ext-cite-error' ] ); DOMUtils::addAttributes( $fragSpan, [ 'class' => 'error mw-ext-cite-error' ] );
return $fragment; return $fragment;
} }