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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 executingDocument->addConsoleMessage(SecurityMessageSource, ErrorMessage Level, "Refused to execute script from '" + m_cachedScript->url().elidedString() + "' because its MIME type ('" + m_cachedScript->mimeType() + "') is not execut able, and strict MIME type checking is enabled."); | 328 executingDocument->addConsoleMessage(SecurityMessageSource, ErrorMessage Level, "Refused to execute script from '" + m_cachedScript->url().elidedString() + "' because its MIME type ('" + m_cachedScript->mimeType() + "') is not execut able, and strict MIME type checking is enabled."); |
329 return; | 329 return; |
330 } | 330 } |
331 | 331 |
332 if (frame) { | 332 if (frame) { |
333 IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountIncre menter(m_isExternalScript ? executingDocument.get() : 0); | 333 IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountIncre menter(m_isExternalScript ? executingDocument.get() : 0); |
334 | 334 |
335 if (isHTMLScriptLoader(m_element)) | 335 if (isHTMLScriptLoader(m_element)) |
336 executingDocument->pushCurrentScript(toHTMLScriptElement(m_element)) ; | 336 executingDocument->pushCurrentScript(toHTMLScriptElement(m_element)) ; |
337 | 337 |
338 ScriptAccessControlCheckStatus corsCheck = ScriptIsNotSharedCrossOrigin; | |
abarth-chromium
2013/08/05 22:31:45
corsCheck -> corsStatus
| |
339 if (!m_element->fastGetAttribute(HTMLNames::crossoriginAttr).isNull() && sourceCode.cachedScript() && sourceCode.cachedScript()->passesAccessControlChec k(m_element->document()->securityOrigin())) | |
abarth-chromium
2013/08/05 22:31:45
I'm worried that we're reading m_element's crossor
Mike West
2013/08/06 06:53:07
That makes sense. I'll take another look at this b
Mike West
2013/08/06 07:54:03
Yup. Tests continue to reflect the behavior we wan
| |
340 corsCheck = ScriptIsSharedCrossOrigin; | |
341 | |
338 // Create a script from the script element node, using the script | 342 // Create a script from the script element node, using the script |
339 // block's source and the script block's type. | 343 // block's source and the script block's type. |
340 // Note: This is where the script is compiled and actually executed. | 344 // Note: This is where the script is compiled and actually executed. |
341 frame->script()->executeScriptInMainWorld(sourceCode); | 345 frame->script()->executeScriptInMainWorld(sourceCode, corsCheck); |
342 | 346 |
343 if (isHTMLScriptLoader(m_element)) { | 347 if (isHTMLScriptLoader(m_element)) { |
344 ASSERT(executingDocument->currentScript() == m_element); | 348 ASSERT(executingDocument->currentScript() == m_element); |
345 executingDocument->popCurrentScript(); | 349 executingDocument->popCurrentScript(); |
346 } | 350 } |
347 } | 351 } |
348 } | 352 } |
349 | 353 |
350 void ScriptLoader::stopLoadRequest() | 354 void ScriptLoader::stopLoadRequest() |
351 { | 355 { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 if (isHTMLScriptLoader(element)) | 443 if (isHTMLScriptLoader(element)) |
440 return toHTMLScriptElement(element)->loader(); | 444 return toHTMLScriptElement(element)->loader(); |
441 | 445 |
442 if (isSVGScriptLoader(element)) | 446 if (isSVGScriptLoader(element)) |
443 return toSVGScriptElement(element)->loader(); | 447 return toSVGScriptElement(element)->loader(); |
444 | 448 |
445 return 0; | 449 return 0; |
446 } | 450 } |
447 | 451 |
448 } | 452 } |
OLD | NEW |