| OLD | NEW |
| 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 Loading... |
| 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, it's a bug in editing code and we should |
| 279 // fix it. |
| 280 Element* innerEditor = innerEditorElement(); |
| 281 for (Node& node : NodeTraversal::descendantsOf(*innerEditor)) { |
| 282 if (node.isTextNode()) |
| 283 continue; |
| 284 ASSERT(isHTMLBRElement(node)); |
| 285 ASSERT(&node == innerEditor->lastChild()); |
| 286 } |
| 287 #endif |
| 288 addPlaceholderBreakElementIfNecessary(); |
| 276 setChangedSinceLastFormControlChangeEvent(true); | 289 setChangedSinceLastFormControlChangeEvent(true); |
| 277 m_valueIsUpToDate = false; | 290 m_valueIsUpToDate = false; |
| 278 setNeedsValidityCheck(); | 291 setNeedsValidityCheck(); |
| 279 setAutofilled(false); | 292 setAutofilled(false); |
| 280 updatePlaceholderVisibility(); | 293 updatePlaceholderVisibility(); |
| 281 | 294 |
| 282 if (!focused()) | 295 if (!focused()) |
| 283 return; | 296 return; |
| 284 | 297 |
| 285 // When typing in a textarea, childrenChanged is not called, so we need to f
orce the directionality check. | 298 // 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 Loading... |
| 649 | 662 |
| 650 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s
ource) | 663 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s
ource) |
| 651 { | 664 { |
| 652 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle
ment&>(source); | 665 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle
ment&>(source); |
| 653 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); | 666 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); |
| 654 m_isDirty = sourceElement.m_isDirty; | 667 m_isDirty = sourceElement.m_isDirty; |
| 655 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); | 668 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); |
| 656 } | 669 } |
| 657 | 670 |
| 658 } // namespace blink | 671 } // namespace blink |
| OLD | NEW |