Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp |
| index 3cb4c6e774b708b134af2de98f96c7aa9e8731ed..88726704171fc95cdae302e9982fe7c3496ee0f7 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp |
| @@ -273,6 +273,18 @@ void HTMLTextAreaElement::handleFocusEvent(Element*, WebFocusType) |
| void HTMLTextAreaElement::subtreeHasChanged() |
| { |
| +#if ENABLE(ASSERT) |
| + // The innerEditor should have either Text nodes or a placeholder break |
| + // 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.
|
| + Element* innerEditor = innerEditorElement(); |
| + for (Node& node : NodeTraversal::descendantsOf(*innerEditor)) { |
| + if (node.isTextNode()) |
| + continue; |
| + ASSERT(isHTMLBRElement(node)); |
| + ASSERT(&node == innerEditor->lastChild()); |
| + } |
| +#endif |
| + addPlaceholderBreakElementIfNecessary(); |
| setChangedSinceLastFormControlChangeEvent(true); |
| m_valueIsUpToDate = false; |
| setNeedsValidityCheck(); |