Issue #3095113 by gapple, longwave, ravi.shankar, Deepak Goyal, anmolgoyal74, Sahana _N, geek-merlin, catch, lauriii, Meenakshi.g: Deprecate IE conditional comments support

merge-requests/25/head
catch 2020-10-26 09:11:41 +00:00
parent 3d7dd76cdf
commit a60c3a47f6
3 changed files with 6 additions and 11 deletions

View File

@ -150,6 +150,8 @@ class HtmlTag extends RenderElement {
return $element;
}
@trigger_error('Support for IE Conditional Comments is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3102997', E_USER_DEPRECATED);
// Determine the conditional comment expression for Internet Explorer to
// evaluate.
if ($browsers['IE'] === TRUE) {

View File

@ -251,9 +251,11 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests adding JavaScript within conditional comments.
*
* @group legacy
* @see \Drupal\Core\Render\Element\HtmlTag::preRenderConditionalComments()
*/
public function testBrowserConditionalComments() {
$this->expectDeprecation('Support for IE Conditional Comments is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3102997');
$default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0';
$build['#attached']['library'][] = 'common_test/browsers';

View File

@ -206,22 +206,13 @@ class HtmlTagTest extends RendererTestBase {
$element = [
'#tag' => 'link',
];
$tags['link'] = [HtmlTag::preRenderConditionalComments($element), '<link />' . "\n"];
// Conditional link.
$element = [
'#tag' => 'link',
'#browsers' => [
'IE' => TRUE,
'!IE' => FALSE,
],
];
$tags['conditional-link'] = [HtmlTag::preRenderConditionalComments($element), "\n" . '<!--[if IE]>' . "\n" . '<link />' . "\n" . '<![endif]-->' . "\n"];
$tags['link'] = [$element, '<link />' . "\n"];
return $tags;
}
/**
* @group legacy
* @covers ::preRenderConditionalComments
* @dataProvider providerPreRenderConditionalComments
*/