Bug #78918
closedPasting long text into the RTE leads to browser crashes
0%
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
Updated by Marco Huber about 8 years ago
- Category set to RTE (rtehtmlarea + ckeditor)
Updated by Gerrit Code Review about 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50932
Updated by Marco Huber about 8 years ago
- File Testtable.doc Testtable.doc added
I can reproduce this bug in the IE11 with pasting the table from the attached doc and the following TsConfig:
User-TsConfig:
setup.default.rteCleanPasteBehaviour = pasteStructure
Page-TsConfig:
RTE.default { buttons{ pastetoggle { setActiveOnRteOpen = 1 hidden = 1 } pastebehaviour { pasteStructure.keepTags = a,p,h[2-3],pre,address,article,aside,blockquote,div,footer,header,nav,section,hr,br,table,thead,tbody,tfoot,caption,tr,th,td,ul,ol,dl,li,dt,dd,b,i,strong,em } } }
Updated by Gerrit Code Review about 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50932
Updated by Gerrit Code Review about 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50932
Updated by Gerrit Code Review almost 8 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50932
Updated by Gerrit Code Review almost 8 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50932
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Under Review to Closed
We are sorry, but we close this issue as now TYPO3 uses CKEditor and RTEHtmlarea is no more supported by TYPO3 .
RTEHtmlarea development has stopped - it has been decoupled from the core and its code is available on GitHub:
https://github.com/FriendsOfTYPO3/rtehtmlarea
If you still need this fixed please create a PR on GitHub
Regards
Riccardo De Contardi