Problem/Motivation

CKEditor 5 35.2.1 is out: https://github.com/ckeditor/ckeditor5/releases/tag/v35.2.1

Steps to reproduce

Proposed resolution

  1. Update core/package.json
  2. cd core
  3. yarn install
  4. yarn build
  5. yarn build:ckeditor5-types

Remaining tasks

Fix test failures in the image url widget test

User interface changes

API changes

Data model changes

Release notes snippet

The version of CKEditor 5 has been updated from 35.1.0 to 35.2.1

Issue fork drupal-3313946

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review
StatusFileSize
new3.84 MB

Status: Needs review » Needs work

The last submitted patch, 2: 3313946-2-10.1.x.patch, failed testing. View results

wim leers’s picture

Priority: Normal » Major
Issue tags: +JavaScript

There were actually five errors in the failure above.

/var/www/html/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php:91
failed 4 times, and contains:

    $panel->find('xpath', "//button[span[text()='Insert']]")->click();

/var/www/html/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageUrlTest.php:109 failed once and contains the same.

So we need to investigate why/how CKEditor 35.2.0 broke our plugins/tests.

If I check the release notes at https://github.com/ckeditor/ckeditor5/releases/tag/v35.2.0, The image insertion pane is no longer empty if opened with the arrow down keystroke. seems most likely: https://github.com/ckeditor/ckeditor5/issues/12215. Investigation needed though.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nod_’s picture

So the selenium driver triggers a blur event on the input when using the setValue method. This blur makes the CKE5 tooltip disapear, and the insert button ends up ineffective => test failures.

When setValue does not trigger the blur event (with some manual hack) things work as expected.

nod_’s picture

Title: Update CKEditor 5 to 35.2.0 » Update CKEditor 5 to 35.2.1
Issue summary: View changes

35.2.1 has been released last week

nod_’s picture

I think the issue comes from this merge request: https://github.com/ckeditor/ckeditor5/pull/12319/ specifically this commit: https://github.com/ckeditor/ckeditor5/pull/12319/commits/633dead6b6d1a2d...

When adding text to an input, selenium will add the text and then trigger a blur() on the input element. It seems that this blur event (used let the browser trigger a "change" event if necessary) makes the dropdown close and our test fail.

nod_’s picture

If we defer the blur event from the Selenium2Driver method, tests pass.

nod_’s picture

Status: Needs work » Needs review

Yup, all green.

The issue is not a problem or a regression. CKE5 behaves as expected for a non-machine user (aka. a human), it's because of the default behavior of the selenium driver that the problem appeared once CKE5 fixed their accessibility.

Getting around it by setting the value in the JS directly. This wouldn't have been a problem with a nightwatch test doing the same thing for example.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Per my MR comment, see #3316274-24: Stabilize FunctionalJavascript testing AJAX: add ::assertExpectedAjaxRequest(), where a similar change was needed, but entirely in the Drupal sphere (Drupal's AJAX system getting triggered after setting a form value), compared to this being entirely in the CKEditor 5 sphere. Basically: Selenium/Mink are not realistic 😬

  • catch committed e3352f8 on 10.0.x
    Issue #3313946 by nod_, longwave, Wim Leers: Update CKEditor 5 to 35.2.1...
  • catch committed b4b36b9 on 10.1.x
    Issue #3313946 by nod_, longwave, Wim Leers: Update CKEditor 5 to 35.2.1
    
catch’s picture

Version: 10.1.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Needs work

Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!

There's a conflict in yarn.lock for 9.5.x so this will need a 9.5 version.

Opened a follow-up for the Mink subclass.

nod_’s picture

Assigned: Unassigned » nod_
nod_’s picture

Assigned: nod_ » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.92 MB
nod_’s picture

forgot to update the tests, hang on

nod_’s picture

StatusFileSize
new3.92 MB
new2.02 KB
wim leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs release note
Related issues: +#3316816: Stabilize FunctionalJavascript testing AJAX: make ::setValue() trigger both "input" and "formUpdated" events

LGTM

FYI, the #18 interdiff (which was also committed to the 10.0.x and 10.1.x branches) will be obsolete (i.e. will get reverted) in #3316816: Stabilize FunctionalJavascript testing AJAX: make ::setValue() trigger both "input" and "formUpdated" events 🤓

  • catch committed d31e7ca on 9.5.x
    Issue #3313946 by nod_, longwave, Wim Leers: Update CKEditor 5 to 35.2.1
    
catch’s picture

Version: 9.5.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Needs work

Ah didn't realise there was already a follow-up open. Committed/pushed to 10.1.x and cherry-picked back to 10.0.x and 9.5.x.

If we want to backport this to 9.4, it'll need a 9.4-specific patch too. I'm assuming we do so leaving open there for that.

nod_’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new3.92 MB
longwave’s picture

Status: Needs review » Reviewed & tested by the community

The only difference between #18 and #22 is git noise and a couple of minor library differences that changed between 9.4.x and 9.5.x.

longwave’s picture

  • catch committed af047bc on 9.4.x
    Issue #3313946 by nod_, longwave, Wim Leers, catch: Update CKEditor 5 to...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +9.4.9 release notes

Committed/pushed to 9.4.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.