ckeditor / ckeditor4

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

Memory leak in Source Code Editing when having thousand of words #5492

Closed syhrimr closed 1 year ago

syhrimr commented 1 year ago

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Go to https://ckeditor.com/docs/ckeditor4/latest/examples/sourcearea.html
  2. In either source code area or dialog, input a long content. In here I input a around 5,9k words long content with images and computed style texts. You can put this code that I used to reproduce the issue https://codepen.io/syhrimr/pen/JjeGVgo

image

  1. Check the dev tools and there will be an error

    Error: attribute viewBox: Expected number, "0 0 100% 4".

Expected result

Fixed the error and memory leak.

Actual result

In my case, since the content is long, the error occurs more than 20k times and causes memory leak.

image image

Other details

Comandeer commented 1 year ago

Could you provide a content used for the reproduction?

syhrimr commented 1 year ago

@Comandeer here the content code that used for reproduction, I put it on Codepen https://codepen.io/syhrimr/pen/JjeGVgo

Comandeer commented 1 year ago

I'm not able to reproduce the error. I've tried pasting the content into the CKEditor 4 sample and the browser's console does not show any error connected to SVG.

syhrimr commented 1 year ago

Okay, so I found the root cause. The memory leak was coming from my browser extensions Microsoft Editor: Spelling and Grammar. Seems it got a bug with the error I reported above coming from it and aggressively check every text in the RTE.