Bug #78918

Pasting long text into the RTE leads to browser crashes

Added by Marco Huber over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2016-12-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The browser crashes, if you copy a long text into the RTE. This happens always in the IE and if you open the developer toolbar it happens in the firefox, too.

I think the reason is this patch: https://review.typo3.org/#/c/44810/

The event DOMSubtreeModified is triggered very often on changes in the RTE. And because everytime the event is triggered a complete form validation is startet, the script runtime gets to long and makes the browser crash.
How often the event is triggered depends on which transformations are done while pasting content into the RTE. I mean, which tags and attributes are allowed and which should be removed and so on.

Examples:
1. If you make a linebreak in an empty RTE, then the event is triggered 3 times.
2. If you paste the text "asd" into an emtpy RTE, then the event is triggered 1 time.
3. If you paste the two textblocks "TYPO3 Schulungen" and "TYPO3 Hosting" from https://typo3.bgm-gmbh.de/leistungen/ into an empty RTE, then the event is triggered more than 30 times (then my browser crached ;-)).
3.1 If you deaktivate the validation in the function Editor.prototype.onDOMSubtreeModified, then the event ist triggered "only" 9 times.

To count how often the event is triggered I added this code to the function Editor.prototype.onDOMSubtreeModified:

this.onDOMSubtreeModifiedCounter = this.onDOMSubtreeModifiedCounter || 0;
this.onDOMSubtreeModifiedCounter++;
console.log(this.onDOMSubtreeModifiedCounter);

Perheps there is a better event to start the validation? Perheps when the hidden textarea is updated? But I haven't found the place where this happens.


Files

Testtable.doc (38.5 KB) Testtable.doc Marco Huber, 2016-12-12 13:53

Related issues

Related to TYPO3 Core - Bug #70246: RTE fields do not handle eval validation like requiredClosedFrank Naegler2015-10-01

Actions

Also available in: Atom PDF