Add support for crossorigin attribute in script elements
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 05:29:11 +0000 (05:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 05:29:11 +0000 (05:29 +0000)
commit3657a1995ee2e19c3cbe7ec725183af9b2c54120
tree5b180d6be8916db18b8d5eecf939c97b13883122
parentc7b94a22092cbb338304c3ca375d6a573599464b
Add support for crossorigin attribute in script elements
https://bugs.webkit.org/show_bug.cgi?id=81438

Patch by Pablo Flouret <pablof@motorola.com> on 2012-03-19
Reviewed by Adam Barth.

Source/WebCore:

Works similarly to img and its crossorigin attribute. In the future it
could allow for things like showing full error messages in error
handlers, etc.

Tests: http/tests/security/script-crossorigin-loads-correctly.html
       http/tests/security/script-crossorigin-loads-same-origin.html
       http/tests/security/script-with-failed-cors-check-fails-to-load.html

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::requestScript):
(WebCore::ScriptElement::notifyFinished):
* dom/ScriptElement.h:
(ScriptElement):
* html/HTMLScriptElement.idl:

LayoutTests:

* http/tests/security/resources/alert-fail.js: Added.
* http/tests/security/resources/cors-script.php: Added.
* http/tests/security/script-crossorigin-loads-correctly-expected.txt: Added.
* http/tests/security/script-crossorigin-loads-correctly.html: Added.
* http/tests/security/script-crossorigin-loads-same-origin-expected.txt: Added.
* http/tests/security/script-crossorigin-loads-same-origin.html: Added.
* http/tests/security/script-with-failed-cors-check-fails-to-load-expected.txt: Added.
* http/tests/security/script-with-failed-cors-check-fails-to-load.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/security/resources/alert-fail.js [new file with mode: 0644]
LayoutTests/http/tests/security/resources/cors-script.php [new file with mode: 0644]
LayoutTests/http/tests/security/script-crossorigin-loads-correctly-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/script-crossorigin-loads-correctly.html [new file with mode: 0644]
LayoutTests/http/tests/security/script-crossorigin-loads-same-origin-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/script-crossorigin-loads-same-origin.html [new file with mode: 0644]
LayoutTests/http/tests/security/script-with-failed-cors-check-fails-to-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/script-with-failed-cors-check-fails-to-load.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/dom/ScriptElement.h
Source/WebCore/html/HTMLScriptElement.idl