Bug 127690
Summary: | execCommand('insertHTML', ...) creates nested paragraphs under very specific circumstances | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tim Molendijk <tim> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.9 | ||
URL: | http://jsbin.com/OKuXiCA/1/edit |
Tim Molendijk
Steps to reproduce the problem:
1. Open provided URL
2. Click button to execute code as described on its label
3. Notice how a nested paragraph structure has been created (and the first inserted paragraphs ends up last in the created DOM tree - but that's probably related)
What is the expected behavior?
What Firefox does: create a DOM tree that looks like this:
<p>1st inserted</p>
<p><br></p>
<p><br></p>
What went wrong?
Instead it creates a DOM tree that looks like this:
<p><p></p></p>
<p>1st inserted</p>
Does it occur on multiple sites: Yes
Is it a problem with a plugin? No
Did this work before? N/A
Does this work in other browsers? No Safari (verified v7.0.1)
Chrome version: 34.0.1797.2 Channel: dev
OS Version: OS X 10.9.1
Flash Version: Shockwave Flash 12.0 r0
As soon as a layout is applied to all paragraphs, this misbehavior disappears. Or when the br element is removed from the initial contenteditable, this misbehavior disappears. And probably several more subtle requirements that I haven't discovered.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Tim Molendijk
I'm not sure whether "layout is applied" in the last paragraph is correct. I _am_ sure that when you apply min-height to every p (in CSS), the problem goes away.