From c1005af3843eea418dc5ce2c033d75d263eb4f6e Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Sun, 18 Jan 2015 10:28:52 +0000 Subject: [PATCH] Issue #2405903 by Berdir, gvso: Our charset metatag is not valid HTML according to W3C validator --- core/modules/system/src/Tests/Installer/InstallerTest.php | 2 +- core/modules/system/src/Tests/Page/DefaultMetatagsTest.php | 3 +-- core/modules/system/system.module | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/modules/system/src/Tests/Installer/InstallerTest.php b/core/modules/system/src/Tests/Installer/InstallerTest.php index ee53a4e5b37c..b17e3e753553 100644 --- a/core/modules/system/src/Tests/Installer/InstallerTest.php +++ b/core/modules/system/src/Tests/Installer/InstallerTest.php @@ -39,7 +39,7 @@ protected function setUpLanguage() { // Test that \Drupal\Core\Render\BareHtmlPageRenderer adds assets and // metatags as expected to the first page of the installer. $this->assertRaw('core/themes/seven/css/components/buttons.css'); - $this->assertRaw('<meta name="charset" charset="utf-8" />'); + $this->assertRaw('<meta charset="utf-8" />'); parent::setUpLanguage(); } } diff --git a/core/modules/system/src/Tests/Page/DefaultMetatagsTest.php b/core/modules/system/src/Tests/Page/DefaultMetatagsTest.php index 5739137f9cee..beb43c0d8b59 100644 --- a/core/modules/system/src/Tests/Page/DefaultMetatagsTest.php +++ b/core/modules/system/src/Tests/Page/DefaultMetatagsTest.php @@ -22,12 +22,11 @@ class DefaultMetatagsTest extends WebTestBase { public function testMetaTag() { $this->drupalGet(''); // Ensures that the charset metatag is on the page. - $result = $this->xpath('//meta[@name="charset" and @charset="utf-8"]'); + $result = $this->xpath('//meta[@charset="utf-8"]'); $this->assertEqual(count($result), 1); // Ensure that the charset one is the first metatag. $result = $this->xpath('//meta'); - $this->assertEqual((string) $result[0]->attributes()->name, 'charset'); $this->assertEqual((string) $result[0]->attributes()->charset, 'utf-8'); // Ensure that the shortcut icon is on the page. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 255449ecf6ec..7c6771471ca5 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -551,7 +551,6 @@ function system_page_attachments(array &$page) { 'system_meta_content_type' => array( '#tag' => 'meta', '#attributes' => array( - 'name' => 'charset', 'charset' => 'utf-8', ), // Security: This always has to be output first. -- GitLab