Problem/Motivation
Originally introduced in #1071818: Lazy-loading CSS fails in IE to support IE 6 - 9 which did not support @import statements within dynamically added style elements. IE 10 fixed stylesheet limitations, and only IE 11 is now officially supported by core #2842298: [policy, no patch] Drop IE9 and IE10 support from Drupal 8.4.x.
Additionally, Drupal no longer uses @import statements when rendering CSS assets #2897408: Remove IE9 support from CssCollectionRenderer and provide it in contrib instead, so this code should never be executed.
Proposed resolution
Remove @import parsing from Drupal.AjaxCommands.prototype.add_css()
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | interdiff.txt | 1.98 KB | lauriii |
| #2 | drupal-3100147-2.patch | 1.98 KB | gapple |
Comments
Comment #2
gappleComment #3
gappleComment #4
longwaveAccording to all documentation I can find, e.g http://help.dottoro.com/ljcxtfmh.php, the
addImport()method only ever existed in IE until version 9 so I agree that this code should never be executed any more and can be removed.Comment #7
lauriiiMakes sense to remove this. Thank you!
I also removed the comment from above since it doesn't make sense anymore.
Committed 0e71536 and pushed to 9.0.x and 8.9.x. Thanks!
Comment #8
gappleAs a followup,
Drupal\Core\Ajax\AddCssCommandno longer provides a benefit overPrependCommand, so usage could be removed in 8.9, deprecated in 9.1, and removed in 10.0.#3110517: Improve Drupal\Core\Ajax\AddCssCommand to accept an array of CSS assets