[Webkit-unassigned] [Bug 9527] REGRESSION: Pasting text in native text area inserts text one character before it should

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Sun Jun 25 15:47:58 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9527


darin at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |justin.garcia at apple.com
          Component|Forms                       |HTML Editing




------- Comment #1 from darin at apple.com  2006-06-25 15:47 PDT -------
The cause of this problem is this code in ReplaceSelectionCommand::doApply:

        if (!isEndOfParagraph(visibleStart) &&
!isStartOfParagraph(visibleStart)) {
            insertParagraphSeparator();
            setEndingSelection(VisiblePosition(endingSelection().start(),
VP_DEFAULT_AFFINITY).previous());
        }

It seems crazy to me that we always insert a paragraph separator for any paste.
But given that we try to do so, there are problems with this code.

The main problem is that insertParagraphSeparator is not guaranteed to insert
anything. There are two cases where it won't, as you can see by
readingInsertParagraphSeparatorCommand::doApply. For example:

    1) If we're in an empty list item, we will break out of the list.
    2) If the startBlock has no parent node, we will do nothing.

In this bug the case is (2). The fix could be as simple as changing
the startBlock->parentNode() case to create a new block that's a child of
startBlock or to use InsertLineBreakCommand the way the isTableCell case does.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list