diff --git a/core/core.services.yml b/core/core.services.yml
index e791572..7f0183e 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -1420,7 +1420,7 @@ services:
     class: Drupal\Core\Asset\AssetDumper
   library.discovery:
     class: Drupal\Core\Asset\LibraryDiscovery
-    arguments: ['@library.discovery.collector', '@cache_tags.invalidator']
+    arguments: ['@library.discovery.collector']
   library.discovery.collector:
     class: Drupal\Core\Asset\LibraryDiscoveryCollector
     arguments: ['@cache.discovery', '@lock', '@library.discovery.parser', '@theme.manager']
diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscovery.php b/core/lib/Drupal/Core/Asset/LibraryDiscovery.php
index 6dd83f7..37e35e1 100644
--- a/core/lib/Drupal/Core/Asset/LibraryDiscovery.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscovery.php
@@ -8,9 +8,6 @@
 namespace Drupal\Core\Asset;
 
 use Drupal\Core\Cache\CacheCollectorInterface;
-use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
-use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\Theme\ThemeManagerInterface;
 
 /**
  * Discovers available asset libraries in Drupal.
@@ -25,13 +22,6 @@ class LibraryDiscovery implements LibraryDiscoveryInterface {
   protected $collector;
 
   /**
-   * The cache tag invalidator.
-   *
-   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
-   */
-  protected $cacheTagInvalidator;
-
-  /**
    * The final library definitions, statically cached.
    *
    * hook_library_info_alter() and hook_js_settings_alter() allows modules
@@ -46,16 +36,9 @@ class LibraryDiscovery implements LibraryDiscoveryInterface {
    *
    * @param \Drupal\Core\Cache\CacheCollectorInterface $library_discovery_collector
    *   The library discovery cache collector.
-   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tag_invalidator
-   *   The cache tag invalidator.
-   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
-   *   The module handler.
-   * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
-   *   The theme manager.
    */
-  public function __construct(CacheCollectorInterface $library_discovery_collector, CacheTagsInvalidatorInterface $cache_tag_invalidator) {
+  public function __construct(CacheCollectorInterface $library_discovery_collector) {
     $this->collector = $library_discovery_collector;
-    $this->cacheTagInvalidator = $cache_tag_invalidator;
   }
 
   /**
@@ -86,7 +69,8 @@ public function getLibraryByName($extension, $name) {
    * {@inheritdoc}
    */
   public function clearCachedDefinitions() {
-    $this->cacheTagInvalidator->invalidateTags(['library_info']);
+    $this->libraryDefinitions = [];
+    $this->collector->clear();
   }
 
 }
diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php
index 7ab83d5..21a81b9 100644
--- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php
@@ -84,4 +84,13 @@ protected function resolveCacheMiss($key) {
 
     return $this->storage[$key];
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function reset() {
+    parent::reset();
+    $this->cid = NULL;
+  }
+
 }
diff --git a/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php b/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php
index 2ddccea..7b8c9ac 100644
--- a/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php
+++ b/core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php
@@ -10,36 +10,39 @@
 use Drupal\simpletest\KernelTestBase;
 
 /**
- * Tests the element info.
+ * Tests the library discovery service.
  *
  * @group Render
  */
 class LibraryDiscoveryIntegrationTest extends KernelTestBase {
 
   /**
-   * {@inheritdoc}
+   * Tests that hook_library_info is invoked and the cache is cleared.
    */
-  protected function setUp() {
-    parent::setUp();
-
-    $this->container->get('theme_handler')->install(['test_theme', 'classy']);
-  }
-
-  /**
-   * Ensures that the element info can be altered by themes.
-   */
-  public function testElementInfoByTheme() {
+  public function testHookLibraryInfoByTheme() {
     /** @var \Drupal\Core\Theme\ThemeInitializationInterface $theme_initializer */
     $theme_initializer = $this->container->get('theme.initialization');
 
     /** @var \Drupal\Core\Theme\ThemeManagerInterface $theme_manager */
     $theme_manager = $this->container->get('theme.manager');
 
-    /** @var \Drupal\Core\Render\ElementInfoManagerInterface $element_info */
+    /** @var \Drupal\Core\Asset\LibraryDiscovery $library_discovery */
     $library_discovery = $this->container->get('library.discovery');
 
+    /** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
+    $theme_installer = $this->container->get('theme_installer');
+
+    // Install test_theme and verify that the library 'kitten' is added using
+    // hook_library_info_alter().
+    $theme_installer->install(['test_theme']);
     $theme_manager->setActiveTheme($theme_initializer->getActiveThemeByName('test_theme'));
     $this->assertTrue($library_discovery->getLibraryByName('test_theme', 'kitten'));
+
+    // Now make classy the active theme and assert that library is not added.
+    $theme_installer->install(['classy']);
+    $theme_manager->setActiveTheme($theme_initializer->getActiveThemeByName('classy'));
+    $library_discovery->clearCachedDefinitions();
+    $this->assertFalse($library_discovery->getLibraryByName('test_theme', 'kitten'));
   }
 
 }
diff --git a/core/modules/system/tests/themes/test_theme/test_theme.theme b/core/modules/system/tests/themes/test_theme/test_theme.theme
index 36cb4d5..aa399b6 100644
--- a/core/modules/system/tests/themes/test_theme/test_theme.theme
+++ b/core/modules/system/tests/themes/test_theme/test_theme.theme
@@ -29,8 +29,13 @@ function test_theme_element_info_alter(&$info) {
   }
 }
 
-function test_theme_library_info_alter(&$libraries) {
-  $libraries['kitten']['js'][] = 'kittens.js';
+/**
+ * Implements hook_library_info_alter().
+ */
+function test_theme_library_info_alter(&$libraries, $extension) {
+  if ($extension === 'test_theme') {
+    $libraries['kitten']['js']['kittens.js'] = [];
+  }
 }
 
 /**
