Skip to content

Commit 1adc538

Browse files
committed
DEL: weird unset via bad html
1 parent fe5be17 commit 1adc538

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

app/code/Magento/Catalog/etc/view.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,5 @@
88
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
99
<vars module="Magento_Catalog">
1010
<var name="product_image_white_borders">1</var>
11-
<!-- Variable to enable lazy loading for catalog product images without borders.
12-
If you enable this setting your small size images without borders may be stretched in template.
13-
So be sure you have correct image sizes. -->
14-
<var name="enable_lazy_loading_for_images_without_borders">0</var>
1511
</vars>
1612
</view>

app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
/** @var $block \Magento\Catalog\Block\Product\Image */
99
/** @var $escaper \Magento\Framework\Escaper */
1010
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
11-
/**
12-
* Enable lazy loading for images with borders and if variable enable_lazy_loading_for_images_without_borders
13-
* is enabled in view.xml. Otherwise small size images without borders may be distorted. So max-width is used for them
14-
* to prevent stretching and lazy loading does not work.
15-
*/
16-
$borders = (bool)$block->getVar('product_image_white_borders', 'Magento_Catalog');
17-
$enableLazyLoadingWithoutBorders = (bool)$block->getVar(
18-
'enable_lazy_loading_for_images_without_borders',
19-
'Magento_Catalog'
20-
);
2111
$width = (int)$block->getWidth();
2212
$paddingBottom = $block->getRatio() * 100;
2313
?>
@@ -29,13 +19,8 @@ $paddingBottom = $block->getRatio() * 100;
2919
<?php endforeach; ?>
3020
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
3121
loading="lazy"
32-
<?php if ($borders || $enableLazyLoadingWithoutBorders): ?>
33-
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
34-
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
35-
<?php else: ?>
36-
max-width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
37-
max-height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
38-
<?php endif; ?>
22+
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
23+
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
3924
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>"/></span>
4025
</span>
4126
<?php

0 commit comments

Comments
 (0)