Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/306451

Change subject: Copy style attribute to lazy placeholder
......................................................................

Copy style attribute to lazy placeholder

Width and height attributes may not be set so we should also pass
the style attribute in case dimensions are defined there. With no
dimensions an image will not load

Change-Id: I0658e036ffd391d146e6e845d66b44029cc9057e
Bug: T143768
---
M includes/MobileFormatter.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/51/306451/1

diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 67d0cc9..8244529 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -266,7 +266,7 @@
                        $imgPlaceholder = $doc->createElement( 'span' );
                        $imgPlaceholder->setAttribute( 'class', 
'lazy-image-placeholder' );
                        $imgPlaceholder->setAttribute( 'style', 
$dimensionsStyle );
-                       foreach ( [ 'src', 'alt', 'width', 'height', 'srcset', 
'class' ] as $attr ) {
+                       foreach ( [ 'src', 'alt', 'width', 'height', 'srcset', 
'class', 'style' ] as $attr ) {
                                if ( $img->hasAttribute( $attr ) ) {
                                        $imgPlaceholder->setAttribute( 
"data-$attr", $img->getAttribute( $attr ) );
                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/306451
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0658e036ffd391d146e6e845d66b44029cc9057e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to