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

Certain list structures cause the editor to crash when using Document lists alongside GHS #15527

Closed
mabryl opened this issue Dec 14, 2023 · 6 comments · Fixed by #15634
Closed
Assignees
Labels
package:html-support package:list squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@mabryl
Copy link
Contributor

mabryl commented Dec 14, 2023

📝 Provide detailed reproduction steps (if any)

  1. Create a build that utilizes Document lists alongside GHS with support enabled for <div> elements
  2. Provide the following HTML to the editor:
<div><ol><li>asd</li><li><div><ol><li>asd</li></ol></div></li></ol></div>
  1. Try removing the sublist a item in the second list item

✔️ Expected result

The editor shouldn't crash.

❌ Actual result

The entire tab freezes, no error thrown in the console:

document-list-freeze.mov

❓ Possible solution

It looks like something weird is happening with the second <div> because removing it from the markup resolves the issue.

📃 Other details

  • Browser: cross-browser
  • OS: cross-OS
  • First affected CKEditor version: N/A
  • Installed CKEditor plugins: N/A

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@mabryl mabryl added type:bug This issue reports a buggy (incorrect) behavior. package:list support:2 An issue reported by a commercially licensed client. squad:core Issue to be handled by the Core team. package:html-support labels Dec 14, 2023
@mabryl mabryl changed the title Certain list structures cause the editor to crash when using Document lists alongside GHS Certain list structures cause the editor to crash when using Document lists Dec 14, 2023
@mabryl mabryl changed the title Certain list structures cause the editor to crash when using Document lists Certain list structures cause the editor to crash when using Document lists alongside GHS Dec 14, 2023
@Witoso
Copy link
Member

Witoso commented Dec 14, 2023

@mabryl could you check if how turning on the AdjacentListsSupport  plugin influences this scenario?

@mabryl
Copy link
Contributor Author

mabryl commented Dec 14, 2023

@Witoso just checked it and there seems to be no difference in behavior, unfortunately:

adjacent-lists-freeze.mov

@mabryl
Copy link
Contributor Author

mabryl commented Dec 14, 2023

Also, I just noticed that, if you wait long enough, you will eventually see some errors in the console. Namely: ckeditorerror.js:90 Uncaught RangeError: Map maximum size exceeded.

Additionally, a warning can be seen: [Violation] 'beforeinput' handler took 365676ms.

image

@Witoso
Copy link
Member

Witoso commented Dec 15, 2023

Thanks for checking, we will take a look at this! One important thing to mention is that it's highly unadvisable to use div's like that, as it's not possible to escape them when writing (rel: #6462).

@FilipTokarski
Copy link
Member

Related #15565 ?

@niegowski niegowski self-assigned this Jan 4, 2024
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jan 4, 2024
@niegowski
Copy link
Contributor

This was a post-fixer loop. Two post-fixers were fixing each other changes. One was removing GHS-related list attributes (and it was doing it too greedy) and the other was adding them since they were expected.

This problem was caused by:

for ( const { item } of change.range.getWalker( { shallow: true } ) ) {

It was trying to iterate the attribute change "shallowly" but for attribute change on an element the range starts before an element and ends just inside it and the walker with the shallow option does not stop properly and follows the document until its end.

niegowski added a commit that referenced this issue Jan 5, 2024
Fix (html-support): The editor should not stuck in an infinite post-fixing loop while modifying a list structure inside a GHS element. Closes #15527. Closes #15565.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jan 5, 2024
@CKEditorBot CKEditorBot added this to the iteration 70 milestone Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:html-support package:list squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants