Commit 8780ba25 authored by Dries's avatar Dries
Browse files

- Patch #1503804 by iamEAP: defer attribute should not be added to inline scripts or settings.

parent f9e44fc4
......@@ -4321,9 +4321,6 @@ function drupal_pre_render_scripts($elements) {
foreach ($group['items'] as $item) {
// Element properties that do not depend on item type.
$element = $element_defaults;
if (!empty($item['defer'])) {
$element['#attributes']['defer'] = 'defer';
}
$element['#browsers'] = $item['browsers'];
// Element properties that depend on item type.
......@@ -4351,6 +4348,11 @@ function drupal_pre_render_scripts($elements) {
break;
}
// The defer attribute must not be specified if src is not defined.
if (!empty($item['defer']) && isset($element['#attributes']['src'])) {
$element['#attributes']['defer'] = 'defer';
}
$elements[] = $element;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment