Commit a60c3a47 authored by catch's avatar catch
Browse files

Issue #3095113 by gapple, longwave, ravi.shankar, Deepak Goyal, anmolgoyal74,...

Issue #3095113 by gapple, longwave, ravi.shankar, Deepak Goyal, anmolgoyal74, Sahana _N, geek-merlin, catch, lauriii, Meenakshi.g: Deprecate IE conditional comments support
parent 3d7dd76c
......@@ -150,6 +150,8 @@ public static function preRenderConditionalComments($element) {
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) {
......
......@@ -251,9 +251,11 @@ public function testNoCache() {
/**
* 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';
......
......@@ -206,22 +206,13 @@ public function providerPreRenderHtmlTag() {
$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
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment