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()

CommentFileSizeAuthor
#7 interdiff.txt1.98 KBlauriii
#2 drupal-3100147-2.patch1.98 KBgapple

Comments

gapple created an issue. See original summary.

gapple’s picture

Status: Active » Needs review
StatusFileSize
new1.98 KB
gapple’s picture

Issue tags: +IE9
longwave’s picture

Status: Needs review » Reviewed & tested by the community

According 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.

  • lauriii committed 0e71536 on 9.0.x
    Issue #3100147 by gapple, longwave: Remove @import parsing from Drupal....

  • lauriii committed 32430ed on 8.9.x
    Issue #3100147 by gapple, longwave: Remove @import parsing from Drupal....
lauriii’s picture

Version: 8.8.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed
StatusFileSize
new1.98 KB

Makes 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!

gapple’s picture

As a followup, Drupal\Core\Ajax\AddCssCommand no longer provides a benefit over PrependCommand, 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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.