diff --git a/core/lib/Drupal/Core/Render/Element/Html.php b/core/lib/Drupal/Core/Render/Element/Html.php index 0a83d56..d7888ec 100644 --- a/core/lib/Drupal/Core/Render/Element/Html.php +++ b/core/lib/Drupal/Core/Render/Element/Html.php @@ -15,10 +15,6 @@ class Html extends RenderElement { public function getInfo() { return array( '#theme' => 'html', - // HTML5 Shiv - '#attached' => array( - 'library' => array('core/html5shiv'), - ), ); } diff --git a/core/modules/system/src/Tests/Common/NoJavaScriptAnonymousTest.php b/core/modules/system/src/Tests/Common/NoJavaScriptAnonymousTest.php index 0e1e298..5738074 100644 --- a/core/modules/system/src/Tests/Common/NoJavaScriptAnonymousTest.php +++ b/core/modules/system/src/Tests/Common/NoJavaScriptAnonymousTest.php @@ -33,34 +33,27 @@ public function testNoJavaScript() { // Test frontpage. $this->drupalGet(''); - $this->assertNoJavaScriptExceptHtml5Shiv(); + $this->assertNoJavaScript(); // Test node page. $this->drupalGet('node/1'); - $this->assertNoJavaScriptExceptHtml5Shiv(); + $this->assertNoJavaScript(); // Test user profile page. $this->drupalGet('user/' . $user->id()); - $this->assertNoJavaScriptExceptHtml5Shiv(); + $this->assertNoJavaScript(); } /** - * Passes if no JavaScript is found on the page except the HTML5 shiv. - * - * The HTML5 shiv is necessary for e.g. the
tag which Drupal 8 uses - * to work in older browsers like Internet Explorer 8. + * Passes if no JavaScript is found on the page. */ - protected function assertNoJavaScriptExceptHtml5Shiv() { + protected function assertNoJavaScript() { // Ensure drupalSettings is not set. $settings = $this->getDrupalSettings(); $this->assertTrue(empty($settings), 'drupalSettings is not set.'); - // Ensure the HTML5 shiv exists. - $this->assertRaw('html5shiv/html5shiv.min.js', 'HTML5 shiv JavaScript exists.'); - - // Ensure no other JavaScript file exists on the page, while ignoring the - // HTML5 shiv. - $this->assertNoPattern('/(?assertNoPattern('/\.js/', 'No other JavaScript exists.'); } } diff --git a/core/modules/system/src/Tests/Render/AjaxPageStateTest.php b/core/modules/system/src/Tests/Render/AjaxPageStateTest.php index 08cd276..700c82d 100644 --- a/core/modules/system/src/Tests/Render/AjaxPageStateTest.php +++ b/core/modules/system/src/Tests/Render/AjaxPageStateTest.php @@ -24,55 +24,39 @@ protected function setUp() { $this->adminUser = $this->drupalCreateUser(array_keys(\Drupal::service('user.permissions') ->getPermissions())); - // Log in so there are more libraries to test with otherwise only html5shiv - // is the only one in the source we can easily test for. + // Log in so there are more libraries to test for. $this->drupalLogin($this->adminUser); } /** * Default functionality without the param ajax_page_state[libraries]. * - * The libraries html5shiv and drupalSettings are loaded default from core + * The libraries drupalSettings are loaded default from core * and available in code as scripts. Do this as the base test. */ public function testLibrariesAvailable() { $this->drupalGet('node', array()); $this->assertRaw( - '/core/assets/vendor/html5shiv/html5shiv.min.js', - 'The html5shiv library from core should be loaded.' - ); - $this->assertRaw( '/core/misc/drupalSettingsLoader.js', 'The drupalSettings library from core should be loaded.' ); } /** - * Give ajax_page_state[libraries]=core/html5shiv to exclude the library. + * Give ajax_page_state[libraries]=core/drupalSettings to exclude the library. * - * When called with ajax_page_state[libraries]=core/html5shiv the library + * When called with ajax_page_state[libraries]=core/drupalSettings the library * should be excluded as it is already loaded. This should not affect other * libraries so test if drupalSettings is still available. */ - public function testHtml5ShivIsNotLoaded() { + public function testDrupalSettingsIsNotLoaded() { $this->drupalGet('node', - array( - "query" => - array( - 'ajax_page_state' => array( - 'libraries' => 'core/html5shiv' - ) - ) - ) - ); - $this->assertNoRaw( - '/core/assets/vendor/html5shiv/html5shiv.min.js', - 'The html5shiv library from core should be excluded from loading' + ['query' => ['ajax_page_state' => ['libraries' => 'core/drupalSettings']]] ); - $this->assertRaw( + $this->assertNoRaw( '/core/misc/drupalSettingsLoader.js', - 'The drupalSettings library from core should be loaded.' + 'The drupalSettings library from core should be excluded from loading.' ); } @@ -84,18 +68,7 @@ public function testHtml5ShivIsNotLoaded() { */ public function testMultipleLibrariesAreNotLoaded() { $this->drupalGet('node', - array( - "query" => - array( - 'ajax_page_state' => array( - 'libraries' => 'core/html5shiv,core/drupalSettings' - ) - ) - ) - ); - $this->assertNoRaw( - '/core/assets/vendor/html5shiv/html5shiv.min.js', - 'The html5shiv library from core should be excluded from loading.' + ['query' => ['ajax_page_state' => ['libraries' => 'core/drupalSettings']]] ); $this->assertNoRaw( diff --git a/core/modules/system/src/Tests/Theme/ThemeInfoTest.php b/core/modules/system/src/Tests/Theme/ThemeInfoTest.php index 043986a..2c44e56 100644 --- a/core/modules/system/src/Tests/Theme/ThemeInfoTest.php +++ b/core/modules/system/src/Tests/Theme/ThemeInfoTest.php @@ -90,13 +90,13 @@ public function testChanges() { $active_theme = $this->themeManager->getActiveTheme(); // Make sure we are not testing the wrong theme. $this->assertEqual('test_theme', $active_theme->getName()); - $this->assertEqual(['classy/base', 'core/normalize', 'test_theme/global-styling'], $active_theme->getLibraries()); + $this->assertEqual(['core/html5shiv', 'classy/base', 'core/normalize', 'test_theme/global-styling'], $active_theme->getLibraries()); // @see theme_test_system_info_alter() $this->state->set('theme_test.modify_info_files', TRUE); drupal_flush_all_caches(); $active_theme = $this->themeManager->getActiveTheme(); - $this->assertEqual(['classy/base', 'core/normalize', 'test_theme/global-styling', 'core/backbone'], $active_theme->getLibraries()); + $this->assertEqual(['core/html5shiv', 'classy/base', 'core/normalize', 'test_theme/global-styling', 'core/backbone'], $active_theme->getLibraries()); } } diff --git a/core/themes/bartik/bartik.info.yml b/core/themes/bartik/bartik.info.yml index 130d583..dbc44c4 100644 --- a/core/themes/bartik/bartik.info.yml +++ b/core/themes/bartik/bartik.info.yml @@ -20,6 +20,8 @@ version: VERSION core: 8.x libraries: - bartik/global-styling +libraries-override: + core/html5shiv: false ckeditor_stylesheets: - css/base/elements.css - css/components/captions.css diff --git a/core/themes/classy/classy.info.yml b/core/themes/classy/classy.info.yml index 34b07b5..1afa884 100644 --- a/core/themes/classy/classy.info.yml +++ b/core/themes/classy/classy.info.yml @@ -7,6 +7,7 @@ core: 8.x hidden: true libraries: + - core/html5shiv - classy/base - core/normalize diff --git a/core/themes/seven/seven.info.yml b/core/themes/seven/seven.info.yml index 9452d5a..e1f7859 100644 --- a/core/themes/seven/seven.info.yml +++ b/core/themes/seven/seven.info.yml @@ -36,6 +36,8 @@ libraries-override: assets/vendor/jquery.ui/themes/base/dialog.css: false classy/dialog: seven/seven.drupal.dialog + core/html5shiv: false + libraries-extend: core/drupal.vertical-tabs: - seven/vertical-tabs diff --git a/core/themes/stable/stable.info.yml b/core/themes/stable/stable.info.yml index 3476833..1f9da3d 100644 --- a/core/themes/stable/stable.info.yml +++ b/core/themes/stable/stable.info.yml @@ -7,6 +7,9 @@ core: 8.x base theme: false hidden: true +libraries: + - core/html5shiv + libraries-override: block/drupal.block.admin: css: