New issue
Advanced search Search tips

Issue 597306 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

execCommand('insertHTML') doesn't insert original content as-is.

Reported by cyril.au...@gmail.com, Mar 23 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Steps to reproduce the problem:
1. https://jsfiddle.net/crl/gvau4uc8/2/
2. click once 'replace': it works fine
3. click again: wrapping issue

What is the expected behavior?
it should stay the same after replace

What went wrong?
the dom is different

Did this work before? N/A 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0

are there other ways to replace all content in a contenteditable (and keeping undo history)? or is it a bug?
 
Labels: M-51
Status: Untriaged (was: Unconfirmed)
Tested on Windows 7 using chrome stable M49-49.0.2623.87 and chrome canary M51-51.0.2688.0, Observed the dom is different while clicking the replace button.

Tested the same on previous version of chrome M35-35.0.1851.0, Observed no replace button displayed to check the issue. It's seen only after chrome M49 versions, so considering it as non-regression and marking it as untriaged.

Thanks!
it happens only when h1 is the first element, so not here https://jsfiddle.net/crl/gvau4uc8/3/
if it helps


Components: Blink>Editing

Comment 4 by yosin@chromium.org, Jul 15 2016

Components: -Blink>Editing Blink>Editing>Command
Status: Available (was: Untriaged)
Project Member

Comment 5 by sheriffbot@chromium.org, Jul 17 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
Summary: execCommand('insertHTML') doesn't insert original content as-is. (was: header block wraps a list block sibling after insertHTML command [blink, contenteditable, execCommand])
Simplify test.
<button id="replace">
  replace
</button>
<div id="foo" contenteditable>
  <h1> World</h1><ul><li>rips br's without our consent</li></ul>
</div>
<script>

replace.addEventListener('click', e=>{
  foo.focus();
  document.execCommand('selectAll');
  document.execCommand('insertHTML',null, `<h1> World</h1><ul><li>rips br's without our consent</li>
	      </ul>`);
});



Comment 7 by yosin@chromium.org, Oct 4 2017

Labels: Pri-3
Project Member

Comment 8 by sheriffbot@chromium.org, Oct 4

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment