Unverified Commit 77657fb6 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3260032 by longwave, bnjmnm, Wim Leers, samuel.mortenson: CKEditor 5...

Issue #3260032 by longwave, bnjmnm, Wim Leers, samuel.mortenson: CKEditor 5 adds ie11.user.warnings library to every page, triggering a FOUC even for anonymous users
parent c055bd25
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ drupal.ckeditor5:
    - core/ckeditor5
    - editor/drupal.editor
    - ckeditor5/drupal.ckeditor5.quickedit-temporary-work-around
    - ckeditor5/ie11.user.warnings

drupal.ckeditor5.quickedit-temporary-work-around:
  deprecated: "Temporary work-around until https://www.drupal.org/project/drupal/issues/3196689 lands."
+0 −11
Original line number Diff line number Diff line
@@ -391,17 +391,6 @@ function ckeditor5_library_info_alter(&$libraries, $extension) {
    $libraries['drupal.filter.admin']['dependencies'][] = 'ckeditor5/drupal.ckeditor5.filter.admin';
  }

  // If the 'ckeditor5/ie11.user.warnings' library is added as a dependency of
  // other Ckeditor 5 libraries, it won't reliably work as the CKEditor 5 assets
  // are loaded via AJAX, and the IE11-incompatible syntax in CKEditor 5 can
  // prevent the AJAX call from successfully loading the functionality in
  // 'ckeditor5/ie11.user.warnings'. Adding this as a dependency of
  // 'system/base', as excessive as it may seem, is the most reliable way to
  // assure it is loaded as part of the page request.
  if ($extension === 'system') {
    $libraries['base']['dependencies'][] = 'ckeditor5/ie11.user.warnings';
  }

  $moduleHandler = \Drupal::moduleHandler();
  // Only add translation processing if the locale module is enabled.
  if (!$moduleHandler->moduleExists('locale')) {
+3 −3
Original line number Diff line number Diff line
@@ -205,9 +205,6 @@ public function testArticleNode() {

    $this->drupalGet('node/' . $node->id());

    // Confirm that the JavaScript that generates IE11 warnings loads.
    $assert_session->elementExists('css', 'script[src*="ckeditor5/js/ie11.user.warnings.js"]');

    // Initial state.
    $this->awaitQuickEditForEntity('node', 1);
    $this->assertEntityInstanceStates([
@@ -229,6 +226,9 @@ public function testArticleNode() {
      'node/1/body/en/full' => 'candidate',
    ]);

    // Confirm that the JavaScript that generates IE11 warnings loads.
    $assert_session->elementExists('css', 'script[src*="ckeditor5/js/ie11.user.warnings.js"]');

    // Click the body field.
    hold_test_response(TRUE);
    $this->click('[data-quickedit-field-id="node/1/body/en/full"]');