Summary: | Copy / paste inside PRE element re-inserts PRE element | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | jaroslav.benc | ||||||
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | NEW --- | ||||||||
Severity: | Normal | CC: | ahmad.saleem792, ap, enrica, megan_gardner, rniwa, tony, wenson_hsieh | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | Windows 7 | ||||||||
Attachments: |
|
Description
jaroslav.benc
2012-05-23 18:49:48 PDT
Created attachment 143701 [details]
test case
The problem here is that pre has contenteditable so: if ((selectionStartWasStartOfParagraph && selectionEndWasEndOfParagraph && !startIsInsideMailBlockquote) || startBlock == currentRoot || isListItem(startBlock) || selectionIsPlainText) m_preventNesting = false; sets m_preventNesting false because startBlock is currentRoot. We should probably not set m_preventNesting false here in this case, and do this check later when we actually try to prevent nesting. Actually, all we need to do is to fix the FIXME added in: http://trac.webkit.org/changeset/98899/trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp Created attachment 151728 [details]
work in progress
I am not able to reproduce this bug in Safari 15.5 on macOS 12.4. It matches other browsers. Chrome Canary 104 - no <pre> or extra line added. Firefox Nightly - no <pre> or extra line added. It might have been fixed over the course or if I am testing it incorrectly, please retest accordingly. Else it can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks! I'm still getting the expected behavior from Firefox 101, but not from Safari or Chrome. |