Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 571420 chrome hangs on when creating bullet list in contenteditable
Starred by 7 users Reported by l...@symphony.com, Dec 21 2015 Back to list
Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Steps to reproduce the problem:
to see issue, run this html, also attached...

<html>
<head>
</head>
<body>
    <!-- the button with contenteditabla false will cause hang -->
    <div id='ce' contenteditable='true'>
        <p>line1<button contenteditable='false'>hello</button></p>
        <p>line2</p>
    </div>
    <!-- oh snap - hitting this button will cause app to hang -->
    <button id='bulletButton'>hang chrome</button>
    <script>
        var ceEl = document.getElementById('ce');
        document.getElementById('bulletButton').addEventListener('click', function() {
            // select all text in content editable element
            var range = document.createRange();
            range.selectNodeContents(ceEl);
            var selection = window.getSelection();
            selection.removeAllRanges();
            selection.addRange(range);

            // turn into bullets - this line hangs chrome and never returns
            document.execCommand('insertUnorderedList', false, null);
        });
    </script>
</body>
</html>

What is the expected behavior?
should turn two lines into bullets

What went wrong?
hang, 100% cpu usage in both chrome/safari (mac and windows).

Did this work before? N/A 

Chrome version: 47.0.2526.106  Channel: stable
OS Version: OS X 10.10.5
Flash Version: Shockwave Flash 20.0 r0

looks similiar to https://code.google.com/p/chromium/issues/detail?id=98682 but i couldn't not view link above for some reason
 
chromeHang.html
974 bytes View Download
Labels: -OS-Mac
Removing OS-Mac label per "mac and windows"
Cc: msrchandra@chromium.org
Labels: OS-All M-49 Cr-Blink-HTML Stability-Hang
Status: Untriaged
Able to reproduce this issue on Latest Stable# 47.0.2526.106 and Latest Canary# 49.0.2599.0 on Windows, Mac and Ubuntu.
This is a Non-Regression Issue existing from M30 build# 30.0.1549.0 (Official Build 208818) m.
Changing the status to Untriaged so that the issue could get addressed.
Thank You.
Comment 3 by tkent@chromium.org, Dec 28 2015
Labels: -Cr-Blink-HTML Cr-Blink-Editing
Comment 4 by yosin@chromium.org, Jan 8 2016
Status: Available
Blink stacks in while-loop in InsertListCommand::doApply() with following
condition is true:
  inSameTreeAndOrdered(startOfCurrentParagraph, startOfLastParagraph) && 
  !inSameParagraph(startOfCurrentParagraph, startOfLastParagraph, CanCrossEditingBoundary))

where |startOfCurrentParagraph| is P 5CA14180
|startOfLastParagaph| is #text	5CA182E0 "line2"

BODY	5CA14010
	#text	5CA180B0 "\n    "
	#comment	5CA18100
	#text	5CA18150 "\n    "
	DIV	5CA14124 ID="ce"
		#text	5CA181A0 "\n        "
		P	5CA14180
			UL	5CA142F0
				LI	5CA14238
					#text	5CA185B0 "line1"
				LI	5CA1434C
					BR	5CA14404
				LI	5CA14460
... omit LI/BR subtrees ...

			BUTTON	5CA28010
				#text	5CA18240 "hello"
		#text	5CA18290 "\n        "
		P	5CA141DC
*			#text	5CA182E0 "line2"
		#text	5CA18330 "\n    "
	#text	5CA18380 "\n    "
	#comment	5CA183D0
	#text	5CA18420 "\n    "
	BUTTON	5CA28098 ID="bulletButton"
		#text	5CA18470 "hang chrome"
	#text	5CA184C0 "\n    "
	SCRIPT	5CA34010
		#text	5CA18510 "... script ..."
	#text	5CA18560 "\n\n\n"


Project Member Comment 5 by bugdroid1@chromium.org, Aug 18 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f15d4cc339737df653274e39726ae0d14d409b18

commit f15d4cc339737df653274e39726ae0d14d409b18
Author: joone.hur <joone.hur@intel.com>
Date: Thu Aug 18 20:28:11 2016

No hang when inserting a list over uneditable element in contenteditable

While firstEditablePositionAfterPositionInRootAlgorithm() is running,
we can get the next editable paragraph under the highest editable
node by skipping non-editable paragraph.

However, if an editable paragraph has a non-editable child, the next
paragraph can be the same editable paragraph that is the parent of the
non-editable child. In this case, we can't get the next editable
paragraph in InsertListCommand::doApply's while loop. As a result,
the while loop can't break, which makes the tab hang.

Here is the example:
<div contenteditable="true">
  <p>line1<button contenteditable="false">hello</button></p>
  <p>line2</p>
</div>

This CL allows to get the next editable paragraph by considering the
non-editable child element.

BUG= 571420 
TEST=editing/selection/insert-list-over-uneditable-in-contenteditable.html

Review-Url: https://codereview.chromium.org/2250133004
Cr-Commit-Position: refs/heads/master@{#412925}

[add] https://crrev.com/f15d4cc339737df653274e39726ae0d14d409b18/third_party/WebKit/LayoutTests/editing/selection/insert-list-over-uneditable-in-contenteditable.html
[modify] https://crrev.com/f15d4cc339737df653274e39726ae0d14d409b18/third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Comment 6 by co...@streak.com, Oct 7 2016
I've reported a similar issue at https://bugs.chromium.org/p/chromium/issues/detail?id=653732 that might have a related cause.
Comment 7 by joone....@intel.com, Oct 19 2016
Owner: joone....@intel.com
Status: Fixed
Sign in to add a comment