Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for bookmarks created inside temporary elements #3487

Merged
merged 9 commits into from
Sep 25, 2019
Merged

Fix for bookmarks created inside temporary elements #3487

merged 9 commits into from
Sep 25, 2019

Conversation

Comandeer
Copy link
Member

@Comandeer Comandeer commented Sep 24, 2019

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What is the proposed changelog entry for this pull request?

* [#3423](https://github.com/ckeditor/ckeditor4/issues/3423) Fixed: [Bookmarks](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dom_range.html#method-createBookmark) can be created inside temporary elements.

What changes did you make?

I've forced bookmarks to be created outside temporary elements (elements with [data-cke-temp=1]). Thanks to that, widgets can now always restore bookmarks after copying.

I've also refactored CKEDITOR.dom.range#createBookmarks() by deduplicating logic connected with creating bookmark nodes. However this commit can be extracted to separate PR.

Closes #3423.
Closes #3482.

@f1ames
Copy link
Contributor

f1ames commented Sep 25, 2019

Since the CI was red, I have extracted the refactor commit to t/3423_refactor branch (basically it's a copy of initial PR) to keep minimal set of changes here.

@f1ames f1ames self-assigned this Sep 25, 2019
@Dumluregn
Copy link
Contributor

Seems like this breaks clipboard operations for widgets in IE8 - cutting, copying and pasting (dragging works fine).

@Comandeer
Copy link
Member Author

I've slightly modified createBookmarks method to not move selection outside of the temporary element if it's inside copybin or pastebin.

Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍


Unit tests

  • Chrome (CI) ✅
  • Firefox (CI) ✅
  • Safari (dev & build) ✅✅
  • IE8 (build) ✅
  • IE11 (dev & build) ✅✅
  • Edge (dev & build) ✅✅

Manual tests

With help of @msamsel and @Dumluregn 👍


After copypin/pastebin fix:

Unit tests

  • Chrome (CI) ✅
  • Firefox (CI) ✅

is:unit,path:/tests/plugins/widget,path:/tests/plugins/uploadwidget,name:bookmarks,path:/tests/core/dom,path:/tests/core/selection

  • Safari (dev) ✅
  • IE8 (dev) ✅
  • IE9 (dev) ✅
  • IE10 (dev) ✅
  • IE11 (dev) ✅
  • Edge (dev) ✅

Manual tests

is:manual,name:clipboardhtml,name:clipboardhtmlselectall,name:embed

  • Chrome ✅
  • Firefox ✅
  • Safari ✅
  • IE8 ✅
  • IE9 ✅
  • IE10 ✅
  • IE11 ✅
  • Edge ✅

@f1ames f1ames merged commit fc9e912 into major Sep 25, 2019
@CKEditorBot CKEditorBot deleted the t/3423 branch September 25, 2019 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copying editor content with widget clears selection Bookmarks are created inside filler
3 participants