Pasting into inline elements style as "display: block" in ContentEditable causes them to split
Categories
(Core :: DOM: Editor, defect)
Tracking
()
People
(Reporter: samjclarke, Unassigned)
Details
Attachments
(1 file)
741 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1 Build ID: 20120713224749 Steps to reproduce: 1. Copy any part of the first (or any) paragraph on the attached page 2. Place the cursor in the middle of the word test in any of the examples 3. Paste the copied paragraph or paragraph section Actual results: The second example which is a span styled as "display: block" splits as if it was inline. Expected results: The second example shouldn't split, it should act like the last example which is a block level pre tag. It doesn't split in Chrome, IE or Opera. Although IE doesn't split the inline one either and Opera doesn't seem to paste anything other than plain text.
Updated•12 years ago
|
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Although I have a fix, Chrome and Safari have this issue too. Should we ignore CSS and keep the existing behavior here?
Comment 2•4 years ago
|
||
(In reply to Kagami :saschanaz from comment #1)
Although I have a fix, Chrome and Safari have this issue too. Should we ignore CSS and keep the existing behavior here?
Really? I see different result on Windows. Chrome splits <span>
element in the first testcase, and insert a text node between them. And also Chrome splits <span>
element in the second testcase, and keep new text node and right <span>
element to be in same hard line with setting style="display: inline !important;"
. I think that Chrome's behavior does make sense.
Comment 3•4 years ago
|
||
Ah, I mean they still split <span>
. I think the result can simply be <span>TeCopy any part of me.st</span>
, why should it be <span>Te<span style="display: inline !important;">Copy any part of me.</span><span style="display: inline !important;">st</span>
? Chrome also does the same splitting for <div>
which makes me confused.
Comment 4•4 years ago
|
||
In my understanding, user does not try to copy/paste line breaks in the testcase. So, not breaking existing line with pasting content which does not include line breaks must be expected by user. So, I think your idea is also fine to me.
(And I forgot that quoted text of Thunderbird's plaintext email composer is wrapped with <span style="white-space: pre-wrap; display: block; width: 98vw;">
, be careful about this. But I guess that, it does not become problem because EditorBase::IsPlaintextEditor()
returns true
in this case.)
Comment 5•3 years ago
|
||
Haven't been working on it, unassigning myself...
Updated•2 years ago
|
Description
•