| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 ScriptLoader::ScriptLoader(Element* element, bool parserInserted, bool alreadySt
arted) | 60 ScriptLoader::ScriptLoader(Element* element, bool parserInserted, bool alreadySt
arted) |
| 61 : m_element(element) | 61 : m_element(element) |
| 62 , m_resource(0) | 62 , m_resource(0) |
| 63 , m_startLineNumber(WTF::OrdinalNumber::beforeFirst()) | 63 , m_startLineNumber(WTF::OrdinalNumber::beforeFirst()) |
| 64 , m_parserInserted(parserInserted) | 64 , m_parserInserted(parserInserted) |
| 65 , m_isExternalScript(false) | 65 , m_isExternalScript(false) |
| 66 , m_alreadyStarted(alreadyStarted) | 66 , m_alreadyStarted(alreadyStarted) |
| 67 , m_haveFiredLoad(false) | 67 , m_haveFiredLoad(false) |
| 68 , m_willBeParserExecuted(false) | 68 , m_willBeParserExecuted(false) |
| 69 , m_readyToBeParserExecuted(false) | 69 , m_readyToBeParserExecuted(false) |
| 70 , m_willExecuteInOrder(false) |
| 70 , m_willExecuteWhenDocumentFinishedParsing(false) | 71 , m_willExecuteWhenDocumentFinishedParsing(false) |
| 71 , m_forceAsync(!parserInserted) | 72 , m_forceAsync(!parserInserted) |
| 72 , m_willExecuteInOrder(false) | |
| 73 { | 73 { |
| 74 ASSERT(m_element); | 74 ASSERT(m_element); |
| 75 if (parserInserted && element->document().scriptableDocumentParser() && !ele
ment->document().isInDocumentWrite()) | 75 if (parserInserted && element->document().scriptableDocumentParser() && !ele
ment->document().isInDocumentWrite()) |
| 76 m_startLineNumber = element->document().scriptableDocumentParser()->line
Number(); | 76 m_startLineNumber = element->document().scriptableDocumentParser()->line
Number(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 ScriptLoader::~ScriptLoader() | 79 ScriptLoader::~ScriptLoader() |
| 80 { | 80 { |
| 81 m_pendingScript.stopWatchingForLoad(this); | 81 m_pendingScript.stopWatchingForLoad(this); |
| 82 } | 82 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 if (client->hasSourceAttribute() && client->deferAttributeValue() && m_parse
rInserted && !client->asyncAttributeValue()) { | 243 if (client->hasSourceAttribute() && client->deferAttributeValue() && m_parse
rInserted && !client->asyncAttributeValue()) { |
| 244 m_willExecuteWhenDocumentFinishedParsing = true; | 244 m_willExecuteWhenDocumentFinishedParsing = true; |
| 245 m_willBeParserExecuted = true; | 245 m_willBeParserExecuted = true; |
| 246 } else if (client->hasSourceAttribute() && m_parserInserted && !client->asyn
cAttributeValue()) { | 246 } else if (client->hasSourceAttribute() && m_parserInserted && !client->asyn
cAttributeValue()) { |
| 247 m_willBeParserExecuted = true; | 247 m_willBeParserExecuted = true; |
| 248 } else if (!client->hasSourceAttribute() && m_parserInserted && !elementDocu
ment.isRenderingReady()) { | 248 } else if (!client->hasSourceAttribute() && m_parserInserted && !elementDocu
ment.isRenderingReady()) { |
| 249 m_willBeParserExecuted = true; | 249 m_willBeParserExecuted = true; |
| 250 m_readyToBeParserExecuted = true; | 250 m_readyToBeParserExecuted = true; |
| 251 } else if (client->hasSourceAttribute() && !client->asyncAttributeValue() &&
!m_forceAsync) { | 251 } else if (client->hasSourceAttribute() && !client->asyncAttributeValue() &&
!m_forceAsync) { |
| 252 m_pendingScript = PendingScript(m_element, m_resource.get()); |
| 252 m_willExecuteInOrder = true; | 253 m_willExecuteInOrder = true; |
| 253 m_pendingScript = PendingScript(m_element, m_resource.get()); | |
| 254 contextDocument->scriptRunner()->queueScriptForExecution(this, ScriptRun
ner::IN_ORDER_EXECUTION); | 254 contextDocument->scriptRunner()->queueScriptForExecution(this, ScriptRun
ner::IN_ORDER_EXECUTION); |
| 255 // Note that watchForLoad can immediately call notifyFinished. | 255 // Note that watchForLoad can immediately call notifyFinished. |
| 256 m_pendingScript.watchForLoad(this); | 256 m_pendingScript.watchForLoad(this); |
| 257 } else if (client->hasSourceAttribute()) { | 257 } else if (client->hasSourceAttribute()) { |
| 258 m_pendingScript = PendingScript(m_element, m_resource.get()); | 258 m_pendingScript = PendingScript(m_element, m_resource.get()); |
| 259 LocalFrame* frame = m_element->document().frame(); | 259 LocalFrame* frame = m_element->document().frame(); |
| 260 if (frame) { | 260 if (frame) { |
| 261 ScriptState* scriptState = ScriptState::forMainWorld(frame); | 261 ScriptState* scriptState = ScriptState::forMainWorld(frame); |
| 262 if (scriptState) | 262 if (scriptState) |
| 263 ScriptStreamer::startStreaming(m_pendingScript, PendingScript::A
sync, frame->settings(), scriptState, frame->frameScheduler()->loadingTaskRunner
()); | 263 ScriptStreamer::startStreaming(m_pendingScript, PendingScript::A
sync, frame->settings(), scriptState, frame->frameScheduler()->loadingTaskRunner
()); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 if (isHTMLScriptLoader(element)) | 513 if (isHTMLScriptLoader(element)) |
| 514 return toHTMLScriptElement(element)->loader(); | 514 return toHTMLScriptElement(element)->loader(); |
| 515 | 515 |
| 516 if (isSVGScriptLoader(element)) | 516 if (isSVGScriptLoader(element)) |
| 517 return toSVGScriptElement(element)->loader(); | 517 return toSVGScriptElement(element)->loader(); |
| 518 | 518 |
| 519 return 0; | 519 return 0; |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace blink | 522 } // namespace blink |
| OLD | NEW |