| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 ASSERT(element); | 283 ASSERT(element); |
| 284 return isHTMLScriptElement(*element); | 284 return isHTMLScriptElement(*element); |
| 285 } | 285 } |
| 286 | 286 |
| 287 bool isSVGScriptLoader(Element* element) | 287 bool isSVGScriptLoader(Element* element) |
| 288 { | 288 { |
| 289 ASSERT(element); | 289 ASSERT(element); |
| 290 return isSVGScriptElement(*element); | 290 return isSVGScriptElement(*element); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void ScriptLoader::executeScript(const ScriptSourceCode& sourceCode) | 293 void ScriptLoader::executeScript(const ScriptSourceCode& sourceCode, double* com
pilationFinishTime) |
| 294 { | 294 { |
| 295 ASSERT(m_alreadyStarted); | 295 ASSERT(m_alreadyStarted); |
| 296 | 296 |
| 297 if (sourceCode.isEmpty()) | 297 if (sourceCode.isEmpty()) |
| 298 return; | 298 return; |
| 299 | 299 |
| 300 RefPtrWillBeRawPtr<Document> elementDocument(m_element->document()); | 300 RefPtrWillBeRawPtr<Document> elementDocument(m_element->document()); |
| 301 RefPtrWillBeRawPtr<Document> contextDocument = elementDocument->contextDocum
ent().get(); | 301 RefPtrWillBeRawPtr<Document> contextDocument = elementDocument->contextDocum
ent().get(); |
| 302 if (!contextDocument) | 302 if (!contextDocument) |
| 303 return; | 303 return; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 333 if (isHTMLScriptLoader(m_element)) | 333 if (isHTMLScriptLoader(m_element)) |
| 334 contextDocument->pushCurrentScript(toHTMLScriptElement(m_element)); | 334 contextDocument->pushCurrentScript(toHTMLScriptElement(m_element)); |
| 335 | 335 |
| 336 AccessControlStatus corsCheck = NotSharableCrossOrigin; | 336 AccessControlStatus corsCheck = NotSharableCrossOrigin; |
| 337 if (!m_isExternalScript || (sourceCode.resource() && sourceCode.resource()->
passesAccessControlCheck(m_element->document().securityOrigin()))) | 337 if (!m_isExternalScript || (sourceCode.resource() && sourceCode.resource()->
passesAccessControlCheck(m_element->document().securityOrigin()))) |
| 338 corsCheck = SharableCrossOrigin; | 338 corsCheck = SharableCrossOrigin; |
| 339 | 339 |
| 340 // Create a script from the script element node, using the script | 340 // Create a script from the script element node, using the script |
| 341 // block's source and the script block's type. | 341 // block's source and the script block's type. |
| 342 // Note: This is where the script is compiled and actually executed. | 342 // Note: This is where the script is compiled and actually executed. |
| 343 frame->script().executeScriptInMainWorld(sourceCode, corsCheck); | 343 frame->script().executeScriptInMainWorld(sourceCode, corsCheck, compilationF
inishTime); |
| 344 | 344 |
| 345 if (isHTMLScriptLoader(m_element)) { | 345 if (isHTMLScriptLoader(m_element)) { |
| 346 ASSERT(contextDocument->currentScript() == m_element); | 346 ASSERT(contextDocument->currentScript() == m_element); |
| 347 contextDocument->popCurrentScript(); | 347 contextDocument->popCurrentScript(); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 | 350 |
| 351 void ScriptLoader::stopLoadRequest() | 351 void ScriptLoader::stopLoadRequest() |
| 352 { | 352 { |
| 353 if (m_resource) { | 353 if (m_resource) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 if (isHTMLScriptLoader(element)) | 442 if (isHTMLScriptLoader(element)) |
| 443 return toHTMLScriptElement(element)->loader(); | 443 return toHTMLScriptElement(element)->loader(); |
| 444 | 444 |
| 445 if (isSVGScriptLoader(element)) | 445 if (isSVGScriptLoader(element)) |
| 446 return toSVGScriptElement(element)->loader(); | 446 return toSVGScriptElement(element)->loader(); |
| 447 | 447 |
| 448 return 0; | 448 return 0; |
| 449 } | 449 } |
| 450 | 450 |
| 451 } | 451 } |
| OLD | NEW |