| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 const bool isImportedScript = contextDocument != elementDocument; | 356 const bool isImportedScript = contextDocument != elementDocument; |
| 357 // http://www.whatwg.org/specs/web-apps/current-work/#execute-the-script-blo
ck step 2.3 | 357 // http://www.whatwg.org/specs/web-apps/current-work/#execute-the-script-blo
ck step 2.3 |
| 358 // with additional support for HTML imports. | 358 // with additional support for HTML imports. |
| 359 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncremente
r(m_isExternalScript || isImportedScript ? contextDocument.get() : 0); | 359 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncremente
r(m_isExternalScript || isImportedScript ? contextDocument.get() : 0); |
| 360 | 360 |
| 361 if (isHTMLScriptLoader(m_element)) | 361 if (isHTMLScriptLoader(m_element)) |
| 362 contextDocument->pushCurrentScript(toHTMLScriptElement(m_element)); | 362 contextDocument->pushCurrentScript(toHTMLScriptElement(m_element)); |
| 363 | 363 |
| 364 AccessControlStatus corsCheck = NotSharableCrossOrigin; | 364 AccessControlStatus corsCheck = NotSharableCrossOrigin; |
| 365 if (!m_isExternalScript || (sourceCode.resource() && sourceCode.resource()->
passesAccessControlCheck(m_element->document().securityOrigin()))) | 365 if (!m_isExternalScript || (sourceCode.resource() && sourceCode.resource()->
passesAccessControlCheck(&m_element->document(), m_element->document().securityO
rigin()))) |
| 366 corsCheck = SharableCrossOrigin; | 366 corsCheck = SharableCrossOrigin; |
| 367 | 367 |
| 368 // Create a script from the script element node, using the script | 368 // Create a script from the script element node, using the script |
| 369 // block's source and the script block's type. | 369 // block's source and the script block's type. |
| 370 // Note: This is where the script is compiled and actually executed. | 370 // Note: This is where the script is compiled and actually executed. |
| 371 frame->script().executeScriptInMainWorld(sourceCode, corsCheck, compilationF
inishTime); | 371 frame->script().executeScriptInMainWorld(sourceCode, corsCheck, compilationF
inishTime); |
| 372 | 372 |
| 373 if (isHTMLScriptLoader(m_element)) { | 373 if (isHTMLScriptLoader(m_element)) { |
| 374 ASSERT(contextDocument->currentScript() == m_element); | 374 ASSERT(contextDocument->currentScript() == m_element); |
| 375 contextDocument->popCurrentScript(); | 375 contextDocument->popCurrentScript(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 if (isHTMLScriptLoader(element)) | 466 if (isHTMLScriptLoader(element)) |
| 467 return toHTMLScriptElement(element)->loader(); | 467 return toHTMLScriptElement(element)->loader(); |
| 468 | 468 |
| 469 if (isSVGScriptLoader(element)) | 469 if (isSVGScriptLoader(element)) |
| 470 return toSVGScriptElement(element)->loader(); | 470 return toSVGScriptElement(element)->loader(); |
| 471 | 471 |
| 472 return 0; | 472 return 0; |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace blink | 475 } // namespace blink |
| OLD | NEW |