Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!6
#3167034
"Leverage the 'loading' html attribute to enable lazy-load by default for images"
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
#3167034
"Leverage the 'loading' html attribute to enable lazy-load by default for images"
issue/drupal-3167034:3167034-lazy-load-images
into
9.1.x
Overview
22
Commits
27
Pipelines
0
Changes
8
Merged
#3167034 "Leverage the 'loading' html attribute to enable lazy-load by default for images"
Edys Meza
requested to merge
issue/drupal-3167034:3167034-lazy-load-images
into
9.1.x
Sep 1, 2020
Overview
22
Commits
27
Pipelines
0
Changes
8
Related
#3167034
0
0
Merge request reports
Compare
9.1.x
version 15
8e3d8771
Oct 1, 2020
version 14
b9b65be4
Sep 28, 2020
version 13
f59f12f8
Sep 28, 2020
version 12
2175e1f0
Sep 25, 2020
version 11
ef1bb0f1
Sep 25, 2020
version 10
77bdbd02
Sep 25, 2020
version 9
f47bf829
Sep 24, 2020
version 8
470e1d71
Sep 22, 2020
version 7
dab23783
Sep 18, 2020
version 6
8cfda822
Sep 8, 2020
version 5
bf605e47
Sep 4, 2020
version 4
193dd554
Sep 4, 2020
version 3
7f6892f5
Sep 2, 2020
version 2
cf8181e8
Sep 2, 2020
version 1
5b41c504
Sep 1, 2020
9.1.x (base)
and
latest version
latest version
13741187
27 commits,
Oct 1, 2020
version 15
8e3d8771
26 commits,
Oct 1, 2020
version 14
b9b65be4
25 commits,
Sep 28, 2020
version 13
f59f12f8
24 commits,
Sep 28, 2020
version 12
2175e1f0
23 commits,
Sep 25, 2020
version 11
ef1bb0f1
22 commits,
Sep 25, 2020
version 10
77bdbd02
11 commits,
Sep 25, 2020
version 9
f47bf829
10 commits,
Sep 24, 2020
version 8
470e1d71
9 commits,
Sep 22, 2020
version 7
dab23783
8 commits,
Sep 18, 2020
version 6
8cfda822
7 commits,
Sep 8, 2020
version 5
bf605e47
6 commits,
Sep 4, 2020
version 4
193dd554
5 commits,
Sep 4, 2020
version 3
7f6892f5
4 commits,
Sep 2, 2020
version 2
cf8181e8
3 commits,
Sep 2, 2020
version 1
5b41c504
2 commits,
Sep 1, 2020
8 files
+
190
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
core/includes/theme.inc
+
7
−
0
View file @ 13741187
Edit in single-file editor
Open in Web IDE
Show full file
@@ -851,6 +851,13 @@ function template_preprocess_image(&$variables) {
$variables
[
'attributes'
][
$key
]
=
$variables
[
$key
];
}
}
// Without dimensions specified, layout shifts can occur,
// which are more noticeable on pages that take some time to load.
// As a result, only mark images as lazy load that have dimensions.
if
(
isset
(
$variables
[
'width'
],
$variables
[
'height'
])
&&
!
isset
(
$variables
[
'attributes'
][
'loading'
]))
{
$variables
[
'attributes'
][
'loading'
]
=
'lazy'
;
}
}
/**
Loading