Bug 183741 - Nested tables inside iframe hangs Safari
Summary: Nested tables inside iframe hangs Safari
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://codepen.io/msamsel/pen/qoqMpd
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-19 05:10 PDT by m.samsel
Modified: 2018-03-27 06:19 PDT (History)
7 users (show)

See Also:


Attachments
Video shown CPU consumption during bug (9.58 MB, video/mp4)
2018-03-19 05:15 PDT, m.samsel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description m.samsel 2018-03-19 05:10:57 PDT
Tested on Safari Version 11.0.3 (13604.5.6) under MacOS Version 10.13.3 (17D102)

Description:
Having nested tables inside iframe with contenteditable="true" hang the browser. CPU consumption reach 100% and page stop responding.

1. Open sample: https://codepen.io/msamsel/pen/qoqMpd or create html page with code mentioned below
2. Click into table
3. Wait around 5 seconds and try to click somewhere else.

Actual result:
Browser hangs and became not responding

Please take a look into attached video. I add activity monitor showing how CPU consumption start to reach 100%.

--- HTML CODE ---

<!doctype html>
<html lang='en'>
	<head>
		<meta charset="utf-8">
		<title>TEST PAGE</title>
	</head>
	<body>
		<iframe width="100" height="100" srcdoc='<!doctype html><html><head><title>Editor</title></head><body><table border="1"><tr><td><table border="1"><tr><td><table border="1"><tr><td></td></tr></table></td></tr></table></td></tr></table></body></html>'></iframe>
	</body>
</html>
Comment 1 m.samsel 2018-03-19 05:15:06 PDT
Created attachment 336039 [details]
Video shown CPU consumption during bug
Comment 2 Alexey Proskuryakov 2018-03-23 16:28:52 PDT
I can reproduce with the codepen.io link, but not with the posted HTML code saved to a local file.

It's spinning in editing code (WebPage::didChangeSelection->WebPage::editorState->WebPage::platformEditorState->Editor::stringForCandidateRequest).
Comment 3 Radar WebKit Bug Importer 2018-03-23 16:29:33 PDT
<rdar://problem/38812455>
Comment 4 Mattias Wikström 2018-03-27 06:19:34 PDT
We are also seeing this issue in TinyMCE, the editor freezes with nested tables. 

Here is an issue on out bug tracker regarding it: https://github.com/tinymce/tinymce/issues/3995