diff --git a/core/misc/ajax.es6.js b/core/misc/ajax.es6.js index 905559c921..9527c10a2b 100644 --- a/core/misc/ajax.es6.js +++ b/core/misc/ajax.es6.js @@ -1532,10 +1532,6 @@ /** * Command to add css. * - * Uses the proprietary addImport method if available as browsers which - * support that method ignore @import statements in dynamically added - * stylesheets. - * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response @@ -1548,19 +1544,6 @@ add_css(ajax, response, status) { // Add the styles in the normal way. $('head').prepend(response.data); - // Add imports in the styles using the addImport method if available. - let match; - const importMatch = /^@import url\("(.*)"\);$/gim; - if ( - document.styleSheets[0].addImport && - importMatch.test(response.data) - ) { - importMatch.lastIndex = 0; - do { - match = importMatch.exec(response.data); - document.styleSheets[0].addImport(match[1]); - } while (match); - } }, /** diff --git a/core/misc/ajax.js b/core/misc/ajax.js index 7df2501987..06d13d4738 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -629,16 +629,6 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr }, add_css: function add_css(ajax, response, status) { $('head').prepend(response.data); - - var match = void 0; - var importMatch = /^@import url\("(.*)"\);$/gim; - if (document.styleSheets[0].addImport && importMatch.test(response.data)) { - importMatch.lastIndex = 0; - do { - match = importMatch.exec(response.data); - document.styleSheets[0].addImport(match[1]); - } while (match); - } }, message: function message(ajax, response) { var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector));