| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 { | 452 { |
| 453 ASSERT(!m_willBeParserExecuted); | 453 ASSERT(!m_willBeParserExecuted); |
| 454 | 454 |
| 455 RefPtrWillBeRawPtr<Document> elementDocument(m_element->document()); | 455 RefPtrWillBeRawPtr<Document> elementDocument(m_element->document()); |
| 456 RefPtrWillBeRawPtr<Document> contextDocument = elementDocument->contextDocum
ent().get(); | 456 RefPtrWillBeRawPtr<Document> contextDocument = elementDocument->contextDocum
ent().get(); |
| 457 if (!contextDocument) | 457 if (!contextDocument) |
| 458 return; | 458 return; |
| 459 | 459 |
| 460 ASSERT_UNUSED(resource, resource == m_resource); | 460 ASSERT_UNUSED(resource, resource == m_resource); |
| 461 | 461 |
| 462 ScriptRunner::ExecutionType runOrder = m_willExecuteInOrder ? ScriptRunner::
IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION; |
| 462 if (m_resource->errorOccurred()) { | 463 if (m_resource->errorOccurred()) { |
| 463 dispatchErrorEvent(); | 464 dispatchErrorEvent(); |
| 464 // dispatchErrorEvent might move the HTMLScriptElement to a new | 465 // dispatchErrorEvent might move the HTMLScriptElement to a new |
| 465 // document. In that case, we must notify the ScriptRunner of the new | 466 // document. In that case, we must notify the ScriptRunner of the new |
| 466 // document, not the ScriptRunner of the old docuemnt. | 467 // document, not the ScriptRunner of the old docuemnt. |
| 467 contextDocument = m_element->document().contextDocument().get(); | 468 contextDocument = m_element->document().contextDocument().get(); |
| 468 if (!contextDocument) | 469 if (!contextDocument) |
| 469 return; | 470 return; |
| 470 contextDocument->scriptRunner()->notifyScriptLoadError(this, m_willExecu
teInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION); | 471 contextDocument->scriptRunner()->notifyScriptLoadError(this, runOrder); |
| 471 return; | 472 return; |
| 472 } | 473 } |
| 473 if (m_willExecuteInOrder) | 474 contextDocument->scriptRunner()->notifyScriptReady(this, runOrder); |
| 474 contextDocument->scriptRunner()->notifyScriptReady(this, ScriptRunner::I
N_ORDER_EXECUTION); | |
| 475 else | |
| 476 contextDocument->scriptRunner()->notifyScriptReady(this, ScriptRunner::A
SYNC_EXECUTION); | |
| 477 | |
| 478 m_pendingScript.stopWatchingForLoad(this); | 475 m_pendingScript.stopWatchingForLoad(this); |
| 479 } | 476 } |
| 480 | 477 |
| 481 bool ScriptLoader::ignoresLoadRequest() const | 478 bool ScriptLoader::ignoresLoadRequest() const |
| 482 { | 479 { |
| 483 return m_alreadyStarted || m_isExternalScript || m_parserInserted || !elemen
t() || !element()->inDocument(); | 480 return m_alreadyStarted || m_isExternalScript || m_parserInserted || !elemen
t() || !element()->inDocument(); |
| 484 } | 481 } |
| 485 | 482 |
| 486 bool ScriptLoader::isScriptForEventSupported() const | 483 bool ScriptLoader::isScriptForEventSupported() const |
| 487 { | 484 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 if (isHTMLScriptLoader(element)) | 516 if (isHTMLScriptLoader(element)) |
| 520 return toHTMLScriptElement(element)->loader(); | 517 return toHTMLScriptElement(element)->loader(); |
| 521 | 518 |
| 522 if (isSVGScriptLoader(element)) | 519 if (isSVGScriptLoader(element)) |
| 523 return toSVGScriptElement(element)->loader(); | 520 return toSVGScriptElement(element)->loader(); |
| 524 | 521 |
| 525 return 0; | 522 return 0; |
| 526 } | 523 } |
| 527 | 524 |
| 528 } // namespace blink | 525 } // namespace blink |
| OLD | NEW |