Issue #3095113 by gapple, longwave, ravi.shankar, Deepak Goyal, anmolgoyal74, Sahana _N, geek-merlin, catch, lauriii, Meenakshi.g: Deprecate IE conditional comments support
parent
3d7dd76cdf
commit
a60c3a47f6
|
@ -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) {
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue