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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 for (Node* n = firstChild(); n; n = n->nextSibling()) { | 401 for (Node* n = firstChild(); n; n = n->nextSibling()) { |
402 if (n->isTextNode()) | 402 if (n->isTextNode()) |
403 value.append(toText(n)->data()); | 403 value.append(toText(n)->data()); |
404 } | 404 } |
405 | 405 |
406 return value.toString(); | 406 return value.toString(); |
407 } | 407 } |
408 | 408 |
409 void HTMLTextAreaElement::setDefaultValue(const String& defaultValue) | 409 void HTMLTextAreaElement::setDefaultValue(const String& defaultValue) |
410 { | 410 { |
411 RefPtr<Node> protectFromMutationEvents(this); | 411 RefPtrWillBeRawPtr<Node> protectFromMutationEvents(this); |
412 | 412 |
413 // To preserve comments, remove only the text nodes, then add a single text
node. | 413 // To preserve comments, remove only the text nodes, then add a single text
node. |
414 Vector<RefPtr<Node> > textNodes; | 414 WillBeHeapVector<RefPtrWillBeMember<Node> > textNodes; |
415 for (Node* n = firstChild(); n; n = n->nextSibling()) { | 415 for (Node* n = firstChild(); n; n = n->nextSibling()) { |
416 if (n->isTextNode()) | 416 if (n->isTextNode()) |
417 textNodes.append(n); | 417 textNodes.append(n); |
418 } | 418 } |
419 size_t size = textNodes.size(); | 419 size_t size = textNodes.size(); |
420 for (size_t i = 0; i < size; ++i) | 420 for (size_t i = 0; i < size; ++i) |
421 removeChild(textNodes[i].get(), IGNORE_EXCEPTION); | 421 removeChild(textNodes[i].get(), IGNORE_EXCEPTION); |
422 | 422 |
423 // Normalize line endings. | 423 // Normalize line endings. |
424 String value = defaultValue; | 424 String value = defaultValue; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 { | 561 { |
562 return true; | 562 return true; |
563 } | 563 } |
564 | 564 |
565 bool HTMLTextAreaElement::supportsAutofocus() const | 565 bool HTMLTextAreaElement::supportsAutofocus() const |
566 { | 566 { |
567 return true; | 567 return true; |
568 } | 568 } |
569 | 569 |
570 } | 570 } |
OLD | NEW |