Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: Source/WebCore/editing/DeleteSelectionCommand.cpp

Issue 13532011: Stop inserting placeholders for TextArea and Input elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/WebCore/editing/TextIterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | Source/WebCore/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698