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 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 ASSERT(m_element); | 70 ASSERT(m_element); |
71 if (parserInserted && m_element->document()->scriptableDocumentParser() && !
m_element->document()->isInDocumentWrite()) | 71 if (parserInserted && m_element->document()->scriptableDocumentParser() && !
m_element->document()->isInDocumentWrite()) |
72 m_startLineNumber = m_element->document()->scriptableDocumentParser()->l
ineNumber(); | 72 m_startLineNumber = m_element->document()->scriptableDocumentParser()->l
ineNumber(); |
73 } | 73 } |
74 | 74 |
75 ScriptElement::~ScriptElement() | 75 ScriptElement::~ScriptElement() |
76 { | 76 { |
77 stopLoadRequest(); | 77 stopLoadRequest(); |
78 } | 78 } |
79 | 79 |
| 80 void ScriptElement::prepareScriptCallback(Element* element) |
| 81 { |
| 82 ASSERT(toScriptElementIfPossible(element)); |
| 83 toScriptElementIfPossible(element)->prepareScript(); |
| 84 } |
| 85 |
80 void ScriptElement::insertedInto(ContainerNode* insertionPoint) | 86 void ScriptElement::insertedInto(ContainerNode* insertionPoint) |
81 { | 87 { |
82 if (insertionPoint->inDocument() && !m_parserInserted) | 88 if (insertionPoint->inDocument() && !m_parserInserted) |
83 prepareScript(); // FIXME: Provide a real starting line number here. | 89 ContainerNode::queueInsertionCallback(prepareScriptCallback, m_element);
// FIXME: Provide a real starting line number here. |
84 } | 90 } |
85 | 91 |
86 void ScriptElement::childrenChanged() | 92 void ScriptElement::childrenChanged() |
87 { | 93 { |
88 if (!m_parserInserted && m_element->inDocument()) | 94 if (!m_parserInserted && m_element->inDocument()) |
89 prepareScript(); // FIXME: Provide a real starting line number here. | 95 prepareScript(); // FIXME: Provide a real starting line number here. |
90 } | 96 } |
91 | 97 |
92 void ScriptElement::handleSourceAttribute(const String& sourceUrl) | 98 void ScriptElement::handleSourceAttribute(const String& sourceUrl) |
93 { | 99 { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 if (isHTMLScriptElement(element)) | 414 if (isHTMLScriptElement(element)) |
409 return toHTMLScriptElement(element); | 415 return toHTMLScriptElement(element); |
410 | 416 |
411 if (isSVGScriptElement(element)) | 417 if (isSVGScriptElement(element)) |
412 return toSVGScriptElement(element); | 418 return toSVGScriptElement(element); |
413 | 419 |
414 return 0; | 420 return 0; |
415 } | 421 } |
416 | 422 |
417 } | 423 } |
OLD | NEW |