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) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 void HTMLScriptElement::insertedIntoDocument() | 82 void HTMLScriptElement::insertedIntoDocument() |
83 { | 83 { |
84 HTMLElement::insertedIntoDocument(); | 84 HTMLElement::insertedIntoDocument(); |
85 ScriptElement::insertedIntoDocument(); | 85 ScriptElement::insertedIntoDocument(); |
86 } | 86 } |
87 | 87 |
88 void HTMLScriptElement::setText(const String &value) | 88 void HTMLScriptElement::setText(const String &value) |
89 { | 89 { |
| 90 RefPtr<Node> protectFromMutationEvents(this); |
| 91 |
90 ExceptionCode ec = 0; | 92 ExceptionCode ec = 0; |
91 int numChildren = childNodeCount(); | 93 int numChildren = childNodeCount(); |
92 | 94 |
93 if (numChildren == 1 && firstChild()->isTextNode()) { | 95 if (numChildren == 1 && firstChild()->isTextNode()) { |
94 static_cast<Text*>(firstChild())->setData(value, ec); | 96 static_cast<Text*>(firstChild())->setData(value, ec); |
95 return; | 97 return; |
96 } | 98 } |
97 | 99 |
98 if (numChildren > 0) | 100 if (numChildren > 0) |
99 removeChildren(); | 101 removeChildren(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 178 |
177 dispatchEvent(Event::create(eventNames().loadEvent, false, false)); | 179 dispatchEvent(Event::create(eventNames().loadEvent, false, false)); |
178 } | 180 } |
179 | 181 |
180 PassRefPtr<Element> HTMLScriptElement::cloneElementWithoutAttributesAndChildren(
) | 182 PassRefPtr<Element> HTMLScriptElement::cloneElementWithoutAttributesAndChildren(
) |
181 { | 183 { |
182 return adoptRef(new HTMLScriptElement(tagQName(), document(), false, already
Started())); | 184 return adoptRef(new HTMLScriptElement(tagQName(), document(), false, already
Started())); |
183 } | 185 } |
184 | 186 |
185 } | 187 } |
OLD | NEW |