|
| __construct ( $skipSmallImages=false) |
|
| apply (DOMElement $node) |
| Insert a table of content placeholder into the element which will be progressively enhanced via JS.
|
|
| getImageDimensions (DOMElement $img) |
| Determine the user perceived width and height of an image element based on style , width , and height attributes.
|
|
| isDimensionSmallerThanThreshold ( $dimension) |
| Is image dimension small enough to not lazy load it.
|
|
◆ __construct()
MobileFrontend\Transforms\LazyImageTransform::__construct |
( |
| $skipSmallImages = false | ) |
|
- Parameters
-
bool | $skipSmallImages | whether small images should be excluded from lazy loading |
◆ apply()
MobileFrontend\Transforms\LazyImageTransform::apply |
( |
DOMElement | $node | ) |
|
◆ getImageDimensions()
MobileFrontend\Transforms\LazyImageTransform::getImageDimensions |
( |
DOMElement | $img | ) |
|
Determine the user perceived width and height of an image element based on style
, width
, and height
attributes.
As in the browser, the style
attribute takes precedence over the width
and height
attributes. If the image has no style
, width
or height
attributes, then the image is dimensionless.
- Parameters
-
- Returns
- array with width and height parameters if dimensions are found
◆ gradeCImageSupport()
static MobileFrontend\Transforms\LazyImageTransform::gradeCImageSupport |
( |
| ) |
|
|
static |
Fallback for Grade C to load lazy-load image placeholders.
Note: This will add a single repaint for Grade C browsers as images enter view but this is intentional and deemed acceptable.
- Returns
- string The JavaScript code to load lazy placeholders in Grade C browsers
◆ isDimensionSmallerThanThreshold()
MobileFrontend\Transforms\LazyImageTransform::isDimensionSmallerThanThreshold |
( |
| $dimension | ) |
|
Is image dimension small enough to not lazy load it.
- Parameters
-
string | $dimension | in css format, supports only px|ex units |
- Returns
- bool
The documentation for this class was generated from the following file:
- includes/Transforms/LazyImageTransform.php