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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp

Issue 1785603002: TEXTAREA: Cutting last line without EOL should not remove the remaining EOL in the previous line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 267
268 void HTMLTextAreaElement::handleFocusEvent(Element*, WebFocusType) 268 void HTMLTextAreaElement::handleFocusEvent(Element*, WebFocusType)
269 { 269 {
270 if (LocalFrame* frame = document().frame()) 270 if (LocalFrame* frame = document().frame())
271 frame->spellChecker().didBeginEditing(this); 271 frame->spellChecker().didBeginEditing(this);
272 } 272 }
273 273
274 void HTMLTextAreaElement::subtreeHasChanged() 274 void HTMLTextAreaElement::subtreeHasChanged()
275 { 275 {
276 #if ENABLE(ASSERT)
277 // The innerEditor should have either Text nodes or a placeholder break
278 // element. If we see other nodes, we need to fix editing code.
yosin_UTC9 2016/03/10 08:33:15 nit: one space after "."?
tkent 2016/03/10 08:42:38 Done.
279 Element* innerEditor = innerEditorElement();
280 for (Node& node : NodeTraversal::descendantsOf(*innerEditor)) {
281 if (node.isTextNode())
282 continue;
283 ASSERT(isHTMLBRElement(node));
284 ASSERT(&node == innerEditor->lastChild());
285 }
286 #endif
287 addPlaceholderBreakElementIfNecessary();
276 setChangedSinceLastFormControlChangeEvent(true); 288 setChangedSinceLastFormControlChangeEvent(true);
277 m_valueIsUpToDate = false; 289 m_valueIsUpToDate = false;
278 setNeedsValidityCheck(); 290 setNeedsValidityCheck();
279 setAutofilled(false); 291 setAutofilled(false);
280 updatePlaceholderVisibility(); 292 updatePlaceholderVisibility();
281 293
282 if (!focused()) 294 if (!focused())
283 return; 295 return;
284 296
285 // When typing in a textarea, childrenChanged is not called, so we need to f orce the directionality check. 297 // When typing in a textarea, childrenChanged is not called, so we need to f orce the directionality check.
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 661
650 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s ource) 662 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s ource)
651 { 663 {
652 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle ment&>(source); 664 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle ment&>(source);
653 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); 665 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion);
654 m_isDirty = sourceElement.m_isDirty; 666 m_isDirty = sourceElement.m_isDirty;
655 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); 667 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source);
656 } 668 }
657 669
658 } // namespace blink 670 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698