Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
javascript
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Mar 2012 at 04:41 UTC
Updated:
20 Mar 2020 at 16:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
iamEAP commentedPreliminary patch that takes care of this.
Also tagged html5.
Comment #2
arnested commentedYes, 'defer' should only be added to file and external and the patch works fine.
Comment #3
nod_how about unset-ing #attributes['defer'] in inline scripts? that would avoid some duplication.
Comment #4
iamEAP commentedHow about if we move it after the switch/case block? We can check for an src attribute and line up directly with the spec definition.
Comment #5
iamEAP commentedI might say this needs backporting too. Tagging.
Comment #6
arnested commentedYes, much better approach in #4.
Reviewed and tested. Works like a charm.
Comment #7
dries commentedCommitted to 8.x. Moving to 7.x.
Comment #8
iamEAP commentedComment #9
iamEAP commentedGoing ahead and reducing redundancy in D7.
Comment #10
iamEAP commentedSame, but doesn't wipe unrelated comments.
Comment #11
ericduran commentedFor D7, I think is best to just mark this issue as closed and instead fix defer and async in one shot over at #1140356: Add async, onload property to script tags. The other patch fixes this issue and also adds test.
Comment #12
tim.plunkettFixing tag.
Comment #14
ericduran commentedI think this should just be marked as dupe but I'll leave it to someone else.
#1140356: Add async, onload property to script tags already got in to D8, which is a better fixed (on top of this D8 patch) for this problem and that one is also marked for backport. But 1st #1587536: JavaScript aggregation should account for "async" and "defer" attributes needs to be fixed.
So I don't think this issue is needed.
Comment #15
iamEAP commentedYeah, there are some pros and cons to that.
On the one hand, the two (three) issues are very tightly knit and a backport for #1140356: Add async, onload property to script tags would depend on this.
On the other hand, this is still a separate bug with an easy fix. It's likely the aforementioned issue (along with #1587536: JavaScript aggregation should account for "async" and "defer" attributes will probably stay active for at least another month. No use in having this similar but distinct bug remain a bug while a new feature is added and backported.