Index: Source/WebCore/editing/DeleteSelectionCommand.cpp |
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp |
index 6e7f44aa4e64f7268edb7a86c1de52f98bb54ba8..54f94ec886aaa8f2e952883dc437992cc3c2601b 100644 |
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp |
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp |
@@ -37,6 +37,7 @@ |
#include "htmlediting.h" |
#include "HTMLInputElement.h" |
#include "HTMLNames.h" |
+#include "HTMLTextAreaElement.h" |
#include "NodeTraversal.h" |
#include "RenderTableCell.h" |
#include "Text.h" |
@@ -791,8 +792,8 @@ void DeleteSelectionCommand::doApply() |
String originalString = originalStringForAutocorrectionAtBeginningOfSelection(); |
// If the deletion is occurring in a text field, and we're not deleting to replace the selection, then let the frame call across the bridge to notify the form delegate. |
+ Element* textControl = enclosingTextFormControl(m_selectionToDelete.start()); |
if (!m_replace) { |
- Element* textControl = enclosingTextFormControl(m_selectionToDelete.start()); |
if (textControl && textControl->focused()) |
document()->frame()->editor()->textWillBeDeletedInTextField(textControl); |
} |
@@ -803,7 +804,8 @@ void DeleteSelectionCommand::doApply() |
Position downstreamEnd = m_selectionToDelete.end().downstream(); |
m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart(), CanCrossEditingBoundary) |
&& isEndOfParagraph(m_selectionToDelete.visibleEnd(), CanCrossEditingBoundary) |
- && !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd()); |
+ && !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd()) |
+ && !isHTMLTextAreaElement(textControl) && !textControl->toInputElement(); |
ojan
2013/04/08 19:23:36
If you're willing to try it out, I had a more gene
aurimas (slooooooooow)
2013/04/09 21:54:21
I tried adding !m_endingPosition.containerNode()->
leviw_travelin_and_unemployed
2013/04/09 23:54:29
Ojan, I think your change is correct, but simply v
|
if (m_needPlaceholder) { |
// Don't need a placeholder when deleting a selection that starts just before a table |
// and ends inside it (we do need placeholders to hold open empty cells, but that's |