ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.8k stars 2.48k forks source link

Failing tests: plugins/clipboard/drop [SAFARI] #4818

Closed sculpt0r closed 3 years ago

sculpt0r commented 3 years ago

Type of report

Bug

Provide detailed reproduction steps (if any)

Failing tests:

Expected result

What is the expected result of the above steps? Tests passed.

Actual result

What is the actual result of the above steps?

Tests failed. All of them failed with:

Error
TypeError: undefined is not an object (evaluating 'bookmark.is2')
tests/plugins/clipboard/drop test internal drag and drop on editors margin (framed)

Timeout: wait() called but resume() never called.
Expected: undefined (undefined)
Actual:   undefined (undefined)

With proper test case name of course

Other details

sculpt0r commented 3 years ago

It is not failing on Safari 13.1 🤔 Also, not failing on Chrome, FF.

Failing even back to 4.14.0 so it looks like safari problem here.

f1ames commented 3 years ago

It would be good to check if it's only the test which is failing or something is broken with drag and drop handling. cc @sculpt0r

sculpt0r commented 3 years ago

This test was added as a response for https://github.com/ckeditor/ckeditor4/issues/2292. There is also a manual test for this issue: droponmargin which seems to be working.

In this line: https://github.com/ckeditor/ckeditor4/blob/7ccffe9ba5255672b4aa6d185b087ce135b81ed8/plugins/clipboard/plugin.js#L2016 createBookmarks() returns an empty array in safari 14.1.2 while in safari 13.1 it is an array with a single element. It has only startNode and is collapsed.

It is because of this line: https://github.com/ckeditor/ckeditor4/blob/7ccffe9ba5255672b4aa6d185b087ce135b81ed8/core/selection.js#L2443 and the getRanges() function gives us an empty array on the newest safari.

sculpt0r commented 3 years ago

Duplicate: https://github.com/ckeditor/ckeditor4/issues/4689